#dynamic 0x800000
//---------------
#org @start
lock
faceplayer
call @snippet1
release
end
[B]//---------------
#org @snippet1
msgbox @string1 MSG_KEEPOPEN //"Welcome to our POKéMON CENTER!\pPl..."
closeonkeypress
setvar 0x8004 0x0 [color=red]// This will first check the Pokémon in the 1st Slot of the Player's party.[/color]
goto @snippet2
//---------------
#org @snippet2
compare 0x8004 0x6 [color=red]// If the script is going to check the (non-existent) 7th slot, instead go to @snippet3.[/color]
if 0x1 goto @snippet3
special2 LASTRESULT 0x65 [color=red]// Otherwise, check the HP of the Pokémon in the current slot.[/color]
compare LASTRESULT 0x0 [color=red]// If the HP is equal to 0...[/color]
if 0x1 call @snippet4 [color=red]// ...then call @snippet4[/color]
addvar 0x8004 0x1 [color=red]// Move onto the next slot...[/color]
goto @snippet2 [color=red]// ...and repeat the process.[/color]
//---------------
#org @snippet3
compare 0x8005 0x1
if 0x0 call @snippet5 [color=red]// If a Pokémon hasn't been erased, then call @snippet5.[/color]
goto @snippet6 [color=red]// Go to @snippet6[/color]
//---------------
#org @snippet4
special 0x62 [color=red]// Erase the party Pokémon in the current slot.[/color]
setvar 0x8005 0x1 [color=red]// Tell the script that at least one Pokémon has been erased.[/color]
return [color=red]// Go back to @snippet2.[/color]
//---------------
#org @snippet5
msgbox @string2 MSG_FACE //"Oh, you don't have any fainted Pok..." [color=red]// Display a congratulatory message for not sucking at keeping your Pokémon alive.[/color]
return [color=red]// Go back to @snippet3, essentially to go to @snippet6, which is just the normal Pokémon Center script.[/color]
[/B]
//---------------
#org @snippet6
special 0x187
compare LASTRESULT 0x2
if 0x1 goto @snippet7
preparemsg @string3 //"Now, would you like me to\nheal yo..."
waitmsg
multichoice 0x13 0x8 0x0 0x2
copyvar 0x8000 LASTRESULT
compare 0x8000 0x0
if 0x1 goto @snippet8
compare 0x8000 0x1
if 0x1 goto @snippet9
compare 0x8000 0x7F
if 0x1 goto @snippet9
end
//---------------
#org @snippet7
release
end
//---------------
#org @snippet8
cmdc3 0xF
preparemsg @string4 //"Okay, I'll take your POKéMON for a..."
waitmsg
call @snippet10
special 0x169
goto @snippet11
//---------------
#org @snippet9
msgbox @string5 MSG_KEEPOPEN //"We hope to see you again!"
return
//---------------
#org @snippet10
applymovement LASTTALKED @move1
waitmovement 0x0
doanimation 0x19
checkanimation 0x19
applymovement LASTTALKED @move2
waitmovement 0x0
special 0x0
return
//---------------
#org @snippet11
special2 LASTRESULT 0x1B1
compare LASTRESULT 0x0
if 0x1 goto @snippet12
special2 LASTRESULT 0x183
copyvar 0x8008 LASTRESULT
compare 0x8008 0x0
if 0x1 goto @snippet12
compare 0x8008 0x1
if 0x1 goto @snippet13
end
//---------------
#org @snippet12
preparemsg @string6 //"Thank you for waiting.\nWe've rest..."
waitmsg
applymovement LASTTALKED @move3
waitmovement 0x0
msgbox @string5 MSG_KEEPOPEN //"We hope to see you again!"
return
//---------------
#org @snippet13
checkflag 0x842
if 0x1 goto @snippet12
msgbox @string6 MSG_KEEPOPEN //"Thank you for waiting.\nWe've rest..."
setflag 0x842
preparemsg @string7 //"It appears as if [buffer1] is play..."
waitmsg
applymovement LASTTALKED @move3
waitmovement 0x0
msgbox @string5 MSG_KEEPOPEN //"We hope to see you again!"
return
//---------
// Strings
//---------
[B]#org @string1
= Welcome to our POKéMON CENTER!\pPlease hand over any fainted\nPOKéMON you have.\pIt's the POKéMON LEAGUE's new\npolicy that any fainted POKéMON\lare to be permanently confiscated.
#org @string2
= Oh, you don't have any fainted Pokémon?\nThat's great!
#org @string3
= Now, would you like me to\nheal your POKéMON back to\lperfect health?[/B]
#org @string4
= Okay, I'll take your POKéMON for a\nfew seconds.
#org @string5
= We hope to see you again!
#org @string6
= Thank you for waiting.\nWe've restored your POKéMON to\lfull health.
#org @string7
= It appears as if [buffer1] is playing\nright now.\lGo for it!
//-----------
// Movements
//-----------
#org @move1
#raw 0x2F //Face Left (Delayed)
#raw 0xFE //End of Movements
#org @move2
#raw 0x2D //Face Down (Delayed)
#raw 0xFE //End of Movements
#org @move3
#raw 0x5B //mov5B
#raw 0x1A //Delay3
#raw 0xFE //End of Movements