Organizer!

言語: JP EN DE FR
2010-06-21
New Items
users online
フォーラム » Windower » General » Organizer!
Organizer!
First Page 2 3 ... 15 16 17 ... 21 22 23
Offline
Posts: 20
By Havok16 2017-10-31 11:46:21  
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks that are called to process player actions at specific points in time.
-------------------------------------------------------------------------------------------------------------------
Code
function job_precast(spell, action, spellMap, eventArgs)
-- Define class for Sic and Ready moves.
    if spell.type == "Monster" then
        classes.CustomClass = "WS"
 
        if state.LagMode.value == 'Lag' then
            if physical_ready_moves:contains(spell.name) then
                if state.AxeMode.value == 'PetOnly' then
                    if state.OffenseMode.value == 'MaxAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.ReadyDWNE.MaxAcc, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.ReadyNE.MaxAcc, sets.ReadyRecast)
                        end
                    elseif state.OffenseMode.value == 'HighAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.ReadyDWNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.ReadyNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
                        end
                    elseif state.OffenseMode.value == 'MedAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.ReadyDWNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.ReadyNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
                        end
                    else
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            if multi_hit_ready_moves:contains(spell.name) then
                                if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK, sets.ReadyRecastDWNE))
                                elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK, sets.ReadyRecastDWNE))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE))
                                end
                            else
                                equip(set_combine(sets.midcast.Pet.ReadyDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE))
                            end
                        else
                            if multi_hit_ready_moves:contains(spell.name) then
                                if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK, sets.ReadyRecast))
                                elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK, sets.ReadyRecast))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
                                end
                            else
                                equip(set_combine(sets.midcast.Pet.ReadyNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
                            end
                        end
                    end
                else
                    if state.OffenseMode.value == 'MaxAcc' then
                        equip(sets.midcast.Pet.MaxAcc, sets.ReadyRecast)
                    elseif state.OffenseMode.value == 'HighAcc' then
                        equip(sets.midcast.Pet.HighAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
                    elseif state.OffenseMode.value == 'MedAcc' then
                        equip(sets.midcast.Pet.MedAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
                    else
                        if multi_hit_ready_moves:contains(spell.name) then
                            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK, sets.ReadyRecast))
                            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK, sets.ReadyRecast))
                            else
                                equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
                            end
                        else
                            equip(set_combine(sets.midcast.Pet.WS, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
                        end
                    end
                end
            end

            if magic_atk_ready_moves:contains(spell.name) then
                if state.AxeMode.value == 'PetOnly' then
                    if state.OffenseMode.value == 'MaxAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.MaxAcc, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc, sets.ReadyRecast)
                        end
                    elseif state.OffenseMode.value == 'HighAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.HighAcc, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.HighAcc, sets.ReadyRecast)
                        end
                    elseif state.OffenseMode.value == 'MedAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.MedAcc, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.MedAcc, sets.ReadyRecast)
                        end
                    else
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE, sets.ReadyRecast)
                        end
                    end
                else
                    equip(sets.midcast.Pet.MagicAtkReady, sets.ReadyRecast)
                end
            end

            if magic_acc_ready_moves:contains(spell.name) then
                if state.AxeMode.value == 'PetOnly' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        equip(sets.midcast.Pet.MagicAccReadyDWNE, sets.ReadyRecastDWNE)
                    else
                        equip(sets.midcast.Pet.MagicAccReadyNE, sets.ReadyRecast)
                    end
                else
                    equip(sets.midcast.Pet.MagicAccReady, sets.ReadyRecast)
                end
            end

            if pet_buff_moves:contains(spell.name) then
                if state.AxeMode.value == 'PetOnly' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        equip(sets.midcast.Pet.BuffDWNE, sets.ReadyRecastDWNE)
                    else
                        equip(sets.midcast.Pet.BuffNE, sets.ReadyRecast)
                    end
                else
                    equip(sets.midcast.Pet.Buff, sets.ReadyRecast)
                end
            end

            -- If Pet TP, before bonuses, is less than a certain value then equip Nukumi Manoplas +1.
            if (physical_ready_moves:contains(spell.name) or magic_atk_ready_moves:contains(spell.name)) and state.OffenseMode.value ~= 'MaxAcc' then
                if tp_based_ready_moves:contains(spell.name) and PetJob == 'Warrior' then
                    if pet_tp < 1300 then
                        equip(sets.midcast.Pet.TPBonus)
                    end
                elseif tp_based_ready_moves:contains(spell.name) and PetJob ~= 'Warrior' then
                    if pet_tp < 1800 then
                        equip(sets.midcast.Pet.TPBonus)
                    end
                end
            end
        eventArgs.handled = true
        else
            if state.AxeMode.value == 'PetOnly' and not buffactive['Unleash']then
                if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                    equip(sets.ReadyRecastDWNE)
                else
                    equip(sets.ReadyRecastNE)
                end
            else
                equip(sets.ReadyRecast)
            end
        end
    end

    if spell.english == 'Reward' then
        if state.AxeMode.value == 'PetOnly' then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                equip(sets.precast.JA.RewardNEDW)
            else
                equip(sets.precast.JA.RewardNE)
            end
        else
            equip(sets.precast.JA.Reward)
        end
    end

    if enmity_plus_moves:contains(spell.english) then
        if state.AxeMode.value == 'PetOnly' then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                equip(sets.EnmityNEDW)
            else
                equip(sets.EnmityNE)
            end
        else
            equip(sets.Enmity)
        end
    end

    if spell.english == 'Spur' then
        if state.AxeMode.value == 'PetOnly' then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                equip(sets.precast.JA.SpurNEDW)
            else
                equip(sets.precast.JA.SpurNE)
            end
        else
            equip(sets.precast.JA.Spur)
        end
    end

    if spell.english == 'Charm' then
        if state.AxeMode.value == 'PetOnly' then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                equip(sets.precast.JA.CharmNEDW)
            else
                equip(sets.precast.JA.CharmNE)
            end
        else
            equip(sets.precast.JA.Charm)
        end
    end

    if spell.english == 'Bestial Loyalty' or spell.english == 'Call Beast' then
        JugInfo = ''
        if state.JugMode.value == 'FunguarFamiliar' or state.JugMode.value == 'Seedbed Soil' then
            JugInfo = 'Seedbed Soil'
        elseif state.JugMode.value == 'CourierCarrie' or state.JugMode.value == 'Fish Oil Broth' then
            JugInfo = 'Fish Oil Broth'
        elseif state.JugMode.value == 'AmigoSabotender' or state.JugMode.value == 'Sun Water' then
            JugInfo = 'Sun Water'
        elseif state.JugMode.value == 'NurseryNazuna' or state.JugMode.value == 'Dancing Herbal Broth' or state.JugMode.value == 'D. Herbal Broth' then
            JugInfo = 'D. Herbal Broth'
        elseif state.JugMode.value == 'CraftyClyvonne' or state.JugMode.value == 'Cunning Brain Broth' or state.JugMode.value == 'Cng. Brain Broth' then
            JugInfo = 'Cng. Brain Broth'
        elseif state.JugMode.value == 'PrestoJulio' or state.JugMode.value == 'Chirping Grasshopper Broth' or state.JugMode.value == 'C. Grass Broth' then
            JugInfo = 'C. Grass Broth'
        elseif state.JugMode.value == 'SwiftSieghard' or state.JugMode.value == 'Mellow Bird Broth' or state.JugMode.value == 'Mlw. Bird Broth' then
            JugInfo = 'Mlw. Bird Broth'
        elseif state.JugMode.value == 'MailbusterCetas' or state.JugMode.value == 'Goblin Bug Broth' or state.JugMode.value == 'Gob. Bug Broth' then
            JugInfo = 'Gob. Bug Broth'
        elseif state.JugMode.value == 'AudaciousAnna' or state.JugMode.value == 'Bubbling Carrion Broth' then
            JugInfo = 'B. Carrion Broth'
        elseif state.JugMode.value == 'TurbidToloi' or state.JugMode.value == 'Auroral Broth' then
            JugInfo = 'Auroral Broth'
        elseif state.JugMode.value == 'SlipperySilas' or state.JugMode.value == 'Wormy Broth' then
            JugInfo = 'Wormy Broth'
        elseif state.JugMode.value == 'LuckyLulush' or state.JugMode.value == 'Lucky Carrot Broth' or state.JugMode.value == 'L. Carrot Broth' then
            JugInfo = 'L. Carrot Broth'
        elseif state.JugMode.value == 'DipperYuly' or state.JugMode.value == 'Wool Grease' then
            JugInfo = 'Wool Grease'
        elseif state.JugMode.value == 'FlowerpotMerle' or state.JugMode.value == 'Vermihumus' then
            JugInfo = 'Vermihumus'
        elseif state.JugMode.value == 'DapperMac' or state.JugMode.value == 'Briny Broth' then
            JugInfo = 'Briny Broth'
        elseif state.JugMode.value == 'DiscreetLouise' or state.JugMode.value == 'Deepbed Soil' then
            JugInfo = 'Deepbed Soil'
        elseif state.JugMode.value == 'FatsoFargann' or state.JugMode.value == 'Curdled Plasma Broth' or state.JugMode.value == 'C. Plasma Broth' then
            JugInfo = 'C. Plasma Broth'
        elseif state.JugMode.value == 'FaithfulFalcorr' or state.JugMode.value == 'Lucky Broth' then
            JugInfo = 'Lucky Broth'
        elseif state.JugMode.value == 'BugeyedBroncha' or state.JugMode.value == 'Savage Mole Broth' or state.JugMode.value == 'Svg. Mole Broth' then
            JugInfo = 'Svg. Mole Broth'
        elseif state.JugMode.value == 'BloodclawShasra' or state.JugMode.value == 'Razor Brain Broth' or state.JugMode.value == 'Rzr. Brain Broth' then
            JugInfo = 'Rzr. Brain Broth'
        elseif state.JugMode.value == 'GorefangHobs' or state.JugMode.value == 'Burning Carrion Broth' then
            JugInfo = 'B. Carrion Broth'
        elseif state.JugMode.value == 'GooeyGerard' or state.JugMode.value == 'Cloudy Wheat Broth' or state.JugMode.value == 'Cl. Wheat Broth' then
            JugInfo = 'Cl. Wheat Broth'
        elseif state.JugMode.value == 'CrudeRaphie' or state.JugMode.value == 'Shadowy Broth' then
            JugInfo = 'Shadowy Broth'
        elseif state.JugMode.value == 'DroopyDortwin' or state.JugMode.value == 'Swirling Broth' then
            JugInfo = 'Swirling Broth'
        elseif state.JugMode.value == 'PonderingPeter' or state.JugMode.value == 'Viscous Broth' or state.JugMode.value == 'Vis. Broth' then
            JugInfo = 'Vis. Broth'
        elseif state.JugMode.value == 'SunburstMalfik' or state.JugMode.value == 'Shimmering Broth' then
            JugInfo = 'Shimmering Broth'
        elseif state.JugMode.value == 'AgedAngus' or state.JugMode.value == 'Fermented Broth' or state.JugMode.value == 'Ferm. Broth' then
            JugInfo = 'Ferm. Broth'
        elseif state.JugMode.value == 'WarlikePatrick' or state.JugMode.value == 'Livid Broth' then
            JugInfo = 'Livid Broth'
        elseif state.JugMode.value == 'ScissorlegXerin' or state.JugMode.value == 'Spicy Broth' then
            JugInfo = 'Spicy Broth'
        elseif state.JugMode.value == 'BouncingBertha' or state.JugMode.value == 'Bubbly Broth' then
            JugInfo = 'Bubbly Broth'
        elseif state.JugMode.value == 'RhymingShizuna' or state.JugMode.value == 'Lyrical Broth' then
            JugInfo = 'Lyrical Broth'
        elseif state.JugMode.value == 'AttentiveIbuki' or state.JugMode.value == 'Salubrious Broth' then
            JugInfo = 'Salubrious Broth'
        elseif state.JugMode.value == 'SwoopingZhivago' or state.JugMode.value == 'Windy Greens' then
            JugInfo = 'Windy Greens'
        elseif state.JugMode.value == 'AmiableRoche' or state.JugMode.value == 'Airy Broth' then
            JugInfo = 'Airy Broth'
        elseif state.JugMode.value == 'HeraldHenry' or state.JugMode.value == 'Translucent Broth' or state.JugMode.value == 'Trans. Broth' then
            JugInfo = 'Trans. Broth'
        elseif state.JugMode.value == 'BrainyWaluis' or state.JugMode.value == 'Crumbly Soil' then
            JugInfo = 'Crumbly Soil'
        elseif state.JugMode.value == 'HeadbreakerKen' or state.JugMode.value == 'Blackwater Broth' then
            JugInfo = 'Blackwater Broth'
        elseif state.JugMode.value == 'RedolentCandi' or state.JugMode.value == 'Electrified Broth' then
            JugInfo = 'Electrified Broth'
        elseif state.JugMode.value == 'AlluringHoney' or state.JugMode.value == 'Bug-Ridden Broth' then
            JugInfo = 'Bug-Ridden Broth'
        elseif state.JugMode.value == 'CaringKiyomaro' or state.JugMode.value == 'Fizzy Broth' then
            JugInfo = 'Fizzy Broth'
        elseif state.JugMode.value == 'VivaciousVickie' or state.JugMode.value == 'Tantalizing Broth' or state.JugMode.value == 'Tant. Broth' then
            JugInfo = 'Tant. Broth'
        elseif state.JugMode.value == 'HurlerPercival' or state.JugMode.value == 'Pale Sap' then
            JugInfo = 'Pale Sap'
        elseif state.JugMode.value == 'BlackbeardRandy' or state.JugMode.value == 'Meaty Broth' then
            JugInfo = 'Meaty Broth'
        elseif state.JugMode.value == 'GenerousArthur' or state.JugMode.value == 'Dire Broth' then
            JugInfo = 'Dire Broth'
        elseif state.JugMode.value == 'ThreestarLynn' or state.JugMode.value == 'Muddy Broth' then
            JugInfo = 'Muddy Broth'
        elseif state.JugMode.value == 'BraveHeroGlenn' or state.JugMode.value == 'Wispy Broth' then
            JugInfo = 'Wispy Broth'
        elseif state.JugMode.value == 'SharpwitHermes' or state.JugMode.value == 'Saline Broth' then
            JugInfo = 'Saline Broth'
        elseif state.JugMode.value == 'ColibriFamiliar' or state.JugMode.value == 'Sugary Broth' then
            JugInfo = 'Sugary Broth'
        elseif state.JugMode.value == 'ChoralLeera' or state.JugMode.value == 'Glazed Broth' then
            JugInfo = 'Glazed Broth'
        elseif state.JugMode.value == 'SpiderFamiliar' or state.JugMode.value == 'Sticky Webbing' then
            JugInfo = 'Sticky Webbing'
        elseif state.JugMode.value == 'GussyHachirobe' or state.JugMode.value == 'Slimy Webbing' then
            JugInfo = 'Slimy Webbing'
        elseif state.JugMode.value == 'AcuexFamiliar' or state.JugMode.value == 'Poisonous Broth' then
            JugInfo = 'Poisonous Broth'
        elseif state.JugMode.value == 'FluffyBredo' or state.JugMode.value == 'Venomous Broth' then
            JugInfo = 'Venomous Broth'
        elseif state.JugMode.value == 'SuspiciousAlice' or state.JugMode.value == 'Furious Broth' then
            JugInfo = 'Furious Broth'
        elseif state.JugMode.value == 'AnklebiterJedd' or state.JugMode.value == 'Crackling Broth' then
            JugInfo = 'Crackling Broth'
        elseif state.JugMode.value == 'FleetReinhard' or state.JugMode.value == 'Rapid Broth' then
            JugInfo = 'Rapid Broth'
        elseif state.JugMode.value == 'CursedAnnabelle' or state.JugMode.value == 'Creepy Broth' then
            JugInfo = 'Creepy Broth'
        elseif state.JugMode.value == 'SurgingStorm' or state.JugMode.value == 'Insipid Broth' then
            JugInfo = 'Insipid Broth'
        elseif state.JugMode.value == 'SubmergedIyo' or state.JugMode.value == 'Deepwater Broth' then
            JugInfo = 'Deepwater Broth'
        elseif state.JugMode.value == 'MosquitoFamiliar' or state.JugMode.value == 'Wetlands Broth' then
            JugInfo = 'Wetlands Broth'
        elseif state.JugMode.value == 'Left-HandedYoko' or state.JugMode.value == 'Heavenly Broth' then
            JugInfo = 'Heavenly Broth'
        end
        if spell.english == "Call Beast" and call_beast_cancel:contains(JugInfo) then
            add_to_chat(123, spell.name..' Canceled: [HQ Jug Pet]')
            return
        end
        equip({ammo=JugInfo})
    end

    if player.equipment.main == 'Aymur' then
        custom_aftermath_timers_precast(spell)
    end

    if spell.type == "WeaponSkill" and spell.name ~= 'Mistral Axe' and spell.name ~= 'Bora Axe' and spell.target.distance > target_distance then
        cancel_spell()
        add_to_chat(123, spell.name..' Canceled: [Out of Range]')
        handle_equipping_gear(player.status)
        return
    end

    if spell.type == 'CorsairRoll' or spell.english == "Double-Up" then
        equip(sets.precast.LuzafRing)
    end

    if spell.prefix == '/magic' or spell.prefix == '/ninjutsu' or spell.prefix == '/song' then
        if state.AxeMode.value == 'PetOnly' then
            equip(sets.precast.FCNE)
        else
            equip(sets.precast.FC)
        end
    end
end

function customize_melee_set(meleeSet)
    if state.AxeMode.value == 'PetOnly' and pet.status == "Engaged" and player.status == "Engaged" and state.DefenseMode.value == "None" then
        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                meleeSet = set_combine(meleeSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBMNK)
            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                meleeSet = set_combine(meleeSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBNonMNK)
            else
                meleeSet = set_combine(meleeSet, sets.PetTPAxes, sets.idle.Pet.Engaged)
            end
        else
            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                meleeSet = set_combine(meleeSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBMNK)
            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                meleeSet = set_combine(meleeSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBNonMNK)
            else
                meleeSet = set_combine(meleeSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged)
            end
        end
    end
    return meleeSet
end

function job_post_precast(spell, action, spellMap, eventArgs)
-- If Killer Instinct is active during WS, equip Nukumi Gausape +1.
    if spell.type:lower() == 'weaponskill' and buffactive['Killer Instinct'] then
        equip(sets.buff['Killer Instinct'])
    end

    if spell.english == "Primal Rend" or spell.english == "Cloudsplitter" then
        if player.tp > 2750 then
            equip(sets.midcast.ExtraMAB)
        end
    end

-- Equip Chaac Belt for TH+1 on common Subjob Abilities or Spells.
    if abilities_to_check:contains(spell.english) and state.TreasureMode.value == 'Tag' then
        equip(sets.THGear)
    end
end

function job_midcast(spell, action, spellMap, eventArgs)
    if state.AxeMode.value == 'PetOnly' then
        if spell.english == "Cure" or spell.english == "Cure II" or spell.english == "Cure III" or spell.english == "Cure IV" then
            equip(sets.CurePetOnly)
        end
        if spell.english == "Curaga" or spell.english == "Curaga II" or spell.english == "Curaga III" then
            equip(sets.CurePetOnly)
        end
    end
end

-- Return true if we handled the aftercast work.  Otherwise it will fall back
-- to the general aftercast() code in Mote-Include.
function job_aftercast(spell, action, spellMap, eventArgs)
    if spell.type == "Monster" and not spell.interrupted then
        if physical_ready_moves:contains(spell.name) then
            if state.AxeMode.value == 'PetOnly' then
                if state.OffenseMode.value == 'MaxAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyDWNE.TPBonus.MaxAcc)
                        else
                            equip(sets.midcast.Pet.ReadyDWNE.MaxAcc)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyNE.TPBonus.MaxAcc)
                        else
                            equip(sets.midcast.Pet.ReadyNE.MaxAcc)
                        end
                    end
                elseif state.OffenseMode.value == 'HighAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyDWNE.TPBonus.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        else
                            equip(sets.midcast.Pet.ReadyDWNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyNE.TPBonus.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        else
                            equip(sets.midcast.Pet.ReadyNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        end
                    end
                elseif state.OffenseMode.value == 'MedAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyDWNE.TPBonus.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        else
                            equip(sets.midcast.Pet.ReadyDWNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyNE.TPBonus.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        else
                            equip(sets.midcast.Pet.ReadyNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        end
                    end
                else
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if multi_hit_ready_moves:contains(spell.name) then
                            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                                end
                            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                                end
                            else
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value]))
                                end
                            end
                        else
                            if tp_based_ready_moves:contains(spell.name) then
                                equip(set_combine(sets.midcast.Pet.ReadyDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
                            else
                                equip(set_combine(sets.midcast.Pet.ReadyDWNE, sets.midcast.Pet[state.CorrelationMode.value]))
                            end
                        end
                    else
                        if multi_hit_ready_moves:contains(spell.name) then
                            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                                end
                            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                                end
                            else
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value]))
                                end
                            end
                        else
                            if tp_based_ready_moves:contains(spell.name) then
                                equip(set_combine(sets.midcast.Pet.ReadyNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
                            else
                                equip(set_combine(sets.midcast.Pet.ReadyNE, sets.midcast.Pet[state.CorrelationMode.value]))
                            end
                        end
                    end
                end
            else
                if state.OffenseMode.value == 'MaxAcc' then
                    equip(sets.midcast.Pet.MaxAcc)
                elseif state.OffenseMode.value == 'HighAcc' then
                    equip(sets.midcast.Pet.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                elseif state.OffenseMode.value == 'MedAcc' then
                    equip(sets.midcast.Pet.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                else
                    if multi_hit_ready_moves:contains(spell.name) then
                        if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                            equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                        elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                            equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                        else
                            equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value]))
                        end
                    else
                        equip(set_combine(sets.midcast.Pet.WS, sets.midcast.Pet[state.CorrelationMode.value]))
                    end
                end
            end
        end

        if magic_atk_ready_moves:contains(spell.name) then
            if state.AxeMode.value == 'PetOnly' then
                if state.OffenseMode.value == 'MaxAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MaxAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.MaxAcc)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MaxAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc)
                        end
                    end
                elseif state.OffenseMode.value == 'HighAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.HighAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.HighAcc)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus.HighAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.HighAcc)
                        end
                    end
                elseif state.OffenseMode.value == 'MedAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MedAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.MedAcc)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MedAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.MedAcc)
                        end
                    end
                else
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE)
                        end
                    end
                end
            else
                equip(sets.midcast.Pet.MagicAtkReady)
            end
        end

        if magic_acc_ready_moves:contains(spell.name) then
            if state.AxeMode.value == 'PetOnly' then
                if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                    equip(sets.midcast.Pet.MagicAccReadyDWNE)
                else
                    equip(sets.midcast.Pet.MagicAccReadyNE)
                end
            else
                equip(sets.midcast.Pet.MagicAccReady)
            end
        end

        if pet_buff_moves:contains(spell.name) then
            if state.AxeMode.value == 'PetOnly' then
                if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                    equip(sets.midcast.Pet.BuffDWNE)
                else
                    equip(sets.midcast.Pet.BuffNE)
                end
            else
                equip(sets.midcast.Pet.Buff)
            end
        end

        -- If Pet TP, before bonuses, is less than a certain value then equip Nukumi Manoplas +1.
        -- Or if Pet TP, before bonuses, is more than a certain value then equip Unleash-specific Axes.
        if (physical_ready_moves:contains(spell.name) or magic_atk_ready_moves:contains(spell.name)) and state.OffenseMode.value ~= 'MaxAcc' then
            if tp_based_ready_moves:contains(spell.name) and PetJob == 'Warrior' then
                if pet_tp < 1300 then
                    equip(sets.midcast.Pet.TPBonus)
                elseif pet_tp > 2000 and state.AxeMode.value == 'PetOnly' then
                    if physical_ready_moves:contains(spell.name) then
                        if state.OffenseMode.value == 'HighAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes.HighAcc)
                            else
                                equip(sets.UnleashAtkAxeShield.HighAcc)
                            end
                        elseif state.OffenseMode.value == 'MedAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes.MedAcc)
                            else
                                equip(sets.UnleashAtkAxeShield.MedAcc)
                            end
                        else
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes)
                            else
                                equip(sets.UnleashAtkAxeShield)
                            end
                        end
                    else
                        if state.OffenseMode.value == 'HighAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes.HighAcc)
                            else
                                equip(sets.UnleashMABAxeShield.HighAcc)
                            end
                        elseif state.OffenseMode.value == 'MedAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes.MedAcc)
                            else
                                equip(sets.UnleashMABAxeShield.MedAcc)
                            end
                        else
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes)
                            else
                                equip(sets.UnleashMABAxeShield)
                            end
                        end
                    end
                end
            elseif tp_based_ready_moves:contains(spell.name) and PetJob ~= 'Warrior' then
                if pet_tp < 1800 then
                    equip(sets.midcast.Pet.TPBonus)
                elseif pet_tp > 2500 and state.AxeMode.value == 'PetOnly' then
                    if physical_ready_moves:contains(spell.name) then
                        if state.OffenseMode.value == 'HighAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes.HighAcc)
                            else
                                equip(sets.UnleashAtkAxeShield.HighAcc)
                            end
                        elseif state.OffenseMode.value == 'MedAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes.MedAcc)
                            else
                                equip(sets.UnleashAtkAxeShield.MedAcc)
                            end
                        else
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes)
                            else
                                equip(sets.UnleashAtkAxeShield)
                            end
                        end
                    else
                        if state.OffenseMode.value == 'HighAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes.HighAcc)
                            else
                                equip(sets.UnleashMABAxeShield.HighAcc)
                            end
                        elseif state.OffenseMode.value == 'MedAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes.MedAcc)
                            else
                                equip(sets.UnleashMABAxeShield.MedAcc)
                            end
                        else
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes)
                            else
                                equip(sets.UnleashMABAxeShield)
                            end
                        end
                    end
                end
            end
        end
    eventArgs.handled = true
    end

    -- Create custom timers for Pet Buffs.
    if pet_buff_moves:contains(spell.name) and DisplayPetBuffTimers == 'true' then
        if not spell.interrupted then
            pet_buff_timer(spell)
        end
    end

    if spell.english == 'Fight' or spell.english == 'Bestial Loyalty' or spell.english == 'Call Beast' then
        if not spell.interrupted then
            pet_info_update()
        end
    end

    if spell.english == "Leave" and not spell.interrupted then
        clear_pet_buff_timers()
        PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None'
    end

    if player.equipment.main == 'Aymur' then
        custom_aftermath_timers_aftercast(spell)
    end

    if player.status ~= 'Idle' and state.AxeMode.value == 'PetOnly' and spell.type ~= "Monster" then
        pet_only_equip_handling()
    end
