pokeemerald/data/scripts/apprentice.inc

250 lines
8.0 KiB
PHP
Raw Normal View History

.set LOCALID_APPRENTICE, 6
2021-07-20 21:18:31 +02:00
BattleFrontier_BattleTowerLobby_EventScript_Apprentice::
2018-10-14 11:37:44 +02:00
lock
faceplayer
2019-11-19 17:36:38 +01:00
apprentice_gavelvlmode
goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_FirstMeeting
2019-11-19 17:36:38 +01:00
apprentice_shouldcheckgone
goto_if_eq VAR_0x8004, FALSE, Apprentice_EventScript_AskQuestion @ VAR_0x8004 always TRUE here
2019-11-19 17:36:38 +01:00
goto_if_set FLAG_DAILY_APPRENTICE_LEAVES, Apprentice_EventScript_Gone
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_AskQuestion:
2019-11-19 17:36:38 +01:00
apprentice_getquestion
goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WHICH_MON, Apprentice_EventScript_UseWhichMon
goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WHAT_ITEM, Apprentice_EventScript_UseWhatHeldItem
goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WHICH_MOVE, Apprentice_EventScript_UseWhichMove
goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WHICH_FIRST, Apprentice_EventScript_PutWhichMonFirst
goto_if_eq VAR_RESULT, APPRENTICE_QUESTION_WIN_SPEECH, Apprentice_EventScript_PickWinSpeech
2018-10-14 11:37:44 +02:00
release
releaseall
end
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_FirstMeeting:
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_NAME
2019-11-19 17:36:38 +01:00
apprentice_msg FALSE, APPRENTICE_MSG_PLEASE_TEACH
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_WhichLvlMode:
2018-10-14 14:35:51 +02:00
apprentice_menu APPRENTICE_ASK_YES_NO
goto_if_eq VAR_RESULT, 1, Apprentice_EventScript_RejectTeach
2019-11-19 17:36:38 +01:00
apprentice_msg FALSE, APPRENTICE_MSG_WHICH_LVL_MODE
2018-10-14 14:35:51 +02:00
apprentice_menu APPRENTICE_ASK_WHICH_LEVEL
2019-11-19 17:36:38 +01:00
apprentice_setlvlmode VAR_RESULT
2019-11-20 23:36:52 +01:00
apprentice_shufflespecies
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_LEVEL
2019-11-19 17:36:38 +01:00
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_LVL_MODE
2019-11-20 23:36:52 +01:00
call Apprentice_EventScript_SetHideFlags
2018-10-14 11:37:44 +02:00
release
releaseall
switch VAR_FACING
2019-11-19 17:36:38 +01:00
case DIR_NORTH, Apprentice_EventScript_LeaveNorth
goto Apprentice_EventScript_Leave
2018-10-14 11:37:44 +02:00
end
2019-11-19 17:36:38 +01:00
@ Its impossible to fully reject an Apprentice, they just keep asking for you to teach them
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_RejectTeach:
2019-11-19 17:36:38 +01:00
apprentice_msg FALSE, APPRENTICE_MSG_REJECT
goto Apprentice_EventScript_WhichLvlMode
2018-10-14 11:37:44 +02:00
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_UseWhichMon:
2019-11-19 17:36:38 +01:00
apprentice_initquestion APPRENTICE_QUESTION_WHICH_MON
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES1
apprentice_buff STR_VAR_2, APPRENTICE_BUFF_SPECIES2
2019-11-19 17:36:38 +01:00
apprentice_msg FALSE, APPRENTICE_MSG_WHICH_MON
2018-10-14 14:35:51 +02:00
apprentice_menu APPRENTICE_ASK_2SPECIES
2018-10-14 11:37:44 +02:00
copyvar VAR_0x8005, VAR_RESULT
call_if_eq VAR_0x8005, 0, Apprentice_EventScript_ChoseFirstMon
call_if_eq VAR_0x8005, 1, Apprentice_EventScript_ChoseSecondMon
2019-11-19 17:36:38 +01:00
apprentice_getnumpartymons
apprentice_setpartymon VAR_RESULT
apprentice_answeredquestion
apprentice_getnumpartymons
call_if_eq VAR_RESULT, MULTI_PARTY_SIZE, Apprentice_EventScript_LastMonSelected
apprentice_buff STR_VAR_1, VAR_0x8007
2019-11-19 17:36:38 +01:00
apprentice_freequestion
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MON
2019-11-20 23:36:52 +01:00
call Apprentice_EventScript_SetHideFlags
2018-10-14 11:37:44 +02:00
release
releaseall
switch VAR_FACING
2019-11-19 17:36:38 +01:00
case DIR_NORTH, Apprentice_EventScript_LeaveNorth
goto Apprentice_EventScript_Leave
2018-10-14 11:37:44 +02:00
end
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_ChoseFirstMon:
2019-11-19 17:36:38 +01:00
setvar VAR_0x8007, APPRENTICE_BUFF_SPECIES1
2018-10-14 11:37:44 +02:00
return
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_ChoseSecondMon:
2019-11-19 17:36:38 +01:00
setvar VAR_0x8007, APPRENTICE_BUFF_SPECIES2
2018-10-14 11:37:44 +02:00
return
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_LastMonSelected:
2019-11-20 23:36:52 +01:00
apprentice_randomizequestions
2018-10-14 11:37:44 +02:00
return
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_UseWhatHeldItem:
2019-11-19 17:36:38 +01:00
apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES3
2019-11-19 17:36:38 +01:00
apprentice_msg TRUE, APPRENTICE_MSG_WHAT_HELD_ITEM
apprentice_freequestion
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_ChooseHoldItem:
2019-12-15 17:42:50 +01:00
fadescreen FADE_TO_BLACK
2018-10-14 11:37:44 +02:00
setvar VAR_RESULT, 0
2019-11-19 17:36:38 +01:00
apprentice_openbag
goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_ConfirmHoldNothing
2019-11-20 23:36:52 +01:00
apprentice_trysetitem
goto_if_eq VAR_RESULT, FALSE, Apprentice_EventScript_AlreadySuggestedItem
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_ITEM
2019-11-19 17:36:38 +01:00
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_HELD_ITEM
apprentice_answeredquestion
2019-11-20 23:36:52 +01:00
call Apprentice_EventScript_SetHideFlags
2018-10-14 11:37:44 +02:00
release
releaseall
switch VAR_FACING
2019-11-19 17:36:38 +01:00
case DIR_NORTH, Apprentice_EventScript_LeaveNorth
goto Apprentice_EventScript_Leave
2018-10-14 11:37:44 +02:00
end
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_ConfirmHoldNothing:
2019-11-19 17:36:38 +01:00
apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES3
2019-11-19 17:36:38 +01:00
apprentice_msg FALSE, APPRENTICE_MSG_HOLD_NOTHING
2018-10-14 14:35:51 +02:00
apprentice_menu APPRENTICE_ASK_GIVE
2019-11-19 17:36:38 +01:00
apprentice_freequestion
goto_if_eq VAR_RESULT, 0, Apprentice_EventScript_ChooseHoldItem
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_HoldNothing:
2019-11-19 17:36:38 +01:00
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_NO_HELD_ITEM
apprentice_answeredquestion
2019-11-20 23:36:52 +01:00
call Apprentice_EventScript_SetHideFlags
2018-10-14 11:37:44 +02:00
release
releaseall
switch VAR_FACING
2019-11-19 17:36:38 +01:00
case DIR_NORTH, Apprentice_EventScript_LeaveNorth
goto Apprentice_EventScript_Leave
2018-10-14 11:37:44 +02:00
end
2019-11-20 23:36:52 +01:00
@ Because Battle Tower mons may not hold the same item, the player must suggest a
@ different item if theyve already told the Apprentice to use it for another mon
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_AlreadySuggestedItem:
2019-11-19 17:36:38 +01:00
apprentice_initquestion APPRENTICE_QUESTION_WHAT_ITEM
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_ITEM
apprentice_buff STR_VAR_2, APPRENTICE_BUFF_SPECIES3
2019-11-19 17:36:38 +01:00
apprentice_msg FALSE, APPRENTICE_MSG_ITEM_ALREADY_SUGGESTED
2018-10-14 14:35:51 +02:00
apprentice_menu APPRENTICE_ASK_GIVE
2019-11-19 17:36:38 +01:00
apprentice_freequestion
goto_if_eq VAR_RESULT, 0, Apprentice_EventScript_ChooseHoldItem
2019-11-19 17:36:38 +01:00
goto Apprentice_EventScript_HoldNothing
2018-10-14 11:37:44 +02:00
end
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_UseWhichMove:
2019-11-19 17:36:38 +01:00
apprentice_initquestion APPRENTICE_QUESTION_WHICH_MOVE
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_SPECIES3
apprentice_buff STR_VAR_2, APPRENTICE_BUFF_MOVE1
apprentice_buff STR_VAR_3, APPRENTICE_BUFF_MOVE2
2019-11-19 17:36:38 +01:00
apprentice_msg FALSE, APPRENTICE_MSG_WHICH_MOVE
2018-10-14 14:35:51 +02:00
apprentice_menu APPRENTICE_ASK_MOVES
2018-10-14 11:37:44 +02:00
copyvar VAR_0x8005, VAR_RESULT
call_if_eq VAR_0x8005, 0, Apprentice_EventScript_ChoseMove1
call_if_eq VAR_0x8005, 1, Apprentice_EventScript_ChoseMove2
2019-11-19 17:36:38 +01:00
apprentice_setmove
apprentice_answeredquestion
apprentice_buff STR_VAR_1, VAR_0x8007
2019-11-19 17:36:38 +01:00
apprentice_freequestion
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MOVE
2019-11-20 23:36:52 +01:00
call Apprentice_EventScript_SetHideFlags
2018-10-14 11:37:44 +02:00
release
releaseall
switch VAR_FACING
2019-11-19 17:36:38 +01:00
case DIR_NORTH, Apprentice_EventScript_LeaveNorth
goto Apprentice_EventScript_Leave
2018-10-14 11:37:44 +02:00
end
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_ChoseMove1:
2019-11-19 17:36:38 +01:00
setvar VAR_0x8007, APPRENTICE_BUFF_MOVE1
2018-10-14 11:37:44 +02:00
return
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_ChoseMove2:
2019-11-19 17:36:38 +01:00
setvar VAR_0x8007, APPRENTICE_BUFF_MOVE2
2018-10-14 11:37:44 +02:00
return
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_PutWhichMonFirst:
2019-11-19 17:36:38 +01:00
apprentice_msg FALSE, APPRENTICE_MSG_WHICH_MON_FIRST
2018-10-14 14:35:51 +02:00
apprentice_menu APPRENTICE_ASK_3SPECIES
2019-11-20 23:36:52 +01:00
apprentice_setleadmon VAR_RESULT
2019-11-19 17:36:38 +01:00
apprentice_answeredquestion
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_LEAD_MON_SPECIES
2019-11-19 17:36:38 +01:00
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_MON_FIRST
2019-11-20 23:36:52 +01:00
call Apprentice_EventScript_SetHideFlags
2018-10-14 11:37:44 +02:00
release
releaseall
switch VAR_FACING
2019-11-19 17:36:38 +01:00
case DIR_NORTH, Apprentice_EventScript_LeaveNorth
goto Apprentice_EventScript_Leave
2018-10-14 11:37:44 +02:00
end
2019-11-19 17:36:38 +01:00
@ Last question, after which the Apprentice leaves (and is saved) to be replaced by another
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_PickWinSpeech:
2019-11-19 17:36:38 +01:00
apprentice_msg TRUE, APPRENTICE_MSG_PICK_WIN_SPEECH
2019-11-20 23:36:52 +01:00
apprentice_shiftsaved
2019-02-27 19:45:31 +01:00
setvar VAR_0x8004, EASY_CHAT_TYPE_APPRENTICE
call Common_ShowEasyChatScreen
2018-10-14 11:37:44 +02:00
lock
faceplayer
2019-11-20 23:36:52 +01:00
apprentice_save
apprentice_buff STR_VAR_1, APPRENTICE_BUFF_WIN_SPEECH
2019-11-19 17:36:38 +01:00
apprentice_msg TRUE, APPRENTICE_MSG_THANKS_WIN_SPEECH
apprentice_reset
2019-11-20 23:36:52 +01:00
call Apprentice_EventScript_SetHideFlags
2018-10-14 11:37:44 +02:00
release
releaseall
switch VAR_FACING
2019-11-19 17:36:38 +01:00
case DIR_NORTH, Apprentice_EventScript_LeaveNorth
goto Apprentice_EventScript_Leave
2018-10-14 11:37:44 +02:00
end
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_SetHideFlags:
setflag FLAG_HIDE_APPRENTICE
2019-01-02 22:12:43 +01:00
setflag FLAG_DAILY_APPRENTICE_LEAVES
2018-10-14 11:37:44 +02:00
return
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_LeaveNorth:
2019-11-19 17:36:38 +01:00
apprentice_shouldleave
goto_if_eq VAR_0x8004, FALSE, Apprentice_EventScript_DontMove @ VAR_0x8004 always TRUE here
applymovement LOCALID_APPRENTICE, Apprentice_Movement_LeaveNorth
2018-10-14 11:37:44 +02:00
waitmovement 0
end
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_Leave:
2019-11-19 17:36:38 +01:00
apprentice_shouldleave
goto_if_eq VAR_0x8004, FALSE, Apprentice_EventScript_DontMove @ VAR_0x8004 always TRUE here
applymovement LOCALID_APPRENTICE, Apprentice_Movement_Leave
2018-10-14 11:37:44 +02:00
waitmovement 0
end
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_Gone:
2018-10-14 11:37:44 +02:00
release
releaseall
end
2021-07-20 21:18:31 +02:00
Apprentice_EventScript_DontMove:
2018-10-14 11:37:44 +02:00
end
2021-07-20 21:18:31 +02:00
Apprentice_Movement_LeaveNorth:
2018-10-14 11:37:44 +02:00
walk_fast_right
2021-07-20 21:18:31 +02:00
Apprentice_Movement_Leave:
2018-10-14 11:37:44 +02:00
walk_fast_down
walk_fast_down
walk_fast_right
walk_fast_right
walk_fast_right
walk_fast_right
walk_fast_right
walk_fast_right
walk_fast_right
walk_fast_right
walk_fast_right
set_invisible
slide_down
slide_down
slide_down
step_end