landsandboat/scripts/items/jesters_hat.lua

26 lines
574 B
Lua
Raw Permalink Normal View History

2021-01-18 12:51:02 -05:00
-----------------------------------
-- ID: 11788
2017-11-11 00:34:58 -05:00
-- Item: Jester's Hat
-- Item Effect: Casts Cure II
2021-01-18 12:51:02 -05:00
-----------------------------------
---@type TItem
local itemObject = {}
itemObject.onItemCheck = function(target, item, caster)
return 0
end
itemObject.onItemUse = function(target)
local hpHeal = 90
local dif = target:getMaxHP() - target:getHP()
if hpHeal > dif then
hpHeal = dif
end
target:addHP(hpHeal)
target:updateEnmityFromCure(target, hpHeal)
2021-04-01 15:10:15 -04:00
target:messageBasic(xi.msg.basic.RECOVERS_HP, 0, hpHeal)
end
2021-01-17 11:55:03 -05:00
return itemObject