end

function job_pet_midcast(spell, action, spellMap, eventArgs)

end


[Mod Edit: Code tags - AnnaMolly]
Offline
Posts: 20
By Havok16 2017-10-31 11:47:10  
Code
function job_pet_aftercast(spell, action, spellMap, eventArgs)
    if pet_buff_moves:contains(spell.name) and DisplayPetBuffTimers == 'true' then
        -- Pet TP calculations for Ready Buff Durations
        local TP_Amount = 1000
        if pet_tp < 1000 then TP_Amount = TP_Amount + TP_Gift_Bonus;end
        if pet_tp > 1000 then TP_Amount = pet_tp + TP_Gift_Bonus;end
        if player.equipment.hands == "Ferine Manoplas +1" then TP_Amount = TP_Amount + 250;end
        if player.equipment.hands == "Ferine Manoplas +2" then TP_Amount = TP_Amount + 500;end
        if player.equipment.hands == "Nukumi Manoplas" then TP_Amount = TP_Amount + 550;end
        if player.equipment.hands == "Nukumi Manoplas +1" then TP_Amount = TP_Amount + 600;end
        if player.equipment.main == "Aymur" or player.equipment.sub == "Aymur" then TP_Amount = TP_Amount + 500;end
        if player.equipment.main == "Kumbhakarna" then TP_Amount = TP_Amount + TP_Bonus_Main;end
        if player.equipment.sub == "Kumbhakarna" then TP_Amount = TP_Amount + TP_Bonus_Sub;end
        if TP_Amount > 3000 then TP_Amount = 3000;end

        if spell.english == 'Bubble Curtain' then
            local TP_Buff_Duration = math.floor((TP_Amount - 1000)* 0.09) + BubbleCurtainDuration
            send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..BubbleCurtainIcon..'')
        elseif spell.english == 'Scissor Guard' then
            local TP_Buff_Duration = math.floor(TP_Amount * 0.06)
            send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..ScissorGuardIcon..'')
        elseif spell.english == 'Secretion' then
            TP_Amount = TP_Amount + 500
            if TP_Amount > 3000 then TP_Amount = 3000;end
            local TP_Buff_Duration = math.floor(TP_Amount * 0.18)
            send_command('timers c "Secretion" '..TP_Buff_Duration..' down '..SecretionIcon..'')
        elseif spell.english == 'Rage' then
            TP_Amount = TP_Amount + 500
            if TP_Amount > 3000 then TP_Amount = 3000;end
            local TP_Buff_Duration = math.floor(TP_Amount * 0.18)
            send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..RageIcon..'')
        elseif spell.english == 'Rhino Guard' then
            local TP_Buff_Duration = math.floor(TP_Amount * 0.18)
            send_command('timers c "Rhino Guard" '..TP_Buff_Duration..' down '..RhinoGuardIcon..'')
        elseif spell.english == 'Zealous Snort' then
            local TP_Buff_Duration = math.floor(TP_Amount * 0.06)
            send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..ZealousSnortIcon..'')
        end
    end
    pet_only_equip_handling()
end

-------------------------------------------------------------------------------------------------------------------
-- Customization hook for idle sets.
-------------------------------------------------------------------------------------------------------------------

