Thread: [Tutorial] XSE Scripting Tutorial
View Single Post
Old 1st March 2018, 10:28 PM  
Avara
Mirage Of Tales Creator
 
Join Date: Nov 2013
Posts: 33
Avara
Default

Pokémon Battle Scripts

First, we're going to learn how to make a wild Pokémon battle, useful for legendary encounters and such. We'll cover trainer battles a little later! The wildbattle command is set up like this:
Quote:
Originally Posted by Avara
wildbattle 0x[Pokémon] 0x[Level In Hex] 0x[Held Item]
Imagine we wanted to battle a level 50 Milotic holding Mystic Water:
Quote:
Originally Posted by Avara
#dynamic 0x800000

#org @main
...
wildbattle 0x149 0x32 0xD1
...
0x149 is Milotic's ID, 0x32 is 50 in hex, and 0xD1 is the item Mystic Water's ID. Click here for Pokémon/Item hex IDs if needed.

Wild Battle Result Check: [FR]
Spoiler:
wildbattle 0x[Pokémon] 0x[Level In Hex] 0x[Held Item]
special2 LASTRESULT 0xB4
compare LASTRESULT 0x1
if 0x1 goto @DefeatedPointer
compare LASTRESULT 0x4
if 0x1 goto @RanPointer
hidesprite LASTTALKED
setflag 0x[OW's Person ID in A-Map]
release
end


Wild Battle Result Check: [EM]
Spoiler:
wildbattle 0x[Pokémon] 0x[Level In Hex] 0x[Held Item]
special2 LASTRESULT 0xB7
compare LASTRESULT 0x1
if 0x1 goto @DefeatedPointer
compare LASTRESULT 0x4
if 0x1 goto @RanPointer
hidesprite LASTTALKED
setflag 0x[OW's Person ID in A-Map]
release
end


Avara is offline   Reply With Quote
Likes Lunos liked this post