landsandboat/scripts/items/moogle_pie.lua
WinterSolstice8 14427a7f48 [lua] Convert food HP/MP mods to FOOD_HP/FOOD_MP mods
Command used to update files:

find -name "*.lua" -exec bash -c 'grep "xi.effect.FOOD" "{}" && sed -i "s/xi.mod.MP,/xi.mod.FOOD_MP,/g ; s/xi.mod.HP,/xi.mod.FOOD_HP,/g" "{}"' \;
2024-12-06 20:04:59 -07:00

51 lines
1.3 KiB
Lua

-----------------------------------
-- ID: 5561
-- Item: Moogle Pie
-- Food Effect: 3 Hrs, All Races
-----------------------------------
-- HP 20
-- MP 20
-- Strength 1
-- Dexterity 1
-- Vitality 1
-- Agility 1
-- Intelligence 1
-- Mind 1
-- Charisma 1
-----------------------------------
---@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, 10800, 5561)
end
itemObject.onEffectGain = function(target, effect)
target:addMod(xi.mod.FOOD_HP, 20)
target:addMod(xi.mod.FOOD_MP, 20)
target:addMod(xi.mod.STR, 1)
target:addMod(xi.mod.DEX, 1)
target:addMod(xi.mod.VIT, 1)
target:addMod(xi.mod.AGI, 1)
target:addMod(xi.mod.INT, 1)
target:addMod(xi.mod.MND, 1)
target:addMod(xi.mod.CHR, 1)
end
itemObject.onEffectLose = function(target, effect)
target:delMod(xi.mod.FOOD_HP, 20)
target:delMod(xi.mod.FOOD_MP, 20)
target:delMod(xi.mod.STR, 1)
target:delMod(xi.mod.DEX, 1)
target:delMod(xi.mod.VIT, 1)
target:delMod(xi.mod.AGI, 1)
target:delMod(xi.mod.INT, 1)
target:delMod(xi.mod.MND, 1)
target:delMod(xi.mod.CHR, 1)
end
return itemObject