Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/home/give.asm
1270 views
1
GiveItem::
2
; Give player quantity c of item b,
3
; and copy the item's name to wStringBuffer.
4
; Return carry on success.
5
ld a, b
6
ld [wNamedObjectIndex], a
7
ld [wCurItem], a
8
ld a, c
9
ld [wItemQuantity], a
10
ld hl, wNumBagItems
11
call AddItemToInventory
12
ret nc
13
call GetItemName
14
call CopyToStringBuffer
15
scf
16
ret
17
18
GivePokemon::
19
; Give the player monster b at level c.
20
ld a, b
21
ld [wCurPartySpecies], a
22
ld a, c
23
ld [wCurEnemyLevel], a
24
xor a ; PLAYER_PARTY_DATA
25
ld [wMonDataLocation], a
26
farjp _GivePokemon
27
28