summaryrefslogtreecommitdiff
path: root/events/misc_scripts.asm
diff options
context:
space:
mode:
authorRemy Oukaour <remy.oukaour@gmail.com>2017-12-26 21:55:57 -0500
committerRemy Oukaour <remy.oukaour@gmail.com>2017-12-26 21:55:57 -0500
commitdae16acd6f4e2e2c177e3776be6ed549af070c4f (patch)
tree2577502f3ccc185e772ef121ba52fa3fddfd95c2 /events/misc_scripts.asm
parent2a565f747ccb8099f4057548a6d598d538e6b991 (diff)
event/ → events/, and move some appropriate engine/ files there
Diffstat (limited to 'events/misc_scripts.asm')
-rwxr-xr-xevents/misc_scripts.asm62
1 files changed, 62 insertions, 0 deletions
diff --git a/events/misc_scripts.asm b/events/misc_scripts.asm
new file mode 100755
index 000000000..97372a57a
--- /dev/null
+++ b/events/misc_scripts.asm
@@ -0,0 +1,62 @@
+Script_AbortBugContest: ; 0x122c1
+ checkflag ENGINE_BUG_CONTEST_TIMER
+ iffalse .finish
+ setflag ENGINE_DAILY_BUG_CONTEST
+ special ContestReturnMons
+.finish
+ end
+
+FindItemInBallScript:: ; 0x122ce
+ callasm .TryReceiveItem
+ iffalse .no_room
+ disappear LAST_TALKED
+ opentext
+ writetext .text_found
+ playsound SFX_ITEM
+ pause 60
+ itemnotify
+ closetext
+ end
+; 0x122e3
+
+.no_room ; 0x122e3
+ opentext
+ writetext .text_found
+ waitbutton
+ writetext .text_bag_full
+ waitbutton
+ closetext
+ end
+; 0x122ee
+
+.text_found ; 0x122ee
+ ; found @ !
+ text_jump UnknownText_0x1c0a1c
+ db "@"
+; 0x122f3
+
+.text_bag_full ; 0x122f3
+ ; But can't carry any more items.
+ text_jump UnknownText_0x1c0a2c
+ db "@"
+; 0x122f8
+
+.TryReceiveItem: ; 122f8
+ xor a
+ ld [ScriptVar], a
+ ld a, [EngineBuffer1]
+ ld [wNamedObjectIndexBuffer], a
+ call GetItemName
+ ld hl, StringBuffer3
+ call CopyName2
+ ld a, [EngineBuffer1]
+ ld [CurItem], a
+ ld a, [CurFruit]
+ ld [wItemQuantityChangeBuffer], a
+ ld hl, NumItems
+ call ReceiveItem
+ ret nc
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+; 12324