Added removeallitem

This commit is contained in:
pkmnsnfrn 2024-08-10 14:43:50 -07:00
parent 113f8de9b1
commit 73953b3e39
2 changed files with 12 additions and 0 deletions

View file

@ -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

View file

@ -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));
}