31 lines
995 B
Lua
31 lines
995 B
Lua
-----------------------------------
|
|
-- ID: 14786
|
|
-- Item: Counter Earring
|
|
-- Item Effect: Counter 5%
|
|
-- Duration: 3 Minutes
|
|
-----------------------------------
|
|
---@type TItem
|
|
local itemObject = {}
|
|
|
|
itemObject.onItemCheck = function(target, item, caster)
|
|
if target:getStatusEffectBySource(xi.effect.ENCHANTMENT, xi.effectSourceType.EQUIPPED_ITEM, xi.item.COUNTER_EARRING) ~= nil then
|
|
target:delStatusEffect(xi.effect.ENCHANTMENT, nil, xi.effectSourceType.EQUIPPED_ITEM, xi.item.COUNTER_EARRING)
|
|
end
|
|
|
|
return 0
|
|
end
|
|
|
|
itemObject.onItemUse = function(target, user)
|
|
if target:hasEquipped(xi.item.COUNTER_EARRING) then
|
|
target:addStatusEffect(xi.effect.ENCHANTMENT, { duration = 180, origin = user, sourceType = xi.effectSourceType.EQUIPPED_ITEM, sourceTypeParam = xi.item.COUNTER_EARRING })
|
|
end
|
|
end
|
|
|
|
itemObject.onEffectGain = function(target, effect)
|
|
effect:addMod(xi.mod.COUNTER, 5)
|
|
end
|
|
|
|
itemObject.onEffectLose = function(target, effect)
|
|
end
|
|
|
|
return itemObject
|