landsandboat/scripts/items/wild_cookie.lua
claywar 6e4fa2af25
[type] Add type annotations to Item scripts
rename to reflect type definition

Annotate xi.itemUtils.foodOnItemCheck

Make TItemFood functions optional, since the definition does not include types
2024-08-24 18:25:26 -04:00

33 lines
904 B
Lua

-----------------------------------
-- ID: 4577
-- Item: wild_cookie
-- Food Effect: 5Min, All Races
-----------------------------------
-- Aquan killer +12
-- Silence resistance +12
-- MP recovered while healing +5
-----------------------------------
---@type TItemFood
local itemObject = {}
itemObject.onItemCheck = function(target, item, param, caster)
return xi.itemUtils.foodOnItemCheck(target, xi.foodType.BASIC)
end
itemObject.onItemUse = function(target)
target:addStatusEffect(xi.effect.FOOD, 0, 0, 300, 4577)
end
itemObject.onEffectGain = function(target, effect)
target:addMod(xi.mod.AQUAN_KILLER, 12)
target:addMod(xi.mod.SILENCERES, 12)
target:addMod(xi.mod.MPHEAL, 5)
end
itemObject.onEffectLose = function(target, effect)
target:delMod(xi.mod.AQUAN_KILLER, 12)
target:delMod(xi.mod.SILENCERES, 12)
target:delMod(xi.mod.MPHEAL, 5)
end
return itemObject