-----------------------------------
-- Attachment: Strobe II
-- http://forum.square-enix.com/ffxi/threads/49065?p=565264#post565264
-----------------------------------
---@type TAttachment
local attachmentObject = {}

attachmentObject.onEquip = function(pet, attachment)
    xi.automaton.onAttachmentEquip(pet, attachment)
    pet:addListener('AUTOMATON_ATTACHMENT_CHECK', 'ATTACHMENT_STROBE_II', function(automaton, target)
        local master = automaton:getMaster()

        if
            master and
            master:countEffect(xi.effect.FIRE_MANEUVER) > 0 and
            (automaton:checkDistance(target) - target:getModelSize()) <= 15
        then
            automaton:useMobAbility(xi.automaton.abilities.PROVOKE)
        end
    end)
end

attachmentObject.onUnequip = function(pet, attachment)
    xi.automaton.onAttachmentUnequip(pet, attachment)
    pet:removeListener('ATTACHMENT_STROBE_II')
end

attachmentObject.onManeuverGain = function(pet, attachment, maneuvers)
    xi.automaton.onManeuverGain(pet, attachment, maneuvers)
end

attachmentObject.onManeuverLose = function(pet, attachment, maneuvers)
    xi.automaton.onManeuverLose(pet, attachment, maneuvers)
end

attachmentObject.onUpdate = function(pet, attachment, maneuvers)
    xi.automaton.updateAttachmentModifier(pet, attachment, maneuvers)
end

return attachmentObject
