Lets say that after beating a champion, you set a flag (I'll use flag 0x210 for this example).
--------------------------------------------------------------
Tutorial for the script event of the wild battle:
The wild battle script won't be activated unless the champion has been defeated (flag 0x210 has been set), so, to do that you will have to:
- For the script event to not activate, use a level script that will set the variable value to 0x1 preferably in the city where the wild battle will initiate
(I'll use variable 0x4011) for this example but, make sure that the variable value in Advance Map is 0x0 (meaning that the event will only activate when variable 0x4011 stores the value 0x0).
-in the same level script I mentioned before, add a command that will check for flag 0x210, and if it is set, go to the part of code where you'll set the variable value to 0x0 so that the script event of the wild battle can activate.
-------------------------------------------------------------
If you want the Jirachi to be a person event where you can interact with it, here's what you will do:
-Give Jirachi a flag number (person ID in Advance Map) (Let's use flag 0x211 as it's person ID)
-Use a level script that will check for flag 0x210 and if it is not set, use command hidesprite and setflag (hidesprite needs person event number, and setflag needs the number of Jirachi's flag), and if the flag is set, go to the part of code where you'll use showsprite and clearflag (showsprite needs person event number and setflag Jirachi's flag number)
Level scripts for hidesprite/showsprite are type 3 level scripts.
------------------------------------------
Here is a little example (for the Jirachi person event)
#dynamic 0x800000
#org @start
checkflag 0x210
if 0x1 goto @ChampionDefeated
hidesprite 0x1 '----------------- (Here I used 0x1, but you have to put the person event number of Jirachi here)
setflag 0x211
end
#org @ChampionDefeated
showsprite 0x1
clearflag 0x211
end
---------------------------------------------