daily pastebin goal
78%
SHARE
TWEET

Untitled

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