I was bingeing Inuyasha, and I thought I could try playing this game. This game is kinda really bad due to very high encounter rate, but that appears to be luck-manipulatable.
I made a script that displays stuff:
Download InuyashaDS.luaLanguage: lua
client.SetGameExtraPadding(0, 0, 200, 0)
local text = gui.pixelText
local image = gui.drawImage
memory.usememorydomain("Main RAM")
local read8 = memory.read_u8
local read16 = memory.read_u16_le
local read24 = memory.read_u24_be
local read32 = memory.read_u32_le
local Addresses = {
--to use ARM 7/9 System Bus, add 02000000 to the addresses
--[[
there's 3 Janis characters
1. Start
2. Spells unlocked
3. Spear unlocked
]]--
Area = 0x0B40C4, --2 bytes; 7 is battle; 579 total
Character_Overworld = 0x0C4A64,
Money = 0x0C4AB0,
-- Janis1_Start = 0x0c6469,0c647c
--Janis without any spells
Janis1_Start = 0x0C6488,
Janis1_Name_Index = 0x0C648C,
Janis1_Is_NPC = 0x0C648D, --1 is npc, 0 is player
Janis1_Item_1 = 0x0C64A4, --4 bytes
Janis1_Item_2 = 0x0C64A8, --4 bytes
Janis1_Item_3 = 0x0C64AC, --4 bytes
Janis1_Item_4 = 0x0C64B0, --4 bytes
Janis1_Item_5 = 0x0C64B4, --4 bytes
Janis1_Item_6 = 0x0C64B8, --4 bytes
Janis1_Item_7 = 0x0C64BC, --4 bytes
Janis1_Item_8 = 0x0C64C0, --4 bytes
Janis1_Item_9 = 0x0C64C4, --4 bytes
Janis1_Item_10 = 0x0C64C8, --4 bytes
Janis1_Equip1 = 0x0C64D0, --Items 1 - 8 binary flag
Janis1_Equip2 = 0x0C64D1, --Items 9 - 10
Janis1_EXP = 0x0C64D6, --2 bytes
Janis1_HP = 0x0C64D8, --2 bytes
Janis1_EP = 0x0C64DA, --2 bytes
Janis1_MAX_HP = 0x0C64DC, --2 bytes
Janis1_MAX_EP = 0x0C64DE, --2 bytes
Janis1_Sprite_ID = 0x0C64E4,
Janis1_Sprite_Pallete = 0x0C64F4,
Janis1_LVL = 0x0C64FC,
Janis1_ATK = 0x0C64FD,
Janis1_DEF = 0x0C64FE,
Janis1_DEX = 0x0C64FF,
Janis1_AGI = 0x0C6500,
Janis1_Select = 0x0C650D, --they are glowing
Janis1_isPresent = 0x0C6510, --he vanishes to fight at 6?
Janis1_Escaped = 0x0C6512,
Janis1_Status = 0x0C6513,
Janis1_Divine_Barrier = 0x0C6517, --how many turns does it last
Janis1_Sealing_Barrier = 0x0C6518, --how many turns does it last
--Janis with spells unlocked
Janis2_Start = 0x0C651C,
Janis2_Name_Index = 0x0C6520,
Janis2_Is_NPC = 0x0C6521, --1 is npc, 0 is player
Janis2_Item_1 = 0x0C6538, --4 bytes
Janis2_Item_2 = 0x0C653C, --4 bytes
Janis2_Item_3 = 0x0C6540, --4 bytes
Janis2_Item_4 = 0x0C6544, --4 bytes
Janis2_Item_5 = 0x0C6548, --4 bytes
Janis2_Item_6 = 0x0C654C, --4 bytes
Janis2_Item_7 = 0x0C6550, --4 bytes
Janis2_Item_8 = 0x0C6554, --4 bytes
Janis2_Item_9 = 0x0C6558, --4 bytes
Janis2_Item_10 = 0x0C655C, --4 bytes
Janis2_Equip1 = 0x0C6564, --Items 1 - 8 binary flag
Janis2_Equip2 = 0x0C6565, --Items 9 - 10
Janis2_EXP = 0x0C656A, --2 bytes
Janis2_HP = 0x0C656C, --2 bytes
Janis2_EP = 0x0C656E, --2 bytes
Janis2_MAX_HP = 0x0C6570, --2 bytes
Janis2_MAX_EP = 0x0C6572, --2 bytes
Janis2_Sprite_ID = 0x0C6578,
Janis2_Sprite_Pallete = 0x0C6588,
Janis2_LVL = 0x0C6590,
Janis2_ATK = 0x0C6591,
Janis2_DEF = 0x0C6592,
Janis2_DEX = 0x0C6593,
Janis2_AGI = 0x0C6594,
Janis2_Select = 0x0C65A1, --they are glowing
Janis2_isPresent = 0x0C65A4, --he vanishes to fight at 6?
Janis2_Escaped = 0x0C65A6,
Janis2_Status = 0x0C65A7,
Janis2_Divine_Barrier = 0x0C65AB, --how many turns does it last
Janis2_Sealing_Barrier = 0x0C65AC, --how many turns does it last
--Janis with spear unlocked
Janis3_Start = 0x0C65B0,
Janis3_Name_Index = 0x0C65B4,
Janis3_Is_NPC = 0x0C65B5, --1 is npc, 0 is player
Janis3_Item_1 = 0x0C65CC, --4 bytes
Janis3_Item_2 = 0x0C65D0, --4 bytes
Janis3_Item_3 = 0x0C65D4, --4 bytes
Janis3_Item_4 = 0x0C65D8, --4 bytes
Janis3_Item_5 = 0x0C65DC, --4 bytes
Janis3_Item_6 = 0x0C65E0, --4 bytes
Janis3_Item_7 = 0x0C65E4, --4 bytes
Janis3_Item_8 = 0x0C65E8, --4 bytes
Janis3_Item_9 = 0x0C65EC, --4 bytes
Janis3_Item_10 = 0x0C65F0, --4 bytes
Janis3_Equip1 = 0x0C65F8, --Items 1 - 8 binary flag
Janis3_Equip2 = 0x0C65F9, --Items 9 - 10
Janis3_EXP = 0x0C65FE, --2 bytes
Janis3_HP = 0x0C6600, --2 bytes
Janis3_EP = 0x0C6602, --2 bytes
Janis3_MAX_HP = 0x0C6604, --2 bytes
Janis3_MAX_EP = 0x0C6606, --2 bytes
Janis3_Sprite_ID = 0x0C660C,
Janis3_Sprite_Pallete = 0x0C661C,
Janis3_LVL = 0x0C6624,
Janis3_ATK = 0x0C6625,
Janis3_DEF = 0x0C6626,
Janis3_DEX = 0x0C6627,
Janis3_AGI = 0x0C6628,
Janis3_Select = 0x0C6635, --they are glowing
Janis3_isPresent = 0x0C6638, --he vanishes to fight at 6?
Janis3_Escaped = 0x0C663A,
Janis3_Status = 0x0C663B,
Janis3_Divine_Barrier = 0x0C663F, --how many turns does it last
Janis3_Sealing_Barrier = 0x0C6640, --how many turns does it last
--Inu Yasha
Inuyasha1_Start = 0x0C6644,
Inuyasha1_Name_Index = 0x0C6648,
Inuyasha1_Is_NPC = 0x0C6649, --1 is npc, 0 is player
Inuyasha1_Item_1 = 0x0C6660, --4 bytes
Inuyasha1_Item_2 = 0x0C6664, --4 bytes
Inuyasha1_Item_3 = 0x0C6668, --4 bytes
Inuyasha1_Item_4 = 0x0C666C, --4 bytes
Inuyasha1_Item_5 = 0x0C6670, --4 bytes
Inuyasha1_Item_6 = 0x0C6674, --4 bytes
Inuyasha1_Item_7 = 0x0C6678, --4 bytes
Inuyasha1_Item_8 = 0x0C667C, --4 bytes
Inuyasha1_Item_9 = 0x0C6680, --4 bytes
Inuyasha1_Item_10 = 0x0C6684, --4 bytes
Inuyasha1_Equip1 = 0x0C668C, --Items 1 - 8 binary flag
Inuyasha1_Equip2 = 0x0C668D, --Items 9 - 10
Inuyasha1_EXP = 0x0C6692, --2 bytes
Inuyasha1_HP = 0x0C6694, --2 bytes
Inuyasha1_EP = 0x0C6696, --2 bytes
Inuyasha1_MAX_HP = 0x0C6698, --2 bytes
Inuyasha1_MAX_EP = 0x0C669A, --2 bytes
Inuyasha1_Sprite_ID = 0x0C66A0,
Inuyasha1_Sprite_Pallete = 0x0C66B0,
Inuyasha1_LVL = 0x0C66B8,
Inuyasha1_ATK = 0x0C66B9,
Inuyasha1_DEF = 0x0C66BA,
Inuyasha1_DEX = 0x0C66BB,
Inuyasha1_AGI = 0x0C66BC,
Inuyasha1_Select = 0x0C66C9, --they are glowing
Inuyasha1_isPresent = 0x0C66CC, --he vanishes to fight at 6?
Inuyasha1_Escaped = 0x0C66CE,
Inuyasha1_Status = 0x0C66CF,
Inuyasha1_Divine_Barrier = 0x0C66D3, --how many turns does it last
Inuyasha1_Sealing_Barrier = 0x0C66D4, --how many turns does it last
--Inu Yasha (Human)
Inuyasha2_Start = 0x0C66D8,
Inuyasha2_Name_Index = 0x0C66DC,
Inuyasha2_Is_NPC = 0x0C66DD, --1 is npc, 0 is player
Inuyasha2_Item_1 = 0x0C66F4, --4 bytes
Inuyasha2_Item_2 = 0x0C66F8, --4 bytes
Inuyasha2_Item_3 = 0x0C66FC, --4 bytes
Inuyasha2_Item_4 = 0x0C6700, --4 bytes
Inuyasha2_Item_5 = 0x0C6704, --4 bytes
Inuyasha2_Item_6 = 0x0C6708, --4 bytes
Inuyasha2_Item_7 = 0x0C670C, --4 bytes
Inuyasha2_Item_8 = 0x0C6710, --4 bytes
Inuyasha2_Item_9 = 0x0C6714, --4 bytes
Inuyasha2_Item_10 = 0x0C6718, --4 bytes
Inuyasha2_Equip1 = 0x0C6720, --Items 1 - 8 binary flag
Inuyasha2_Equip2 = 0x0C6721, --Items 9 - 10
Inuyasha2_EXP = 0x0C6726, --2 bytes
Inuyasha2_HP = 0x0C6728, --2 bytes
Inuyasha2_EP = 0x0C672A, --2 bytes
Inuyasha2_MAX_HP = 0x0C672C, --2 bytes
Inuyasha2_MAX_EP = 0x0C672E, --2 bytes
Inuyasha2_Sprite_ID = 0x0C6734,
Inuyasha2_Sprite_Pallete = 0x0C6744,
Inuyasha2_LVL = 0x0C674C,
Inuyasha2_ATK = 0x0C674D,
Inuyasha2_DEF = 0x0C674E,
Inuyasha2_DEX = 0x0C674F,
Inuyasha2_AGI = 0x0C6750,
Inuyasha2_Select = 0x0C675D, --they are glowing
Inuyasha2_isPresent = 0x0C6760, --he vanishes to fight at 6?
Inuyasha2_Escaped = 0x0C6762,
Inuyasha2_Status = 0x0C6763,
Inuyasha2_Divine_Barrier = 0x0C6767, --how many turns does it last
Inuyasha2_Sealing_Barrier = 0x0C6768, --how many turns does it last
Kagome_Start = 0x0C676C,
Kagome_Name_Index = 0x0C6770,
Kagome_Is_NPC = 0x0C6771, --1 is npc, 0 is player
Kagome_Item_1 = 0x0C6788, --4 bytes
Kagome_Item_2 = 0x0C678C, --4 bytes
Kagome_Item_3 = 0x0C6790, --4 bytes
Kagome_Item_4 = 0x0C6794, --4 bytes
Kagome_Item_5 = 0x0C6798, --4 bytes
Kagome_Item_6 = 0x0C679C, --4 bytes
Kagome_Item_7 = 0x0C67A0, --4 bytes
Kagome_Item_8 = 0x0C67A4, --4 bytes
Kagome_Item_9 = 0x0C67A8, --4 bytes
Kagome_Item_10 = 0x0C67AC, --4 bytes
Kagome_Equip1 = 0x0C67B4, --Items 1 - 8 binary flag
Kagome_Equip2 = 0x0C67B5, --Items 9 - 10
Kagome_EXP = 0x0C67BA, --2 bytes
Kagome_HP = 0x0C67BC, --2 bytes
Kagome_EP = 0x0C67BE, --2 bytes
Kagome_MAX_HP = 0x0C67C0, --2 bytes
Kagome_MAX_EP = 0x0C67C2, --2 bytes
Kagome_Sprite_ID = 0x0C67C8,
Kagome_Sprite_Pallete = 0x0C67D8,
Kagome_LVL = 0x0C67E0,
Kagome_ATK = 0x0C67E1,
Kagome_DEF = 0x0C67E2,
Kagome_DEX = 0x0C67E3,
Kagome_AGI = 0x0C67E4,
Kagome_Select = 0x0C67F1, --they are glowing
Kagome_isPresent = 0x0C67F4, --he vanishes to fight at 6?
Kagome_Escaped = 0x0C67F6,
Kagome_Status = 0x0C67F7,
Kagome_Divine_Barrier = 0x0C67FB, --how many turns does it last
Kagome_Sealing_Barrier = 0x0C67FC, --how many turns does it last
Miroku_Start = 0x0C6800,
Miroku_Name_Index = 0x0C6804,
Miroku_Is_NPC = 0x0C6805, --1 is npc, 0 is player
Miroku_Item_1 = 0x0C681C, --4 bytes
Miroku_Item_2 = 0x0C6820, --4 bytes
Miroku_Item_3 = 0x0C6824, --4 bytes
Miroku_Item_4 = 0x0C6828, --4 bytes
Miroku_Item_5 = 0x0C682C, --4 bytes
Miroku_Item_6 = 0x0C6830, --4 bytes
Miroku_Item_7 = 0x0C6834, --4 bytes
Miroku_Item_8 = 0x0C6838, --4 bytes
Miroku_Item_9 = 0x0C683C, --4 bytes
Miroku_Item_10 = 0x0C6840, --4 bytes
Miroku_Equip1 = 0x0C6848, --Items 1 - 8 binary flag
Miroku_Equip2 = 0x0C6849, --Items 9 - 10
Miroku_EXP = 0x0C684E, --2 bytes
Miroku_HP = 0x0C6850, --2 bytes
Miroku_EP = 0x0C6852, --2 bytes
Miroku_MAX_HP = 0x0C6854, --2 bytes
Miroku_MAX_EP = 0x0C6856, --2 bytes
Miroku_Sprite_ID = 0x0C685C,
Miroku_Sprite_Pallete = 0x0C686C,
Miroku_LVL = 0x0C6874,
Miroku_ATK = 0x0C6875,
Miroku_DEF = 0x0C6876,
Miroku_DEX = 0x0C6877,
Miroku_AGI = 0x0C6878,
Miroku_Select = 0x0C6885, --they are glowing
Miroku_isPresent = 0x0C6888, --he vanishes to fight at 6?
Miroku_Escaped = 0x0C688A,
Miroku_Status = 0x0C688B,
Miroku_Divine_Barrier = 0x0C688F, --how many turns does it last
Miroku_Sealing_Barrier = 0x0C6890, --how many turns does it last
Sango_Start = 0x0C6894,
Sango_Name_Index = 0x0C6898,
Sango_Is_NPC = 0x0C6899, --1 is npc, 0 is player
Sango_Item_1 = 0x0C68B0, --4 bytes
Sango_Item_2 = 0x0C68B4, --4 bytes
Sango_Item_3 = 0x0C68B8, --4 bytes
Sango_Item_4 = 0x0C68BC, --4 bytes
Sango_Item_5 = 0x0C68C0, --4 bytes
Sango_Item_6 = 0x0C68C4, --4 bytes
Sango_Item_7 = 0x0C68C8, --4 bytes
Sango_Item_8 = 0x0C68CC, --4 bytes
Sango_Item_9 = 0x0C68D0, --4 bytes
Sango_Item_10 = 0x0C68D4, --4 bytes
Sango_Equip1 = 0x0C68DC, --Items 1 - 8 binary flag
Sango_Equip2 = 0x0C68DD, --Items 9 - 10
Sango_EXP = 0x0C68E2, --2 bytes
Sango_HP = 0x0C68E4, --2 bytes
Sango_EP = 0x0C68E6, --2 bytes
Sango_MAX_HP = 0x0C68E8, --2 bytes
Sango_MAX_EP = 0x0C68EA, --2 bytes
Sango_Sprite_ID = 0x0C68F0,
Sango_Sprite_Pallete = 0x0C6900,
Sango_LVL = 0x0C6908,
Sango_ATK = 0x0C6909,
Sango_DEF = 0x0C690A,
Sango_DEX = 0x0C690B,
Sango_AGI = 0x0C690C,
Sango_Select = 0x0C6919, --they are glowing
Sango_isPresent = 0x0C691C, --he vanishes to fight at 6?
Sango_Escaped = 0x0C691E,
Sango_Status = 0x0C691F,
Sango_Divine_Barrier = 0x0C6923, --how many turns does it last
Sango_Sealing_Barrier = 0x0C6924, --how many turns does it last
--Alone
Shippo1_Start = 0x0C6928,
Shippo1_Name_Index = 0x0C692C,
Shippo1_Is_NPC = 0x0C692D, --1 is npc, 0 is player
Shippo1_Item_1 = 0x0C6944, --4 bytes
Shippo1_Item_2 = 0x0C6948, --4 bytes
Shippo1_Item_3 = 0x0C694C, --4 bytes
Shippo1_Item_4 = 0x0C6950, --4 bytes
Shippo1_Item_5 = 0x0C6954, --4 bytes
Shippo1_Item_6 = 0x0C6958, --4 bytes
Shippo1_Item_7 = 0x0C695C, --4 bytes
Shippo1_Item_8 = 0x0C6960, --4 bytes
Shippo1_Item_9 = 0x0C6964, --4 bytes
Shippo1_Item_10 = 0x0C6968, --4 bytes
Shippo1_Equip1 = 0x0C6970, --Items 1 - 8 binary flag
Shippo1_Equip2 = 0x0C6971, --Items 9 - 10
Shippo1_EXP = 0x0C6976, --2 bytes
Shippo1_HP = 0x0C6978, --2 bytes
Shippo1_EP = 0x0C697A, --2 bytes
Shippo1_MAX_HP = 0x0C697C, --2 bytes
Shippo1_MAX_EP = 0x0C697E, --2 bytes
Shippo1_Sprite_ID = 0x0C6984,
Shippo1_Sprite_Pallete = 0x0C6994,
Shippo1_LVL = 0x0C699C,
Shippo1_ATK = 0x0C699D,
Shippo1_DEF = 0x0C699E,
Shippo1_DEX = 0x0C699F,
Shippo1_AGI = 0x0C69A0,
Shippo1_Select = 0x0C69AD, --they are glowing
Shippo1_isPresent = 0x0C69B0, --he vanishes to fight at 6?
Shippo1_Escaped = 0x0C69B2,
Shippo1_Status = 0x0C69B3,
Shippo1_Divine_Barrier = 0x0C69B7, --how many turns does it last
Shippo1_Sealing_Barrier = 0x0C69B8, --how many turns does it last
--With Kirara
Shippo2_Start = 0x0C69BC,
Shippo2_Name_Index = 0x0C69C0,
Shippo2_Is_NPC = 0x0C69C1, --1 is npc, 0 is player
Shippo2_Item_1 = 0x0C69D8, --4 bytes
Shippo2_Item_2 = 0x0C69DC, --4 bytes
Shippo2_Item_3 = 0x0C69E0, --4 bytes
Shippo2_Item_4 = 0x0C69E4, --4 bytes
Shippo2_Item_5 = 0x0C69E8, --4 bytes
Shippo2_Item_6 = 0x0C69EC, --4 bytes
Shippo2_Item_7 = 0x0C69F0, --4 bytes
Shippo2_Item_8 = 0x0C69F4, --4 bytes
Shippo2_Item_9 = 0x0C69F8, --4 bytes
Shippo2_Item_10 = 0x0C69FC, --4 bytes
Shippo2_Equip1 = 0x0C6A04, --Items 1 - 8 binary flag
Shippo2_Equip2 = 0x0C6A05, --Items 9 - 10
Shippo2_EXP = 0x0C6A0A, --2 bytes
Shippo2_HP = 0x0C6A0C, --2 bytes
Shippo2_EP = 0x0C6A0E, --2 bytes
Shippo2_MAX_HP = 0x0C6A10, --2 bytes
Shippo2_MAX_EP = 0x0C6A12, --2 bytes
Shippo2_Sprite_ID = 0x0C6A18,
Shippo2_Sprite_Pallete = 0x0C6A28,
Shippo2_LVL = 0x0C6A30,
Shippo2_ATK = 0x0C6A31,
Shippo2_DEF = 0x0C6A32,
Shippo2_DEX = 0x0C6A33,
Shippo2_AGI = 0x0C6A34,
Shippo2_Select = 0x0C6A41, --they are glowing
Shippo2_isPresent = 0x0C6A44, --he vanishes to fight at 6?
Shippo2_Escaped = 0x0C6A46,
Shippo2_Status = 0x0C6A47,
Shippo2_Divine_Barrier = 0x0C6A4B, --how many turns does it last
Shippo2_Sealing_Barrier = 0x0C6A4C, --how many turns does it last
--Shikioni 1
Shikioni1_Item_1 = 0x0C6CBC, --4 bytes
Shikioni1_Item_2 = 0x0C6CC0, --4 bytes
Shikioni1_Item_3 = 0x0C6CC4, --4 bytes
Shikioni1_Item_4 = 0x0C6CC8, --4 bytes
Shikioni1_Item_5 = 0x0C6CCC, --4 bytes
Shikioni1_Item_6 = 0x0C6CD0, --4 bytes
Shikioni1_Item_7 = 0x0C6CD4, --4 bytes
Shikioni1_Item_8 = 0x0C6CD8, --4 bytes
Shikioni1_Item_9 = 0x0C6CDC, --4 bytes
Shikioni1_Item_10 = 0x0C6CE0, --4 bytes
Shikioni1_Equip1 = 0x0C6CE8, --Items 1 - 8 binary flag
Shikioni1_Equip2 = 0x0C6CE9, --Items 9 - 10
Shikioni1_EXP = 0x0C6CEE, --2 bytes
Shikioni1_HP = 0x0C6CF0, --2 bytes
Shikioni1_EP = 0x0C6CF2, --2 bytes
Shikioni1_MAX_HP = 0x0C6CF4, --2 bytes
Shikioni1_MAX_EP = 0x0C6CF6, --2 bytes
Shikioni1_LVL = 0x0C6D14,
Shikioni1_ATK = 0x0C6D15,
Shikioni1_DEF = 0x0C6D16,
Shikioni1_DEX = 0x0C6D17,
Shikioni1_AGI = 0x0C6D18,
Shikioni1_Select = 0x0C6D25, --they are glowing
Shikioni1_Status = 0x0C6D2B,
Shikioni1_Divine_Barrier = 0x0C6D2F, --how many turns does it last
Shikioni1_Sealing_Barrier = 0x0C6D30, --how many turns does it last
Shikioni1_Power_Leaf = 0x0C6D31, --how many turns does it last
--0C6DC8
NPC1_Start = 0x0C6DC8,
NPC1_Name_Index = 0x0C6DCC,
NPC1_Item_1 = 0x0C6DE4, --4 bytes
NPC1_Item_2 = 0x0C6DE8, --4 bytes
NPC1_Item_3 = 0x0C6DEC, --4 bytes
NPC1_Item_4 = 0x0C6DF0, --4 bytes
NPC1_Item_5 = 0x0C6DF4, --4 bytes
NPC1_Item_6 = 0x0C6DF8, --4 bytes
NPC1_Item_7 = 0x0C6DFC, --4 bytes
NPC1_Item_8 = 0x0C6E00, --4 bytes
NPC1_Item_9 = 0x0C6E04, --4 bytes
NPC1_Item_10 = 0x0C6E08, --4 bytes
NPC1_Equip1 = 0x0C6E10, --Items 1 - 8 binary flag
NPC1_Equip2 = 0x0C6E11, --Items 9 - 10
NPC1_EXP = 0x0C6E16, --2 bytes
NPC1_HP = 0x0C6E18, --2 bytes
NPC1_EP = 0x0C6E1A, --2 bytes
NPC1_MAX_HP = 0x0C6E1C, --2 bytes
NPC1_MAX_EP = 0x0C6E1E, --2 bytes
NPC1_Sprite_ID = 0x0C6E24,
NPC1_Sprite_Pallete = 0x0C6E34,
NPC1_LVL = 0x0C6E3C,
NPC1_ATK = 0x0C6E3D,
NPC1_DEF = 0x0C6E3E,
NPC1_DEX = 0x0C6E3F,
NPC1_AGI = 0x0C6E40,
NPC1_Select = 0x0C6E4D, --they are glowing
NPC1_isPresent = 0x0C6E50, --he vanishes to fight at 6?
NPC1_Escaped = 0x0C6E52,
NPC1_Status = 0x0C6E53,
NPC1_Divine_Barrier = 0x0C6E57, --how many turns does it last
NPC1_Sealing_Barrier = 0x0C6E58, --how many turns does it last
NPC1_Power_Leaf = 0x0C6E59, --how many turns does it last
Moon_Phase = 0x107568,
Moon_Step = 0x10756C, --80 steps outdoors a phase
RNG1 = 0x107B98,
RNG2 = 0x107B9C,
Character_Menu = 0x24BF06,
Character_Attacking = 0x24C152,
X = 0x2AD49C,
Y = 0x2AD4A0,
Attack_Selected = 0x2B5E28
}
--[[
Status
7 6 5 4 3 2 1 0
0 Defense
1 Paralysis
2 Poison
3 Blindness
4 Fatigue
]]--
local Attack = {
--value for FUN_02068c64
[1] = {Name = "Attack", EP = 1, Value = 0x00},
[2] = {Name = "Charge", EP = 2, Value = 0},
[3] = {Name = "Shoot", EP = 1, Value = 0},
[4] = {Name = "Defense", EP = 0, Value = 0},
[6] = {Name = "?", EP = 0, Value = 0},
[7] = {Name = "?", EP = 0, Value = 0},
[8] = {Name = "?", EP = 0, Value = 0},
[9] = {Name = "?", EP = 0, Value = 0},
[10] = {Name = "Spirit Up", EP = 0, Value = 0},
[11] = {Name = "Item", EP = 0, Value = 0},
[12] = {Name = "?", EP = 0, Value = 0},
[13] = {Name = "Lightning Arrow", EP = 2, Value = 0x7B},
[14] = {Name = "Infernal Meteor", EP = 3, Value = 0x64},
[15] = {Name = "Heavenly Essence",EP = 3, Value = 0}, --heals
[16] = {Name = "Power Leaf", EP = 2, Value = 0}, --boost attack for 3 turns
[17] = {Name = "Iron Reaver", EP = 2, Value = 0x5F},
[18] = {Name = "Blades Of Blood", EP = 3, Value = 0x5A},
[19] = {"Wind Scar", EP = 4, Value = 0xAF},
[20] = {Name = "Backlash Wave", EP = 5, Value = 0xBE},
[21] = {Name = "Sacred Arrow", EP = 3, Value = 0x87},
[22] = {Name = "Purifying Light", EP = 3, Value = 0}, --Heals status
[23] = {Name = "Divine Barrier", EP = 3, Value = 0},
[24] = {Name = "Wind Tunnel", EP = 5, Value = 0},
[25] = {Name = "Healing Sutra", EP = 3, Value = 0},
[26] = {Name = "Sealing Barrier", EP = 4, Value = 0},
[27] = {Name = "Binding Sutra", EP = 3, Value = 0},
[28] = {Name = "Fury Of Taishaku", EP = 3, Value = 0x6E},
[29] = {Name = "Hiraikotsu", EP = 3, Value = 0x82},
[30] = {Name = "Great Cannon", EP = 3, Value = 0x5A},
[31] = {Name = "Fox Fire", EP = 1, Value = 0x41},
[32] = {Name = "Smashing Top", EP = 2, Value = 0x50},
[33] = {Name = "Smoke Illusion", EP = 2, Value = 0}
}
local Battle = {
Name_Index = {0,0,0,0,0,0,0,0,0,0,0,0,0},
EXP = {0,0,0,0,0,0,0,0,0,0,0,0,0},
HP = {0,0,0,0,0,0,0,0,0,0,0,0,0},
EP = {0,0,0,0,0,0,0,0,0,0,0,0,0},
Max_HP = {0,0,0,0,0,0,0,0,0,0,0,0,0},
Max_EP = {0,0,0,0,0,0,0,0,0,0,0,0,0},
Sprite_ID = {0,0,0,0,0,0,0,0,0,0,0,0,0},
Sprite_ID2 = {0,0,0,0,0,0,0,0,0,0,0,0,0},
Sprite_Palette = {0,0,0,0,0,0,0,0,0,0,0,0,0},
Sprite_Palette2 = {0,0,0,0,0,0,0,0,0,0,0,0,0},
LVL = {0,0,0,0,0,0,0,0,0,0,0,0,0},
ATK = {0,0,0,0,0,0,0,0,0,0,0,0,0},
DEF = {0,0,0,0,0,0,0,0,0,0,0,0,0},
DEX = {0,0,0,0,0,0,0,0,0,0,0,0,0},
AGI = {0,0,0,0,0,0,0,0,0,0,0,0,0}
}
local NPC = {
[0] = { Name = "Iron Dragon Spawn", Sprite_ID = 0x0114, Sprite_Pallete = 0x0114, Width = 80, Height = 76},
[1] = { Name = "Fire Dragon Spawn", Sprite_ID = 0x0114, Sprite_Pallete = 0x0115, Width = 80, Height = 76},
[2] = { Name = "Wandering Spirit", Sprite_ID = 0x0116, Sprite_Pallete = 0x0116, Width = 16, Height = 30},
[3] = { Name = "Lost Soul", Sprite_ID = 0x0116, Sprite_Pallete = 0x0118, Width = 16, Height = 30},
[4] = { Name = "Banshee", Sprite_ID = 0x011A, Sprite_Pallete = 0x011A, Width = 29, Height = 48},
[5] = { Name = "Ten-Eyed Monster", Sprite_ID = 0x011B, Sprite_Pallete = 0x011B, Width = 44, Height = 41},
[6] = { Name = "Disembodied Soul", Sprite_ID = 0x011B, Sprite_Pallete = 0x011C, Width = 44, Height = 41},
[7] = { Name = "Cackling Skull", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[8] = { Name = "Cursed Skull", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[9] = { Name = "Little Devil", Sprite_ID = 0x011D, Sprite_Pallete = 0x011D, Width = 31, Height = 43},
[10] = { Name = "Vile Demon", Sprite_ID = 0x011D, Sprite_Pallete = 0x011E, Width = 31, Height = 43},
[11] = { Name = "Malicious Demon", Sprite_ID = 0x011D, Sprite_Pallete = 0x011F, Width = 31, Height = 43},
[12] = { Name = "Wild Hermit", Sprite_ID = 0x0120, Sprite_Pallete = 0x0120, Width = 50, Height = 65},
[13] = { Name = "Masked Priest", Sprite_ID = 0x0120, Sprite_Pallete = 0x0121, Width = 50, Height = 65},
[14] = { Name = "Demon Handler", Sprite_ID = 0x0122, Sprite_Pallete = 0x0122, Width = 29, Height = 54},
[15] = { Name = "Revenant", Sprite_ID = 0x0122, Sprite_Pallete = 0x0124, Width = 29, Height = 54},
[16] = { Name = "Savage Rat", Sprite_ID = 0x0126, Sprite_Pallete = 0x0126, Width = 28, Height = 32},
[17] = { Name = "Filthy Rat", Sprite_ID = 0x0126, Sprite_Pallete = 0x0127, Width = 28, Height = 32},
[18] = { Name = "Giant Mantis", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[19] = { Name = "Shadow Mantis", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[20] = { Name = "Giant Spider", Sprite_ID = 0x0128, Sprite_Pallete = 0x0128, Width = 29, Height = 26},
[21] = { Name = "Hirasaka Spider", Sprite_ID = 0x0128, Sprite_Pallete = 0x012A, Width = 29, Height = 26},
[22] = { Name = "Sandman", Sprite_ID = 0x012C, Sprite_Pallete = 0x012C, Width = 30, Height = 46},
[23] = { Name = "Sludge", Sprite_ID = 0x012C, Sprite_Pallete = 0x012E, Width = 30, Height = 46},
[24] = { Name = "Wild Bear", Sprite_ID = 0x0130, Sprite_Pallete = 0x0130, Width = 45, Height = 52},
[25] = { Name = "Bloody Bear", Sprite_ID = 0x0130, Sprite_Pallete = 0x0131, Width = 45, Height = 52},
[26] = { Name = "Rock Monkey", Sprite_ID = 0x0132, Sprite_Pallete = 0x0132, Width = 46, Height = 36},
[27] = { Name = "Jizo Monkey", Sprite_ID = 0x0132, Sprite_Pallete = 0x0134, Width = 46, Height = 36},
[28] = { Name = "Iorimaru", Sprite_ID = 0x0136, Sprite_Pallete = 0x0136, Width = 23, Height = 43},
[29] = { Name = "Tosen King", Sprite_ID = 0x0138, Sprite_Pallete = 0x0138, Width = 23, Height = 43},
[30] = { Name = "Senryo", Sprite_ID = 0x013A, Sprite_Pallete = 0x013A, Width = 34, Height = 49},
[31] = { Name = "Manryo", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[32] = { Name = "Tengu", Sprite_ID = 0x013E, Sprite_Pallete = 0x013E, Width = 58, Height = 65},
[33] = { Name = "Dark Tengu", Sprite_ID = 0x013E, Sprite_Pallete = 0x0141, Width = 58, Height = 65},
[34] = { Name = "Wandering Demon", Sprite_ID = 0x0144, Sprite_Pallete = 0x0144, Width = 44, Height = 79},
[35] = { Name = "Iron-Souled Demon", Sprite_ID = 0x0144, Sprite_Pallete = 0x0147, Width = 44, Height = 79},
[36] = { Name = "One-Eyed Priest", Sprite_ID = 0x0144, Sprite_Pallete = 0x014A, Width = 44, Height = 79},
[37] = { Name = "Antero Demon", Sprite_ID = 0x014D, Sprite_Pallete = 0x014D, Width = 40, Height = 55},
[38] = { Name = "Ninestar Demon", Sprite_ID = 0x014D, Sprite_Pallete = 0x014E, Width = 40, Height = 55},
[39] = { Name = "Postero Demon", Sprite_ID = 0x014F, Sprite_Pallete = 0x014F, Width = 35, Height = 56},
[40] = { Name = "Shrouded Demon", Sprite_ID = 0x014F, Sprite_Pallete = 0x0150, Width = 35, Height = 56},
[41] = { Name = "Demon of Misfortune", Sprite_ID = 0x0151, Sprite_Pallete = 0x0151, Width = 50, Height = 111},
[42] = { Name = "Slashing Demon", Sprite_ID = 0x0151, Sprite_Pallete = 0x0156, Width = 50, Height = 111},
[43] = { Name = "Hades Demon", Sprite_ID = 0x0151, Sprite_Pallete = 0x015B, Width = 50, Height = 111},
[44] = { Name = "Saimyosho", Sprite_ID = 0x0160, Sprite_Pallete = 0x0160, Width = 40, Height = 38},
[45] = { Name = "Saimyosho", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[46] = { Name = "Saimyosho", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[47] = { Name = "Saimyosho", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[48] = { Name = "Wind Spirit", Sprite_ID = 0x0167, Sprite_Pallete = 0x0167, Width = 45, Height = 50},
[49] = { Name = "Wind God", Sprite_ID = 0x0167, Sprite_Pallete = 0x0168, Width = 45, Height = 50},
[50] = { Name = "Ice Dragon Spawn", Sprite_ID = 0x0114, Sprite_Pallete = 0x0169, Width = 80, Height = 76},
[51] = { Name = "Light Demon", Sprite_ID = 0x014D, Sprite_Pallete = 0x016A, Width = 40, Height = 55},
[52] = { Name = "Dark Demon", Sprite_ID = 0x014F, Sprite_Pallete = 0x016B, Width = 35, Height = 56},
[53] = { Name = "Akagane", Sprite_ID = 0x016C, Sprite_Pallete = 0x016C, Width = 65, Height = 109},
[54] = { Name = "Akagane", Sprite_ID = 0x016C, Sprite_Pallete = 0x016C, Width = 65, Height = 109},
[55] = { Name = "Akagane", Sprite_ID = 0x016C, Sprite_Pallete = 0x016C, Width = 65, Height = 109},
[56] = { Name = "Burai", Sprite_ID = 0x016F, Sprite_Pallete = 0x016F, Width = 66, Height = 78},
[57] = { Name = "Datara", Sprite_ID = 0x0170, Sprite_Pallete = 0x0170, Width = 55, Height = 106},
[58] = { Name = "Gorai", Sprite_ID = 0x0175, Sprite_Pallete = 0x0175, Width = 35, Height = 67},
[59] = { Name = "Gorai", Sprite_ID = 0x0175, Sprite_Pallete = 0x0175, Width = 35, Height = 67},
[60] = { Name = "Gorai", Sprite_ID = 0x0175, Sprite_Pallete = 0x0175, Width = 35, Height = 67},
[61] = { Name = "Haniwa Golem 1", Sprite_ID = 0x0177, Sprite_Pallete = 0x0177, Width = 23, Height = 36},
[62] = { Name = "Haniwa Golem 2", Sprite_ID = 0x0178, Sprite_Pallete = 0x0178, Width = 25, Height = 27},
[63] = { Name = "Haniwa Golem 3", Sprite_ID = 0x017A, Sprite_Pallete = 0x017A, Width = 64, Height = 48},
[64] = { Name = "Demon Puppet", Sprite_ID = 0x017C, Sprite_Pallete = 0x017C, Width = 80, Height = 80},
[65] = { Name = "Demon Puppet", Sprite_ID = 0x017C, Sprite_Pallete = 0x017C, Width = 80, Height = 80},
[66] = { Name = "Masuko", Sprite_ID = 0x017D, Sprite_Pallete = 0x017D, Width = 121, Height = 116},
[67] = { Name = "Mitsurugi", Sprite_ID = 0x017E, Sprite_Pallete = 0x017E, Width = 37, Height = 44},
[68] = { Name = "Mitsurugi", Sprite_ID = 0x017E, Sprite_Pallete = 0x017E, Width = 37, Height = 44},
[69] = { Name = "Sara", Sprite_ID = 0x0180, Sprite_Pallete = 0x0180, Width = 23, Height = 45},
[70] = { Name = "Sara", Sprite_ID = 0x0180, Sprite_Pallete = 0x0180, Width = 23, Height = 45},
[71] = { Name = "Monk Sen", Sprite_ID = 0x0182, Sprite_Pallete = 0x0182, Width = 33, Height = 61},
[72] = { Name = "Sugagaki", Sprite_ID = 0x0184, Sprite_Pallete = 0x0184, Width = 64, Height = 64},
[73] = { Name = "Sugagaki", Sprite_ID = 0x0184, Sprite_Pallete = 0x0184, Width = 64, Height = 64},
[74] = { Name = "Usuba", Sprite_ID = 0x0187, Sprite_Pallete = 0x0187, Width = 78, Height = 76},
[75] = { Name = "Crash", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[241] = { Name = "Crash", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[242] = { Name = "No name", Sprite_ID = 0x0000, Sprite_Pallete = 0x0000, Width = 255, Height = 255},
[243] = { Name = "Zombie", Sprite_ID = 0x00FA, Sprite_Pallete = 0x00FA, Width = 20, Height = 46},
[244] = { Name = "Zombie 2", Sprite_ID = 0x00FB, Sprite_Pallete = 0x00FB, Width = 48, Height = 64},
[245] = { Name = "Possessed Warrior", Sprite_ID = 0x00FC, Sprite_Pallete = 0x00FC, Width = 23, Height = 42},
[246] = { Name = "Deceased Warrior", Sprite_ID = 0x00FC, Sprite_Pallete = 0x00FE, Width = 23, Height = 42},
[247] = { Name = "Demon Soldier", Sprite_ID = 0x0100, Sprite_Pallete = 0x0100, Width = 59, Height = 35},
[248] = { Name = "Cave Insect", Sprite_ID = 0x0101, Sprite_Pallete = 0x0101, Width = 53, Height = 36},
[249] = { Name = "Rock Insect", Sprite_ID = 0x0101, Sprite_Pallete = 0x0103, Width = 53, Height = 36},
[250] = { Name = "Slimy Bug", Sprite_ID = 0x0101, Sprite_Pallete = 0x0105, Width = 53, Height = 36},
[251] = { Name = "Giant Centipede", Sprite_ID = 0x0107, Sprite_Pallete = 0x0107, Width = 93, Height = 78},
[252] = { Name = "Poisonous Centipede", Sprite_ID = 0x0107, Sprite_Pallete = 0x010A, Width = 93, Height = 78},
[253] = { Name = "Steel Centipede", Sprite_ID = 0x0107, Sprite_Pallete = 0x010D, Width = 93, Height = 78},
[254] = { Name = "Poisonous Child", Sprite_ID = 0x0110, Sprite_Pallete = 0x0110, Width = 20, Height = 33},
[255] = { Name = "Messenger of Hades", Sprite_ID = 0x0110, Sprite_Pallete = 0x0112, Width = 20, Height = 33}
}
--starts from 1, 24BF06 for menu, 0C4A64 for overworld
local Character = {
"Janis 1", --1 start
"Janis 2", --2 spell unlocked
"Janis 3", --3 spear unlocked
"Inuyasha 1", --4 Demon
"Inuyasha 2", --5 Human
"Kagome", --6
"Miroku", --7
"Sango", --8
"Shippo 1", --9 Alone, no Kirara
"Shippo 2", --10 Riding Kirara
--not sure if following are playable
"Kohaku", --11
"Koga", --12
"Tsugumi", --13
"Sesshomaru", --14
"Shiki Demon 1", --15 from start
"Shiki Demon 2", --16 from start
}
--total amount of experience at current level to reach next. So you need 17 xp total to reach level 2 from 1
local XP = {
[1] = 17,
[2] = 49,
[3] = 94,
[4] = 153,
[5] = 231,
[6] = 330,
[7] = 450,
[8] = 590,
[9] = 746,
[10] = 919,
[11] = 1109,
[12] = 1314,
[13] = 1533,
[14] = 1769,
[15] = 2026,
[16] = 2300,
[17] = 2589,
[18] = 2899,
[19] = 3227,
[20] = 3572,
[21] = 3933,
[22] = 4308,
[23] = 4698,
[24] = 5102,
[25] = 5523,
[26] = 5959,
[27] = 6412,
[28] = 6884,
[29] = 7377,
[30] = 7889,
[31] = 8422,
[32] = 8977,
[33] = 9551,
[34] = 10147,
[35] = 10765,
[36] = 11401,
[37] = 12056,
[38] = 12734,
[39] = 13433,
[40] = 14154,
[41] = 14896,
[42] = 15661,
[43] = 16443,
[44] = 17244,
[45] = 18066,
[46] = 18905,
[47] = 19764,
[48] = 20645,
[49] = 21545,
[50] = 22466,
[51] = 23404,
[52] = 24363,
[53] = 25342,
[54] = 26342,
[55] = 27342,
[56] = 28342,
[57] = 29342,
[58] = 30342,
[59] = 31367,
[60] = 32392,
[61] = 33417,
[62] = 34442,
[63] = 35467,
[64] = 36517,
[65] = 37567,
[66] = 38617,
[67] = 39667,
[68] = 40717,
[69] = 41817,
[70] = 42917,
[71] = 44017,
[72] = 45117,
[73] = 46217,
[74] = 47367,
[75] = 48517,
[76] = 49667,
[77] = 50817,
[78] = 51967,
[79] = 53167,
[80] = 54367,
[81] = 55567,
[82] = 56767,
[83] = 57967,
[84] = 59217,
[85] = 60467,
[86] = 61717,
[87] = 62967,
[88] = 64217,
[89] = 65535,
[90] = 0
}
--checks the mouse position during a click relative to the client and see if its within some range
function get_mouse_pos(x,y,width,height)
mx = input.getmouse().X
my = input.getmouse().Y
--input.getmouse() is already relative to client :)
gui.drawRectangle(x, y, width, height, "red", nil) --So I know where the heck are the clickboxes
--subtract 192, since top of bottom screen is y == 0 for mouse Y
if (mx >= x and mx <= x+width) and (my >= y-192 and my <= y+height*2-192) then
return true
end
return false
end
function MLA(A,B,C)
--http://tasvideos.org/forum/viewtopic.php?p=489512#489512
local reslow = A * (B%0x10000) -- A multiplied with lower 16 bits of B
local reshigh = A * (math.floor(B/0x10000)%0x10000) -- A multiplied with higher 16 bits of B (shifted down)
reshigh = reshigh%0x10000 -- only 16 bits can matter here if result is 32 bits
return (reshigh*0x10000 + reslow + C)%0x100000000 -- recombine and cut off to 32 bits
end
function MUL64(A,B)
--http://tasvideos.org/forum/viewtopic.php?p=489523#489523
local reslow = A * (B%0x10000) -- 0x0000LLLLLLLLLLLL
local reshigh = A * math.floor(B/0x10000) -- 0xHHHHHHHHHHHH0000
local reslow_lo = reslow%0x100000000 -- 0x00000000LLLLLLLL
local reslow_hi = math.floor(reslow/0x100000000) -- 0x0000LLLL00000000
local reshigh_lo = reshigh%0x10000 -- 0x00000000HHHH0000
local reshigh_hi = math.floor(reshigh/0x10000) -- 0xHHHHHHHH00000000
local low32 = reshigh_lo*0x10000 + reslow_lo
local high32 = reshigh_hi + reslow_hi
high32 = high32 + math.floor(low32/0x100000000) -- add what carries over
low32 = low32%0x100000000 -- 32 bit
high32 = high32%0x100000000 -- 32 bit
return low32,high32
end
function rng(r0, rng1, rng2)
--020461c4: e59f1050 ldr r1, [pc, #+0x50]
local r1 = 0
local r2, r3 = 0,0
local r4, lr, carry = 0,0,0
local rng1_2, rng2_2 = 0, 0
r4, lr = MUL64(0x6C078965, rng1)
lr = MLA(0x6C078965, rng2, lr)
lr = MLA(0x5D588B65, rng1, lr)
r3 = 0x00269EC3 + r4
carry = r3 > 4294967295 and 1 or 0
rng1_2 = r3 % 4294967296 --107b98
r4 = lr + carry
rng2_2 = r4 --107b9c
if (r0 ~= 0) then
r4 = (r4 * r0) >> 0x20
end
r0 = r4
return r0, rng1_2, rng2_2
end
function update_battle()
local start = Addresses.NPC1_Start --0x94 long
for i = 0, 11 do
Battle.Name_Index[i+1] = read8(start + 0x4 + (i * 0x94))
Battle.EXP[i+1] = read16(start + 0x4E + (i * 0x94))
Battle.HP[i+1] = read16(start + 0x50 + (i * 0x94))
Battle.EP[i+1] = read16(start + 0x52 + (i * 0x94))
Battle.Max_HP[i+1] = read16(start + 0x54 + (i * 0x94))
Battle.Max_EP[i+1] = read16(start + 0x56 + (i * 0x94))
Battle.Sprite_ID[i+1] = read16(start + 0x5C + (i * 0x94))
Battle.Sprite_ID2[i+1] = read8(start + 0x5D + (i * 0x94))
Battle.Sprite_Palette[i+1] = read16(start + 0x6C + (i * 0x94))
Battle.Sprite_Palette2[i+1] = read8(start + 0x6D + (i * 0x94))
Battle.LVL[i+1] = read8(start + 0x74 + (i * 0x94))
Battle.ATK[i+1] = read8(start + 0x75 + (i * 0x94))
Battle.DEF[i+1] = read8(start + 0x76 + (i * 0x94))
Battle.DEX[i+1] = read8(start + 0x77 + (i * 0x94))
Battle.AGI[i+1] = read8(start + 0x78 + (i * 0x94))
end
end
local image_height = 22
function display_battle()
local text_x = 264
local text_y = 8
local name = ""
local image_x = 0
local total_xp = 0
local total_npcs = 0
for i = 1, 13 do
if NPC[Battle.Name_Index[i]] ~= 0 then
if Battle.Sprite_ID[i] == NPC[Battle.Name_Index[i]].Sprite_ID then
total_xp = total_xp + math.floor(Battle.EXP[i]/6)
total_npcs = total_npcs + 1
if NPC[i].Name ~= nil then
name = NPC[Battle.Name_Index[i]].Name
image_width = math.floor(NPC[Battle.Name_Index[i]].Width/(NPC[Battle.Name_Index[i]].Height/image_height))
image_x = (image_width > 29) and text_x-12 or text_x-12+(math.abs(image_width-29)/2)
image(name .. ".png", image_x, text_y, image_width, image_height)
else
name = ""
end
text(text_x + 16,text_y, string.format('%s (%d) EXP: %d', name, Battle.Name_Index[i],math.floor(Battle.EXP[i]/6)))
text_y = text_y + 8
text(text_x + 16,text_y, string.format('%d LV: %d HP: %d/%d EP: %d/%d', i, Battle.LVL[i], Battle.HP[i], Battle.Max_HP[i], Battle.EP[i], Battle.Max_EP[i]))
text_y = text_y + 8
text(text_x + 16,text_y, string.format('ATK: %d DEF: %d DEX: %d AGI: %d EXP: %d', Battle.ATK[i], Battle.DEF[i], Battle.DEX[i], Battle.AGI[i], Battle.EXP[i]))
text_y = text_y + 8
end
end
end
text(text_x,0, string.format("NPCS: %d Total XP: %d", total_npcs, total_xp))
end
-- local toggle = {0,0,1,1,0,1,1,1,0,1}
local toggle = {0,0,0,0,0,0,0,0,0,0}
function display_stats()
local text_x = 260
local text_y = 216
local box_y = 192;
local box_x = {[1] = 0, [2] = 12, [3] = 24, [4] = 36, [5] = 48, [6] = 60, [7] = 72, [8] = 84, [9] = 96, [10] = 108};
local box_width = 8;
local box_height = 8;
local start = Addresses.Janis1_EXP
for i = 1, 10 do
if toggle[i] == 1 then
local XP = read16(start + (i-1) * 0x94)
local HP = read16(start + 0x2 + (i-1) * 0x94)
local EP = read16(start + 0x4 + (i-1) * 0x94)
local Max_HP = read16(start + 0x6 + (i-1) * 0x94)
local Max_EP = read16(start + 0x8 + (i-1) * 0x94)
local LVL = read8(start + 0x26 + (i-1) * 0x94)
local ATK = read8(start + 0x27 + (i-1) * 0x94)
local DEF = read8(start + 0x28 + (i-1) * 0x94)
local DEX = read8(start + 0x29 + (i-1) * 0x94)
local AGI = read8(start + 0x2A + (i-1) * 0x94)
color = "yellow"
text(text_x,text_y, string.format('%s', Character[i]))
text_y = text_y + 8
text(text_x,text_y, string.format('LV: %d HP: %d/%d EP: %d/%d', LVL, HP, Max_HP, EP, Max_EP))
text_y = text_y + 8
text(text_x,text_y, string.format('ATK: %d DEF: %d DEX: %d AGI: %d EXP: %d', ATK, DEF, DEX, AGI, XP))
text_y = text_y + 8
else
color = "green"
end
gui.drawRectangle(box_x[i]+text_x,box_y,box_width,box_height, color, nil)
if (input.getmouse().Left and get_mouse_pos(box_x[i]+text_x,box_y,box_width,box_height)) then
toggle[i] = (toggle[i] == 1 and 0 or 1) --flip them
end
end
end
--0C6E24
local i = 1
console.clear()
update_battle()
-- console.log(string.format('%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d', Battle.Sprite_ID[i], Battle.Sprite_ID2[i], Battle.Sprite_Palette[i], Battle.Sprite_Palette2[i], Battle.EXP[i], Battle.Max_HP[i], Battle.Max_EP[i], Battle.LVL[i], Battle.ATK[i], Battle.DEF[i], Battle.DEX[i], Battle.AGI[i]))
while true do
local text_x = 260
local text_y = 202
local area = read16(Addresses.Area)
local x = read32(Addresses.X)
local y = read32(Addresses.Y)
display_stats()
text(text_x, text_y, string.format('X: %d Y: %d\nArea: %d', x, y, area))
text_y = text_y + 40
-- text(text_x, text_y, string.format('MX: %d MY: %d', input.getmouse().X, input.getmouse().Y))
-- if area == 7 then
update_battle()
display_battle()
-- end
emu.frameadvance()
end
Notes:
1. There's 3 Janis characters. 1st one is from the start. You're completely defenseless, and cannot escape from battle. The 2nd one is after unlocking spells. The last one has a spear.
2. Similarly, there's 2 Inuyasha's (demon/human) and 2 Shippos (with/without Kirara)
3. Every character uses the same XP to next amount. They cap at level 90
4. Attack/Charge is based on your Attack/Dex, and the opponent's DEF. However, specials like Wind Scar is entirely based on your level. Unfortunately, this means you need to grind.
5. I couldn't figure out the NPC ids, but I did record their sprite/pallete
https://docs.google.com/spreadsheets/d/13ly3T8zQA1WYVDUFytGlAuNMhFBxtflyWnkJAUxzjRA/edit?usp=sharing