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

54 lines
1.5 KiB
Lua

-----------------------------------
-- ID: 4411
-- Item: dhalmel_pie
-- Food Effect: 30Min, All Races
-----------------------------------
-- Health 25
-- Strength 4
-- Agility 2
-- Vitality 1
-- Intelligence -2
-- Mind 1
-- Attack % 25
-- Attack Cap 45
-- Ranged ATT % 25
-- Ranged ATT Cap 45
-----------------------------------
---@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, 1800, 0, 0, 0, xi.effectSourceType.FOOD, item:getID(), user:getID())
end
itemObject.onEffectGain = function(target, effect)
target:addMod(xi.mod.FOOD_HP, 25)
target:addMod(xi.mod.STR, 4)
target:addMod(xi.mod.AGI, 2)
target:addMod(xi.mod.VIT, 1)
target:addMod(xi.mod.INT, -2)
target:addMod(xi.mod.MND, 1)
target:addMod(xi.mod.FOOD_ATTP, 25)
target:addMod(xi.mod.FOOD_ATT_CAP, 45)
target:addMod(xi.mod.FOOD_RATTP, 25)
target:addMod(xi.mod.FOOD_RATT_CAP, 45)
end
itemObject.onEffectLose = function(target, effect)
target:delMod(xi.mod.FOOD_HP, 25)
target:delMod(xi.mod.STR, 4)
target:delMod(xi.mod.AGI, 2)
target:delMod(xi.mod.VIT, 1)
target:delMod(xi.mod.INT, -2)
target:delMod(xi.mod.MND, 1)
target:delMod(xi.mod.FOOD_ATTP, 25)
target:delMod(xi.mod.FOOD_ATT_CAP, 45)
target:delMod(xi.mod.FOOD_RATTP, 25)
target:delMod(xi.mod.FOOD_RATT_CAP, 45)
end
return itemObject