function customize_idle_set(idleSet)
    if state.AxeMode.value == 'PetOnly' then
        if pet.status == "Engaged" then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    idleSet = set_combine(idleSet, sets.PetPDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    idleSet = set_combine(idleSet, sets.PetMDTAxes)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    idleSet = set_combine(idleSet, sets.PDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    idleSet = set_combine(idleSet, sets.MDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    idleSet = set_combine(idleSet, sets.MEvaAxes)
                else
                    if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                        idleSet = set_combine(idleSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBMNK)
                    elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                        idleSet = set_combine(idleSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBNonMNK)
                    elseif state.HybridMode.value == 'PetSTP' then
                        idleSet = set_combine(idleSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSTP)
                    else
                        idleSet = set_combine(idleSet, sets.PetTPAxes)
                    end
                end
            else
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    idleSet = set_combine(idleSet, sets.PetPDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    idleSet = set_combine(idleSet, sets.PetMDTAxeShield)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    idleSet = set_combine(idleSet, sets.PDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    idleSet = set_combine(idleSet, sets.MDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    idleSet = set_combine(idleSet, sets.MEvaAxeShield)
                else
                    if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                        idleSet = set_combine(idleSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBMNK)
                    elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                        idleSet = set_combine(idleSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBNonMNK)
                    elseif state.HybridMode.value == 'PetSTP' then
                        idleSet = set_combine(idleSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSTP)
                    else
                        idleSet = set_combine(idleSet, sets.PetTPAxeShield)
                    end
                end
            end
        end
        if pet.status ~= "Engaged" then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    idleSet = set_combine(idleSet, sets.PetPDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    idleSet = set_combine(idleSet, sets.PetMDTAxes)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    idleSet = set_combine(idleSet, sets.PDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    idleSet = set_combine(idleSet, sets.MDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    idleSet = set_combine(idleSet, sets.MEvaAxes)
                elseif state.IdleMode.value == "PetRegen" then
                    idleSet = set_combine(idleSet, sets.PetRegenAxes)
                else
                    idleSet = set_combine(idleSet, sets.IdleAxes)
                end
            else
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    idleSet = set_combine(idleSet, sets.PetPDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    idleSet = set_combine(idleSet, sets.PetMDTAxeShield)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    idleSet = set_combine(idleSet, sets.PDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    idleSet = set_combine(idleSet, sets.MDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    idleSet = set_combine(idleSet, sets.MEvaAxeShield)
                elseif state.IdleMode.value == "PetRegen" then
                    idleSet = set_combine(idleSet, sets.PetRegenAxeShield)
                else
                    idleSet = set_combine(idleSet, sets.IdleAxeShield)
                end
            end
        end
    end
    return idleSet
end

-------------------------------------------------------------------------------------------------------------------
-- Hooks for Reward, Correlation, Treasure Hunter, and Pet Mode handling.
-------------------------------------------------------------------------------------------------------------------

function job_state_change(stateField, newValue, oldValue)
    if stateField == 'Correlation Mode' then
        state.CorrelationMode:set(newValue)
    elseif stateField == 'Treasure Mode' then
        state.TreasureMode:set(newValue)
    elseif stateField == 'Pet Mode' then
        state.CombatWeapon:set(newValue)
    end
end

function get_custom_wsmode(spell, spellMap, default_wsmode)
    if default_wsmode == 'Normal' then
        if spell.english == "Ruinator" and (world.day_element == 'Water' or world.day_element == 'Wind' or world.day_element == 'Ice') then
            return 'Gavialis'
        end
        if spell.english == "Rampage" and world.day_element == 'Earth' then
            return 'Gavialis'
        end
    end
end

-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------

-- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).
function job_handle_equipping_gear(playerStatus, eventArgs)
    -- Equipping a Capacity Points Mantle locks it until it is manually unequipped.
    if player.equipment.back == 'Mecisto. Mantle' or player.equipment.back == 'Aptitude Mantle' or player.equipment.back == 'Aptitude Mantle +1' then
        disable('back')
    else
        enable('back')
    end
end

-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
    get_combat_form()
    get_melee_groups()
    pet_info_update()
    update_display_mode_info()
    pet_only_equip_handling()
end

-- Updates gear based on pet status changes.
function job_pet_status_change(newStatus, oldStatus, eventArgs)
    if newStatus == 'Idle' or newStatus == 'Engaged' then
        if state.DefenseMode.value ~= "Physical" and state.DefenseMode.value ~= "Magical" then
            handle_equipping_gear(player.status)
        end
    end

    if pet.hpp == 0 then
        clear_pet_buff_timers()
        PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None'
    end

    customize_melee_set(meleeSet)
    pet_info_update()
end 

function job_buff_change(status, gain, gain_or_loss)
    --Equip Frenzy Sallet if we're asleep and engaged.
    if (status == "sleep" and gain_or_loss) and player.status == 'Engaged' then
        if gain then
            equip(sets.FrenzySallet)
        else
            handle_equipping_gear(player.status)
        end
    end
end

-------------------------------------------------------------------------------------------------------------------
-- Ready Move Presets and Pet TP Evaluation Functions - Credit to Bomberto and Verda
-------------------------------------------------------------------------------------------------------------------

pet_tp=0
function job_self_command(cmdParams, eventArgs)
    if cmdParams[1]:lower() == 'ready' then
        ready_move(cmdParams)
        eventArgs.handled = true
    end
    if cmdParams[1]:lower() == 'gearhandle' then
        pet_only_equip_handling()
    end
    if cmdParams[1] == 'pet_tp' then
	    pet_tp = tonumber(cmdParams[2])
    end
    if cmdParams[1]:lower() == 'charges' then
        charges = 3
        ready = windower.ffxi.get_ability_recasts()[102]
	    if ready ~= 0 then
	        charges = math.floor(((30 - ready) / 10))
	    end
	    add_to_chat(28,'Ready Recast:'..ready..'   Charges Remaining:'..charges..'')
    end
end
 
function ready_move(cmdParams)
    local move = cmdParams[2]:lower()
    local ReadyMove = ''
    if move == 'one' then
        ReadyMove = ReadyMoveOne
    elseif move == 'two' then
        ReadyMove = ReadyMoveTwo
    else
        ReadyMove = ReadyMoveThree
    end
    send_command('input /pet "'.. ReadyMove ..'" <me>')
end

pet_tp = 0
--Fix missing Pet.TP field by getting the packets from the fields lib
packets = require('packets')
function update_pet_tp(id,data)
    if id == 0x068 then
        pet_tp = 0
        local update = packets.parse('incoming', data)
        pet_tp = update["Pet TP"]
        windower.send_command('lua c gearswap c pet_tp '..pet_tp)
    end
end
id = windower.raw_register_event('incoming chunk', update_pet_tp)

-------------------------------------------------------------------------------------------------------------------
-- Current Job State Display
-------------------------------------------------------------------------------------------------------------------

-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
    local msg = 'Melee'
    
    if state.CombatForm.has_value then
        msg = msg .. ' (' .. state.CombatForm.value .. ')'
    end
    
    msg = msg .. ': '
    
    msg = msg .. state.OffenseMode.value
    if state.HybridMode.value ~= 'Normal' then
        msg = msg .. '/' .. state.HybridMode.value
    end
    msg = msg .. ', WS: ' .. state.WeaponskillMode.value
    
    if state.DefenseMode.value ~= 'None' then
        msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
    end
    
    if state.Kiting.value then
        msg = msg .. ', Kiting'
    end

    msg = msg .. ', Corr.: '..state.CorrelationMode.value

    if state.JugMode.value ~= 'None' then
        add_to_chat(8,'-- Jug Pet: '.. PetName ..' -- (Pet Info: '.. PetInfo ..', '.. PetJob ..')')
    end

    add_to_chat(28,'Ready Moves: 1.'.. ReadyMoveOne ..'  2.'.. ReadyMoveTwo ..'  3.'.. ReadyMoveThree ..'')
    add_to_chat(122, msg)

    eventArgs.handled = true
end

-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------

function pet_info_update()
    if pet.isvalid then
        PetName = pet.name

        if pet.name == 'DroopyDortwin' or pet.name == 'PonderingPeter' or pet.name == 'HareFamiliar' or pet.name == 'KeenearedSteffi' or pet.name == 'LuckyLulush' then
            PetInfo = "Rabbit, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Foot Kick';ReadyMoveTwo = 'Whirl Claws';ReadyMoveThree = 'Wild Carrot'
        elseif pet.name == 'SunburstMalfik' or pet.name == 'AgedAngus' or pet.name == 'HeraldHenry' or pet.name == 'CrabFamiliar' or pet.name == 'CourierCarrie' then
            PetInfo = "Crab, Aquan";PetJob = 'Paladin';ReadyMoveOne = 'Big Scissors';ReadyMoveTwo = 'Scissor Guard';ReadyMoveThree = 'Bubble Curtain'
        elseif pet.name == 'WarlikePatrick' or pet.name == 'LizardFamiliar' or pet.name == 'ColdbloodedComo' or pet.name == 'AudaciousAnna' then
            PetInfo = "Lizard, Lizard";PetJob = 'Warrior';ReadyMoveOne = 'Tail Blow';ReadyMoveTwo = 'Brain Crush';ReadyMoveThree = 'Fireball'
        elseif pet.name == 'ScissorlegXerin' or pet.name == 'BouncingBertha' then
            PetInfo = "Chapuli, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Sensilla Blades';ReadyMoveTwo = 'Tegmina Buffet';ReadyMoveThree = 'Tegmina Buffet'
        elseif pet.name == 'RhymingShizuna' or pet.name == 'SheepFamiliar' or pet.name == 'LullabyMelodia' or pet.name == 'NurseryNazuna' then
            PetInfo = "Sheep, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Lamb Chop';ReadyMoveTwo = 'Rage';ReadyMoveThree = 'Sheep Song'
        elseif pet.name == 'AttentiveIbuki' or pet.name == 'SwoopingZhivago' then
            PetInfo = "Tulfaire, Bird";PetJob = 'Warrior';ReadyMoveOne = 'Swooping Frenzy';ReadyMoveTwo = 'Pentapeck';ReadyMoveThree = 'Molting Plumage'
        elseif pet.name == 'AmiableRoche' or pet.name == 'TurbidToloi' then
            PetInfo = "Pugil, Aquan";PetJob = 'Warrior';ReadyMoveOne = 'Recoil Dive';ReadyMoveTwo = 'Water Wall';ReadyMoveThree = 'Intimidate'
        elseif pet.name == 'BrainyWaluis' or pet.name == 'FunguarFamiliar' or pet.name == 'DiscreetLouise' then
            PetInfo = "Funguar, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Frogkick';ReadyMoveTwo = 'Spore';ReadyMoveThree = 'Silence Gas'              
        elseif pet.name == 'HeadbreakerKen' or pet.name == 'MayflyFamiliar' or pet.name == 'ShellbusterOrob' or pet.name == 'MailbusterCetas' then
            PetInfo = "Fly, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Somersault';ReadyMoveTwo = 'Cursed Sphere';ReadyMoveThree = 'Venom'               
        elseif pet.name == 'RedolentCandi' or pet.name == 'AlluringHoney' then
            PetInfo = "Snapweed, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Tickling Tendrils';ReadyMoveTwo = 'Stink Bomb';ReadyMoveThree = 'Nectarous Deluge'
        elseif pet.name == 'CaringKiyomaro' or pet.name == 'VivaciousVickie' then
            PetInfo = "Raaz, Beast";PetJob = 'Monk';ReadyMoveOne = 'Sweeping Gouge';ReadyMoveTwo = 'Zealous Snort';ReadyMoveThree = 'Zealous Snort'
        elseif pet.name == 'HurlerPercival' or pet.name == 'BeetleFamiliar' or pet.name == 'PanzerGalahad' then
            PetInfo = "Beetle, Vermin";PetJob = 'Paladin';ReadyMoveOne = 'Power Attack';ReadyMoveTwo = 'Rhino Attack';ReadyMoveThree = 'Hi-Freq Field'
        elseif pet.name == 'BlackbeardRandy' or pet.name == 'TigerFamiliar' or pet.name == 'SaberSiravarde' or pet.name == 'GorefangHobs' then
            PetInfo = "Tiger, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Razor Fang';ReadyMoveTwo = 'Claw Cyclone';ReadyMoveThree = 'Roar'
        elseif pet.name == 'ColibriFamiliar' or pet.name == 'ChoralLeera' then
            PetInfo = "Colibri, Bird";PetJob = 'Red Mage';ReadyMoveOne = 'Pecking Flurry';ReadyMoveTwo = 'Pecking Flurry';ReadyMoveThree = 'Pecking Flurry'
        elseif pet.name == 'SpiderFamiliar' or pet.name == 'GussyHachirobe' then
            PetInfo = "Spider, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Sickle Slash';ReadyMoveTwo = 'Acid Spray';ReadyMoveThree = 'Spider Web'
        elseif pet.name == 'GenerousArthur' or pet.name == 'GooeyGerard' then
            PetInfo = "Slug, Amorph";PetJob = 'Warrior';ReadyMoveOne = 'Purulent Ooze';ReadyMoveTwo = 'Corrosive Ooze';ReadyMoveThree = 'Corrosive Ooze'
        elseif pet.name == 'ThreestarLynn' or pet.name == 'DipperYuly' then
            PetInfo = "Ladybug, Vermin";PetJob = 'Thief';ReadyMoveOne = 'Spiral Spin';ReadyMoveTwo = 'Sudden Lunge';ReadyMoveThree = 'Noisome Powder'
        elseif pet.name == 'SharpwitHermes' or pet.name == 'FlowerpotBill' or pet.name == 'FlowerpotBen' or pet.name == 'Homunculus' or pet.name == 'FlowerpotMerle' then
            PetInfo = "Mandragora, Plantoid";PetJob = 'Monk';ReadyMoveOne = 'Head Butt';ReadyMoveTwo = 'Leaf Dagger';ReadyMoveThree = 'Wild Oats'
        elseif pet.name == 'AcuexFamiliar' or pet.name == 'FluffyBredo' then
            PetInfo = "Acuex, Amorph";PetJob = 'Black Mage';ReadyMoveOne = 'Foul Waters';ReadyMoveTwo = 'Pestilent Plume';ReadyMoveThree = 'Pestilent Plume'
        elseif pet.name == 'FlytrapFamiliar' or pet.name == 'VoraciousAudrey' or pet.name == 'PrestoJulio' then
            PetInfo = "Flytrap, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Soporific';ReadyMoveTwo = 'Palsy Pollen';ReadyMoveThree = 'Gloeosuccus'
        elseif pet.name == 'EftFamiliar' or pet.name == 'AmbusherAllie' or pet.name == 'BugeyedBroncha' or pet.name == 'SuspiciousAlice' then
            PetInfo = "Eft, Lizard";PetJob = 'Warrior';ReadyMoveOne = 'Nimble Snap';ReadyMoveTwo = 'Cyclotail';ReadyMoveThree = 'Geist Wall'
        elseif pet.name == 'AntlionFamiliar' or pet.name == 'ChopsueyChucky' or pet.name == 'CursedAnnabelle' then
            PetInfo = "Antlion, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Mandibular Bite';ReadyMoveTwo = 'Venom Spray';ReadyMoveThree = 'Sandblast'
        elseif pet.name == 'MiteFamiliar' or pet.name == 'LifedrinkerLars' or pet.name == 'AnklebiterJedd' then
            PetInfo = "Diremite, Vermin";PetJob = 'Dark Knight';ReadyMoveOne = 'Double Claw';ReadyMoveTwo = 'Spinning Top';ReadyMoveThree = 'Filamented Hold'
        elseif pet.name == 'AmigoSabotender' then
            PetInfo = "Cactuar, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Needle Shot';ReadyMoveTwo = '??? Needles';ReadyMoveThree = '??? Needles'
        elseif pet.name == 'CraftyClyvonne' then
            PetInfo = "Coeurl, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Blaster';ReadyMoveTwo = 'Chaotic Eye';ReadyMoveThree = 'Chaotic Eye'
        elseif pet.name == 'BloodclawShasra' then
            PetInfo = "Lynx, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Blaster';ReadyMoveTwo = 'Chaotic Eye';ReadyMoveThree = 'Charged Whisker'
        elseif pet.name == 'SwiftSieghard' or pet.name == 'FleetReinhard' then
            PetInfo = "Raptor, Lizard";PetJob = 'Warrior';ReadyMoveOne = 'Scythe Tail';ReadyMoveTwo = 'Ripper Fang';ReadyMoveThree = 'Chomp Rush'
        elseif pet.name == 'DapperMac' or pet.name == 'SurgingStorm' or pet.name == 'SubmergedIyo' then
            PetInfo = "Apkallu, Bird";PetJob = 'Monk';ReadyMoveOne = 'Beak Lunge';ReadyMoveTwo = 'Wing Slap';ReadyMoveThree = 'Wing Slap'
        elseif pet.name == 'FatsoFargann' then
            PetInfo = "Leech, Amorph";PetJob = 'Warrior';ReadyMoveOne = 'Suction';ReadyMoveTwo = 'Acid Mist';ReadyMoveThree = 'Drainkiss'
        elseif pet.name == 'FaithfulFalcorr' then
            PetInfo = "Hippogryph, Bird";PetJob = 'Thief';ReadyMoveOne = 'Back Heel';ReadyMoveTwo = 'Choke Breath';ReadyMoveThree = 'Fantod'
        elseif pet.name == 'CrudeRaphie' then
            PetInfo = "Adamantoise, Lizard";PetJob = 'Paladin';ReadyMoveOne = 'Tortoise Stomp';ReadyMoveTwo = 'Harden Shell';ReadyMoveThree = 'Aqua Breath'
        elseif pet.name == 'MosquitoFamilia' or pet.name == 'Left-HandedYoko' then
            PetInfo = "Mosquito, Vermin";PetJob = 'Dark Knight';ReadyMoveOne = 'Infected Leech';ReadyMoveTwo = 'Gloom Spray';ReadyMoveThree = 'Gloom Spray'
        end
    else
        PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None'
    end
end

function pet_only_equip_handling()
    if player.status == 'Engaged' and state.AxeMode.value == 'PetOnly' then
        if pet.status == "Engaged" then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    equip(sets.PetPDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    equip(sets.PetMDTAxes)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    equip(sets.PDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    equip(sets.MDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    equip(sets.MEvaAxes)
                else
                    equip(sets.PetTPAxes)
                end
            else
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    equip(sets.PetPDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    equip(sets.PetMDTAxeShield)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    equip(sets.PDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    equip(sets.MDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    equip(sets.MEvaAxeShield)
                else
                    equip(sets.PetTPAxeShield)
                end
            end
        end
        if pet.status ~= "Engaged" then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    equip(sets.PetPDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    equip(sets.PetMDTAxes)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    equip(sets.PDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    equip(sets.MDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    equip(sets.MEvaAxes)
                elseif state.IdleMode.value == "PetRegen" then
                    equip(sets.PetRegenAxes)
                else
                    equip(sets.IdleAxes)
                end
            else
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    equip(sets.PetPDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    equip(sets.PetMDTAxeShield)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    equip(sets.PDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    equip(sets.MDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    equip(sets.MEvaAxeShield)
                elseif state.IdleMode.value == "PetRegen" then
                    equip(sets.PetRegenAxeShield)
                else
                    equip(sets.IdleAxeShield)
                end
            end
        end
    end

    handle_equipping_gear(player.status)
end

function pet_buff_timer(spell)
    if spell.english == 'Reward' then
        send_command('timers c "Pet: Regen" 180 down '..RewardRegenIcon..'')
    elseif spell.english == 'Spur' then
        send_command('timers c "Pet: Spur" 90 down '..SpurIcon..'')
    elseif spell.english == 'Run Wild' then
        send_command('timers c "'..spell.english..'" '..RunWildDuration..' down '..RunWildIcon..'')
    end
end

function clear_pet_buff_timers()
    send_command('timers c "Pet: Regen" 0 down '..RewardRegenIcon..'')
    send_command('timers c "Pet: Spur" 0 down '..SpurIcon..'')
    send_command('timers c "Run Wild" 0 down '..RunWildIcon..'')
end

function display_mode_info()
    if DisplayModeInfo == 'true' and DisplayTrue == 1 then
        local x = TextBoxX
        local y = TextBoxY
        send_command('text AccuracyText create Acc. Mode: '..state.OffenseMode.value..'')
        send_command('text AccuracyText pos '..x..' '..y..'')
        send_command('text AccuracyText size '..TextSize..'')
        y = y + (TextSize + 6)
        send_command('text CorrelationText create Corr. Mode: '..state.CorrelationMode.value..'')
        send_command('text CorrelationText pos '..x..' '..y..'')
        send_command('text CorrelationText size '..TextSize..'')
        y = y + (TextSize + 6)
        send_command('text AxeModeText create Axe Mode: '..state.AxeMode.value..'')
        send_command('text AxeModeText pos '..x..' '..y..'')
        send_command('text AxeModeText size '..TextSize..'')
        y = y + (TextSize + 6)
        send_command('text JugPetText create Jug Mode: '..state.JugMode.value..'')
        send_command('text JugPetText pos '..x..' '..y..'')
        send_command('text JugPetText size '..TextSize..'')
        DisplayTrue = DisplayTrue - 1
    end
end

function update_display_mode_info()
    if DisplayModeInfo == 'true' then
        send_command('text AccuracyText text Acc. Mode: '..state.OffenseMode.value..'')
        send_command('text CorrelationText text Corr. Mode: '..state.CorrelationMode.value..'')
        send_command('text AxeModeText text Axe Mode: '..state.AxeMode.value..'')
        send_command('text JugPetText text Jug Mode: '..state.JugMode.value..'')
    end
end

function get_melee_groups()
    classes.CustomMeleeGroups:clear()

    if buffactive['Aftermath: Lv.3'] then
        classes.CustomMeleeGroups:append('Aftermath')
    end
end

function get_combat_form()
    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
        state.CombatForm:set('DW')
    else
        state.CombatForm:reset()
    end
end

function select_default_macro_book()
    set_macro_page(1, 2)
end

function set_lockstyle()

	send_command('wait 2; input /lockstyleset 15')

end


[Mod Edit: Code tags - AnnaMolly]
 Lakshmi.Elidyr
Offline
サーバ: Lakshmi
Game: FFXI
user: elii
Posts: 912
By Lakshmi.Elidyr 2017-10-31 11:48:16  
Havok16 said: »
Hello Guys

I'm struggling with an error in my bst.lua and only with bst.lua.
the error says

>Gearswap: Lua runtime error: Gearswap/flow.lua:102:
>User event error: ...6)Windower4/Addons/Gearswap/libs/organizer-lib.lua:101: atempt to get lenght of field '?'(a nil value)

My bst lua was working well, then i modified some gear like usualy with every other lua, but i get this error randomly. i cancelled lua and did a new one again. worked fine, modified again and got the error.

Think I posted in another post on the same thing. Is the error random? What exact line were you editing when it failed to work? Also I think you can use "["code"]" "["/code"]" to help clean that up.
 Asura.Chiaia
VIP
Offline
サーバ: Asura
Game: FFXI
user: Demmis
Posts: 1656
By Asura.Chiaia 2017-10-31 11:51:58  
https://pastebin.com/ is your friend or at the very least use the code tags lol
[+]
 Lakshmi.Elidyr
Offline
サーバ: Lakshmi
Game: FFXI
user: elii
Posts: 912
By Lakshmi.Elidyr 2017-10-31 11:53:08  
Asura.Chiaia said: »
https://pastebin.com/ is your friend or at the very least use the code tags lol

Didnt even think about pastebin, I can't log in to their site. Thinks I am a robot.
Offline
Posts: 20
By Havok16 2017-10-31 11:56:42  
Code
-------------------------------------------------------------------------------------------------------------------
-- Initialization function that defines sets and variables to be used.
-------------------------------------------------------------------------------------------------------------------

-- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.

-- Initialization function for this job file.
function get_sets()
    mote_include_version = 2

    -- Load and initialize the include file.
    include('Mote-Include.lua')
    include('organizer-lib')
end

function job_setup()
    -- Display and Random Lockstyle Generator options
    DisplayPetBuffTimers = 'false'
    DisplayModeInfo = 'false'
    RandomLockstyleGenerator = 'true'

    PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None'
    pet_info_update()

    -- Input Pet:TP Bonus values for Skirmish Axes used during Pet Buffs
    TP_Bonus_Main = 200
    TP_Bonus_Sub = 200

    -- 1200 Job Point Gift Bonus (Set equal to 0 if below 1200 Job Points)
    TP_Gift_Bonus = 40

    -- (Adjust Run Wild Duration based on # of Job Points)
    RunWildDuration = 340;RunWildIcon = 'abilities/00121.png'
    RewardRegenIcon = 'spells/00023.png'
    SpurIcon = 'abilities/00037.png'
    BubbleCurtainDuration = 180;BubbleCurtainIcon = 'spells/00048.png'
    ScissorGuardIcon = 'spells/00043.png'
    SecretionIcon = 'spells/00053.png'
    RageIcon = 'abilities/00002.png'
    RhinoGuardIcon = 'spells/00053.png'
    ZealousSnortIcon = 'spells/00057.png'

    -- Display Mode Info as on-screen Text
    TextBoxX = 1075
    TextBoxY = 47
    TextSize = 10

    -- List of Equipment Sets created for Random Lockstyle Generator
    -- (If you want to have the same Lockstyle every time, reduce the list to a single Equipset #)
    random_lockstyle_list = {1,2,3,4,5,6,7,8,9,10,11}

    state.Buff['Aftermath: Lv.3'] = buffactive['Aftermath: Lv.3'] or false
    state.Buff['Killer Instinct'] = buffactive['Killer Instinct'] or false

    if DisplayModeInfo == 'true' then
        DisplayTrue = 1
    end

    get_combat_form()
    get_melee_groups()
end

function user_setup()
    state.OffenseMode:options('Normal', 'MedAcc', 'HighAcc', 'MaxAcc')
    state.WeaponskillMode:options('Normal', 'WSMedAcc', 'WSHighAcc')
    state.HybridMode:options('Normal', 'Hybrid', 'PetSB', 'PetSTP')
    state.CastingMode:options('Normal')
    state.IdleMode:options('Normal', 'Reraise')
    state.RestingMode:options('Normal')
    state.PhysicalDefenseMode:options('PetPDT', 'PDT')
    state.MagicalDefenseMode:options('PetMDT', 'MDTShell', 'MEva')
	select_default_macro_book()
	set_lockstyle()

    -- Set up Jug Pet cycling and keybind Alt+F8/Ctrl+F8
    -- INPUT PREFERRED JUG PETS HERE
    state.JugMode = M{['description']='Jug Mode', 'Meaty Broth', 'Bubbly Broth', 'Livid Broth',
        'Tant. Broth', 'Blackwater Broth', 'Bug-Ridden Broth', 'Electrified Broth', 'Wetlands Broth', 'Spicy Broth'}
    send_command('bind !f8 gs c cycle JugMode')
    send_command('bind ^f8 gs c cycleback JugMode')

    -- Set up Monster Correlation Modes and keybind Alt+F11
    state.CorrelationMode = M{['description']='Correlation Mode', 'Neutral', 'Favorable'}
    send_command('bind !f11 gs c cycle CorrelationMode')

    -- Set up Axe Swapping Modes and keybind alt+=
    state.AxeMode = M{['description']='Axe Mode', 'PetOnly', 'NoSwaps'}
    send_command('bind != gs c cycle AxeMode')

    -- Keybind Ctrl+F11 to cycle Magical Defense Modes
    send_command('bind ^f11 gs c cycle MagicalDefenseMode')

    -- Set up Treasure Modes and keybind Ctrl+`
    state.TreasureMode = M{['description']='Treasure Mode', 'Tag', 'Normal'}
    send_command('bind ^` gs c cycle TreasureMode')

    -- Set up Lag Modes and keybind Ctrl+=
    state.LagMode = M{['description']='Lag Mode', 'Normal', 'Lag'}
    send_command('bind ^= gs c cycle LagMode')

    -- 'Out of Range' distance; Melee WSs will auto-cancel
    target_distance = 8

-- Categorized list of Ready moves
physical_ready_moves = S{'Foot Kick','Whirl Claws','Sheep Charge','Lamb Chop','Head Butt','Wild Oats',
    'Leaf Dagger','Claw Cyclone','Razor Fang','Nimble Snap','Cyclotail','Rhino Attack','Power Attack',
    'Mandibular Bite','Big Scissors','Grapple','Spinning Top','Double Claw','Frogkick','Blockhead',
    'Brain Crush','Tail Blow','??? Needles','Needleshot','Scythe Tail','Ripper Fang','Chomp Rush',
    'Recoil Dive','Sudden Lunge','Spiral Spin','Wing Slap','Beak Lunge','Suction','Back Heel',
    'Fantod','Tortoise Stomp','Sensilla Blades','Tegmina Buffet','Swooping Frenzy','Pentapeck',
    'Sweeping Gouge','Somersault','Tickling Tendrils','Pecking Flurry','Sickle Slash'}

magic_atk_ready_moves = S{'Dust Cloud','Cursed Sphere','Venom','Toxic Spit','Bubble Shower','Drainkiss',
    'Silence Gas','Dark Spore','Fireball','Plague Breath','Snow Cloud','Charged Whisker','Purulent Ooze',
    'Corrosive Ooze','Aqua Breath','Stink Bomb','Nectarous Deluge','Nepenthic Plunge','Pestilent Plume',
    'Foul Waters','Acid Spray','Infected Leech','Gloom Spray'}

magic_acc_ready_moves = S{'Sheep Song','Scream','Dream Flower','Roar','Gloeosuccus','Palsy Pollen',
    'Soporific','Geist Wall','Toxic Spit','Numbing Noise','Spoil','Hi-Freq Field','Sandpit','Sandblast',
    'Venom Spray','Filamented Hold','Queasyshroom','Numbshroom','Spore','Shakeshroom','Infrasonics',
    'Chaotic Eye','Blaster','Intimidate','Noisome Powder','Acid Mist','TP Drainkiss','Choke Breath',
    'Jettatura','Molting Plumage','Spider Web'}

multi_hit_ready_moves = S{'Pentapeck','Tickling Tendrils','Sweeping Gouge','Chomp Rush','Wing Slap',
    'Pecking Flurry'}

tp_based_ready_moves = S{'Foot Kick','Dust Cloud','Snow Cloud','Sheep Song','Sheep Charge','Lamb Chop',
    'Head Butt','Scream','Dream Flower','Wild Oats','Leaf Dagger','Claw Cyclone','Razor Fang','Roar',
    'Gloeosuccus','Palsy Pollen','Soporific','Cursed Sphere','Somersault','Geist Wall','Numbing Noise',
    'Frogkick','Nimble Snap','Cyclotail','Spoil','Rhino Attack','Hi-Freq Field','Sandpit','Sandblast',
    'Mandibular Bite','Metallic Body','Bubble Shower','Grapple','Spinning Top','Double Claw','Spore',
    'Filamented Hold','Blockhead','Fireball','Tail Blow','Plague Breath','Brain Crush','Infrasonics',
    'Needleshot','Chaotic Eye','Blaster','Ripper Fang','Intimidate','Recoil Dive','Water Wall',
    'Sudden Lunge','Noisome Powder','Wing Slap','Beak Lunge','Suction','Drainkiss','Acid Mist',
    'TP Drainkiss','Back Heel','Jettatura','Choke Breath','Fantod','Charged Whisker','Purulent Ooze',
    'Corrosive Ooze','Tortoise Stomp','Aqua Breath','Sensilla Blades','Tegmina Buffet','Sweeping Gouge',
    'Tickling Tendrils','Pecking Flurry','Pestilent Plume','Foul Waters','Spider Web','Gloom Spray'}

-- List of Pet Buffs and Ready moves exclusively modified by Pet TP Bonus gear.
pet_buff_moves = S{'Reward','Spur','Run Wild','Wild Carrot','Bubble Curtain','Scissor Guard','Secretion','Rage',
    'Harden Shell','Rhino Guard','Zealous Snort'}

-- List of Jug Modes that will cancel if Call Beast is used (Bestial Loyalty-only jug pets, HQs generally).
call_beast_cancel = S{'Vis. Broth','Ferm. Broth','Bubbly Broth','Windy Greens','Bug-Ridden Broth','Tant. Broth',
    'Glazed Broth','Slimy Webbing','Deepwater Broth','Venomous Broth','Heavenly Broth'}

-- List of abilities to reference for applying Treasure Hunter gear.
abilities_to_check = S{'Feral Howl','Quickstep','Box Step','Stutter Step','Desperate Flourish',
    'Violent Flourish','Animated Flourish','Provoke','Dia','Dia II','Flash','Bio','Bio II',
    'Sleep','Sleep II','Drain','Aspir','Dispel','Stun','Steal','Mug'}

enmity_plus_moves = S{'Provoke','Berserk','Warcry','Aggressor','Holy Circle','Sentinel','Last Resort',
    'Souleater','Vallation','Swordplay'}

-- Random Lockstyle generator.
    if RandomLockstyleGenerator == 'true' then
        local randomLockstyle = random_lockstyle_list[math.random(1, #random_lockstyle_list)]
        send_command('@wait 5;input /lockstyleset '.. randomLockstyle)
    end

    display_mode_info()
end

function file_unload()
    if binds_on_unload then
        binds_on_unload()
    end

    -- Unbinds the Reward, Correlation, JugMode, AxeMode and Treasure hotkeys.
    send_command('unbind !=')
    send_command('unbind ^=')
    send_command('unbind @=')
    send_command('unbind !f8')
    send_command('unbind ^f8')
    send_command('unbind @f8')
    send_command('unbind ^f11')

    -- Removes any Text Info Boxes
    send_command('text JugPetText delete')
    send_command('text CorrelationText delete')
    send_command('text AxeModeText delete')
    send_command('text AccuracyText delete')
end

-- BST gearsets
function init_gear_sets()

    --------------------
    -- AUGMENTED GEAR --
    --------------------

    Pet_Idle_AxeMain = "Guttler"
    Pet_Idle_AxeSub = "Arktoi"
    Pet_PDT_AxeMain = "Izizoeksi"
    Pet_PDT_AxeSub = "Arktoi"
    Pet_MDT_AxeMain = "Izizoeksi"
    Pet_MDT_AxeSub = "Arktoi"
    Pet_TP_AxeMain = "Guttler"
    Pet_TP_AxeSub = { name="Skullrender", augments={'DMG:+15','Pet: Accuracy+20','Pet: Attack+20',}}
    Pet_Regen_AxeMain = { name="Skullrender", augments={'DMG:+15','Pet: "Mag.Atk.Bns."+15','Pet: "Regen"+2',}}
    Pet_Regen_AxeSub = { name="Skullrender", augments={'DMG:+15','Pet: Accuracy+20','Pet: Attack+20',}}

   Ready_Atk_Axe = { name="Skullrender", augments={'DMG:+15','Pet: Accuracy+20','Pet: Attack+20',}}
    Ready_Atk_Axe2 = "Arktoi"
    Ready_Atk_TPBonus_Axe = { name="Skullrender", augments={'DMG:+15','Pet: Accuracy+20','Pet: Attack+20',}}
    Ready_Atk_TPBonus_Axe2 = { name="Skullrender", augments={'DMG:+15','Pet: "Mag.Atk.Bns."+15','Pet: "Regen"+2',}}

    Ready_Acc_Axe = "Arktoi"
    Ready_Acc_Axe2 = { name="Skullrender", augments={'DMG:+15','Pet: Accuracy+20','Pet: Attack+20',}}
    Ready_Acc_TPBonus_Axe = { name="Skullrender", augments={'DMG:+15','Pet: Accuracy+20','Pet: Attack+20',}}

    Ready_MAB_Axe = { name="Skullrender", augments={'DMG:+15','Pet: "Mag.Atk.Bns."+15','Pet: "Regen"+2',}}
    Ready_MAB_Axe2 = "Deacon Tabar"
    Ready_MAB_TPBonus_Axe = { name="Skullrender", augments={'DMG:+15','Pet: "Mag.Atk.Bns."+15','Pet: "Regen"+2',}}
    Ready_MAB_TPBonus_Axe2 = "Deacon Tabar"

    Ready_MAcc_Axe = { name="Skullrender", augments={'DMG:+15','Pet: "Mag.Atk.Bns."+15','Pet: "Regen"+2',}}
    Ready_MAcc_Axe2 = "Deacon Tabar"

    Reward_Axe = "Arktoi"
    Reward_Axe2 = { name="Skullrender", augments={'DMG:+15','Pet: Accuracy+20','Pet: Attack+20',}}
    Reward_hands = "Totemic Gloves +1"
    Reward_back = "Artio's Mantle"

    Pet_PDT_head = "Anwig Salade"
    Pet_PDT_body = "Totemic Jackcoat +2"
    Pet_PDT_hands = "Taeon Gloves"
    Pet_PDT_legs = "Tali'ah Seraweels +2"
    Pet_PDT_feet = "Totemic Gaiters +2"
    Pet_PDT_back = "Pastoralist's Mantle"

    Pet_MDT_head = "Anwig Salade"
    Pet_MDT_body = "Totemic Jackcoat +2"
    Pet_MDT_hands = "Taeon Gloves"
    Pet_MDT_legs = "Tali'ah Seraweels +2"
    Pet_MDT_feet = "Totemic Gaiters +2"

    Pet_DT_head = "Anwig Salade"
    Pet_DT_body = "Totemic Jackcoat +2"
    Pet_DT_hands = "Totemic Gloves +1"
    Pet_DT_legs = "Tali'ah Seraweels +2"
    Pet_DT_feet = "Totemic Gaiters +2"

    Pet_Regen_head = "Anwig Salade"
    Pet_Regen_body = "Totemic Jackcoat +2"
    Pet_Regen_hands = "Taeon Gloves"
    Pet_Regen_legs = "Tali'ah Seraweels +2"
    Pet_Regen_feet = "Totemic Gaiters +2"
    Pet_Regen_back = "Artio's Mantle"

    Ready_Atk_head = "Emicho Coronet"
    Ready_Atk_body = "Totemic Jackcoat +2"
    Ready_Atk_hands = "Nukumi Manoplas +1"
    Ready_Atk_legs = "Tali'ah Seraweels +2"
    Ready_Atk_feet = "Totemic Gaiters +2"
    Ready_Atk_back ="Artio's Mantle"

    Ready_Acc_head = "Tali'ah Turban +1"
    Ready_Acc_body = "Totemic Jackcoat +2"
    Ready_Acc_hands = "Nukumi Manoplas +1"
    Ready_Acc_legs = "Tali'ah Seraweels +2"
    Ready_Acc_feet = "Totemic Gaiters +2"
    Ready_Acc_back = "Artio's Mantle"
 
    Ready_MAB_head = "Tali'ah Turban +1" 
    Ready_MAB_body = "Emicho Haubert" 
    Ready_MAB_hands = "Nukumi Manoplas +1"
    Ready_MAB_legs = "Tali'ah Seraweels +2"
    Ready_MAB_feet = "Tali'ah Crackows +1" 

    Ready_MAcc_head = "Tali'ah Turban +1"
    Ready_MAcc_body = "Tali'ah Manteel +1"
    Ready_MAcc_hands = "Tali'ah Gages +1"
    Ready_MAcc_legs = "Tali'ah Seraweels +2"
    Ready_MAcc_feet = "Tali'ah Crackows +1"
    Ready_MAcc_back = "Artio's Mantle"

    Ready_DA_axe = { name="Skullrender", augments={'DMG:+15','Pet: Accuracy+20','Pet: Attack+20',}}
    Ready_DA_head = "Emicho Coronet"
    Ready_DA_body = "Emicho Haubert"
    Ready_DA_hands = "Emicho Gauntlets"
    Ready_DA_legs = "Emicho Hose"
    Ready_DA_feet = "Totemic Gaiters +2"

    Pet_Melee_head = "Emicho Coronet"
    Pet_Melee_body = "Emicho Haubert"
    Pet_Melee_hands = "Emicho Gauntlets"
    Pet_Melee_legs = "Emicho Hose"
    Pet_Melee_feet = "Totemic Gaiters +2"

    Pet_SB_body = "Emicho Haubert"

    Hybrid_head = "Despair Helm"
    Hybrid_body = Pet_PDT_body
    Hybrid_hands = Pet_PDT_hands
    Hybrid_legs = "Tali'ah Seraweels +2"
    Hybrid_feet = "Tali'ah Crackows +1"

    DW_head = "Emicho Coronet"
    DW_body = "Emicho Haubert"
    DW_hands = "Emicho Gauntlets"
    DW_legs = "Emicho Hose"
    DW_feet = "Totemic Gaiters +2"
    DW_back = "Artio's Mantle"

    MAB_head = "Jumalik Helm"
    MAB_body = "Jumalik Mail"
    MAB_hands = "Leyline Gloves"
    MAB_legs = "Emicho Hose"
    MAB_feet = "Totemic Gaiters +2"

    FC_head = "Tali'ah Turban +1"
    FC_body = "Tali'ah Manteel +1"
    FC_hands = "Leyline Gloves"
    FC_legs = "Taeon Tights"
    FC_feet = "Totemic Gaiters +2"
    FC_back = "Artio's Mantle"

    MAcc_head = "Tali'ah Turban +1"
    MAcc_body = "Tali'ah Manteel +1"
    MAcc_hands = "Tali'ah Gages +1"
    MAcc_legs = "Tali'ah Seraweels +2"
    MAcc_feet = "Tali'ah Crackows +1"
    MAcc_back = "Artio's Mantle"

    MEva_Axe_main = "Kumbhakarna"
    MEva_Axe_sub = "Arktoi"
    MEva_head = "Tali'ah Turban +1"
    MEva_body = "Totemic Jackcoat +2"
    MEva_hands = "Leyline Gloves"
    MEva_legs = "Arjuna Breeches"
    MEva_feet = "Shukuyu Sune-Ate"
    MEva_back = "Artio's Mantle"

    CB_head = {name="Acro Helm", augments={'Pet: Mag. Acc.+25','"Call Beast" ability delay -5',}}
    CB_body = "Mirke Wardecors"
    CB_hands = "Ankusa Gloves"
    CB_legs = {name="Acro Breeches", augments={'Pet: Mag. Acc.+25','"Call Beast" ability delay -5',}}
    CB_feet = "Armada Sollerets"

    Cure_Potency_axe = { name="Skullrender", augments={'DMG:+15','Pet: "Mag.Atk.Bns."+15','Pet: "Regen"+2',}}
    Cure_Potency_head = "Emicho Coronet"
    Cure_Potency_body = "Jumalik Mail"
    Cure_Potency_hands = "Buremte Gloves"
    Cure_Potency_legs = "Totemic Trousers +1"
    Cure_Potency_feet = "Totemic Gaiters +2"
    Cure_Potency_back = "Artio's Mantle"

    Waltz_back = "Artio's Mantle"

    STR_DA_back = "Artio's Mantle"
    STR_WS_back = "Artio's Mantle"
    Onslaught_back = "Artio's Mantle"
    Primal_back = "Artio's Mantle"
    Cloud_back = "Artio's Mantle"

    TH_hands = "Tali'ah Gages +1"
    TH_legs = "Tali'ah Seraweels +2"

    Enmity_plus_feet = "Tali'ah Crackows +1"
    Enmity_plus_back = "Artio's Mantle"

    sets.Enmity = {ammo="Paeapua",
        head="Rabid Visor",neck="Unmoving Collar",ear1="Friomisi Earring",ear2="Cryptic Earring",
        body="Emet Harness +1",hands="Macabre Gauntlets +1",ring1="Petrov Ring",ring2="Begrudging Ring",
        back=Enmity_plus_back,waist="Sinew Belt",feet=Enmity_plus_feet}
    sets.EnmityNE = set_combine(sets.Enmity, {main="Guttler",sub="Freydis"})
    sets.EnmityNEDW = set_combine(sets.Enmity, {main="Guttler",sub="Freydis"})

    ---------------------
    -- JA PRECAST SETS --
    ---------------------
    -- Most gearsets are divided into 3 categories:
    -- 1. Default - No Axe swaps involved.
    -- 2. NE (Not engaged) - Axe/Shield swap included, for use with Pet Only mode.
    -- 3. NEDW (Not engaged; Dual-wield) - Axe swaps included, for use with Pet Only mode.

    sets.precast.JA.Familiar = {legs="Ankusa Trousers +1"}
    sets.precast.JA['Call Beast'] = {head=CB_head,
        body=CB_body,
        hands=CB_hands,
        legs=CB_legs,
        feet=CB_feet}
    sets.precast.JA['Bestial Loyalty'] = sets.precast.JA['Call Beast']

    sets.precast.JA.Tame = {head="Totemic Helm +1",ear1="Tamer's Earring",legs="Stout Kecks"}

    sets.precast.JA.Spur = {back="Artio's Mantle",feet="Nukumi Ocreae +1"}
    sets.precast.JA.SpurNE = set_combine(sets.precast.JA.Spur, {main="Skullrender"})
    sets.precast.JA.SpurNEDW = set_combine(sets.precast.JA.Spur, {main="Skullrender",sub="Skullrender"})

    --sets.precast.JA['Feral Howl'] = {ammo="Pemphredo Tathlum",
    --    head=MAcc_head,neck="Sanctity Necklace",ear1="Hermetic Earring",ear2="Dignitary's Earring",
    --    body=MAcc_body,hands=MAcc_hands,ring1="Veneficium Ring",ring2="Sangoma Ring",
    --    back=MAcc_back,waist="Eschan Stone",legs=MAcc_legs,feet=MAcc_feet}
    sets.precast.JA['Feral Howl'] = sets.Enmity

    sets.precast.JA['Killer Instinct'] = set_combine(sets.Enmity, {head="Ankusa Helm +1"})

    sets.precast.JA.Reward = {ammo="Pet Food Theta",
        head="Stout Bonnet",neck="Aife's Medal",ear1="Lifestorm Earring",ear2="Star Earring",
        body="Totemic Jackcoat +2",hands=Reward_hands,ring1="Leviathan Ring +1",ring2="Aquamarine Ring",
        back=Reward_back,waist="Engraved Belt",legs="Totemic Trousers +1",feet="Shukuyu Sune-Ate"}
    sets.precast.JA.RewardNE = set_combine(sets.precast.JA.Reward, {main=Reward_Axe,sub="Adapa Shield"})
    sets.precast.JA.RewardNEDW = set_combine(sets.precast.JA.RewardNE, {sub=Reward_Axe2})

    sets.precast.JA.Charm = {ammo="Tsar's Egg",
        head="Totemic Helm +1",neck="Dualism Collar +1",ear1="Enchanter's Earring",ear2="Enchanter Earring +1",
        body="Totemic Jackcoat +2",hands="Ankusa Gloves",ring1="Dawnsoul Ring",ring2="Dawnsoul Ring",
        back=Primal_back,waist="Aristo Belt",legs="Ankusa Trousers +1",feet="Ankusa Gaiters +1"}
    sets.precast.JA.CharmNE = set_combine(sets.precast.JA.Charm, {main="Buramgh +1",sub="Adapa Shield"})
    sets.precast.JA.CharmNEDW = set_combine(sets.precast.JA.CharmNE, {sub="Buramgh"})

    ---------------------------
    -- PET SIC & READY MOVES --
    ---------------------------

    sets.ReadyRecast = {legs="Desultor Tassets"}
    sets.midcast.Pet.TPBonus = {hands="Nukumi Manoplas +1"}
    sets.midcast.Pet.Neutral = {head=Ready_Atk_head}
    sets.midcast.Pet.Favorable = {head="Nukumi Cabasset +1"}

    sets.midcast.Pet.WS = {ammo="Demonry Core",
        neck="Shulmanu Collar",ear1="Ferine Earring",ear2="Enmerkar Earring",
        body=Ready_Atk_body,
        hands=Ready_Atk_hands,
        ring1="Varar Ring +1",
        ring2="Varar Ring +1",
        back=Ready_Atk_back,
        waist="Incarnation Sash",
        legs=Ready_Atk_legs,
        feet=Ready_Atk_feet}

    sets.midcast.Pet.MedAcc = set_combine(sets.midcast.Pet.WS, {
        ear2="Enmerkar Earring",
        body=Ready_Acc_body,
        back=Ready_Acc_back,
        waist="Incarnation Sash",
        legs=Ready_Acc_legs})

    sets.midcast.Pet.HighAcc = set_combine(sets.midcast.Pet.WS, {
        ear1="Ferine Earring",
        ear2="Enmerkar Earring",
        body=Ready_Acc_body,
        back=Ready_Acc_back,
        waist="Klouskap Sash",
        legs=Ready_Acc_legs,
        feet=Ready_Acc_feet})

    sets.midcast.Pet.MaxAcc = set_combine(sets.midcast.Pet.WS, {
        head="Totemic Helm +1",
        ear1="Ferine Earring",
        ear2="Enmerkar Earring",
        body="Tali'ah Manteel +1",
        hands="Tali'ah Gages +1",
        back=Ready_Acc_back,
        waist="Klouskap Sash",
        legs=Ready_Acc_legs,
        feet=Ready_Acc_feet})

    sets.midcast.Pet.MagicAtkReady = set_combine(sets.midcast.Pet.WS, {
        head=Ready_MAB_head,
        neck="Adad Amulet",
        ear1="Ferine Earring",ear2="Diamond Earring",
        body=Ready_MAB_body,
        hands=Ready_MAB_hands,
        back="Argochampsa Mantle",
        legs=Ready_MAB_legs,
        feet=Ready_MAB_feet})

    sets.midcast.Pet.MagicAtkReady.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReady, {
        head=Ready_MAcc_head,
        ear2="Enmerkar Earring",
        legs=Ready_MAcc_legs})

    sets.midcast.Pet.MagicAtkReady.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReady, {
        head=Ready_MAcc_head,
        ear2="Enmerkar Earring",
        body=Ready_MAcc_body,
        hands=Ready_MAcc_hands,
        back=Ready_MAcc_back,
        legs=Ready_MAcc_legs})

    sets.midcast.Pet.MagicAtkReady.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReady, {
        head=Ready_MAcc_head,
        ear1="Sapphire Earring",ear2="Enmerkar Earring",
        body=Ready_MAcc_body,
        hands=Ready_MAcc_hands,
        back=Ready_MAcc_back,
        legs=Ready_MAcc_legs,
        feet=Ready_MAcc_feet})

    sets.midcast.Pet.MagicAccReady = set_combine(sets.midcast.Pet.WS, {
        head=Ready_MAcc_head,
        neck="Adad Amulet",
        ear1="Sapphire Earring",ear2="Enmerkar Earring",
        body=Ready_MAcc_body,
        hands=Ready_MAcc_hands,
        back=Ready_MAcc_back,
        legs=Ready_MAcc_legs,
        feet=Ready_MAcc_feet})

    sets.midcast.Pet.MultiStrike = set_combine(sets.midcast.Pet.WS, {
        neck="Shulmanu Collar",ear2="Domesticator's Earring",
        body=Ready_DA_body,
        hands=Ready_DA_hands,
        legs=Ready_DA_legs,
        feet=Ready_DA_feet})

    sets.midcast.Pet.SubtleBlowMNK = {ear1="Gelai Earring",
        body=Pet_SB_body,
        waist="Isa Belt"}

    sets.midcast.Pet.SubtleBlowNonMNK = set_combine(sets.midcast.Pet.WS, {
        ear1="Gelai Earring",
        body=Pet_SB_body,
        waist="Isa Belt"})

    sets.midcast.Pet.Buff = set_combine(sets.midcast.Pet.TPBonus, {
        body="Emicho Haubert",
        hands="Nukumi Manoplas +1"})

    --------------------------------------
    -- SINGLE WIELD PET-ONLY READY SETS --
    --------------------------------------

    sets.ReadyRecastNE = {main="Charmer's Merlin",legs="Desultor Tassets"}

    -- Physical Ready Attacks w/o TP Modifier for Damage (ex. Sickle Slash, Whirl Claws, Swooping Frenzy, etc.)
    sets.midcast.Pet.ReadyNE = set_combine(sets.midcast.Pet.WS, {main=Ready_Atk_Axe})
    sets.midcast.Pet.ReadyNE.MedAcc = set_combine(sets.midcast.Pet.MedAcc, {main=Ready_Atk_Axe})
    sets.midcast.Pet.ReadyNE.HighAcc = set_combine(sets.midcast.Pet.HighAcc, {main=Ready_Atk_Axe})
    sets.midcast.Pet.ReadyNE.MaxAcc = set_combine(sets.midcast.Pet.MaxAcc, {main=Ready_Acc_Axe})

    -- Physical TP Bonus Ready Attacks (ex. Razor Fang, Tegmina Buffet, Tail Blow, Recoil Dive, etc.)
    sets.midcast.Pet.ReadyNE.TPBonus = set_combine(sets.midcast.Pet.ReadyNE, {main=Ready_Atk_TPBonus_Axe})
    sets.midcast.Pet.ReadyNE.TPBonus.MedAcc = set_combine(sets.midcast.Pet.ReadyNE.MedAcc, {main=Ready_Atk_TPBonus_Axe})
    sets.midcast.Pet.ReadyNE.TPBonus.HighAcc = set_combine(sets.midcast.Pet.ReadyNE.HighAcc, {main=Ready_Atk_TPBonus_Axe})
    sets.midcast.Pet.ReadyNE.TPBonus.MaxAcc = set_combine(sets.midcast.Pet.ReadyNE.MaxAcc, {main=Ready_Acc_Axe})

    -- Multihit Ready Attacks w/o TP Modifier for Damage (Pentapeck, Chomp Rush)
    sets.midcast.Pet.MultiStrikeNE = set_combine(sets.midcast.Pet.MultiStrike, {main=Ready_Atk_Axe2})

    -- Multihit TP Bonus Ready Attacks (Sweeping Gouge, Tickling Tendrils, Pecking Flurry, Wing Slap)
    sets.midcast.Pet.MultiStrikeNE.TPBonus = set_combine(sets.midcast.Pet.MultiStrike, {main=Ready_Atk_TPBonus_Axe})

    -- Magical Ready Attacks w/o TP Modifier for Damage (ex. Molting Plumage, Venom, Stink Bomb, etc.)
    sets.midcast.Pet.MagicAtkReadyNE = set_combine(sets.midcast.Pet.MagicAtkReady, {main=Ready_MAB_Axe})
    sets.midcast.Pet.MagicAtkReadyNE.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReady.MedAcc, {main=Ready_MAB_Axe})
    sets.midcast.Pet.MagicAtkReadyNE.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReady.HighAcc, {main=Ready_MAB_Axe})
    sets.midcast.Pet.MagicAtkReadyNE.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReady.MaxAcc, {main=Ready_MAcc_Axe2})

    -- Magical TP Bonus Ready Attacks (ex. Fireball, Cursed Sphere, Corrosive Ooze, etc.)
    sets.midcast.Pet.MagicAtkReadyNE.TPBonus = set_combine(sets.midcast.Pet.MagicAtkReadyNE, {main=Ready_MAB_TPBonus_Axe})
    sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MedAcc, {main=Ready_MAB_TPBonus_Axe})
    sets.midcast.Pet.MagicAtkReadyNE.TPBonus.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.HighAcc, {main=Ready_MAB_TPBonus_Axe})
    sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc, {main=Ready_MAcc_Axe2})

    -- Magical Ready Enfeebles (ex. Roar, Sheep Song, Infrasonics, etc.)
    sets.midcast.Pet.MagicAccReadyNE = set_combine(sets.midcast.Pet.MagicAccReady, {main=Ready_MAcc_Axe})

    -- Pet Buffs/Cures (Bubble Curtain, Scissor Guard, Secretion, Rage, Rhino Guard, Zealous Snort, Wild Carrot)
    sets.midcast.Pet.BuffNE = set_combine(sets.midcast.Pet.Buff, {main=Ready_Atk_TPBonus_Axe})

    -- Axe Swaps for when Pet TP is above a certain value.
    sets.UnleashAtkAxeShield = {main=Ready_Atk_Axe}
    sets.UnleashAtkAxeShield.MedAcc = {main=Ready_Atk_Axe}
    sets.UnleashAtkAxeShield.HighAcc = {main=Ready_Atk_Axe}

    sets.UnleashMABAxeShield = {main=Ready_MAB_Axe}
    sets.UnleashMABAxeShield.MedAcc = {main=Ready_MAB_Axe}
    sets.UnleashMABAxeShield.HighAcc = {main=Ready_MAB_Axe}

    ------------------------------------
    -- DUAL WIELD PET-ONLY READY SETS --
    ------------------------------------

    sets.ReadyRecastDWNE = {main={ name="Skullrender", augments={'DMG:+15','Pet: "Mag.Atk.Bns."+15','Pet: "Regen"+2',}},sub="Charmer's Merlin",legs="Desultor Tassets"}

    -- DW Axe Swaps for Physical Ready Attacks w/o TP Modifier for Damage (ex. Sickle Slash, Whirl Claws, Swooping Frenzy, etc.)
    sets.midcast.Pet.ReadyDWNE = set_combine(sets.midcast.Pet.ReadyNE, {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2})
    sets.midcast.Pet.ReadyDWNE.MedAcc = set_combine(sets.midcast.Pet.ReadyNE.MedAcc, {main=Ready_Atk_Axe,sub=Ready_Acc_Axe})
    sets.midcast.Pet.ReadyDWNE.HighAcc = set_combine(sets.midcast.Pet.ReadyNE.HighAcc, {main=Ready_Atk_Axe,sub=Ready_Acc_Axe})
    sets.midcast.Pet.ReadyDWNE.MaxAcc = set_combine(sets.midcast.Pet.ReadyNE.MaxAcc, {main=Ready_Acc_Axe,sub=Ready_Acc_Axe2})

    -- DW Axe Swaps for Physical TP Bonus Ready Attacks (ex. Razor Fang, Tegmina Buffet, Tail Blow, Recoil Dive, etc.)
    sets.midcast.Pet.ReadyDWNE.TPBonus = set_combine(sets.midcast.Pet.ReadyNE, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Atk_TPBonus_Axe2})
    sets.midcast.Pet.ReadyDWNE.TPBonus.MedAcc = set_combine(sets.midcast.Pet.ReadyNE.MedAcc, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Acc_TPBonus_Axe})
    sets.midcast.Pet.ReadyDWNE.TPBonus.HighAcc = set_combine(sets.midcast.Pet.ReadyNE.HighAcc, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Acc_TPBonus_Axe})
    sets.midcast.Pet.ReadyDWNE.TPBonus.MaxAcc = set_combine(sets.midcast.Pet.ReadyNE.MaxAcc, {main=Ready_Acc_Axe,sub=Ready_Acc_Axe2})

    -- DW Axe Swaps for Multihit Ready Attacks w/o TP Modifier for Damage (Pentapeck, Chomp Rush)
    sets.midcast.Pet.MultiStrikeDWNE = set_combine(sets.midcast.Pet.MultiStrikeNE, {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2})

    -- DW Axe Swaps for Multihit TP Bonus Ready Attacks (Sweeping Gouge, Tickling Tendrils, Pecking Flurry, Wing Slap)
    sets.midcast.Pet.MultiStrikeDWNE.TPBonus = set_combine(sets.midcast.Pet.MultiStrikeNE, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Atk_TPBonus_Axe2})

    -- DW Axe Swaps for Magical Ready Attacks w/o TP Modifier for Damage (ex. Molting Plumage, Stink Bomb, Venom, etc.)
    sets.midcast.Pet.MagicAtkReadyDWNE = set_combine(sets.midcast.Pet.MagicAtkReadyNE, {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2})
    sets.midcast.Pet.MagicAtkReadyDWNE.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MedAcc, {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2})
    sets.midcast.Pet.MagicAtkReadyDWNE.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.HighAcc, {main=Ready_MAB_Axe,sub=Ready_MAcc_Axe})
    sets.midcast.Pet.MagicAtkReadyDWNE.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc, {main=Ready_MAB_Axe,sub=Ready_MAcc_Axe})

    -- DW Axe Swaps for Magical TP Bonus Ready Attacks (ex. Fireball, Cursed Sphere, Corrosive Ooze, etc.)
    sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus = set_combine(sets.midcast.Pet.MagicAtkReadyNE, {main=Ready_MAB_TPBonus_Axe,sub=Ready_MAB_TPBonus_Axe2})
    sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MedAcc, {main=Ready_MAB_TPBonus_Axe,sub=Ready_MAB_TPBonus_Axe2})
    sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.HighAcc, {main=Ready_MAB_TPBonus_Axe,sub=Ready_MAB_TPBonus_Axe2})
    sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc, {main=Ready_MAB_Axe,sub=Ready_MAcc_Axe})

    -- DW Axe Swaps for Magical Ready Enfeebles (ex. Roar, Sheep Song, Infrasonics, etc.)
    sets.midcast.Pet.MagicAccReadyDWNE = set_combine(sets.midcast.Pet.MagicAccReadyNE, {main=Ready_MAB_Axe,sub=Ready_MAcc_Axe2})

    -- DW Axe Swaps for Pet Buffs/Cures (Bubble Curtain, Scissor Guard, Secretion, Rage, Rhino Guard, Zealous Snort, Wild Carrot)
    sets.midcast.Pet.BuffDWNE = set_combine(sets.midcast.Pet.BuffNE, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Atk_TPBonus_Axe2})

    -- Axe Swaps for when Pet TP is above a certain value.
    sets.UnleashAtkAxes = {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2}
    sets.UnleashAtkAxes.MedAcc = {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2}
    sets.UnleashAtkAxes.HighAcc = {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2}

    sets.UnleashMABAxes = {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2}
    sets.UnleashMABAxes.MedAcc = {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2}
    sets.UnleashMABAxes.HighAcc = {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2}
Offline
Posts: 20
By Havok16 2017-10-31 11:58:15  
sorry i apologize for the mess up. I was just editing gear. nothing special. i'm very confident with putting gearsets in, respecting quotes so i dont understande why, it works, and once i reload it doesnt work.
Offline
Posts: 20
By Havok16 2017-10-31 12:04:16  
Code
    ---------------
    -- IDLE SETS --
    ---------------

    sets.idle = {ammo="Demonry Core",
        head="Meghanada Visor +1",neck="Bathy Choker",ear1="Infused Earring",ear2="Dawn Earring",
        body="Meghanada Cuirie +1",hands="Meghanada Gloves +1",ring1="Meghanada Ring",ring2="Sheltered Ring",
        back="Solemnity Cape",waist="Flume Belt",legs="Meghanada Chausses +1",feet="Skadi's Jambeaux +1"}

    sets.idle.Refresh = set_combine(sets.idle, {head="Jumalik Helm",body="Jumalik Mail"})
    sets.idle.Reraise = set_combine(sets.idle, {head="Twilight Helm",body="Twilight Mail"})

    sets.idle.Pet = set_combine(sets.idle, {back=Pet_Regen_back})

    sets.idle.PetRegen = set_combine(sets.idle.Pet, {neck="Empath Necklace",feet=Pet_Regen_feet})

    sets.idle.Pet.Engaged = {ammo="Demonry Core",
        head=Pet_Melee_head,
        neck="Shulmanu Collar",ear1="Ferine Earring",ear2="Domesticator's Earring",
        body=Pet_Melee_body,
        hands=Pet_Melee_hands,
        ring1="Varar Ring +1",ring2="Varar Ring +1",
        back=Ready_Atk_back,
        waist="Incarnation Sash",
        legs=Pet_Melee_legs,
        feet=Pet_Melee_feet}

    sets.idle.Pet.Engaged.PetSBMNK = set_combine(sets.idle.Pet.Engaged, {
        ear1="Gelai Earring",
        body=Pet_SB_body,
        waist="Isa Belt"})

    sets.idle.Pet.Engaged.PetSBNonMNK = set_combine(sets.idle.Pet.Engaged, {
        ear1="Gelai Earring",
        body=Pet_SB_body,
        waist="Isa Belt"})

    sets.idle.Pet.Engaged.PetSTP = set_combine(sets.idle.Pet.Engaged, {
        ring2="Varar Ring +1"})

    sets.resting = {}

    ------------------
    -- DEFENSE SETS --
    ------------------

    -- Pet PDT and MDT sets:
    sets.defense.PetPDT = {
        ammo="Demonry Core",
        head="Anwig Salade",neck="Shepherd's Chain",
        ear1="Handler's Earring +1",ear2="Enmerkar Earring",
        body=Pet_PDT_body,
        hands=Pet_PDT_hands,
        ring1="Varar Ring +1",ring2="Defending Ring",
        back=Pet_PDT_back,
        waist="Isa Belt",
        legs=Pet_PDT_legs,
        feet=Pet_PDT_feet}

    sets.defense.PetMDT = set_combine(sets.defense.PetPDT, {
        ear1="Rimeice Earring",ear2="Enmerkar Earring",
        body=Pet_MDT_Body,
        hands=Pet_MDT_hands,
        ring1="Varar Ring +1",ring2="Defending Ring",
        legs=Pet_MDT_legs,
        feet=Pet_MDT_feet})

    -- Master PDT and MDT sets:
    sets.defense.PDT = {ammo="Staunch Tathlum",
        head="Jumalik Helm",neck="Loricate Torque +1",ear1="Odnowa Earring",ear2="Genmei Earring",
        body="Jumalik Mail",hands="Macabre Gauntlets +1",ring1="Warden's Ring",ring2="Defending Ring",
        back="Shadow Mantle",waist="Flume Belt",legs="Meghanada Chausses +1",feet="Amm Greaves"}

    sets.defense.Reraise = set_combine(sets.defense.PDT, {head="Twilight Helm",body="Twilight Mail"})

    sets.defense.HybridPDT = {ammo="Staunch Tathlum",
        head="Jumalik Helm",neck="Loricate Torque +1",ear1="Handler's Earring +1",ear2="Enmerkar Earring",
        body="Jumalik Mail",hands=Pet_PDT_hands,ring1="Dark Ring",ring2="Defending Ring",
        back="Solemnity Cape",waist="Flume Belt",legs=Pet_PDT_legs,feet="Amm Greaves"}

    sets.defense.MDT = set_combine(sets.defense.PDT, {ammo="Staunch Tathlum",
        head="Skormoth Mask",neck="Loricate Torque +1",ear1="Odnowa Earring",ear2="Etiolation Earring",
        body="Jumalik Mail",hands="Leyline Gloves",
        back="Reiki Cloak",waist="Nierenschutz"})

    sets.defense.MDTShell = set_combine(sets.defense.MDT, {ammo="Vanir Battery",
        neck="Inquisitor Bead Necklace",ear2="Genmei Earring",
        ring1="Shadow Ring",
        waist="Asklepian Belt",legs="Tali'ah Seraweels +2",feet="Tali'ah Crackows +1"})

    sets.defense.MEva = set_combine(sets.defense.MDT, {ammo="Staunch Tathlum",
        head=MEva_head,
        neck="Warder's Charm",ear1="Odnowa Earring",ear2="Genmei Earring",
        body=MEva_body,
        hands=MEva_hands,
        ring1="Vengeful Ring",ring2="Purity Ring",
        back=MEva_back,
        waist="Engraved Belt",
        legs=MEva_legs,
        feet=MEva_feet})

    sets.Kiting = {feet="Skadi's Jambeaux +1"}

    -------------------------------------------------------
    -- Single-wield Pet Only Mode Idle/Defense Axe Swaps --
    -------------------------------------------------------
    sets.IdleAxeShield = {main="Freydis",sub="Adapa Shield"}
    sets.PDTAxeShield = {main="Freydis",sub="Adapa Shield"}
    sets.MDTAxeShield = {main="Purgation",sub="Adapa Shield"}
    sets.MEvaAxeShield = {main=MEva_Axe_main,sub="Adapa Shield"}
    sets.PetPDTAxeShield = {main=Pet_PDT_AxeMain,sub="Adapa Shield"}
    sets.PetMDTAxeShield = {main=Pet_MDT_AxeMain,sub="Adapa Shield"}
    sets.PetTPAxeShield = {main=Pet_TP_AxeMain,sub="Adapa Shield"}
    sets.PetRegenAxeShield = {main=Pet_Regen_AxeMain,sub="Adapa Shield"}

    -----------------------------------------------------
    -- Dual-wield Pet Only Mode Idle/Defense Axe Swaps --
    -----------------------------------------------------
    sets.IdleAxes = {main="Freydis",sub="Guttler"}
    sets.PDTAxes = {main="Freydis",sub="Guttler"}
    sets.MDTAxes = {main="Izizoeksi",sub="Guttler"}
    sets.MEvaAxes = {main=MEva_Axe_main,sub=MEva_Axe_sub}
    sets.PetPDTAxes = {main=Pet_PDT_AxeMain,sub=Pet_PDT_AxeSub}
    sets.PetMDTAxes = {main=Pet_MDT_AxeMain,sub=Pet_MDT_AxeSub}
    sets.PetTPAxes = {main=Pet_TP_AxeMain,sub=Pet_TP_AxeSub}
    sets.PetRegenAxes = {main=Pet_Regen_AxeMain,sub=Pet_Regen_AxeSub}

    --------------------
    -- FAST CAST SETS --
    --------------------

    sets.precast.FC = {
        ammo="Sapience Orb",
        head=FC_head,
        neck="Orunmila's Torque",ear1="Loquacious Earring",ear2="Enchanter Earring +1",
        body=FC_body,
        hands=FC_hands,
        ring1="Prolix Ring",ring2="Veneficium Ring",
        back=FC_back,
        legs=FC_legs,
        feet=FC_feet}

    sets.precast.FCNE = set_combine(sets.precast.FC, {main="Shukuyu's Scythe",sub="Vivid Strap +1"})
    sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})

    ------------------
    -- MIDCAST SETS --
    ------------------

    sets.midcast.FastRecast = {
        ammo="Sapience Orb",
        head=FC_head,
        neck="Orunmila's Torque",ear1="Loquacious Earring",ear2="Enchanter Earring +1",
        body=FC_body,
        hands=FC_hands,
        ring1="Prolix Ring",ring2="Veneficium Ring",
        back=FC_back,
        legs=FC_legs,
        feet=FC_feet}

    sets.midcast.Cure = {ammo="Hydrocera",
        head=Cure_Potency_head,
        neck="Diemer Gorget",ear1="Domesticator's Earring",ear2="Mendicant's Earring",
        body=Cure_Potency_body,
        hands=Cure_Potency_hands,
        ring1="Lebeche Ring",ring2="Kunaji Ring",
        back=Cure_Potency_back,
        waist="Gishdubar Sash",
        legs=Cure_Potency_legs,
        feet=Cure_Potency_feet}

    sets.midcast.Curaga = sets.midcast.Cure
    sets.CurePetOnly = {main=Cure_Potency_axe,sub="Adapa Shield"}

    sets.midcast.Stoneskin = {ammo="Hydrocera",
        head="Jumalik Helm",neck="Stone Gorget",ear1="Earthcry Earring",ear2="Lifestorm Earring",
        body="Totemic Jackcoat +2",hands="Stone Mufflers",ring1="Leviathan Ring +1",ring2="Aquamarine Ring",
        back=Pet_PDT_back,waist="Engraved Belt",legs="Haven Hose"}

    sets.midcast.Cursna = set_combine(sets.midcast.FastRecast, {neck="Malison Medallion",
        ring1="Eshmun's Ring",ring2="Haoma's Ring",waist="Gishdubar Sash"})

    sets.midcast.Protect = {ring2="Sheltered Ring"}
    sets.midcast.Protectra = sets.midcast.Protect

    sets.midcast.Shell = {ring2="Sheltered Ring"}
    sets.midcast.Shellra = sets.midcast.Shell

    sets.midcast['Enfeebling Magic'] = {ammo="Pemphredo Tathlum",
        head=MAcc_head,neck="Sanctity Necklace",ear1="Hermetic Earring",ear2="Dignitary's Earring",
        body=MAcc_body,hands=MAcc_hands,ring1="Veneficium Ring",ring2="Sangoma Ring",
        back=MAcc_back,waist="Eschan Stone",legs=MAcc_legs,feet=MAcc_feet}

    sets.midcast['Elemental Magic'] = {ammo="Pemphredo Tathlum",
        head=MAB_head,neck="Baetyl Pendant",ear1="Hecate's Earring",ear2="Friomisi Earring",
        body=MAB_body,hands=MAB_hands,ring1="Acumen Ring",ring2="Fenrir Ring +1",
        back=MAcc_back,waist="Eschan Stone",legs=MAB_legs,feet=MAB_feet}

    sets.midcast.Flash = sets.Enmity

    --------------------------------------
    -- SINGLE-WIELD MASTER ENGAGED SETS --
    --------------------------------------

    sets.engaged = {ammo="Ginsen",
        head="Skormoth Mask",neck="Asperity Necklace",ear1="Sherida Earring",ear2="Brutal Earring",
        body="Emicho Haubert",hands="Argosy Mufflers",ring1="Hetairoi Ring",ring2="Epona's Ring",
        back=STR_DA_back,waist="Windbuffet Belt +1",legs="Meghanada Chausses +1",feet="Argosy Sollerets"}

    ------------------------------------
    -- DUAL-WIELD MASTER ENGAGED SETS --
    ------------------------------------

    sets.engaged.DW = {ammo="Paeapua",
        head=DW_head,neck="Asperity Necklace",ear1="Suppanomimi",ear2="Genmei Earring",
        body=DW_body,hands=DW_hands,ring1="Hetairoi Ring",ring2="Epona's Ring",
        back=DW_back,waist="Patentia Sash",legs=DW_legs,feet=DW_feet}

    sets.engaged.DW.Hybrid = {ammo="Demonry Core",
        head=Pet_PDT_head,neck="Shulmanu Collar",ear1="Enmerkar Earring",ear2="Sherida Earring",
        body=Pet_PDT_body,hands=Pet_PDT_hands,ring1="Varar Ring +1",ring2="Epona's Ring",
        back=DW_back,waist="Windbuffet Belt +1",legs="Meghanada Chausses +1",feet=DW_feet}

    --------------------
    -- MASTER WS SETS --
    --------------------

    sets.precast.WS = {ammo="Floestone",
        head="Argosy Celata",neck="Caro Necklace",ear1="Telos Earring",ear2="Sherida Earring",
        body="Nzingha Cuirass",hands="Argosy Mufflers",ring1="Ifrit Ring +1",ring2="Epona's Ring",
        back=STR_WS_back,waist="Windbuffet Belt +1",legs="Argosy Breeches",feet="Argosy Sollerets"}

    sets.precast.WS['Rampage'] = {ammo="Floestone",
        head="Argosy Celata",neck="Fotia Gorget",ear1="Sherida Earring",ear2="Brutal Earring",
        body="Nzingha Cuirass",hands="Argosy Mufflers",ring1="Ifrit Ring +1",ring2="Epona's Ring",
        back=STR_DA_back,waist="Fotia Belt",legs="Meghanada Chausses +1",feet="Argosy Sollerets"}
    sets.precast.WS['Rampage'].Gavialis = set_combine(sets.precast.WS['Rampage'], {head="Gavialis Helm"})

    sets.precast.WS['Calamity'] = {ammo="Floestone",
        head="Argosy Celata",neck="Caro Necklace",ear1="Telos Earring",ear2="Sherida Earring",
        body="Nzingha Cuirass",hands="Meghanada Gloves +1",ring1="Ifrit Ring +1",ring2="Epona's Ring",
        back=STR_WS_back,waist="Windbuffet Belt +1",legs="Argosy Breeches",feet="Argosy Sollerets"}

    sets.precast.WS['Mistral Axe'] = {ammo="Floestone",
        head="Argosy Celata",neck="Caro Necklace",ear1="Telos Earring",ear2="Sherida Earring",
        body="Nzingha Cuirass",hands="Meghanada Gloves +1",ring1="Ifrit Ring +1",ring2="Epona's Ring",
        back=STR_WS_back,waist="Windbuffet Belt +1",legs="Argosy Breeches",feet="Argosy Sollerets"}

    sets.precast.WS['Bora Axe'] = {ammo="Cheruski Needle",
        head="Argosy Celata",neck="Caro Necklace",ear1="Sherida Earring",ear2="Brutal Earring",
        body="Nzingha Cuirass",hands="Meghanada Gloves +1",ring1="Ilabrat Ring",ring2="Epona's Ring",
        back=Onslaught_back,waist="Windbuffet Belt +1",legs="Argosy Breeches",feet="Argosy Sollerets"}

    sets.precast.WS['Ruinator'] = {ammo="Floestone",
        head="Argosy Celata",neck="Fotia Gorget",ear1="Sherida Earring",ear2="Brutal Earring",
        body="Nzingha Cuirass",hands="Argosy Mufflers",ring1="Ifrit Ring +1",ring2="Epona's Ring",
        back=STR_DA_back,waist="Fotia Belt",legs="Meghanada Chausses +1",feet="Argosy Sollerets"}
    sets.precast.WS['Ruinator'].Gavialis = set_combine(sets.precast.WS['Ruinator'], {head="Gavialis Helm"})

    sets.precast.WS['Onslaught'] = {ammo="Cheruski Needle",
        head="Argosy Celata",neck="Caro Necklace",ear1="Sherida Earring",ear2="Brutal Earring",
        body="Nzingha Cuirass",hands="Meghanada Gloves +1",ring1="Ilabrat Ring",ring2="Epona's Ring",
        back=Onslaught_back,waist="Windbuffet Belt +1",legs="Argosy Breeches",feet="Argosy Sollerets"}

    sets.precast.WS['Primal Rend'] = {ammo="Pemphredo Tathlum",
        head=MAB_head,
        neck="Baetyl Pendant",ear1="Telos Earring",ear2="Friomisi Earring",
        body=MAB_body,
        hands=MAB_hands,
        ring1="Acumen Ring",ring2="Fenrir Ring +1",
        back=Primal_back,
        waist="Eschan Stone",
        legs=MAB_legs,
        feet=MAB_feet}

    sets.precast.WS['Cloudsplitter'] = set_combine(sets.precast.WS['Primal Rend'], {back=Cloud_back})

    sets.midcast.ExtraMAB = {ear1="Hecate's Earring"}

    ----------------
    -- OTHER SETS --
    ----------------

    --Precast Gear Sets for DNC subjob abilities:
    sets.precast.Waltz = {ammo="Sonia's Plectrum",
        ring1="Kunaji Ring",ring2="Valseur's Ring",
        back=Waltz_back}
    sets.precast.Step = {waist="Chaac Belt"}
    sets.precast.Flourish1 = {}
    sets.precast.Flourish1['Violent Flourish'] = {ammo="Pemphredo Tathlum",
        head=MAcc_head,neck="Sanctity Necklace",ear1="Hermetic Earring",ear2="Dignitary's Earring",
        body=MAcc_body,hands=MAcc_hands,ring1="Veneficium Ring",ring2="Sangoma Ring",
        back=MAcc_back,waist="Eschan Stone",legs=MAcc_legs,feet=MAcc_feet}

    --Misc Gear Sets
    sets.FrenzySallet = {head="Frenzy Sallet"}
    sets.precast.LuzafRing = {ring1="Luzaf's Ring"}
    sets.buff['Killer Instinct'] = {body="Nukumi Gausape +1"}
    sets.THGear = {hands=TH_hands,legs=TH_legs,waist="Chaac Belt"}
end

-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks that are called to process player actions at specific points in time.
-------------------------------------------------------------------------------------------------------------------

function job_precast(spell, action, spellMap, eventArgs)
-- Define class for Sic and Ready moves.
    if spell.type == "Monster" then
        classes.CustomClass = "WS"
 
        if state.LagMode.value == 'Lag' then
            if physical_ready_moves:contains(spell.name) then
                if state.AxeMode.value == 'PetOnly' then
                    if state.OffenseMode.value == 'MaxAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.ReadyDWNE.MaxAcc, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.ReadyNE.MaxAcc, sets.ReadyRecast)
                        end
                    elseif state.OffenseMode.value == 'HighAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.ReadyDWNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.ReadyNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
                        end
                    elseif state.OffenseMode.value == 'MedAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.ReadyDWNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.ReadyNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
                        end
                    else
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            if multi_hit_ready_moves:contains(spell.name) then
                                if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK, sets.ReadyRecastDWNE))
                                elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK, sets.ReadyRecastDWNE))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE))
                                end
                            else
                                equip(set_combine(sets.midcast.Pet.ReadyDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE))
                            end
                        else
                            if multi_hit_ready_moves:contains(spell.name) then
                                if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK, sets.ReadyRecast))
                                elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK, sets.ReadyRecast))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
                                end
                            else
                                equip(set_combine(sets.midcast.Pet.ReadyNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
                            end
                        end
                    end
                else
                    if state.OffenseMode.value == 'MaxAcc' then
                        equip(sets.midcast.Pet.MaxAcc, sets.ReadyRecast)
                    elseif state.OffenseMode.value == 'HighAcc' then
                        equip(sets.midcast.Pet.HighAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
                    elseif state.OffenseMode.value == 'MedAcc' then
                        equip(sets.midcast.Pet.MedAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
                    else
                        if multi_hit_ready_moves:contains(spell.name) then
                            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK, sets.ReadyRecast))
                            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK, sets.ReadyRecast))
                            else
                                equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
                            end
                        else
                            equip(set_combine(sets.midcast.Pet.WS, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
                        end
                    end
                end
            end

            if magic_atk_ready_moves:contains(spell.name) then
                if state.AxeMode.value == 'PetOnly' then
                    if state.OffenseMode.value == 'MaxAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.MaxAcc, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc, sets.ReadyRecast)
                        end
                    elseif state.OffenseMode.value == 'HighAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.HighAcc, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.HighAcc, sets.ReadyRecast)
                        end
                    elseif state.OffenseMode.value == 'MedAcc' then
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.MedAcc, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.MedAcc, sets.ReadyRecast)
                        end
                    else
                        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE, sets.ReadyRecastDWNE)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE, sets.ReadyRecast)
                        end
                    end
                else
                    equip(sets.midcast.Pet.MagicAtkReady, sets.ReadyRecast)
                end
            end

            if magic_acc_ready_moves:contains(spell.name) then
                if state.AxeMode.value == 'PetOnly' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        equip(sets.midcast.Pet.MagicAccReadyDWNE, sets.ReadyRecastDWNE)
                    else
                        equip(sets.midcast.Pet.MagicAccReadyNE, sets.ReadyRecast)
                    end
                else
                    equip(sets.midcast.Pet.MagicAccReady, sets.ReadyRecast)
                end
            end

            if pet_buff_moves:contains(spell.name) then
                if state.AxeMode.value == 'PetOnly' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        equip(sets.midcast.Pet.BuffDWNE, sets.ReadyRecastDWNE)
                    else
                        equip(sets.midcast.Pet.BuffNE, sets.ReadyRecast)
                    end
                else
                    equip(sets.midcast.Pet.Buff, sets.ReadyRecast)
                end
            end

            -- If Pet TP, before bonuses, is less than a certain value then equip Nukumi Manoplas +1.
            if (physical_ready_moves:contains(spell.name) or magic_atk_ready_moves:contains(spell.name)) and state.OffenseMode.value ~= 'MaxAcc' then
                if tp_based_ready_moves:contains(spell.name) and PetJob == 'Warrior' then
                    if pet_tp < 1300 then
                        equip(sets.midcast.Pet.TPBonus)
                    end
                elseif tp_based_ready_moves:contains(spell.name) and PetJob ~= 'Warrior' then
                    if pet_tp < 1800 then
                        equip(sets.midcast.Pet.TPBonus)
                    end
                end
            end
        eventArgs.handled = true
        else
            if state.AxeMode.value == 'PetOnly' and not buffactive['Unleash']then
                if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                    equip(sets.ReadyRecastDWNE)
                else
                    equip(sets.ReadyRecastNE)
                end
            else
                equip(sets.ReadyRecast)
            end
        end
    end

    if spell.english == 'Reward' then
        if state.AxeMode.value == 'PetOnly' then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                equip(sets.precast.JA.RewardNEDW)
            else
                equip(sets.precast.JA.RewardNE)
            end
        else
            equip(sets.precast.JA.Reward)
        end
    end

    if enmity_plus_moves:contains(spell.english) then
        if state.AxeMode.value == 'PetOnly' then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                equip(sets.EnmityNEDW)
            else
                equip(sets.EnmityNE)
            end
        else
            equip(sets.Enmity)
        end
    end

    if spell.english == 'Spur' then
        if state.AxeMode.value == 'PetOnly' then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                equip(sets.precast.JA.SpurNEDW)
            else
                equip(sets.precast.JA.SpurNE)
            end
        else
            equip(sets.precast.JA.Spur)
        end
    end

    if spell.english == 'Charm' then
        if state.AxeMode.value == 'PetOnly' then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                equip(sets.precast.JA.CharmNEDW)
            else
                equip(sets.precast.JA.CharmNE)
            end
        else
            equip(sets.precast.JA.Charm)
        end
    end

    if spell.english == 'Bestial Loyalty' or spell.english == 'Call Beast' then
        JugInfo = ''
        if state.JugMode.value == 'FunguarFamiliar' or state.JugMode.value == 'Seedbed Soil' then
            JugInfo = 'Seedbed Soil'
        elseif state.JugMode.value == 'CourierCarrie' or state.JugMode.value == 'Fish Oil Broth' then
            JugInfo = 'Fish Oil Broth'
        elseif state.JugMode.value == 'AmigoSabotender' or state.JugMode.value == 'Sun Water' then
            JugInfo = 'Sun Water'
        elseif state.JugMode.value == 'NurseryNazuna' or state.JugMode.value == 'Dancing Herbal Broth' or state.JugMode.value == 'D. Herbal Broth' then
            JugInfo = 'D. Herbal Broth'
        elseif state.JugMode.value == 'CraftyClyvonne' or state.JugMode.value == 'Cunning Brain Broth' or state.JugMode.value == 'Cng. Brain Broth' then
            JugInfo = 'Cng. Brain Broth'
        elseif state.JugMode.value == 'PrestoJulio' or state.JugMode.value == 'Chirping Grasshopper Broth' or state.JugMode.value == 'C. Grass Broth' then
            JugInfo = 'C. Grass Broth'
        elseif state.JugMode.value == 'SwiftSieghard' or state.JugMode.value == 'Mellow Bird Broth' or state.JugMode.value == 'Mlw. Bird Broth' then
            JugInfo = 'Mlw. Bird Broth'
        elseif state.JugMode.value == 'MailbusterCetas' or state.JugMode.value == 'Goblin Bug Broth' or state.JugMode.value == 'Gob. Bug Broth' then
            JugInfo = 'Gob. Bug Broth'
        elseif state.JugMode.value == 'AudaciousAnna' or state.JugMode.value == 'Bubbling Carrion Broth' then
            JugInfo = 'B. Carrion Broth'
        elseif state.JugMode.value == 'TurbidToloi' or state.JugMode.value == 'Auroral Broth' then
            JugInfo = 'Auroral Broth'
        elseif state.JugMode.value == 'SlipperySilas' or state.JugMode.value == 'Wormy Broth' then
            JugInfo = 'Wormy Broth'
        elseif state.JugMode.value == 'LuckyLulush' or state.JugMode.value == 'Lucky Carrot Broth' or state.JugMode.value == 'L. Carrot Broth' then
            JugInfo = 'L. Carrot Broth'
        elseif state.JugMode.value == 'DipperYuly' or state.JugMode.value == 'Wool Grease' then
            JugInfo = 'Wool Grease'
        elseif state.JugMode.value == 'FlowerpotMerle' or state.JugMode.value == 'Vermihumus' then
            JugInfo = 'Vermihumus'
        elseif state.JugMode.value == 'DapperMac' or state.JugMode.value == 'Briny Broth' then
            JugInfo = 'Briny Broth'
        elseif state.JugMode.value == 'DiscreetLouise' or state.JugMode.value == 'Deepbed Soil' then
            JugInfo = 'Deepbed Soil'
        elseif state.JugMode.value == 'FatsoFargann' or state.JugMode.value == 'Curdled Plasma Broth' or state.JugMode.value == 'C. Plasma Broth' then
            JugInfo = 'C. Plasma Broth'
        elseif state.JugMode.value == 'FaithfulFalcorr' or state.JugMode.value == 'Lucky Broth' then
            JugInfo = 'Lucky Broth'
        elseif state.JugMode.value == 'BugeyedBroncha' or state.JugMode.value == 'Savage Mole Broth' or state.JugMode.value == 'Svg. Mole Broth' then
            JugInfo = 'Svg. Mole Broth'
        elseif state.JugMode.value == 'BloodclawShasra' or state.JugMode.value == 'Razor Brain Broth' or state.JugMode.value == 'Rzr. Brain Broth' then
            JugInfo = 'Rzr. Brain Broth'
        elseif state.JugMode.value == 'GorefangHobs' or state.JugMode.value == 'Burning Carrion Broth' then
            JugInfo = 'B. Carrion Broth'
        elseif state.JugMode.value == 'GooeyGerard' or state.JugMode.value == 'Cloudy Wheat Broth' or state.JugMode.value == 'Cl. Wheat Broth' then
            JugInfo = 'Cl. Wheat Broth'
        elseif state.JugMode.value == 'CrudeRaphie' or state.JugMode.value == 'Shadowy Broth' then
            JugInfo = 'Shadowy Broth'
        elseif state.JugMode.value == 'DroopyDortwin' or state.JugMode.value == 'Swirling Broth' then
            JugInfo = 'Swirling Broth'
        elseif state.JugMode.value == 'PonderingPeter' or state.JugMode.value == 'Viscous Broth' or state.JugMode.value == 'Vis. Broth' then
            JugInfo = 'Vis. Broth'
        elseif state.JugMode.value == 'SunburstMalfik' or state.JugMode.value == 'Shimmering Broth' then
            JugInfo = 'Shimmering Broth'
        elseif state.JugMode.value == 'AgedAngus' or state.JugMode.value == 'Fermented Broth' or state.JugMode.value == 'Ferm. Broth' then
            JugInfo = 'Ferm. Broth'
        elseif state.JugMode.value == 'WarlikePatrick' or state.JugMode.value == 'Livid Broth' then
            JugInfo = 'Livid Broth'
        elseif state.JugMode.value == 'ScissorlegXerin' or state.JugMode.value == 'Spicy Broth' then
            JugInfo = 'Spicy Broth'
        elseif state.JugMode.value == 'BouncingBertha' or state.JugMode.value == 'Bubbly Broth' then
            JugInfo = 'Bubbly Broth'
        elseif state.JugMode.value == 'RhymingShizuna' or state.JugMode.value == 'Lyrical Broth' then
            JugInfo = 'Lyrical Broth'
        elseif state.JugMode.value == 'AttentiveIbuki' or state.JugMode.value == 'Salubrious Broth' then
            JugInfo = 'Salubrious Broth'
        elseif state.JugMode.value == 'SwoopingZhivago' or state.JugMode.value == 'Windy Greens' then
            JugInfo = 'Windy Greens'
        elseif state.JugMode.value == 'AmiableRoche' or state.JugMode.value == 'Airy Broth' then
            JugInfo = 'Airy Broth'
        elseif state.JugMode.value == 'HeraldHenry' or state.JugMode.value == 'Translucent Broth' or state.JugMode.value == 'Trans. Broth' then
            JugInfo = 'Trans. Broth'
        elseif state.JugMode.value == 'BrainyWaluis' or state.JugMode.value == 'Crumbly Soil' then
            JugInfo = 'Crumbly Soil'
        elseif state.JugMode.value == 'HeadbreakerKen' or state.JugMode.value == 'Blackwater Broth' then
            JugInfo = 'Blackwater Broth'
        elseif state.JugMode.value == 'RedolentCandi' or state.JugMode.value == 'Electrified Broth' then
            JugInfo = 'Electrified Broth'
        elseif state.JugMode.value == 'AlluringHoney' or state.JugMode.value == 'Bug-Ridden Broth' then
            JugInfo = 'Bug-Ridden Broth'
        elseif state.JugMode.value == 'CaringKiyomaro' or state.JugMode.value == 'Fizzy Broth' then
            JugInfo = 'Fizzy Broth'
        elseif state.JugMode.value == 'VivaciousVickie' or state.JugMode.value == 'Tantalizing Broth' or state.JugMode.value == 'Tant. Broth' then
            JugInfo = 'Tant. Broth'
        elseif state.JugMode.value == 'HurlerPercival' or state.JugMode.value == 'Pale Sap' then
            JugInfo = 'Pale Sap'
        elseif state.JugMode.value == 'BlackbeardRandy' or state.JugMode.value == 'Meaty Broth' then
            JugInfo = 'Meaty Broth'
        elseif state.JugMode.value == 'GenerousArthur' or state.JugMode.value == 'Dire Broth' then
            JugInfo = 'Dire Broth'
        elseif state.JugMode.value == 'ThreestarLynn' or state.JugMode.value == 'Muddy Broth' then
            JugInfo = 'Muddy Broth'
        elseif state.JugMode.value == 'BraveHeroGlenn' or state.JugMode.value == 'Wispy Broth' then
            JugInfo = 'Wispy Broth'
        elseif state.JugMode.value == 'SharpwitHermes' or state.JugMode.value == 'Saline Broth' then
            JugInfo = 'Saline Broth'
        elseif state.JugMode.value == 'ColibriFamiliar' or state.JugMode.value == 'Sugary Broth' then
            JugInfo = 'Sugary Broth'
        elseif state.JugMode.value == 'ChoralLeera' or state.JugMode.value == 'Glazed Broth' then
            JugInfo = 'Glazed Broth'
        elseif state.JugMode.value == 'SpiderFamiliar' or state.JugMode.value == 'Sticky Webbing' then
            JugInfo = 'Sticky Webbing'
        elseif state.JugMode.value == 'GussyHachirobe' or state.JugMode.value == 'Slimy Webbing' then
            JugInfo = 'Slimy Webbing'
        elseif state.JugMode.value == 'AcuexFamiliar' or state.JugMode.value == 'Poisonous Broth' then
            JugInfo = 'Poisonous Broth'
        elseif state.JugMode.value == 'FluffyBredo' or state.JugMode.value == 'Venomous Broth' then
            JugInfo = 'Venomous Broth'
        elseif state.JugMode.value == 'SuspiciousAlice' or state.JugMode.value == 'Furious Broth' then
            JugInfo = 'Furious Broth'
        elseif state.JugMode.value == 'AnklebiterJedd' or state.JugMode.value == 'Crackling Broth' then
            JugInfo = 'Crackling Broth'
        elseif state.JugMode.value == 'FleetReinhard' or state.JugMode.value == 'Rapid Broth' then
            JugInfo = 'Rapid Broth'
        elseif state.JugMode.value == 'CursedAnnabelle' or state.JugMode.value == 'Creepy Broth' then
            JugInfo = 'Creepy Broth'
        elseif state.JugMode.value == 'SurgingStorm' or state.JugMode.value == 'Insipid Broth' then
            JugInfo = 'Insipid Broth'
        elseif state.JugMode.value == 'SubmergedIyo' or state.JugMode.value == 'Deepwater Broth' then
            JugInfo = 'Deepwater Broth'
        elseif state.JugMode.value == 'MosquitoFamiliar' or state.JugMode.value == 'Wetlands Broth' then
            JugInfo = 'Wetlands Broth'
        elseif state.JugMode.value == 'Left-HandedYoko' or state.JugMode.value == 'Heavenly Broth' then
            JugInfo = 'Heavenly Broth'
        end
        if spell.english == "Call Beast" and call_beast_cancel:contains(JugInfo) then
            add_to_chat(123, spell.name..' Canceled: [HQ Jug Pet]')
            return
        end
        equip({ammo=JugInfo})
    end
