SHARE
TWEET

NIN.lua

a guest Mar 16th, 2017 142 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Initialization function that defines sets and variables to be used.
  3. -------------------------------------------------------------------------------------------------------------------
  4. -- Haste II has the same buff ID [33], so we have to use a toggle.
  5. -- gs c toggle hastemode -- Toggles whether or not you're getting Haste II
  6. -- for Rune Fencer sub, you need to create two macros. One cycles runes, and gives you descrptive text in the log.
  7. -- The other macro will use the actual rune you cycled to.
  8. -- Macro #1 //console gs c cycle Runes
  9. -- Macro #2 //console gs c toggle UseRune
  10. function get_sets()
  11.     mote_include_version = 2
  12.     include('Mote-Include.lua')
  13.     include('organizer-lib')
  14.     require('vectors')
  15. end
  16.  
  17.  
  18. -- Setup vars that are user-independent.
  19. function job_setup()
  20.     state.Buff.Migawari = buffactive.migawari or false
  21.     state.Buff.Doomed = buffactive.doomed or false
  22.     state.Buff.Sange = buffactive.Sange or false
  23.     state.Buff.Yonin = buffactive.Yonin or false
  24.     state.Buff.Innin = buffactive.Innin or false
  25.     state.Buff.Futae = buffactive.Futae or false
  26.  
  27.     include('Mote-TreasureHunter')
  28.     state.TreasureMode:set('Tag')
  29.  
  30.     state.HasteMode = M{['description']='Haste Mode', 'Haste I', 'Haste II'}
  31.     state.MarchMode = M{['description']='March Mode', 'Trusts', '3', '7', 'Honor'}
  32.     state.Runes = M{['description']='Runes', "Ignis", "Gelus", "Flabra", "Tellus", "Sulpor", "Unda", "Lux", "Tenebrae"}
  33.     state.UseRune = M(false, 'Use Rune')
  34.     state.CapacityMode = M(false, 'Capacity Point Mantle')
  35.  
  36.     run_sj = player.sub_job == 'RUN' or false
  37.  
  38.     select_ammo()
  39.     LugraWSList = S{'Blade: Shun', 'Blade: Ku', 'Blade: Jin',}
  40.     wsList = S{'Blade: Hi', 'Blade: Metsu'}
  41.  
  42.     gear.RegularAmmo = 'Seki Shuriken'
  43.     gear.SangeAmmo = 'Happo Shuriken'
  44.     gear.MovementFeet = {name="Danzo Sune-ate"}
  45.     gear.DayFeet = "Danzo Sune-ate"
  46.     gear.NightFeet = "Hachiya Kyahan +3"
  47.     gear.AccAmmo = {name="Happo Shuriken"}
  48.     gear.AccAmmoDay = "Happo Shuriken"
  49.     gear.AccAmmoNight = "Happo Shuriken"
  50.     gear.ElementalObi = {name="Hachirin-no-Obi"}
  51.     gear.default.obi_waist = "Eschan Stone"
  52.    
  53.     update_combat_form()
  54.  
  55.     state.warned = M(false)
  56.     options.ammo_warning_limit = 25
  57.     -- For th_action_check():
  58.     -- JA IDs for actions that always have TH: Provoke, Animated Flourish
  59.     info.default_ja_ids = S{35, 204}
  60.     -- Unblinkable JA IDs for actions that always have TH: Quick/Box/Stutter Step, Desperate/Violent Flourish
  61.     info.default_u_ja_ids = S{201, 202, 203, 205, 207}
  62. end
  63.  
  64.  
  65. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  66. function user_setup()
  67.     windower.register_event('time change', time_change)
  68.     -- Options: Override default values
  69.     state.OffenseMode:options ('Normal', 'Acc', 'Acc2', 'Acc3')
  70.     state.RangedMode:options('Normal', 'Acc')
  71.     state.WeaponskillMode:options('Normal', 'Acc')
  72.     state.HybridMode:options('Normal', 'PDT')
  73.     state.CastingMode:options('Normal', 'Resistant')
  74.     state.IdleMode:options('Normal')
  75.     -- Defensive Sets
  76.     state.PhysicalDefenseMode:options('PDT')
  77.     state.MagicalDefenseMode:options('MDT')
  78.     -- Binds
  79.     send_command('bind ^= gs c cycle treasuremode')
  80.     send_command('bind ^[ input /lockstyle on')
  81.     send_command('bind ![ input /lockstyle off')
  82.     send_command('bind != gs c toggle CapacityMode')
  83.     send_command('bind !` gs c cycle HasteMode')
  84.     send_command('bind @` gs c cycle MarchMode')
  85.     send_command('bind @[ gs c cycle Runes')
  86.     send_command('bind ^] gs c toggle UseRune')
  87.     send_command('bind ` input /jump')
  88.    
  89.     select_movement_feet()
  90.     select_default_macro_book()
  91. end
  92.  
  93.  
  94. function file_unload()
  95.     send_command('unbind ^[')
  96.     send_command('unbind ![')
  97.     send_command('unbind ^=')
  98.     send_command('unbind !=')
  99.     send_command('unbind @f9')
  100.     send_command('unbind @[')
  101.     send_command('unbind `')
  102. end
  103.  
  104. -- Define sets and vars used by this job file.
  105. -- sets.engaged[state.CombatForm][state.CombatWeapon][state.OffenseMode][state.HybridMode][classes.CustomMeleeGroups (any number)
  106. -- Ninjutsu tips
  107. -- To stick Slow (Hojo) lower earth resist with Raiton: Ni
  108. -- To stick poison (Dokumori) or Attack down (Aisha) lower resist with Katon: Ni
  109. -- To stick paralyze (Jubaku) lower resistence with Huton: Ni
  110. function init_gear_sets()
  111.     --------------------------------------
  112.     -- Augments
  113.     --------------------------------------
  114.     Andartia = {}
  115.     Andartia.DEX = {name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}}
  116.     Andartia.AGI = {name="Andartia's Mantle", augments={'AGI+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}}
  117.     Andartia.STR = {name="Andartia's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%',}}
  118.     Andartia.INT = {name="Andartia's Mantle", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Fast Cast"+10',}}
  119.     Andartia.MEva = {name="Andartia's Mantle", augments={'INT+10','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10',}}
  120.    
  121.     --------------------------------------
  122.     -- Job Abilties
  123.     --------------------------------------
  124.     sets.precast.JA['Mijin Gakure'] = {legs="Mochizuki Hakama +1"}
  125.     sets.precast.JA['Futae'] = {hands="Iga Tekko +2"}
  126.     sets.precast.JA['Sange'] = {ammo="Happo Shuriken",legs="Mochizuki Chainmail +1"}
  127.     sets.precast.JA['Provoke'] = {ammo="",
  128.     head="",neck="Unmoving Collar",ear1="Trux Earring",ear2="Friomisi Earring",
  129.     body="Emet Harness +1",hands="Kurys Gloves",ring1="Petrov Ring",ring2="Begrudging Ring",
  130.     back="Agema Cape",waist="Chaac Belt",legs="Arjuna Breeches",feet="Mochizuki Kyahan +1"}
  131.    
  132.     sets.midcast.Flash = set_combine(sets.precast.JA['Provoke'], {ammo="Impatiens",head=gear.HerculeanHeadDT,waist="Hurch'lan Sash"})
  133.  
  134.     -- Waltz (chr and vit)
  135.     sets.precast.Waltz = {ammo="",
  136.         head="Whirlpool",neck="Tjukurrpa Medal",
  137.         body="Otronif Harness +1",hands="Buremte Gloves",
  138.         back="",waist="Caudata Belt",legs="Mochizuki Hakama +1",feet="Otronif Boots +1"}
  139.        
  140.     -- Don't need any special gear for Healing Waltz.
  141.     sets.precast.Waltz['Healing Waltz'] = {}
  142.    
  143.     -- Set for acc on steps, since Yonin drops acc a fair bit
  144.     sets.precast.Step = {ammo=gear.AccAmmo,
  145.         head="Dampening Tam",neck="Ej Necklace",ear1="Zennaroi Earring",ear2="Steelflash Earring",
  146.         body="Herculean Vest",hands="Ryuo Tekko",ring1="Patricius Ring",ring2="Ramuh Ring",
  147.         back=Andartia.Dex,waist="Olseni Belt",legs="Hizamaru Hizayoroi +1",feet="Hizamaru Sune-Ate +1"}
  148.        
  149.     sets.precast.Flourish1 = {waist="Chaac Belt"}
  150.    
  151.     sets.midcast["Apururu (UC)"] = {body="Apururu Unity shirt"}
  152.  
  153.     --------------------------------------
  154.     -- Utility Sets for rules below
  155.     --------------------------------------
  156.     sets.TreasureHunter = { waist="Chaac Belt" }
  157.     sets.CapacityMantle = { back="Mecistopins Mantle" }
  158.     sets.WSDayBonus     = { head="Gavialis Helm" }
  159.     sets.WSBack         = { back="Trepidity Mantle" }
  160.     sets.BrutalLugra    = { ear1="Cessance Earring", ear2="Lugra Earring +1" }
  161.     sets.BrutalTrux     = { ear1="Cessance Earring", ear2="Trux Earring" }
  162.     sets.BrutalMoon     = { ear1="Brutal Earring", ear2="Moonshade Earring" }
  163.     sets.IshvaraMoon    = { ear1="Ishvara Earring", ear2="Moonshade Earring" }
  164.     sets.LugraMoon      = { ear1="Lugra Earring +1", ear2="Moonshade Earring" }
  165.     sets.DualLugra      = { ear1="Lugra Earring",ear2="Lugra Earring +1" }
  166.     sets.IshvaraCessance= { ear1="Ishvara Earring", ear2="Cessance Earring" }
  167.    
  168.     sets.RegularAmmo    = { ammo=gear.RegularAmmo }
  169.     sets.SangeAmmo      = { ammo=gear.SangeAmmo }
  170.  
  171.     sets.NightAccAmmo   = { ammo="Ginsen" }
  172.     sets.DayAccAmmo     = { ammo="Tengu-no-Hane" }
  173.  
  174.     --------------------------------------
  175.     -- Ranged
  176.     --------------------------------------
  177.     -- Snapshot for ranged
  178.     sets.precast.RA = {hands="Manibozho Gloves",legs="Nahtirah Trousers",feet="Wurrukatte Boots"}
  179.    
  180.     sets.midcast.RA = {
  181.         head="Felistris Mask",neck="Ej Necklace",
  182.         body="Hachiya Chainmail +2",hands="Hachiya Tekko +2",ring1="Beeline Ring",
  183.         back="Yokaze Mantle",waist="Eschan Stone",legs="Nahtirah Trousers",feet=gear.HerculeanBootsTA}
  184.     sets.midcast.RA.Acc = set_combine(sets.midcast.RA, {
  185.         body="Mochizuki Chainmail +1"
  186.     })
  187.     sets.midcast.RA.TH = set_combine(sets.midcast.RA, set.TreasureHunter)
  188.  
  189.     ----------------------------------
  190.     -- Casting
  191.     ----------------------------------
  192.     sets.precast.FC = {ammo="Impatiens",
  193.     head=gear.HerculeanHelmMAB,neck="Orunmila's Torque",ear1="Loquacious Earring",ear2="Etiolation Earring",
  194.     body=gear.TaeonBodyFC,hands="Leyline Gloves",ring1="Prolix Ring",ring2="Weatherspoon Ring",
  195.     back=Andartia.INT,waist="Hurch'lan Sash",legs="Arjuna Breeches",feet="Mochizuki Kyahan +1",}
  196.     sets.precast.FC.ElementalNinjutsuSan = set_combine(sets.precast.FC, {feet="Mochizuki Kyahan +1"})
  197.     sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads",body="Mochizuki Chainmail +1",back=Andartia.INT,feet="Iga Kyahan +2"})
  198.    
  199.     -- Midcast Sets
  200.     sets.midcast.FastRecast = {
  201.         head="Herculean Helm",neck="Orunmila's Torque",ear2="Loquacious Earring",
  202.         body=gear.TaeonBodyFC,hands="Leyline Gloves",ring1="Prolix Ring",ring2="Weatherspoon Ring",
  203.         back=Andartia.INT,waist="Hurch'lan Sash",legs="Arjuna Breeches",feet=gear.HerculeanBootsTA}
  204.  
  205.     -- skill ++
  206.     sets.midcast.Ninjutsu = {
  207.         ammo="Pemphredo Tathlum",
  208.         head="Hachiya Hatsuburi +3",neck="Sanctity Necklace",ear1="Gwati Earring",ear2="Dignitary's Earring",
  209.         body="Samnuha Coat",hands=gear.HerculeanHandsMacc,ring1="Sangoma Ring",ring2="Weatherspoon Ring",
  210.         back=Andartia.INT,waist="Eschan Stone",legs=gear.HerculeanLegsMAB,feet="Hachiya Kyahan +3",
  211.     }
  212.    
  213.     -- any ninjutsu cast on self
  214.     sets.midcast.SelfNinjutsu = set_combine(sets.midcast.Ninjutsu, {
  215.     head=gear.HerculeanHelmMAB,neck="Orunmila's Torque",ear1="Loquacious Earring",ear2="Etiolation Earring",
  216.     body=gear.TaeonBodyFC,hands="Leyline Gloves",ring1="Prolix Ring",ring2="Weatherspoon Ring",
  217.     back="Andartia.INT",waist="Hurch'lan Sash",legs="Arjuna Breeches",feet="Taeon Boots"})
  218.     sets.midcast.Utsusemi = set_combine(sets.midcast.SelfNinjutsu, {ammo="Impatiens",back=Andartia.INT,feet="Iga Kyahan +2"})
  219.    
  220.     sets.midcast.Migawari = set_combine(sets.midcast.Ninjutsu, {
  221.         body="Hattori Ningi +1",
  222.         back=Andartia.INT,
  223.     })
  224.  
  225.     -- Nuking Ninjutsu (skill & magic attack)
  226.     sets.midcast.ElementalNinjutsu = {ammo="Pemphredo Tathlum",
  227.     head="Hachiya Hatusuburi +3",neck="Sanctity Necklace",ear1="Hecate's Earring",ear2="Friomisi Earring",
  228.     body="Samnuha Coat",hands="Leyline Gloves",ring1="Dingir Ring",ring2="Shiva Ring",
  229.     back=Andartia.INT,waist=gear.ElementalObi,legs=gear.HerculeanLegsMAB,feet="Hachiya Kyahan +3",}
  230.  
  231.     sets.midcast.ElementalNinjutsu.Burst = {ammo="Pemphredo Tathlum",
  232.     head="Hachiya Hatusuburi +3",neck="Sanctity Necklace",ear1="Hecate's Earring",ear2="Friomisi Earring",
  233.     body="Samnuha Coat",hands="Leyline Gloves",ring1="Locus Ring",ring2="Mujin Band",
  234.     back=Andartia.INT,waist=gear.ElementalObi,legs=gear.HerculeanLegsMAB,feet="Hachiya Kyahan +3",}
  235.    
  236.     sets.midcast.ElementalNinjutsu.Resistant = set_combine(sets.midcast.Ninjutsu, {head="Hachiya Hatsuburi +3",ear1="Gwati Earring",ear2="Dignitary's Earring",back=Andartia.INT,waist="Eschan Stone"})
  237.     sets.midcast.ElementalNinjutsuSan = set_combine(sets.midcast.ElementalNinjutsu, {head="Mochizuki Hatsuburi +1",})
  238.     sets.midcast.ElementalNinjutsuSan.Burst = {ring1="Locus Ring", ring2="Mujin Band",}
  239.     sets.midcast.ElementalNinjutsuSan.Resistant = set_combine(sets.midcast.ElementalNinjutsu.Resistant, {})
  240.  
  241.     -- Effusions
  242.     sets.precast.Effusion = {}
  243.     sets.precast.Effusion.Lunge = sets.midcast.ElementalNinjutsu
  244.     sets.precast.Effusion.Swipe = sets.midcast.ElementalNinjutsu
  245.  
  246.     ----------------------------------
  247.     -- Idle Sets
  248.     ----------------------------------
  249.     sets.idle = {ammo="Seki Shuriken",
  250.         head="Adhemar Bonnet",neck="Sanctity Necklace",ear1="Impregnable Earring",ear2="Etiolation Earring",
  251.         body="Hizamaru Haramaki +1",hands=gear.HerculeanHandsTA,ring1="Defending Ring",ring2="Paguroidea Ring",
  252.         back="Shadow Mantle",waist="Flume Belt",legs="Hachiya Hakama +2",feet=gear.MovementFeet}
  253.  
  254.     sets.idle.Town = {ammo="Seki Shuriken",
  255.         head="Adhemar Bonnet",neck="Sanctity Necklace",ear1="Impregnable Earring",ear2="Etiolation Earring",
  256.         body="Hizamaru Haramaki +1",hands=gear.HerculeanHandsTA,ring1="Defending Ring",ring2="Paguroidea Ring",
  257.         back="Shadow Mantle",waist="Flume Belt",legs="Hachiya Hakama +2",feet=gear.MovementFeet}
  258.    
  259.     sets.idle.Weak = sets.idle
  260.  
  261.     ----------------------------------
  262.     -- Defense sets
  263.     ----------------------------------
  264.     -- 51% PDT + Nullification(Mantle)
  265.     sets.defense.PDT = {ammo="Staunch Tathlum",
  266.         head=gear.HerculeanHeadDT,neck="Loricate Torque +1",ear1="Impregnable Earring",ear2="Handler's Earring +1",
  267.         body="Emet Harness +1",hands="Umuthi Gloves",ring1="Defending Ring",ring2="Dark Ring",
  268.         back="Shadow Mantle",waist="Flume Belt",legs=gear.HerculeanPantsDT,feet="Amm Greaves"}
  269.  
  270.     -- 37% MDT + Absorb + Nullification
  271.     sets.defense.MDT = {ammo="Staunch Tathlum",
  272.         head=gear.HerculeanHeadDT,neck="Loricate Torque +1",ear1="Eabani Earring",ear2="Etiolation Earring",
  273.         body="Emet Harness +1",hands="Umuthi Gloves",ring1="Defending Ring",ring2="Shadow Ring",
  274.         back="Engulfer Cape +1",waist="Flume Belt",legs=gear.HerculeanPantsDT,feet="Amm Greaves"}
  275.        
  276.     sets.MEva = {ammo="Staunch Tathlum",
  277.         head=gear.TaeonHeadMEva,neck="Warder's Charm +1",ear1="Eabani Earring",ear2="Flashward Earring",
  278.         body="Hizamaru Haramaki +1",hands="Leyline Gloves",ring1="Vengeful Ring",ring2="Purity Ring",
  279.         back=Andartia.MEva,waist="Flume Belt",legs="Gyve Trousers",feet="Amm Greaves"
  280.     }
  281.    
  282.     sets.Resist = set_combine(sets.MEva, {ear1="Hearty Earring",})
  283.     sets.Resist.Stun = set_combine(sets.MEva, {back="", body="",})
  284.    
  285.     sets.DayMovement = {feet="Danzo sune-ate"}
  286.     sets.NightMovement = {feet="Hachiya Kyahan +3"}
  287.  
  288.     ----------------------------------
  289.     -- Engaged Sets (No Haste)
  290.     ----------------------------------
  291.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  292.     -- sets if more refined versions aren't defined.
  293.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  294.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  295.  
  296.     -- Acc 1145/1120 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1186/1140 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  297.     -- DW Total in Gear: 37 DW
  298.     sets.engaged = {ammo="Seki Shuriken",
  299.         head="Ryuo Somen",neck="Ainia Collar",ear1="Suppanomimi",ear2="Cessance Earring",
  300.         body="Adhemar Jacket",hands="Floral Gauntlets",ring1="Petrov Ring",ring2="Epona's Ring",
  301.         back=Andartia.DEX,waist="Reiki Yotai",legs="Samnuha Tights",feet="Hizamaru Sune-Ate +1"}
  302.        
  303.     -- Acc Tier 1: 1166/1141 (Heishi/Ochu|Kikoku/Ochu) :: Acc 1207/1161 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  304.     -- DW Total in Gear: 37 DW
  305.     sets.engaged.Acc = set_combine(sets.engaged, {neck="Erudition Necklace",ear2="Zennaroi Earring"})
  306.  
  307.     -- Acc Tier 2: 1183/1158 (Heishi/Ochu|Kikoku/Ochu) :: Acc 1224/1178 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  308.     -- DW Total in Gear: 37 DW
  309.     sets.engaged.Acc2 = set_combine(sets.engaged.Acc, {ring1="Patricius Ring",legs="Hizamaru Hizayoroi +1"})
  310.    
  311.     -- Acc Tier 3: 1223/1198 (Heishi/Ochu|Kikoku/Ochu) :: Acc 1264/1218 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  312.     -- DW Total in Gear: 20 DW
  313.     sets.engaged.Acc3 = set_combine(sets.engaged.Acc2, {neck="Ej Necklace",ear1="Cessance Earring",hands="Ryuo Tekko",ring2="Ramuh Ring +1",waist="Olseni Belt"})
  314.    
  315.     sets.engaged.Innin     = sets.engaged
  316.     sets.engaged.Innin.Acc = sets.engaged.Acc
  317.     sets.engaged.Innin.Acc2 = sets.engaged.Acc2
  318.     sets.engaged.Innin.Acc3 = sets.engaged.Acc3
  319.  
  320.     ----------------------------------
  321.     -- Defensive Sets
  322.     ----------------------------------
  323.     --Flesh These "Hybrid" sets out?
  324.     sets.NormalPDT =  sets.engaged.PDT
  325.     sets.AccPDT =  sets.engaged.PDT
  326.     sets.engaged.PDT        = sets.defense.PDT
  327.     sets.engaged.Acc.PDT    = set_combine(sets.engaged.Acc, sets.defense.PDT)
  328.     sets.engaged.Acc2.PDT   = set_combine(sets.engaged.Acc2, sets.defense.PDT)
  329.     sets.engaged.Acc3.PDT   = set_combine(sets.engaged.Acc3, sets.defense.PDT)
  330.     sets.engaged.Innin.PDT  = set_combine(sets.engaged.Innin, sets.defense.PDT)
  331.     sets.engaged.Innin.Acc.PDT = sets.engaged.Acc.PDT
  332.     sets.engaged.Innin.Acc2.PDT = sets.engaged.Acc2.PDT
  333.     sets.engaged.Innin.Acc3.PDT = sets.engaged.Acc3.PDT
  334.     sets.engaged.HastePDT   = sets.defense.PDT
  335.  
  336.     ----------------------------------
  337.     -- MaxHaste Sets (0%DW Needed)
  338.     ----------------------------------
  339.     -- Acc 1084/1059 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1125/1079 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  340.     -- DW Total in Gear: 0 DW
  341.     sets.engaged.MaxHaste = {ammo="Seki Shuriken",
  342.         head="Adhemar Bonnet",neck="Iskur Gorget",ear1="Dedition Earring",ear2="Cessance Earring",
  343.         body=gear.HerculeanVestAcc,hands=gear.HerculeanHandsTA,ring1="Petrov Ring",ring2="Epona's Ring",
  344.         back=Andartia.DEX,waist="Windbuffet Belt +1",legs="Samnuha Tights",feet=gear.HerculeanBootsTA}
  345.        
  346.     -- Acc 1105/1080 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1146/1100 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  347.     -- DW Total in Gear: 0 DW
  348.     sets.engaged.Acc.MaxHaste = set_combine(sets.engaged.MaxHaste, {ammo="Seki Shuriken", neck="Erudition Necklace",ear1="Trux Earring",})
  349.    
  350.     -- Acc 1151/1126 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1192/1146 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  351.     -- DW Total in Gear: 5 DW
  352.     sets.engaged.Acc2.MaxHaste = set_combine(sets.engaged.Acc.MaxHaste, {head="Dampening Tam",ear1="Zennaroi Earring",ring1="Patricius Ring",body="Adhemar Jacket",})
  353.    
  354.     -- Acc 1211/1188 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1252/1208 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  355.     -- DW Total in Gear: 5 DW
  356.     sets.engaged.Acc3.MaxHaste = set_combine(sets.engaged.Acc2.MaxHaste, {neck="Ej Necklace",hands="Ryuo Tekko",ring2="Ramuh Ring +1",waist="Olseni Belt",legs="Hizamaru Hizayoroi +1"})
  357.    
  358.     sets.engaged.Innin.MaxHaste     = sets.engaged.MaxHaste
  359.     sets.engaged.Innin.Acc.MaxHaste = sets.engaged.Acc.MaxHaste
  360.     sets.engaged.Innin.Acc2.MaxHaste = sets.engaged.Acc2.MaxHaste
  361.     sets.engaged.Innin.Acc3.MaxHaste = sets.engaged.Acc3.MaxHaste
  362.  
  363.     -- Defensive sets
  364.     sets.engaged.PDT.MaxHaste       = set_combine(sets.engaged.MaxHaste, sets.engaged.HastePDT)
  365.     sets.engaged.Acc.PDT.MaxHaste   = set_combine(sets.engaged.Acc.MaxHaste, sets.engaged.HastePDT)
  366.     sets.engaged.Acc2.PDT.MaxHaste  = set_combine(sets.engaged.Acc2.MaxHaste, sets.engaged.HastePDT)
  367.     sets.engaged.Acc3.PDT.MaxHaste  = set_combine(sets.engaged.Acc3.MaxHaste, sets.AccPDT)
  368.     sets.engaged.Innin.PDT.MaxHaste = set_combine(sets.engaged.Innin.MaxHaste, sets.NormalPDT)
  369.     sets.engaged.Innin.Acc.PDT.MaxHaste = sets.engaged.Acc.PDT.MaxHaste
  370.     sets.engaged.Innin.Acc2.PDT.MaxHaste = sets.engaged.Acc2.PDT.MaxHaste
  371.     sets.engaged.Innin.Acc3.PDT.MaxHaste = sets.engaged.Acc3.PDT.MaxHaste
  372.  
  373.     ----------------------------------
  374.     -- 35% Haste (~10-12%DW Needed)
  375.     ----------------------------------
  376.     -- Acc 1095/1070 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1136/1099 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  377.     -- DW Total in Gear: 12 DW
  378.     sets.engaged.Haste_35 = set_combine(sets.engaged.MaxHaste, {waist="Reiki Yotai",ear1="Suppanomimi",})
  379.    
  380.     -- Acc 1127/1102 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1168/1122 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  381.     -- DW Total in Gear: 12 DW
  382.     sets.engaged.Acc.Haste_35 = set_combine(sets.engaged.Acc.MaxHaste, {body="Adhemar Jacket",waist="Reiki Yotai",ear1="Brutal Earring",})
  383.    
  384.     -- Acc 1159/1134 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1200/1154 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  385.     -- DW Total in Gear: 12 DW
  386.     sets.engaged.Acc2.Haste_35 = set_combine(sets.engaged.Acc2.MaxHaste, {waist="Reiki Yotai"})
  387.    
  388.     -- Acc 1217/1192 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1258/1212 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  389.     -- DW Total in Gear: 13 DW
  390.     sets.engaged.Acc3.Haste_35 = set_combine(sets.engaged.Acc3.MaxHaste, {head="Ryuo Somen"})
  391.  
  392.     sets.engaged.Innin.Haste_35     = sets.engaged.Haste_35
  393.     sets.engaged.Innin.Acc.Haste_35 = sets.engaged.Acc.Haste_35
  394.     sets.engaged.Innin.Acc2.Haste_35 = sets.engaged.Acc2.Haste_35
  395.     sets.engaged.Innin.Acc3.Haste_35 = sets.engaged.Acc3.Haste_35
  396.  
  397.     sets.engaged.PDT.Haste_35 = set_combine(sets.engaged.Haste_35, sets.engaged.HastePDT)
  398.     sets.engaged.Acc.PDT.Haste_35 = set_combine(sets.engaged.Acc.Haste_35, sets.engaged.HastePDT)
  399.     sets.engaged.Acc2.PDT.Haste_35 = set_combine(sets.engaged.Acc2.Haste_35, sets.engaged.HastePDT)
  400.     sets.engaged.Acc3.PDT.Haste_35 = set_combine(sets.engaged.Acc3.Haste_35, sets.engaged.AccPDT)
  401.  
  402.     sets.engaged.Innin.PDT.Haste_35 = set_combine(sets.engaged.Innin.Haste_35, sets.engaged.HastePDT)
  403.     sets.engaged.Innin.Acc.PDT.Haste_35 = sets.engaged.Acc.PDT.Haste_35
  404.     sets.engaged.Innin.Acc2.PDT.Haste_35 = sets.engaged.Acc2.PDT.Haste_35
  405.     sets.engaged.Innin.Acc3.PDT.Haste_35 = sets.engaged.Acc3.PDT.Haste_35
  406.  
  407.     ----------------------------------
  408.     -- 30% Haste (~21-22%DW Needed)
  409.     ----------------------------------
  410.     -- Acc  (Heishi/Ochu|Kikoku/Ochu)) :: Acc  (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  411.     -- DW Total in Gear: 20 DW
  412.     sets.engaged.Haste_30 = {ammo="Seki Shuriken",
  413.         head="Ryuo Somen",neck="Asperity Necklace",ear1="Brutal Earring",ear2="Cessance Earring",
  414.         body="Adhemar Jacket",hands=gear.HerculeanHandsTA,ring1="Petrov Ring",ring2="Epona's Ring",
  415.         back=Andartia.DEX,waist="Reiki Yotai",legs="Samnuha Tights",feet=gear.HerculeanBootsTA}
  416.    
  417.     -- +22 Acc
  418.     sets.engaged.Acc.Haste_30 = set_combine(sets.engaged.Haste_30, {neck="Ej Necklace",ring1="Patricius Ring"})
  419.    
  420.     -- +
  421.     sets.engaged.Acc2.Haste_30 = set_combine(sets.engaged.Acc.Haste_30, {hands="Ryuo Tekko",ear1="Zennaroi Earring",ring2="Ramuh Ring"})
  422.    
  423.     sets.engaged.Acc3.Haste_30 = set_combine(sets.engaged.Acc2.Haste_30, {waist="Olseni Belt",legs="Hizamaru Hizayoroi +1",feet="Hizamaru Sune-ate +1",})
  424.  
  425.     sets.engaged.Innin.Haste_30 = sets.engaged.Haste_30
  426.     sets.engaged.Innin.Acc.Haste_30 = sets.engaged.Acc.Haste_30
  427.     sets.engaged.Innin.Acc2.Haste_30 = sets.engaged.Acc2.Haste_30
  428.     sets.engaged.Innin.Acc3.Haste_30 = sets.engaged.Acc3.Haste_30
  429.  
  430.     sets.engaged.PDT.Haste_30 = set_combine(sets.engaged.Haste_30, sets.engaged.HastePDT)
  431.     sets.engaged.Acc.PDT.Haste_30 = set_combine(sets.engaged.Acc.Haste_30, sets.engaged.HastePDT)
  432.     sets.engaged.Acc2.PDT.Haste_30 = set_combine(sets.engaged.Acc2.Haste_30, sets.engaged.HastePDT)
  433.     sets.engaged.Acc3.PDT.Haste_30 = set_combine(sets.engaged.Acc3.Haste_30, sets.engaged.AccPDT)
  434.  
  435.     sets.engaged.Innin.PDT.Haste_30 = set_combine(sets.engaged.Innin.Haste_30, sets.engaged.HastePDT)
  436.     sets.engaged.Innin.Acc.PDT.Haste_30 = sets.engaged.Acc.PDT.Haste_30
  437.     sets.engaged.Innin.Acc2.PDT.Haste_30 = sets.engaged.Acc2.PDT.Haste_30
  438.     sets.engaged.Innin.Acc3.PDT.Haste_30 = sets.engaged.Acc3.PDT.Haste_30
  439.  
  440.  
  441.     ----------------------------------
  442.     -- 15% Haste (~32%DW Needed)
  443.     ----------------------------------
  444.     -- Acc 1145/1120 (Heishi/Ochu|Kikoku/Ochu)) :: Acc 1186/1140 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  445.     -- DW Total in Gear: 32 DW
  446.     sets.engaged.Haste_15 = {ammo="Seki Shuriken",
  447.         head="Ryuo Somen",neck="Asperity Necklace",ear1="Suppanomimi",ear2="Cessance Earring",
  448.         body="Adhemar Jacket",hands=gear.HerculeanHandsTA,ring1="Petrov Ring",ring2="Epona's Ring",
  449.         back=Andartia.DEX,waist="Reiki Yotai",legs="Samnuha Tights",feet="Hizamaru Sune-Ate +1"}
  450.        
  451.     -- Acc Tier 1: 1166/1141 (Heishi/Ochu|Kikoku/Ochu) :: Acc 1207/1161 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  452.     -- DW Total in Gear: 32 DW
  453.     sets.engaged.Acc.Haste_15 = set_combine(sets.engaged.Haste_15, {neck="Ej Necklace",ear2="Zennaroi Earring"})
  454.  
  455.     -- Acc Tier 2: 1183/1158 (Heishi/Ochu|Kikoku/Ochu) :: Acc 1224/1178 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  456.     -- DW Total in Gear: 32 DW
  457.     sets.engaged.Acc2.Haste_15 = set_combine(sets.engaged.Acc.Haste_15, {ring1="Patricius Ring",legs="Hizamaru Hizayoroi +1"})
  458.    
  459.     -- Acc Tier 3: 1223/1198 (Heishi/Ochu|Kikoku/Ochu) :: Acc 1264/1218 (Heishi/Shigi|Kikoku/Shigi) :: Acc ??? (Heishi/Kanaria)
  460.     -- DW Total in Gear: 20 DW
  461.     sets.engaged.Acc3.Haste_15 = set_combine(sets.engaged.Acc2.Haste_15, {ear1="Cessance Earring",hands="Ryuo Tekko",ring2="Ramuh Ring",waist="Olseni Belt"})
  462.    
  463.     sets.engaged.Innin.Haste_15 = sets.engaged.Haste_15
  464.     sets.engaged.Innin.Acc.Haste_15 = sets.engaged.Acc.Haste_15
  465.     sets.engaged.Innin.Acc2.Haste_15 = sets.engaged.Acc2.Haste_15
  466.     sets.engaged.Innin.Acc3.Haste_15 = sets.engaged.Acc3.Haste_15
  467.    
  468.     sets.engaged.PDT.Haste_15 = set_combine(sets.engaged.Haste_15, sets.engaged.HastePDT)
  469.     sets.engaged.Acc.PDT.Haste_15 = set_combine(sets.engaged.Acc.Haste_15, sets.engaged.HastePDT)
  470.     sets.engaged.Acc2.PDT.Haste_15 = set_combine(sets.engaged.Acc2.Haste_15, sets.engaged.HastePDT)
  471.     sets.engaged.Acc3.PDT.Haste_15 = set_combine(sets.engaged.Acc3.Haste_15, sets.engaged.AccPDT)
  472.    
  473.     sets.engaged.Innin.PDT.Haste_15 = set_combine(sets.engaged.Innin.Haste_15, sets.engaged.HastePDT)
  474.     sets.engaged.Innin.Acc.PDT.Haste_15 = sets.engaged.Acc.PDT.Haste_15
  475.     sets.engaged.Innin.Acc2.PDT.Haste_15 = sets.engaged.Acc2.PDT.Haste_15
  476.     sets.engaged.Innin.Acc3.PDT.Haste_15 = sets.engaged.Acc3.PDT.Haste_15
  477.    
  478.     sets.buff.Migawari = {body="Hattori Ningi +1"}
  479.    
  480.     ----------------------------------
  481.     -- Weaponskills (General)
  482.     ----------------------------------
  483.     sets.precast.WS = {ammo="Seething Bomblet +1",
  484.         head="Hachiya Hatsuburi +3",neck="Moepapa Medal",ear1="Brutal Earring",ear2="Cessance Earring",
  485.         body=gear.HerculeanVestAcc,hands="Ryuo Tekko",ring1="Petrov Ring",ring2="Epona's Ring",
  486.         back=Andartia.STR,waist="Windbuffet Belt +1",legs="Samnuha Tights",feet=gear.HerculeanBootsTA}
  487.    
  488.     sets.precast.WS.Acc = set_combine(sets.precast.WS, {})
  489.    
  490.     -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
  491.     sets.precast.WS['Blade: Hi'] = set_combine(sets.precast.WS, {ammo="Yetshila",
  492.     head="Hachiya Hatsuburi +3",neck="Fotia Gorget",ear1="Ishvara Earring",ear2="Moonshade Earring",
  493.     body=gear.HerculeanVestAcc,hands="Ryuo Tekko",ring1="Garuda Ring",ring2="Begrudging Ring",
  494.     back=Andartia.STR,waist="Windbuffet Belt +1",legs="Samnuha Tights",feet=gear.HerculeanBootsTA})
  495.     sets.precast.WS['Blade: Hi'].Acc = set_combine(sets.precast.WS['Blade: Hi'], {waist="Fotia Belt"})
  496.  
  497.     sets.precast.WS['Blade: Ten'] = set_combine(sets.precast.WS, {ammo="Seething Bomblet +1",
  498.     head="Hachiya Hatsuburi +3",neck="Caro Necklace",ear1="Ishvara Earring",ear2="Moonshade Earring",
  499.     body=gear.HerculeanBodyWS,hands=gear.HerculeanHandsWS,ring1="Apate Ring",ring2="Ilabrat Ring",
  500.     back=Andartia.STR,waist="Grunfeld Rope",legs="Hizamaru Hizayoroi +1",feet=gear.HerculeanFeetWS})
  501.     sets.precast.WS['Blade: Ku'] = set_combine(sets.precast.WS['Blade: Shun'], {})
  502.     sets.precast.WS['Blade: Jin'] = set_combine(sets.precast.WS, {ammo="Jukukik Feather",ring1="Ramuh Ring",back="Andartia's Mantle"})
  503.    
  504.     sets.precast.WS['Blade: Kamu'] = set_combine(sets.precast.WS['Blade: Ten'], {neck="Fotia Gorget",waist="Fotia Belt"})
  505.     sets.precast.WS['Blade: Kamu'].Acc = set_combine(sets.precast.WS['Blade: Kamu'], {waist="Fotia Belt"})
  506.  
  507.     sets.precast.WS['Blade: Metsu'] = set_combine(sets.precast.WS['Blade: Ten'], {ear1="Ishvara Earring",ear2="Cessance Earring",ring1="Ramuh Ring +1",ring2="Ilabrat Ring",ammo="Jukukik Feather",back=Andartia.DEX})
  508.     sets.precast.WS['Blade: Metsu'].Acc = set_combine(sets.precast.WS['Blade: Metsu'], {waist="Fotia Belt"})
  509.    
  510.     sets.precast.WS['Blade: Shun'] = set_combine(sets.precast.WS, {ammo="Seething Bomblet +1",
  511.     head="Adhemar Bonnet",neck="Fotia Gorget",ear1="Moonshade Earring",
  512.     body="Adhemar Jacket",hands="Adhemar Wristbands",ring1="Ramuh Ring +1",ring2="Ilabrat Ring",
  513.     back=Andartia.DEX,waist="Fotia Belt"})
  514.    
  515.     sets.precast.WS['Blade: Yu'] = {ammo="Pemphredo Tathlum",
  516.     head=gear.HerculeanHelmMAB,neck="Sanctity Necklace",ear1="Friomisi Earring",ear2="Hecate's Earring",
  517.     body="Samnuha Coat",hands="Leyline Gloves",ring1="Dingir Ring",ring2="Shiva Ring",
  518.     back=Andartia.INT,waist=gear.ElementalObi,legs=gear.HerculeanLegsMAB,feet=gear.HerculeanBootsMAB,}
  519.    
  520.     sets.precast.WS['Blade: To'] = sets.precast.WS['Blade: Yu']
  521.     sets.precast.WS['Blade: Teki'] = sets.precast.WS['Blade: Yu']
  522.    
  523.     sets.precast.WS['Aeolian Edge'] = {ammo="Pemphredo Tathlum",
  524.     head=gear.HerculeanHelmMAB,body="Samnuha Coat",hands="Leyline Gloves",legs=gear.HerculeanLegsMAB,
  525.     feet=gear.HerculeanBootsMAB,neck="Sanctity Necklace",waist=gear.ElementalObi,left_ear="Hecate's Earring",
  526.     right_ear="Friomisi Earring",left_ring="Dingir Ring",right_ring="Ramuh Ring",back=Andartia.DEX}
  527.  
  528. end
  529.  
  530.  
  531.  
  532. -------------------------------------------------------------------------------------------------------------------
  533. -- Job-specific hooks that are called to process player actions at specific points in time.
  534. -------------------------------------------------------------------------------------------------------------------
  535. function job_pretarget(spell, action, spellMap, eventArgs)
  536.     if state.Buff[spell.english] ~= nil then
  537.         state.Buff[spell.english] = true
  538.     end
  539.     if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then
  540.         cancel_spell()
  541.         send_command('input /item "Echo Drops" <me>')
  542.     end
  543. end
  544. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  545. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  546. function job_precast(spell, action, spellMap, eventArgs)
  547.     --if facing_away(spell) then
  548.         -- this removes Innin rule, if not behind enemy
  549.     --   state.CombatForm:reset()
  550.     --end
  551.     if spell.skill == "Ninjutsu" and spell.target.type:lower() == 'self' and spellMap ~= "Utsusemi" then
  552.         if spell.english == "Migawari" then
  553.             classes.CustomClass = "Migawari"
  554.         else
  555.             classes.CustomClass = "SelfNinjutsu"
  556.         end
  557.     end
  558.     if spell.name == 'Spectral Jig' and buffactive.sneak then
  559.         -- If sneak is active when using, cancel before completion
  560.         send_command('cancel 71')
  561.     end
  562.     if string.find(spell.english, 'Utsusemi') then
  563.         if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  564.             cancel_spell()
  565.             eventArgs.cancel = true
  566.             return
  567.         end
  568.     end
  569.  
  570. end
  571.  
  572. function job_post_precast(spell, action, spellMap, eventArgs)
  573.     -- Ranged Attacks
  574.     if spell.action_type == 'Ranged Attack' and state.OffenseMode ~= 'Acc' then
  575.         equip( sets.SangeAmmo )
  576.     end
  577.     -- protection for lag
  578.     if spell.name == 'Sange' and player.equipment.ammo == gear.RegularAmmo then
  579.         state.Buff.Sange = false
  580.         eventArgs.cancel = true
  581.     end
  582.     if spell.type == 'WeaponSkill' then
  583.         if spell.english == 'Aeolian Edge' and state.TreasureMode.value ~= 'None' then
  584.             equip(sets.TreasureHunter)
  585.         end
  586.         -- Mecistopins Mantle rule (if you kill with ws)
  587.         if state.CapacityMode.value then
  588.             equip(sets.CapacityMantle)
  589.         end
  590.         -- Gavialis Helm rule
  591.         --if is_sc_element_today(spell) then
  592.             --if state.OffenseMode.current == 'Normal' and wsList:contains(spell.english) then
  593.                 -- do nothing
  594.             --else
  595.             --    equip(sets.WSDayBonus)
  596.             --end
  597.         --end
  598.         -- Swap in special ammo for WS in high Acc mode
  599.         if state.OffenseMode.value == 'Acc' then
  600.             equip(select_ws_ammo())
  601.         end
  602.         -- Lugra Earring for some WS
  603.         if LugraWSList:contains(spell.english) then
  604.             if world.time >= (17*60) or world.time <= (7*60) then
  605.                 equip(sets.LugraMoon)
  606.             else
  607.                 equip(sets.BrutalMoon)
  608.             end
  609.         elseif spell.english == 'Blade: Hi' then
  610.             if world.time >= (17*60) or world.time <= (7*60) then
  611.                 equip(sets.IshvaraMoon)
  612.             else
  613.                 equip(sets.IshvaraMoon)
  614.             end
  615.         elseif spell.english == 'Blade: Ten' then
  616.             if world.time >= (17*60) or world.time <= (7*60) then
  617.                 equip(sets.LugraMoon)
  618.             else
  619.                 equip(sets.IshvaraMoon)
  620.             end
  621.         elseif spell.english == 'Blade: Metsu' then
  622.             if world.time >= (17*60) or world.time <= (7*60) then
  623.                 equip(sets.DualLugra)
  624.             else
  625.                 equip(sets.IshvaraCessance)
  626.             end
  627.         end
  628.     end
  629. end
  630.  
  631. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  632. function job_midcast(spell, action, spellMap, eventArgs)
  633.     if spell.english == "Monomi: Ichi" then
  634.         if buffactive['Sneak'] then
  635.             send_command('@wait 1.7;cancel sneak')
  636.         end
  637.     end
  638. end
  639.  
  640. -- Run after the general midcast() is done.
  641. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  642. function job_post_midcast(spell, action, spellMap, eventArgs)
  643.     --if state.TreasureMode.value ~= 'None' and spell.action_type == 'Ranged Attack' then
  644.     --    equip(sets.TreasureHunter)
  645.     --end
  646.    
  647. end
  648.  
  649.  
  650. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  651. function job_aftercast(spell, action, spellMap, eventArgs)
  652.     if midaction() then
  653.         return
  654.     end
  655.     -- Aftermath timer creation
  656.     aw_custom_aftermath_timers_aftercast(spell)
  657.     --if spell.type == 'WeaponSkill' then
  658. end
  659.  
  660. -------------------------------------------------------------------------------------------------------------------
  661. -- Customization hooks for idle and melee sets, after they've been automatically constructed.
  662. -------------------------------------------------------------------------------------------------------------------
  663.  
  664. -- Called before the Include starts constructing melee/idle/resting sets.
  665. -- Can customize state or custom melee class values at this point.
  666. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  667. function job_handle_equipping_gear(playerStatus, eventArgs)    
  668.     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
  669.         disable('back')
  670.     else
  671.         enable('back')
  672.     end
  673.     if player.equipment.ring1 == 'Warp Ring' or player.equipment.ring1 == 'Vocation Ring' or player.equipment.ring1 == 'Capacity Ring' or player.equipment.ring1 == 'Echad Ring' or player.equipment.ring1 == 'Trizek Ring' then
  674.         disable('ring1')
  675.     else
  676.         enable('ring1')
  677.     end
  678.     if player.equipment.ring2 == 'Warp Ring' or player.equipment.ring2 == 'Vocation Ring' or player.equipment.ring2 == 'Capacity Ring'  or player.equipment.ring2 == 'Echad Ring' or player.equipment.ring2 == 'Trizek Ring' then
  679.         disable('ring2')
  680.     else
  681.         enable('ring2')
  682.     end
  683. end
  684.  
  685. -- Modify the default idle set after it was constructed.
  686. function customize_idle_set(idleSet)
  687.     if player.hpp < 80 then
  688.         idleSet = set_combine(idleSet, sets.idle.Regen)
  689.     end
  690.     if state.HybridMode.value == 'PDT' then
  691.         if state.Buff.Migawari then
  692.             idleSet = set_combine(idleSet, sets.buff.Migawari)
  693.         else
  694.             idleSet = set_combine(idleSet, sets.defense.PDT)
  695.         end
  696.     else
  697.         idleSet = idleSet
  698.     end
  699.     return idleSet
  700. end
  701.  
  702. -- Modify the default melee set after it was constructed.
  703. function customize_melee_set(meleeSet)
  704.     if state.TreasureMode.value == 'Fulltime' then
  705.         meleeSet = set_combine(meleeSet, sets.TreasureHunter)
  706.     end
  707.     --if state.CapacityMode.value then
  708.     --    meleeSet = set_combine(meleeSet, sets.CapacityMantle)
  709.     --end
  710.     if state.Buff.Migawari and state.HybridMode.value == 'PDT' then
  711.         meleeSet = set_combine(meleeSet, sets.buff.Migawari)
  712.     end
  713.     if player.equipment.sub == 'empty' then
  714.         meleeSet = set_combine(meleeSet, sets.NoDW)
  715.     end
  716.     if player.mp < 100 and state.OffenseMode.value ~= 'Acc' then
  717.         -- use Rajas instead of Oneiros for normal + mid
  718.         meleeSet = set_combine(meleeSet, sets.Rajas)
  719.     end
  720.     meleeSet = set_combine(meleeSet, select_ammo())
  721.     return meleeSet
  722. end
  723.  
  724. -------------------------------------------------------------------------------------------------------------------
  725. -- General hooks for other events.
  726. -------------------------------------------------------------------------------------------------------------------
  727.  
  728. -- Called when a player gains or loses a buff.
  729. -- buff == buff gained or lost
  730. -- gain == true if the buff was gained, false if it was lost.
  731. function job_buff_change(buff, gain)
  732.     if state.Buff[buff] ~= nil then
  733.         if not midaction() then
  734.             handle_equipping_gear(player.status)
  735.         end
  736.     end
  737.  
  738.     if (buff == 'Innin' and gain or buffactive['Innin']) then
  739.         state.CombatForm:set('Innin')
  740.         if not midaction() then
  741.             handle_equipping_gear(player.status)
  742.         end
  743.     else
  744.         state.CombatForm:reset()
  745.         if not midaction() then
  746.             handle_equipping_gear(player.status)
  747.         end
  748.     end
  749.  
  750.     -- If we gain or lose any haste buffs, adjust which gear set we target.
  751.     if S{'haste', 'march', 'mighty guard', 'embrava', 'haste samba', 'geo-haste', 'indi-haste'}:contains(buff:lower()) then
  752.         determine_haste_group()
  753.         if not midaction() then
  754.             handle_equipping_gear(player.status)
  755.         end
  756.     end
  757.  
  758. end
  759.  
  760. function job_status_change(newStatus, oldStatus, eventArgs)
  761.     if newStatus == 'Engaged' then
  762.         update_combat_form()
  763.     end
  764. end
  765.  
  766. -------------------------------------------------------------------------------------------------------------------
  767. -- User code that supplements self-commands.
  768. -------------------------------------------------------------------------------------------------------------------
  769.  
  770. -- Called by the default 'update' self-command.
  771. function job_update(cmdParams, eventArgs)
  772.     select_ammo()
  773.     select_movement_feet()
  774.     determine_haste_group()
  775.     update_combat_form()
  776.     run_sj = player.sub_job == 'RUN' or false
  777.     --select_movement()
  778.     th_update(cmdParams, eventArgs)
  779. end
  780.  
  781. -------------------------------------------------------------------------------------------------------------------
  782. -- Facing ratio
  783. -------------------------------------------------------------------------------------------------------------------
  784. function facing_away(spell)
  785.     if spell.target.type == 'MONSTER' then
  786.         local dir = V{spell.target.x, spell.target.y} - V{player.x, player.y}
  787.         local heading = V{}.from_radian(player.facing)
  788.         local angle = V{}.angle(dir, heading):degree():abs()
  789.         if angle > 90 then
  790.             add_to_chat(8, 'Aborting... angle > 90')
  791.             return true
  792.         else
  793.             return false
  794.         end
  795.     end
  796. end
  797. -------------------------------------------------------------------------------------------------------------------
  798. -- Utility functions specific to this job.
  799. -------------------------------------------------------------------------------------------------------------------
  800.  
  801. -- State buff checks that will equip buff gear and mark the event as handled.
  802. function check_buff(buff_name, eventArgs)
  803.     if state.Buff[buff_name] then
  804.         equip(sets.buff[buff_name] or {})
  805.         if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
  806.             equip(sets.TreasureHunter)
  807.         end
  808.         eventArgs.handled = true
  809.     end
  810. end
  811. -- Check for various actions that we've specified in user code as being used with TH gear.
  812. -- This will only ever be called if TreasureMode is not 'None'.
  813. -- Category and Param are as specified in the action event packet.
  814. function th_action_check(category, param)
  815.     if category == 2 or -- any ranged attack
  816.         --category == 4 or -- any magic action
  817.         (category == 3 and param == 30) or -- Aeolian Edge
  818.         (category == 6 and info.default_ja_ids:contains(param)) or -- Provoke, Animated Flourish
  819.         (category == 14 and info.default_u_ja_ids:contains(param)) -- Quick/Box/Stutter Step, Desperate/Violent Flourish
  820.         then
  821.             return true
  822.     end
  823. end
  824.  
  825. function select_movement_feet()
  826.     if world.time >= (17*60) or world.time < (7*60) then
  827.         gear.MovementFeet.name = gear.NightFeet
  828.     else
  829.         gear.MovementFeet.name = gear.DayFeet
  830.     end
  831. end
  832.  
  833. function determine_haste_group()
  834.    
  835.     classes.CustomMeleeGroups:clear()
  836.     h = 0
  837.     -- Spell Haste 15/30
  838.     if buffactive[33] then
  839.         if state.HasteMode.value == 'Haste I' then
  840.             h = h + 15
  841.         elseif state.HasteMode.value == 'Haste II' then
  842.             h = h + 30
  843.         end
  844.     end
  845.     -- Geo Haste 30
  846.     if buffactive[580] then
  847.         h = h + 30
  848.     end
  849.     -- Mighty Guard 15
  850.     if buffactive[604] then
  851.         h = h + 15
  852.     end
  853.     -- Embrava 15
  854.     if buffactive.embrava then
  855.         h = h + 15
  856.     end
  857.     -- March(es)
  858.     if buffactive.march then
  859.         if state.MarchMode.value == 'Honor' then
  860.             if buffactive.march == 2 then
  861.                 h = h + 27 + 16
  862.             elseif buffactive.march == 1 then
  863.                 h = h + 16
  864.             elseif buffactive.march == 3 then
  865.                 h = h + 27 + 17 + 16
  866.             end
  867.         elseif state.MarchMode.value == 'Trusts' then
  868.             if buffactive.march == 2 then
  869.                 h = h + 26
  870.             elseif buffactive.march == 1 then
  871.                 h = h + 16
  872.             elseif buffactive.march == 3 then
  873.                 h = h + 27 + 17 + 16
  874.             end
  875.         elseif state.MarchMode.value == '7' then
  876.             if buffactive.march == 2 then
  877.                 h = h + 27 + 17
  878.             elseif buffactive.march == 1 then
  879.                 h = h + 27
  880.             elseif buffactive.march == 3 then
  881.                 h = h + 27 + 17 + 16
  882.             end
  883.         elseif state.MarchMode.value == '3' then
  884.             if buffactive.march == 2 then
  885.                 h = h + 13.5 + 20.6
  886.             elseif buffactive.march == 1 then
  887.                 h = h + 20.6
  888.             elseif buffactive.march == 3 then
  889.                 h = h + 27 + 17 + 16
  890.             end
  891.         end
  892.     end
  893.  
  894.     -- Determine CustomMeleeGroups
  895.     if h >= 15 and h < 30 then
  896.         classes.CustomMeleeGroups:append('Haste_15')
  897.         add_to_chat('Haste Group: 15% -- From Haste Total: '..h)
  898.     elseif h >= 30 and h < 35 then
  899.         classes.CustomMeleeGroups:append('Haste_30')
  900.         add_to_chat('Haste Group: 30% -- From Haste Total: '..h)
  901.     elseif h >= 35 and h < 40 then
  902.         classes.CustomMeleeGroups:append('Haste_35')
  903.         add_to_chat('Haste Group: 35% -- From Haste Total: '..h)
  904.     elseif h >= 40 then
  905.         classes.CustomMeleeGroups:append('MaxHaste')
  906.         add_to_chat('Haste Group: Max -- From Haste Total: '..h)
  907.     end
  908. end
  909.  
  910. -- Handle notifications of general user state change.
  911. function job_state_change(stateField, newValue, oldValue)
  912.     if stateField == 'Capacity Point Mantle' then
  913.         gear.Back = newValue
  914.     elseif stateField == 'Runes' then
  915.         local msg = ''
  916.         if newValue == 'Ignis' then
  917.             msg = msg .. 'Increasing resistence against ICE and deals FIRE damage.'
  918.         elseif newValue == 'Gelus' then
  919.             msg = msg .. 'Increasing resistence against WIND and deals ICE damage.'
  920.         elseif newValue == 'Flabra' then
  921.             msg = msg .. 'Increasing resistence against EARTH and deals WIND damage.'
  922.         elseif newValue == 'Tellus' then
  923.             msg = msg .. 'Increasing resistence against LIGHTNING and deals EARTH damage.'
  924.         elseif newValue == 'Sulpor' then
  925.             msg = msg .. 'Increasing resistence against WATER and deals LIGHTNING damage.'
  926.         elseif newValue == 'Unda' then
  927.             msg = msg .. 'Increasing resistence against FIRE and deals WATER damage.'
  928.         elseif newValue == 'Lux' then
  929.             msg = msg .. 'Increasing resistence against DARK and deals LIGHT damage.'
  930.         elseif newValue == 'Tenebrae' then
  931.             msg = msg .. 'Increasing resistence against LIGHT and deals DARK damage.'
  932.         end
  933.         add_to_chat(123, msg)
  934.     elseif stateField == 'Use Rune' then
  935.         send_command('@input /ja '..state.Runes.value..' <me>')
  936.     end
  937. end
  938.  
  939. --- Custom spell mapping.
  940. --function job_get_spell_map(spell, default_spell_map)
  941. --    if spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble' then
  942. --        return 'HighTierNuke'
  943. --    end
  944. --end
  945. -- Creating a custom spellMap, since Mote capitalized absorbs incorrectly
  946. function job_get_spell_map(spell, default_spell_map)
  947.     if spell.type == 'Trust' then
  948.         return 'Trust'
  949.     end
  950. end
  951.  
  952. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  953. function display_current_job_state(eventArgs)
  954.     local msg = ''
  955.     msg = msg .. 'Offense: '..state.OffenseMode.current
  956.    
  957.     if state.DefenseMode.value ~= 'None' then
  958.         local defMode = state[state.DefenseMode.value ..'DefenseMode'].current
  959.         msg = msg .. ', Defense: '..state.DefenseMode.value..' '..defMode
  960.     end
  961.     if state.HasteMode.value ~= 'Normal' then
  962.         msg = msg .. ', Haste: '..state.HasteMode.current
  963.     end
  964.     if state.MarchMode.value ~= 'Normal' then
  965.         msg = msg .. ', March Mode: '..state.MarchMode.current
  966.     end
  967.     if state.RangedMode.value ~= 'Normal' then
  968.         msg = msg .. ', Rng: '..state.RangedMode.current
  969.     end
  970.     if state.Kiting.value then
  971.         msg = msg .. ', Kiting'
  972.     end
  973.     if state.PCTargetMode.value ~= 'default' then
  974.         msg = msg .. ', Target PC: '..state.PCTargetMode.value
  975.     end
  976.     if state.SelectNPCTargets.value then
  977.         msg = msg .. ', Target NPCs'
  978.     end
  979.  
  980.     add_to_chat(123, msg)
  981.     eventArgs.handled = true
  982. end
  983.  
  984. -- Call from job_precast() to setup aftermath information for custom timers.
  985. function aw_custom_aftermath_timers_precast(spell)
  986.     if spell.type == 'WeaponSkill' then
  987.         info.aftermath = {}
  988.  
  989.         local empy_ws = "Blade: Hi"
  990.  
  991.         info.aftermath.weaponskill = empy_ws
  992.         info.aftermath.duration = 0
  993.  
  994.         info.aftermath.level = math.floor(player.tp / 1000)
  995.         if info.aftermath.level == 0 then
  996.             info.aftermath.level = 1
  997.         end
  998.  
  999.         if spell.english == empy_ws and player.equipment.main == 'Kannagi' then
  1000.             -- nothing can overwrite lvl 3
  1001.             if buffactive['Aftermath: Lv.3'] then
  1002.                 return
  1003.             end
  1004.             -- only lvl 3 can overwrite lvl 2
  1005.             if info.aftermath.level ~= 3 and buffactive['Aftermath: Lv.2'] then
  1006.                 return
  1007.             end
  1008.  
  1009.             -- duration is based on aftermath level
  1010.             info.aftermath.duration = 30 * info.aftermath.level
  1011.         end
  1012.     end
  1013. end
  1014.  
  1015. -- Call from job_aftercast() to create the custom aftermath timer.
  1016. function aw_custom_aftermath_timers_aftercast(spell)
  1017.     -- prevent gear being locked when it's currently impossible to cast
  1018.     if not spell.interrupted and spell.type == 'WeaponSkill' and
  1019.         info.aftermath and info.aftermath.weaponskill == spell.english and info.aftermath.duration > 0 then
  1020.  
  1021.         local aftermath_name = 'Aftermath: Lv.'..tostring(info.aftermath.level)
  1022.         send_command('timers d "Aftermath: Lv.1"')
  1023.         send_command('timers d "Aftermath: Lv.2"')
  1024.         send_command('timers d "Aftermath: Lv.3"')
  1025.         send_command('timers c "'..aftermath_name..'" '..tostring(info.aftermath.duration)..' down abilities/aftermath'..tostring(info.aftermath.level)..'.png')
  1026.  
  1027.         info.aftermath = {}
  1028.     end
  1029. end
  1030.  
  1031. function select_ammo()
  1032.     if state.Buff.Sange then
  1033.         return sets.SangeAmmo
  1034.     else
  1035.         return sets.RegularAmmo
  1036.     end
  1037. end
  1038.  
  1039. function select_ws_ammo()
  1040.     if world.time >= (18*60) or world.time <= (6*60) then
  1041.         gear.AccAmmo.name = gear.AccAmmoNight
  1042.         return sets.NightAccAmmo
  1043.     else
  1044.         gear.AccAmmo.name = gear.AccAmmoDay
  1045.         return sets.DayAccAmmo
  1046.     end
  1047. end
  1048. function update_combat_form()
  1049.     if state.Buff.Innin then
  1050.         state.CombatForm:set('Innin')
  1051.     else
  1052.         state.CombatForm:reset()
  1053.     end
  1054. end
  1055.  
  1056. -- Select default macro book on initial load or subjob change.
  1057. function select_default_macro_book()
  1058.     -- Default macro set/book
  1059.     if player.sub_job == 'DNC' then
  1060.         set_macro_page(4, 1)
  1061.     elseif player.sub_job == 'THF' then
  1062.         set_macro_page(4, 1)
  1063.     else
  1064.         set_macro_page(4, 1)
  1065.     end
  1066. 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