vm0d

vmod_BRD

Jun 16th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 36.03 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job.  Generally should not be modified.
  3. -- Modified JUL 01 2018
  4. -------------------------------------------------------------------------------------------------------------------
  5.  
  6. --[[
  7.     Custom commands:
  8.    
  9.     ExtraSongsMode may take one of three values: None, Dummy, FullLength
  10.    
  11.     You can set these via the standard 'set' and 'cycle' self-commands.  EG:
  12.     gs c cycle ExtraSongsMode
  13.     gs c set ExtraSongsMode Dummy
  14.    
  15.     The Dummy state will equip the bonus song instrument and ensure non-duration gear is equipped.
  16.     The FullLength state will simply equip the bonus song instrument on top of standard gear.
  17.    
  18.    
  19.     Simple macro to cast a dummy Daurdabla song:
  20.     /console gs c set ExtraSongsMode Dummy
  21.     /ma "Shining Fantasia" <me>
  22.    
  23.     To use a Terpander rather than Daurdabla, set the info.ExtraSongInstrument variable to
  24.     'Terpander', and info.ExtraSongs to 1.
  25. --]]
  26.  
  27. -- Initialization function for this job file.
  28. function get_sets()
  29.     mote_include_version = 2
  30.    
  31.     -- Load and initialize the include file.
  32.     include('Mote-Include.lua')
  33. end
  34.  
  35.  
  36. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  37. function job_setup()
  38.     state.Buff['Sleep'] = buffactive['Sleep'] or false
  39.     state.Buff['Pianissimo'] = buffactive['Pianissimo'] or false
  40.     state.Buff['Soul Voice'] = buffactive['Soul Voice'] or false
  41.     state.Buff['Clarion Call'] = buffactive['Clarion Call'] or false
  42.     state.Buff['Marcato'] = buffactive['Marcato'] or false
  43.     state.Buff['Nightingale'] = buffactive['Nightingale'] or false
  44.     state.Buff['Troubadour'] = buffactive['Troubadour'] or false
  45.     state.Buff['Tenuto'] = buffactive['Tenuto'] or false
  46.     state.Buff['Reive Mark'] = buffactive['Reive Mark'] or false
  47.  
  48.     -- For tracking current recast timers via the Timers plugin.
  49.     custom_timers = {}
  50.    
  51. end
  52.  
  53. -------------------------------------------------------------------------------------------------------------------
  54. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  55. -------------------------------------------------------------------------------------------------------------------
  56.  
  57. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  58. function user_setup()
  59.     state.ExtraSongsMode = M{['description']='Extra Songs', 'None', 'Dummy', 'FullLength'}
  60.     state.OffenseMode:options('None', 'Normal', 'Acc')
  61.     state.CastingMode:options('Normal', 'Resistant')
  62.  
  63.     brd_daggers = S{'Mandau', 'Izhiikoh', 'Vanir Knife', 'Atoyac', 'Sabebus', 'Carnwenhan'}
  64.     pick_tp_weapon()
  65.  
  66.     select_default_macro_book()
  67.  
  68.     -- Gear Definitions
  69.     gear.DarkRing = {name="Dark Ring"}
  70.     gear.Reive = {name="Ygnas's Resolve +1"}
  71.     gear.JPcape = {name="Mecistopins Mantle"}
  72.     gear.HasteBelt = {name="Sailfi Belt +1"}
  73.    
  74.     -- Melee Set, for the battlebrd
  75.     gear.MeleeHead = {name="Lithelimb Cap"}
  76.     gear.MeleeBody = {name="Bihu Justaucorps +1"}
  77.     gear.MeleeHands = {name="Buremte Gloves"}
  78.     gear.MeleeLegs = {name="Telchine Braconi"}
  79.     gear.MeleeFeet = {name="Battlecast Gaiters"}
  80.    
  81.     -- Artifact set
  82.     -- For most BRD, only feet are necessary
  83.     -- Artifact Head has M.Acc, Paeon +1
  84.     gear.AFHead = {name="Brioso Roundlet +1"}
  85.     -- Artifact Body has M.Acc
  86.     gear.AFBody = {name="Brioso Justaucorps +1"}
  87.     -- Artifact Hands have M.Acc, Lullaby +1
  88.     gear.AFHands = {name="Brioso Cuffs +1"}
  89.     -- Artifact Legs have M.Acc
  90.     gear.AFLegs = {name="Brioso Cannions +1"}
  91.     -- Artifact Feet have M.Acc, increased song duration
  92.     gear.AFFeet = {name="Brioso Slippers +1"}
  93.    
  94.     -- Relic set
  95.     -- For most BRD, only body, legs, feet are necessary
  96.     -- Relic Head has PDT, M.Acc, Aug: Foe Sirvente
  97.     gear.RHead = {name="Bihu Roundlet +1"}
  98.     -- Relic Body has PDT, melee stats, Aug: Troubador
  99.     gear.RBody = {name="Bihu Justaucorps +1"}
  100.     -- Relic Hands have PDT, M.Acc, Aug: Adventurer's Dirge
  101.     gear.RHands = {name="Bihu Cuffs +1"}
  102.     -- Relic Legs have PDT, M.Acc, Aug: Soul Voice
  103.     gear.RLegs = {name="Bihu Cannions +1"}
  104.     -- Relic Feet have PDT, Precast song cast, Aug: Nightingale
  105.     gear.RFeet = {name="Bihu Slippers +1"}
  106.  
  107.     -- Empyrean set
  108.     -- Empyrean set has a unique set bonus which applies with as little as 2 pieces.
  109.     -- This entire set should be acquired and +2.
  110.     -- Empyrean Head is for Precast song cast, Madrigal +1
  111.     gear.EmpHead = {name="Fili Calot +1"}
  112.     -- Empyrean Body is for increased song duration, Minuet +1
  113.     gear.EmpBody = {name="Fili Hongreline +1"}
  114.     -- Empyrean Hands are for March +1
  115.     gear.EmpHands = {name="Fili Manchettes +1"}
  116.     -- Empyrean Legs are for song recast, Ballad +1
  117.     gear.EmpLegs = {name="Fili Rhingrave +1"}
  118.     -- Empyrean Feet are for movement+12%, auto-regen, Scherzo +1
  119.     gear.EmpFeet = {name="Fili Cothurnes +1"}
  120.  
  121.     -- Gendewitha Set
  122.     -- This entire set should be acquired and aug for DT, either NQ or +1
  123.     -- Gendewitha head is for DT, Cure potency
  124.     gear.GHead = {name="Gendewitha Caubeen +1"}
  125.     -- Gendewitha body is for DT
  126.     gear.GBody = {name="Gendewitha Bliaut +1"}
  127.     -- Gendewitha hands is for DT, Precast fast cast, Midcast recast
  128.     -- Best aug is Song Casting-5, for Precast song cast
  129.     gear.GHands = {name="Gendewitha Gages +1"}
  130.     -- Gendewitha legs is for DT, Precast song cast
  131.     -- Best aug is Song Casting-5, for Precast song cast
  132.     gear.GLegs = {name="Gendewitha Spats +1"}
  133.     -- Gendewitha feet is for DT, cursna
  134.     gear.GFeet = {name="Gendewitha Galoshes +1"}
  135.  
  136.     -- Telchine set
  137.     -- Many augs are available for this set, multiple sets are an option
  138.     -- This set assumes max Fast Cast and Enhancing duration augs on all pieces
  139.     -- Telchine head is for M.Acc
  140.     gear.THeadEnh = {name="Telchine Cap", augments={'Enh. Mag. eff. dur. +10'}}
  141.     -- Telchine body is for Enhancing skill+12, Regen duration +12
  142.     gear.TBodyEnh = {name="Telchine Chasuble", augments={'Enh. Mag. eff. dur. +10'}}
  143.     -- Telchine hands is for cure potency
  144.     gear.THandsEnh = {name="Telchine Gloves", augments={'Enh. Mag. eff. dur. +10'}}
  145.     -- Telchine legs is for MAB+15, DA+3
  146.     gear.TLegsEnh = {name="Telchine Braconi", augments={'Enh. Mag. eff. dur. +10'}}
  147.     -- Telchine feet is for precast song cast
  148.     gear.TFeetEnh = {name="Telchine Pigaches", augments={'Enh. Mag. eff. dur. +10'}}
  149.  
  150.     -- Vanya set
  151.     -- Vanya head is for conserve mp, cure pot, mdt-
  152.     -- Path D aug for precast fc and haste
  153.     gear.VHead = {name="Vanya Hood"}
  154.     -- Vanya body is for m.acc, divine skill, enfeebling skill, dt-
  155.     gear.VBody = {name="Vanya Robe"}
  156.     -- Vanya hands is for singing skill
  157.     gear.VHands = {name="Vanya Cuffs"}
  158.     -- Vanya legs is for m.acc, conserve mp
  159.     gear.VLegs = {name="Vanya Slops"}
  160.     -- Vanya feet is for healing skill, cure pot, cursna
  161.     gear.VFeet = {name="Vanya Clogs"}
  162.  
  163.     -- Chironic set
  164.     -- Chironic head is for acc, mdt, aquaveil
  165.     gear.CHead = {name="Chironic Hat"}
  166.     -- Chironic body is for
  167.     --gear.CBody = {name="Chironic"}
  168.     -- Chironic hands is for acc, mab, enhancing skill, enm-, spell interruption-
  169.     gear.CHands = {name="Chironic Gloves"}
  170.     -- Chironic legs is for enfeebling skill, cure pot, immunobreak
  171.     gear.CLegs = {name="Chironic Hose"}
  172.     -- Chironic feet is for atk, mab, divine skill, enm-, pdt
  173.     gear.CFeet = {name="Chironic Slippers"}
  174.  
  175.     -- Kaykaus set
  176.     -- Kaykaus head is for m.acc, healing skill, cure pot, mdt
  177.     gear.KHead = {name="Kaykaus Mitra"}
  178.     -- Kaykaus body is for acc, m.acc, refresh, cure potII
  179.     gear.KBody = {name="Kaykaus Briault"}
  180.     -- Kaykaus hands is for m.acc, enfeebling skill, enm-, cure pot
  181.     gear.KHands = {name="Kaykaus Cuffs"}
  182.     -- Kaykaus legs is for m.atk, divine skill, fc, cure pot
  183.     gear.KLegs = {name="Kaykaus Tights"}
  184.     -- Kaykaus feet is for enhancing skill, enm-, conserve mp, cure pot
  185.     gear.KFeet = {name="Kaykaus Boots"}
  186.  
  187.     -- Ayanmo set
  188.     -- Ayanmo head is for
  189.     gear.AyaHead = {name="Ayanmo Zucchetto +1"}
  190.     -- Ayanmo body is for
  191.     gear.AyaBody = {name="Ayanmo Corazza +1"}
  192.     -- Ayanmo hands is for
  193.     gear.AyaHands = {name="Ayanmo Manopolas +1"}
  194.     -- Ayanmo legs is for precast fc and haste
  195.     gear.AyaLegs = {name="Ayanmo Cosciales +2"}
  196.     -- Ayanmo feet is for
  197.     gear.AyaFeet = {name="Ayanmo Gambieras +1"}
  198.  
  199.     -- Inyanga set
  200.     -- Inyanga head is for
  201.     --gear.IHead = {name="Inyanga +2"}
  202.     -- Inyanga body is for precast precast fc and haste
  203.     gear.IBody = {name="Inyanga Jubbah +2"}
  204.     -- Inyanga hands is for
  205.     --gear.IHands = {name="Inyanga +2"}
  206.     -- Inyanga legs is for song duration, mdt-
  207.     gear.ILegs = {name="Inyanga Shalwar +2"}
  208.     -- Inyanga feet is for
  209.     --gear.IFeet = {name="Inyanga +2"}
  210.  
  211.     -- Adjust this if using the Terpander (new +song instrument)
  212.     info.ExtraSongInstrument = 'Daurdabla'
  213.     -- How many extra songs we can keep from Daurdabla/Terpander
  214.     info.ExtraSongs = 2
  215.    
  216.     -- Set this to false if you don't want to use custom timers.
  217.     state.UseCustomTimers = M(true, 'Use Custom Timers')
  218.    
  219.     -- Additional local binds
  220.     -- F10, F11, F12 are occupied by default as follows:
  221.     -- f10 reset DefenseMode
  222.     -- ^f10 DefenseMode Physical
  223.     -- !f10 DefenseMode Magical
  224.     -- f11 toggle CP
  225.     -- ^f11 toggle Kiting
  226.     -- f11 EquipStop
  227.     -- f12 update user
  228.     -- ^f12 IdleMode
  229.     send_command('bind ^` input /ma "Chocobo Mazurka" <me>')
  230.     send_command('bind f9 gs c cycle ExtraSongsMode')
  231.     send_command('bind ^f9 gs c cycle CastingMode')
  232.     send_command('bind !f9 gs c cycle OffenseMode')
  233. end
  234.  
  235.  
  236. -- Called when this job file is unloaded (eg: job change)
  237. function user_unload()
  238.     send_command('unbind ^`')
  239. end
  240.  
  241.  
  242. -- Define sets and vars used by this job file.
  243. function init_gear_sets()
  244.     --------------------------------------
  245.     -- Special sets (required by rules)
  246.     --------------------------------------
  247.  
  248.     -- Globally defined sets
  249.     sets.Kiting = {feet=gear.EmpFeet}
  250.     sets.CP = {back=gear.JPcape}
  251.  
  252.     -- vm0d's Custom Sets
  253.     -- Sets to augment the Idle set
  254.     sets.latent_refresh = {waist="Fucho-no-obi"}
  255.     sets.DayRefresh = {head=none,body="Respite Cloak",legs="Assiduity Pants +1",feet="Serpentes Sabots"}
  256.     sets.NightRefresh = {head=none,body="Respite Cloak",legs="Assiduity Pants +1",hands="Serpentes Cuffs"}
  257.     sets.ExtraRegen = {neck="Wiglen Gorget",ring1="Sheltered Ring",ring2="Paguroidea Ring"}
  258.     sets.ExtraRefresh = {head=none,body="Respite Cloak",legs="Assiduity Pants +1"}
  259.     sets.Sanction = {ring1="Balrahn's Ring"}
  260.     sets.Roll = {ring1="Roller's Ring"}
  261.     sets.poison = {back="Taster's Cape"}
  262.     sets.Aries = {back="Aries Mantle"}
  263.     sets.ProSh = {ring1="Sheltered Ring"}
  264.     -- Sets that augment various sets
  265.     sets.Moonshade = {ear2="Moonshade Earring"}
  266.  
  267.     -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  268.     sets.buff['Reive Mark'] = {neck=gear.Reive}
  269.  
  270.  
  271.     --------------------------------------
  272.     -- Precast sets
  273.     --------------------------------------
  274.  
  275.     -- Fast cast sets for spells
  276.     sets.precast.FC = {main="Kali",sub="Genbu's Shield",
  277.         head=gear.VHead,neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
  278.         body=gear.IBody,hands=gear.GHands,ring1="Kishar Ring",ring2="Veneficium Ring",
  279.         back="Perimede Cape",waist="Witful Belt",legs=gear.AyaLegs,feet=gear.TFeetEnh}
  280.  
  281.     sets.precast.FC.BardSong = set_combine(sets.precast.FC, {head=gear.EmpHead,legs=gear.GLegs})
  282.  
  283.     sets.precast.FC.Daurdabla = set_combine(sets.precast.FC.BardSong, {range=info.ExtraSongInstrument})
  284.  
  285.     sets.precast.FC.Cure = set_combine(sets.precast.FC, {})
  286.  
  287.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  288.  
  289.     sets.precast.FC.Stoneskin = set_combine(sets.precast.FC, {head="Umuthi Hat",waist="Siegel Sash"})
  290.  
  291.  
  292.     -- Precast sets to enhance JAs
  293.  
  294.     sets.precast.JA.Nightingale = {feet=gear.RFeet}
  295.     sets.precast.JA.Troubadour = {body=gear.RBody}
  296.     sets.precast.JA['Soul Voice'] = {legs=gear.RLegs}
  297.  
  298.     -- Waltz set (chr and vit)
  299.     sets.precast.Waltz = {
  300.         head=gear.GHead,
  301.         body=gear.GBody,hands=gear.GHands,
  302.         legs=gear.GLegs,feet=gear.GFeet}
  303.  
  304.  
  305.     -- Weaponskill sets
  306.     -- Default set for any weaponskill that isn't any more specifically defined
  307.     sets.precast.WS = {
  308.         head=gear.MeleeHead,neck="Fotia Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  309.         body=gear.MeleeBody,hands=gear.MeleeHands,ring1="Rajas Ring",ring2="Petrov Ring",
  310.         back="Grounded Mantle +1",waist="Fotia Belt",legs=gear.MeleeLegs,feet=gear.MeleeFeet}
  311.  
  312.     -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
  313.     sets.precast.WS['Aeolian Edge'] = {
  314.         head="Highwing Helm",neck="Fotia Gorget",ear1="Friomisi Earring",ear2="Novio Earring",
  315.         body=gear.TBodyEnh,hands="Buremte Gloves",ring1="Rajas Ring",ring2="Arvina Ringlet +1",
  316.         back="Toro Cape",waist="Fotia Belt",legs=gear.TLegsEnh,feet=gear.TFeetEnh}
  317.  
  318.  
  319.     --------------------------------------
  320.     -- Midcast Sets
  321.     --------------------------------------
  322.  
  323.     -- General set for recast times.
  324.     sets.midcast.FastRecast = {main="Kali",sub="Genbu's Shield",range="Angel Lyre",
  325.         head=gear.THeadEnh,neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
  326.         body=gear.TBodyEnh,hands=gear.THandsEnh,ring1="Kishar Ring",ring2="Prolix Ring",
  327.         back="Swith Cape +1",waist=gear.HasteBelt,legs=gear.TLegsEnh,feet=gear.TFeetEnh}
  328.        
  329.     -- Gear to enhance certain classes of songs.  No instruments added here since Gjallarhorn is being used.
  330.     sets.midcast.Ballad = {legs=gear.EmpLegs}
  331.     sets.midcast.Lullaby = {hands=gear.AFHands}
  332.     sets.midcast.Madrigal = {head=gear.EmpHead,back="Intarabus's Cape"}
  333.     sets.midcast.Prelude = {back="Intarabus's Cape"}
  334.     sets.midcast.March = {hands=gear.EmpHands}
  335.     sets.midcast.Minuet = {body=gear.EmpBody}
  336.     --sets.midcast.Minne = {}
  337.     --sets.midcast.Mambo = {}
  338.     sets.midcast.Paeon = {head=gear.AFHead}
  339.     sets.midcast.Carol = {head=gear.EmpHead,body=gear.EmpBody,hands=gear.EmpHands}
  340.     sets.midcast["Sentinel's Scherzo"] = {feet=gear.EmpFeet}
  341.     --sets.midcast.Threnody = {}
  342.     sets.midcast['Magic Finale'] = {legs=gear.EmpLegs}
  343.     sets.midcast['Foe Sirvente'] = {head=gear.RHead}
  344.     sets.midcast["Adventurer's Dirge"] = {hands=gear.RHands}
  345.  
  346.     --sets.midcast.Mazurka = {range=info.ExtraSongInstrument}
  347.  
  348.  
  349.     -- For song buffs (duration and AF3 set bonus)
  350.     sets.midcast.SongEffect = set_combine(sets.midcast.FastRecast, {main="Kali",sub="Genbu's Shield",range="Gjallarhorn",
  351.         head=gear.EmpHead,neck="Moonbow Whistle",
  352.         body=gear.EmpBody,hands=gear.EmpHands,
  353.         legs=gear.ILegs,feet=gear.AFFeet})
  354.  
  355.     -- For song defbuffs for <Tough mobs or Troubadour buff active (duration primary, accuracy secondary)
  356.     sets.midcast.SongDebuff = set_combine(sets.midcast.SongEffect, {
  357.         ear1="Enchanter Earring +1",ear2="Gwati Earring",
  358.         ring1="Metamorph Ring +1",ring2="Sangoma Ring",
  359.         back="Intarabus's Cape",waist="Ovate Rope"})
  360.  
  361.     -- For song defbuffs (accuracy primary, duration secondary)
  362.     sets.midcast.ResistantSongDebuff = {main="Kali",sub="Genbu's Shield",range="Gjallarhorn",
  363.         head=gear.CHead,neck="Moonbow Whistle",ear1="Enchanter Earring +1",ear2="Gwati Earring",
  364.         body=gear.IBody,hands=gear.CHands,ring1="Metamorph Ring +1",ring2="Sangoma Ring",
  365.         back="Intarabus's Cape",waist="Ovate Rope",legs=gear.CLegs,feet=gear.CFeet}
  366.  
  367.     -- Song-specific recast reduction
  368.     sets.midcast.SongRecast = {main="Kali",sub="Genbu's Shield",
  369.         head=gear.VHead,neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
  370.         body=gear.TBodyEnh,hands=gear.THandsEnh,ring1="Prolix Ring",
  371.         back="Swith Cape +1",waist="Witful Belt",legs=gear.TLegsEnh,feet=gear.TFeetEnh}
  372.  
  373.     --sets.midcast.Daurdabla = set_combine(sets.midcast.FastRecast, sets.midcast.SongRecast, {range=info.ExtraSongInstrument})
  374.  
  375.     -- Cast spell with normal gear, except using Daurdabla instead
  376.     sets.midcast.Daurdabla = {range=info.ExtraSongInstrument}
  377.  
  378.     -- Dummy song with Daurdabla; minimize duration to make it easy to overwrite.
  379.     sets.midcast.DaurdablaDummy = set_combine(sets.midcast.SongRecast, {range=info.ExtraSongInstrument})
  380.  
  381.     -- Other general spells and classes.
  382.     sets.midcast.Cure = set_combine(sets.midcast.FastRecast, {back="Oretania's Cape +1"})
  383.  
  384.     sets.midcast.Stoneskin = set_combine(sets.midcast.FastRecast, {ear1="Earthcry Earring",neck="Stone Gorget",waist="Siegel Sash",legs="Haven Hose"})
  385.  
  386.     sets.midcast['Aquaveil'] = set_combine(sets.midcast.FastRecast, {head=gear.ChiHead,waist="Emphatikos Rope"})
  387.  
  388.     sets.midcast.Cursna = set_combine(sets.midcast.FastRecast, {ring2="Haoma's Ring",back="Oretania's Cape +1",feet=gear.GFeet})
  389.  
  390.  
  391.     -- Sets to return to when not performing an action.
  392.  
  393.     -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  394.     sets.idle = {main="Ipetam", sub="Genbu's Shield",range="Linos",
  395.         head=gear.RHead,neck="Loricate Torque +1",ear1="Ethereal Earring",ear2="Sanare Earring",
  396.         body=gear.GBody,hands="Buremte Gloves",ring1="Dark Ring",ring2="Defending Ring",
  397.         back="Umbra Cape",waist="Gishdubar Sash",legs=gear.RLegs,feet=gear.EmpFeet}
  398.  
  399.     sets.idle.Field = set_combine(sets.idle, {})
  400.  
  401.     sets.idle.PDT = set_combine(sets.idle, {})
  402.  
  403.     sets.idle.Town = set_combine(sets.idle, {})
  404.  
  405.     sets.idle.Weak = {main="Ipetam",sub="Genbu's Shield",range="Linos",
  406.         head=gear.RHead,neck="Loricate Torque +1",ear1="Oneiros Earring",ear2="Sanare Earring",
  407.         body=gear.RBody,hands="Buremte Gloves",ring1="Dark Ring",ring2="Defending Ring",
  408.         back="Umbra Cape",waist="Flume Belt",legs=gear.RLegs,feet=gear.GFeet}
  409.  
  410.  
  411.     -- Defense sets
  412.     sets.defense.PDT = set_combine(sets.idle, {})
  413.  
  414.     sets.defense.MDT = set_combine(sets.idle, {})
  415.  
  416.     -- Resting sets
  417.     sets.resting = set_combine(sets.idle, sets.ExtraRefresh)
  418.  
  419.     -- Engaged sets
  420.  
  421.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  422.     -- sets if more refined versions aren't defined.
  423.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  424.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  425.  
  426.     -- Basic set for if no TP weapon is defined.
  427.     sets.engaged = {
  428.         head=gear.MeleeHead,neck="Lissome Necklace",ear1="Steelflash Earring",ear2="Bladeborn Earring",
  429.         body=gear.MeleeBody,hands=gear.MeleeHands,ring1="Oneiros Ring",ring2="Rajas Ring",
  430.         back="Kayapa Cape",waist="Olseni Belt",legs=gear.MeleeLegs,feet=gear.MeleeFeet}
  431. end
  432.  
  433.  
  434. -------------------------------------------------------------------------------------------------------------------
  435. -- Job-specific hooks for standard casting events.
  436. -------------------------------------------------------------------------------------------------------------------
  437.  
  438. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  439. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  440. function job_precast(spell, action, spellMap, eventArgs)
  441.     if player.status == 'Engaged' then
  442.             disable('main','sub')
  443.         else
  444.             enable('main','sub')
  445.     end
  446.     if spell.type == 'BardSong' then
  447.         -- Auto-Pianissimo
  448.         if ((spell.target.type == 'PLAYER' and not spell.target.charmed) or (spell.target.type == 'NPC' and spell.target.in_party)) and
  449.             not state.Buff['Pianissimo'] then
  450.            
  451.             local spell_recasts = windower.ffxi.get_spell_recasts()
  452.             if spell_recasts[spell.recast_id] < 2 then
  453.                 send_command('@input /ja "Pianissimo" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
  454.                 eventArgs.cancel = true
  455.                 return
  456.             end
  457.         end
  458.     end
  459. end
  460.  
  461. function job_post_precast(spell, action, spellMap, eventArgs)
  462.     if player.status == 'Engaged' then
  463.             disable('main','sub')
  464.         else
  465.             enable('main','sub')
  466.     end
  467.     if spell.type:lower() == 'weaponskill' then
  468.         if (player.tp > 1749 and player.tp < 2000) or (player.tp > 2749 and player.tp < 3000) then
  469.             equip(sets.Moonshade)
  470.         end
  471.     end
  472. end
  473.  
  474. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  475. function job_midcast(spell, action, spellMap, eventArgs)
  476.     if player.status == 'Engaged' then
  477.             disable('main','sub')
  478.         else
  479.             enable('main','sub')
  480.     end
  481.     if spell.action_type == 'Magic' then
  482.         if spell.type == 'BardSong' then
  483.             -- layer general gear on first, then let default handler add song-specific gear.
  484.             local generalClass = get_song_class(spell)
  485.             if generalClass and sets.midcast[generalClass] then
  486.                 equip(sets.midcast[generalClass])
  487.             end
  488.         end
  489.     end
  490. end
  491.  
  492. function job_post_midcast(spell, action, spellMap, eventArgs)
  493.     if player.status == 'Engaged' then
  494.             disable('main','sub')
  495.         else
  496.             enable('main','sub')
  497.     end
  498.     if spell.type == 'BardSong' then
  499.         if state.ExtraSongsMode.value == 'FullLength' then
  500.             equip(sets.midcast.Daurdabla)
  501.         end
  502.         state.ExtraSongsMode:reset()
  503.     end
  504. end
  505.  
  506. -- Set eventArgs.handled to true if we don't want automatic gear equipping to be done.
  507. function job_aftercast(spell, action, spellMap, eventArgs)
  508.     if player.status == 'Engaged' then
  509.             disable('main','sub')
  510.         else
  511.             enable('main','sub')
  512.     end
  513.     if spell.type == 'BardSong' and not spell.interrupted then
  514.         if spell.target and spell.target.type == 'SELF' then
  515.             adjust_timers(spell, spellMap)
  516.         end
  517.     end
  518. end
  519.  
  520. -------------------------------------------------------------------------------------------------------------------
  521. -- Job-specific hooks for non-casting events.
  522. -------------------------------------------------------------------------------------------------------------------
  523.  
  524. -- Called when a player gains or loses a buff.
  525. -- buff == buff gained or lost
  526. -- gain == true if the buff was gained, false if it was lost.
  527. function job_buff_change(buff, gain)
  528.     -- Check if we're in a Reive
  529.     if buff == "Reive Mark" then
  530.         if player.inventory[sets.buff['Reive Mark']] or player.wardrobe[sets.buff['Reive Mark']] or player.wardrobe2[sets.buff['Reive Mark']] or player.wardrobe3[sets.buff['Reive Mark']] or player.wardrobe4[sets.buff['Reive Mark']] then
  531.             if gain then
  532.                 equip(sets.buff['Reive Mark'])
  533.                 disable('neck')
  534.             elseif not gain then
  535.                 enable('neck')
  536.                 status_change(player.status)
  537.             end
  538.         end
  539.     end
  540. end
  541.  
  542. -- Handle notifications of general user state change.
  543. function job_state_change(stateField, newValue, oldValue)
  544.     -- Lock gear that affects TP, except instruments as they no longer reset TP
  545.     if stateField == 'Offense Mode' then
  546.         if newValue == 'Normal' then
  547.             equip(sets.Offense)
  548.             disable('main','sub')
  549.         else
  550.             enable('main','sub')
  551.         end
  552.     end
  553.     -- Equip capacity point gear
  554.     if stateField == 'CP' then
  555.         if newValue ~= false then
  556.             equip(sets.CP)
  557.             disable('back','ring1')
  558.         else
  559.             enable('back','ring1')
  560.         end
  561.     end
  562. end
  563.  
  564. -------------------------------------------------------------------------------------------------------------------
  565. -- User code that supplements standard library decisions.
  566. -------------------------------------------------------------------------------------------------------------------
  567.  
  568. -- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).
  569. function job_handle_equipping_gear(playerStatus, eventArgs)
  570. end
  571.  
  572. -- Called by the 'update' self-command.
  573. function job_update(cmdParams, eventArgs)
  574.     pick_tp_weapon()
  575. end
  576.  
  577.  
  578. -- Modify the default idle set after it was constructed.
  579. function customize_idle_set(idleSet)
  580.     if player.hpp < 80 then
  581.         idleSet = set_combine(idleSet, sets.ExtraRegen)
  582.     end
  583.  
  584.     if player.mpp < 86 then
  585.         if world.time >= (18*60) or world.time <= (6*60) then
  586.             idleSet = set_combine(idleSet, sets.NightRefresh)
  587.         else
  588.             idleSet = set_combine(idleSet, sets.DayRefresh)
  589.         end
  590.     end
  591.  
  592.     if areas.TOAU:contains(world.area) then
  593.         idleSet = set_combine(idleSet, sets.Sanction)
  594.     end
  595.  
  596.     if buffactive['Poison'] then
  597.         idleSet = set_combine(idleSet, sets.poison)
  598.     end
  599.  
  600.     if player.mpp < 51 then
  601.         idleSet = set_combine(idleSet, sets.latent_refresh)
  602.     end
  603.  
  604.     if buffactive["Dancer's Roll"] or buffactive["Evoker's Roll"] or buffactive["Corsair's Roll"] or buffactive["Bolter's Roll"] then
  605.         idleSet = set_combine(idleSet, sets.Roll)
  606.     end
  607.  
  608.     if buffactive["Fighter's Roll"] or buffactive["Rogue's Roll"] or buffactive["Hunter's Roll"] or buffactive["Chaos Roll"] then
  609.         idleSet = set_combine(idleSet, sets.Roll)
  610.     end
  611.  
  612.     if buffactive["Wizard's Roll"] or buffactive["Warlock's Roll"] or buffactive["Caster's Roll"] or buffactive["Courser's Roll"] then
  613.         idleSet = set_combine(idleSet, sets.Roll)
  614.     end
  615.  
  616.     if buffactive["Samurai Roll"] or buffactive["Blitzer's Roll"] or buffactive["Tactician's Roll"] or buffactive["Miser's Roll"] then
  617.         idleSet = set_combine(idleSet, sets.Roll)
  618.     end
  619.  
  620.     if buffactive['Sleep'] then
  621.         idleSet = set_combine(idleSet, sets.Aries)
  622.     end
  623.  
  624.     if not buffactive['Protect'] or not buffactive['Shell'] then
  625.         idleSet = set_combine(idleSet, sets.ProSh)
  626.     end
  627.  
  628.     return idleSet
  629. end
  630.  
  631.  
  632. --function customize_melee_set(melee_set)
  633. --  return melee_set
  634. --end
  635.  
  636.  
  637. -- Function to display the current relevant user state when doing an update.
  638. function display_current_job_state(eventArgs)
  639.     local msg = 'Bard'
  640.  
  641.     if state.CombatForm.has_value then
  642.         msg = msg .. ' (' .. state.CombatForm.value .. ')'
  643.     end
  644.  
  645.     msg = msg .. ', Magic: ' .. state.CastingMode.value
  646.  
  647.     msg = msg .. ', Offense: ' .. state.OffenseMode.value
  648.  
  649.     if state.DefenseMode.value ~= 'None' then
  650.         msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
  651.     end
  652.  
  653.     if state.Kiting.value == true then
  654.         msg = msg .. ', Kiting ON'
  655.     end
  656.  
  657.     if state.CP.value == true then
  658.         msg = msg .. ', CP ON'
  659.     end
  660.  
  661.     add_to_chat(122, msg)
  662.  
  663.     eventArgs.handled = true
  664. end
  665.  
  666. -------------------------------------------------------------------------------------------------------------------
  667. -- Utility functions specific to this job.
  668. -------------------------------------------------------------------------------------------------------------------
  669.  
  670. -- Determine the custom class to use for the given song.
  671. function get_song_class(spell)
  672.     -- Can't use spell.targets:contains() because this is being pulled from resources
  673.     if set.contains(spell.targets, 'Enemy') then
  674.         if state.CastingMode == 'Resistant' then
  675.             return 'ResistantSongDebuff'
  676.         else
  677.             return 'SongDebuff'
  678.         end
  679.     elseif state.ExtraSongsMode.value == 'Dummy' then
  680.         return 'DaurdablaDummy'
  681.     else
  682.         return 'SongEffect'
  683.     end
  684. end
  685.  
  686.  
  687. -- Function to create custom buff-remaining timers with the Timers plugin,
  688. -- keeping only the actual valid songs rather than spamming the default
  689. -- buff remaining timers.
  690. function adjust_timers(spell, spellMap)
  691.     if state.UseCustomTimers.value == false then
  692.         return
  693.     end
  694.    
  695.     local current_time = os.time()
  696.    
  697.     -- custom_timers contains a table of song names, with the os time when they
  698.     -- will expire.
  699.    
  700.     -- Eliminate songs that have already expired from our local list.
  701.     local temp_timer_list = {}
  702.     for song_name,expires in pairs(custom_timers) do
  703.         if expires < current_time then
  704.             temp_timer_list[song_name] = true
  705.         end
  706.     end
  707.     for song_name,expires in pairs(temp_timer_list) do
  708.         custom_timers[song_name] = nil
  709.     end
  710.    
  711.     local dur = calculate_duration(spell.name, spellMap)
  712.     if custom_timers[spell.name] then
  713.         -- Songs always overwrite themselves now, unless the new song has
  714.         -- less duration than the old one (ie: old one was NT version, new
  715.         -- one has less duration than what's remaining).
  716.        
  717.         -- If new song will outlast the one in our list, replace it.
  718.         if custom_timers[spell.name] < (current_time + dur) then
  719.             send_command('timers delete "'..spell.name..'"')
  720.             custom_timers[spell.name] = current_time + dur
  721.             send_command('timers create "'..spell.name..'" '..dur..' down')
  722.         end
  723.     else
  724.         -- Figure out how many songs we can maintain.
  725.         local maxsongs = 2
  726.         if player.equipment.range == info.ExtraSongInstrument then
  727.             maxsongs = maxsongs + info.ExtraSongs
  728.         end
  729.         if buffactive['Clarion Call'] then
  730.             maxsongs = maxsongs + 1
  731.         end
  732.         -- If we have more songs active than is currently apparent, we can still overwrite
  733.         -- them while they're active, even if not using appropriate gear bonuses (ie: Daur).
  734.         if maxsongs < table.length(custom_timers) then
  735.             maxsongs = table.length(custom_timers)
  736.         end
  737.        
  738.         -- Create or update new song timers.
  739.         if table.length(custom_timers) < maxsongs then
  740.             custom_timers[spell.name] = current_time + dur
  741.             send_command('timers create "'..spell.name..'" '..dur..' down')
  742.         else
  743.             local rep,repsong
  744.             for song_name,expires in pairs(custom_timers) do
  745.                 if current_time + dur > expires then
  746.                     if not rep or rep > expires then
  747.                         rep = expires
  748.                         repsong = song_name
  749.                     end
  750.                 end
  751.             end
  752.             if repsong then
  753.                 custom_timers[repsong] = nil
  754.                 send_command('timers delete "'..repsong..'"')
  755.                 custom_timers[spell.name] = current_time + dur
  756.                 send_command('timers create "'..spell.name..'" '..dur..' down')
  757.             end
  758.         end
  759.     end
  760. end
  761.  
  762. -- Function to calculate the duration of a song based on the equipment used to cast it.
  763. -- Called from adjust_timers(), which is only called on aftercast().
  764. function calculate_duration(spellName, spellMap)
  765.     local mult = 1
  766.     local gift = 0
  767.     if player.equipment.range == 'Daurdabla' then mult = mult + 0.3 end -- change to 0.25 with 90 Daur
  768.     if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 end -- change to 0.3 with 95 Gjall
  769.     if player.equipment.range == "Marsya" then mult = mult + 0.5 end
  770.    
  771.     if player.equipment.main == "Carnwenhan" then mult = mult + 0.1 end -- 0.1 for 75, 0.4 for 95, 0.5 for 99/119
  772.     if player.equipment.main == "Kali" then mult = mult + 0.05 end
  773.     if player.equipment.sub == "Kali" then mult = mult + 0.05 end
  774.     if player.equipment.main == "Legato Dagger" then mult = mult + 0.05 end
  775.     if player.equipment.sub == "Legato Dagger" then mult = mult + 0.05 end
  776.  
  777.     if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
  778.     if player.equipment.neck == "Moonbow Whistle" then mult = mult + 0.2 end
  779.     if player.equipment.neck == "Moonbow Whistle +1" then mult = mult + 0.3 end
  780.     if player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  781.     if player.equipment.body == "Fili Hongreline" then mult = mult + 0.11 end
  782.     if player.equipment.body == "Fili Hongreline +1" then mult = mult + 0.12 end
  783.     if player.equipment.legs == "Marduk's Shalwar +1" then mult = mult + 0.1 end
  784.     if player.equipment.legs == "Inyanga Shalwar" then mult = mult + 0.12 end
  785.     if player.equipment.legs == "Inyanga Shalwar +1" then mult = mult + 0.15 end
  786.     if player.equipment.legs == "Inyanga Shalwar +2" then mult = mult + 0.17 end
  787.     if player.equipment.feet == "Brioso Slippers" then mult = mult + 0.1 end
  788.     if player.equipment.feet == "Brioso Slippers +1" then mult = mult + 0.11 end
  789.     if player.equipment.feet == "Brioso Slippers +2" then mult = mult + 0.13 end
  790.     if player.equipment.feet == "Brioso Slippers +3" then mult = mult + 0.15 end
  791.  
  792.     if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet" then mult = mult + 0.1 end
  793.     if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +1" then mult = mult + 0.1 end
  794.     if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +2" then mult = mult + 0.1 end
  795.     if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +3" then mult = mult + 0.2 end
  796.  
  797.     if spellMap == 'Madrigal' and player.equipment.head == "Aoidos' Calot +2" then mult = mult + 0.1 end
  798.     if spellMap == 'Madrigal' and player.equipment.head == "Fili Calot" then mult = mult + 0.1 end
  799.     if spellMap == 'Madrigal' and player.equipment.head == "Fili Calot +1" then mult = mult + 0.1 end
  800.     if spellMap == 'Madrigal' and player.equipment.back == "Intarbus's Cape" then mult = mult + 0.1 end
  801.  
  802.     if spellMap == 'Prelude' and player.equipment.back == "Intarbus's Cape" then mult = mult + 0.1 end
  803.  
  804.     if spellMap == 'Minuet' and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  805.     if spellMap == 'Minuet' and player.equipment.body == "Fili Hongreline" then mult = mult + 0.1 end
  806.     if spellMap == 'Minuet' and player.equipment.body == "Fili Hongreline +1" then mult = mult + 0.1 end
  807.  
  808.     if spellMap == 'March' and player.equipment.hands == "Aoidos' Manchettes +2" then mult = mult + 0.1 end
  809.     if spellMap == 'March' and player.equipment.hands == 'Fili Manchettes' then mult = mult + 0.1 end
  810.     if spellMap == 'March' and player.equipment.hands == 'Fili Manchettes +1' then mult = mult + 0.1 end
  811.  
  812.     if spellMap == 'Ballad' and player.equipment.legs == "Aoidos' Rhingrave +2" then mult = mult + 0.1 end
  813.     if spellMap == 'Ballad' and player.equipment.legs == "Fili Rhingrave" then mult = mult + 0.1 end
  814.     if spellMap == 'Ballad' and player.equipment.legs == "Fili Rhingrave +1" then mult = mult + 0.1 end
  815.  
  816.     if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Aoidos' Cothurnes +2" then mult = mult + 0.1 end
  817.     if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Fili Cothurnes" then mult = mult + 0.1 end
  818.     if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Fili Cothurnes +1" then mult = mult + 0.1 end
  819.  
  820.     if spellMap == 'Etude' and player.equipment.head == "Mousai Turban" then mult = mult + 0.1 end
  821.     if spellMap == 'Etude' and player.equipment.head == "Mousai Turban +1" then mult = mult + 0.1 end
  822.  
  823.     if spellMap == 'Threnody' and player.equipment.body == "Mousai Manteel" then mult = mult + 0.1 end
  824.     if spellMap == 'Threnody' and player.equipment.body == "Mousai Manteel +1" then mult = mult + 0.1 end
  825.  
  826.     if spellMap == 'Carol' and player.equipment.hands == "Mousai Gages" then mult = mult + 0.1 end
  827.     if spellMap == 'Carol' and player.equipment.hands == "Mousai Gages +1" then mult = mult + 0.1 end
  828.  
  829.     if spellMap == 'Minne' and player.equipment.legs == "Mousai Seraweels" then mult = mult + 0.1 end
  830.     if spellMap == 'Minne' and player.equipment.legs == "Mousai Seraweels +1" then mult = mult + 0.1 end
  831.  
  832.     if spellMap == 'Mambo' and player.equipment.feet == "Mousai Crackows" then mult = mult + 0.1 end
  833.     if spellMap == 'Mambo' and player.equipment.feet == "Mousai Crackows +1" then mult = mult + 0.1 end
  834.  
  835.     if spellName == "Foe Sirvente" and player.equipment.head == "Bihu Roundlet" then mult = mult + 0.1 end
  836.     if spellName == "Foe Sirvente" and player.equipment.head == "Bihu Roundlet +1" then mult = mult + 0.1 end
  837.     if spellName == "Foe Sirvente" and player.equipment.head == "Bihu Roundlet +2" then mult = mult + 0.1 end
  838.     if spellName == "Foe Sirvente" and player.equipment.head == "Bihu Roundlet +3" then mult = mult + 0.1 end
  839.  
  840.     if spellName == "Adventurer's Dirge" and player.equipment.head == "Bihu Cuffs" then mult = mult + 0.1 end
  841.     if spellName == "Adventurer's Dirge" and player.equipment.head == "Bihu Cuffs +1" then mult = mult + 0.1 end
  842.     if spellName == "Adventurer's Dirge" and player.equipment.head == "Bihu Cuffs +2" then mult = mult + 0.1 end
  843.     if spellName == "Adventurer's Dirge" and player.equipment.head == "Bihu Cuffs +3" then mult = mult + 0.1 end
  844.  
  845.     if buffactive['Troubadour'] then
  846.         mult = mult*2
  847.     end
  848.  
  849.     -- Soul Voice and Marcato give increased duration to Hymnus, Mazurka, Scherzo only
  850.     if spellName == "Sentinel's Scherzo" then
  851.         if buffactive['Soul Voice'] then
  852.             mult = mult*2
  853.         elseif buffactive['Marcato'] then
  854.             mult = mult*1.5
  855.         end
  856.     end
  857.  
  858.     if buffactive['Clarion Call'] then
  859.         mult = mult*2
  860.         -- gift + 2x job point tier
  861.         gift = gift + 20
  862.     end
  863.  
  864.     if buffactive['Tenuto'] then
  865.         -- gift + 2x job point tier
  866.         gift = gift + 0
  867.     end
  868.  
  869.     if spellMap == 'Lullaby' then
  870.         -- gift + job point tier
  871.         gift = gift + 9
  872.         if player.equipment.hands == "Brioso Cuffs" or player.equipment.hands == "Brioso Cuffs +1" or player.equipment.hands == "Brioso Cuffs +2" then
  873.             mult = mult + 0.1
  874.         elseif player.equipment.hands == "Brioso Cuffs +3" then
  875.             mult = mult + 0.2
  876.         end
  877.     end
  878.  
  879.     local totalDuration = math.floor((mult*120) + gift)
  880.  
  881.     return totalDuration
  882. end
  883.  
  884.  
  885. -- Examine equipment to determine what our current TP weapon is.
  886. function pick_tp_weapon()
  887.     if brd_daggers:contains(player.equipment.main) then
  888.         state.CombatWeapon:set('Dagger')
  889.        
  890.         if S{'NIN','DNC'}:contains(player.sub_job) and brd_daggers:contains(player.equipment.sub) then
  891.             state.CombatForm:set('DW')
  892.         else
  893.             state.CombatForm:reset()
  894.         end
  895.     else
  896.         state.CombatWeapon:reset()
  897.         state.CombatForm:reset()
  898.     end
  899. end
  900.  
  901. -- Function to reset timers.
  902. function reset_timers()
  903.     for i,v in pairs(custom_timers) do
  904.         send_command('timers delete "'..i..'"')
  905.     end
  906.     custom_timers = {}
  907. end
  908.  
  909. -- Select default macro book on initial load or subjob change.
  910. function select_default_macro_book()
  911.     set_macro_page(1, 10)
  912. end
  913.  
  914.  
  915. windower.raw_register_event('zone change',reset_timers)
  916. windower.raw_register_event('logout',reset_timers)
Add Comment
Please, Sign In to add comment