Offline
Posts: 20
By Havok16 2017-10-31 12:04:57  
Code
    if player.equipment.main == 'Aymur' then
        custom_aftermath_timers_precast(spell)
    end

    if spell.type == "WeaponSkill" and spell.name ~= 'Mistral Axe' and spell.name ~= 'Bora Axe' and spell.target.distance > target_distance then
        cancel_spell()
        add_to_chat(123, spell.name..' Canceled: [Out of Range]')
        handle_equipping_gear(player.status)
        return
    end

    if spell.type == 'CorsairRoll' or spell.english == "Double-Up" then
        equip(sets.precast.LuzafRing)
    end

    if spell.prefix == '/magic' or spell.prefix == '/ninjutsu' or spell.prefix == '/song' then
        if state.AxeMode.value == 'PetOnly' then
            equip(sets.precast.FCNE)
        else
            equip(sets.precast.FC)
        end
    end
end

function customize_melee_set(meleeSet)
    if state.AxeMode.value == 'PetOnly' and pet.status == "Engaged" and player.status == "Engaged" and state.DefenseMode.value == "None" then
        if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                meleeSet = set_combine(meleeSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBMNK)
            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                meleeSet = set_combine(meleeSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBNonMNK)
            else
                meleeSet = set_combine(meleeSet, sets.PetTPAxes, sets.idle.Pet.Engaged)
            end
        else
            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                meleeSet = set_combine(meleeSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBMNK)
            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                meleeSet = set_combine(meleeSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBNonMNK)
            else
                meleeSet = set_combine(meleeSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged)
            end
        end
    end
    return meleeSet
