landsandboat/scripts/items/dominus_shield.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

24 lines
556 B
Lua

-----------------------------------
-- ID: 14491
-- Item: Dominus Shield
-- Item Effect: Restores 20-35 MP
-----------------------------------
---@type TItem
local itemObject = {}
itemObject.onItemCheck = function(target, item, param, caster)
return 0
end
itemObject.onItemUse = function(target)
local mpHeal = math.random(60, 85)
local dif = target:getMaxMP() - target:getMP()
if mpHeal > dif then
mpHeal = dif
end
target:addMP(mpHeal)
target:messageBasic(xi.msg.basic.RECOVERS_MP, 0, mpHeal)
end
return itemObject