This is probably more useful to post here than just on discord:
RNG for encounters, items, and criticals is 0xCE04 System Bus
While I'm not sure what exactly is this type of RNG, I do know that it seems to be the only determinant for criticals, so I recorded all 65,535 values possible for if it gave a critical or not, then made it display using lua:
https://cdn.discordapp.com/attachments/698993369321308240/1004226153680211968/hp1_data.lua
Language: lua
memory.usememorydomain("System Bus")
client.SetGameExtraPadding(0, 0, 60, 144)
local Boss = {'Malfoy','Giant Rat v2','Troll','Ogre','Purple Rabbit','Chickens','Rook','Knight Piece','Knight Piece 2','Devils Snare','Quirrell','Voldermort','Giant Rat','Knight','Easy XP'}
local hp1_data = require 'hp1 data'
local Critical = hp1_data.RNG
local Addresses = hp1_data.Addresses
--[[
Monsters in battle are offset 0xA2 of each other
0xC4B8,0xC55A,0xC5FC is HP
0xC46A,0xC50C,0xC5AE is X
0xC46D,0xC50F,0xC5B1 is Y
0xC48A,0xC52C,0xC5CE is Sprite (not ID!)
This is needed since they technically don't have a "fixed" location; monster 1 can appear in top middle or bottom.
All little endian
]]--
local Deck = {'Gregory the Swarmy','Justus Pilliwickle','Merwyn the Malicious','Gulliver Pokeby'}
local text
local read8
local read16
local read32
console.clear()
if vba then
text = gui.text
read8 = memory.readbyteunsigned
read16 = memory.readwordunsigned
read32 = memory.readlongunsigned
else
text = gui.pixelText
memory.usememorydomain("System Bus")
read8 = memory.read_u8
read16 = memory.read_u16_le
read32 = memory.read_u32_le
end
while true do
local boss_id = memory.readbyte(Addresses.boss_id)
local boss_name = Boss[boss_id]
local yes = memory.readbyte(Addresses.yes,"WRAM")
local x = read16(Addresses.x)
local y = read16(Addresses.y)
local text_y = 17+130
local rng = read16(Addresses.rng)
local deck_id = read8(Addresses.deck_id)
local game_state = read8(Addresses.game_state) % 128
local message_timer = read8(Addresses.message_timer)
local in_battle = game_state >= 25 and game_state <= 33
local color = "white"
text(0, text_y + (7 * 5),'Yes: '..yes)
for i = 0,40 do
if Critical[rng+i] == "Yes" then color = "Green" else color = "white" end
text(160, 0 + 7 * (i), (rng+i)%65535 .."\t"..Critical[(rng+i)%65535],color)
end
if in_battle then
text(0, text_y,'State: '.. game_state) --Game state for debugging
text(0, text_y + 7, 'RNG: '.. rng)
text(0, text_y + (7 * 2), 'X: '.. x ..' Y: '.. y)
for i = 1, 3 do
local monster_x = read16(Addresses.monster.x[i])
local monster_y = read16(Addresses.monster.y[i])
local monster_hp = read16(Addresses.monster.hp[i])
text(monster_x, monster_y, monster_hp)
end
else
text(0, text_y, 'X: '.. x ..' Y: '.. y)
text(0, text_y + 7, 'RNG: '.. rng)
text(0, text_y + (7 * 2), 'Msg: '.. message_timer) -- The player cannot press A to continue until the countdown is finished.
text(0, text_y + (7 * 3),'Deck: '..Deck[(deck_id+1)%5])
if boss_name ~= nil then
text(0,75, 'Boss: '..boss_name..'('..boss_id..')')
end
--[[
Game state for battles:
25 - Battle transit (includes using cards)
26 - Your turn
28 - Spells
29 - Items
30 - Item used
31 - Flee
32 - Enemy attacks
33 - Select enemies and attack
34 - Win screen
42 - Cards (same if you use not in battle)
68 - Debug
end]]--
text(0, text_y + (7 * 4),'State: '..read8(0xFFD2)%128)
end
emu.frameadvance()
end
Just attack when the upper right number is green and says "Yes"