end

function job_post_precast(spell, action, spellMap, eventArgs)
-- If Killer Instinct is active during WS, equip Nukumi Gausape +1.
    if spell.type:lower() == 'weaponskill' and buffactive['Killer Instinct'] then
        equip(sets.buff['Killer Instinct'])
    end

    if spell.english == "Primal Rend" or spell.english == "Cloudsplitter" then
        if player.tp > 2750 then
            equip(sets.midcast.ExtraMAB)
        end
    end

-- Equip Chaac Belt for TH+1 on common Subjob Abilities or Spells.
    if abilities_to_check:contains(spell.english) and state.TreasureMode.value == 'Tag' then
        equip(sets.THGear)
    end
end

function job_midcast(spell, action, spellMap, eventArgs)
    if state.AxeMode.value == 'PetOnly' then
        if spell.english == "Cure" or spell.english == "Cure II" or spell.english == "Cure III" or spell.english == "Cure IV" then
            equip(sets.CurePetOnly)
        end
        if spell.english == "Curaga" or spell.english == "Curaga II" or spell.english == "Curaga III" then
            equip(sets.CurePetOnly)
        end
    end
end

-- Return true if we handled the aftercast work.  Otherwise it will fall back
-- to the general aftercast() code in Mote-Include.
function job_aftercast(spell, action, spellMap, eventArgs)
    if spell.type == "Monster" and not spell.interrupted then
        if physical_ready_moves:contains(spell.name) then
            if state.AxeMode.value == 'PetOnly' then
                if state.OffenseMode.value == 'MaxAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyDWNE.TPBonus.MaxAcc)
                        else
                            equip(sets.midcast.Pet.ReadyDWNE.MaxAcc)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyNE.TPBonus.MaxAcc)
                        else
                            equip(sets.midcast.Pet.ReadyNE.MaxAcc)
                        end
                    end
                elseif state.OffenseMode.value == 'HighAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyDWNE.TPBonus.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        else
                            equip(sets.midcast.Pet.ReadyDWNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyNE.TPBonus.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        else
                            equip(sets.midcast.Pet.ReadyNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        end
                    end
                elseif state.OffenseMode.value == 'MedAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyDWNE.TPBonus.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        else
                            equip(sets.midcast.Pet.ReadyDWNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.ReadyNE.TPBonus.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        else
                            equip(sets.midcast.Pet.ReadyNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                        end
                    end
                else
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if multi_hit_ready_moves:contains(spell.name) then
                            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                                end
                            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                                end
                            else
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value]))
                                end
                            end
                        else
                            if tp_based_ready_moves:contains(spell.name) then
                                equip(set_combine(sets.midcast.Pet.ReadyDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
                            else
                                equip(set_combine(sets.midcast.Pet.ReadyDWNE, sets.midcast.Pet[state.CorrelationMode.value]))
                            end
                        end
                    else
                        if multi_hit_ready_moves:contains(spell.name) then
                            if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                                end
                            elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                                end
                            else
                                if tp_based_ready_moves:contains(spell.name) then
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
                                else
                                    equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value]))
                                end
                            end
                        else
                            if tp_based_ready_moves:contains(spell.name) then
                                equip(set_combine(sets.midcast.Pet.ReadyNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
                            else
                                equip(set_combine(sets.midcast.Pet.ReadyNE, sets.midcast.Pet[state.CorrelationMode.value]))
                            end
                        end
                    end
                end
            else
                if state.OffenseMode.value == 'MaxAcc' then
                    equip(sets.midcast.Pet.MaxAcc)
                elseif state.OffenseMode.value == 'HighAcc' then
                    equip(sets.midcast.Pet.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
                elseif state.OffenseMode.value == 'MedAcc' then
                    equip(sets.midcast.Pet.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
                else
                    if multi_hit_ready_moves:contains(spell.name) then
                        if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                            equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
                        elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                            equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
                        else
                            equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value]))
                        end
                    else
                        equip(set_combine(sets.midcast.Pet.WS, sets.midcast.Pet[state.CorrelationMode.value]))
                    end
                end
            end
        end

        if magic_atk_ready_moves:contains(spell.name) then
            if state.AxeMode.value == 'PetOnly' then
                if state.OffenseMode.value == 'MaxAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MaxAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.MaxAcc)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MaxAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc)
                        end
                    end
                elseif state.OffenseMode.value == 'HighAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.HighAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.HighAcc)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus.HighAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.HighAcc)
                        end
                    end
                elseif state.OffenseMode.value == 'MedAcc' then
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MedAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.MedAcc)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MedAcc)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE.MedAcc)
                        end
                    end
                else
                    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyDWNE)
                        end
                    else
                        if tp_based_ready_moves:contains(spell.name) then
                            equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus)
                        else
                            equip(sets.midcast.Pet.MagicAtkReadyNE)
                        end
                    end
                end
            else
                equip(sets.midcast.Pet.MagicAtkReady)
            end
        end

        if magic_acc_ready_moves:contains(spell.name) then
            if state.AxeMode.value == 'PetOnly' then
                if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                    equip(sets.midcast.Pet.MagicAccReadyDWNE)
                else
                    equip(sets.midcast.Pet.MagicAccReadyNE)
                end
            else
                equip(sets.midcast.Pet.MagicAccReady)
            end
        end

        if pet_buff_moves:contains(spell.name) then
            if state.AxeMode.value == 'PetOnly' then
                if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                    equip(sets.midcast.Pet.BuffDWNE)
                else
                    equip(sets.midcast.Pet.BuffNE)
                end
            else
                equip(sets.midcast.Pet.Buff)
            end
        end

        -- If Pet TP, before bonuses, is less than a certain value then equip Nukumi Manoplas +1.
        -- Or if Pet TP, before bonuses, is more than a certain value then equip Unleash-specific Axes.
        if (physical_ready_moves:contains(spell.name) or magic_atk_ready_moves:contains(spell.name)) and state.OffenseMode.value ~= 'MaxAcc' then
            if tp_based_ready_moves:contains(spell.name) and PetJob == 'Warrior' then
                if pet_tp < 1300 then
                    equip(sets.midcast.Pet.TPBonus)
                elseif pet_tp > 2000 and state.AxeMode.value == 'PetOnly' then
                    if physical_ready_moves:contains(spell.name) then
                        if state.OffenseMode.value == 'HighAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes.HighAcc)
                            else
                                equip(sets.UnleashAtkAxeShield.HighAcc)
                            end
                        elseif state.OffenseMode.value == 'MedAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes.MedAcc)
                            else
                                equip(sets.UnleashAtkAxeShield.MedAcc)
                            end
                        else
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes)
                            else
                                equip(sets.UnleashAtkAxeShield)
                            end
                        end
                    else
                        if state.OffenseMode.value == 'HighAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes.HighAcc)
                            else
                                equip(sets.UnleashMABAxeShield.HighAcc)
                            end
                        elseif state.OffenseMode.value == 'MedAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes.MedAcc)
                            else
                                equip(sets.UnleashMABAxeShield.MedAcc)
                            end
                        else
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes)
                            else
                                equip(sets.UnleashMABAxeShield)
                            end
                        end
                    end
                end
            elseif tp_based_ready_moves:contains(spell.name) and PetJob ~= 'Warrior' then
                if pet_tp < 1800 then
                    equip(sets.midcast.Pet.TPBonus)
                elseif pet_tp > 2500 and state.AxeMode.value == 'PetOnly' then
                    if physical_ready_moves:contains(spell.name) then
                        if state.OffenseMode.value == 'HighAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes.HighAcc)
                            else
                                equip(sets.UnleashAtkAxeShield.HighAcc)
                            end
                        elseif state.OffenseMode.value == 'MedAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes.MedAcc)
                            else
                                equip(sets.UnleashAtkAxeShield.MedAcc)
                            end
                        else
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashAtkAxes)
                            else
                                equip(sets.UnleashAtkAxeShield)
                            end
                        end
                    else
                        if state.OffenseMode.value == 'HighAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes.HighAcc)
                            else
                                equip(sets.UnleashMABAxeShield.HighAcc)
                            end
                        elseif state.OffenseMode.value == 'MedAcc' then
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes.MedAcc)
                            else
                                equip(sets.UnleashMABAxeShield.MedAcc)
                            end
                        else
                            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                                equip(sets.UnleashMABAxes)
                            else
                                equip(sets.UnleashMABAxeShield)
                            end
                        end
                    end
                end
            end
        end
    eventArgs.handled = true
    end

    -- Create custom timers for Pet Buffs.
    if pet_buff_moves:contains(spell.name) and DisplayPetBuffTimers == 'true' then
        if not spell.interrupted then
            pet_buff_timer(spell)
        end
    end

    if spell.english == 'Fight' or spell.english == 'Bestial Loyalty' or spell.english == 'Call Beast' then
        if not spell.interrupted then
            pet_info_update()
        end
    end

    if spell.english == "Leave" and not spell.interrupted then
        clear_pet_buff_timers()
        PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None'
    end

    if player.equipment.main == 'Aymur' then
        custom_aftermath_timers_aftercast(spell)
    end

    if player.status ~= 'Idle' and state.AxeMode.value == 'PetOnly' and spell.type ~= "Monster" then
        pet_only_equip_handling()
    end
