landsandboat/scripts/items/wizard_cookie.lua
2025-10-05 21:12:24 -06:00

33 lines
976 B
Lua

-----------------------------------
-- ID: 4576
-- Item: wizard_cookie
-- Food Effect: 5Min, All Races
-----------------------------------
-- MP Recovered While Healing 7
-- Plantoid Killer 12
-- Slow Resist 12
-----------------------------------
---@type TItemFood
local itemObject = {}
itemObject.onItemCheck = function(target, item, param, caster)
return xi.itemUtils.foodOnItemCheck(target, xi.foodType.BASIC)
end
itemObject.onItemUse = function(target, user, item, action)
target:addStatusEffect(xi.effect.FOOD, 0, 0, 300, 0, 0, 0, xi.effectSourceType.FOOD, item:getID(), user:getID())
end
itemObject.onEffectGain = function(target, effect)
target:addMod(xi.mod.MPHEAL, 7)
target:addMod(xi.mod.PLANTOID_KILLER, 12)
target:addMod(xi.mod.SLOWRES, 12)
end
itemObject.onEffectLose = function(target, effect)
target:delMod(xi.mod.MPHEAL, 7)
target:delMod(xi.mod.PLANTOID_KILLER, 12)
target:delMod(xi.mod.SLOWRES, 12)
end
return itemObject