pokeemerald/data/scripts/obtain_item.inc

208 lines
5.3 KiB
PHP
Raw Normal View History

Std_ObtainItem:: @ 8271AD3
additem VAR_0x8000, VAR_0x8001
copyvar VAR_0x8007, VAR_RESULT
2019-10-22 23:56:47 +02:00
call EventScript_ObtainItemMessage
return
2019-10-22 23:56:47 +02:00
EventScript_ObtainItemMessage:: @ 8271AE3
bufferitemnameplural 1, VAR_0x8000, VAR_0x8001
checkitemtype VAR_0x8000
2019-10-22 23:56:47 +02:00
call EventScript_BufferPocketNameAndTryFanfare
compare VAR_0x8007, 1
2019-10-22 23:56:47 +02:00
call_if_eq EventScript_ObtainedItem
compare VAR_0x8007, 0
2019-10-22 23:56:47 +02:00
call_if_eq EventScript_NoRoomForItem
return
2019-10-22 23:56:47 +02:00
EventScript_BufferPocketNameAndTryFanfare:: @ 8271B08
switch VAR_RESULT
2019-10-22 23:56:47 +02:00
case POCKET_ITEMS, EventScript_BufferItemsPocket
case POCKET_KEY_ITEMS, EventScript_BufferKeyItemsPocket
case POCKET_POKE_BALLS, EventScript_BufferPokeballsPocket
case POCKET_TM_HM, EventScript_BufferTMHMsPocket
case POCKET_BERRIES, EventScript_BufferBerriesPocket
end
2019-10-22 23:56:47 +02:00
EventScript_BufferItemsPocket:: @ 8271B45
bufferstdstring 2, STDSTRING_ITEMS
compare VAR_0x8007, 1
call_if_eq EventScript_PlayFanfareObtainedItem
return
2019-10-22 23:56:47 +02:00
EventScript_BufferKeyItemsPocket:: @ 8271B55
bufferstdstring 2, STDSTRING_KEYITEMS
compare VAR_0x8007, 1
call_if_eq EventScript_PlayFanfareObtainedItem
return
2019-10-22 23:56:47 +02:00
EventScript_BufferPokeballsPocket:: @ 8271B65
bufferstdstring 2, STDSTRING_POKEBALLS
compare VAR_0x8007, 1
call_if_eq EventScript_PlayFanfareObtainedItem
return
2019-10-22 23:56:47 +02:00
EventScript_BufferTMHMsPocket:: @ 8271B75
bufferstdstring 2, STDSTRING_TMHMS
compare VAR_0x8007, 1
call_if_eq EventScript_PlayFanfareObtainedTMHM
return
2019-10-22 23:56:47 +02:00
EventScript_BufferBerriesPocket:: @ 8271B85
bufferstdstring 2, STDSTRING_BERRIES
compare VAR_0x8007, 1
call_if_eq EventScript_PlayFanfareObtainedItem
return
2019-10-22 23:56:47 +02:00
EventScript_ObtainedItem:: @ 8271B95
message gText_ObtainedTheItem
waitfanfare
msgbox gText_PutItemInPocket, MSGBOX_DEFAULT
setvar VAR_RESULT, 1
return
2019-10-22 23:56:47 +02:00
EventScript_NoRoomForItem:: @ 8271BA9
setvar VAR_RESULT, 0
return
EventScript_PlayFanfareObtainedItem:: @ 8271BAF
playfanfare MUS_FANFA4
return
EventScript_PlayFanfareObtainedTMHM:: @ 8271BB3
playfanfare MUS_ME_WAZA
return
Std_ObtainDecoration:: @ 8271BB7
adddecoration VAR_0x8000
copyvar VAR_0x8007, VAR_RESULT
2019-10-22 23:56:47 +02:00
call EventScript_ObtainDecorationMessage
return
2019-10-22 23:56:47 +02:00
EventScript_ObtainDecorationMessage:: @ 8271BC5
bufferdecorationname 1, VAR_0x8000
compare VAR_0x8007, 1
2019-10-22 23:56:47 +02:00
call_if_eq EventScript_ObtainedDecor
compare VAR_0x8007, 0
2019-10-22 23:56:47 +02:00
call_if_eq EventScript_NoRoomForDecor
return
2019-10-22 23:56:47 +02:00
EventScript_ObtainedDecor:: @ 8271BE0
playfanfare MUS_FANFA4
message gText_ObtainedTheDecor
waitfanfare
msgbox gText_TheDecorWasTransferredToThePC, MSGBOX_DEFAULT
setvar VAR_RESULT, 1
return
2019-10-22 23:56:47 +02:00
EventScript_NoRoomForDecor:: @ 8271BF7
setvar VAR_RESULT, 0
return
Std_FindItem:: @ 8271BFD
lock
faceplayer
waitse
copyvar VAR_0x8004, VAR_0x8000
copyvar VAR_0x8005, VAR_0x8001
checkitemspace VAR_0x8000, VAR_0x8001
copyvar VAR_0x8007, VAR_RESULT
bufferitemnameplural 1, VAR_0x8000, VAR_0x8001
checkitemtype VAR_0x8000
2019-10-22 23:56:47 +02:00
call EventScript_BufferPocketNameAndTryFanfare
compare VAR_0x8007, 1
2019-10-22 23:56:47 +02:00
call_if_eq EventScript_PickUpItem
compare VAR_0x8007, 0
2019-10-22 23:56:47 +02:00
call_if_eq EventScript_NoRoomToPickUpItem
release
return
2019-10-22 23:56:47 +02:00
EventScript_PickUpItem:: @ 8271C3A
removeobject VAR_LAST_TALKED
additem VAR_0x8004, VAR_0x8005
specialvar VAR_RESULT, BufferTMHMMoveName
copyvar VAR_0x8008, VAR_RESULT
compare VAR_0x8008, 1
2019-10-22 23:56:47 +02:00
call_if_eq EventScript_FoundTMHM
compare VAR_0x8008, 0
2019-10-22 23:56:47 +02:00
call_if_eq EventScript_FoundItem
waitfanfare
waitmessage
bufferitemnameplural 1, VAR_0x8004, VAR_0x8005
2019-12-02 15:52:16 +01:00
pyramid_inchallenge
compare VAR_RESULT, 1
2019-10-22 23:56:47 +02:00
goto_if_eq EventScript_PutBattlePyramidItemInBag
msgbox gText_PutItemInPocket, MSGBOX_DEFAULT
return
2019-10-22 23:56:47 +02:00
EventScript_PutBattlePyramidItemInBag:: @ 8271C86
msgbox gText_PlayerPutItemInBag, MSGBOX_DEFAULT
return
2019-10-22 23:56:47 +02:00
EventScript_FoundTMHM:: @ 8271C8F
bufferitemnameplural 0, VAR_0x8004, VAR_0x8005
2019-10-22 23:56:47 +02:00
message gText_PlayerFoundOneTMHM
return
2019-10-22 23:56:47 +02:00
EventScript_FoundItem:: @ 8271C9B
message gText_PlayerFoundOneItem
return
2019-10-22 23:56:47 +02:00
EventScript_NoRoomToPickUpItem:: @ 8271CA1
msgbox gText_ObtainedTheItem, MSGBOX_DEFAULT
msgbox gText_TooBadBagIsFull, MSGBOX_DEFAULT
setvar VAR_RESULT, 0
return
EventScript_HiddenItemScript:: @ 8271CB7
lockall
waitse
additem VAR_0x8005
copyvar VAR_0x8007, VAR_RESULT
bufferitemnameplural 1, VAR_0x8005, 1
checkitemtype VAR_0x8005
2019-10-22 23:56:47 +02:00
call EventScript_BufferPocketNameAndTryFanfare
compare VAR_0x8007, 1
2019-10-22 23:56:47 +02:00
goto_if_eq EventScript_PickUpHiddenItem
compare VAR_0x8007, 0
2019-10-22 23:56:47 +02:00
goto_if_eq EventScript_NoRoomForHiddenItem
end
2019-10-22 23:56:47 +02:00
EventScript_PickUpHiddenItem:: @ 8271CE8
copyvar VAR_0x8008, VAR_0x8004
copyvar VAR_0x8004, VAR_0x8005
specialvar VAR_RESULT, BufferTMHMMoveName
compare VAR_RESULT, 1
2019-10-22 23:56:47 +02:00
goto_if_eq EventScript_FoundHiddenTMHM
compare VAR_RESULT, 0
2019-10-22 23:56:47 +02:00
goto_if_eq EventScript_FoundHiddenItem
end
2019-10-22 23:56:47 +02:00
EventScript_FoundHiddenTMHM:: @ 8271D0E
bufferitemnameplural 0, VAR_0x8004, 1
2019-10-22 23:56:47 +02:00
message gText_PlayerFoundOneTMHM
goto EventScript_PutHiddenItemInPocket
end
2019-10-22 23:56:47 +02:00
EventScript_FoundHiddenItem:: @ 8271D1F
message gText_PlayerFoundOneItem
2019-10-22 23:56:47 +02:00
goto EventScript_PutHiddenItemInPocket
end
2019-10-22 23:56:47 +02:00
EventScript_PutHiddenItemInPocket:: @ 8271D2A
waitmessage
waitfanfare
bufferitemnameplural 1, VAR_0x8004, 1
copyvar VAR_0x8004, VAR_0x8008
msgbox gText_PutItemInPocket, MSGBOX_DEFAULT
2019-10-22 23:56:47 +02:00
special TryPutTreasureInvestigatorsOnAir
special SetHiddenItemFlag
releaseall
end
2019-10-22 23:56:47 +02:00
EventScript_NoRoomForHiddenItem:: @ 8271D47
msgbox gText_PlayerFoundOneItem, MSGBOX_DEFAULT
msgbox gText_TooBadBagIsFull, MSGBOX_DEFAULT
setvar VAR_RESULT, 0
releaseall
end