summaryrefslogtreecommitdiff
path: root/engine/events/misc_scripts.asm
diff options
context:
space:
mode:
authorIIMarckus <iimarckus@gmail.com>2020-02-09 02:20:05 -0700
committerIIMarckus <iimarckus@gmail.com>2020-02-09 02:20:05 -0700
commita7e3a999ff21ecac0bfbe7f091f9ff901075a323 (patch)
tree8032e91c6a426b355b6d1d3505bbc1fdc9c40fa6 /engine/events/misc_scripts.asm
parentd561a6d2db176240549fa605dc3e7e1f59e86607 (diff)
parent0543e933915a65127a8b803789d049478c7889d5 (diff)
Merge https://github.com/libjet/pokegold
Diffstat (limited to 'engine/events/misc_scripts.asm')
-rwxr-xr-xengine/events/misc_scripts.asm55
1 files changed, 55 insertions, 0 deletions
diff --git a/engine/events/misc_scripts.asm b/engine/events/misc_scripts.asm
new file mode 100755
index 00000000..f9ba459f
--- /dev/null
+++ b/engine/events/misc_scripts.asm
@@ -0,0 +1,55 @@
+Script_AbortBugContest:
+ checkflag ENGINE_BUG_CONTEST_TIMER
+ iffalse .finish
+ setflag ENGINE_DAILY_BUG_CONTEST
+ special ContestReturnMons
+.finish
+ end
+
+FindItemInBallScript::
+ callasm .TryReceiveItem
+ iffalse .no_room
+ disappear LAST_TALKED
+ opentext
+ writetext .FoundItemText
+ playsound SFX_ITEM
+ pause 60
+ itemnotify
+ closetext
+ end
+
+.no_room
+ opentext
+ writetext .FoundItemText
+ waitbutton
+ writetext .CantCarryItemText
+ waitbutton
+ closetext
+ end
+
+.FoundItemText:
+ text_far _FoundItemText
+ db "@"
+
+.CantCarryItemText:
+ text_far _CantCarryItemText
+ db "@"
+
+.TryReceiveItem:
+ xor a
+ ld [wScriptVar], a
+ ld a, [wcf29]
+ ld [wDeciramBuffer], a
+ call GetItemName
+ ld hl, wStringBuffer3
+ call CopyName2
+ ld a, [wcf29]
+ ld [wd002], a
+ ld a, [wcf2a]
+ ld [wItemQuantityChangeBuffer], a
+ ld hl, wNumItems
+ call ReceiveItem
+ ret nc
+ ld a, $1
+ ld [wScriptVar], a
+ ret \ No newline at end of file