Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --NatureCheck by Collector Togami
- --Please select what game you are playing below to handle the offsets. At this time
- --this program only supports ENG versions of RBY.
- Yellow=0
- NotYellow=1
- GameVersion=NotYellow
- PartyStart=0x0000D178+GameVersion
- PartySize=0x0000D162+GameVersion
- WildStart=0x0000CFF0
- --Checks the currently playing audio track to see if we're in a wild fight or not
- AmIFacingWild=0xC027
- WildSong=0xF0
- --This offset may not be constant across other languages
- PartyOffset=44
- StartingY=10
- --Thanks to MKDasher for this
- local naturename={
- "Hardy","Lonely","Brave","Adamant","Naughty",
- "Bold","Docile","Relaxed","Impish","Lax",
- "Timid","Hasty","Serious","Jolly","Naive",
- "Modest","Mild","Quiet","Bashful","Rash",
- "Calm","Gentle","Sassy","Careful","Quirky"}
- while true do
- counter=1
- currentParty=PartyStart
- currentY=StartingY
- party=memory.readbyte(PartySize)
- while party > -1 do
- GoalHit=false
- --After the entire party has been read, check the opposing pokemon
- if party == 0 then
- currentParty=WildStart
- end
- --Not the best way to get exp but it will do for now
- natureNum = memory.readbyte(currentParty)*0x10000
- natureNum = natureNum + memory.readbyte(currentParty+1)*0x100
- natureNum = natureNum + memory.readbyte(currentParty+2)
- natureNum = natureNum % 25
- DeFactoIVs=memory.readwordunsigned(currentParty+13)
- if DeFactoIVs == 0xAAA2 then GoalHit = true
- elseif DeFactoIVs == 0xAAA3 then GoalHit = true
- elseif DeFactoIVs == 0xAAA6 then GoalHit = true
- elseif DeFactoIVs == 0xAAA7 then GoalHit = true
- elseif DeFactoIVs == 0xAAAA then GoalHit = true
- elseif DeFactoIVs == 0xAAAB then GoalHit = true
- elseif DeFactoIVs == 0xAAAE then GoalHit = true
- elseif DeFactoIVs == 0xAAAF then GoalHit = true
- end
- if GoalHit == true then isShiny=" SHINY"
- elseif GoalHit == false then isShiny=""
- end
- if counter > memory.readbyte(PartySize) then
- if memory.readbyte(AmIFacingWild) == WildSong then
- gui.text(5,currentY,"W" ..". "..naturename[natureNum+1]..isShiny)
- end
- end
- if counter <= memory.readbyte(PartySize) then
- gui.text(5,currentY, counter ..". "..naturename[natureNum+1]..isShiny)
- end
- party = party - 1
- counter = counter + 1
- currentParty=currentParty+PartyOffset
- currentY=currentY+10
- end
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement