diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 891c7fd4ed..f5abad6f29 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -2321,3 +2321,9 @@ .macro togglefakertc callnative Script_ToggleFakeRtc .endm + + @ Remove all of specified item from the player's bag + .macro removeallitem itemId:req + callnative RemoveAllItem + .2byte \itemId + .endm diff --git a/src/scrcmd.c b/src/scrcmd.c index 319e667566..955b5e00dd 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -2473,3 +2473,9 @@ void ScriptSetDoubleBattleFlag(struct ScriptContext *ctx) { sIsScriptedWildDouble = TRUE; } + +void RemoveAllItem(struct ScriptContext *ctx) +{ + u16 itemId = VarGet(ScriptReadHalfword(ctx)); + RemoveBagItem(itemId, CountTotalItemQuantityInBag(itemId)); +}