landsandboat/scripts/items/prominence_axe.lua
2026-02-20 18:42:33 -07:00

36 lines
1.2 KiB
Lua

-----------------------------------
-- ID:18220
-- Item: Prominence Axe
-- Enchantment: Enfire
-- Duration: 3 minutes
-----------------------------------
---@type TItem
local itemObject = {}
itemObject.onItemCheck = function(target, user)
if target:getStatusEffectBySource(xi.effect.ENFIRE, xi.effectSourceType.EQUIPPED_ITEM, xi.item.PROMINENCE_AXE) ~= nil then
target:delStatusEffect(xi.effect.ENFIRE, nil, xi.effectSourceType.EQUIPPED_ITEM, xi.item.PROMINENCE_AXE)
end
return 0
end
itemObject.onItemUse = function(target, user)
if target:hasEquipped(xi.item.PROMINENCE_AXE) then
local effect = xi.effect.ENFIRE
local magicskill = target:getSkillLevel(xi.skill.ENHANCING_MAGIC)
local potency = 0
if magicskill <= 200 then
potency = 3 + math.floor(6 * magicskill / 100)
elseif magicskill > 200 then
potency = 5 + math.floor(5 * magicskill / 100)
end
potency = utils.clamp(potency, 3, 25)
target:addStatusEffect(effect, { power = potency, duration = 180, origin = user, sourceType = xi.effectSourceType.EQUIPPED_ITEM, sourceTypeParam = xi.item.PROMINENCE_AXE })
end
end
return itemObject