end

function job_pet_midcast(spell, action, spellMap, eventArgs)

end

function job_pet_aftercast(spell, action, spellMap, eventArgs)
    if pet_buff_moves:contains(spell.name) and DisplayPetBuffTimers == 'true' then
        -- Pet TP calculations for Ready Buff Durations
        local TP_Amount = 1000
        if pet_tp < 1000 then TP_Amount = TP_Amount + TP_Gift_Bonus;end
        if pet_tp > 1000 then TP_Amount = pet_tp + TP_Gift_Bonus;end
        if player.equipment.hands == "Ferine Manoplas +1" then TP_Amount = TP_Amount + 250;end
        if player.equipment.hands == "Ferine Manoplas +2" then TP_Amount = TP_Amount + 500;end
        if player.equipment.hands == "Nukumi Manoplas" then TP_Amount = TP_Amount + 550;end
        if player.equipment.hands == "Nukumi Manoplas +1" then TP_Amount = TP_Amount + 600;end
        if player.equipment.main == "Aymur" or player.equipment.sub == "Aymur" then TP_Amount = TP_Amount + 500;end
        if player.equipment.main == "Kumbhakarna" then TP_Amount = TP_Amount + TP_Bonus_Main;end
        if player.equipment.sub == "Kumbhakarna" then TP_Amount = TP_Amount + TP_Bonus_Sub;end
        if TP_Amount > 3000 then TP_Amount = 3000;end

        if spell.english == 'Bubble Curtain' then
            local TP_Buff_Duration = math.floor((TP_Amount - 1000)* 0.09) + BubbleCurtainDuration
            send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..BubbleCurtainIcon..'')
        elseif spell.english == 'Scissor Guard' then
            local TP_Buff_Duration = math.floor(TP_Amount * 0.06)
            send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..ScissorGuardIcon..'')
        elseif spell.english == 'Secretion' then
            TP_Amount = TP_Amount + 500
            if TP_Amount > 3000 then TP_Amount = 3000;end
            local TP_Buff_Duration = math.floor(TP_Amount * 0.18)
            send_command('timers c "Secretion" '..TP_Buff_Duration..' down '..SecretionIcon..'')
        elseif spell.english == 'Rage' then
            TP_Amount = TP_Amount + 500
            if TP_Amount > 3000 then TP_Amount = 3000;end
            local TP_Buff_Duration = math.floor(TP_Amount * 0.18)
            send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..RageIcon..'')
        elseif spell.english == 'Rhino Guard' then
            local TP_Buff_Duration = math.floor(TP_Amount * 0.18)
            send_command('timers c "Rhino Guard" '..TP_Buff_Duration..' down '..RhinoGuardIcon..'')
        elseif spell.english == 'Zealous Snort' then
            local TP_Buff_Duration = math.floor(TP_Amount * 0.06)
            send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..ZealousSnortIcon..'')
        end
    end
    pet_only_equip_handling()
