Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2021-01-31 21:08:32

eddieweppler
New member
From: Germany
Registered: 2018-05-25
Post 3/3

Sweet Honey as Item from Bag

I'm recently fiddling with the item effects and here's a usable Sweet Honey from your menu
(acts like Sweet Scent, but as an usable item!)

first, add the obvious data:
constants/item_constants.asm
data/items/names.asm
data/items/descriptions.asm

data/items/attributes.asm
item_attribute 200, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE

ITEMMENU_CLOSE is needed, since we want the item to be used, close the menu, and then summon a wild battle

don't forget to remove the changed item from catch_rate_items.asm!


after the necessary stuff, go to engine/items/item_effects.asm

replace the NoEffect of your replaced item with HoneyEffect
go all the way down to the end of the item_effects.asm file and add:

HoneyEffect:
ld hl, .SweetHoney
call QueueScript
ld a, [wItemEffectSucceeded]
cp 1
call z, UseDisposableItem ; removes the Sweet Honey from the menu
ret

.SweetHoney:
reloadmappart
special UpdateTimePals
callasm GetPartyNick
writetext UnknownText_0x70000
waitbutton
callasm SweetHoneyEncounter
iffalse SweetHoneyNothing
checkflag ENGINE_BUG_CONTEST_TIMER ; important, or not usable in Bug Contests
iftrue .BugCatchingContest
randomwildmon
startbattle
reloadmapafterbattle
end

.BugCatchingContest:
farsjump BugCatchingContestBattleScript

SweetHoneyNothing:
writetext UnknownText_0x7002b
waitbutton
closetext
end

SweetHoneyEncounter:
farcall CanUseSweetScent ; copy of the SweetScent effect to load a wild encounter
jr nc, .no_battle
farcall GetMapEncounterRate ; wild encounter of the current map
ld a, b
and a
jr z, .no_battle
farcall ChooseWildEncounter
jr nz, .no_battle
jr .start_battle

.not_in_bug_contest
farcall ChooseWildEncounter_BugContest

.start_battle
ld a, $1
ld [wScriptVar], a
ret

.no_battle
xor a
ld [wScriptVar], a
ld [wBattleType], a
ret

UnknownText_0x70000:
; <PLAYER> used SWEET HONEY!
text_far UnknownText_0x1d0000
text_end

UnknownText_0x7002b:
; Looks like there's nothing here…
text_far UnknownText_0x1d002b
text_end


afterwards, go to data/text/common_2.asm
we will add the new text when the player uses sweet honey

add this somewhere in the .asm (I added it after the Sweet Scent text (line 582)


UnknownText_0x1d0000::
text "<PLAYER> used"
line "SWEET HONEY!"
done

UnknownText_0x1d002b::
text "Looks like there's"
line "nothing here…"
done


and thats it! usable from the menu, attracts a wild pokemon,
and nothing happens when we use it outside of grass / a cave

Offline

Board footer

Powered by FluxBB