SHARE
TWEET

Xilkk_PUP.lua

xilk Jul 14th, 2018 (edited) 479 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---------------------------------------
  2. -- Last Revised: August 2018--
  3. ---------------------------------------
  4. -----------------------------------------
  5. -- Last Revised: July 13, 2018 --
  6. ---------------------------------------
  7. --
  8. -- Newest updates:
  9. -- Trying to add weaponslot swap toggles
  10. --  Next I want to include the pet ws and ja toggles from faloun's lua for tanking and dd
  11. -- 
  12. --  toggle Petmode, because the head based mode just isnt' sufficient.
  13. -- Not all Gearswap bindings listed below are yet implemented, but I plan to.
  14. ---------------------------------------------
  15. -- Gearswap Commands Specific to this File --
  16. ---------------------------------------------
  17. --
  18. -- alt+F8 cycles through designated PetMode (tank, melee, healer, nuker, etc)
  19. -- ctrl+F8 cycles backwards through designated PetMode
  20. -- alt+F11
  21. -- ctrl+F9
  22. -- alt+= switches between Pet-Only (H2H Swaps) and Master (no Swap) modes
  23. -- ctrl+` can swap in the usage of Chaac Belt for Treasure Hunter on common subjob abilities.
  24. -- ctrl+F11 cycles between Magical Defense Modes
  25. -- ctrl+= activates a LagMode which swaps in most pet gear during precast.
  26. --
  27. -------------------------------
  28. -- General Gearswap Commands --
  29. -------------------------------
  30. -- F9 cycles Accuracy modes
  31. -- ctrl+F9 cycles Hybrid modes
  32. -- F10 equips Physical Defense
  33. -- alt+F10 toggles Kiting on or off
  34. -- ctrl+F10 cycles Physical Defense modes
  35. -- F11 equips Magical Defense
  36. -- alt+F12 turns off Defense modes
  37. -- ctrl+F12 cycles Idle modes
  38. --
  39. -- Keep in mind that any time you Change Jobs/Subjobs, your Pet/Correlation/etc reset to default options.
  40. -- F12 will list your current options.
  41. --
  42. -------------------------------------------------------------------------------------------------------------------
  43. -- Initialization function that defines sets and variables to be used.
  44. -------------------------------------------------------------------------------------------------------------------
  45.  
  46. -- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
  47.  
  48. -- Initialization function for this job file.
  49. function get_sets()
  50.   mote_include_version = 2
  51.   -- Load and initialize the include file.
  52.   include('Mote-Include.lua')
  53.   include('organizer-lib')
  54. end
  55.  
  56.  
  57. -- Setup vars that are user-independent.
  58. function job_setup()
  59.     -- List of pet weaponskills to check for
  60.     petWeaponskills = S{"Slapstick", "Knockout", "Magic Mortar",
  61.         "Chimera Ripper", "String Clipper",  "Cannibal Blade", "Bone Crusher", "String Shredder",
  62.         "Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
  63.        
  64.     AutomatonMagic = {}
  65.        
  66.     AutomatonMagic.Elemental = {'Stone', 'Water', 'Aero', 'Fire', 'Blizzard', 'Thunder', 'Stone II',
  67.         'Water II', 'Aero II', 'Fire II', 'Blizzard II', 'Thunder II', 'Stone III', 'Water III',
  68.         'Aero III', 'Fire III', 'Blizzard III', 'Thunder III', 'Stone IV', 'Water IV', 'Aero IV', 'Fire IV',
  69.         'Blizzard IV', 'Thunder IV', 'Stone V', 'Water V', 'Aero V', 'Fire V', 'Blizzard V', 'Thunder V'}
  70.    
  71.     AutomatonMagic.Enhancing = {'Protect', 'Shell', 'Regen', 'Protect II', 'Phalanx', 'Stoneskin',
  72.         'Shell II', 'Regen II', 'Protect III', 'Haste', 'Shell III', 'Protect IV', 'Regen III', 'Shell IV',
  73.         'Protect V', 'Regen IV', 'Shell V', 'Haste II'}
  74.    
  75.     AutomatonMagic.Enfeebling = {'Poison', 'Paralyze', 'Blind', 'Slow', 'Silence',  'Poison II', 'Addle', }
  76.    
  77.     AutomatonMagic.Healing = {'Cure', 'Poisona', 'Paralyna', 'Blindna', 'Cure II', 'Silena', 'Cure III',
  78.         'Cursna', 'Erase', 'Viruna', 'Stona', 'Cure IV', 'Cure V', 'Cure VI', }
  79.    
  80.     AutomatonMagic.Divine = {'Dia', 'Dia II', }
  81.    
  82.     AutomatonMagic.Dark = {'Bio', 'Drain', 'Aspir', 'Dispel', 'Bio II', 'Absorb-INT', 'Dread Spikes', 'Aspir II',
  83.         'Absorb-Attri', }
  84.    
  85.    
  86.    
  87.     -- Map automaton heads/Frames to combat roles
  88.     --[[
  89.     AutomatonModes = {
  90.     ['Harlequin Head'] = 'Melee',
  91.     ['Sharpshot Head'] = 'Ranged',
  92.     ['Valoredge Head'] = 'Tank',
  93.     ['Stormwaker Head'] = 'Magic',
  94.     ['Harlequin Frame'] = 'Melee',
  95.     ['Sharpshot Frame'] = 'Ranged',
  96.     ['Valoredge Frame'] = 'Tank',
  97.     ['Stormwaker Frame'] = 'Magic',
  98.     ['Soulsoother Head'] = 'Heal',
  99.     ['Spiritreaver Head'] = 'Nuke'
  100.     }
  101.     --]]
  102.     --[[
  103.     petModes = {
  104.         [{'Harlequin Head', 'Harlequin Frame'}] = 'Melee',
  105.         [{'Harlequin Head', 'Sharpshot Frame'}] = 'Melee',
  106.         [{'Harlequin Head', 'Valoredge Frame'}] = 'Melee',
  107.         [{'Harlequin Head', 'Stormwaker Frame'}] = 'Magic',
  108.         [{'Sharpshot Head', 'Sharpshot Frame'}] = 'Ranged',
  109.         [{'Sharpshot Head', 'Valoredge Frame'}] = 'Melee',
  110.         [{'Sharpshot Head', 'Harlequin Frame'}] = 'Melee',
  111.         [{'Sharpshot Head', 'Stormwaker Frame'}] = 'Magic',
  112.         [{'Valoredge Head', 'Valoredge Frame'}] = 'Melee',
  113.         [{'Valoredge Head', 'Sharpshot Frame'}] = 'Melee',
  114.         [{'Valoredge Head', 'Harlequin Frame'}] = 'Melee',
  115.         [{'Valoredge Head', 'Stormwaker Frame'}] = 'Magic',
  116.         [{'Stormwaker Head', 'Stormwaker Frame'}] = 'Magic',
  117.         [{'Stormwaker Head', 'Sharpshot Frame'}] = 'Magic',
  118.         [{'Stormwaker Head', 'Harlequin Frame'}] = 'Melee',
  119.         [{'Stormwaker Head', 'Valoredge Frame'}] = 'Melee',
  120.         [{'Soulsoother Head', 'Stormwaker Frame'}] = 'Heal',
  121.         [{'Soulsoother Head', 'Valoredge Frame'}]= 'Tank',
  122.         [{'Soulsoother Head', 'Harlequin Frame'}] = 'Tank',
  123.         [{'Soulsoother Head', 'Sharpshot Frame'}] = 'Tank',
  124.         [{'Spiritreaver Head', 'Stormwaker Frame'}] = 'Nuke',
  125.         [{'Spiritreaver Head', 'Harlequin Frame'}] = 'Nuke',
  126.         [{'Spiritreaver Head', 'Sharpshot Frame'}] = 'Melee',
  127.         [{'Spiritreaver Head', 'Valoredge Frame'}] = 'Melee'
  128.         }
  129.         --]]
  130.  
  131.    
  132.  
  133.     -- Subset of modes that use magic
  134.     magicPetModes = S{'Nuke','Heal','Magic'}
  135.    
  136.     -- Var to track the current pet mode.
  137.     state.PetMode = M{['description']='Pet Mode', 'None', 'Melee', 'Ranged', 'Tank', 'Magic', 'Heal', 'Nuke'}
  138.     update_pet_mode()
  139.     send_command('bind !f8 gs c cycle PetMode')
  140.     send_command('bind ^f8 gs c cycleback PetMode')
  141.  
  142.     -- Display Mode Info as on-screen Text
  143.     DisplayModeInfo = 'true'
  144.     TextBoxX = 950
  145.     TextBoxY = 47
  146.     TextSize = 10
  147.     display_mode_info()
  148. end
  149.  
  150.  
  151. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  152. function user_setup()
  153.     -- Options: Override default values
  154.     state.OffenseMode:options('Normal', 'MedAcc', 'HighAcc')
  155.     state.HybridMode:options('Normal', 'Hybrid')
  156.     state.WeaponskillMode:options('Normal', 'WSMedAcc', 'WSHighAcc')
  157.     state.CastingMode:options('Normal')
  158.     state.IdleMode:options('Normal', 'Reraise', 'Regen', 'Refresh')
  159.     state.RestingMode:options('Normal')
  160.     state.PhysicalDefenseMode:options('PetPDT', 'PDT')
  161.     state.MagicalDefenseMode:options('MDTShell', 'PetMDT')
  162.    
  163.     state.H2HMode = M{['description']='Swap Mode', 'PetOnly', 'NoSwaps'}
  164.     send_command('bind != gs c cycle H2HMode')
  165.    
  166.     -- 'Out of Range' distance; WS will auto-cancel
  167.     target_distance = 7
  168.  
  169.     -- Default maneuvers 1, 2, 3 and 4 for each pet mode.
  170.     defaultManeuvers = {
  171.         ['Melee'] = {'Fire Maneuver', 'Thunder Maneuver', 'Wind Maneuver', 'Light Maneuver'},
  172.         ['Ranged'] = {'Wind Maneuver', 'Fire Maneuver', 'Thunder Maneuver', 'Light Maneuver'},
  173.         ['Tank'] = {'Earth Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Wind Maneuver'},
  174.         ['Magic'] = {'Ice Maneuver', 'Light Maneuver', 'Dark Maneuver', 'Earth Maneuver'},
  175.         ['Heal'] = {'Light Maneuver', 'Dark Maneuver', 'Water Maneuver', 'Earth Maneuver'},
  176.         ['Nuke'] = {'Ice Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Earth Maneuver'}
  177.     }
  178.  
  179.     send_command('@wait 5;input /lockstyleset 10')
  180. end
  181.  
  182. -- Called when this job file is unloaded (eg: job change)
  183. function file_unload()
  184.     if binds_on_unload then
  185.         binds_on_unload()
  186.     end
  187.  
  188.     -- Removes any Text Info Boxes
  189.     send_command('text PDTModeText delete')
  190.     send_command('text AccuracyText delete')
  191.     send_command('text H2HModeText delete')
  192.     send_command('text AutoModeText delete')
  193.    
  194.     send_command('unbind !=')
  195.     --send_command('unbind ^=')
  196.     --send_command('unbind @=')
  197.     --send_command('unbind !f8')
  198.     --send_command('unbind ^f8')
  199.     --send_command('unbind @f8')
  200.     --send_command('unbind ^f11')
  201. end
  202.  
  203.  
  204. -- Define sets used by this job file.
  205. function init_gear_sets()
  206.  
  207.     Melee_Animator = "Animator P"
  208.     Ranged_Animator = "Animator P II"
  209.     Current_Animator = Melee_Animator
  210.    
  211.     Pet_Mab_main = "Tinhaspa"
  212.     Pet_DT_main ={ name="Condemners", augments={'Pet: Damage taken -4%','Accuracy+16','Pet: Accuracy+9 Pet: Rng. Acc.+9',}}
  213.     Pet_WS_Main ="Ormazd"
  214.    
  215.     Pet_PDT_head = "Anwig Salade"
  216.     Pet_PDT_body = { name="Taeon Tabard", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+3','Pet: Damage taken -3%',}}
  217.     Pet_PDT_hands = { name="Taeon Gloves", augments={'Pet: Accuracy+20 Pet: Rng. Acc.+20','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}}
  218.     Pet_PDT_legs = "Foire Churidars +3"
  219.     Pet_PDT_feet = { name="Taeon Boots", augments={'Pet: Attack+9 Pet: Rng.Atk.+9','Pet: "Dbl. Atk."+3','Pet: Damage taken -4%',}}
  220.     Pet_PDT_back = "Visucius's Mantle"
  221.  
  222.     Pet_Melee_head = { name="Herculean Helm", augments={'Pet: Accuracy+27 Pet: Rng. Acc.+27','Pet: "Store TP"+11','Pet: "Mag.Atk.Bns."+9',}}
  223.     Pet_Melee_body = "Pitre Tobe +2"
  224.     Pet_Melee_hands = { name="Herculean Gloves", augments={'Pet: Mag. Acc.+9','Pet: "Store TP"+11','Pet: INT+7','Pet: Attack+2 Pet: Rng.Atk.+2',}}
  225.     Pet_Melee_legs = { name="Herculean Trousers", augments={'Pet: "Store TP"+10','Pet: DEX+6','Pet: Attack+15 Pet: Rng.Atk.+15',}}
  226.     Pet_Melee_feet = { name="Herculean Boots", augments={'Pet: "Store TP"+10','Pet: Attack+8 Pet: Rng.Atk.+8','Pet: "Mag.Atk.Bns."+11',}}
  227.     Pet_Melee_back = "Visucius's Mantle"
  228.    
  229.     Pet_Vit_head = { name="Herculean Helm", augments={'Pet: Mag. Acc.+22','Pet: "Dbl.Atk."+2 Pet: Crit.hit rate +2','Pet: VIT+7','Pet: Attack+3 Pet: Rng.Atk.+3',}}
  230.     Pet_Vit_hands = { name="Herculean Gloves", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+2','Pet: VIT+11','Pet: Attack+2 Pet: Rng.Atk.+2','Pet: "Mag.Atk.Bns."+9',}}
  231.     Pet_Vit_legs = "Herculean trousers"
  232.     Pet_Vit_feet = "Herculean boots"
  233.    
  234.     Hybrid_head = Pet_Melee_head
  235.    
  236.     PDT_hands ={ name="Herculean Gloves", augments={'Damage taken-3%','AGI+6','Accuracy+14',}}
  237.     PDT_legs ={ name="Herculean Trousers", augments={'Accuracy+14 Attack+14','Phys. dmg. taken -4%','VIT+4','Attack+13',}}
  238.     PDT_feet ={ name="Herculean Boots", augments={'Phys. dmg. taken -3%','VIT+3','Accuracy+20 Attack+20',}}
  239.    
  240.     WSD_head = { name="Herculean Helm", augments={'Attack+25','Weapon skill damage +3%','DEX+2','Accuracy+5',}}
  241.     WSD_feet = { name="Herculean Boots", augments={'Accuracy+17','Accuracy+18 Attack+18','Weapon skill damage +4%',}}
  242.    
  243.     TH_feet={ name="Herculean Boots", augments={'MND+7','Attack+6','"Treasure Hunter"+2','Accuracy+6 Attack+6',}}
  244.    
  245.     Macc_head = "Tali'ah turban +2"
  246.     MAcc_body = "Tali'ah manteel +2"
  247.     MAcc_hands = "Tali'ah gages +2"
  248.     MAcc_legs = "Tali'ah Seraweels +2"
  249.     MAcc_feet = "Tali'ah crackows +2"
  250.    
  251.    
  252.     Enmity_back = {name="Visucius's Mantle", augments={'Enmity+10',}}
  253.    
  254.     sets.Enmity = {--main="Nibiru Sainti",
  255.         neck="Unmoving Collar",ear1="Trux Earring",ear2="Cryptic Earring",
  256.         body="Passion Jacket",hands="Kurys Gloves",ring1="Petrov Ring",ring2="Begrudging Ring",
  257.         back=Enmity_back,legs="Obatala Subligar",feet="Rager Ledelsens +1"}
  258.    
  259.     sets.PetEnmity = {head="Heyoka Cap",ear1="Rimeice Earring",ear2="Domesticator's Earring",
  260.         body="Heyoka Harness",hands="Heyoka Mittens",
  261.         legs="Heyoka Subligar",feet="Heyoka Leggings"}
  262.        
  263.     sets.treasure = {
  264.         head="Wh. Rarab mask +1",
  265.         waist="Chaac belt",
  266.         feet=TH_feet
  267.     }
  268.  
  269.     -- PRECAST GEAR SETS
  270.     sets.precast.JA['Tactical Switch'] = {feet="Karagoz Scarpe"}
  271.     sets.precast.JA['Overdrive'] = {body="Pitre Tobe +2"}
  272.     sets.precast.JA['Ventriloquy'] = {legs="Pitre Churidars +2"}
  273.     sets.precast.JA['Role Reversal'] = {feet="Pitre Babouches +2"}
  274.     sets.precast.JA['Repair'] = {--main="Nibiru Sainti",
  275.     ear1="Guignol Earring",ear2="Pratik Earring",body="Foire Tobe +3",hands="Rao kote", feet="Foire Babouches +3"}
  276.     sets.precast.JA.Maneuver = {--main="Midnights",
  277.         --ranged="Animator P",
  278.         neck="Buffoon's Collar",body="Karagoz Farsetto +1",hands="Foire Dastanas +3",
  279.         back="Visucius's Mantle"}
  280.     sets.precast.JA.Maneuver.NE = set_combine(sets.precast.JA.Maneuver, {main="Midnights"})
  281.    
  282.     sets.precast.JA.Provoke = sets.Enmity
  283.     sets.precast.JA.Provoke = set_combine(sets.Enmity, {main="Nibiru Sainti"})
  284.    
  285.     sets.precast.Step = {}
  286.     sets.precast.Step['Box Step'] = {
  287.         neck="Ziel Charm",ear1="Choreia Earring",
  288.         body="Thaumas Coat",ring1="Regal Ring",ring2="Oneiros Annulet",
  289.         back="Visucius's Mantle"}
  290.  
  291.     sets.precast.Flourish1 = {}
  292.     sets.precast.Flourish1['Violent Flourish'] = {legs="Iuitl Tights",feet="Iuitl Gaiters"}
  293.  
  294.     -- CURING/DIVINE WALTZ
  295.     sets.precast.Waltz = {
  296.         head="Whirlpool Mask",ear1="Roundel Earring",
  297.         body="Otronif Harness",hands="Otronif Gloves",ring1="Spiral Ring",
  298.         back="Iximulew Cape",legs="Nahtirah Trousers",feet="Thurandaut Boots +1"}
  299.        
  300.     -- FAST CAST PRECAST GEAR   --33 %
  301.     sets.precast.FC = {head="Herculean helm",  --7 FC, 8 Haste
  302.         neck="Orunmila's torque", --5 FC
  303.         ear2="Loquacious Earring", -- 2 FC
  304.         body="Vrikodara Jupon", -- 5 FC
  305.         --hands="Thaumas Gloves", -- 4 FC
  306.         ring1="Prolix Ring", -- 2 FC
  307.         --ring2="Rahab Ring",
  308.         back="Swith cape", -- 3 FC
  309.         legs="Orvail Pants +1", -- 5 FC
  310.         feet="Chelona boots"    -- 4 FC
  311.     }
  312.     sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})
  313.  
  314.     -- WEAPONSKILL SETS
  315.     -- Default set for any weaponskill that isn't more specifically defined:
  316.     sets.precast.WS = {
  317.         head=WSD_head,neck="Fotia gorget",ear1="Moonshade Earring",ear2="Brutal Earring",
  318.         body="Foire tobe +3",hands="Tali'ah gages +2",ring1="Niqmaddu Ring",ring2="Epona's Ring",
  319.         back="Dispersal Mantle",waist="Fotia belt",legs="Hizamaru Hizayoroi +2",feet=WSD_feet}
  320.  
  321.     -- Specific weaponskill sets:
  322.    
  323.        
  324.     sets.precast.WS['Stringing Pummel'] = sets.precast.WS --[[set_combine(sets.precast.WS , {--neck="Rancor Collar",
  325.        
  326.         body="Heyoka harness", hands="Heyoka mittens", ring2="Begrudging Ring",
  327.         waist="Fotia Belt", legs="Heyoka harness", feet="Heyoka leggings"})
  328.         --]]
  329.     sets.precast.WS['Victory Smite'] = set_combine(sets.precast.WS['Stringing Pummel'], {
  330.         neck="Fotia gorget",
  331.         waist="Fotia Belt"})
  332.        
  333.     sets.precast.WS['Shijin Spiral'] = set_combine(sets.precast.WS, {ear1="Mache Earring",
  334.         body="Heyoka harness", hands="Heyoka mittens",
  335.         waist="Fotia Belt", legs="Heyoka harness", feet="Heyoka leggings"
  336.         })
  337.        
  338.     sets.precast.WS['Howling Fist'] = set_combine(sets.precast.WS, {ear1="Mache Earring",
  339.         body="Heyoka harness", hands="Heyoka mittens",
  340.         waist="Fotia Belt", legs="Heyoka harness", feet="Heyoka leggings"
  341.         })
  342.  
  343.     -- MIDCAST SETS
  344.     sets.midcast.FastRecast = {
  345.         head="Taeon Chapeau",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
  346.         body="Taeon Tabard",hands="Regimen Mittens",ring1="Prolix Ring",ring2="Defending Ring",
  347.         legs="Taeon Tights",feet="Taeon Boots"}
  348.    
  349.     sets.midcast.Cure = {--ammo="Quartz Tathlum +1",
  350.         --head=Cure_Potency_head,
  351.         neck="Phalaina Locket",ear1="Lifestorm Earring",ear2="Mendicant's Earring",
  352.         body="Vrikodara Jupon",
  353.         hands="Weatherspoon cuffs +1",
  354.         back="Solemnity cape",
  355.         ring1="Lebeche Ring",ring2="Asklepian Ring", waist="Luminary Sash",
  356.         --legs="Gyve Trousers",
  357.         --feet="Skaoi boots"
  358.         }
  359.        
  360.     sets.midcast.Curaga = sets.midcast.Cure
  361.     --sets.CurePetOnly = {main=Cure_Potency_axe,sub="Matamata Shield +1"}
  362.  
  363.     sets.midcast.Stoneskin = {--ammo="Quartz Tathlum +1",
  364.         --neck="Stone Gorget",ear1="Earthcry Earring",
  365.         ear2="Lifestorm Earring",
  366.         --hands="Stone Mufflers",ring1="Leviathan Ring +1",
  367.         --waist="Engraved Belt",legs="Haven Hose"
  368.         }
  369.  
  370.     sets.midcast.Cursna = set_combine(sets.midcast.FastRecast, {--neck="Malison Medallion",
  371.         --ring1="Eshmun's Ring",ring2="Haoma's Ring",
  372.         waist="Gishdubar Sash"})
  373.     sets.midcast.Dia = sets.treasure
  374.    
  375.     sets.midcast.Protect = {ring2="Sheltered Ring"}
  376.     sets.midcast.Protectra = sets.midcast.Protect
  377.  
  378.     sets.midcast.Shell = {ring2="Sheltered Ring"}
  379.     sets.midcast.Shellra = sets.midcast.Shell
  380.  
  381.     sets.midcast['Enfeebling Magic'] = {
  382.         head=MAcc_head,
  383.         neck="Sanctity Necklace",--ear1="Hermetic Earring",ear2="Dignitary's Earring",
  384.         body=MAcc_body,hands=MAcc_hands,
  385.         ring1="Rahab Ring",ring2="Sangoma Ring",
  386.         back=MAcc_back,
  387.         waist="Eschan Stone",
  388.         legs=MAcc_legs,feet=MAcc_feet
  389.         }
  390.    
  391.     sets.midcast['Elemental Magic'] = {
  392.         head=MAcc_head,
  393.         neck="Baetyl pendant",ear1="Hecate's Earring",ear2="Friomisi Earring",
  394.         body=MAcc_body,hands=MAcc_hands,
  395.         ring1="Acumen Ring",--ring2="Fenrir Ring +1",
  396.         back="Argochampsa mantle",
  397.         waist="Eschan Stone",
  398.         legs=MAcc_legs,feet=MAcc_feet
  399.         }
  400.        
  401.     -- PET MIDCAST SETS
  402.     sets.midcast.Pet.Cure = {--head="naga somen", body="Naga Samue",
  403.         legs="Foire churidars +3",
  404.         --feet="Naga kyahan"
  405.     }
  406.  
  407.     sets.midcast.Pet['Elemental Magic'] = {head="Rawhide mask", neck="Adad Amulet",
  408.         ear1="Enmerkar earring", ear2="Sapphire earring",
  409.         body="Tali'ah manteel +2", hands="Naga tekko", ring1="Tali'ah ring",
  410.         back="Argochampsa mantle", waist="incarnation sash", legs="Pitre Churidars +2",feet="Pitre Babouches +2"}
  411.     sets.midcast.Pet['Elemental Magic'].NE = set_combine(sets.midcast.Pet['Elemental Magic'], {main="Tinhaspa"})
  412.    
  413.     sets.midcast.Pet['Enfeebling Magic'] = {head="Tali'ah Turban +2", neck="Adad Amulet",
  414.         ear1="Enmerkar earring", ear2="Sapphire earring",
  415.         body="Tali'ah manteel +2", hands="Tali'ah gages +2", ring1="Tali'ah ring",
  416.         back="Visucius's cape", waist="incarnation sash", legs="Tali'ah Sera. +2",feet="Tali'ah crackows +2"}
  417.     sets.midcast.Pet['Enfeebling Magic'].NE = set_combine(sets.midcast.Pet['Enfeebling Magic'], {main="Tinhaspa"})
  418.  
  419.     sets.midcast.Pet.WeaponSkill = {
  420.         head="Karagoz capello +1", neck="Shulmanu collar", earring1="Enmerkar earring", ear2="Domesticator's earring",
  421.         body="Pitre tobe +2", hands="Karagoz guantli +1", ring1="Thurandaut ring +1", ring2="Overbearing ring",
  422.         back="Visucius mantle", waist="Incarnation sash", legs="Karagoz Pantaloni +1", feet="Naga kyahan"
  423.         }
  424.     sets.midcast.Pet.WeaponSkill.NE = set_combine(sets.midcast.Pet.WeaponSkill, {main="Ormazd"})
  425.    
  426.     sets.midcast.Pet.WeaponSkill['Bone Crusher'] = set_combine(sets.midcast.Pet.WeaponSkill, {
  427.         head=Pet_Vit_head,
  428.         hands=Pet_Vit_hands,
  429.         legs=Pet_Vit_legs,
  430.         feet=Pet_Vit_feet
  431.    
  432.         })
  433.     sets.midcast.Pet.WeaponSkill['Bone Crusher'].NE = set_combine(sets.midcast.Pet.WeaponSkill['Bone Crusher'], {main="Ormazd"})
  434.    
  435.     -- RESTING SETS
  436.         sets.resting = {head="Foire Taj +3",neck="Sanctity necklace",
  437.         ring1="Sheltered Ring",ring2="Paguroidea Ring"}
  438.  
  439.     -- DEFENSE SETS
  440.     sets.defense.PDT = {
  441.         --range="Animator P +1",
  442.         ammo="Automat. Oil +3",
  443.         head="Hike khat",neck="Loricate Torque +1",ear1="Genmei Earring",
  444.         body="Vrikodara jupon",hands=PDT_hands, ring1="Tali'ah Ring",ring2="Defending Ring",
  445.         back="Moonbow Cape",waist="Moonbow Belt",legs=PDT_legs, feet=PDT_feet}
  446.     sets.defense.PDT.NE = set_combine(sets.defense.PDT, {main="Suwaiyas"})
  447.    
  448.     sets.defense.PetPDT = {--main="Condemners",range="Animator P",
  449.         ammo="Automat. Oil +3",
  450.         head=Pet_PDT_head,neck="Shepherd's Chain",ear1="Rimeice Earring",ear2="Enmerkar Earring",
  451.         body=Pet_PDT_body,hands=Pet_PDT_hands,ring1="Thurandaut Ring +1",ring2="Overbearing Ring",
  452.         back=Pet_PDT_back,waist="Isa Belt",legs=Pet_PDT_legs,feet=Pet_PDT_feet}
  453.     sets.defense.PetPDT.NE = set_combine(sets.defense.PetPDT, {main="Condemners"})
  454.    
  455.     sets.defense.MDTShell = {
  456.         --range="Animator P",
  457.         ammo="Automat. Oil +3",
  458.         head="Uk'uxkaj Cap",neck="Loricate Torque +1",ear1="Sanare Earring",ear2="Etiolation Earring",
  459.         body="Otronif Harness +1",hands="Otronif Gloves",ring1="Shadow Ring",ring2="Defending Ring",
  460.         back="Moonbow Cape",waist="Moonbow Belt",legs="Otronif Brais +1",feet="Otronif Boots +1"}
  461.  
  462.     sets.Kiting = {feet="Hermes' Sandals"}
  463.  
  464.     -- IDLE SET
  465.     sets.idle = {
  466.         head="Rawhide mask",neck="Sanctity necklace",ear1="Infused Earring",ear2="Eabani Earring",
  467.         body="Vrikodara jupon",hands=PDT_hands,
  468.         ring1="Sheltered Ring",ring2="Paguroidea Ring",
  469.         back="Moonbeam cape",waist="Fucho-no-obi",legs="Assid. pants +1",feet="Hermes' Sandals"}
  470.  
  471.     -- PET IDLE SET (eg: pet regen gear)
  472.     sets.idle.Pet = {--range="Animator P",
  473.     ammo="Automat. Oil +3",
  474.         head="Pitre Taj +1",neck="Sanctity Necklace",ear1="Rimeice Earring",ear2="Domesticator's Earring",
  475.         body=Pet_PDT_body,hands=Pet_PDT_hands,ring1="Paguroidea Ring",ring2="Sheltered Ring",
  476.         back=Pet_PDT_back,waist="Isa Belt",legs=Pet_PDT_legs,feet="Hermes' Sandals"}
  477.    
  478.     sets.idle.Pet.Magic = set_combine( sets.idle.Pet, {
  479.         body="Foire tobe +3", hands="Naga Tekko",
  480.         legs="Foire churidars +3"
  481.     })
  482.     sets.idle.Pet.Nuke = sets.idle.Pet.Magic
  483.     sets.idle.Pet.Heal = sets.idle.Pet.Magic
  484.    
  485.     sets.idle.Pet.Engaged = {--main="Ohtas",range="Animator P",
  486.         ammo="Automat. Oil +3",
  487.         head=Pet_Melee_head, neck="Shulmanu Collar",ear1="Enmerkar Earring",ear2="Domesticator's Earring",
  488.         body=Pet_Melee_body, hands=Pet_Melee_hands, ring1="Thurandaut Ring +1",ring2="Varar Ring",
  489.         back=Pet_Melee_back, waist="Incarnation Sash",legs=Pet_Melee_legs, feet=Pet_Melee_feet}
  490.    
  491.     sets.idle.Pet.Engaged.Ranged = sets.idle.Pet.Engaged
  492.  
  493.     sets.idle.Pet.Engaged.Magic = set_combine(sets.idle.Pet.Engaged, sets.idle.Pet.Magic)
  494.  
  495.     sets.idle.Pet.Engaged.Nuke = sets.idle.Pet.Engaged.Magic
  496.        
  497.     sets.idle.Pet.Engaged.Heal = sets.idle.Pet.Engaged.Magic
  498.    
  499.     --sets.AutomatonWS = {
  500.     --  head="Karagoz capello +1",neck="Empath Necklace",ear1="Ruby Earring",ear2="Domesticator's Earring",
  501.     --  body="Pitre Tobe +2",hands=Pet_Melee_hands,ring1="Thurandaut Ring +1",ring2="Angel's Ring",
  502.     --  back="Visucius's Mantle",waist="Incarnation Sash",legs=Pet_Melee_legs,feet=Pet_Melee_feet}
  503.  
  504.     -- ENGAGED SETS
  505.     sets.engaged = {head="  Tali'ah Turban +2",
  506.         body=Pet_Melee_head,
  507.         hands={ name="Herculean Gloves", augments={'Pet: Mag. Acc.+9','Pet: "Store TP"+11','Pet: INT+7','Pet: Attack+2 Pet: Rng.Atk.+2',}},
  508.         legs="Samnuha Tights",
  509.         feet={ name="Herculean Boots", augments={'CHR+11','Rng.Acc.+14','Quadruple Attack +3','Accuracy+7 Attack+7',}},
  510.         neck="Shulmanu collar",
  511.         waist="Moonbow belt",
  512.         left_ear="Cessance Earring",
  513.         right_ear="Telos Earring",
  514.         left_ring="Niqmaddu Ring",
  515.         right_ring="Epona's Ring",
  516.         back={ name="Visucius's Mantle", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Accuracy+20 Attack+20','Pet: Attack+10 Pet: Rng.Atk.+10','Pet: Haste+10',}}}
  517.        
  518.     sets.engaged.acc = set_combine (sets.engaged, {
  519.         head="Heyoka cap",
  520.         body="Heyoka harness", hands="Heyoka gloves",
  521.         legs="Heyoka subligar", feet="Heyoka leggings"
  522.    
  523.     })
  524.    
  525.     sets.engaged.MedAcc = set_combine (sets.engaged.acc, {})
  526.    
  527.     -------------------------------------------------------
  528.     -- Pet Only Mode H2H Swaps --
  529.     -------------------------------------------------------
  530.     sets.IdleH2H = {main="Suwaiyas"}
  531.     sets.PDTH2H = {main="Suwaiyas"}
  532.     sets.MDTH2H = {main="Raetic baghnakhs"}
  533.     sets.PetDTH2H = {main=Pet_DT_main}
  534.     sets.PetRefreshH2H = {main="Denouements"}
  535.     sets.PetRegenH2H = {main="Denouements"}
  536.     sets.EnmityH2H = {main="Nibiru Sainti"}
  537.     sets.petWSH2H = {main=Pet_WS_Main}
  538.     sets.BurdenH2H = {main="Midnights"}
  539.     sets.PetMeleeH2H = {main="Ohtas"}
  540.     sets.PetMABH2H = {main="Tinhaspa"}
  541.     sets.PetMaccH2H = {main="Tinhaspa"}
  542.    
  543. end
  544.  
  545. -------------------------------------------------------------------------------------------------------------------
  546. -- Job-specific hooks that are called to process player actions at specific points in time.
  547. -------------------------------------------------------------------------------------------------------------------
  548.  
  549. -- Called when player is about to perform an action
  550. function job_precast(spell, action, spellMap, eventArgs)
  551.     if spell.english == 'Activate' then
  552.         local abil_recasts = windower.ffxi.get_ability_recasts()
  553.         if abil_recasts[spell.recast_id] > 0 then
  554.             send_command('input /ja "Deus Ex Automata" <me>')
  555.             add_to_chat(28, 'Activate timer is not ready - Using [Deus Ex Automata]!')
  556.             eventArgs.cancel = true
  557.             return
  558.         end
  559.         job_update()
  560.     end
  561.     if spell.english == 'Wind Maneuver' then
  562.         if H2HMode == 'PetOnly' then
  563.             equip(sets.precast.JA.Maneuver.NE)
  564.         else
  565.             equip(sets.precast.JA.Maneuver)
  566.         end
  567.     end
  568.     if spell.type == "WeaponSkill" and spell.target.distance > target_distance then
  569.         cancel_spell()
  570.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  571.         handle_equipping_gear(player.status)
  572.         return
  573.     end
  574. end
  575.  
  576. -- Called when pet is about to perform an action
  577. function job_pet_midcast(spell, action, spellMap, eventArgs)
  578.     --if petWeaponskills:contains(spell.english) then
  579.     --    classes.CustomClass = "Weaponskill"
  580.     --
  581.     if state.H2HMode.value == 'PetOnly' then
  582.         if AutomatonMagic.Elemental:contains(spell.english) then
  583.             equip(sets.midcast.Pet['Elemental Magic'].NE)
  584.         elseif AutomatonMagic.Enfeebling:contains(spell.english) then
  585.             equip(sets.midcast.Pet['Elemental Magic'].NE)
  586.         else
  587.         end
  588.     end
  589.    
  590.     if spell.english == 'Provoke' then
  591.         send_command('timers c "Strobe:Provoke" 30 up abilities/00002.png')
  592.     elseif spell.english == 'Flash' then
  593.         send_command('timers c "Flashbulb:Flash" 45 up abilities/00002.png')
  594.     end
  595.    
  596.    
  597.    
  598.     --handle_equipping_gear(player.status)
  599. end
  600.  
  601. function job_pet_aftercast(spell, action, spellMap, eventArgs)
  602.     eventArgs.handled = true
  603. end
  604.  
  605. -------------------------------------------------------------------------------------------------------------------
  606. -- Customization hook for idle sets.
  607. -------------------------------------------------------------------------------------------------------------------
  608.  
  609. function customize_idle_set(idleSet)
  610.     if state.H2HMode.value == 'PetOnly' then
  611.         if state.PetMode.value == 'Tank' then
  612.             idleSet = set_combine(idleSet, sets.PetPDTH2H)
  613.         elseif state.PetMode.value == 'Melee' then
  614.             idleSet = set_combine(idleSet, sets.PetMeleeH2H)
  615.         elseif state.PetMode.value == 'Ranged' then
  616.             idleSet = set_combine(idleSet, sets.PetMeleeH2H)
  617.         elseif state.PetMode.value == 'Magic' then
  618.             idleSet = set_combine(sets.idle.Pet.Magic, {main="Denouements"})
  619.         elseif state.PetMode.value == 'Nuke' then
  620.             idleSet = set_combine(sets.idle.Pet.Nuke, {main="Denouements"})
  621.         elseif state.PetMode.value == 'Heal' then
  622.             idleSet = set_combine(sets.idle.Pet.Heal, {main="Denouements"})
  623.         end
  624.     end
  625.     return idleSet
  626. end
  627.  
  628. -------------------------------------------------------------------------------------------------------------------
  629. -- General hooks for other game events.
  630. -------------------------------------------------------------------------------------------------------------------
  631. function job_buff_change(buff, gain)
  632.     if buff == 'Wind Maneuver' then
  633.         handle_equipping_gear(player.status)
  634.     end
  635. end
  636.  
  637. -- Called when a player gains or loses a pet.
  638. function job_pet_change(pet, gain)
  639.     update_pet_mode()
  640. end
  641.  
  642. -- Called when the pet's status changes.
  643. function job_pet_status_change(newStatus, oldStatus)
  644.     if newStatus == 'Engaged' or newStatus == 'Idle' then
  645.         handle_equipping_gear(player.status)
  646.     end
  647. end
  648.  
  649. -------------------------------------------------------------------------------------------------------------------
  650. -- User code that supplements self-commands.
  651. -------------------------------------------------------------------------------------------------------------------
  652.  
  653. -- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).
  654. function job_handle_equipping_gear(playerStatus, eventArgs)    
  655.     if player.equipment.back == 'Mecisto. Mantle' or player.equipment.back == 'Aptitude Mantle' or player.equipment.back == 'Aptitude Mantle +1' or player.equipment.back == 'Nexus Cape' then
  656.         disable('back')
  657.     else
  658.         enable('back')
  659.     end
  660. end
  661.  
  662. -- Called for custom player commands.
  663. function job_self_command(cmdParams, eventArgs)
  664.     if cmdParams[1]:lower() == 'gearhandle' then
  665.         handle_equipping_gear(player.status)
  666.     end
  667. end
  668.  
  669.  
  670. -- Called by the 'update' self-command, for common needs.
  671. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  672. function job_update(cmdParams, eventArgs)
  673.     update_pet_mode()
  674.     update_display_mode_info()
  675. end
  676.  
  677.  
  678. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  679. function display_current_job_state(eventArgs)
  680.     local msg = 'Melee'
  681.    
  682.     if state.CombatForm.has_value then
  683.         msg = msg .. ' (' .. state.CombatForm.value .. ')'
  684.     end
  685.    
  686.     msg = msg .. ': '
  687.    
  688.     msg = msg .. state.OffenseMode.value
  689.     if state.HybridMode.value ~= 'Normal' then
  690.         msg = msg .. '/' .. state.HybridMode.value
  691.     end
  692.     msg = msg .. ', WS: ' .. state.WeaponskillMode.value
  693.    
  694.     if state.DefenseMode.value ~= 'None' then
  695.         msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
  696.     end
  697.    
  698.     if state.Kiting.value then
  699.         msg = msg .. ', Kiting'
  700.     end
  701.  
  702.     add_to_chat(122, msg)
  703.  
  704.     eventArgs.handled = true
  705.  
  706.     display_pet_status()
  707. end
  708.  
  709.  
  710. -------------------------------------------------------------------------------------------------------------------
  711. -- Utility functions specific to this job.
  712. -------------------------------------------------------------------------------------------------------------------
  713.  
  714. -- Get the pet mode value based on the equipped head of the automaton.
  715. -- Returns nil if pet is not valid.
  716.  
  717. --[[
  718. function get_pet_mode()
  719.     if pet.isvalid then
  720.         return petModes[pet.head] or 'None'
  721.     else
  722.         return 'None'
  723.     end
  724. end
  725. --]]
  726.  
  727. --[[
  728. function get_pet_mode()
  729.     if pet.isvalid then
  730.         return petModes[pet.head..', '..pet.frame] or 'None'
  731.     else
  732.         return 'None'
  733.     end
  734. end
  735. --]]
  736. -- Update state.PetMode, as well as functions that use it for set determination.
  737. function update_pet_mode()
  738.    
  739.     --state.PetMode:set(get_pet_mode())
  740.     --add_to_chat(122,  PetMode )
  741.     update_custom_groups()
  742. end
  743.  
  744. -- Update custom groups based on the current pet.
  745. function update_custom_groups()
  746.     classes.CustomIdleGroups:clear()
  747.     if pet.isvalid then
  748.         classes.CustomIdleGroups:append(state.PetMode.value)
  749.     end
  750. end
  751.  
  752. -- Display current pet status.
  753. function display_pet_status()
  754.     if pet.isvalid then
  755.     local petInfoString = pet.name..' ['..pet.head..']/['..pet.frame..']:  '..tostring(pet.status)..'  TP='..tostring(pet.tp)..'  HP%='..tostring(pet.hpp)
  756.  
  757.     if magicPetModes:contains(state.PetMode) then
  758.         petInfoString = petInfoString..'  MP%='..tostring(pet.mpp)
  759.     end
  760.  
  761.     add_to_chat(122,petInfoString)
  762.     end
  763. end
  764.  
  765. function display_mode_info()
  766.     if DisplayModeInfo == 'true' then
  767.         send_command('text AccuracyText create Acc. Mode: Normal')
  768.         send_command('text AccuracyText pos '..TextBoxX..' '..TextBoxY..'')
  769.         send_command('text AccuracyText size '..TextSize..'')
  770.         TextBoxY = TextBoxY + (TextSize + 6)
  771.         send_command('text PDTModeText create PDT Mode: PetPDT')
  772.         send_command('text PDTModeText pos '..TextBoxX..' '..TextBoxY..'')
  773.         send_command('text PDTModeText size '..TextSize..'')
  774.         TextBoxY = TextBoxY + (TextSize + 6)
  775.         send_command('text H2HModeText create H2H Mode: NoSwaps')
  776.         send_command('text H2HModeText pos '..TextBoxX..' '..TextBoxY..'')
  777.         send_command('text H2HModeText size '..TextSize..'')
  778.         TextBoxY = TextBoxY + (TextSize + 6)
  779.         send_command('text AutoModeText create Pet Mode: None')
  780.         send_command('text AutoModeText pos '..TextBoxX..' '..TextBoxY..'')
  781.         send_command('text AutoModeText size '..TextSize..'')
  782.     end
  783. end
  784.  
  785. -- Select default macro book on initial load or subjob change.
  786. function select_default_macro_book()
  787.     -- Default macro set/book
  788.     if player.sub_job == 'DNC' then
  789.         set_macro_page(2, 4)
  790.     elseif player.sub_job == 'WAR' then
  791.         set_macro_page(3, 4)
  792.     elseif player.sub_job == 'THF' then
  793.         set_macro_page(4, 4)
  794.     else
  795.         set_macro_page(1, 4)
  796.     end
  797. end
  798.  
  799. function update_display_mode_info()
  800.     if DisplayModeInfo == 'true' then
  801.         send_command('text AccuracyText text Acc. Mode: '..state.OffenseMode.value..'')
  802.         send_command('text PDTModeText text PDT Mode: '..state.PhysicalDefenseMode.value..'')
  803.         send_command('text H2HModeText text H2H Mode: '..state.H2HMode.value..'')
  804.         send_command('text AutoModeText text Pet Mode: '..state.PetMode.value..'')
  805.     end
  806. end
  807.  
  808. windower.raw_register_event('action',function (act)
  809.     local actor = windower.ffxi.get_mob_by_id(act.actor_id)    
  810.     local self = windower.ffxi.get_player()
  811.     local target_count = act.target_count
  812.     local category = act.category  
  813.     local param = act.param
  814.     local recast = act.recast  
  815.     local targets = act.targets
  816.     local primarytarget = windower.ffxi.get_mob_by_id(targets[1].id)
  817.     local valid_target = act.valid_target
  818.     local pet = windower.ffxi.get_mob_by_target('pet')
  819.     -- print(actor.name,category,param)
  820.     --[[
  821.     [1945] = {id=1945,en="Provoke",ja="挑発"},
  822.     [1946] = {id=1946,en="Shock Absorber",ja="S.アブソーバー"},
  823.     [1947] = {id=1947,en="Flashbulb",ja="フラッシュバルブ"},
  824.     ]]
  825.     if actor and pet and actor.id == pet.id and (param == 1944 or param == 1945 or param == 1947) then
  826.         windower.send_command('lua c gearswap c gearhandle')
  827.     end
  828. end)
  829.  
  830.  
  831. -- Newest updates:
  832. -- Added a fourth customizable Ready move option. (//gs c Ready four)
  833. -- Added a pre-Target Checkblocking function (credit to Quetzalcoatl.Sammeh)
  834. --
  835. -- Other previous update additions:
  836. -- Altered any keybinds that involved the Windows Key.
  837. -- Added a new Lag Mode (Ctrl + = to toggle).
  838. ----- Conducts most swaps during Ready precast, and handles Axe/Leg swaps afterwards.
  839. ----- Prevents Charmer's Merlin usage while single-wielding.
  840. ----- Intended to increase performance during Omen, Sinister Reign, Vagary, Delve, etc. when latency is poor.
  841. -- Added a gearset for off-handing Kraken Club.
  842. -- Corrected the spelling of ColdbloodComo.
  843. -- Added sets.midcast.Pet.Buff for Bubble Curtain, Scissor Guard, Secretion, Rage, Rhino Guard, Zealous Snort, Wild Carrot.
  844. -- Added Axe swaps for when Pet TP is 3000 after bonuses (sets.UnleashAtkAxes, sets.UnleashMABAxes).
  845. -- Divided Pet Only gearsets into 'TPBonus' and 'non-TPBonus' sets (to maximize dmg for Sweeping Gouge vs Chomp Rush, as an example).
  846. -- Equips Frenzy Sallet when you're asleep & engaged.
  847. -- Started using Nukumi Manoplas+1 for Magic Ready Attacks when below a certain TP threshold.
  848. -- The name of PetMode has been changed to AxeMode (is either NoSwaps or PetOnly). alt+= is the default keybind.
  849. -- Added a cycleback keybind (ctrl+F8) to cycle backward through the JugMode list.
  850. -- Changed Correlation Mode keybind to Alt+F11
  851. -- Added Pet:Subtle Blow and Pet:Store TP options to Hybrid Modes (ctrl+F9 to toggle).
  852. -- Added more gearsets/rules for PetOnly idle Axe swaps (TP, PDT, PetPDT, PetMDT, Idle).
  853. -- Added Verda's pet_tp function to the lua.
  854. -- Added a call_beast_cancel list to prevent usage of HQ jug pets with Call Beast JugModes.
  855. -- Moved pet_midcast rules to job_aftercast to help reduce issues due to lag or missed pet_midcast packets.
  856. -- Added Random Lockstyle Generator - set RandomLockstyleGenerator to 'false' to disable.
  857. -- Added on-screen indicators for Modes [requires the Text add-on] - set DisplayModeInfo to 'false' to disable
  858. -- Added Buff Timers for Reward, Spur, Run Wild - set DisplayPetBuffTimers to 'false' to disable
  859. --
  860. ---------------------------------------------
  861. -- Gearswap Commands Specific to this File --
  862. ---------------------------------------------
  863. -- Universal Ready Move Commands -
  864. -- //gs c Ready one
  865. -- //gs c Ready two
  866. -- //gs c Ready three
  867. -- //gs c Ready four
  868. --
  869. -- alt+F8 cycles through designated Jug Pets
  870. -- ctrl+F8 cycles backwards through designated Jug Pets
  871. -- alt+F11 toggles Monster Correlation between Neutral and Favorable
  872. -- ctrl+F9 cycles through Pet stances for Subtle Blow and Store TP modes
  873. -- alt+= switches between Pet-Only (Axe Swaps) and Master (no Axe Swap) modes
  874. -- ctrl+` can swap in the usage of Chaac Belt for Treasure Hunter on common subjob abilities.
  875. -- ctrl+F11 cycles between Magical Defense Modes
  876. -- ctrl+= activates a LagMode which swaps in most pet gear during precast.
  877. --
  878. -------------------------------
  879. -- General Gearswap Commands --
  880. -------------------------------
  881. -- F9 cycles Accuracy modes
  882. -- ctrl+F9 cycles Hybrid modes
  883. -- F10 equips Physical Defense
  884. -- alt+F10 toggles Kiting on or off
  885. -- ctrl+F10 cycles Physical Defense modes
  886. -- F11 equips Magical Defense
  887. -- alt+F12 turns off Defense modes
  888. -- ctrl+F12 cycles Idle modes
  889. --
  890. -- Keep in mind that any time you Change Jobs/Subjobs, your Pet/Correlation/etc reset to default options.
  891. -- F12 will list your current options.
  892. --
  893. -------------------------------------------------------------------------------------------------------------------
  894. -- Initialization function that defines sets and variables to be used.
  895. -------------------------------------------------------------------------------------------------------------------
  896.  
  897. -- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
  898.  
  899. -- Initialization function for this job file.
  900. function get_sets()
  901.     mote_include_version = 2
  902.  
  903.     -- Load and initialize the include file.
  904.     include('Mote-Include.lua')
  905.     include('organizer-lib')
  906. end
  907.  
  908. function job_setup()
  909.     -- Display and Random Lockstyle Generator options
  910.     DisplayPetBuffTimers = 'true'
  911.     DisplayModeInfo = 'true'
  912.     RandomLockstyleGenerator = 'false'
  913.  
  914.     PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None';ReadyMoveFour = 'None'
  915.     pet_info_update()
  916.  
  917.     -- Input Pet:TP Bonus values for Skirmish Axes used during Pet Buffs
  918.     TP_Bonus_Main = 140
  919.     TP_Bonus_Sub = 140
  920.  
  921.     -- 1200 Job Point Gift Bonus (Set equal to 0 if below 1200 Job Points)
  922.     TP_Gift_Bonus = 40
  923.  
  924.     -- (Adjust Run Wild Duration based on # of Job Points)
  925.     RunWildDuration = 340;RunWildIcon = 'abilities/00121.png'
  926.     RewardRegenIcon = 'spells/00023.png'
  927.     SpurIcon = 'abilities/00037.png'
  928.     BubbleCurtainDuration = 180;BubbleCurtainIcon = 'spells/00048.png'
  929.     ScissorGuardIcon = 'spells/00043.png'
  930.     SecretionIcon = 'spells/00053.png'
  931.     RageIcon = 'abilities/00002.png'
  932.     RhinoGuardIcon = 'spells/00053.png'
  933.     ZealousSnortIcon = 'spells/00057.png'
  934.  
  935.     -- Display Mode Info as on-screen Text
  936.     TextBoxX = 1060
  937.     TextBoxY = 47
  938.     TextSize = 10
  939.  
  940.     -- List of Equipment Sets created for Random Lockstyle Generator
  941.     -- (If you want to have the same Lockstyle every time, reduce the list to a single Equipset #)
  942.     random_lockstyle_list = {31,12,13,14,10,15,20}
  943.  
  944.     state.Buff['Aftermath: Lv.3'] = buffactive['Aftermath: Lv.3'] or false
  945.     state.Buff['Killer Instinct'] = buffactive['Killer Instinct'] or false
  946.  
  947.     if DisplayModeInfo == 'true' then
  948.         DisplayTrue = 1
  949.     end
  950.  
  951.     get_combat_form()
  952.     get_melee_groups()
  953. end
  954.  
  955. function user_setup()
  956.     state.OffenseMode:options('Normal', 'MedAcc', 'HighAcc', 'MaxAcc')
  957.     state.WeaponskillMode:options('Normal', 'WSMedAcc', 'WSHighAcc')
  958.     state.HybridMode:options('Normal', 'Hybrid', 'PetSB', 'PetSTP')
  959.     state.CastingMode:options('Normal')
  960.     state.IdleMode:options('Normal', 'Reraise', 'Refresh')
  961.     state.RestingMode:options('Normal')
  962.     state.PhysicalDefenseMode:options('PetPDT', 'PDT')
  963.     state.MagicalDefenseMode:options('PetMDT', 'MDTShell', 'MEva')
  964.  
  965.     -- Set up Jug Pet cycling and keybind Alt+F8/Ctrl+F8
  966.     -- INPUT PREFERRED JUG PETS HERE
  967.     state.JugMode = M{['description']='Jug Mode', 'BlackbeardRandy', 'RhymingShizuna', 'PonderingPeter',
  968.         'DroopyDortwin','VivaciousVickie', 'CaringKiyomaro', 'BloodclawShasra',
  969.         'WarlikePatrick', 'SuspiciousAlice', 'FleetReinhard',
  970.         'BouncingBertha', 'ScissorlegXerin', 'HeadbreakerKen', 'ThreestarLynn',  'HurlerPercival', 'AnklebiterJedd',
  971.         'SpiderFamiliar', 'GussyHachirobe', 'CursedAnnabelle', 'Left-HandedYoko', 'MosquitoFamiliar', 'PrestoJulio',
  972.         'SharpwitHermes', 'BrainyWaluis', 'RedolentCandi', 'AlluringHoney',
  973.         'SwoopingZhivago', 'AttentiveIbuki', 'ColibriFamiliar', 'ChoralLeera', 'SurgingStorm', 'SubmergedIyo', 'FaithfulFalcorr',
  974.         'AgedAngus','SunburstMalfik', 'AmiableRoche', 'HeraldHenry', 'BraveHeroGlenn',
  975.         'GenerousArthur', 'FluffyBredo', 'AcuexFamiliar',"FatsoFargann",}
  976.     send_command('bind !f8 gs c cycle JugMode')
  977.     send_command('bind ^f8 gs c cycleback JugMode')
  978.  
  979.     -- Set up Monster Correlation Modes and keybind Alt+F11
  980.     state.CorrelationMode = M{['description']='Correlation Mode', 'Neutral', 'Favorable'}
  981.     send_command('bind !f11 gs c cycle CorrelationMode')
  982.  
  983.     -- Set up Axe Swapping Modes and keybind alt+=
  984.     state.AxeMode = M{['description']='Axe Mode', 'PetOnly', 'NoSwaps'}
  985.     send_command('bind != gs c cycle AxeMode')
  986.  
  987.     -- Keybind Ctrl+F11 to cycle Magical Defense Modes
  988.     send_command('bind ^f11 gs c cycle MagicalDefenseMode')
  989.  
  990.     -- Set up Treasure Modes and keybind Ctrl+`
  991.     state.TreasureMode = M{['description']='Treasure Mode', 'Tag', 'Normal'}
  992.     send_command('bind ^` gs c cycle TreasureMode')
  993.  
  994.     -- Set up Lag Modes and keybind Ctrl+=
  995.     state.LagMode = M{['description']='Lag Mode', 'Lag', 'Normal'}
  996.     send_command('bind ^= gs c cycle LagMode')
  997.  
  998.     -- 'Out of Range' distance; Melee WSs will auto-cancel
  999.     target_distance = 8
  1000.  
  1001. -- Categorized list of Ready moves
  1002. physical_ready_moves = S{'Foot Kick','Whirl Claws','Sheep Charge','Lamb Chop','Head Butt','Wild Oats',
  1003.     'Leaf Dagger','Claw Cyclone','Razor Fang','Nimble Snap','Cyclotail','Rhino Attack','Power Attack',
  1004.     'Mandibular Bite','Grapple','Spinning Top','Double Claw','Frogkick','Blockhead', 'Big Scissors',
  1005.     'Brain Crush','Tail Blow','??? Needles','Needleshot','Scythe Tail','Ripper Fang','Chomp Rush',
  1006.     'Recoil Dive','Sudden Lunge','Spiral Spin','Wing Slap','Beak Lunge','Suction','Back Heel',
  1007.     'Fantod','Tortoise Stomp','Sensilla Blades','Tegmina Buffet','Swooping Frenzy','Pentapeck',
  1008.     'Sweeping Gouge','Somersault','Tickling Tendrils','Pecking Flurry','Sickle Slash'}
  1009.  
  1010. magic_atk_ready_moves = S{'Dust Cloud','Cursed Sphere','Venom','Toxic Spit','Drainkiss', 'Bubble Shower',
  1011.     'Silence Gas','Dark Spore','Fireball','Plague Breath','Snow Cloud','Charged Whisker',
  1012.     'Corrosive Ooze','Aqua Breath','Stink Bomb','Nectarous Deluge','Nepenthic Plunge','Pestilent Plume',
  1013.     'Foul Waters','Acid Spray','Infected Leech','Gloom Spray'}
  1014.  
  1015. magic_acc_ready_moves = S{'Sheep Song','Scream','Dream Flower','Roar','Gloeosuccus','Palsy Pollen',
  1016.     'Soporific','Geist Wall','Toxic Spit','Numbing Noise','Spoil','Hi-Freq Field','Sandpit','Sandblast',
  1017.     'Venom Spray','Filamented Hold','Queasyshroom','Numbshroom','Spore','Shakeshroom','Infrasonics','Purulent Ooze',
  1018.     'Chaotic Eye','Blaster','Intimidate','Noisome Powder','Acid Mist','TP Drainkiss','Choke Breath',
  1019.     'Jettatura','Molting Plumage','Spider Web'}
  1020.  
  1021. multi_hit_ready_moves = S{'Pentapeck','Tickling Tendrils','Sweeping Gouge','Chomp Rush','Wing Slap',
  1022.     'Pecking Flurry'}
  1023.  
  1024. tp_based_ready_moves = S{'Foot Kick','Dust Cloud','Snow Cloud','Sheep Song','Sheep Charge','Lamb Chop',
  1025.     'Head Butt','Scream','Dream Flower','Wild Oats','Leaf Dagger','Claw Cyclone','Razor Fang','Roar',
  1026.     'Gloeosuccus','Palsy Pollen','Soporific','Cursed Sphere','Somersault','Geist Wall','Numbing Noise',
  1027.     'Frogkick','Nimble Snap','Cyclotail','Spoil','Rhino Attack','Hi-Freq Field','Sandpit','Sandblast',
  1028.     'Mandibular Bite','Metallic Body','Bubble Shower','Grapple','Spinning Top','Double Claw','Spore',
  1029.     'Filamented Hold','Blockhead','Fireball','Tail Blow','Plague Breath','Brain Crush','Infrasonics',
  1030.     'Needleshot','Chaotic Eye','Blaster','Ripper Fang','Intimidate','Recoil Dive','Water Wall',
  1031.     'Sudden Lunge','Noisome Powder','Wing Slap','Beak Lunge','Suction','Drainkiss','Acid Mist',
  1032.     'TP Drainkiss','Back Heel','Jettatura','Choke Breath','Fantod','Charged Whisker','Purulent Ooze',
  1033.     'Corrosive Ooze','Tortoise Stomp','Aqua Breath','Sensilla Blades','Tegmina Buffet','Sweeping Gouge',
  1034.     'Tickling Tendrils','Pecking Flurry','Pestilent Plume','Foul Waters','Spider Web','Gloom Spray'}
  1035.  
  1036. -- List of Pet Buffs and Ready moves exclusively modified by Pet TP Bonus gear.
  1037. pet_buff_moves = S{'Spur','Run Wild','Wild Carrot','Bubble Curtain','Scissor Guard',  'Secretion','Rage',
  1038.     'Harden Shell','Rhino Guard','Zealous Snort'}
  1039.  
  1040. -- List of Jug Modes that will cancel if Call Beast is used (Bestial Loyalty-only jug pets, HQs generally).
  1041. call_beast_cancel = S{'Vis. Broth','Ferm. Broth','Bubbly Broth','Windy Greens','Bug-Ridden Broth','Tant. Broth',
  1042.     'Glazed Broth','Slimy Webbing','Deepwater Broth','Venomous Broth','Heavenly Broth'}
  1043.  
  1044. -- List of abilities to reference for applying Treasure Hunter gear.
  1045. abilities_to_check = S{'Feral Howl','Quickstep','Box Step','Stutter Step','Desperate Flourish',
  1046.     'Violent Flourish','Animated Flourish','Provoke','Dia','Dia II','Flash','Bio','Bio II',
  1047.     'Sleep','Sleep II','Drain','Aspir','Dispel','Stun','Steal','Mug'}
  1048.  
  1049. enmity_plus_moves = S{'Provoke','Berserk','Warcry','Aggressor','Holy Circle','Sentinel','Last Resort',
  1050.     'Souleater','Vallation','Swordplay', 'Pflug', 'Blank Gaze', 'Sheep Song', 'Soporific', 'Stinking Gas', 'Jettatura', 'Geist Wall', 'Vivacious Etude',
  1051.     'Quick Etude', 'Sinewy Etude', 'Dextrous Etude', 'Learned Etude', 'Spirited Etude', 'Enchanting Etude'}
  1052.  
  1053. -- Random Lockstyle generator.
  1054.     if RandomLockstyleGenerator == 'true' then
  1055.         local randomLockstyle = random_lockstyle_list[math.random(1, #random_lockstyle_list)]
  1056.         send_command('@wait 5;input /lockstyleset '.. randomLockstyle)
  1057.     end
  1058.  
  1059.     display_mode_info()
  1060. end
  1061.  
  1062. function file_unload()
  1063.     if binds_on_unload then
  1064.         binds_on_unload()
  1065.     end
  1066.  
  1067.     -- Unbinds the Reward, Correlation, JugMode, AxeMode and Treasure hotkeys.
  1068.     send_command('unbind !=')
  1069.     send_command('unbind ^=')
  1070.     send_command('unbind @=')
  1071.     send_command('unbind !f8')
  1072.     send_command('unbind ^f8')
  1073.     send_command('unbind @f8')
  1074.     send_command('unbind ^f11')
  1075.  
  1076.     -- Removes any Text Info Boxes
  1077.     send_command('text JugPetText delete')
  1078.     send_command('text CorrelationText delete')
  1079.     send_command('text AxeModeText delete')
  1080.     send_command('text AccuracyText delete')
  1081. end
  1082.  
  1083. -- BST gearsets
  1084. function init_gear_sets()
  1085.  
  1086.     -------------------------------------------------
  1087.     -- AUGMENTED GEAR AND GENERAL GEAR DEFINITIONS --
  1088.     -------------------------------------------------
  1089.  
  1090.     Pet_Idle_AxeMain = "Aymur"
  1091.     Pet_Idle_AxeSub = "Arktoi"
  1092.     Pet_PDT_AxeMain = "Izizoeksi"
  1093.     Pet_PDT_AxeSub = {name="Astolfo", augments={'VIT+11','Pet: Phys. dmg. taken -11%',}}
  1094.     Pet_MDT_AxeMain = "Izizoeksi"
  1095.     Pet_MDT_AxeSub = { name="Digirbalag", augments={'Pet: Damage taken -3%','Pet: STR+15','Pet: Accuracy+11 Pet: Rng. Acc.+11','Pet: Attack+16 Pet: Rng.Atk.+16','DMG:+4',}}
  1096.     Pet_TP_AxeMain = "Skullrender"
  1097.     Pet_TP_AxeSub = "Skullrender"
  1098.     Pet_Regen_AxeMain = "Buramgh"
  1099.     Pet_Regen_AxeSub = { name="Kumbhakarna", augments={'Pet: "Mag.Atk.Bns."+22','Pet: "Regen"+1','Pet: TP Bonus+140',}}
  1100.  
  1101.     Ready_Atk_Axe = "Aymur"
  1102.     Ready_Atk_Axe2 = "Arktoi"
  1103.     Ready_Atk_TPBonus_Axe = { name="Kumbhakarna", augments={'Pet: "Mag.Atk.Bns."+22','Pet: "Regen"+1','Pet: TP Bonus+140',}}
  1104.     Ready_Atk_TPBonus_Axe2 = { name="Kumbhakarna", augments={'Pet: "Mag.Atk.Bns."+22','Pet: "Regen"+1','Pet: TP Bonus+140',}}
  1105.  
  1106.     Ready_Acc_Axe = "Arktoi"
  1107.     Ready_Acc_Axe2 = { name="Digirbalag", augments={'Pet: VIT+3','Pet: Accuracy+23 Pet: Rng. Acc.+23','Pet: Attack+24 Pet: Rng.Atk.+24',}}
  1108.     Ready_Acc_TPBonus_Axe = { name="Kumbhakarna", augments={'Pet: "Mag.Atk.Bns."+22','Pet: "Regen"+1','Pet: TP Bonus+140',}}
  1109.  
  1110.     Ready_MAB_Axe = "Kumbhakarna"
  1111.     Ready_MAB_Axe2 = "Deacon Tabar"
  1112.     Ready_MAB_TPBonus_Axe = { name="Kumbhakarna", augments={'Pet: "Mag.Atk.Bns."+22','Pet: "Regen"+1','Pet: TP Bonus+140',}}
  1113.     Ready_MAB_TPBonus_Axe2 = { name="Kumbhakarna", augments={'Pet: "Mag.Atk.Bns."+22','Pet: "Regen"+1','Pet: TP Bonus+140',}}
  1114.  
  1115.     Ready_MAcc_Axe = {name="Kumbhakarna", augments={'Pet: Mag. Acc.+20','"Cure" potency +15%','Pet: TP Bonus+180',}}
  1116.     Ready_MAcc_Axe2 = {name="Digirbalag", augments={'Pet: Mag. Acc.+21','Pet: "Mag.Atk.Bns."+30','INT+2 MND+2 CHR+2',}}
  1117.  
  1118.     --Reward_Axe = "Farsha"
  1119.     Reward_Axe2 = "Farsha"
  1120.     Reward_hands = "Totemic Gloves +3"
  1121.     Reward_back = { name="Artio's Mantle", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Weapon skill damage +10%',}}
  1122.  
  1123.     Pet_PDT_head = "Anwig Salade"
  1124.     Pet_PDT_body = "Totemic Jackcoat +3"
  1125.     Pet_PDT_hands = "Ankusa Gloves +3"
  1126.     Pet_PDT_legs = "Tali'ah Seraweels +2"
  1127.     Pet_PDT_feet = { name="Valorous Greaves", augments={'Pet: Accuracy+26 Pet: Rng. Acc.+26','Pet: Phys. dmg. taken -5%','Pet: Attack+11 Pet: Rng.Atk.+11',}}
  1128.     Pet_PDT_back = { name="Artio's Mantle", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Pet: Attack+10 Pet: Rng.Atk.+10','Pet: Haste+10','System: 1 ID: 1246 Val: 4',}}
  1129.  
  1130.     Pet_MDT_head = "Anwig Salade"
  1131.     Pet_MDT_body = "Totemic Jackcoat +3"
  1132.     Pet_MDT_hands = { name="Taeon Gloves", augments={'Pet: Accuracy+20 Pet: Rng. Acc.+20','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}}
  1133.     Pet_MDT_legs = "Tali'ah Seraweels +2"
  1134.     Pet_MDT_feet = { name="Taeon Boots", augments={'Pet: Attack+9 Pet: Rng.Atk.+9','Pet: "Dbl. Atk."+3','Pet: Damage taken -4%',}}
  1135.     Pet_MDT_back = { name="Artio's Mantle", augments={'Pet: M.Acc.+20 Pet: M.Dmg.+20','Eva.+20 /Mag. Eva.+20','Pet: Mag. Acc.+10','Pet: "Regen"+10','System: 1 ID: 1247 Val: 4',}}
  1136.    
  1137.     Pet_DT_head = "Anwig Salade"
  1138.     Pet_DT_body = Pet_PDT_body
  1139.     Pet_DT_hands = { name="Taeon Gloves", augments={'Pet: Accuracy+20 Pet: Rng. Acc.+20','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}}
  1140.     Pet_DT_legs = Pet_PDT_legs
  1141.     Pet_DT_feet = { name="Taeon Boots", augments={'Pet: Attack+9 Pet: Rng.Atk.+9','Pet: "Dbl. Atk."+3','Pet: Damage taken -4%',}}
  1142.     Pet_DT_back = "Pastoralist's mantle"
  1143.    
  1144.     Pet_Regen_head = { name="Valorous Mask", augments={'Pet: "Regen"+5','Pet: VIT+4','Pet: Attack+3 Pet: Rng.Atk.+3',}}
  1145.     Pet_Regen_body = "Emicho haubert"
  1146.     Pet_Regen_hands = { name="Valorous Mitts", augments={'Pet: Attack+21 Pet: Rng.Atk.+21','Pet: "Regen"+5','Pet: DEX+6',}}
  1147.     --Pet_Regen_legs = { name="Valor. Hose", augments={'Pet: Mag. Acc.+13','Pet: "Regen"+3','Pet: DEX+5','Pet: Attack+6 Pet: Rng.Atk.+6',}}
  1148.     Pet_Regen_feet = "Emicho Gambieras"
  1149.     Pet_Regen_back = Pet_MDT_back
  1150.  
  1151.     Ready_Atk_head = "Emicho coronet"
  1152.     Ready_Atk_body = {name="Valorous Mail", augments={'Pet: Attack+27 Pet: Rng.Atk.+27','Pet: STR+14','Pet: Accuracy+14 Pet: Rng. Acc.+14',}}
  1153.     Ready_Atk_hands = "Emicho Gauntlets"
  1154.     Ready_Atk_legs = "Totemic Trousers +3"
  1155.     Ready_Atk_feet = "Totemic Gaiters +3"
  1156.     Ready_Atk_back = Pet_PDT_back
  1157.  
  1158.     Ready_Acc_head = "Heyoka Cap"
  1159.     Ready_Acc_body = "Heyoka harness"
  1160.     Ready_Acc_hands = "Heyoka mittens"
  1161.     Ready_Acc_legs = "Heyoka Subligar"
  1162.     Ready_Acc_feet = "Heyoka leggings"
  1163.     Ready_Acc_back = Pet_PDT_back
  1164.  
  1165.     Ready_MAB_head = { name="Valorous Mask", augments={'Pet: "Mag.Atk.Bns."+25','System: 1 ID: 1796 Val: 5','Pet: Accuracy+9 Pet: Rng. Acc.+9','Pet: Attack+15 Pet: Rng.Atk.+15',}}
  1166.     Ready_MAB_body = "Emicho haubert"
  1167.     Ready_MAB_hands = {name="Valorous Mitts", augments={'Pet: "Mag.Atk.Bns."+30','Pet: "Dbl.Atk."+1 Pet: Crit.hit rate +1','System: 1 ID: 1792 Val: 0',}}
  1168.     Ready_MAB_legs = { name="Valor. Hose", augments={'Pet: "Mag.Atk.Bns."+27','Pet: "Dbl. Atk."+2','Pet: VIT+6','Pet: Accuracy+7 Pet: Rng. Acc.+7',}}
  1169.     Ready_MAB_feet = { name="Valorous Greaves", augments={'Pet: "Mag.Atk.Bns."+29','Pet: "Store TP"+7','System: 1 ID: 1795 Val: 5',}}
  1170.     Ready_MAB_back = "Argochampsa mantle" --{ name="Artio's Mantle", augments={'Pet: M.Acc.+20 Pet: M.Dmg.+20','Eva.+20 /Mag. Eva.+20','Pet: Mag. Acc.+10','Pet: "Regen"+10',}}
  1171.  
  1172.     Ready_MAcc_head = "Tali'ah Turban +2"
  1173.     Ready_MAcc_body = "Tali'ah manteel +2"
  1174.     Ready_MAcc_hands = "Tali'ah gages +2"
  1175.     Ready_MAcc_legs = "Tali'ah Seraweels +2"
  1176.     Ready_MAcc_feet = "Tali'ah Crackows +1"
  1177.     Ready_MAcc_back = Pet_MDT_back
  1178.  
  1179.     Ready_DA_axe = "Skullrender"
  1180.     Ready_DA_head = "Emicho Coronet"
  1181.     Ready_DA_body = "Taeon Tabard"
  1182.     Ready_DA_hands = "Emicho Gauntlets"
  1183.     Ready_DA_legs = "Emicho Hose"
  1184.     Ready_DA_feet = "Emicho gambieras"
  1185.  
  1186.     Pet_Melee_head = "Emicho Coronet"
  1187.     Pet_Melee_body = { name="Taeon Tabard", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+3','Pet: Haste+5',}}
  1188.     Pet_Melee_hands = "Emicho Gauntlets"
  1189.     Pet_Melee_legs = "Emicho Hose"
  1190.     Pet_Melee_feet = "Emicho Gambieras"
  1191.     Pet_Melee_back = Pet_PDT_back
  1192.    
  1193.     --Pet_SB_body = {name="Valorous Mail", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Pet: "Subtle Blow"+11','Pet: Accuracy+15 Pet: Rng. Acc.+15',}}
  1194.  
  1195.     Hybrid_head = {name="Valorous Mask", augments={'Pet: "Regen"+5','Pet: Accuracy+13 Pet: Rng. Acc.+13',}}
  1196.     Hybrid_body = Pet_PDT_body
  1197.     Hybrid_hands = Pet_PDT_hands
  1198.     Hybrid_legs = {name="Taeon Tights", augments={'Accuracy+20 Attack+20','"Triple Atk."+2','Pet: Damage taken -4%',}}
  1199.     Hybrid_feet = {name="Taeon Boots", augments={'Accuracy+25','"Triple Atk."+2','Pet: Damage taken -4%',}}
  1200.  
  1201.     --DW_head = {name="Taeon Chapeau", augments={'Accuracy+19 Attack+19','"Dual Wield"+5','STR+3 VIT+3',}}
  1202.     --DW_body = {name="Taeon Tabard", augments={'Accuracy+20 Attack+20','"Dual Wield"+5','Crit. hit damage +2%',}}
  1203.     --DW_hands = {name="Taeon Gloves", augments={'Accuracy+18 Attack+18','"Dual Wield"+5','MND+9',}}
  1204.     --DW_legs = "Sombra tights"
  1205.     DW_feet = { name="Taeon Boots", augments={'Accuracy+24','"Dual Wield"+5','STR+1 CHR+1',}}
  1206.  
  1207.     MAB_head = "Jumalik Helm"
  1208.     MAB_body = { name="Valorous Mail", augments={'"Mag.Atk.Bns."+24','Crit.hit rate+1','DEX+2','Accuracy+1',}}
  1209.     MAB_hands = "Leyline Gloves"
  1210.     MAB_legs = { name="Valor. Hose", augments={'"Mag.Atk.Bns."+23','"Dbl.Atk."+2','Mag. Acc.+8 "Mag.Atk.Bns."+8',}}
  1211.     MAB_feet = { name="Valorous Greaves", augments={'"Mag.Atk.Bns."+22','DEX+5','Accuracy+10','Attack+8',}}
  1212.    
  1213.     WSD_legs={ name="Valor. Hose", augments={'Accuracy+23','Weapon skill damage +4%','STR+9','Attack+4',}}
  1214.    
  1215.     FC_head = { name="Valorous Mask", augments={'Accuracy+14','"Fast Cast"+4','Accuracy+16 Attack+16','Mag. Acc.+17 "Mag.Atk.Bns."+17',}}
  1216.     FC_body = "Taeon Tabard"
  1217.     FC_hands = "Leyline Gloves"
  1218.     FC_legs = "Arjuna Breeches"
  1219.     --FC_feet = {name="Taeon Boots", augments={'Mag. Acc.+13 "Mag.Atk.Bns."+13','"Fast Cast"+5','Weapon skill damage +2%',}}
  1220.     --FC_back = {name="Artio's Mantle", augments={'INT+20','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','"Fast Cast"+10',}}
  1221.  
  1222.     MAcc_head = "Tali'ah Turban +2"
  1223.     MAcc_body = "Tali'ah manteel +2"
  1224.     MAcc_hands = "Tali'ah gages +2"
  1225.     MAcc_legs = "Tali'ah Seraweels +2"
  1226.     MAcc_feet = "Tali'ah Crackows +1"
  1227.     MAcc_back = { name="Artio's Mantle", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Weapon skill damage +10%',}}
  1228.  
  1229.     --MEva_Axe_main = {name="Kumbhakarna", augments={'Mag. Evasion+14','Magic dmg. taken -5%','INT+15',}}
  1230.     --MEva_Axe_sub = {name="Astolfo", augments={'CHR+11','Mag. Evasion+16',}}
  1231.     MEva_head = "Heyoka Cap"
  1232.     MEva_body = "Heyoka harness"
  1233.     MEva_hands = "Heyoka mittens"
  1234.     MEva_legs = "Heyoka subligar"
  1235.     MEva_feet = "Heyoka Leggings"
  1236.     MEva_back = Pet_MDT_back
  1237.  
  1238.     --CB_head = {name="Acro Helm", augments={'Pet: Mag. Acc.+25','"Call Beast" ability delay -5',}}
  1239.     CB_body = "Mirke Wardecors"
  1240.     CB_hands = "Ankusa Gloves +3"
  1241.     --CB_legs = {name="Acro Breeches", augments={'Pet: Mag. Acc.+25','"Call Beast" ability delay -5',}}
  1242.     CB_feet = "Armada Sollerets"
  1243.  
  1244.     Cure_Potency_axe = {name="Kumbhakarna", augments={'Pet: Mag. Acc.+20','"Cure" potency +15%','Pet: TP Bonus+180',}}
  1245.     Cure_Potency_head = "Emicho Coronet"
  1246.     Cure_Potency_body = "Jumalik Mail"
  1247.     Cure_Potency_hands = "Buremte Gloves"
  1248.     Cure_Potency_legs = "Totemic Trousers +3"
  1249.     --Cure_Potency_feet = {name="Taeon Boots", augments={'"Cure" potency +5%',}}
  1250.     Cure_Potency_back = {name="Artio's Mantle", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','MND+10','Weapon skill damage +10%',}}
  1251.  
  1252.     Waltz_back = {name="Artio's Mantle", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','CHR+10','Weapon skill damage +10%',}}
  1253.  
  1254.     STR_DA_back = { name="Artio's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Dbl.Atk."+10','Phys. dmg. taken-10%',}}
  1255.     STR_WS_back = { name="Artio's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Dbl.Atk."+10',}}
  1256.     Onslaught_back = { name="Artio's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Dbl.Atk."+10',}}
  1257.     Primal_back = { name="Artio's Mantle", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','CHR+10','Weapon skill damage +10%',}}
  1258.     Cloud_back = { name="Artio's Mantle", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Weapon skill damage +10%',}}
  1259.  
  1260.     --TH_hands = {name="Valorous Mitts", augments={'Pet: STR+6','"Fast Cast"+3','"Treasure Hunter"+1','Mag. Acc.+15 "Mag.Atk.Bns."+15',}}
  1261.     TH_legs = { name="Valor. Hose", augments={'Pet: Mag. Acc.+16','STR+14','"Treasure Hunter"+1','Mag. Acc.+5 "Mag.Atk.Bns."+5',}}
  1262.     TH_feet = { name="Valorous Greaves", augments={'Pet: "Regen"+1','Accuracy+20 Attack+20','"Treasure Hunter"+1','Mag. Acc.+18 "Mag.Atk.Bns."+18',}}
  1263.     Enmity_plus_feet = "Dux greaves"  --{name="Acro Leggings", augments={'Pet: Mag. Acc.+23','Enmity+10',}}
  1264.     --Enmity_plus_back = {name="Artio's Mantle", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','Enmity+10',}}
  1265.  
  1266.     sets.Enmity = {ammo="Paeapua",
  1267.         head="Halitus Helm",
  1268.         neck="Unmoving Collar",
  1269.         --ear1="Trux Earring",
  1270.         ear2="Cryptic Earring",
  1271.         body="Emet Harness +1",
  1272.         hands="Macabre Gauntlets +1", ring1="Petrov Ring",ring2="Begrudging Ring",
  1273.         --back=Enmity_plus_back,
  1274.         waist="Sinew belt", --"Trance Belt",
  1275.         legs="Zoar Subligar +1",
  1276.         feet=Enmity_plus_feet
  1277.         }
  1278.     sets.EnmityNE = set_combine(sets.Enmity, {main="Freydis",sub="Evalach +1"})
  1279.     sets.EnmityNEDW = set_combine(sets.Enmity, {main="Freydis",sub="Evalach +1"})
  1280.    
  1281.     --Pet Enmity +50 (Heyoka +1 set makes it +60)
  1282.     sets.PetEnmity = { head="Heyoka Cap", ear1="Rimeice earring", ear2="Domes. earring",
  1283.         body="Heyoka Harness", hands="Heyoka mittens",
  1284.         --waist="Primal belt",
  1285.         legs="Heyoka subligar", feet="Heyoka leggings",
  1286.         }
  1287.     sets.PetEnmityNE = set_combine(sets.PetEnmity, {main="Izizoeksi"}) -- +7
  1288.     sets.PetEnmityNEDW = set_combine(sets.PetEnmity, {main="Izizoeksi",sub="Anahera Tabar"}) -- +7 / +6
  1289.    
  1290.    
  1291.     ---------------------
  1292.     -- JA PRECAST SETS --
  1293.     ---------------------
  1294.     -- Most gearsets are divided into 3 categories:
  1295.     -- 1. Default - No Axe swaps involved.
  1296.     -- 2. NE (Not engaged) - Axe/Shield swap included, for use with Pet Only mode.
  1297.     -- 3. NEDW (Not engaged; Dual-wield) - Axe swaps included, for use with Pet Only mode.
  1298.  
  1299.     sets.precast.JA.Familiar = {legs="Ankusa Trousers +3"}
  1300.     sets.precast.JA['Call Beast'] = {head=CB_head,
  1301.         body=CB_body,
  1302.         hands=CB_hands,
  1303.         legs=CB_legs,
  1304.         feet=CB_feet}
  1305.     sets.precast.JA['Bestial Loyalty'] = sets.precast.JA['Call Beast']
  1306.    
  1307.     sets.precast.JA['Snarl'] = sets.PetEnmity
  1308.    
  1309.     sets.precast.JA.Tame = {head="Totemic Helm +3",ear1="Tamer's Earring",--legs="Stout Kecks"
  1310.     }
  1311.  
  1312.     sets.precast.JA.Spur = {back="Artio's Mantle",feet="Nukumi Ocreae +1"}
  1313.     sets.precast.JA.SpurNE = set_combine(sets.precast.JA.Spur, {main="Skullrender"})
  1314.     sets.precast.JA.SpurNEDW = set_combine(sets.precast.JA.Spur, {main="Skullrender",sub="Skullrender"})
  1315.  
  1316.     --sets.precast.JA['Feral Howl'] = {ammo="Pemphredo Tathlum",
  1317.     --    head=MAcc_head,neck="Sanctity Necklace",ear1="Hermetic Earring",ear2="Dignitary's Earring",
  1318.     --    body=MAcc_body,hands=MAcc_hands,ring1="Rahab Ring",ring2="Sangoma Ring",
  1319.     --    back=MAcc_back,waist="Eschan Stone",legs=MAcc_legs,feet=MAcc_feet}
  1320.     sets.precast.JA['Feral Howl'] = sets.Enmity
  1321.  
  1322.     sets.precast.JA['Killer Instinct'] = set_combine(sets.Enmity, {head="Ankusa Helm +3"})
  1323.  
  1324.     sets.precast.JA.Reward = {ammo="Pet Food Theta",
  1325.         head="Brave's warbonnet",neck="Phalaina locket",ear1="Lifestorm Earring",--ear2="Neptune's Pearl",
  1326.         body="Totemic Jackcoat +3",hands="Totemic gloves +3",--ring1="Solemn Ring",ring2="Balrahn's Ring",
  1327.         back=Reward_back,--waist="Engraved Belt",
  1328.         legs="Totemic trousers +3",feet="Totemic gaiters +3"}
  1329.     sets.precast.JA.RewardNE = set_combine(sets.precast.JA.Reward, {main=Reward_Axe,sub="Matamata Shield +1"})
  1330.     sets.precast.JA.RewardNEDW = set_combine(sets.precast.JA.RewardNE, {sub=Reward_Axe2})
  1331.  
  1332.     sets.precast.JA.Charm = {ammo="light sachet",
  1333.         head="Totemic helm +3",neck="Unmoving collar",ear1="Handler's earring +1",ear2="Rimeice earring",
  1334.         body="Ankusa Jackcoat +1",hands="Ankusa Gloves +3",ring1="Airy Ring",--ring2="Balrahn's Ring",
  1335.         back=Primal_back,waist="Aristo Belt",legs="Ankusa Trousers +3",feet="Ankusa Gaiters +3"}
  1336.     sets.precast.JA.CharmNE = set_combine(sets.precast.JA.Charm, {main="Buramgh axe"})
  1337.     sets.precast.JA.CharmNEDW = set_combine(sets.precast.JA.CharmNE, {main="Buramgh axe"})
  1338.  
  1339.     ---------------------------
  1340.     -- PET SIC & READY MOVES --
  1341.     ---------------------------
  1342.  
  1343.     sets.ReadyRecast = {legs="Desultor Tassets"}
  1344.     sets.midcast.Pet.TPBonus = {hands="Nukumi Manoplas +1"}
  1345.     --sets.micast.Pet.TPBonus.PetEnmity = set_combine(sets.PetEnmity, {hands="Nukumi Manoplas +1"}
  1346.     sets.midcast.Pet.Neutral = {head=Ready_Atk_head}
  1347.     sets.midcast.Pet.Favorable = {head="Nukumi Cabasset +1"}
  1348.  
  1349.     sets.midcast.Pet.WS = {ammo="Demonry Core",
  1350.         neck="Shulmanu Collar",ear1="Hija Earring",ear2="Enmerkar Earring",
  1351.         body=Ready_Atk_body,
  1352.         hands=Ready_Atk_hands,
  1353.         ring1="Thurandaut Ring +1",
  1354.         ring2="Varar Ring",
  1355.         back=Ready_Atk_back,
  1356.         waist="Incarnation Sash",
  1357.         legs=Ready_Atk_legs,
  1358.         feet=Ready_Atk_feet}
  1359.  
  1360.     sets.midcast.Pet.MedAcc = set_combine(sets.midcast.Pet.WS, {
  1361.         ear2="Enmerkar Earring",
  1362.         body=Ready_Acc_body,
  1363.         back=Ready_Acc_back,
  1364.         waist="Incarnation Sash",
  1365.         legs=Ready_Acc_legs})
  1366.  
  1367.     sets.midcast.Pet.HighAcc = set_combine(sets.midcast.Pet.WS, {
  1368.         ear1="Ferine Earring",
  1369.         ear2="Enmerkar Earring",
  1370.         body=Ready_Acc_body,
  1371.         back=Ready_Acc_back,
  1372.         waist="Incarnation Sash",
  1373.         legs=Ready_Acc_legs,
  1374.         feet=Ready_Acc_feet})
  1375.  
  1376.     sets.midcast.Pet.MaxAcc = set_combine(sets.midcast.Pet.WS, {
  1377.         head="Heyoka cap",
  1378.         ear1="Ferine Earring",
  1379.         ear2="Enmerkar Earring",
  1380.         body="Heyoka harness",
  1381.         hands="Heyoka mittens",
  1382.         back=Ready_Acc_back,
  1383.         waist="Incarnation Sash",
  1384.         legs="Heyoka subligar",
  1385.         feet=Ready_Acc_feet})
  1386.  
  1387.     sets.midcast.Pet.MagicAtkReady = set_combine(sets.midcast.Pet.WS, {
  1388.         head=Ready_MAB_head,
  1389.         neck="Adad Amulet",
  1390.         ear1="Hija Earring",ear2="Enmerkar Earring",
  1391.         body=Ready_MAB_body,
  1392.         hands=Ready_MAB_hands,
  1393.         ring1="Tali'ah Ring",
  1394.         back=Ready_MAB_back,
  1395.         legs=Ready_MAB_legs,
  1396.         feet=Ready_MAB_feet})
  1397.  
  1398.     sets.midcast.Pet.MagicAtkReady.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReady, {
  1399.         head=Ready_MAcc_head,
  1400.         ear2="Enmerkar Earring",
  1401.         legs=Ready_MAcc_legs})
  1402.  
  1403.     sets.midcast.Pet.MagicAtkReady.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReady, {
  1404.         head=Ready_MAcc_head,
  1405.         ear2="Enmerkar Earring",
  1406.         body=Ready_MAcc_body,
  1407.         hands=Ready_MAcc_hands,
  1408.         back=Ready_MAcc_back,
  1409.         legs=Ready_MAcc_legs})
  1410.  
  1411.     sets.midcast.Pet.MagicAtkReady.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReady, {
  1412.         head=Ready_MAcc_head,
  1413.         ear1="Sapphire Earring",ear2="Enmerkar Earring",
  1414.         body=Ready_MAcc_body,
  1415.         hands=Ready_MAcc_hands,
  1416.         back=Ready_MAcc_back,
  1417.         legs=Ready_MAcc_legs,
  1418.         feet=Ready_MAcc_feet})
  1419.  
  1420.     sets.midcast.Pet.MagicAccReady = set_combine(sets.midcast.Pet.WS, {
  1421.         head=Ready_MAcc_head,
  1422.         neck="Adad Amulet",
  1423.         ear1="Sapphire Earring",ear2="Enmerkar Earring",
  1424.         body=Ready_MAcc_body,
  1425.         hands=Ready_MAcc_hands,
  1426.         ring1="Tali'ah Ring",
  1427.         back=Ready_MAcc_back,
  1428.         legs=Ready_MAcc_legs,
  1429.         feet=Ready_MAcc_feet})
  1430.  
  1431.     sets.midcast.Pet.MultiStrike = set_combine(sets.midcast.Pet.WS, {
  1432.         neck="Shulmanu Collar",ear2="Domesticator's Earring",
  1433.         body=Ready_DA_body,
  1434.         hands=Ready_DA_hands,
  1435.         legs=Ready_DA_legs,
  1436.         feet=Ready_DA_feet})
  1437.  
  1438.     sets.midcast.Pet.SubtleBlowMNK = {ear1="Gelai Earring",
  1439.         body=Pet_SB_body,
  1440.         waist="Isa Belt"}
  1441.  
  1442.     sets.midcast.Pet.SubtleBlowNonMNK = set_combine(sets.midcast.Pet.WS, {
  1443.         ear1="Gelai Earring",
  1444.         body=Pet_SB_body,
  1445.         waist="Isa Belt"})
  1446.  
  1447.     sets.midcast.Pet.Buff = set_combine(sets.midcast.Pet.TPBonus, {
  1448.         head="Heyoka Cap", ear1="Rimeice earring", ear2="Domes. earring",
  1449.         body="Heyoka Harness", --body="Emicho Haubert",
  1450.         hands="Nukumi Manoplas +1", --hands="Heyoka mittens",
  1451.         --waist="Primal belt",
  1452.         legs="Heyoka subligar", feet="Heyoka leggings"        
  1453.         })
  1454.  
  1455.     --------------------------------------
  1456.     -- SINGLE WIELD PET-ONLY READY SETS --
  1457.     --------------------------------------
  1458.  
  1459.     sets.ReadyRecastNE = {main="Charmer's Merlin",legs="Desultor Tassets"}
  1460.  
  1461.     -- Physical Ready Attacks w/o TP Modifier for Damage (ex. Sickle Slash, Whirl Claws, Swooping Frenzy, etc.)
  1462.     sets.midcast.Pet.ReadyNE = set_combine(sets.midcast.Pet.WS, {main=Ready_Atk_Axe})
  1463.     sets.midcast.Pet.ReadyNE.MedAcc = set_combine(sets.midcast.Pet.MedAcc, {main=Ready_Atk_Axe})
  1464.     sets.midcast.Pet.ReadyNE.HighAcc = set_combine(sets.midcast.Pet.HighAcc, {main=Ready_Atk_Axe})
  1465.     sets.midcast.Pet.ReadyNE.MaxAcc = set_combine(sets.midcast.Pet.MaxAcc, {main=Ready_Acc_Axe})
  1466.  
  1467.     -- Physical TP Bonus Ready Attacks (ex. Razor Fang, Tegmina Buffet, Tail Blow, Recoil Dive, etc.)
  1468.     sets.midcast.Pet.ReadyNE.TPBonus = set_combine(sets.midcast.Pet.ReadyNE, {main=Ready_Atk_TPBonus_Axe})
  1469.     sets.midcast.Pet.ReadyNE.TPBonus.MedAcc = set_combine(sets.midcast.Pet.ReadyNE.MedAcc, {main=Ready_Atk_TPBonus_Axe})
  1470.     sets.midcast.Pet.ReadyNE.TPBonus.HighAcc = set_combine(sets.midcast.Pet.ReadyNE.HighAcc, {main=Ready_Atk_TPBonus_Axe})
  1471.     sets.midcast.Pet.ReadyNE.TPBonus.MaxAcc = set_combine(sets.midcast.Pet.ReadyNE.MaxAcc, {main=Ready_Acc_Axe})
  1472.  
  1473.     -- Multihit Ready Attacks w/o TP Modifier for Damage (Pentapeck, Chomp Rush)
  1474.     sets.midcast.Pet.MultiStrikeNE = set_combine(sets.midcast.Pet.MultiStrike, {main=Ready_Atk_Axe2})
  1475.  
  1476.     -- Multihit TP Bonus Ready Attacks (Sweeping Gouge, Tickling Tendrils, Pecking Flurry, Wing Slap)
  1477.     sets.midcast.Pet.MultiStrikeNE.TPBonus = set_combine(sets.midcast.Pet.MultiStrike, {main=Ready_Atk_TPBonus_Axe})
  1478.  
  1479.     -- Magical Ready Attacks w/o TP Modifier for Damage (ex. Molting Plumage, Venom, Stink Bomb, etc.)
  1480.     sets.midcast.Pet.MagicAtkReadyNE = set_combine(sets.midcast.Pet.MagicAtkReady, {main=Ready_MAB_Axe})
  1481.     sets.midcast.Pet.MagicAtkReadyNE.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReady.MedAcc, {main=Ready_MAB_Axe})
  1482.     sets.midcast.Pet.MagicAtkReadyNE.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReady.HighAcc, {main=Ready_MAB_Axe})
  1483.     sets.midcast.Pet.MagicAtkReadyNE.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReady.MaxAcc, {main=Ready_MAcc_Axe2})
  1484.  
  1485.     -- Magical TP Bonus Ready Attacks (ex. Fireball, Cursed Sphere, Corrosive Ooze, etc.)
  1486.     sets.midcast.Pet.MagicAtkReadyNE.TPBonus = set_combine(sets.midcast.Pet.MagicAtkReadyNE, {main=Ready_MAB_TPBonus_Axe})
  1487.     sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MedAcc, {main=Ready_MAB_TPBonus_Axe})
  1488.     sets.midcast.Pet.MagicAtkReadyNE.TPBonus.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.HighAcc, {main=Ready_MAB_TPBonus_Axe})
  1489.     sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc, {main=Ready_MAcc_Axe2})
  1490.  
  1491.     -- Magical Ready Enfeebles (ex. Roar, Sheep Song, Infrasonics, etc.)
  1492.     sets.midcast.Pet.MagicAccReadyNE = set_combine(sets.midcast.Pet.MagicAccReady, {main=Ready_MAcc_Axe})
  1493.  
  1494.     -- Pet Buffs/Cures (Bubble Curtain, Scissor Guard, Secretion, Rage, Rhino Guard, Zealous Snort, Wild Carrot)
  1495.     sets.midcast.Pet.BuffNE = set_combine(sets.midcast.Pet.Buff, {main=Ready_Atk_TPBonus_Axe})
  1496.  
  1497.     -- Axe Swaps for when Pet TP is above a certain value.
  1498.     sets.UnleashAtkAxeShield = {main=Ready_Atk_Axe}
  1499.     sets.UnleashAtkAxeShield.MedAcc = {main=Ready_Atk_Axe}
  1500.     sets.UnleashAtkAxeShield.HighAcc = {main=Ready_Atk_Axe}
  1501.  
  1502.     sets.UnleashMABAxeShield = {main=Ready_MAB_Axe}
  1503.     sets.UnleashMABAxeShield.MedAcc = {main=Ready_MAB_Axe}
  1504.     sets.UnleashMABAxeShield.HighAcc = {main=Ready_MAB_Axe}
  1505.  
  1506.     ------------------------------------
  1507.     -- DUAL WIELD PET-ONLY READY SETS --
  1508.     ------------------------------------
  1509.  
  1510.     sets.ReadyRecastDWNE = {main="Aymur",sub="Charmer's Merlin",legs="Desultor Tassets"}
  1511.  
  1512.     -- DW Axe Swaps for Physical Ready Attacks w/o TP Modifier for Damage (ex. Sickle Slash, Whirl Claws, Swooping Frenzy, etc.)
  1513.     sets.midcast.Pet.ReadyDWNE = set_combine(sets.midcast.Pet.ReadyNE, {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2})
  1514.     sets.midcast.Pet.ReadyDWNE.MedAcc = set_combine(sets.midcast.Pet.ReadyNE.MedAcc, {main=Ready_Atk_Axe,sub=Ready_Acc_Axe})
  1515.     sets.midcast.Pet.ReadyDWNE.HighAcc = set_combine(sets.midcast.Pet.ReadyNE.HighAcc, {main=Ready_Atk_Axe,sub=Ready_Acc_Axe})
  1516.     sets.midcast.Pet.ReadyDWNE.MaxAcc = set_combine(sets.midcast.Pet.ReadyNE.MaxAcc, {main=Ready_Acc_Axe,sub=Ready_Acc_Axe2})
  1517.  
  1518.     -- DW Axe Swaps for Physical TP Bonus Ready Attacks (ex. Razor Fang, Tegmina Buffet, Tail Blow, Recoil Dive, etc.)
  1519.     sets.midcast.Pet.ReadyDWNE.TPBonus = set_combine(sets.midcast.Pet.ReadyNE, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Atk_TPBonus_Axe2})
  1520.     sets.midcast.Pet.ReadyDWNE.TPBonus.MedAcc = set_combine(sets.midcast.Pet.ReadyNE.MedAcc, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Acc_TPBonus_Axe})
  1521.     sets.midcast.Pet.ReadyDWNE.TPBonus.HighAcc = set_combine(sets.midcast.Pet.ReadyNE.HighAcc, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Acc_TPBonus_Axe})
  1522.     sets.midcast.Pet.ReadyDWNE.TPBonus.MaxAcc = set_combine(sets.midcast.Pet.ReadyNE.MaxAcc, {main=Ready_Acc_Axe,sub=Ready_Acc_Axe2})
  1523.  
  1524.     -- DW Axe Swaps for Multihit Ready Attacks w/o TP Modifier for Damage (Pentapeck, Chomp Rush)
  1525.     sets.midcast.Pet.MultiStrikeDWNE = set_combine(sets.midcast.Pet.MultiStrikeNE, {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2})
  1526.  
  1527.     -- DW Axe Swaps for Multihit TP Bonus Ready Attacks (Sweeping Gouge, Tickling Tendrils, Pecking Flurry, Wing Slap)
  1528.     sets.midcast.Pet.MultiStrikeDWNE.TPBonus = set_combine(sets.midcast.Pet.MultiStrikeNE, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Atk_TPBonus_Axe2})
  1529.  
  1530.     -- DW Axe Swaps for Magical Ready Attacks w/o TP Modifier for Damage (ex. Molting Plumage, Stink Bomb, Venom, etc.)
  1531.     sets.midcast.Pet.MagicAtkReadyDWNE = set_combine(sets.midcast.Pet.MagicAtkReadyNE, {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2})
  1532.     sets.midcast.Pet.MagicAtkReadyDWNE.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MedAcc, {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2})
  1533.     sets.midcast.Pet.MagicAtkReadyDWNE.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.HighAcc, {main=Ready_MAB_Axe,sub=Ready_MAcc_Axe})
  1534.     sets.midcast.Pet.MagicAtkReadyDWNE.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc, {main=Ready_MAB_Axe,sub=Ready_MAcc_Axe})
  1535.  
  1536.     -- DW Axe Swaps for Magical TP Bonus Ready Attacks (ex. Fireball, Cursed Sphere, Corrosive Ooze, etc.)
  1537.     sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus = set_combine(sets.midcast.Pet.MagicAtkReadyNE, {main=Ready_MAB_TPBonus_Axe,sub=Ready_MAB_TPBonus_Axe2})
  1538.     sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MedAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MedAcc, {main=Ready_MAB_TPBonus_Axe,sub=Ready_MAB_TPBonus_Axe2})
  1539.     sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.HighAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.HighAcc, {main=Ready_MAB_TPBonus_Axe,sub=Ready_MAB_TPBonus_Axe2})
  1540.     sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MaxAcc = set_combine(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc, {main=Ready_MAB_Axe,sub=Ready_MAcc_Axe})
  1541.  
  1542.     -- DW Axe Swaps for Magical Ready Enfeebles (ex. Roar, Sheep Song, Infrasonics, etc.)
  1543.     sets.midcast.Pet.MagicAccReadyDWNE = set_combine(sets.midcast.Pet.MagicAccReadyNE, {main=Ready_MAB_Axe,sub=Ready_MAcc_Axe2})
  1544.  
  1545.     -- DW Axe Swaps for Pet Buffs/Cures (Bubble Curtain, Scissor Guard, Secretion, Rage, Rhino Guard, Zealous Snort, Wild Carrot)
  1546.     sets.midcast.Pet.BuffDWNE = set_combine(sets.midcast.Pet.BuffNE, {main=Ready_Atk_TPBonus_Axe,sub=Ready_Atk_TPBonus_Axe2})
  1547.  
  1548.     -- Axe Swaps for when Pet TP is above a certain value.
  1549.     sets.UnleashAtkAxes = {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2}
  1550.     sets.UnleashAtkAxes.MedAcc = {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2}
  1551.     sets.UnleashAtkAxes.HighAcc = {main=Ready_Atk_Axe,sub=Ready_Atk_Axe2}
  1552.  
  1553.     sets.UnleashMABAxes = {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2}
  1554.     sets.UnleashMABAxes.MedAcc = {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2}
  1555.     sets.UnleashMABAxes.HighAcc = {main=Ready_MAB_Axe,sub=Ready_MAB_Axe2}
  1556.  
  1557.     ---------------
  1558.     -- IDLE SETS --
  1559.     ---------------
  1560.  
  1561.     sets.idle = {ammo="Staunch Tathlum",
  1562.         head="Meghanada visor +2",neck="Loricate torque +1",ear1="Infused Earring",--ear2="Dawn Earring",
  1563.         body="Meghanada Cuirie +2",hands="Meghanada Gloves +2",ring1="Meghanada Ring",ring2="Moonbeam Ring",
  1564.         back="Moonbeam Cape",waist="Flume Belt +1",legs="Meghanada Chausses +2",feet="Skadi's Jambeaux +1"}
  1565.  
  1566.     sets.idle.Refresh = set_combine(sets.idle, {head="Jumalik Helm",body="Jumalik Mail",legs="Stearc Subligar"})
  1567.     sets.idle.Reraise = set_combine(sets.idle, {head="Twilight Helm",body="Twilight Mail"})
  1568.  
  1569.     sets.idle.Pet = set_combine(sets.idle, {back=Pet_Regen_back})
  1570.  
  1571.     sets.idle.PetRegen = set_combine(sets.idle.Pet, {neck="Empath Necklace",feet=Pet_Regen_feet})
  1572.  
  1573.     sets.idle.Pet.Engaged = {ammo="Demonry Core",
  1574.         head=Pet_Melee_head,
  1575.         neck="Beastmaster Collar",ear1="Hija Earring",ear2="Domesticator's Earring",
  1576.         body=Pet_Melee_body,
  1577.         hands=Pet_Melee_hands,
  1578.         ring1="Varar Ring",ring2="Varar Ring",
  1579.         back=Ready_Atk_back,
  1580.         waist="Incarnation Sash",
  1581.         legs=Pet_Melee_legs,
  1582.         feet=Pet_Melee_feet}
  1583.  
  1584.     sets.idle.Pet.Engaged.PetSBMNK = set_combine(sets.idle.Pet.Engaged, {
  1585.         ear1="Gelai Earring",
  1586.         body=Pet_SB_body,
  1587.         waist="Isa Belt"})
  1588.  
  1589.     sets.idle.Pet.Engaged.PetSBNonMNK = set_combine(sets.idle.Pet.Engaged, {
  1590.         ear1="Gelai Earring",
  1591.         body=Pet_SB_body,
  1592.         waist="Isa Belt"})
  1593.  
  1594.     sets.idle.Pet.Engaged.PetSTP = set_combine(sets.idle.Pet.Engaged, {
  1595.         ring1="Varar Ring",ring2="Varar Ring"})
  1596.  
  1597.     sets.resting = {}
  1598.  
  1599.     ------------------
  1600.     -- DEFENSE SETS --
  1601.     ------------------
  1602.  
  1603.     -- Pet PDT and MDT sets:
  1604.     sets.defense.PetPDT = {
  1605.         ammo="Demonry Core",
  1606.         head="Anwig Salade",neck="Shepherd's Chain",
  1607.         ear1="Handler's Earring +1",ear2="Enmerkar Earring",
  1608.         body=Pet_PDT_body,
  1609.         hands=Pet_PDT_hands,
  1610.         ring1="Thurandaut Ring +1",ring2="Defending Ring",
  1611.         back=Pet_PDT_back,
  1612.         waist="Isa Belt",
  1613.         legs=Pet_PDT_legs,
  1614.         feet=Pet_PDT_feet}
  1615.  
  1616.     sets.defense.PetMDT = set_combine(sets.defense.PetPDT, {
  1617.         ear1="Rimeice Earring",ear2="Enmerkar Earring",
  1618.         body=Pet_MDT_Body,
  1619.         hands=Pet_MDT_hands,
  1620.         ring1="Thurandaut Ring +1",ring2="Defending Ring",
  1621.         back=Pet_MDT_back,
  1622.         legs=Pet_MDT_legs,
  1623.         feet=Pet_MDT_feet})
  1624.  
  1625.     -- Master PDT and MDT sets:
  1626.     sets.defense.PDT = {
  1627.         ammo="Staunch Tathlum",         -- 2 DT
  1628.         head="Jumalik Helm",            --5 PDT
  1629.         neck="Loricate torque +1",      --6 DT
  1630.         ear1="Ethereal Earring",
  1631.         --ear2="Genmei Earring",
  1632.         body="Jumalik Mail",            --8 DT
  1633.         hands="Macabre Gauntlets +1",   --4 PDT
  1634.         ring1="Moonbeam Ring",          -- 4 DT
  1635.         ring2="Defending Ring",         --10 DT
  1636.         back="Shadow Mantle",
  1637.         waist="Flume Belt +1",          -- 4 PDT
  1638.         legs="Arjuna breeches",         -- 6 PDT ?
  1639.         feet="Amm Greaves"              -- 5 DT
  1640.         }-- 54% PDT; 35 MDT
  1641.  
  1642.     sets.defense.Reraise = set_combine(sets.defense.PDT, {head="Twilight Helm",body="Twilight Mail"})
  1643.  
  1644.     sets.defense.HybridPDT = {ammo="Staunch Tathlum",
  1645.         head="Jumalik Helm",neck="Loricate Torque +1",ear1="Handler's Earring +1",ear2="Enmerkar Earring",
  1646.         body="Jumalik Mail",hands=Pet_PDT_hands,ring1="Moonbeam Ring",ring2="Defending Ring",
  1647.         back="Moonbeam Cape",waist="Flume Belt +1",legs=Pet_PDT_legs,feet="Amm Greaves"}
  1648.  
  1649.     sets.defense.MDT = set_combine(sets.defense.PDT, {
  1650.         head="Skormoth Mask",neck="Loricate Torque +1",ear1="Etiolation Earring",
  1651.         ear2="Eabani Earring",
  1652.         body="Jumalik Mail", ring1="Purity Ring",
  1653.         back="Engulfer Cape +1",--waist="Nierenschutz"
  1654.         })
  1655.  
  1656.     sets.defense.MDTShell = set_combine(sets.defense.MDT, {ammo="Staunch Tathlum",
  1657.         neck="Inquisitor Bead Necklace",ear2="Eabani Earring",
  1658.         hangs="Heyoka mittens", ring1="Shadow Ring",
  1659.         waist="Asklepian Belt",legs="Heyoka subligar",feet="Heyoka leggings"})
  1660.  
  1661.     sets.defense.MEva = set_combine(sets.defense.MDT, {ammo="Staunch Tathlum",
  1662.         head=MEva_head,
  1663.         neck="Warder's Charm +1",ear1="Hearty Earring",ear2="Eabani Earring",
  1664.         body=MEva_body,
  1665.         hands=MEva_hands,
  1666.         --ring1="Vengeful Ring",ring2="Purity Ring",
  1667.         back=MEva_back,
  1668.         --waist="Engraved Belt",
  1669.         legs=MEva_legs,
  1670.         feet=MEva_feet})
  1671.  
  1672.     sets.Kiting = {feet="Skadi's Jambeaux +1"}
  1673.  
  1674.     -------------------------------------------------------
  1675.     -- Single-wield Pet Only Mode Idle/Defense Axe Swaps --
  1676.     -------------------------------------------------------
  1677.     sets.IdleAxeShield = {main="Freydis",sub="Beatific Shield +1"}
  1678.     sets.PDTAxeShield = {main="Freydis",sub="Adapa Shield"}
  1679.     sets.MDTAxeShield = {main="Purgation",sub="Beatific Shield +1"}
  1680.     sets.MEvaAxeShield = {main=MEva_Axe_main,sub="Beatific Shield +1"}
  1681.     sets.PetPDTAxeShield = {main=Pet_PDT_AxeMain,sub="Beatific Shield +1"}
  1682.     sets.PetMDTAxeShield = {main=Pet_MDT_AxeMain,sub="Beatific Shield +1"}
  1683.     sets.PetTPAxeShield = {main=Pet_TP_AxeMain,sub="Beatific Shield +1"}
  1684.     sets.PetRegenAxeShield = {main=Pet_Regen_AxeMain,sub="Beatific Shield +1"}
  1685.  
  1686.     -----------------------------------------------------
  1687.     -- Dual-wield Pet Only Mode Idle/Defense Axe Swaps --
  1688.     -----------------------------------------------------
  1689.     sets.IdleAxes = {main="Freydis",sub="Habilitator +1"}
  1690.     sets.PDTAxes = {main="Freydis",sub="Habilitator +1"}
  1691.     sets.MDTAxes = {main="Purgation",sub="Habilitator +1"}
  1692.     sets.MEvaAxes = {main=MEva_Axe_main,sub=MEva_Axe_sub}
  1693.     sets.PetPDTAxes = {main=Pet_PDT_AxeMain,sub=Pet_PDT_AxeSub}
  1694.     sets.PetMDTAxes = {main=Pet_MDT_AxeMain,sub=Pet_MDT_AxeSub}
  1695.     sets.PetTPAxes = {main=Pet_TP_AxeMain,sub=Pet_TP_AxeSub}
  1696.     sets.PetRegenAxes = {main=Pet_Regen_AxeMain,sub=Pet_Regen_AxeSub}
  1697.  
  1698.     --------------------
  1699.     -- FAST CAST SETS --
  1700.     --------------------
  1701.  
  1702.     sets.precast.FC = {
  1703.         ammo="Sapience Orb",
  1704.         head=FC_head,
  1705.         neck="Orunmila's Torque",ear1="Loquacious Earring",ear2="Etiolation Earring",
  1706.         body=FC_body,
  1707.         hands=FC_hands,
  1708.         ring1="Prolix Ring",--ring2="Rahab Ring",
  1709.         back=FC_back,
  1710.         --waist="Moblin Cest",
  1711.         legs=FC_legs,
  1712.         feet=FC_feet}
  1713.  
  1714.     sets.precast.FCNE = set_combine(sets.precast.FC, {main="Shukuyu's Scythe",--sub="Vivid Strap"
  1715.         })
  1716.     sets.precast.FC["Utsusemi: Ichi"] = set_combine(sets.precast.FC, {neck="Magoraga Beads"})
  1717.     sets.precast.FC["Utsusemi: Ni"] = set_combine(sets.precast.FC, {ammo="Impatiens",neck="Magoraga Beads",ring1="Lebeche Ring",ring2="Veneficium Ring"})
  1718.  
  1719.     ------------------
  1720.     -- MIDCAST SETS --
  1721.     ------------------
  1722.  
  1723.     sets.midcast.FastRecast = {
  1724.         ammo="Sapience Orb",
  1725.         head=FC_head,
  1726.         neck="Orunmila's Torque",ear1="Loquacious Earring",--ear2="Enchanter Earring +1",
  1727.         body=FC_body,
  1728.         hands=FC_hands,
  1729.         ring1="Prolix Ring",ring2="Rahab Ring",
  1730.         back=FC_back,
  1731.         --waist="Moblin Cest",
  1732.         legs=FC_legs,
  1733.         feet=FC_feet}
  1734.  
  1735.     sets.midcast.Cure = {--ammo="Quartz Tathlum +1",
  1736.         head=Cure_Potency_head,
  1737.         neck="Phalaina Locket",ear1="Domesticator's Earring",ear2="Mendicant's Earring",
  1738.         body=Cure_Potency_body,
  1739.         hands=Cure_Potency_hands,
  1740.         ring1="Lebeche Ring",ring2="Asklepian Ring",
  1741.         back=Cure_Potency_back,
  1742.         waist="Gishdubar Sash",
  1743.         legs=Cure_Potency_legs,
  1744.         feet=Cure_Potency_feet}
  1745.  
  1746.     sets.midcast.Curaga = sets.midcast.Cure
  1747.     sets.CurePetOnly = {main=Cure_Potency_axe,sub="Matamata Shield +1"}
  1748.  
  1749.     sets.midcast.Stoneskin = {ammo="Quartz Tathlum +1",
  1750.         head="Jumalik Helm",neck="Stone Gorget",ear1="Earthcry Earring",ear2="Lifestorm Earring",
  1751.         body="Totemic Jackcoat +3",hands="Stone Mufflers",--ring1="Leviathan Ring +1",ring2="Leviathan Ring +1",
  1752.         back=Pet_PDT_back,waist="Engraved Belt",legs="Haven Hose"}
  1753.  
  1754.     sets.midcast.Cursna = set_combine(sets.midcast.FastRecast, {neck="Malison Medallion",
  1755.         ring1="Eshmun's Ring",ring2="Haoma's Ring",waist="Gishdubar Sash"})
  1756.  
  1757.     sets.midcast.Protect = {ring2="Sheltered Ring"}
  1758.     sets.midcast.Protectra = sets.midcast.Protect
  1759.  
  1760.     sets.midcast.Shell = {ring2="Sheltered Ring"}
  1761.     sets.midcast.Shellra = sets.midcast.Shell
  1762.  
  1763.     sets.midcast['Enfeebling Magic'] = {ammo="Pemphredo Tathlum",
  1764.         head=MAcc_head,neck="Sanctity Necklace",ear1="Hermetic Earring",ear2="Dignitary's Earring",
  1765.         body=MAcc_body,hands=MAcc_hands,ring1="Rahab Ring",ring2="Sangoma Ring",
  1766.         back=MAcc_back,waist="Eschan Stone",legs=MAcc_legs,feet=MAcc_feet}
  1767.  
  1768.     sets.midcast['Elemental Magic'] = {ammo="Pemphredo Tathlum",
  1769.         head=MAB_head,neck="Sanctity necklace",ear1="Hecate's Earring",ear2="Friomisi Earring",
  1770.         body=MAB_body,hands=MAB_hands,ring1="Acumen Ring",ring2="Fenrir Ring +1",
  1771.         back=MAcc_back,waist="Eschan Stone",legs=MAB_legs,feet=MAB_feet}
  1772.  
  1773.     sets.midcast.Flash = sets.Enmity
  1774.  
  1775.     --------------------------------------
  1776.     -- SINGLE-WIELD MASTER ENGAGED SETS --
  1777.     --------------------------------------
  1778.  
  1779.     sets.engaged = {ammo="Hasty Pinion +1",
  1780.         head="Argosy celata",neck="Asperity necklace",ear1="Sherida Earring",ear2="Cessance Earring",
  1781.         body="Argosy hauberk",hands="Argosy Mufflers",ring1="Ilabrat Ring",ring2="Epona's Ring",
  1782.         back=STR_DA_back,waist="Windbuffet Belt",legs="Argosy breeches",feet="Argosy Sollerets"}
  1783.  
  1784.     sets.engaged.LowAccHaste = sets.engaged
  1785.     sets.engaged.MedAcc= {ammo="Ginsen",
  1786.         head="Argosy celata",neck="Shulmanu Collar",ear1="Sherida earring",ear2="Cessance earring",
  1787.         body="Tali'ah manteel +2",hands="Argosy mufflers",ring1="Ilabrat Ring",ring2="Epona's Ring",
  1788.         back=DA_back,waist="Klouskap sash",
  1789.         legs="Meghanada chausses +2",
  1790.         feet="Argosy sollerets"}
  1791.     sets.engaged.MedAccHaste = sets.engaged.MedAcc
  1792.     sets.engaged.HighAcc = {ammo="Ginsen",
  1793.         head="Totemic helm +3",neck="Shulmanu Collar",ear1="Telos earring",ear2="Cessance earring",
  1794.         body="Totemic jackcoat +3",hands="Totemic mittens +3",ring1="Ilabrat Ring",ring2="Regal Ring",
  1795.         back=DA_back,waist="Klouskap sash",
  1796.         legs="Totemic trousers +3",
  1797.         feet="Totemic gaiters +3"}
  1798.     sets.engaged.HighAccHaste = sets.engaged.HighAcc
  1799.     sets.engaged.Aftermath = set_combine(sets.engaged, {hands="Argosy mufflers"})
  1800.     sets.engaged.LowAccHaste.Aftermath = sets.engaged.Aftermath
  1801.     sets.engaged.MedAcc.Aftermath = set_combine(sets.engaged.MedAcc, {hands="Argosy mufflers"})
  1802.     sets.engaged.MedAccHaste.Aftermath = sets.engaged.MedAcc.Aftermath
  1803.     sets.engaged.HighAcc.Aftermath = set_combine(sets.engaged.HighAcc)
  1804.     sets.engaged.HighAccHaste.Aftermath = sets.engaged.HighAcc.Aftermath       
  1805.     sets.engaged.HighAcc.MaxAcc={ammo="Ginsen",
  1806.         head="Heyoka cap",neck="Shulmanu collar",ear1="Sherida earring",ear2="Cessance earring",
  1807.         body="Heyoka harness",hands="Heyoka mittens", ring1="Ilabrat ring",ring2="Epona Ring",
  1808.         legs="Heyoka subligar",
  1809.         back=STR_DA_back,waist="Windbuffet belt",
  1810.         feet="Heyoka leggings"}
  1811.     ------------------------------------
  1812.     -- DUAL-WIELD MASTER ENGAGED SETS --
  1813.     ------------------------------------
  1814.  
  1815.     sets.engaged.DW = {ammo="Ginsen",
  1816.         head="Argosy celata",neck="Asperity necklace",ear1="Sherida earring",ear2="Eabani earring",
  1817.         body="Argosy hauberk",hands="Argosy mufflers",ring1="Ilabrat Ring",ring2="Epona's Ring",
  1818.         back=STR_DA_back,waist="Sailfi belt",
  1819.         legs="Argosy breeches", feet=DW_feet}
  1820.  
  1821.     sets.engaged.DW.Hybrid = {ammo="Ginsen",
  1822.         head=Pet_PDT_head,neck="Shulmanu Collar",ear1="Enmerkar Earring",ear2="Brutal Earring",
  1823.         body=Pet_PDT_body,hands=Pet_PDT_hands,ring1="Thurandaut Ring +1",ring2="Epona's Ring",
  1824.         back=DW_back,waist="Windbuffet Belt",legs="Meghanada Chausses +2",feet=DW_feet}
  1825.  
  1826.     sets.engaged.DW.KrakenClub = {ammo="Ginsen",
  1827.         head="Argosy celata",neck="Asperity necklace",ear1="Sherida earring",ear2="Eabani earring",
  1828.         body="Argosy hauberk",hands="Argosy mufflers",ring1="Ilabrat Ring",ring2="Epona's Ring",
  1829.         back=STR_DA_back,waist="Sailfi belt",
  1830.         legs="Argosy breeches", feet=DW_feet}
  1831.  
  1832.     sets.engaged.DW.LowAccHaste = {ammo="Ginsen",
  1833.         head="Argosy celata",neck="Asperity necklace",ear1="Sherida earring",ear2="Eabani earring",
  1834.         body="Argosy hauberk",hands="Argosy mufflers",ring1="Ilabrat Ring",ring2="Epona's Ring",
  1835.         back=STR_DA_back,waist="Sailfi belt",
  1836.         legs="Argosy breeches", feet=DW_feet}
  1837.     sets.engaged.DW.MedAcc = {ammo="Ginsen",
  1838.         head="Heyoka cap",neck="Shulmanu Collar",ear1="Sherida earring",ear2="Eabani earring",
  1839.         body="Tali'ah manteel +2",hands="Heyoka mittens",ring1="Ilabrat Ring",ring2="Epona's Ring",
  1840.         back=STR_DA_back,waist="Klouskap sash",
  1841.         legs="Meghanada chausses +2",
  1842.         feet=DW_feet}
  1843.     sets.engaged.DW.MedAccHaste = {ammo="Ginsen",
  1844.         head="Heyoka cap",neck="Shulmanu Collar",ear1="Sherida earring",ear2="Eabani earring",
  1845.         body="Tali'ah manteel +2",hands="Heyoka mittens",ring1="Ilabrat Ring",ring2="Epona's Ring",
  1846.         back=STR_DA_back,waist="Klouskap sash",
  1847.         legs="Meghanada chausses +2",
  1848.         feet=DW_feet}
  1849.     sets.engaged.DW.HighAcc = {ammo="Ginsen",
  1850.         head="Totemic helm +3",neck="Shulmanu collar",ear1="Mache earring",ear2="Telos earring",
  1851.         body="Totemic jackcoat +3",hands="Totemic gloves +3", ring1="Ilabrat ring",ring2="Epona Ring",
  1852.         legs="Totemic trousers +3",
  1853.         back=STR_DA_back,waist="Klouskap sash",
  1854.         feet="Totemic gaiters +3"}
  1855.     sets.engaged.DW.HighAccHaste = {ammo="Ginsen",
  1856.         head="Totemic helm +3",neck="Shulmanu collar",ear1="Mache earring",ear2="Telos earring",
  1857.         body="Totemic jackcoat +3",hands="Totemic gloves +3", ring1="Ilabrat Ring",ring2="Epona Ring",
  1858.         legs="Totemic trousers +3",
  1859.         back=STR_DA_back,waist="Klouskap sash",
  1860.         feet="Totemic gaiters +3"}
  1861.     sets.engaged.DW.Aftermath = sets.engaged.DW
  1862.     sets.engaged.DW.LowAccHaste.Aftermath = sets.engaged.DW.Aftermath
  1863.     sets.engaged.DW.MedAcc.Aftermath = sets.engaged.DW.MedAcc
  1864.     sets.engaged.DW.MedAccHaste.Aftermath = sets.engaged.DW.MedAcc.Aftermath
  1865.     sets.engaged.DW.HighAcc.Aftermath = sets.engaged.DW.HighAcc
  1866.     sets.engaged.DW.HighAccHaste.Aftermath = sets.engaged.DW.HighAcc.Aftermath 
  1867.     sets.engaged.DW.MaxAcc = {ammo="Ginsen",
  1868.         head="Heyoka cap",neck="Shulmanu collar",ear1="Sherida earring",ear2="Eabani earring",
  1869.         body="Heyoka harness",hands="Heyoka mittens", ring1="Ilabrat ring",ring2="Epona Ring",
  1870.         legs="Heyoka subligar",
  1871.         back=STR_DA_back,waist="Windbuffet belt",
  1872.         feet="Heyoka leggings"}
  1873.     sets.engaged.DW.MaxAccHaste = sets.engaged.DW.MaxAcc
  1874.        
  1875.     --------------------
  1876.     -- MASTER WS SETS --
  1877.     --------------------
  1878.  
  1879.     sets.precast.WS = {ammo="Floestone",
  1880.         head="Argosy Celata",neck="Beastmaster Collar",ear1="Moonshade Earring",ear2="Sherida Earring",
  1881.         body="Argosy Hauberk",hands="Argosy Mufflers",ring1="Regal Ring",ring2="Epona's Ring",
  1882.         back=STR_WS_back,waist="Windbuffet Belt",legs="Argosy Breeches",feet="Argosy Sollerets +1"}
  1883.  
  1884.     sets.precast.WS['Rampage'] = {ammo="Floestone",
  1885.         head="Heyoka cap",neck="Fotia Gorget",ear1="Brutal Earring",ear2="Sherida Earring",
  1886.         body="Heyoka harness",hands="Heyoka mittens",ring1="Regal Ring",ring2="Epona's Ring",
  1887.         back=STR_DA_back,waist="Fotia Belt",legs="Heyoka subligar",feet="Heyoka leggings"}
  1888.     sets.precast.WS['Rampage'].Gavialis = set_combine(sets.precast.WS['Rampage'], {head="Gavialis Helm"})
  1889.  
  1890.     sets.precast.WS['Calamity'] = {ammo="Floestone",
  1891.         head="Ankusa Helm +3",neck="Beastmaster Collar",ear1="Moonshade Earring",ear2="Telos Earring",
  1892.         body="Argosy Hauberk",hands="Totemic Gloves +3",ring1="Regal Ring",ring2="Ilabrat Ring",
  1893.         back=STR_WS_back,waist="Metalsinger belt",legs=WSD_legs,feet="Argosy Sollerets +1"}
  1894.  
  1895.     sets.precast.WS['Mistral Axe'] = {ammo="Floestone",
  1896.         head="Ankusa Helm +3",neck="Beastmaster Collar",ear1="Moonshade Earring",ear2="Telos Earring",
  1897.         body="Argosy Hauberk",hands="Totemic gloves +3",ring1="Regal Ring",ring2="Ilabrat Ring",
  1898.         back=STR_WS_back,waist="Metalsinger belt",legs="Argosy Breeches",feet="Argosy Sollerets +1"}
  1899.    
  1900.     sets.precast.WS['Spinning Axe'] = sets.precast.WS['Mistral Axe']
  1901.    
  1902.     sets.precast.WS['Bora Axe'] = {ammo="Cheruski Needle",
  1903.         head="Ankusa Helm +3",neck="Beastmaster Collar",ear1="Brutal Earring",ear2="Sherida Earring",
  1904.         body="Argosy Hauberk",hands="Totemic Gloves +3",ring1="Regal Ring",ring2="Ilabrat Ring",
  1905.         back=Onslaught_back,waist="Windbuffet Belt",legs="Argosy Breeches",feet="Argosy Sollerets +1"}
  1906.  
  1907.     sets.precast.WS['Ruinator'] = {ammo="Floestone",
  1908.         head="Ankusa Helm +3",neck="Fotia Gorget",ear1="Kokou's Earring",ear2="Sherida Earring",
  1909.         body="Argosy Hauberk",hands="Totemic Gloves +3",ring1="Regal Ring",ring2="Epona's Ring",
  1910.         back=STR_DA_back,waist="Fotia Belt",legs="Argosy Breeches",feet="Argosy Sollerets +1"}
  1911.    
  1912.     sets.precast.WS['Ruinator'].Gavialis = set_combine(sets.precast.WS['Ruinator'], {head="Gavialis Helm"})
  1913.  
  1914.     sets.precast.WS['Onslaught'] = {ammo="Cheruski Needle",
  1915.         head="Ankusa Helm +3",neck="Beastmaster Collar",ear1="Sherida Earring",ear2="Brutal Earring",
  1916.         body="Argosy Hauberk",hands="Totemic gloves +3",ring1="Ilabrat Ring",ring2="Epona's Ring",
  1917.         back=Onslaught_back,waist="Windbuffet Belt",legs="Argosy Breeches",feet="Argosy Sollerets +1"}
  1918.  
  1919.     sets.precast.WS['Primal Rend'] = {ammo="Pemphredo Tathlum",
  1920.         head=MAB_head,
  1921.         neck="Baetyl pendant",ear1="Moonshade Earring",ear2="Friomisi Earring",
  1922.         body=MAB_body,
  1923.         hands=MAB_hands,
  1924.         ring1="Acumen Ring",ring2="Airy Ring",
  1925.         back=Primal_back,
  1926.         waist="Eschan Stone",
  1927.         legs=MAB_legs,
  1928.         feet=MAB_feet}
  1929.  
  1930.     sets.precast.WS['Cloudsplitter'] = set_combine(sets.precast.WS['Primal Rend'], {back=Cloud_back})
  1931.     sets.precast.WS['Aeolian Edge'] = set_combine(sets.precast.WS['Primal Rend'], {})
  1932.    
  1933.     sets.midcast.ExtraMAB = {ear1="Hecate's Earring"}
  1934.  
  1935.     ----------------
  1936.     -- OTHER SETS --
  1937.     ----------------
  1938.  
  1939.     --Precast Gear Sets for DNC subjob abilities:
  1940.     sets.precast.Waltz = {ammo="Sonia's Plectrum",
  1941.         head="Totemic Helm +3",neck="Unmoving Collar",ear1="Handler's Earring +1",ear2="Enchanter Earring +1",
  1942.         body="Totemic Jackcoat +3",hands="Totemic Gloves +3",ring1="Asklepian Ring",ring2="Valseur's Ring",
  1943.         back=Waltz_back,waist="Chaac Belt",legs="Desultor Tassets",feet="Totemic Gaiters +3"}
  1944.     sets.precast.Step = {waist="Chaac Belt"}
  1945.     sets.precast.Flourish1 = {}
  1946.     sets.precast.Flourish1['Violent Flourish'] = {ammo="Pemphredo Tathlum",
  1947.         head=MAcc_head,neck="Sanctity Necklace",ear1="Hermetic Earring",ear2="Dignitary's Earring",
  1948.         body=MAcc_body,hands=MAcc_hands,ring1="Rahab Ring",ring2="Sangoma Ring",
  1949.         back=MAcc_back,waist="Eschan Stone",legs=MAcc_legs,feet=MAcc_feet}
  1950.  
  1951.     --Misc Gear Sets
  1952.     sets.FrenzySallet = {head="Frenzy Sallet"}
  1953.     sets.precast.LuzafRing = {ring1="Luzaf's Ring"}
  1954.     sets.buff['Killer Instinct'] = {head="Ankusa Helm +3", body="Nukumi Gausape +1"}
  1955.     sets.THGear = {head="Wh. Rarab Cap +1",legs=TH_legs,waist="Chaac Belt",feet=TH_Feet}
  1956. end
  1957.  
  1958. -------------------------------------------------------------------------------------------------------------------
  1959. -- Job-specific hooks that are called to process player actions at specific points in time.
  1960. -------------------------------------------------------------------------------------------------------------------
  1961.  
  1962. function job_pretarget(spell)
  1963.     checkblocking(spell)
  1964. end
  1965.  
  1966. function job_precast(spell, action, spellMap, eventArgs)
  1967. -- Define class for Sic and Ready moves.
  1968.     if spell.type == "Monster" then
  1969.         classes.CustomClass = "WS"
  1970.  
  1971.         if state.LagMode.value == 'Lag' then
  1972.             if physical_ready_moves:contains(spell.name) then
  1973.                 if state.AxeMode.value == 'PetOnly' then
  1974.                     if state.OffenseMode.value == 'MaxAcc' then
  1975.                         if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  1976.                             equip(sets.midcast.Pet.ReadyDWNE.MaxAcc, sets.ReadyRecastDWNE)
  1977.                         else
  1978.                             equip(sets.midcast.Pet.ReadyNE.MaxAcc, sets.ReadyRecast)
  1979.                         end
  1980.                     elseif state.OffenseMode.value == 'HighAcc' then
  1981.                         if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  1982.                             equip(sets.midcast.Pet.ReadyDWNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE)
  1983.                         else
  1984.                             equip(sets.midcast.Pet.ReadyNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
  1985.                         end
  1986.                     elseif state.OffenseMode.value == 'MedAcc' then
  1987.                         if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  1988.                             equip(sets.midcast.Pet.ReadyDWNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE)
  1989.                         else
  1990.                             equip(sets.midcast.Pet.ReadyNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
  1991.                         end
  1992.                     else
  1993.                         if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  1994.                             if multi_hit_ready_moves:contains(spell.name) then
  1995.                                 if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  1996.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK, sets.ReadyRecastDWNE))
  1997.                                 elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  1998.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK, sets.ReadyRecastDWNE))
  1999.                                 else
  2000.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE))
  2001.                                 end
  2002.                             else
  2003.                                 equip(set_combine(sets.midcast.Pet.ReadyDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecastDWNE))
  2004.                             end
  2005.                         else
  2006.                             if multi_hit_ready_moves:contains(spell.name) then
  2007.                                 if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  2008.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK, sets.ReadyRecast))
  2009.                                 elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  2010.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK, sets.ReadyRecast))
  2011.                                 else
  2012.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
  2013.                                 end
  2014.                             else
  2015.                                 equip(set_combine(sets.midcast.Pet.ReadyNE, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
  2016.                             end
  2017.                         end
  2018.                     end
  2019.                 else
  2020.                     if state.OffenseMode.value == 'MaxAcc' then
  2021.                         equip(sets.midcast.Pet.MaxAcc, sets.ReadyRecast)
  2022.                     elseif state.OffenseMode.value == 'HighAcc' then
  2023.                         equip(sets.midcast.Pet.HighAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
  2024.                     elseif state.OffenseMode.value == 'MedAcc' then
  2025.                         equip(sets.midcast.Pet.MedAcc, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast)
  2026.                     else
  2027.                         if multi_hit_ready_moves:contains(spell.name) then
  2028.                             if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  2029.                                 equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK, sets.ReadyRecast))
  2030.                             elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  2031.                                 equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK, sets.ReadyRecast))
  2032.                             else
  2033.                                 equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
  2034.                             end
  2035.                         else
  2036.                             equip(set_combine(sets.midcast.Pet.WS, sets.midcast.Pet[state.CorrelationMode.value], sets.ReadyRecast))
  2037.                         end
  2038.                     end
  2039.                 end
  2040.             end
  2041.  
  2042.             if magic_atk_ready_moves:contains(spell.name) then
  2043.                 if state.AxeMode.value == 'PetOnly' then
  2044.                     if state.OffenseMode.value == 'MaxAcc' then
  2045.                         if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2046.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.MaxAcc, sets.ReadyRecastDWNE)
  2047.                         else
  2048.                             equip(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc, sets.ReadyRecast)
  2049.                         end
  2050.                     elseif state.OffenseMode.value == 'HighAcc' then
  2051.                         if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2052.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.HighAcc, sets.ReadyRecastDWNE)
  2053.                         else
  2054.                             equip(sets.midcast.Pet.MagicAtkReadyNE.HighAcc, sets.ReadyRecast)
  2055.                         end
  2056.                     elseif state.OffenseMode.value == 'MedAcc' then
  2057.                         if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2058.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.MedAcc, sets.ReadyRecastDWNE)
  2059.                         else
  2060.                             equip(sets.midcast.Pet.MagicAtkReadyNE.MedAcc, sets.ReadyRecast)
  2061.                         end
  2062.                     else
  2063.                         if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2064.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE, sets.ReadyRecastDWNE)
  2065.                         else
  2066.                             equip(sets.midcast.Pet.MagicAtkReadyNE, sets.ReadyRecast)
  2067.                         end
  2068.                     end
  2069.                 else
  2070.                     equip(sets.midcast.Pet.MagicAtkReady, sets.ReadyRecast)
  2071.                 end
  2072.             end
  2073.  
  2074.             if magic_acc_ready_moves:contains(spell.name) then
  2075.                 if state.AxeMode.value == 'PetOnly' then
  2076.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2077.                         equip(sets.midcast.Pet.MagicAccReadyDWNE, sets.ReadyRecastDWNE)
  2078.                     else
  2079.                         equip(sets.midcast.Pet.MagicAccReadyNE, sets.ReadyRecast)
  2080.                     end
  2081.                 else
  2082.                     equip(sets.midcast.Pet.MagicAccReady, sets.ReadyRecast)
  2083.                 end
  2084.             end
  2085.  
  2086.             if pet_buff_moves:contains(spell.name) then
  2087.                 if state.AxeMode.value == 'PetOnly' then
  2088.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2089.                         equip(sets.midcast.Pet.BuffDWNE, sets.ReadyRecastDWNE)
  2090.                     else
  2091.                         equip(sets.midcast.Pet.BuffNE, sets.ReadyRecast)
  2092.                     end
  2093.                 else
  2094.                     equip(sets.midcast.Pet.Buff, sets.ReadyRecast)
  2095.                 end
  2096.             end
  2097.  
  2098.             -- If Pet TP, before bonuses, is less than a certain value then equip Nukumi Manoplas +1.
  2099.             if (physical_ready_moves:contains(spell.name) or magic_atk_ready_moves:contains(spell.name)) and state.OffenseMode.value ~= 'MaxAcc' then
  2100.                 if tp_based_ready_moves:contains(spell.name) and PetJob == 'Warrior' then
  2101.                     if pet_tp < 1300 then
  2102.                         equip(sets.midcast.Pet.TPBonus)
  2103.                     end
  2104.                 elseif tp_based_ready_moves:contains(spell.name) and PetJob ~= 'Warrior' then
  2105.                     if pet_tp < 1800 then
  2106.                         equip(sets.midcast.Pet.TPBonus)
  2107.                     end
  2108.                 end
  2109.             end
  2110.         eventArgs.handled = true
  2111.         else
  2112.             if state.AxeMode.value == 'PetOnly' and not buffactive['Unleash']then
  2113.                 if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2114.                     equip(sets.ReadyRecastDWNE)
  2115.                 else
  2116.                     equip(sets.ReadyRecastNE)
  2117.                 end
  2118.             else
  2119.                 equip(sets.ReadyRecast)
  2120.             end
  2121.         end
  2122.     end
  2123.  
  2124.     if spell.english == 'Reward' then
  2125.         if state.AxeMode.value == 'PetOnly' then
  2126.             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2127.                 equip(sets.precast.JA.RewardNEDW)
  2128.             else
  2129.                 equip(sets.precast.JA.RewardNE)
  2130.             end
  2131.         else
  2132.             equip(sets.precast.JA.Reward)
  2133.         end
  2134.     end
  2135.  
  2136.     if enmity_plus_moves:contains(spell.english) then
  2137.         if state.AxeMode.value == 'PetOnly' then
  2138.             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2139.                 equip(sets.EnmityNEDW)
  2140.             else
  2141.                 equip(sets.EnmityNE)
  2142.             end
  2143.         else
  2144.             equip(sets.Enmity)
  2145.         end
  2146.     end
  2147.  
  2148.     if spell.english == 'Spur' then
  2149.         if state.AxeMode.value == 'PetOnly' then
  2150.             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2151.                 equip(sets.precast.JA.SpurNEDW)
  2152.             else
  2153.                 equip(sets.precast.JA.SpurNE)
  2154.             end
  2155.         else
  2156.             equip(sets.precast.JA.Spur)
  2157.         end
  2158.     end
  2159.  
  2160.     if spell.english == 'Charm' then
  2161.         if state.AxeMode.value == 'PetOnly' then
  2162.             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2163.                 equip(sets.precast.JA.CharmNEDW)
  2164.             else
  2165.                 equip(sets.precast.JA.CharmNE)
  2166.             end
  2167.         else
  2168.             equip(sets.precast.JA.Charm)
  2169.         end
  2170.     end
  2171.  
  2172.     if spell.english == 'Bestial Loyalty' or spell.english == 'Call Beast' then
  2173.         JugInfo = ''
  2174.         if state.JugMode.value == 'FunguarFamiliar' or state.JugMode.value == 'Seedbed Soil' then
  2175.             JugInfo = 'Seedbed Soil'
  2176.         elseif state.JugMode.value == 'CourierCarrie' or state.JugMode.value == 'Fish Oil Broth' then
  2177.             JugInfo = 'Fish Oil Broth'
  2178.         elseif state.JugMode.value == 'AmigoSabotender' or state.JugMode.value == 'Sun Water' then
  2179.             JugInfo = 'Sun Water'
  2180.         elseif state.JugMode.value == 'NurseryNazuna' or state.JugMode.value == 'Dancing Herbal Broth' or state.JugMode.value == 'D. Herbal Broth' then
  2181.             JugInfo = 'D. Herbal Broth'
  2182.         elseif state.JugMode.value == 'CraftyClyvonne' or state.JugMode.value == 'Cunning Brain Broth' or state.JugMode.value == 'Cng. Brain Broth' then
  2183.             JugInfo = 'Cng. Brain Broth'
  2184.         elseif state.JugMode.value == 'PrestoJulio' or state.JugMode.value == 'Chirping Grasshopper Broth' or state.JugMode.value == 'C. Grass Broth' then
  2185.             JugInfo = 'C. Grass Broth'
  2186.         elseif state.JugMode.value == 'SwiftSieghard' or state.JugMode.value == 'Mellow Bird Broth' or state.JugMode.value == 'Mlw. Bird Broth' then
  2187.             JugInfo = 'Mlw. Bird Broth'
  2188.         elseif state.JugMode.value == 'MailbusterCetas' or state.JugMode.value == 'Goblin Bug Broth' or state.JugMode.value == 'Gob. Bug Broth' then
  2189.             JugInfo = 'Gob. Bug Broth'
  2190.         elseif state.JugMode.value == 'AudaciousAnna' or state.JugMode.value == 'Bubbling Carrion Broth' then
  2191.             JugInfo = 'B. Carrion Broth'
  2192.         elseif state.JugMode.value == 'TurbidToloi' or state.JugMode.value == 'Auroral Broth' then
  2193.             JugInfo = 'Auroral Broth'
  2194.         elseif state.JugMode.value == 'SlipperySilas' or state.JugMode.value == 'Wormy Broth' then
  2195.             JugInfo = 'Wormy Broth'
  2196.         elseif state.JugMode.value == 'LuckyLulush' or state.JugMode.value == 'Lucky Carrot Broth' or state.JugMode.value == 'L. Carrot Broth' then
  2197.             JugInfo = 'L. Carrot Broth'
  2198.         elseif state.JugMode.value == 'DipperYuly' or state.JugMode.value == 'Wool Grease' then
  2199.             JugInfo = 'Wool Grease'
  2200.         elseif state.JugMode.value == 'FlowerpotMerle' or state.JugMode.value == 'Vermihumus' then
  2201.             JugInfo = 'Vermihumus'
  2202.         elseif state.JugMode.value == 'DapperMac' or state.JugMode.value == 'Briny Broth' then
  2203.             JugInfo = 'Briny Broth'
  2204.         elseif state.JugMode.value == 'DiscreetLouise' or state.JugMode.value == 'Deepbed Soil' then
  2205.             JugInfo = 'Deepbed Soil'
  2206.         elseif state.JugMode.value == 'FatsoFargann' or state.JugMode.value == 'Curdled Plasma Broth' or state.JugMode.value == 'C. Plasma Broth' then
  2207.             JugInfo = 'C. Plasma Broth'
  2208.         elseif state.JugMode.value == 'FaithfulFalcorr' or state.JugMode.value == 'Lucky Broth' then
  2209.             JugInfo = 'Lucky Broth'
  2210.         elseif state.JugMode.value == 'BugeyedBroncha' or state.JugMode.value == 'Savage Mole Broth' or state.JugMode.value == 'Svg. Mole Broth' then
  2211.             JugInfo = 'Svg. Mole Broth'
  2212.         elseif state.JugMode.value == 'BloodclawShasra' or state.JugMode.value == 'Razor Brain Broth' or state.JugMode.value == 'Rzr. Brain Broth' then
  2213.             JugInfo = 'Rzr. Brain Broth'
  2214.         elseif state.JugMode.value == 'GorefangHobs' or state.JugMode.value == 'Burning Carrion Broth' then
  2215.             JugInfo = 'B. Carrion Broth'
  2216.         elseif state.JugMode.value == 'GooeyGerard' or state.JugMode.value == 'Cloudy Wheat Broth' or state.JugMode.value == 'Cl. Wheat Broth' then
  2217.             JugInfo = 'Cl. Wheat Broth'
  2218.         elseif state.JugMode.value == 'CrudeRaphie' or state.JugMode.value == 'Shadowy Broth' then
  2219.             JugInfo = 'Shadowy Broth'
  2220.         elseif state.JugMode.value == 'DroopyDortwin' or state.JugMode.value == 'Swirling Broth' then
  2221.             JugInfo = 'Swirling Broth'
  2222.         elseif state.JugMode.value == 'PonderingPeter' or state.JugMode.value == 'Viscous Broth' or state.JugMode.value == 'Vis. Broth' then
  2223.             JugInfo = 'Vis. Broth'
  2224.         elseif state.JugMode.value == 'SunburstMalfik' or state.JugMode.value == 'Shimmering Broth' then
  2225.             JugInfo = 'Shimmering Broth'
  2226.         elseif state.JugMode.value == 'AgedAngus' or state.JugMode.value == 'Fermented Broth' or state.JugMode.value == 'Ferm. Broth' then
  2227.             JugInfo = 'Ferm. Broth'
  2228.         elseif state.JugMode.value == 'WarlikePatrick' or state.JugMode.value == 'Livid Broth' then
  2229.             JugInfo = 'Livid Broth'
  2230.         elseif state.JugMode.value == 'ScissorlegXerin' or state.JugMode.value == 'Spicy Broth' then
  2231.             JugInfo = 'Spicy Broth'
  2232.         elseif state.JugMode.value == 'BouncingBertha' or state.JugMode.value == 'Bubbly Broth' then
  2233.             JugInfo = 'Bubbly Broth'
  2234.         elseif state.JugMode.value == 'RhymingShizuna' or state.JugMode.value == 'Lyrical Broth' then
  2235.             JugInfo = 'Lyrical Broth'
  2236.         elseif state.JugMode.value == 'AttentiveIbuki' or state.JugMode.value == 'Salubrious Broth' then
  2237.             JugInfo = 'Salubrious Broth'
  2238.         elseif state.JugMode.value == 'SwoopingZhivago' or state.JugMode.value == 'Windy Greens' then
  2239.             JugInfo = 'Windy Greens'
  2240.         elseif state.JugMode.value == 'AmiableRoche' or state.JugMode.value == 'Airy Broth' then
  2241.             JugInfo = 'Airy Broth'
  2242.         elseif state.JugMode.value == 'HeraldHenry' or state.JugMode.value == 'Translucent Broth' or state.JugMode.value == 'Trans. Broth' then
  2243.             JugInfo = 'Trans. Broth'
  2244.         elseif state.JugMode.value == 'BrainyWaluis' or state.JugMode.value == 'Crumbly Soil' then
  2245.             JugInfo = 'Crumbly Soil'
  2246.         elseif state.JugMode.value == 'HeadbreakerKen' or state.JugMode.value == 'Blackwater Broth' then
  2247.             JugInfo = 'Blackwater Broth'
  2248.         elseif state.JugMode.value == 'RedolentCandi' or state.JugMode.value == 'Electrified Broth' then
  2249.             JugInfo = 'Electrified Broth'
  2250.         elseif state.JugMode.value == 'AlluringHoney' or state.JugMode.value == 'Bug-Ridden Broth' then
  2251.             JugInfo = 'Bug-Ridden Broth'
  2252.         elseif state.JugMode.value == 'CaringKiyomaro' or state.JugMode.value == 'Fizzy Broth' then
  2253.             JugInfo = 'Fizzy Broth'
  2254.         elseif state.JugMode.value == 'VivaciousVickie' or state.JugMode.value == 'Tantalizing Broth' or state.JugMode.value == 'Tant. Broth' then
  2255.             JugInfo = 'Tant. Broth'
  2256.         elseif state.JugMode.value == 'HurlerPercival' or state.JugMode.value == 'Pale Sap' then
  2257.             JugInfo = 'Pale Sap'
  2258.         elseif state.JugMode.value == 'BlackbeardRandy' or state.JugMode.value == 'Meaty Broth' then
  2259.             JugInfo = 'Meaty Broth'
  2260.         elseif state.JugMode.value == 'GenerousArthur' or state.JugMode.value == 'Dire Broth' then
  2261.             JugInfo = 'Dire Broth'
  2262.         elseif state.JugMode.value == 'ThreestarLynn' or state.JugMode.value == 'Muddy Broth' then
  2263.             JugInfo = 'Muddy Broth'
  2264.         elseif state.JugMode.value == 'BraveHeroGlenn' or state.JugMode.value == 'Wispy Broth' then
  2265.             JugInfo = 'Wispy Broth'
  2266.         elseif state.JugMode.value == 'SharpwitHermes' or state.JugMode.value == 'Saline Broth' then
  2267.             JugInfo = 'Saline Broth'
  2268.         elseif state.JugMode.value == 'ColibriFamiliar' or state.JugMode.value == 'Sugary Broth' then
  2269.             JugInfo = 'Sugary Broth'
  2270.         elseif state.JugMode.value == 'ChoralLeera' or state.JugMode.value == 'Glazed Broth' then
  2271.             JugInfo = 'Glazed Broth'
  2272.         elseif state.JugMode.value == 'SpiderFamiliar' or state.JugMode.value == 'Sticky Webbing' then
  2273.             JugInfo = 'Sticky Webbing'
  2274.         elseif state.JugMode.value == 'GussyHachirobe' or state.JugMode.value == 'Slimy Webbing' then
  2275.             JugInfo = 'Slimy Webbing'
  2276.         elseif state.JugMode.value == 'AcuexFamiliar' or state.JugMode.value == 'Poisonous Broth' then
  2277.             JugInfo = 'Poisonous Broth'
  2278.         elseif state.JugMode.value == 'FluffyBredo' or state.JugMode.value == 'Venomous Broth' then
  2279.             JugInfo = 'Venomous Broth'
  2280.         elseif state.JugMode.value == 'SuspiciousAlice' or state.JugMode.value == 'Furious Broth' then
  2281.             JugInfo = 'Furious Broth'
  2282.         elseif state.JugMode.value == 'AnklebiterJedd' or state.JugMode.value == 'Crackling Broth' then
  2283.             JugInfo = 'Crackling Broth'
  2284.         elseif state.JugMode.value == 'FleetReinhard' or state.JugMode.value == 'Rapid Broth' then
  2285.             JugInfo = 'Rapid Broth'
  2286.         elseif state.JugMode.value == 'CursedAnnabelle' or state.JugMode.value == 'Creepy Broth' then
  2287.             JugInfo = 'Creepy Broth'
  2288.         elseif state.JugMode.value == 'SurgingStorm' or state.JugMode.value == 'Insipid Broth' then
  2289.             JugInfo = 'Insipid Broth'
  2290.         elseif state.JugMode.value == 'SubmergedIyo' or state.JugMode.value == 'Deepwater Broth' then
  2291.             JugInfo = 'Deepwater Broth'
  2292.         elseif state.JugMode.value == 'MosquitoFamiliar' or state.JugMode.value == 'Wetlands Broth' then
  2293.             JugInfo = 'Wetlands Broth'
  2294.         elseif state.JugMode.value == 'Left-HandedYoko' or state.JugMode.value == 'Heavenly Broth' then
  2295.             JugInfo = 'Heavenly Broth'
  2296.         end
  2297.         if spell.english == "Call Beast" and call_beast_cancel:contains(JugInfo) then
  2298.             add_to_chat(123, spell.name..' Canceled: [HQ Jug Pet]')
  2299.             return
  2300.         end
  2301.         equip({ammo=JugInfo})
  2302.     end
  2303.  
  2304.     if player.equipment.main == 'Aymur' then
  2305.         custom_aftermath_timers_precast(spell)
  2306.     end
  2307.  
  2308.     if spell.type == "WeaponSkill" and spell.name ~= 'Mistral Axe' and spell.name ~= 'Bora Axe' and spell.target.distance > target_distance then
  2309.         cancel_spell()
  2310.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  2311.         handle_equipping_gear(player.status)
  2312.         return
  2313.     end
  2314.  
  2315.     if spell.type == 'CorsairRoll' or spell.english == "Double-Up" then
  2316.         equip(sets.precast.LuzafRing)
  2317.     end
  2318.  
  2319.     if spell.prefix == '/magic' or spell.prefix == '/ninjutsu' or spell.prefix == '/song' then
  2320.         if state.AxeMode.value == 'PetOnly' then
  2321.             equip(sets.precast.FCNE)
  2322.         else
  2323.             equip(sets.precast.FC)
  2324.         end
  2325.     end
  2326. end
  2327.  
  2328. function customize_melee_set(meleeSet)
  2329.     if state.AxeMode.value == 'PetOnly' and pet.status == "Engaged" and player.status == "Engaged" and state.DefenseMode.value == "None" then
  2330.         if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2331.             if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  2332.                 meleeSet = set_combine(meleeSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBMNK)
  2333.             elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  2334.                 meleeSet = set_combine(meleeSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBNonMNK)
  2335.             else
  2336.                 meleeSet = set_combine(meleeSet, sets.PetTPAxes, sets.idle.Pet.Engaged)
  2337.             end
  2338.         else
  2339.             if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  2340.                 meleeSet = set_combine(meleeSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBMNK)
  2341.             elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  2342.                 meleeSet = set_combine(meleeSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBNonMNK)
  2343.             else
  2344.                 meleeSet = set_combine(meleeSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged)
  2345.             end
  2346.         end
  2347.     else
  2348.         if state.AxeMode.value == 'NoSwaps' and state.DefenseMode.value == "None" and player.equipment.sub == 'Kraken Club' then
  2349.             meleeSet = set_combine(meleeSet, sets.engaged.DW.KrakenClub)
  2350.         end
  2351.     end
  2352.     return meleeSet
  2353. end
  2354.  
  2355. function job_post_precast(spell, action, spellMap, eventArgs)
  2356. -- If Killer Instinct is active during WS, equip Nukumi Gausape +1.
  2357.     if spell.type:lower() == 'weaponskill' and buffactive['Killer Instinct'] then
  2358.         equip(sets.buff['Killer Instinct'])
  2359.     end
  2360.  
  2361.     if spell.english == "Primal Rend" or spell.english == "Cloudsplitter" then
  2362.         if player.tp > 2750 then
  2363.             equip(sets.midcast.ExtraMAB)
  2364.         end
  2365.     end
  2366.  
  2367. -- Equip Chaac Belt for TH+1 on common Subjob Abilities or Spells.
  2368.     if abilities_to_check:contains(spell.english) and state.TreasureMode.value == 'Tag' then
  2369.         equip(sets.THGear)
  2370.     end
  2371. end
  2372.  
  2373. function job_midcast(spell, action, spellMap, eventArgs)
  2374.     if state.AxeMode.value == 'PetOnly' then
  2375.         if spell.english == "Cure" or spell.english == "Cure II" or spell.english == "Cure III" or spell.english == "Cure IV" then
  2376.             equip(sets.CurePetOnly)
  2377.         end
  2378.         if spell.english == "Curaga" or spell.english == "Curaga II" or spell.english == "Curaga III" then
  2379.             equip(sets.CurePetOnly)
  2380.         end
  2381.     end
  2382. end
  2383.  
  2384. -- Return true if we handled the aftercast work.  Otherwise it will fall back
  2385. -- to the general aftercast() code in Mote-Include.
  2386. function job_aftercast(spell, action, spellMap, eventArgs)
  2387.     if spell.type == "Monster" and not spell.interrupted then
  2388.         if physical_ready_moves:contains(spell.name) then
  2389.             if state.AxeMode.value == 'PetOnly' then
  2390.                 if state.OffenseMode.value == 'MaxAcc' then
  2391.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2392.                         if tp_based_ready_moves:contains(spell.name) then
  2393.                             equip(sets.midcast.Pet.ReadyDWNE.TPBonus.MaxAcc)
  2394.                         else
  2395.                             equip(sets.midcast.Pet.ReadyDWNE.MaxAcc)
  2396.                         end
  2397.                     else
  2398.                         if tp_based_ready_moves:contains(spell.name) then
  2399.                             equip(sets.midcast.Pet.ReadyNE.TPBonus.MaxAcc)
  2400.                         else
  2401.                             equip(sets.midcast.Pet.ReadyNE.MaxAcc)
  2402.                         end
  2403.                     end
  2404.                 elseif state.OffenseMode.value == 'HighAcc' then
  2405.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2406.                         if tp_based_ready_moves:contains(spell.name) then
  2407.                             equip(sets.midcast.Pet.ReadyDWNE.TPBonus.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2408.                         else
  2409.                             equip(sets.midcast.Pet.ReadyDWNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2410.                         end
  2411.                     else
  2412.                         if tp_based_ready_moves:contains(spell.name) then
  2413.                             equip(sets.midcast.Pet.ReadyNE.TPBonus.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2414.                         else
  2415.                             equip(sets.midcast.Pet.ReadyNE.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2416.                         end
  2417.                     end
  2418.                 elseif state.OffenseMode.value == 'MedAcc' then
  2419.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2420.                         if tp_based_ready_moves:contains(spell.name) then
  2421.                             equip(sets.midcast.Pet.ReadyDWNE.TPBonus.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2422.                         else
  2423.                             equip(sets.midcast.Pet.ReadyDWNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2424.                         end
  2425.                     else
  2426.                         if tp_based_ready_moves:contains(spell.name) then
  2427.                             equip(sets.midcast.Pet.ReadyNE.TPBonus.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2428.                         else
  2429.                             equip(sets.midcast.Pet.ReadyNE.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2430.                         end
  2431.                     end
  2432.                 else
  2433.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2434.                         if multi_hit_ready_moves:contains(spell.name) then
  2435.                             if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  2436.                                 if tp_based_ready_moves:contains(spell.name) then
  2437.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
  2438.                                 else
  2439.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
  2440.                                 end
  2441.                             elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  2442.                                 if tp_based_ready_moves:contains(spell.name) then
  2443.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
  2444.                                 else
  2445.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
  2446.                                 end
  2447.                             else
  2448.                                 if tp_based_ready_moves:contains(spell.name) then
  2449.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
  2450.                                 else
  2451.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeDWNE, sets.midcast.Pet[state.CorrelationMode.value]))
  2452.                                 end
  2453.                             end
  2454.                         else
  2455.                             if tp_based_ready_moves:contains(spell.name) then
  2456.                                 equip(set_combine(sets.midcast.Pet.ReadyDWNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
  2457.                             else
  2458.                                 equip(set_combine(sets.midcast.Pet.ReadyDWNE, sets.midcast.Pet[state.CorrelationMode.value]))
  2459.                             end
  2460.                         end
  2461.                     else
  2462.                         if multi_hit_ready_moves:contains(spell.name) then
  2463.                             if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  2464.                                 if tp_based_ready_moves:contains(spell.name) then
  2465.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
  2466.                                 else
  2467.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
  2468.                                 end
  2469.                             elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  2470.                                 if tp_based_ready_moves:contains(spell.name) then
  2471.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
  2472.                                 else
  2473.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
  2474.                                 end
  2475.                             else
  2476.                                 if tp_based_ready_moves:contains(spell.name) then
  2477.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
  2478.                                 else
  2479.                                     equip(set_combine(sets.midcast.Pet.MultiStrikeNE, sets.midcast.Pet[state.CorrelationMode.value]))
  2480.                                 end
  2481.                             end
  2482.                         else
  2483.                             if tp_based_ready_moves:contains(spell.name) then
  2484.                                 equip(set_combine(sets.midcast.Pet.ReadyNE.TPBonus, sets.midcast.Pet[state.CorrelationMode.value]))
  2485.                             else
  2486.                                 equip(set_combine(sets.midcast.Pet.ReadyNE, sets.midcast.Pet[state.CorrelationMode.value]))
  2487.                             end
  2488.                         end
  2489.                     end
  2490.                 end
  2491.             else
  2492.                 if state.OffenseMode.value == 'MaxAcc' then
  2493.                     equip(sets.midcast.Pet.MaxAcc)
  2494.                 elseif state.OffenseMode.value == 'HighAcc' then
  2495.                     equip(sets.midcast.Pet.HighAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2496.                 elseif state.OffenseMode.value == 'MedAcc' then
  2497.                     equip(sets.midcast.Pet.MedAcc, sets.midcast.Pet[state.CorrelationMode.value])
  2498.                 else
  2499.                     if multi_hit_ready_moves:contains(spell.name) then
  2500.                         if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  2501.                             equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowMNK))
  2502.                         elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  2503.                             equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value], sets.midcast.Pet.SubtleBlowNonMNK))
  2504.                         else
  2505.                             equip(set_combine(sets.midcast.Pet.MultiStrike, sets.midcast.Pet[state.CorrelationMode.value]))
  2506.                         end
  2507.                     else
  2508.                         equip(set_combine(sets.midcast.Pet.WS, sets.midcast.Pet[state.CorrelationMode.value]))
  2509.                     end
  2510.                 end
  2511.             end
  2512.         end
  2513.  
  2514.         if magic_atk_ready_moves:contains(spell.name) then
  2515.             if state.AxeMode.value == 'PetOnly' then
  2516.                 if state.OffenseMode.value == 'MaxAcc' then
  2517.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2518.                         if tp_based_ready_moves:contains(spell.name) then
  2519.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MaxAcc)
  2520.                         else
  2521.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.MaxAcc)
  2522.                         end
  2523.                     else
  2524.                         if tp_based_ready_moves:contains(spell.name) then
  2525.                             equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MaxAcc)
  2526.                         else
  2527.                             equip(sets.midcast.Pet.MagicAtkReadyNE.MaxAcc)
  2528.                         end
  2529.                     end
  2530.                 elseif state.OffenseMode.value == 'HighAcc' then
  2531.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2532.                         if tp_based_ready_moves:contains(spell.name) then
  2533.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.HighAcc)
  2534.                         else
  2535.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.HighAcc)
  2536.                         end
  2537.                     else
  2538.                         if tp_based_ready_moves:contains(spell.name) then
  2539.                             equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus.HighAcc)
  2540.                         else
  2541.                             equip(sets.midcast.Pet.MagicAtkReadyNE.HighAcc)
  2542.                         end
  2543.                     end
  2544.                 elseif state.OffenseMode.value == 'MedAcc' then
  2545.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2546.                         if tp_based_ready_moves:contains(spell.name) then
  2547.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus.MedAcc)
  2548.                         else
  2549.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.MedAcc)
  2550.                         end
  2551.                     else
  2552.                         if tp_based_ready_moves:contains(spell.name) then
  2553.                             equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus.MedAcc)
  2554.                         else
  2555.                             equip(sets.midcast.Pet.MagicAtkReadyNE.MedAcc)
  2556.                         end
  2557.                     end
  2558.                 else
  2559.                     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2560.                         if tp_based_ready_moves:contains(spell.name) then
  2561.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE.TPBonus)
  2562.                         else
  2563.                             equip(sets.midcast.Pet.MagicAtkReadyDWNE)
  2564.                         end
  2565.                     else
  2566.                         if tp_based_ready_moves:contains(spell.name) then
  2567.                             equip(sets.midcast.Pet.MagicAtkReadyNE.TPBonus)
  2568.                         else
  2569.                             equip(sets.midcast.Pet.MagicAtkReadyNE)
  2570.                         end
  2571.                     end
  2572.                 end
  2573.             else
  2574.                 equip(sets.midcast.Pet.MagicAtkReady)
  2575.             end
  2576.         end
  2577.  
  2578.         if magic_acc_ready_moves:contains(spell.name) then
  2579.             if state.AxeMode.value == 'PetOnly' then
  2580.                 if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2581.                     equip(sets.midcast.Pet.MagicAccReadyDWNE)
  2582.                 else
  2583.                     equip(sets.midcast.Pet.MagicAccReadyNE)
  2584.                 end
  2585.             else
  2586.                 equip(sets.midcast.Pet.MagicAccReady)
  2587.             end
  2588.         end
  2589.  
  2590.         if pet_buff_moves:contains(spell.name) then
  2591.             if state.AxeMode.value == 'PetOnly' then
  2592.                 if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2593.                     equip(sets.midcast.Pet.BuffDWNE)
  2594.                 else
  2595.                     equip(sets.midcast.Pet.BuffNE)
  2596.                 end
  2597.             else
  2598.                 equip(sets.midcast.Pet.Buff)
  2599.             end
  2600.         end
  2601.  
  2602.         -- If Pet TP, before bonuses, is less than a certain value then equip Nukumi Manoplas +1.
  2603.         -- Or if Pet TP, before bonuses, is more than a certain value then equip Unleash-specific Axes.
  2604.         if (physical_ready_moves:contains(spell.name) or magic_atk_ready_moves:contains(spell.name)) and state.OffenseMode.value ~= 'MaxAcc' then
  2605.             if tp_based_ready_moves:contains(spell.name) and PetJob == 'Warrior' then
  2606.                 if pet_tp < 1300 then
  2607.                     equip(sets.midcast.Pet.TPBonus)
  2608.                 elseif pet_tp > 2000 and state.AxeMode.value == 'PetOnly' then
  2609.                     if physical_ready_moves:contains(spell.name) then
  2610.                         if state.OffenseMode.value == 'HighAcc' then
  2611.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2612.                                 equip(sets.UnleashAtkAxes.HighAcc)
  2613.                             else
  2614.                                 equip(sets.UnleashAtkAxeShield.HighAcc)
  2615.                             end
  2616.                         elseif state.OffenseMode.value == 'MedAcc' then
  2617.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2618.                                 equip(sets.UnleashAtkAxes.MedAcc)
  2619.                             else
  2620.                                 equip(sets.UnleashAtkAxeShield.MedAcc)
  2621.                             end
  2622.                         else
  2623.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2624.                                 equip(sets.UnleashAtkAxes)
  2625.                             else
  2626.                                 equip(sets.UnleashAtkAxeShield)
  2627.                             end
  2628.                         end
  2629.                     else
  2630.                         if state.OffenseMode.value == 'HighAcc' then
  2631.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2632.                                 equip(sets.UnleashMABAxes.HighAcc)
  2633.                             else
  2634.                                 equip(sets.UnleashMABAxeShield.HighAcc)
  2635.                             end
  2636.                         elseif state.OffenseMode.value == 'MedAcc' then
  2637.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2638.                                 equip(sets.UnleashMABAxes.MedAcc)
  2639.                             else
  2640.                                 equip(sets.UnleashMABAxeShield.MedAcc)
  2641.                             end
  2642.                         else
  2643.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2644.                                 equip(sets.UnleashMABAxes)
  2645.                             else
  2646.                                 equip(sets.UnleashMABAxeShield)
  2647.                             end
  2648.                         end
  2649.                     end
  2650.                 end
  2651.             elseif tp_based_ready_moves:contains(spell.name) and PetJob ~= 'Warrior' then
  2652.                 if pet_tp < 1800 then
  2653.                     equip(sets.midcast.Pet.TPBonus)
  2654.                 elseif pet_tp > 2500 and state.AxeMode.value == 'PetOnly' then
  2655.                     if physical_ready_moves:contains(spell.name) then
  2656.                         if state.OffenseMode.value == 'HighAcc' then
  2657.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2658.                                 equip(sets.UnleashAtkAxes.HighAcc)
  2659.                             else
  2660.                                 equip(sets.UnleashAtkAxeShield.HighAcc)
  2661.                             end
  2662.                         elseif state.OffenseMode.value == 'MedAcc' then
  2663.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2664.                                 equip(sets.UnleashAtkAxes.MedAcc)
  2665.                             else
  2666.                                 equip(sets.UnleashAtkAxeShield.MedAcc)
  2667.                             end
  2668.                         else
  2669.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2670.                                 equip(sets.UnleashAtkAxes)
  2671.                             else
  2672.                                 equip(sets.UnleashAtkAxeShield)
  2673.                             end
  2674.                         end
  2675.                     else
  2676.                         if state.OffenseMode.value == 'HighAcc' then
  2677.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2678.                                 equip(sets.UnleashMABAxes.HighAcc)
  2679.                             else
  2680.                                 equip(sets.UnleashMABAxeShield.HighAcc)
  2681.                             end
  2682.                         elseif state.OffenseMode.value == 'MedAcc' then
  2683.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2684.                                 equip(sets.UnleashMABAxes.MedAcc)
  2685.                             else
  2686.                                 equip(sets.UnleashMABAxeShield.MedAcc)
  2687.                             end
  2688.                         else
  2689.                             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2690.                                 equip(sets.UnleashMABAxes)
  2691.                             else
  2692.                                 equip(sets.UnleashMABAxeShield)
  2693.                             end
  2694.                         end
  2695.                     end
  2696.                 end
  2697.             end
  2698.         end
  2699.     eventArgs.handled = true
  2700.     end
  2701.  
  2702.     -- Create custom timers for Pet Buffs.
  2703.     if pet_buff_moves:contains(spell.name) and DisplayPetBuffTimers == 'true' then
  2704.         if not spell.interrupted then
  2705.             pet_buff_timer(spell)
  2706.         end
  2707.     end
  2708.  
  2709.     if spell.english == 'Fight' or spell.english == 'Bestial Loyalty' or spell.english == 'Call Beast' then
  2710.         if not spell.interrupted then
  2711.             pet_info_update()
  2712.         end
  2713.     end
  2714.  
  2715.     if spell.english == "Leave" and not spell.interrupted then
  2716.         clear_pet_buff_timers()
  2717.         PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None';ReadyMoveFour = 'None'
  2718.     end
  2719.  
  2720.     if player.equipment.main == 'Aymur' then
  2721.         custom_aftermath_timers_aftercast(spell)
  2722.     end
  2723.  
  2724.     if player.status ~= 'Idle' and state.AxeMode.value == 'PetOnly' and spell.type ~= "Monster" then
  2725.         pet_only_equip_handling()
  2726.     end
  2727. end
  2728.  
  2729. function job_pet_midcast(spell, action, spellMap, eventArgs)
  2730.  
  2731. end
  2732.  
  2733. function job_pet_aftercast(spell, action, spellMap, eventArgs)
  2734.     if pet_buff_moves:contains(spell.name) and DisplayPetBuffTimers == 'true' then
  2735.         -- Pet TP calculations for Ready Buff Durations
  2736.         local TP_Amount = 1000
  2737.         if pet_tp < 1000 then TP_Amount = TP_Amount + TP_Gift_Bonus;end
  2738.         if pet_tp > 1000 then TP_Amount = pet_tp + TP_Gift_Bonus;end
  2739.         if player.equipment.hands == "Ferine Manoplas +1" then TP_Amount = TP_Amount + 250;end
  2740.         if player.equipment.hands == "Ferine Manoplas +2" then TP_Amount = TP_Amount + 500;end
  2741.         if player.equipment.hands == "Nukumi Manoplas" then TP_Amount = TP_Amount + 550;end
  2742.         if player.equipment.hands == "Nukumi Manoplas +1" then TP_Amount = TP_Amount + 600;end
  2743.         if player.equipment.main == "Aymur" or player.equipment.sub == "Aymur" then TP_Amount = TP_Amount + 500;end
  2744.         if player.equipment.main == "Kumbhakarna" then TP_Amount = TP_Amount + TP_Bonus_Main;end
  2745.         if player.equipment.sub == "Kumbhakarna" then TP_Amount = TP_Amount + TP_Bonus_Sub;end
  2746.         if TP_Amount > 3000 then TP_Amount = 3000;end
  2747.  
  2748.         if spell.english == 'Bubble Curtain' then
  2749.             local TP_Buff_Duration = math.floor((TP_Amount - 1000)* 0.09) + BubbleCurtainDuration
  2750.             send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..BubbleCurtainIcon..'')
  2751.         elseif spell.english == 'Scissor Guard' then
  2752.             local TP_Buff_Duration = math.floor(TP_Amount * 0.06)
  2753.             send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..ScissorGuardIcon..'')
  2754.         elseif spell.english == 'Secretion' then
  2755.             TP_Amount = TP_Amount + 500
  2756.             if TP_Amount > 3000 then TP_Amount = 3000;end
  2757.             local TP_Buff_Duration = math.floor(TP_Amount * 0.18)
  2758.             send_command('timers c "Secretion" '..TP_Buff_Duration..' down '..SecretionIcon..'')
  2759.         elseif spell.english == 'Rage' then
  2760.             TP_Amount = TP_Amount + 500
  2761.             if TP_Amount > 3000 then TP_Amount = 3000;end
  2762.             local TP_Buff_Duration = math.floor(TP_Amount * 0.18)
  2763.             send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..RageIcon..'')
  2764.         elseif spell.english == 'Rhino Guard' then
  2765.             local TP_Buff_Duration = math.floor(TP_Amount * 0.18)
  2766.             send_command('timers c "Rhino Guard" '..TP_Buff_Duration..' down '..RhinoGuardIcon..'')
  2767.         elseif spell.english == 'Zealous Snort' then
  2768.             local TP_Buff_Duration = math.floor(TP_Amount * 0.06)
  2769.             send_command('timers c "'..spell.english..'" '..TP_Buff_Duration..' down '..ZealousSnortIcon..'')
  2770.         end
  2771.     end
  2772.     pet_only_equip_handling()
  2773. end
  2774.  
  2775. -------------------------------------------------------------------------------------------------------------------
  2776. -- Customization hook for idle sets.
  2777. -------------------------------------------------------------------------------------------------------------------
  2778.  
  2779. function customize_idle_set(idleSet)
  2780.     if state.AxeMode.value == 'PetOnly' then
  2781.         if pet.status == "Engaged" then
  2782.             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2783.                 if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
  2784.                     idleSet = set_combine(idleSet, sets.PetPDTAxes)
  2785.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
  2786.                     idleSet = set_combine(idleSet, sets.PetMDTAxes)
  2787.                 elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
  2788.                     idleSet = set_combine(idleSet, sets.PDTAxes)
  2789.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
  2790.                     idleSet = set_combine(idleSet, sets.MDTAxes)
  2791.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
  2792.                     idleSet = set_combine(idleSet, sets.MEvaAxes)
  2793.                 else
  2794.                     if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  2795.                         idleSet = set_combine(idleSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBMNK)
  2796.                     elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  2797.                         idleSet = set_combine(idleSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSBNonMNK)
  2798.                     elseif state.HybridMode.value == 'PetSTP' then
  2799.                         idleSet = set_combine(idleSet, sets.PetTPAxes, sets.idle.Pet.Engaged.PetSTP)
  2800.                     else
  2801.                         idleSet = set_combine(idleSet, sets.PetTPAxes)
  2802.                     end
  2803.                 end
  2804.             else
  2805.                 if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
  2806.                     idleSet = set_combine(idleSet, sets.PetPDTAxeShield)
  2807.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
  2808.                     idleSet = set_combine(idleSet, sets.PetMDTAxeShield)
  2809.                 elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
  2810.                     idleSet = set_combine(idleSet, sets.PDTAxeShield)
  2811.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
  2812.                     idleSet = set_combine(idleSet, sets.MDTAxeShield)
  2813.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
  2814.                     idleSet = set_combine(idleSet, sets.MEvaAxeShield)
  2815.                 else
  2816.                     if state.HybridMode.value == 'PetSB' and PetJob == 'Monk' then
  2817.                         idleSet = set_combine(idleSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBMNK)
  2818.                     elseif state.HybridMode.value == 'PetSB' and PetJob ~= 'Monk' then
  2819.                         idleSet = set_combine(idleSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSBNonMNK)
  2820.                     elseif state.HybridMode.value == 'PetSTP' then
  2821.                         idleSet = set_combine(idleSet, sets.PetTPAxeShield, sets.idle.Pet.Engaged.PetSTP)
  2822.                     else
  2823.                         idleSet = set_combine(idleSet, sets.PetTPAxeShield)
  2824.                     end
  2825.                 end
  2826.             end
  2827.         end
  2828.         if pet.status ~= "Engaged" then
  2829.             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  2830.                 if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
  2831.                     idleSet = set_combine(idleSet, sets.PetPDTAxes)
  2832.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
  2833.                     idleSet = set_combine(idleSet, sets.PetMDTAxes)
  2834.                 elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
  2835.                     idleSet = set_combine(idleSet, sets.PDTAxes)
  2836.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
  2837.                     idleSet = set_combine(idleSet, sets.MDTAxes)
  2838.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
  2839.                     idleSet = set_combine(idleSet, sets.MEvaAxes)
  2840.                 elseif state.IdleMode.value == "PetRegen" then
  2841.                     idleSet = set_combine(idleSet, sets.PetRegenAxes)
  2842.                 else
  2843.                     idleSet = set_combine(idleSet, sets.IdleAxes)
  2844.                 end
  2845.             else
  2846.                 if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
  2847.                     idleSet = set_combine(idleSet, sets.PetPDTAxeShield)
  2848.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
  2849.                     idleSet = set_combine(idleSet, sets.PetMDTAxeShield)
  2850.                 elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
  2851.                     idleSet = set_combine(idleSet, sets.PDTAxeShield)
  2852.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
  2853.                     idleSet = set_combine(idleSet, sets.MDTAxeShield)
  2854.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
  2855.                     idleSet = set_combine(idleSet, sets.MEvaAxeShield)
  2856.                 elseif state.IdleMode.value == "PetRegen" then
  2857.                     idleSet = set_combine(idleSet, sets.PetRegenAxeShield)
  2858.                 else
  2859.                     idleSet = set_combine(idleSet, sets.IdleAxeShield)
  2860.                 end
  2861.             end
  2862.         end
  2863.     end
  2864.     return idleSet
  2865. end
  2866.  
  2867. -------------------------------------------------------------------------------------------------------------------
  2868. -- Hooks for Reward, Correlation, Treasure Hunter, and Pet Mode handling.
  2869. -------------------------------------------------------------------------------------------------------------------
  2870.  
  2871. function job_state_change(stateField, newValue, oldValue)
  2872.     if stateField == 'Correlation Mode' then
  2873.         state.CorrelationMode:set(newValue)
  2874.     elseif stateField == 'Treasure Mode' then
  2875.         state.TreasureMode:set(newValue)
  2876.     elseif stateField == 'Pet Mode' then
  2877.         state.CombatWeapon:set(newValue)
  2878.     end
  2879. end
  2880.  
  2881. function get_custom_wsmode(spell, spellMap, default_wsmode)
  2882.     if default_wsmode == 'Normal' then
  2883.         if spell.english == "Ruinator" and (world.day_element == 'Water' or world.day_element == 'Wind' or world.day_element == 'Ice') then
  2884.             return 'Gavialis'
  2885.         end
  2886.         if spell.english == "Rampage" and world.day_element == 'Earth' then
  2887.             return 'Gavialis'
  2888.         end
  2889.     end
  2890. end
  2891.  
  2892. -------------------------------------------------------------------------------------------------------------------
  2893. -- User code that supplements self-commands.
  2894. -------------------------------------------------------------------------------------------------------------------
  2895.  
  2896. -- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).
  2897. function job_handle_equipping_gear(playerStatus, eventArgs)
  2898.     -- Equipping a Capacity Points Mantle locks it until it is manually unequipped.
  2899.     --if player.equipment.back == 'Mecisto. Mantle' or player.equipment.back == 'Aptitude Mantle' or player.equipment.back == 'Aptitude Mantle +1' then
  2900.     --    disable('back')
  2901.     --else
  2902.     --    enable('back')
  2903.     --end
  2904. end
  2905.  
  2906. -- Called by the 'update' self-command, for common needs.
  2907. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  2908. function job_update(cmdParams, eventArgs)
  2909.     get_combat_form()
  2910.     get_melee_groups()
  2911.     pet_info_update()
  2912.     update_display_mode_info()
  2913.     pet_only_equip_handling()
  2914. end
  2915.  
  2916. -- Updates gear based on pet status changes.
  2917. function job_pet_status_change(newStatus, oldStatus, eventArgs)
  2918.     if newStatus == 'Idle' or newStatus == 'Engaged' then
  2919.         if state.DefenseMode.value ~= "Physical" and state.DefenseMode.value ~= "Magical" then
  2920.             handle_equipping_gear(player.status)
  2921.         end
  2922.     end
  2923.  
  2924.     if pet.hpp == 0 then
  2925.         clear_pet_buff_timers()
  2926.         PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None';ReadyMoveFour = 'None'
  2927.     end
  2928.  
  2929.     customize_melee_set(meleeSet)
  2930.     pet_info_update()
  2931. end
  2932.  
  2933. function job_buff_change(status, gain, gain_or_loss)
  2934.     --Equip Frenzy Sallet if we're asleep and engaged.
  2935.     if (status == "sleep" and gain_or_loss) and player.status == 'Engaged' then
  2936.         if gain then
  2937.             equip(sets.FrenzySallet)
  2938.         else
  2939.             handle_equipping_gear(player.status)
  2940.         end
  2941.     end
  2942. end
  2943.  
  2944. -------------------------------------------------------------------------------------------------------------------
  2945. -- Ready Move Presets and Pet TP Evaluation Functions - Credit to Bomberto and Verda
  2946. -------------------------------------------------------------------------------------------------------------------
  2947.  
  2948. pet_tp=0
  2949. function job_self_command(cmdParams, eventArgs)
  2950.     if cmdParams[1]:lower() == 'ready' then
  2951.         ready_move(cmdParams)
  2952.         eventArgs.handled = true
  2953.     end
  2954.     if cmdParams[1]:lower() == 'gearhandle' then
  2955.         pet_only_equip_handling()
  2956.     end
  2957.     if cmdParams[1] == 'pet_tp' then
  2958.         pet_tp = tonumber(cmdParams[2])
  2959.     end
  2960.     if cmdParams[1]:lower() == 'charges' then
  2961.         charges = 3
  2962.         ready = windower.ffxi.get_ability_recasts()[102]
  2963.         if ready ~= 0 then
  2964.             charges = math.floor(((30 - ready) / 10))
  2965.         end
  2966.         add_to_chat(28,'Ready Recast:'..ready..'   Charges Remaining:'..charges..'')
  2967.     end
  2968. end
  2969.  
  2970. function ready_move(cmdParams)
  2971.     local move = cmdParams[2]:lower()
  2972.     local ReadyMove = ''
  2973.     if move == 'one' then
  2974.         ReadyMove = ReadyMoveOne
  2975.     elseif move == 'two' then
  2976.         ReadyMove = ReadyMoveTwo
  2977.     elseif move == 'three' then
  2978.         ReadyMove = ReadyMoveThree
  2979.     else
  2980.         ReadyMove = ReadyMoveFour
  2981.     end
  2982.     send_command('input /pet "'.. ReadyMove ..'" <me>')
  2983. end
  2984.  
  2985. pet_tp = 0
  2986. --Fix missing Pet.TP field by getting the packets from the fields lib
  2987. packets = require('packets')
  2988. function update_pet_tp(id,data)
  2989.     if id == 0x068 then
  2990.         pet_tp = 0
  2991.         local update = packets.parse('incoming', data)
  2992.         pet_tp = update["Pet TP"]
  2993.         windower.send_command('lua c gearswap c pet_tp '..pet_tp)
  2994.     end
  2995. end
  2996. id = windower.raw_register_event('incoming chunk', update_pet_tp)
  2997.  
  2998. -------------------------------------------------------------------------------------------------------------------
  2999. -- Current Job State Display
  3000. -------------------------------------------------------------------------------------------------------------------
  3001.  
  3002. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  3003. function display_current_job_state(eventArgs)
  3004.     local msg = 'Melee'
  3005.    
  3006.     if state.CombatForm.has_value then
  3007.         msg = msg .. ' (' .. state.CombatForm.value .. ')'
  3008.     end
  3009.    
  3010.     msg = msg .. ': '
  3011.    
  3012.     msg = msg .. state.OffenseMode.value
  3013.     if state.HybridMode.value ~= 'Normal' then
  3014.         msg = msg .. '/' .. state.HybridMode.value
  3015.     end
  3016.     msg = msg .. ', WS: ' .. state.WeaponskillMode.value
  3017.    
  3018.     if state.DefenseMode.value ~= 'None' then
  3019.         msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
  3020.     end
  3021.    
  3022.     if state.Kiting.value then
  3023.         msg = msg .. ', Kiting'
  3024.     end
  3025.  
  3026.     msg = msg .. ', Corr.: '..state.CorrelationMode.value
  3027.  
  3028.     if state.JugMode.value ~= 'None' then
  3029.         add_to_chat(8,'-- Jug Pet: '.. PetName ..' -- (Pet Info: '.. PetInfo ..', '.. PetJob ..')')
  3030.     end
  3031.  
  3032.     add_to_chat(28,'Ready Moves: 1.'.. ReadyMoveOne ..'  2.'.. ReadyMoveTwo ..'  3.'.. ReadyMoveThree ..'  4.'.. ReadyMoveFour ..'')
  3033.     add_to_chat(122, msg)
  3034.  
  3035.     eventArgs.handled = true
  3036. end
  3037.  
  3038. -------------------------------------------------------------------------------------------------------------------
  3039. -- Utility functions specific to this job.
  3040. -------------------------------------------------------------------------------------------------------------------
  3041.  
  3042. function pet_info_update()
  3043.     if pet.isvalid then
  3044.         PetName = pet.name
  3045.  
  3046.         if pet.name == 'DroopyDortwin' or pet.name == 'PonderingPeter' or pet.name == 'HareFamiliar' or pet.name == 'KeenearedSteffi' then
  3047.             PetInfo = "Rabbit, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Foot Kick';ReadyMoveTwo = 'Whirl Claws';ReadyMoveThree = 'Wild Carrot';ReadyMoveFour = 'Dust Cloud'
  3048.         elseif pet.name == 'LuckyLulush' then
  3049.             PetInfo = "Rabbit, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Foot Kick';ReadyMoveTwo = 'Whirl Claws';ReadyMoveThree = 'Wild Carrot';ReadyMoveFour = 'Snow Cloud'
  3050.         elseif pet.name == 'SunburstMalfik' or pet.name == 'AgedAngus' or pet.name == 'HeraldHenry' or pet.name == 'CrabFamiliar' or pet.name == 'CourierCarrie' then
  3051.             PetInfo = "Crab, Aquan";PetJob = 'Paladin';ReadyMoveOne = 'Big Scissors';ReadyMoveTwo = 'Scissor Guard';ReadyMoveThree = 'Bubble Shower';ReadyMoveFour = 'Bubble Curtain'
  3052.         elseif pet.name == 'WarlikePatrick' or pet.name == 'LizardFamiliar' or pet.name == 'ColdbloodComo' or pet.name == 'AudaciousAnna' then
  3053.             PetInfo = "Lizard, Lizard";PetJob = 'Warrior';ReadyMoveOne = 'Tail Blow';ReadyMoveTwo = 'Brain Crush';ReadyMoveThree = 'Fireball';ReadyMoveFour = 'Blockhead'
  3054.         elseif pet.name == 'ScissorlegXerin' or pet.name == 'BouncingBertha' then
  3055.             PetInfo = "Chapuli, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Sensilla Blades';ReadyMoveTwo = 'Tegmina Buffet';ReadyMoveThree = 'Tegmina Buffet';ReadyMoveFour = 'Tegmina Buffet'
  3056.         elseif pet.name == 'RhymingShizuna' or pet.name == 'SheepFamiliar' or pet.name == 'LullabyMelodia' or pet.name == 'NurseryNazuna' then
  3057.             PetInfo = "Sheep, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Lamb Chop';ReadyMoveTwo = 'Rage';ReadyMoveThree = 'Sheep Song';ReadyMoveFour = 'Sheep Charge'
  3058.         elseif pet.name == 'AttentiveIbuki' or pet.name == 'SwoopingZhivago' then
  3059.             PetInfo = "Tulfaire, Bird";PetJob = 'Warrior';ReadyMoveOne = 'Swooping Frenzy';ReadyMoveTwo = 'Pentapeck';ReadyMoveThree = 'Molting Plumage';ReadyMoveFour = 'Molting Plumage'
  3060.         elseif pet.name == 'AmiableRoche' or pet.name == 'TurbidToloi' then
  3061.             PetInfo = "Pugil, Aquan";PetJob = 'Warrior';ReadyMoveOne = 'Recoil Dive';ReadyMoveTwo = 'Water Wall';ReadyMoveThree = 'Intimidate';ReadyMoveFour = 'Intimidate'
  3062.         elseif pet.name == 'BrainyWaluis' or pet.name == 'FunguarFamiliar' or pet.name == 'DiscreetLouise' then
  3063.             PetInfo = "Funguar, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Frogkick';ReadyMoveTwo = 'Spore';ReadyMoveThree = 'Silence Gas';ReadyMoveFour = 'Dark Spore'
  3064.         elseif pet.name == 'HeadbreakerKen' or pet.name == 'MayflyFamiliar' or pet.name == 'ShellbusterOrob' or pet.name == 'MailbusterCetas' then
  3065.             PetInfo = "Fly, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Somersault';ReadyMoveTwo = 'Cursed Sphere';ReadyMoveThree = 'Venom';ReadyMoveFour = 'Venom'
  3066.         elseif pet.name == 'RedolentCandi' or pet.name == 'AlluringHoney' then
  3067.             PetInfo = "Snapweed, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Tickling Tendrils';ReadyMoveTwo = 'Stink Bomb';ReadyMoveThree = 'Nectarous Deluge';ReadyMoveFour = 'Nepenthic Plunge'
  3068.         elseif pet.name == 'CaringKiyomaro' or pet.name == 'VivaciousVickie' then
  3069.             PetInfo = "Raaz, Beast";PetJob = 'Monk';ReadyMoveOne = 'Sweeping Gouge';ReadyMoveTwo = 'Zealous Snort';ReadyMoveThree = 'Zealous Snort';ReadyMoveFour = 'Zealous Snort'
  3070.         elseif pet.name == 'HurlerPercival' or pet.name == 'BeetleFamiliar' or pet.name == 'PanzerGalahad' then
  3071.             PetInfo = "Beetle, Vermin";PetJob = 'Paladin';ReadyMoveOne = 'Power Attack';ReadyMoveTwo = 'Rhino Attack';ReadyMoveThree = 'Hi-Freq Field';ReadyMoveFour = 'Rhino Guard'
  3072.         elseif pet.name == 'BlackbeardRandy' or pet.name == 'TigerFamiliar' or pet.name == 'SaberSiravarde' or pet.name == 'GorefangHobs' then
  3073.             PetInfo = "Tiger, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Razor Fang';ReadyMoveTwo = 'Claw Cyclone';ReadyMoveThree = 'Roar';ReadyMoveFour = 'Roar'
  3074.         elseif pet.name == 'ColibriFamiliar' or pet.name == 'ChoralLeera' then
  3075.             PetInfo = "Colibri, Bird";PetJob = 'Red Mage';ReadyMoveOne = 'Pecking Flurry';ReadyMoveTwo = 'Pecking Flurry';ReadyMoveThree = 'Pecking Flurry';ReadyMoveFour = 'Pecking Flurry'
  3076.         elseif pet.name == 'SpiderFamiliar' or pet.name == 'GussyHachirobe' then
  3077.             PetInfo = "Spider, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Sickle Slash';ReadyMoveTwo = 'Acid Spray';ReadyMoveThree = 'Spider Web';ReadyMoveFour = 'Spider Web'
  3078.         elseif pet.name == 'GenerousArthur' or pet.name == 'GooeyGerard' then
  3079.             PetInfo = "Slug, Amorph";PetJob = 'Warrior';ReadyMoveOne = 'Purulent Ooze';ReadyMoveTwo = 'Corrosive Ooze';ReadyMoveThree = 'Corrosive Ooze';ReadyMoveFour = 'Corrosive Ooze'
  3080.         elseif pet.name == 'ThreestarLynn' or pet.name == 'DipperYuly' then
  3081.             PetInfo = "Ladybug, Vermin";PetJob = 'Thief';ReadyMoveOne = 'Spiral Spin';ReadyMoveTwo = 'Sudden Lunge';ReadyMoveThree = 'Noisome Powder';ReadyMoveFour = 'Noisome Powder'
  3082.         elseif pet.name == 'SharpwitHermes' or pet.name == 'FlowerpotBill' or pet.name == 'FlowerpotBen' or pet.name == 'Homunculus' or pet.name == 'FlowerpotMerle' then
  3083.             PetInfo = "Mandragora, Plantoid";PetJob = 'Monk';ReadyMoveOne = 'Head Butt';ReadyMoveTwo = 'Leaf Dagger';ReadyMoveThree = 'Wild Oats';ReadyMoveFour = 'Scream'
  3084.         elseif pet.name == 'AcuexFamiliar' or pet.name == 'FluffyBredo' then
  3085.             PetInfo = "Acuex, Amorph";PetJob = 'Black Mage';ReadyMoveOne = 'Foul Waters';ReadyMoveTwo = 'Pestilent Plume';ReadyMoveThree = 'Pestilent Plume';ReadyMoveFour = 'Pestilent Plume'
  3086.         elseif pet.name == 'FlytrapFamiliar' or pet.name == 'VoraciousAudrey' or pet.name == 'PrestoJulio' then
  3087.             PetInfo = "Flytrap, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Soporific';ReadyMoveTwo = 'Palsy Pollen';ReadyMoveThree = 'Gloeosuccus';ReadyMoveFour = 'Gloeosuccus'
  3088.         elseif pet.name == 'EftFamiliar' or pet.name == 'AmbusherAllie' or pet.name == 'BugeyedBroncha' or pet.name == 'SuspiciousAlice' then
  3089.             PetInfo = "Eft, Lizard";PetJob = 'Warrior';ReadyMoveOne = 'Nimble Snap';ReadyMoveTwo = 'Cyclotail';ReadyMoveThree = 'Geist Wall';ReadyMoveFour = 'Numbing Noise'
  3090.         elseif pet.name == 'AntlionFamiliar' or pet.name == 'ChopsueyChucky' or pet.name == 'CursedAnnabelle' then
  3091.             PetInfo = "Antlion, Vermin";PetJob = 'Warrior';ReadyMoveOne = 'Mandibular Bite';ReadyMoveTwo = 'Venom Spray';ReadyMoveThree = 'Sandblast';ReadyMoveFour = 'Sandpit'
  3092.         elseif pet.name == 'MiteFamiliar' or pet.name == 'LifedrinkerLars' or pet.name == 'AnklebiterJedd' then
  3093.             PetInfo = "Diremite, Vermin";PetJob = 'Dark Knight';ReadyMoveOne = 'Double Claw';ReadyMoveTwo = 'Spinning Top';ReadyMoveThree = 'Filamented Hold';ReadyMoveFour = 'Grapple'
  3094.         elseif pet.name == 'AmigoSabotender' then
  3095.             PetInfo = "Cactuar, Plantoid";PetJob = 'Warrior';ReadyMoveOne = 'Needle Shot';ReadyMoveTwo = '??? Needles';ReadyMoveThree = '??? Needles';ReadyMoveFour = '??? Needles'
  3096.         elseif pet.name == 'CraftyClyvonne' then
  3097.             PetInfo = "Coeurl, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Blaster';ReadyMoveTwo = 'Chaotic Eye';ReadyMoveThree = 'Chaotic Eye';ReadyMoveFour = 'Chaotic Eye'
  3098.         elseif pet.name == 'BloodclawShasra' then
  3099.             PetInfo = "Lynx, Beast";PetJob = 'Warrior';ReadyMoveOne = 'Blaster';ReadyMoveTwo = 'Charged Whisker';ReadyMoveThree = 'Chaotic Eye';ReadyMoveFour = 'Chaotic Eye'
  3100.         elseif pet.name == 'SwiftSieghard' or pet.name == 'FleetReinhard' then
  3101.             PetInfo = "Raptor, Lizard";PetJob = 'Warrior';ReadyMoveOne = 'Scythe Tail';ReadyMoveTwo = 'Ripper Fang';ReadyMoveThree = 'Chomp Rush';ReadyMoveFour = 'Chomp Rush'
  3102.         elseif pet.name == 'DapperMac' or pet.name == 'SurgingStorm' or pet.name == 'SubmergedIyo' then
  3103.             PetInfo = "Apkallu, Bird";PetJob = 'Monk';ReadyMoveOne = 'Beak Lunge';ReadyMoveTwo = 'Wing Slap';ReadyMoveThree = 'Wing Slap';ReadyMoveFour = 'Wing Slap'
  3104.         elseif pet.name == 'FatsoFargann' then
  3105.             PetInfo = "Leech, Amorph";PetJob = 'Warrior';ReadyMoveOne = 'Suction';ReadyMoveTwo = 'Acid Mist';ReadyMoveThree = 'Drainkiss';ReadyMoveFour = 'TP Drainkiss'
  3106.         elseif pet.name == 'FaithfulFalcorr' then
  3107.             PetInfo = "Hippogryph, Bird";PetJob = 'Thief';ReadyMoveOne = 'Back Heel';ReadyMoveTwo = 'Choke Breath';ReadyMoveThree = 'Fantod';ReadyMoveFour = 'Jettatura'
  3108.         elseif pet.name == 'CrudeRaphie' then
  3109.             PetInfo = "Adamantoise, Lizard";PetJob = 'Paladin';ReadyMoveOne = 'Tortoise Stomp';ReadyMoveTwo = 'Harden Shell';ReadyMoveThree = 'Aqua Breath';ReadyMoveFour = 'Aqua Breath'
  3110.         elseif pet.name == 'MosquitoFamilia' or pet.name == 'Left-HandedYoko' then
  3111.             PetInfo = "Mosquito, Vermin";PetJob = 'Dark Knight';ReadyMoveOne = 'Infected Leech';ReadyMoveTwo = 'Gloom Spray';ReadyMoveThree = 'Gloom Spray';ReadyMoveFour = 'Gloom Spray'
  3112.         end
  3113.     else
  3114.         PetName = 'None';PetJob = 'None';PetInfo = 'None';ReadyMoveOne = 'None';ReadyMoveTwo = 'None';ReadyMoveThree = 'None';ReadyMoveFour = 'None'
  3115.     end
  3116. end
  3117.  
  3118. function pet_only_equip_handling()
  3119.     if player.status == 'Engaged' and state.AxeMode.value == 'PetOnly' then
  3120.         if pet.status == "Engaged" then
  3121.             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  3122.                 if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
  3123.                     equip(sets.PetPDTAxes)
  3124.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
  3125.                     equip(sets.PetMDTAxes)
  3126.                 elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
  3127.                     equip(sets.PDTAxes)
  3128.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
  3129.                     equip(sets.MDTAxes)
  3130.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
  3131.                     equip(sets.MEvaAxes)
  3132.                 else
  3133.                     equip(sets.PetTPAxes)
  3134.                 end
  3135.             else
  3136.                 if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
  3137.                     equip(sets.PetPDTAxeShield)
  3138.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
  3139.                     equip(sets.PetMDTAxeShield)
  3140.                 elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
  3141.                     equip(sets.PDTAxeShield)
  3142.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
  3143.                     equip(sets.MDTAxeShield)
  3144.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
  3145.                     equip(sets.MEvaAxeShield)
  3146.                 else
  3147.                     equip(sets.PetTPAxeShield)
  3148.                 end
  3149.             end
  3150.         end
  3151.         if pet.status ~= "Engaged" then
  3152.             if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  3153.                 if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
  3154.                     equip(sets.PetPDTAxes)
  3155.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
  3156.                     equip(sets.PetMDTAxes)
  3157.                 elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
  3158.                     equip(sets.PDTAxes)
  3159.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
  3160.                     equip(sets.MDTAxes)
  3161.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
  3162.                     equip(sets.MEvaAxes)
  3163.                 elseif state.IdleMode.value == "PetRegen" then
  3164.                     equip(sets.PetRegenAxes)
  3165.                 else
  3166.                     equip(sets.IdleAxes)
  3167.                 end
  3168.             else
  3169.                 if state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PetPDT" then
  3170.                     equip(sets.PetPDTAxeShield)
  3171.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "PetMDT" then
  3172.                     equip(sets.PetMDTAxeShield)
  3173.                 elseif state.DefenseMode.value == "Physical" and state.PhysicalDefenseMode.value == "PDT" then
  3174.                     equip(sets.PDTAxeShield)
  3175.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MDTShell" then
  3176.                     equip(sets.MDTAxeShield)
  3177.                 elseif state.DefenseMode.value == "Magical" and state.MagicalDefenseMode.value == "MEva" then
  3178.                     equip(sets.MEvaAxeShield)
  3179.                 elseif state.IdleMode.value == "PetRegen" then
  3180.                     equip(sets.PetRegenAxeShield)
  3181.                 else
  3182.                     equip(sets.IdleAxeShield)
  3183.                 end
  3184.             end
  3185.         end
  3186.     end
  3187.  
  3188.     handle_equipping_gear(player.status)
  3189. end
  3190.  
  3191. function pet_buff_timer(spell)
  3192.     if spell.english == 'Reward' then
  3193.         send_command('timers c "Pet: Regen" 180 down '..RewardRegenIcon..'')
  3194.     elseif spell.english == 'Spur' then
  3195.         send_command('timers c "Pet: Spur" 90 down '..SpurIcon..'')
  3196.     elseif spell.english == 'Run Wild' then
  3197.         send_command('timers c "'..spell.english..'" '..RunWildDuration..' down '..RunWildIcon..'')
  3198.     end
  3199. end
  3200.  
  3201. function clear_pet_buff_timers()
  3202.     send_command('timers c "Pet: Regen" 0 down '..RewardRegenIcon..'')
  3203.     send_command('timers c "Pet: Spur" 0 down '..SpurIcon..'')
  3204.     send_command('timers c "Run Wild" 0 down '..RunWildIcon..'')
  3205. end
  3206.  
  3207. function display_mode_info()
  3208.     if DisplayModeInfo == 'true' and DisplayTrue == 1 then
  3209.         local x = TextBoxX
  3210.         local y = TextBoxY
  3211.         send_command('text AccuracyText create Acc. Mode: '..state.OffenseMode.value..'')
  3212.         send_command('text AccuracyText pos '..x..' '..y..'')
  3213.         send_command('text AccuracyText size '..TextSize..'')
  3214.         y = y + (TextSize + 6)
  3215.         send_command('text CorrelationText create Corr. Mode: '..state.CorrelationMode.value..'')
  3216.         send_command('text CorrelationText pos '..x..' '..y..'')
  3217.         send_command('text CorrelationText size '..TextSize..'')
  3218.         y = y + (TextSize + 6)
  3219.         send_command('text AxeModeText create Axe Mode: '..state.AxeMode.value..'')
  3220.         send_command('text AxeModeText pos '..x..' '..y..'')
  3221.         send_command('text AxeModeText size '..TextSize..'')
  3222.         y = y + (TextSize + 6)
  3223.         send_command('text JugPetText create Jug Mode: '..state.JugMode.value..'')
  3224.         send_command('text JugPetText pos '..x..' '..y..'')
  3225.         send_command('text JugPetText size '..TextSize..'')
  3226.         DisplayTrue = DisplayTrue - 1
  3227.     end
  3228. end
  3229.  
  3230. function update_display_mode_info()
  3231.     if DisplayModeInfo == 'true' then
  3232.         send_command('text AccuracyText text Acc. Mode: '..state.OffenseMode.value..'')
  3233.         send_command('text CorrelationText text Corr. Mode: '..state.CorrelationMode.value..'')
  3234.         send_command('text AxeModeText text Axe Mode: '..state.AxeMode.value..'')
  3235.         send_command('text JugPetText text Jug Mode: '..state.JugMode.value..'')
  3236.     end
  3237. end
  3238.  
  3239. function checkblocking(spell)
  3240.     if buffactive.sleep or buffactive.petrification or buffactive.terror then
  3241.         add_to_chat(3,'Canceling Action - Asleep/Petrified/Terror!')
  3242.         cancel_spell()
  3243.         return
  3244.     end
  3245.     if spell.english == "Double-Up" then
  3246.         if not buffactive["Double-Up Chance"] then
  3247.             add_to_chat(3,'Canceling Action - No ability to Double Up')
  3248.             cancel_spell()
  3249.             return
  3250.         end
  3251.     end
  3252.     if spell.name ~= 'Ranged' and spell.type ~= 'WeaponSkill' and spell.type ~= 'Scholar' and spell.type ~= 'Monster' then
  3253.         if spell.action_type == 'Ability' then
  3254.             if buffactive.Amnesia then
  3255.                 cancel_spell()
  3256.                 add_to_chat(3,'Canceling Ability - Currently have Amnesia')
  3257.                 return
  3258.             else
  3259.                 recasttime = windower.ffxi.get_ability_recasts()[spell.recast_id]
  3260.                 if spell and (recasttime >= 1) then
  3261.                     add_to_chat(3,'Ability Canceled:'..spell.name..' - Waiting on Recast:(seconds) '..recasttime..'')
  3262.                     cancel_spell()
  3263.                     return
  3264.                 end
  3265.             end
  3266.         end
  3267.     end
  3268.     if spell.type == 'WeaponSkill' and player.tp < 1000 then
  3269.         cancel_spell()
  3270.         add_to_chat(3,'Canceled WS:'..spell.name..' - Current TP is less than 1000.')
  3271.         return
  3272.     end
  3273.     if spell.type == 'WeaponSkill' and buffactive.Amnesia then
  3274.         cancel_spell()
  3275.         add_to_chat(3,'Canceling Ability - Currently have Amnesia.')
  3276.         return   
  3277.     end
  3278.     if spell.name == 'Utsusemi: Ichi' and (buffactive['Copy Image (3)'] or buffactive ['Copy Image (4+)']) then
  3279.         cancel_spell()
  3280.         add_to_chat(3,'Canceling Utsusemi - Already have maximum shadows (3).')
  3281.         return
  3282.     end
  3283.     if spell.type == 'Monster' or spell.name == 'Reward' then
  3284.         if pet.isvalid then
  3285.             local s = windower.ffxi.get_mob_by_target('me')
  3286.             local pet = windower.ffxi.get_mob_by_target('pet')
  3287.             local PetMaxDistance = 4
  3288.             local pettargetdistance = PetMaxDistance + pet.model_size + s.model_size
  3289.             if pet.model_size > 1.6 then
  3290.                 pettargetdistance = PetMaxDistance + pet.model_size + s.model_size + 0.1
  3291.             end
  3292.             if pet.distance:sqrt() >= pettargetdistance then
  3293.                 --add_to_chat(3,'Canceling: '..spell.name..' - Outside valid JA Distance.')
  3294.                 cancel_spell()
  3295.                 return
  3296.             end
  3297.         else
  3298.             add_to_chat(3,'Canceling: '..spell.name..' - That action requires a pet.')
  3299.             cancel_spell()
  3300.             return
  3301.         end
  3302.     end
  3303.     if spell.name == 'Fight' then
  3304.         if pet.isvalid then
  3305.             local t = windower.ffxi.get_mob_by_target('t') or windower.ffxi.get_mob_by_target('st')
  3306.             local pet = windower.ffxi.get_mob_by_target('pet')
  3307.             local PetMaxDistance = 30
  3308.             local DistanceBetween = ((t.x - pet.x)*(t.x-pet.x) + (t.y-pet.y)*(t.y-pet.y)):sqrt()
  3309.             if DistanceBetween > PetMaxDistance then
  3310.                 --add_to_chat(3,'Canceling: Fight - Replacing with Heel since target is 30 yalms away from pet.')
  3311.                 cancel_spell()
  3312.                 send_command('@wait .5; input /pet Heel <me>')
  3313.                 return
  3314.             end
  3315.         end
  3316.     end
  3317. end
  3318.  
  3319. function get_melee_groups()
  3320.     classes.CustomMeleeGroups:clear()
  3321.  
  3322.     if buffactive['Aftermath: Lv.3'] then
  3323.         classes.CustomMeleeGroups:append('Aftermath')
  3324.     end
  3325. end
  3326.  
  3327. function get_combat_form()
  3328.     if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
  3329.         state.CombatForm:set('DW')
  3330.     else
  3331.         state.CombatForm:reset()
  3332.     end
  3333. end
  3334.  
  3335. -- Select default macro book on initial load or subjob change.
  3336. function select_default_macro_book()
  3337.     -- Default macro set/book
  3338.     if player.sub_job == 'WHM' then
  3339.         set_macro_page(1, 1)
  3340.     else
  3341.         set_macro_page(3, 1)
  3342.     end
  3343. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top