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
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)
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)
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
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"
