2021-01-18 12:51:02 -05:00
|
|
|
-----------------------------------
|
2020-10-25 14:26:16 -07:00
|
|
|
-- ID: 5433
|
|
|
|
|
-- Item: Dusty Elixir
|
|
|
|
|
-- Item Effect: Instantly restores 25% of HP and MP
|
2021-01-18 12:51:02 -05:00
|
|
|
-----------------------------------
|
2024-08-24 12:32:37 -04:00
|
|
|
---@type TItem
|
2022-10-06 17:25:46 +03:00
|
|
|
local itemObject = {}
|
2020-10-25 14:26:16 -07:00
|
|
|
|
2026-05-25 20:42:11 -06:00
|
|
|
itemObject.onItemCheck = function(target, item, caster)
|
2020-10-25 14:26:16 -07:00
|
|
|
local result = 0
|
|
|
|
|
local mHP = target:getMaxHP()
|
|
|
|
|
local cHP = target:getHP()
|
|
|
|
|
local mMP = target:getMaxMP()
|
|
|
|
|
local cMP = target:getMP()
|
|
|
|
|
|
2020-10-28 14:17:16 -07:00
|
|
|
if mHP == cHP and mMP == cMP then
|
2020-10-25 14:26:16 -07:00
|
|
|
result = 56 -- Does not let player use item if their hp and mp are full
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return result
|
|
|
|
|
end
|
|
|
|
|
|
2022-10-06 17:25:46 +03:00
|
|
|
itemObject.onItemUse = function(target)
|
2020-10-28 14:17:16 -07:00
|
|
|
target:addHP(target:getMaxHP() * .25)
|
|
|
|
|
target:addMP(target:getMaxMP() * .25)
|
2021-04-01 15:10:15 -04:00
|
|
|
target:messageBasic(xi.msg.basic.RECOVERS_HP_AND_MP)
|
2020-10-25 14:26:16 -07:00
|
|
|
end
|
2021-01-17 11:55:03 -05:00
|
|
|
|
2022-10-06 17:25:46 +03:00
|
|
|
return itemObject
|