43 lines
1.1 KiB
Lua
43 lines
1.1 KiB
Lua
-----------------------------------
|
|
-- ID: 5875
|
|
-- Item: Galette Des Rois
|
|
-- Food Effect: 180 Min, All Races
|
|
-----------------------------------
|
|
-- HP +8
|
|
-- MP +3% (cap13)
|
|
-- Intelligence +2
|
|
-- Random Jewel
|
|
-----------------------------------
|
|
---@type TItem
|
|
local itemObject = {}
|
|
|
|
itemObject.onItemCheck = function(target, item, caster)
|
|
local result = 0
|
|
if target:hasStatusEffect(xi.effect.FOOD) then
|
|
result = xi.msg.basic.IS_FULL
|
|
end
|
|
|
|
if target:getFreeSlotsCount() == 0 then
|
|
result = xi.msg.basic.ITEM_NO_USE_INVENTORY
|
|
end
|
|
|
|
return result
|
|
end
|
|
|
|
itemObject.onItemUse = function(target, user, item, action)
|
|
target:addStatusEffect(xi.effect.FOOD, { duration = 10800, origin = user, sourceType = xi.effectSourceType.FOOD, sourceTypeParam = item:getID() })
|
|
local rand = math.random(784, 815)
|
|
npcUtil.giveItem(target, { { rand, 1 } })
|
|
end
|
|
|
|
itemObject.onEffectGain = function(target, effect)
|
|
effect:addMod(xi.mod.FOOD_HP, 8)
|
|
effect:addMod(xi.mod.FOOD_MPP, 3)
|
|
effect:addMod(xi.mod.FOOD_MP_CAP, 13)
|
|
effect:addMod(xi.mod.INT, 2)
|
|
end
|
|
|
|
itemObject.onEffectLose = function(target, effect)
|
|
end
|
|
|
|
return itemObject
|