2021-01-18 12:51:02 -05:00
|
|
|
-----------------------------------
|
2018-09-27 22:30:57 -05:00
|
|
|
-- ID: 18243
|
|
|
|
|
-- Item: Astral Pot
|
|
|
|
|
-- Item Effect: Pet Magical Attack +22
|
|
|
|
|
-- Duration 5 Minutes
|
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 = {}
|
2018-09-27 22:30:57 -05:00
|
|
|
|
2026-05-25 20:42:11 -06:00
|
|
|
itemObject.onItemCheck = function(target, item, caster)
|
2018-09-27 22:30:57 -05:00
|
|
|
local pet = target:getPet()
|
|
|
|
|
if not pet then
|
2021-04-01 15:10:15 -04:00
|
|
|
return xi.msg.basic.REQUIRES_A_PET, 0
|
2024-11-13 10:45:49 -05:00
|
|
|
elseif target:getStatusEffectBySource(xi.effect.ENCHANTMENT, xi.effectSourceType.EQUIPPED_ITEM, xi.item.ASTRAL_POT) ~= nil then
|
|
|
|
|
target:delStatusEffect(xi.effect.ENCHANTMENT, nil, xi.effectSourceType.EQUIPPED_ITEM, xi.item.ASTRAL_POT)
|
2018-09-27 22:30:57 -05:00
|
|
|
end
|
2022-11-22 14:45:21 -05:00
|
|
|
|
2018-09-27 22:30:57 -05:00
|
|
|
return 0
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-19 22:48:02 -07:00
|
|
|
itemObject.onItemUse = function(target, user)
|
2024-11-13 10:45:49 -05:00
|
|
|
local pet = target:getPet()
|
|
|
|
|
if target:hasEquipped(xi.item.ASTRAL_POT) and pet ~= nil then
|
2026-02-19 22:48:02 -07:00
|
|
|
target:addStatusEffect(xi.effect.ENCHANTMENT, { duration = 300, origin = user, sourceType = xi.effectSourceType.EQUIPPED_ITEM, sourceTypeParam = xi.item.ASTRAL_POT })
|
2024-11-13 10:45:49 -05:00
|
|
|
end
|
2018-09-27 22:30:57 -05:00
|
|
|
end
|
|
|
|
|
|
2022-10-06 17:25:46 +03:00
|
|
|
itemObject.onEffectGain = function(target, effect)
|
2018-09-27 22:30:57 -05:00
|
|
|
local pet = target:getPet()
|
2024-08-24 18:24:41 -04:00
|
|
|
if not pet then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
2021-04-01 15:10:15 -04:00
|
|
|
pet:addMod(xi.mod.MATT, 22)
|
2018-09-27 22:30:57 -05:00
|
|
|
end
|
|
|
|
|
|
2022-10-06 17:25:46 +03:00
|
|
|
itemObject.onEffectLose = function(target, effect)
|
2018-09-27 22:30:57 -05:00
|
|
|
local pet = target:getPet()
|
2018-09-28 08:25:47 -05:00
|
|
|
if pet ~= nil then
|
2021-04-01 15:10:15 -04:00
|
|
|
pet:delMod(xi.mod.MATT, 22)
|
2018-09-28 08:25:47 -05:00
|
|
|
end
|
2018-09-27 22:30:57 -05:00
|
|
|
end
|
2021-01-17 11:55:03 -05:00
|
|
|
|
2022-10-06 17:25:46 +03:00
|
|
|
return itemObject
|