end

-------------------------------------------------------------------------------------------------------------------
-- Customization hook for idle sets.
-------------------------------------------------------------------------------------------------------------------

function customize_idle_set(idleSet)
    if state.AxeMode.value == 'PetOnly' then
        if pet.status == "Engaged" then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    idleSet = set_combine(idleSet, sets.PetPDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    idleSet = set_combine(idleSet, sets.PetMDTAxes)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    idleSet = set_combine(idleSet, sets.PDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    idleSet = set_combine(idleSet, sets.MDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    idleSet = set_combine(idleSet, sets.MEvaAxes)
                else
                    if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                        idleSet = set_combine(idleSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBMNK)
                    elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                        idleSet = set_combine(idleSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBNonMNK)
                    elseif state.HybridMode.value == 'PetSTP' then
                        idleSet = set_combine(idleSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSTP)
                    else
                        idleSet = set_combine(idleSet, sets.PetTPAxes)
                    end
                end
            else
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    idleSet = set_combine(idleSet, sets.PetPDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    idleSet = set_combine(idleSet, sets.PetMDTAxeShield)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    idleSet = set_combine(idleSet, sets.PDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    idleSet = set_combine(idleSet, sets.MDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    idleSet = set_combine(idleSet, sets.MEvaAxeShield)
                else
                    if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
                        idleSet = set_combine(idleSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBMNK)
                    elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
                        idleSet = set_combine(idleSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBNonMNK)
                    elseif state.HybridMode.value == 'PetSTP' then
                        idleSet = set_combine(idleSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSTP)
                    else
                        idleSet = set_combine(idleSet, sets.PetTPAxeShield)
                    end
                end
            end
        end
        if pet.status ~= "Engaged" then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    idleSet = set_combine(idleSet, sets.PetPDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    idleSet = set_combine(idleSet, sets.PetMDTAxes)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    idleSet = set_combine(idleSet, sets.PDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    idleSet = set_combine(idleSet, sets.MDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    idleSet = set_combine(idleSet, sets.MEvaAxes)
                elseif state.IdleMode.value == "PetRegen" then
                    idleSet = set_combine(idleSet, sets.PetRegenAxes)
                else
                    idleSet = set_combine(idleSet, sets.IdleAxes)
                end
            else
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    idleSet = set_combine(idleSet, sets.PetPDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    idleSet = set_combine(idleSet, sets.PetMDTAxeShield)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    idleSet = set_combine(idleSet, sets.PDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    idleSet = set_combine(idleSet, sets.MDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    idleSet = set_combine(idleSet, sets.MEvaAxeShield)
                elseif state.IdleMode.value == "PetRegen" then
                    idleSet = set_combine(idleSet, sets.PetRegenAxeShield)
                else
                    idleSet = set_combine(idleSet, sets.IdleAxeShield)
                end
            end
        end
    end
    return idleSet
end

-------------------------------------------------------------------------------------------------------------------
-- Hooks for Reward, Correlation, Treasure Hunter, and Pet Mode handling.
-------------------------------------------------------------------------------------------------------------------

function job_state_change(stateField, newValue, oldValue)
    if stateField == 'Correlation Mode' then
        state.CorrelationMode:set(newValue)
    elseif stateField == 'Treasure Mode' then
        state.TreasureMode:set(newValue)
    elseif stateField == 'Pet Mode' then
        state.CombatWeapon:set(newValue)
    end
end

function get_custom_wsmode(spell, spellMap, default_wsmode)
    if default_wsmode == 'Normal' then
        if spell.english == "Ruinator" and (world.day_element == 'Water' or world.day_element == 'Wind' or world.day_element == 'Ice') then
            return 'Gavialis'
        end
        if spell.english == "Rampage" and world.day_element == 'Earth' then
            return 'Gavialis'
        end
    end
end

-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------

-- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).
function job_handle_equipping_gear(playerStatus, eventArgs)
    -- Equipping a Capacity Points Mantle locks it until it is manually unequipped.
    if player.equipment.back == 'Mecisto. Mantle' or player.equipment.back == 'Aptitude Mantle' or player.equipment.back == 'Aptitude Mantle +1' then
        disable('back')
    else
        enable('back')
    end
end

-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
    get_combat_form()
    get_melee_groups()
    pet_info_update()
    update_display_mode_info()
    pet_only_equip_handling()
end

-- Updates gear based on pet status changes.
function job_pet_status_change(newStatus, oldStatus, eventArgs)
    if newStatus == 'Idle' or newStatus == 'Engaged' then
        if state.DefenseMode.value ~= "Physical" and state.DefenseMode.value ~= "Magical" then
            handle_equipping_gear(player.status)
        end
    end

    if pet.hpp == 0 then
        clear_pet_buff_timers()
        PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None'
    end

    customize_melee_set(meleeSet)
    pet_info_update()
end 

function job_buff_change(status, gain, gain_or_loss)
    --Equip Frenzy Sallet if we're asleep and engaged.
    if (status == "sleep" and gain_or_loss) and player.status == 'Engaged' then
        if gain then
            equip(sets.FrenzySallet)
        else
            handle_equipping_gear(player.status)
        end
    end
end

-------------------------------------------------------------------------------------------------------------------
-- Ready Move Presets and Pet TP Evaluation Functions - Credit to Bomberto and Verda
-------------------------------------------------------------------------------------------------------------------

pet_tp=0
function job_self_command(cmdParams, eventArgs)
    if cmdParams[1]:lower() == 'ready' then
        ready_move(cmdParams)
        eventArgs.handled = true
    end
    if cmdParams[1]:lower() == 'gearhandle' then
        pet_only_equip_handling()
    end
    if cmdParams[1] == 'pet_tp' then
	    pet_tp = tonumber(cmdParams[2])
    end
    if cmdParams[1]:lower() == 'charges' then
        charges = 3
        ready = windower.ffxi.get_ability_recasts()[102]
	    if ready ~= 0 then
	        charges = math.floor(((30 - ready) / 10))
	    end
	    add_to_chat(28,'Ready Recast:'..ready..'   Charges Remaining:'..charges..'')
    end
end
 
function ready_move(cmdParams)
    local move = cmdParams[2]:lower()
    local ReadyMove = ''
    if move == 'one' then
        ReadyMove = ReadyMoveOne
    elseif move == 'two' then
        ReadyMove = ReadyMoveTwo
    else
        ReadyMove = ReadyMoveThree
    end
    send_command('input /pet "'.. ReadyMove ..'" <me>')
end

pet_tp = 0
--Fix missing Pet.TP field by getting the packets from the fields lib
packets = require('packets')
function update_pet_tp(id,data)
    if id == 0x068 then
        pet_tp = 0
        local update = packets.parse('incoming', data)
        pet_tp = update["Pet TP"]
        windower.send_command('lua c gearswap c pet_tp '..pet_tp)
    end
end
id = windower.raw_register_event('incoming chunk', update_pet_tp)

-------------------------------------------------------------------------------------------------------------------
-- Current Job State Display
-------------------------------------------------------------------------------------------------------------------

-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
    local msg = 'Melee'
    
    if state.CombatForm.has_value then
        msg = msg .. ' (' .. state.CombatForm.value .. ')'
    end
    
    msg = msg .. ': '
    
    msg = msg .. state.OffenseMode.value
    if state.HybridMode.value ~= 'Normal' then
        msg = msg .. '/' .. state.HybridMode.value
    end
    msg = msg .. ', WS: ' .. state.WeaponskillMode.value
    
    if state.DefenseMode.value ~= 'None' then
        msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
    end
    
    if state.Kiting.value then
        msg = msg .. ', Kiting'
    end

    msg = msg .. ', Corr.: '..state.CorrelationMode.value

    if state.JugMode.value ~= 'None' then
        add_to_chat(8,'-- Jug Pet: '.. PetName ..' -- (Pet Info: '.. PetInfo ..', '.. PetJob ..')')
    end

    add_to_chat(28,'Ready Moves: 1.'.. ReadyMoveOne ..'  2.'.. ReadyMoveTwo ..'  3.'.. ReadyMoveThree ..'')
    add_to_chat(122, msg)

    eventArgs.handled = true
end

-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------

function pet_info_update()
    if pet.isvalid then
        PetName = pet.name

        if pet.name == 'DroopyDortwin' or pet.name == 'PonderingPeter' or pet.name == 'HareFamiliar' or pet.name == 'KeenearedSteffi' or pet.name == 'LuckyLulush' then
            PetInfo = "Rabbit, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Foot Kick';ReadyMoveTwo = 'Whirl Claws';ReadyMoveThree = 'Wild Carrot'
        elseif pet.name == 'SunburstMalfik' or pet.name == 'AgedAngus' or pet.name == 'HeraldHenry' or pet.name == 'CrabFamiliar' or pet.name == 'CourierCarrie' then
            PetInfo = "Crab, Aquan";PetJob = 'Paladin';ReadyMoveOne = 'Big Scissors';ReadyMoveTwo = 'Scissor Guard';ReadyMoveThree = 'Bubble Curtain'
        elseif pet.name == 'WarlikePatrick' or pet.name == 'LizardFamiliar' or pet.name == 'ColdbloodedComo' or pet.name == 'AudaciousAnna' then
            PetInfo = "Lizard, Lizard";PetJob = 'Warrior';ReadyMoveOne = 'Tail Blow';ReadyMoveTwo = 'Brain Crush';ReadyMoveThree = 'Fireball'
        elseif pet.name == 'ScissorlegXerin' or pet.name == 'BouncingBertha' then
            PetInfo = "Chapuli, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Sensilla Blades';ReadyMoveTwo = 'Tegmina Buffet';ReadyMoveThree = 'Tegmina Buffet'
        elseif pet.name == 'RhymingShizuna' or pet.name == 'SheepFamiliar' or pet.name == 'LullabyMelodia' or pet.name == 'NurseryNazuna' then
            PetInfo = "Sheep, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Lamb Chop';ReadyMoveTwo = 'Rage';ReadyMoveThree = 'Sheep Song'
        elseif pet.name == 'AttentiveIbuki' or pet.name == 'SwoopingZhivago' then
            PetInfo = "Tulfaire, Bird";PetJob = 'Warrior';ReadyMoveOne = 'Swooping Frenzy';ReadyMoveTwo = 'Pentapeck';ReadyMoveThree = 'Molting Plumage'
        elseif pet.name == 'AmiableRoche' or pet.name == 'TurbidToloi' then
            PetInfo = "Pugil, Aquan";PetJob = 'Warrior';ReadyMoveOne = 'Recoil Dive';ReadyMoveTwo = 'Water Wall';ReadyMoveThree = 'Intimidate'
        elseif pet.name == 'BrainyWaluis' or pet.name == 'FunguarFamiliar' or pet.name == 'DiscreetLouise' then
            PetInfo = "Funguar, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Frogkick';ReadyMoveTwo = 'Spore';ReadyMoveThree = 'Silence Gas'              
        elseif pet.name == 'HeadbreakerKen' or pet.name == 'MayflyFamiliar' or pet.name == 'ShellbusterOrob' or pet.name == 'MailbusterCetas' then
            PetInfo = "Fly, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Somersault';ReadyMoveTwo = 'Cursed Sphere';ReadyMoveThree = 'Venom'               
        elseif pet.name == 'RedolentCandi' or pet.name == 'AlluringHoney' then
            PetInfo = "Snapweed, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Tickling Tendrils';ReadyMoveTwo = 'Stink Bomb';ReadyMoveThree = 'Nectarous Deluge'
        elseif pet.name == 'CaringKiyomaro' or pet.name == 'VivaciousVickie' then
            PetInfo = "Raaz, Beast";PetJob = 'Monk';ReadyMoveOne = 'Sweeping Gouge';ReadyMoveTwo = 'Zealous Snort';ReadyMoveThree = 'Zealous Snort'
        elseif pet.name == 'HurlerPercival' or pet.name == 'BeetleFamiliar' or pet.name == 'PanzerGalahad' then
            PetInfo = "Beetle, Vermin";PetJob = 'Paladin';ReadyMoveOne = 'Power Attack';ReadyMoveTwo = 'Rhino Attack';ReadyMoveThree = 'Hi-Freq Field'
        elseif pet.name == 'BlackbeardRandy' or pet.name == 'TigerFamiliar' or pet.name == 'SaberSiravarde' or pet.name == 'GorefangHobs' then
            PetInfo = "Tiger, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Razor Fang';ReadyMoveTwo = 'Claw Cyclone';ReadyMoveThree = 'Roar'
        elseif pet.name == 'ColibriFamiliar' or pet.name == 'ChoralLeera' then
            PetInfo = "Colibri, Bird";PetJob = 'Red Mage';ReadyMoveOne = 'Pecking Flurry';ReadyMoveTwo = 'Pecking Flurry';ReadyMoveThree = 'Pecking Flurry'
        elseif pet.name == 'SpiderFamiliar' or pet.name == 'GussyHachirobe' then
            PetInfo = "Spider, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Sickle Slash';ReadyMoveTwo = 'Acid Spray';ReadyMoveThree = 'Spider Web'
        elseif pet.name == 'GenerousArthur' or pet.name == 'GooeyGerard' then
            PetInfo = "Slug, Amorph";PetJob = 'Warrior';ReadyMoveOne = 'Purulent Ooze';ReadyMoveTwo = 'Corrosive Ooze';ReadyMoveThree = 'Corrosive Ooze'
        elseif pet.name == 'ThreestarLynn' or pet.name == 'DipperYuly' then
            PetInfo = "Ladybug, Vermin";PetJob = 'Thief';ReadyMoveOne = 'Spiral Spin';ReadyMoveTwo = 'Sudden Lunge';ReadyMoveThree = 'Noisome Powder'
        elseif pet.name == 'SharpwitHermes' or pet.name == 'FlowerpotBill' or pet.name == 'FlowerpotBen' or pet.name == 'Homunculus' or pet.name == 'FlowerpotMerle' then
            PetInfo = "Mandragora, Plantoid";PetJob = 'Monk';ReadyMoveOne = 'Head Butt';ReadyMoveTwo = 'Leaf Dagger';ReadyMoveThree = 'Wild Oats'
        elseif pet.name == 'AcuexFamiliar' or pet.name == 'FluffyBredo' then
            PetInfo = "Acuex, Amorph";PetJob = 'Black Mage';ReadyMoveOne = 'Foul Waters';ReadyMoveTwo = 'Pestilent Plume';ReadyMoveThree = 'Pestilent Plume'
        elseif pet.name == 'FlytrapFamiliar' or pet.name == 'VoraciousAudrey' or pet.name == 'PrestoJulio' then
            PetInfo = "Flytrap, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Soporific';ReadyMoveTwo = 'Palsy Pollen';ReadyMoveThree = 'Gloeosuccus'
        elseif pet.name == 'EftFamiliar' or pet.name == 'AmbusherAllie' or pet.name == 'BugeyedBroncha' or pet.name == 'SuspiciousAlice' then
            PetInfo = "Eft, Lizard";PetJob = 'Warrior';ReadyMoveOne = 'Nimble Snap';ReadyMoveTwo = 'Cyclotail';ReadyMoveThree = 'Geist Wall'
        elseif pet.name == 'AntlionFamiliar' or pet.name == 'ChopsueyChucky' or pet.name == 'CursedAnnabelle' then
            PetInfo = "Antlion, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Mandibular Bite';ReadyMoveTwo = 'Venom Spray';ReadyMoveThree = 'Sandblast'
        elseif pet.name == 'MiteFamiliar' or pet.name == 'LifedrinkerLars' or pet.name == 'AnklebiterJedd' then
            PetInfo = "Diremite, Vermin";PetJob = 'Dark Knight';ReadyMoveOne = 'Double Claw';ReadyMoveTwo = 'Spinning Top';ReadyMoveThree = 'Filamented Hold'
        elseif pet.name == 'AmigoSabotender' then
            PetInfo = "Cactuar, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Needle Shot';ReadyMoveTwo = '??? Needles';ReadyMoveThree = '??? Needles'
        elseif pet.name == 'CraftyClyvonne' then
            PetInfo = "Coeurl, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Blaster';ReadyMoveTwo = 'Chaotic Eye';ReadyMoveThree = 'Chaotic Eye'
        elseif pet.name == 'BloodclawShasra' then
            PetInfo = "Lynx, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Blaster';ReadyMoveTwo = 'Chaotic Eye';ReadyMoveThree = 'Charged Whisker'
        elseif pet.name == 'SwiftSieghard' or pet.name == 'FleetReinhard' then
            PetInfo = "Raptor, Lizard";PetJob = 'Warrior';ReadyMoveOne = 'Scythe Tail';ReadyMoveTwo = 'Ripper Fang';ReadyMoveThree = 'Chomp Rush'
        elseif pet.name == 'DapperMac' or pet.name == 'SurgingStorm' or pet.name == 'SubmergedIyo' then
            PetInfo = "Apkallu, Bird";PetJob = 'Monk';ReadyMoveOne = 'Beak Lunge';ReadyMoveTwo = 'Wing Slap';ReadyMoveThree = 'Wing Slap'
        elseif pet.name == 'FatsoFargann' then
            PetInfo = "Leech, Amorph";PetJob = 'Warrior';ReadyMoveOne = 'Suction';ReadyMoveTwo = 'Acid Mist';ReadyMoveThree = 'Drainkiss'
        elseif pet.name == 'FaithfulFalcorr' then
            PetInfo = "Hippogryph, Bird";PetJob = 'Thief';ReadyMoveOne = 'Back Heel';ReadyMoveTwo = 'Choke Breath';ReadyMoveThree = 'Fantod'
        elseif pet.name == 'CrudeRaphie' then
            PetInfo = "Adamantoise, Lizard";PetJob = 'Paladin';ReadyMoveOne = 'Tortoise Stomp';ReadyMoveTwo = 'Harden Shell';ReadyMoveThree = 'Aqua Breath'
        elseif pet.name == 'MosquitoFamilia' or pet.name == 'Left-HandedYoko' then
            PetInfo = "Mosquito, Vermin";PetJob = 'Dark Knight';ReadyMoveOne = 'Infected Leech';ReadyMoveTwo = 'Gloom Spray';ReadyMoveThree = 'Gloom Spray'
        end
    else
        PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None'
    end
end

function pet_only_equip_handling()
    if player.status == 'Engaged' and state.AxeMode.value == 'PetOnly' then
        if pet.status == "Engaged" then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    equip(sets.PetPDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    equip(sets.PetMDTAxes)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    equip(sets.PDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    equip(sets.MDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    equip(sets.MEvaAxes)
                else
                    equip(sets.PetTPAxes)
                end
            else
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    equip(sets.PetPDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    equip(sets.PetMDTAxeShield)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    equip(sets.PDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    equip(sets.MDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    equip(sets.MEvaAxeShield)
                else
                    equip(sets.PetTPAxeShield)
                end
            end
        end
        if pet.status ~= "Engaged" then
            if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    equip(sets.PetPDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    equip(sets.PetMDTAxes)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    equip(sets.PDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    equip(sets.MDTAxes)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    equip(sets.MEvaAxes)
                elseif state.IdleMode.value == "PetRegen" then
                    equip(sets.PetRegenAxes)
                else
                    equip(sets.IdleAxes)
                end
            else
                if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
                    equip(sets.PetPDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
                    equip(sets.PetMDTAxeShield)
                elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
                    equip(sets.PDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
                    equip(sets.MDTAxeShield)
                elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
                    equip(sets.MEvaAxeShield)
                elseif state.IdleMode.value == "PetRegen" then
                    equip(sets.PetRegenAxeShield)
                else
                    equip(sets.IdleAxeShield)
                end
            end
        end
    end

    handle_equipping_gear(player.status)
end

function pet_buff_timer(spell)
    if spell.english == 'Reward' then
        send_command('timers c "Pet: Regen" 180 down '..RewardRegenIcon..'')
    elseif spell.english == 'Spur' then
        send_command('timers c "Pet: Spur" 90 down '..SpurIcon..'')
    elseif spell.english == 'Run Wild' then
        send_command('timers c "'..spell.english..'" '..RunWildDuration..' down '..RunWildIcon..'')
    end
end

function clear_pet_buff_timers()
    send_command('timers c "Pet: Regen" 0 down '..RewardRegenIcon..'')
    send_command('timers c "Pet: Spur" 0 down '..SpurIcon..'')
    send_command('timers c "Run Wild" 0 down '..RunWildIcon..'')
end

function display_mode_info()
    if DisplayModeInfo == 'true' and DisplayTrue == 1 then
        local x = TextBoxX
        local y = TextBoxY
        send_command('text AccuracyText create Acc. Mode: '..state.OffenseMode.value..'')
        send_command('text AccuracyText pos '..x..' '..y..'')
        send_command('text AccuracyText size '..TextSize..'')
        y = y + (TextSize + 6)
        send_command('text CorrelationText create Corr. Mode: '..state.CorrelationMode.value..'')
        send_command('text CorrelationText pos '..x..' '..y..'')
        send_command('text CorrelationText size '..TextSize..'')
        y = y + (TextSize + 6)
        send_command('text AxeModeText create Axe Mode: '..state.AxeMode.value..'')
        send_command('text AxeModeText pos '..x..' '..y..'')
        send_command('text AxeModeText size '..TextSize..'')
        y = y + (TextSize + 6)
        send_command('text JugPetText create Jug Mode: '..state.JugMode.value..'')
        send_command('text JugPetText pos '..x..' '..y..'')
        send_command('text JugPetText size '..TextSize..'')
        DisplayTrue = DisplayTrue - 1
    end
end

function update_display_mode_info()
    if DisplayModeInfo == 'true' then
        send_command('text AccuracyText text Acc. Mode: '..state.OffenseMode.value..'')
        send_command('text CorrelationText text Corr. Mode: '..state.CorrelationMode.value..'')
        send_command('text AxeModeText text Axe Mode: '..state.AxeMode.value..'')
        send_command('text JugPetText text Jug Mode: '..state.JugMode.value..'')
    end
end

function get_melee_groups()
    classes.CustomMeleeGroups:clear()

    if buffactive['Aftermath: Lv.3'] then
        classes.CustomMeleeGroups:append('Aftermath')
    end
end

function get_combat_form()
    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
        state.CombatForm:set('DW')
    else
        state.CombatForm:reset()
    end
end

function select_default_macro_book()
    set_macro_page(1, 2)
end

function set_lockstyle()

	send_command('wait 2; input /lockstyleset 15')

end
Offline
Posts: 20
By Havok16 2017-10-31 12:16:04  
I get the error when i do //gs org

I wonder if maybe there is another command. are the organizer command all those in the readme file?
 Lakshmi.Elidyr
Offline
サーバ: Lakshmi
Game: FFXI
user: elii
Posts: 912
By Lakshmi.Elidyr 2017-10-31 12:38:39  
Havok16 said: »
I get the error when i do //gs org

I wonder if maybe there is another command. are the organizer command all those in the readme file?

I don't personally use it so I have no idea how organizer works sorry. If it loads fine the first time, I would assume nothing major is going on, seems like something organizer is trying to fetch or read isn't matching a string or variable or something it is looking for; that's with out me looking at anything though.

Edit also, what is it you were adding that seems to be making the error appear? Line # or highlight. Busy day today so just trying to make it easier on everyone.
Offline
Posts: 20
By Havok16 2017-10-31 12:53:31  
i dont recall which line cuz it happened all of a sudden. I checked in the organizer-lib file, which line it refers too and this is what it says
Code
for id=1,4 do
        if #inv > inventory_max and #ward[id] + (#inv-inventory_max) < wardrobes[id].max then
            local available = wardrobes[id].max - #ward[id]
            local length = math.min(#inv-80,available)
            ward:extend(inv:slice(1-length))
        end
 Lakshmi.Elidyr
Offline
サーバ: Lakshmi
Game: FFXI
user: elii
Posts: 912
By Lakshmi.Elidyr 2017-10-31 13:06:18  
Havok16 said: »
i dont recall which line cuz it happened all of a sudden. I checked in the organizer-lib file, which line it refers too and this is what it says
Code
for id=1,4 do
        if #inv > inventory_max and #ward[id] + (#inv-inventory_max) < wardrobes[id].max then
            local available = wardrobes[id].max - #ward[id]
            local length = math.min(#inv-80,available)
            ward:extend(inv:slice(1-length))
        end

Pretty sure it isn't the organizer library causing it. Its something the library is trying to fetch it can't make ends of. More than likely something you edited. It happens even to the best of us.

Read on organizer a bit, if you take out the include does the lua work then? From what I see organizer only acts when you use that command to organize gear, so if you remove it and just use your BST.lua like normal does it function properly?
Offline
Posts: 6
By Twigberry 2017-10-31 13:23:02  
Only time I get this error is if I have organizer pulling gear from my storage and I try to use organizer from outside Mog House.
Offline
Posts: 20
By Havok16 2017-10-31 13:46:32  
Yes my bst.lua works very well without using organizer
Offline
Posts: 20
By Havok16 2017-10-31 17:24:45  
Issue fixed. Apparently i didnt notice my wardrobe wasnt full so Organizer couldnt pull stuff .
necroskull Necro Bump Detected! [62 days between previous and next post]
 Quetzalcoatl.Xilkk
Offline
サーバ: Quetzalcoatl
Game: FFXI
user: Xilk
Posts: 1419
By Quetzalcoatl.Xilkk 2018-01-01 16:19:05  
I messed up organizer and I'm trying to get it fixed.

It might be a more general windower/lua issue, but I really can't tell.

I deleted the organizer addon folder. I tried recopying it from downloading from github. I didn't work.

The windower gui shows it as ON and installed, but ingame the list of loaded addons does NOT include organizer.

Any ideas how to fix it?

I've reinstalled windower, I've restored the deleted files, I havne't uninstalled windower first... I'd prefer not to.

any ideas where to check?

If I try to manually load organizer, it says lua runtime error: attempt to call a string value
necroskull Necro Bump Detected! [52 days between previous and next post]
 Quetzalcoatl.Xilkk
Offline
サーバ: Quetzalcoatl
Game: FFXI
user: Xilk
Posts: 1419
By Quetzalcoatl.Xilkk 2018-02-22 15:15:32  
So, I got organizer running.... but its not really working with gearswap luas. It gets the list... but I'm on smn and its leaving all my convoker gear in locker or safe...

Is this totally broken?

but the information on how to use it with wardrobe2, 3, 4 is rather unclear.

Are there more lines to add to settings.xml?

I like to put all gear in wardrobes and have inventory as empty as possible.
 Bahamut.Dannyl
Offline
サーバ: Bahamut
Game: FFXI
user: dannyl
Posts: 1550
By Bahamut.Dannyl 2018-02-22 16:01:57  
1. Make sure it is spelled correctly in your gearswap. Especially if its a abbreviated name.
2. Go into your organizer/data/settings.xml and make sure your locker/safe are in the list of priorities. You probably need to make sure its in your dump bags as well
3. If you recently updated your gearswap job file, just unload gearswap/organizer and reload them and try again
 Quetzalcoatl.Xilkk
Offline
サーバ: Quetzalcoatl
Game: FFXI
user: Xilk
Posts: 1419
By Quetzalcoatl.Xilkk 2018-02-22 16:05:03  
thanks for the tips. I actually figured out the problem.

when checking if it would load (initial problem) I actually ran the //org freeze command while on smn

only after that did I try to incorporate it into gearswarp. I was running //gs org

and I think the freeze files for smn were interfering. I noticed when I didn't have the same trouble on other jobs.

any clue how to use wardrobes 2~4?
 Quetzalcoatl.Xilkk
Offline
サーバ: Quetzalcoatl
Game: FFXI
user: Xilk
Posts: 1419
By Quetzalcoatl.Xilkk 2018-02-24 04:26:12  
Looks like an update got pushed out. My organizer just made new files for wardrobe 2,3, and 4.
 Quetzalcoatl.Xilkk
Offline
サーバ: Quetzalcoatl
Game: FFXI
user: Xilk
Posts: 1419
By Quetzalcoatl.Xilkk 2018-02-25 17:30:28  
tried running and getting this

Luar runtime error: organizer/items.lua:358: attempt to index field '?' (a nil value)

line 358 is this:

if current_items[v]._info.n < bag_max and wardrobecheck(v,self.id) then
Offline
Posts: 346
By Sidiov 2018-03-18 19:37:29  
Organizer will not pull Zulfiqar out of storage anymore, doesnt work by name, or by creating a variable with the augs - gearswap works fine with it.
I have several hundred other pieces that all seem to work fine.. Any idea why that one specific piece wouldnt work?
necroskull Necro Bump Detected! [31 days between previous and next post]
Offline
Posts: 14
By Lowclock 2018-04-19 06:22:40  
I want organizer to grab any gear that I don't currently have in an equippable bag and put it in a wardrobe(1, 2, 3, or 4). If there's not enough space, put unneeded gear in safes, locker, or storage. This seems like it should be pretty simple, but between like 3 different versions floating around in forum posts and githubs, I'm not sure what is what. Some seem to only support wardrobe 1, others 1 and 2, others all 4, but not at the same time with //gs loadout, and //gs org doesn't seem to ever do anything at all with any version. I've tried putting wardrobes in settings where they do make sense, and where they don't make sense, but I never end up with what I need.

Will this addon ever be formally update to github or the launcher so I know what version of files I should be using? Anyone have any advice on how to sort this out?
 Cerberus.Darkvlade
Offline
サーバ: Cerberus
Game: FFXI
user: Darkvlade
Posts: 202
By Cerberus.Darkvlade 2018-04-19 07:53:38  
Second this please
Offline
Posts: 634
By zaxtiss 2018-04-19 08:42:08  
you really have a hard time putting your gear where you want it?
the one from the windower launcher can use all 4 btw shouldn't have to go to github to get your files
 Midgardsormr.Lowclock
Offline
サーバ: Midgardsormr
Game: FFXI
user: Lowclock
Posts: 11
By Midgardsormr.Lowclock 2018-04-19 18:15:39  
zaxtiss said: »
you really have a hard time putting your gear where you want it?
the one from the windower launcher can use all 4 btw shouldn't have to go to github to get your files
I don't know which one you're using, but when I grab it from the launcher I get a version from 2015 that doesn't even know the bag ID for wardrobe 2, let alone 3 or 4.
[+]
 Midgardsormr.Lowclock
Offline
サーバ: Midgardsormr
Game: FFXI
user: Lowclock
Posts: 11
By Midgardsormr.Lowclock 2018-04-19 18:48:04  
Maybe I should clarify and simplify things. The stock gearswap organizer lib finds gear just fine and puts it in my inventory. The stock organizer lua doesn't seem to ever look in wardrobes 2, 3, or 4. I tried the test version Rooks posted, and //gs org would do absolutely nothing with gear except sometimes randomly put gear from my inventory into my dump bags, and //gs loadout would put gear into my inventory because it doesn't want to move stuff from my wardrobes to make room for it there.

I just want to be able to hit //gs something, and have it grab gear from mog house bags and put it in my wardrobes, not my inventory. This would require moving some stuff from wardrobes into dump bags to make room, but that doesn't seem to work.
[+]
necroskull Necro Bump Detected! [139 days between previous and next post]
Offline
Posts: 1
By Liltyke 2018-09-06 04:15:45  
Is the main use for this addon for gear? I was hoping to use it to organize my bags of crafting ingredients and the like :( is there an 'idiots guide' to using it? i take a 'freeze shot' of my inventory nice and tidy and then when i need it to get re-sorted i just type //org tidy all? x.X
 Bahamut.Dannyl
Offline
サーバ: Bahamut
Game: FFXI
user: dannyl
Posts: 1550
By Bahamut.Dannyl 2018-09-10 19:12:29  
Havok16 said: »
Hello Guys

I'm struggling with an error in my bst.lua and only with bst.lua.
the error says

>Gearswap: Lua runtime error: Gearswap/flow.lua:102:
>User event error: ...6)Windower4/Addons/Gearswap/libs/organizer-lib.lua:101: atempt to get lenght of field '?'(a nil value)

My bst lua was working well, then i modified some gear like usualy with every other lua, but i get this error randomly. i cancelled lua and did a new one again. worked fine, modified again and got the error.

well this sucks. I'm now getting this error and I can't figure out why. The kicker is its only happening to 1 of my POL instances out of 3. And I've used the same lua's from other characters to try and debug and its throwing this exact error Havok had.

I've replaced both files from the github and still nothing, only on 1 damn character ><

Anyone have thoughts on a possible solution? //gs org has been my bread and butter, lua seems to work fine on reload
First Page 2 3 ... 15 16 17 ... 21 22 23
Log in to post.