2021-07-20 21:18:31 +02:00
|
|
|
EventScript_StartTrainerApproach::
|
2021-01-26 08:16:26 +01:00
|
|
|
selectapproachingtrainer
|
2021-01-26 10:41:13 +01:00
|
|
|
lockfortrainer
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_TrainerApproach::
|
2021-01-26 10:41:13 +01:00
|
|
|
special PlayTrainerEncounterMusic
|
|
|
|
special DoTrainerApproach
|
2018-12-07 23:50:56 +01:00
|
|
|
waitstate
|
|
|
|
goto EventScript_ShowTrainerIntroMsg
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_TryDoNormalTrainerBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
lock
|
|
|
|
faceplayer
|
|
|
|
applymovement VAR_LAST_TALKED, Movement_RevealTrainer
|
|
|
|
waitmovement 0
|
|
|
|
specialvar VAR_RESULT, GetTrainerFlag
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_ne VAR_RESULT, FALSE, EventScript_NoNormalTrainerBattle
|
2021-01-26 10:41:13 +01:00
|
|
|
special PlayTrainerEncounterMusic
|
|
|
|
special SetTrainerFacingDirection
|
2018-12-07 23:50:56 +01:00
|
|
|
goto EventScript_ShowTrainerIntroMsg
|
2021-01-26 10:41:13 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_NoNormalTrainerBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
gotopostbattlescript
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_TryDoDoubleTrainerBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
lock
|
|
|
|
faceplayer
|
|
|
|
call EventScript_RevealTrainer
|
|
|
|
specialvar VAR_RESULT, GetTrainerFlag
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_ne VAR_RESULT, FALSE, EventScript_NoDoubleTrainerBattle
|
2018-12-07 23:50:56 +01:00
|
|
|
special HasEnoughMonsForDoubleBattle
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_ne VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS, EventScript_NotEnoughMonsForDoubleBattle
|
2021-01-26 10:41:13 +01:00
|
|
|
special PlayTrainerEncounterMusic
|
|
|
|
special SetTrainerFacingDirection
|
2018-12-07 23:50:56 +01:00
|
|
|
goto EventScript_ShowTrainerIntroMsg
|
2021-01-26 10:41:13 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_NotEnoughMonsForDoubleBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
special ShowTrainerCantBattleSpeech
|
|
|
|
waitmessage
|
|
|
|
waitbuttonpress
|
|
|
|
release
|
|
|
|
end
|
2021-01-26 10:41:13 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_NoDoubleTrainerBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
gotopostbattlescript
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_DoNoIntroTrainerBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
applymovement VAR_LAST_TALKED, Movement_RevealTrainer
|
|
|
|
waitmovement 0
|
2021-01-26 10:41:13 +01:00
|
|
|
special PlayTrainerEncounterMusic
|
2021-11-18 06:32:28 +01:00
|
|
|
dotrainerbattle
|
2018-12-07 23:50:56 +01:00
|
|
|
gotopostbattlescript
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_TryDoRematchBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
call EventScript_RevealTrainer
|
|
|
|
specialvar VAR_RESULT, IsTrainerReadyForRematch
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_eq VAR_RESULT, FALSE, EventScript_NoRematchTrainerBattle
|
2021-01-26 10:41:13 +01:00
|
|
|
special PlayTrainerEncounterMusic
|
|
|
|
special SetTrainerFacingDirection
|
2018-12-07 23:50:56 +01:00
|
|
|
special ShowTrainerIntroSpeech
|
|
|
|
waitmessage
|
|
|
|
waitbuttonpress
|
|
|
|
special BattleSetup_StartRematchBattle
|
|
|
|
waitstate
|
|
|
|
releaseall
|
|
|
|
end
|
2021-01-26 10:41:13 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_NoRematchTrainerBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
gotopostbattlescript
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_TryDoDoubleRematchBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
specialvar VAR_RESULT, IsTrainerReadyForRematch
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_eq VAR_RESULT, FALSE, EventScript_NoDoubleRematchTrainerBattle
|
2018-12-07 23:50:56 +01:00
|
|
|
special HasEnoughMonsForDoubleBattle
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_ne VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS, EventScript_NotEnoughMonsForDoubleRematchBattle
|
2021-01-26 10:41:13 +01:00
|
|
|
special PlayTrainerEncounterMusic
|
|
|
|
special SetTrainerFacingDirection
|
2018-12-07 23:50:56 +01:00
|
|
|
special ShowTrainerIntroSpeech
|
|
|
|
waitmessage
|
|
|
|
waitbuttonpress
|
|
|
|
special BattleSetup_StartRematchBattle
|
|
|
|
waitstate
|
|
|
|
releaseall
|
|
|
|
end
|
2021-01-26 10:41:13 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_NoDoubleRematchTrainerBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
gotopostbattlescript
|
2021-01-26 10:41:13 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_NotEnoughMonsForDoubleRematchBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
special ShowTrainerCantBattleSpeech
|
|
|
|
waitmessage
|
|
|
|
waitbuttonpress
|
|
|
|
release
|
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_RevealTrainer::
|
2018-12-07 23:50:56 +01:00
|
|
|
applymovement VAR_LAST_TALKED, Movement_RevealTrainer
|
|
|
|
waitmovement 0
|
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
Movement_RevealTrainer:
|
2018-12-07 23:50:56 +01:00
|
|
|
reveal_trainer
|
|
|
|
step_end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_ShowTrainerIntroMsg::
|
2018-12-07 23:50:56 +01:00
|
|
|
special ShowTrainerIntroSpeech
|
|
|
|
waitmessage
|
|
|
|
waitbuttonpress
|
|
|
|
special TryPrepareSecondApproachingTrainer
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_eq VAR_RESULT, TRUE, EventScript_TrainerApproach
|
2018-12-07 23:50:56 +01:00
|
|
|
goto EventScript_DoTrainerBattle
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_DoTrainerBattle::
|
2021-11-18 06:32:28 +01:00
|
|
|
dotrainerbattle
|
2020-03-03 20:47:14 +01:00
|
|
|
@ Below battle mode check only needed in FRLG
|
2018-12-07 23:50:56 +01:00
|
|
|
specialvar VAR_RESULT, GetTrainerBattleMode
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_eq VAR_RESULT, TRAINER_BATTLE_SINGLE, EventScript_EndTrainerBattle
|
|
|
|
goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT, EventScript_EndTrainerBattle
|
|
|
|
goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC, EventScript_EndTrainerBattle
|
|
|
|
goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE, EventScript_EndTrainerBattle
|
|
|
|
goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC, EventScript_EndTrainerBattle
|
2021-07-20 21:18:31 +02:00
|
|
|
EventScript_EndTrainerBattle::
|
2018-12-07 23:50:56 +01:00
|
|
|
gotobeatenscript
|
|
|
|
releaseall
|
|
|
|
end
|
2020-01-11 18:02:58 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
Std_MsgboxAutoclose::
|
2021-11-16 16:53:18 +01:00
|
|
|
message NULL
|
2020-01-11 18:02:58 +01:00
|
|
|
waitmessage
|
|
|
|
waitbuttonpress
|
|
|
|
release
|
|
|
|
return
|