Boposhopo

BRD Lua

Jul 14th, 2025
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 31.86 KB | Gaming | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job.  Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. --[[
  6.     Custom commands:
  7.    
  8.     ExtraSongsMode may take one of three values: None, Dummy, FullLength
  9.    
  10.     You can set these via the standard 'set' and 'cycle' self-commands.  EG:
  11.     gs c cycle ExtraSongsMode
  12.     gs c set ExtraSongsMode Dummy
  13.    
  14.     The Dummy state will equip the bonus song instrument and ensure non-duration gear is equipped.
  15.     The FullLength state will simply equip the bonus song instrument on top of standard gear.
  16.    
  17.    
  18.     Simple macro to cast a dummy Daurdabla song:
  19.     /console gs c set ExtraSongsMode Dummy
  20.     /ma "Shining Fantasia" <me>
  21.    
  22.     To use a Terpander rather than Daurdabla, set the info.ExtraSongInstrument variable to
  23.     'Terpander', and info.ExtraSongs to 1.
  24. --]]
  25.  
  26. -- Initialization function for this job file.
  27. function get_sets()
  28.     mote_include_version = 2
  29.    
  30.     -- Load and initialize the include file.
  31.     include('Mote-Include.lua')
  32. end
  33.  
  34.  
  35. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  36. function job_setup()
  37.     state.ExtraSongsMode = M{['description']='Extra Songs', 'None', 'Dummy', 'FullLength'}
  38.  
  39.     state.Buff['Pianissimo'] = buffactive['pianissimo'] or false
  40.  
  41.     -- For tracking current recast timers via the Timers plugin.
  42.     custom_timers = {}
  43. end
  44.  
  45. -------------------------------------------------------------------------------------------------------------------
  46. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  47. -------------------------------------------------------------------------------------------------------------------
  48.  
  49. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  50. function user_setup()
  51.     state.OffenseMode:options('Normal', 'AM3', 'DT')
  52.     state.CastingMode:options('Normal', 'Resistant')
  53.     state.IdleMode:options('Normal', 'PDT')
  54.  
  55.    
  56.     -- Adjust this if using the Terpander (new +song instrument)
  57.     info.ExtraSongInstrument = {ranged="Daurdabla"}
  58.     -- How many extra songs we can keep from Daurdabla/Terpander
  59.     info.ExtraSongs = 2
  60.    
  61.     -- Set this to false if you don't want to use custom timers.
  62.     state.UseCustomTimers = M(true, 'Use Custom Timers')
  63.    
  64.     send_command('wait 6;input /lockstyleset 2')
  65.  
  66.     select_default_macro_book()
  67.    
  68. end
  69.  
  70.  
  71. -- Called when this job file is unloaded (eg: job change)
  72. function user_unload()
  73.     send_command('unbind ^`')
  74.     send_command('unbind !`')
  75. end
  76.  
  77.  
  78. -- Define sets and vars used by this job file.
  79. function init_gear_sets()
  80.     --------------------------------------
  81.     -- Start defining the sets
  82.     --------------------------------------
  83.    
  84.     -- Precast Sets
  85.  
  86.     -- Fast cast sets for spells
  87.     sets.precast.FC = {head="C. Palug Crown",
  88.         body="Inyanga Jubbah +2",
  89.         hands={ name="Gende. Gages +1", augments={'Phys. dmg. taken -3%','Magic dmg. taken -2%','Song spellcasting time -5%',}},
  90.         legs="Volte Brais",
  91.         feet="Telchine Pigaches",
  92.         waist="Embla Sash",
  93.         right_ear="Loquac. Earring",
  94.         left_ear="Etiolation Earring",
  95.         left_ring="Kishar Ring",
  96.         back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  97.  
  98.     sets.precast.FC.Cure = set_combine(sets.precast.FC, {})
  99.  
  100.     sets.precast.FC.Stoneskin = set_combine(sets.precast.FC, {})
  101.  
  102.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  103.  
  104.     sets.precast.FC.BardSong = {
  105.         head="Fili Calot +2",
  106.         body="Inyanga Jubbah +2",
  107.         hands={ name="Gende. Gages +1", augments={'Phys. dmg. taken -3%','Magic dmg. taken -2%','Song spellcasting time -5%',}},
  108.         legs="Volte Brais",
  109.         feet={ name="Bihu Slippers +3", augments={'Enhances "Nightingale" effect',}},
  110.         waist="Embla Sash",
  111.         right_ear="Loquac. Earring",
  112.         left_ear="Etiolation Earring",
  113.         left_ring="Kishar Ring",
  114.         back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  115.  
  116.     sets.precast.FC.Daurdabla = set_combine(sets.precast.FC.BardSong, {range=info.ExtraSongInstrument})
  117.        
  118.    
  119.     -- Precast sets to enhance JAs+
  120.    
  121.     sets.precast.JA.Nightingale = {feet="Bihu Slippers +3"}
  122.     sets.precast.JA.Troubadour = {body="Bihu Jstcorps. +3"}
  123.     sets.precast.JA['Soul Voice'] = {legs="Bihu Cannions +3"}
  124.  
  125.     -- Waltz set (chr and vit)
  126.     sets.precast.Waltz = {}
  127.    
  128.        
  129.     -- Weaponskill sets
  130.     -- Default set for any weaponskill that isn't any more specifically defined
  131.     sets.precast.WS = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  132.         head="Nyame Helm",
  133.         body={ name="Bihu Jstcorps. +3", augments={'Enhances "Troubadour" effect',}},
  134.         hands="Nyame Gauntlets",
  135.         legs="Nyame Flanchard",
  136.         feet="Nyame Sollerets",
  137.         neck="Bard's Charm +2",
  138.         waist={ name="Sailfi Belt +1", augments={'Path: A',}},
  139.         left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  140.         right_ear="Regal Earring",
  141.         left_ring="Rufescent Ring",
  142.         right_ring="Shukuyu Ring",
  143.         back={ name="Intarabus's Cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  144.    
  145.     -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
  146.     sets.precast.WS['Evisceration'] = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  147.         head="Blistering Sallet +1",
  148.         body={ name="Bihu Jstcorps. +3", augments={'Enhances "Troubadour" effect',}},
  149.         hands={ name="Bihu Cuffs +3", augments={'Enhances "Con Brio" effect',}},
  150.         legs={ name="Bihu Cannions +3", augments={'Enhances "Soul Voice" effect',}},
  151.         feet="Lustratio Leggings +1",
  152.         neck="Fotia Gorget",
  153.         waist="Fotia Belt",
  154.         left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  155.         right_ear="Ishvara Earring",
  156.         left_ring="Petrov Ring",
  157.         right_ring="Ilabrat Ring",
  158.         back={ name="Intarabus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},}
  159.  
  160.     sets.precast.WS['Exenterator'] = {}
  161.    
  162.     sets.precast.WS["Rudra's Storm"] = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  163.         head="Nyame Helm",
  164.         body={ name="Nyame Mail", augments={'Path: B',}},
  165.         hands="Nyame Gauntlets",
  166.         legs="Nyame Flanchard",
  167.         feet="Nyame Sollerets",
  168.         neck={ name="Bard's Charm +2", augments={'Path: A',}},
  169.         waist="Sailfi Belt +1",
  170.         left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  171.         right_ear="Ishvara Earring",
  172.         left_ring="Petrov Ring",
  173.         right_ring="Ilabrat Ring",
  174.         back={ name="Intarabus's Cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  175.    
  176.     sets.precast.WS['Mordant Rime'] = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  177.         head="Nyame Helm",
  178.         body={ name="Bihu Jstcorps. +3", augments={'Enhances "Troubadour" effect',}},
  179.         hands="Nyame Gauntlets",
  180.         legs="Nyame Flanchard",
  181.         feet="Nyame Sollerets",
  182.         neck="Bard's Charm +2",
  183.         waist="Sailfi Belt +1",
  184.         left_ear="Regal Earring",
  185.         right_ear="Ishvara Earring",
  186.         left_ring="Metamorph Ring +1",
  187.         right_ring="Ilabrat Ring",
  188.         back={ name="Intarabus's Cape", augments={'CHR+20','Accuracy+20 Attack+20','CHR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  189.    
  190.     sets.precast.WS['Aeolian Edge'] = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  191.         head={ name="Nyame Helm", augments={'Path: B',}},
  192.         body={ name="Nyame Mail", augments={'Path: B',}},
  193.         hands="Nyame Gauntlets",
  194.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  195.         feet={ name="Nyame Sollerets", augments={'Path: B',}},
  196.         neck="Sibyl Scarf",
  197.         waist="Eschan Stone",
  198.         left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  199.         right_ear="Friomisi Earring",
  200.         left_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
  201.         right_ring="Epaminondas's Ring",
  202.         back={ name="Intarabus's Cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  203.        
  204.     sets.precast.WS['Earth Crusher'] = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  205.         head={ name="Nyame Helm", augments={'Path: B',}},
  206.         body={ name="Nyame Mail", augments={'Path: B',}},
  207.         hands="Nyame Gauntlets",
  208.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  209.         feet={ name="Nyame Sollerets", augments={'Path: B',}},
  210.         neck="Sibyl Scarf",
  211.         waist="Eschan Stone",
  212.         left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  213.         right_ear="Friomisi Earring",
  214.         left_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
  215.         right_ring="Epaminondas's Ring",
  216.         back={ name="Intarabus's Cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  217.        
  218.     sets.precast.WS['Rock Crusher'] = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  219.         head={ name="Nyame Helm", augments={'Path: B',}},
  220.         body={ name="Nyame Mail", augments={'Path: B',}},
  221.         hands="Nyame Gauntlets",
  222.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  223.         feet={ name="Nyame Sollerets", augments={'Path: B',}},
  224.         neck="Sibyl Scarf",
  225.         waist="Eschan Stone",
  226.         left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  227.         right_ear="Friomisi Earring",
  228.         left_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
  229.         right_ring="Epaminondas's Ring",
  230.         back={ name="Intarabus's Cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  231.    
  232.     sets.precast.WS['Savage Blade'] = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  233.         head="Nyame Helm",
  234.         body="Nyame Mail",
  235.         hands="Nyame Gauntlets",
  236.         legs="Nyame Flanchard",
  237.         feet="Nyame Sollerets",
  238.         neck="Bard's Charm +2",
  239.         waist={ name="Sailfi Belt +1", augments={'Path: A',}},
  240.         left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  241.         right_ear="Regal Earring",
  242.         left_ring="Rufescent Ring",
  243.         right_ring="Shukuyu Ring",
  244.         back={ name="Intarabus's Cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  245.        
  246.     sets.precast.WS['Retribution'] = set_combine(sets.precast.WS['Savage Blade'], {})
  247.    
  248.     sets.precast.WS['Cataclysm'] = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  249.         head="Pixie Hairpin +1",
  250.         body={ name="Nyame Mail", augments={'Path: B',}},
  251.         hands="Nyame Gauntlets",
  252.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  253.         feet={ name="Nyame Sollerets", augments={'Path: B',}},
  254.         neck="Sibyl Scarf",
  255.         waist="Hachirin-no-Obi",
  256.         left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  257.         right_ear="Regal Earring",
  258.         left_ring="Archon Ring",
  259.         right_ring="Epaminondas's Ring",
  260.         back={ name="Intarabus's Cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  261.        
  262.     sets.precast.WS['Sanguine Blade'] = {range={ name="Linos", augments={'Accuracy+15','"Store TP"+4','STR+4 DEX+4',}},
  263.         head="Pixie Hairpin +1",
  264.         body={ name="Nyame Mail", augments={'Path: B',}},
  265.         hands="Nyame Gauntlets",
  266.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  267.         feet={ name="Nyame Sollerets", augments={'Path: B',}},
  268.         neck="Sibyl Scarf",
  269.         waist="Hachirin-no-Obi",
  270.         left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  271.         right_ear="Regal Earring",
  272.         left_ring="Archon Ring",
  273.         right_ring="Epaminondas's Ring",
  274.         back={ name="Intarabus's Cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  275.        
  276.    
  277.    
  278.     -- Midcast Sets
  279.  
  280.     -- General set for recast times.
  281.     sets.midcast.FastRecast = {head="C. Palug Crown",
  282.         body="Inyanga Jubbah +2",
  283.         hands={ name="Gende. Gages +1", augments={'Phys. dmg. taken -3%','Magic dmg. taken -2%','Song spellcasting time -5%',}},
  284.         legs="Volte Brais",
  285.         feet="Telchine Pigaches",
  286.         waist="Embla Sash",
  287.         right_ear="Loquac. Earring",
  288.         left_ear="Etiolation Earring",
  289.         left_ring="Kishar Ring",
  290.         back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  291.        
  292.     -- Gear to enhance certain classes of songs.  No instruments added here since Gjallarhorn is being used.
  293.     sets.midcast.Ballad = {legs="Fili Rhingrave +2"}
  294.     sets.midcast.Lullaby = {hands="Brioso Cuffs +3"}
  295.     sets.midcast.AOELullaby = {ranged="Daurdabla", hands="Brioso Cuffs +3"}
  296.     sets.midcast.Madrigal = {head="Fili Calot +2", back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  297.     sets.midcast.March = {hands="Fili Manchettes +2"}
  298.     sets.midcast.HonorMarch = {ranged="Marsyas", hands="Fili Manchettes +2"}
  299.     sets.midcast.Minuet = {body="Fili Hongreline +2"}
  300.     sets.midcast.Etude = {head="Mousai Turban +1"}
  301.     sets.midcast.Minne = {legs="Mousai Seraweels +1"}
  302.     sets.midcast.Paeon = {head="Brioso Roundlet +3"}
  303.     sets.midcast.Carol = {hands="Mousai Gages"}
  304.     sets.midcast.Mambo = {feet="Mousai Crackows +1"}
  305.     sets.midcast["Sentinel's Scherzo"] = {feet="Fili Cothurnes +2"}
  306.     sets.midcast['Magic Finale'] = {}
  307.     sets.midcast.Threnody = {body="Mousai Manteel +1"}
  308.     sets.midcast.Prelude = {back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  309.    
  310.     sets.midcast['Ltng. Threnody II'] = set_combine(sets.midcast.Threnody, {})
  311.  
  312.     sets.midcast.Mazurka = {info.ExtraSongInstrument}
  313.    
  314.  
  315.     -- For song buffs (duration and AF3 set bonus)
  316.     sets.midcast.SongEffect = {head="Fili Calot +2",
  317.         body="Fili Hongreline +2",
  318.         hands="Fili Manchettes +2",
  319.         legs="Inyanga Shalwar +2",
  320.         feet="Brioso Slippers +3",
  321.         neck="Mnbw. Whistle +1",
  322.         left_ring="Moonlight Ring",
  323.         right_ring="Gelatinous Ring +1",
  324.         back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  325.  
  326.     -- For song defbuffs (duration primary, accuracy secondary)
  327.     sets.midcast.SongDebuff = {range="Gjallarhorn",
  328.         head="Brioso Roundlet +3",
  329.         body="Brioso Justau. +3",
  330.         hands="Inyanga Dastanas +2",
  331.         legs="Brioso Cannions +3",
  332.         feet="Brioso Slippers +3",
  333.         ring1="Stikini Ring",
  334.         ring2="Stikini Ring",
  335.         neck="Mnbw. Whistle +1",
  336.         waist="Luminary Sash",
  337.         left_ear="Regal Earring",
  338.         right_ear="Crepuscular Earring",
  339.         back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  340.  
  341.     -- For song defbuffs (accuracy primary, duration secondary)
  342.     sets.midcast.ResistantSongDebuff = {range="Gjallarhorn",
  343.         head="Brioso Roundlet +3",
  344.         body="Brioso Justau. +3",
  345.         hands="Inyanga Dastanas +2",
  346.         legs="Brioso Cannions +3",
  347.         feet="Brioso Slippers +3",
  348.         ring1="Stikini Ring",
  349.         ring2="Stikini Ring",
  350.         neck="Mnbw. Whistle +1",
  351.         waist="Luminary Sash",
  352.         left_ear="Regal Earring",
  353.         right_ear="Crepuscular Earring",
  354.         back={ name="Intarabus's Cape", augments={'CHR+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  355.  
  356.     -- Song-specific recast reduction
  357.     sets.midcast.SongRecast = {legs="Fili Rhingrave +2"}
  358.  
  359.     -- Other general spells and classes.
  360.     sets.midcast.Cure = {head={ name="Kaykaus Mitra +1", augments={'MP+80','"Cure" spellcasting time -7%','Enmity-6',}},
  361.         body={ name="Kaykaus Bliaut +1", augments={'MP+80','MND+12','Mag. Acc.+20',}},
  362.         hands={ name="Kaykaus Cuffs", augments={'MP+60','MND+10','Mag. Acc.+15',}},
  363.         legs="Kaykaus Tights",
  364.         feet={ name="Vanya Clogs", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
  365.         neck="Nodens Gorget",
  366.         waist="Carrier's Sash",
  367.         left_ear="Mendi. Earring",
  368.         left_ring="Menelaus's Ring",
  369.         right_ring="Haoma's Ring",}
  370.        
  371.     sets.midcast.Curaga = set_combine(sets.midcast.Cure, {})
  372.    
  373.     sets.midcast.Stoneskin = {neck="Nodens Gorget",
  374.         waist="Siegel Sash"}
  375.        
  376.     sets.midcast.Haste = {sub="Ammurapi Shield",
  377.         head="Telchine Cap",
  378.         body="Telchine Chas.",
  379.         hands="Telchine Gloves",
  380.         legs="Telchine Braconi",}
  381.        
  382.     sets.midcast.Flurry = {sub="Ammurapi Shield",
  383.         head="Telchine Cap",
  384.         body="Telchine Chas.",
  385.         hands="Telchine Gloves",
  386.         legs="Telchine Braconi",}
  387.        
  388.     sets.midcast.Cursna = {head={ name="Vanya Hood", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
  389.         body={ name="Vanya Robe", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
  390.         hands="Inyan. Dastanas +2",
  391.         feet={ name="Vanya Clogs", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
  392.         neck="Debilis Medallion",
  393.         waist="Gishdubar Sash",
  394.         left_ear="Mendi. Earring",
  395.         left_ring="Menelaus's Ring",
  396.         right_ring="Haoma's Ring",
  397.         back="Oretan. Cape +1",}
  398.  
  399.    
  400.     -- Sets to return to when not performing an action.
  401.    
  402.     -- Resting sets
  403.     sets.resting = {}
  404.    
  405.    
  406.     -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  407.     sets.idle = {
  408.         head="Nyame Helm",
  409.         body="Nyame Mail",
  410.         hands="Nyame Gauntlets",
  411.         legs="Nyame Flanchard",
  412.         feet="Fili Cothurnes +2",
  413.         neck={ name="Bard's Charm +2", augments={'Path: A',}},
  414.         waist="Carrier's Sash",
  415.         left_ear="Etiolation Earring",
  416.         right_ear="Infused Earring",
  417.         left_ring="Fortified Ring",
  418.         right_ring="Defending Ring",
  419.         back={ name="Intarabus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},}
  420.  
  421.     sets.idle.PDT = {head="Nyame Helm",
  422.         body="Nyame Mail",
  423.         hands="Nyame Gauntlets",
  424.         legs="Nyame Flanchard",
  425.         feet="Fili Cothurnes +2",
  426.         neck={ name="Bard's Charm +2", augments={'Path: A',}},
  427.         waist="Carrier's Sash",
  428.         left_ear="Etiolation Earring",
  429.         right_ear="Infused Earring",
  430.         left_ring="Fortified Ring",
  431.         right_ring="Defending Ring",
  432.         back={ name="Intarabus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},}
  433.  
  434.     sets.idle.Town = {
  435.         head="Nyame Helm",
  436.         body="Nyame Mail",
  437.         hands="Nyame Gauntlets",
  438.         legs="Nyame Flanchard",
  439.         feet="Fili Cothurnes +2",
  440.         neck={ name="Bard's Charm +2", augments={'Path: A',}},
  441.         waist="Carrier's Sash",
  442.         left_ear="Etiolation Earring",
  443.         right_ear="Infused Earring",
  444.         left_ring="Fortified Ring",
  445.         right_ring="Defending Ring",
  446.         back={ name="Intarabus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},}
  447.    
  448.     sets.idle.Weak = set_combine(sets.idle, {})
  449.    
  450.    
  451.     -- Defense sets
  452.  
  453.     sets.defense.PDT = {}
  454.  
  455.     sets.defense.MDT = {}
  456.  
  457.     sets.Kiting = {feet="Fili Cothurnes +2"}
  458.  
  459.     sets.latent_refresh = {}
  460.  
  461.     -- Engaged sets
  462.  
  463.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  464.     -- sets if more refined versions aren't defined.
  465.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  466.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  467.    
  468.     -- Basic set for if no TP weapon is defined.
  469.     sets.engaged = {range={ name="Linos", augments={'Accuracy+14','"Store TP"+3','Quadruple Attack +3',}},
  470.         head={ name="Bunzi's Hat", augments={'Path: A',}},
  471.         body="Ashera Harness",
  472.         hands={ name="Bunzi's Gloves", augments={'Path: A',}},
  473.         legs="Volte Tights",
  474.         feet="Volte Spats",
  475.         neck={ name="Bard's Charm +2", augments={'Path: A',}},
  476.         waist="Windbuffet Belt +1",
  477.         left_ear="Telos Earring",
  478.         right_ear="Crep. Earring",
  479.         left_ring="Lehko's Ring",
  480.         right_ring="Moonlight Ring",
  481.         back={ name="Intarabus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dual Wield"+10','Damage taken-5%',}},}
  482.  
  483.     -- Set if AM up
  484.     sets.engaged.AM3 = {range={ name="Linos", augments={'Accuracy+14','"Store TP"+3','Quadruple Attack +3',}},
  485.         head={ name="Bunzi's Hat", augments={'Path: A',}},
  486.         body="Ashera Harness",
  487.         hands={ name="Bunzi's Gloves", augments={'Path: A',}},
  488.         legs="Volte Tights",
  489.         feet="Volte Spats",
  490.         neck={ name="Bard's Charm +2", augments={'Path: A',}},
  491.         waist="Windbuffet Belt +1",
  492.         left_ear="Telos Earring",
  493.         right_ear="Crep. Earring",
  494.         left_ring="Lehko's Ring",
  495.         right_ring="Moonlight Ring",
  496.         back={ name="Intarabus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dual Wield"+10','Damage taken-5%',}},}
  497.        
  498.     sets.engaged.DT = {range={ name="Linos", augments={'Accuracy+14','"Store TP"+3','Quadruple Attack +3',}},
  499.         head={ name="Bunzi's Hat", augments={'Path: A',}},
  500.         body="Ashera Harness",
  501.         hands={ name="Bunzi's Gloves", augments={'Path: A',}},
  502.         legs="Volte Tights",
  503.         feet="Nyame Sollerets",
  504.         neck={ name="Bard's Charm +2", augments={'Path: A',}},
  505.         waist="Windbuffet Belt +1",
  506.         left_ear="Telos Earring",
  507.         right_ear="Crep. Earring",
  508.         left_ring="Lehko's Ring",
  509.         right_ring="Moonlight Ring",
  510.         back={ name="Intarabus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},}
  511. end
  512.  
  513.  
  514. -------------------------------------------------------------------------------------------------------------------
  515. -- Job-specific hooks for standard casting events.
  516. -------------------------------------------------------------------------------------------------------------------
  517.  
  518. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  519. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  520. function job_precast(spell, action, spellMap, eventArgs)
  521.     if spell.type == 'BardSong' then
  522.         -- Auto-Pianissimo
  523.         if ((spell.target.type == 'PLAYER' and not spell.target.charmed) or (spell.target.type == 'NPC' and spell.target.in_party)) and
  524.             not state.Buff['Pianissimo'] then
  525.            
  526.             local spell_recasts = windower.ffxi.get_spell_recasts()
  527.             if spell_recasts[spell.recast_id] < 2 then
  528.                 send_command('@input /ja "Pianissimo" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
  529.                 eventArgs.cancel = true
  530.                 return
  531.             end
  532.         end
  533.     end
  534. end
  535.  
  536. function job_post_precast(spell, action, spellMap, eventArgs)
  537.  
  538.     if spell.name == 'Honor March' then
  539.         equip({ranged="Marsyas"})
  540.     end
  541.  
  542. end
  543.  
  544. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  545. function job_midcast(spell, action, spellMap, eventArgs)
  546.     if spell.action_type == 'Magic' then
  547.         if spell.type == 'BardSong' then
  548.             -- layer general gear on first, then let default handler add song-specific gear.
  549.             local generalClass = get_song_class(spell)
  550.             if generalClass and sets.midcast[generalClass] then
  551.                 equip(sets.midcast[generalClass])
  552.             end
  553.         end
  554.     end
  555. end
  556.  
  557. function job_post_midcast(spell, action, spellMap, eventArgs)
  558.     if spell.type == 'BardSong' then
  559.         if state.ExtraSongsMode.value == 'FullLength' then
  560.             equip(sets.midcast.Daurdabla)
  561.         end
  562.  
  563.         state.ExtraSongsMode:reset()
  564.     end
  565.    
  566.     if spell.name == 'Honor March' then
  567.         equip(sets.midcast.HonorMarch)
  568.     end
  569.    
  570.     if spell.name == 'Horde Lullaby' or spell.name == 'Horde Lullaby II' then
  571.         equip(sets.midcast.AOELullaby)
  572.     end
  573.    
  574. end
  575.  
  576. -- Set eventArgs.handled to true if we don't want automatic gear equipping to be done.
  577. function job_aftercast(spell, action, spellMap, eventArgs)
  578.     if spell.type == 'BardSong' and not spell.interrupted then
  579.         if spell.target and spell.target.type == 'SELF' then
  580.             adjust_timers(spell, spellMap)
  581.         end
  582.     end
  583. end
  584.  
  585. -------------------------------------------------------------------------------------------------------------------
  586. -- Job-specific hooks for non-casting events.
  587. -------------------------------------------------------------------------------------------------------------------
  588.  
  589. -- Handle notifications of general user state change.
  590. function job_state_change(stateField, newValue, oldValue)
  591.     if stateField == 'Offense Mode' then
  592.         if newValue == 'Normal' then
  593.             disable('main','sub','ammo')
  594.         else
  595.             enable('main','sub','ammo')
  596.         end
  597.     end
  598. end
  599.  
  600. -------------------------------------------------------------------------------------------------------------------
  601. -- User code that supplements standard library decisions.
  602. -------------------------------------------------------------------------------------------------------------------
  603.  
  604.  
  605.  
  606. -- Modify the default idle set after it was constructed.
  607. function customize_idle_set(idleSet)
  608.     if player.mpp < 51 then
  609.         idleSet = set_combine(idleSet, sets.latent_refresh)
  610.     end
  611.    
  612.     return idleSet
  613. end
  614.  
  615.  
  616. -- Function to display the current relevant user state when doing an update.
  617. function display_current_job_state(eventArgs)
  618.     display_current_caster_state()
  619.     eventArgs.handled = true
  620. end
  621.  
  622. -------------------------------------------------------------------------------------------------------------------
  623. -- Utility functions specific to this job.
  624. -------------------------------------------------------------------------------------------------------------------
  625.  
  626. -- Determine the custom class to use for the given song.
  627. function get_song_class(spell)
  628.     -- Can't use spell.targets:contains() because this is being pulled from resources
  629.     if set.contains(spell.targets, 'Enemy') then
  630.         if state.CastingMode.value == 'Resistant' then
  631.             return 'ResistantSongDebuff'
  632.         else
  633.             return 'SongDebuff'
  634.         end
  635.     elseif state.ExtraSongsMode.value == 'Dummy' then
  636.         return 'DaurdablaDummy'
  637.     else
  638.         return 'SongEffect'
  639.     end
  640. end
  641.  
  642.  
  643. -- Function to create custom buff-remaining timers with the Timers plugin,
  644. -- keeping only the actual valid songs rather than spamming the default
  645. -- buff remaining timers.
  646. function adjust_timers(spell, spellMap)
  647.     if state.UseCustomTimers.value == false then
  648.         return
  649.     end
  650.    
  651.     local current_time = os.time()
  652.    
  653.     -- custom_timers contains a table of song names, with the os time when they
  654.     -- will expire.
  655.    
  656.     -- Eliminate songs that have already expired from our local list.
  657.     local temp_timer_list = {}
  658.     for song_name,expires in pairs(custom_timers) do
  659.         if expires < current_time then
  660.             temp_timer_list[song_name] = true
  661.         end
  662.     end
  663.     for song_name,expires in pairs(temp_timer_list) do
  664.         custom_timers[song_name] = nil
  665.     end
  666.    
  667.     local dur = calculate_duration(spell.name, spellMap)
  668.     if custom_timers[spell.name] then
  669.         -- Songs always overwrite themselves now, unless the new song has
  670.         -- less duration than the old one (ie: old one was NT version, new
  671.         -- one has less duration than what's remaining).
  672.        
  673.         -- If new song will outlast the one in our list, replace it.
  674.         if custom_timers[spell.name] < (current_time + dur) then
  675.             send_command('timers delete "'..spell.name..'"')
  676.             custom_timers[spell.name] = current_time + dur
  677.             send_command('timers create "'..spell.name..'" '..dur..' down')
  678.         end
  679.     else
  680.         -- Figure out how many songs we can maintain.
  681.         local maxsongs = 2
  682.         if player.equipment.range == info.ExtraSongInstrument then
  683.             maxsongs = maxsongs + info.ExtraSongs
  684.         end
  685.         if buffactive['Clarion Call'] then
  686.             maxsongs = maxsongs + 1
  687.         end
  688.         -- If we have more songs active than is currently apparent, we can still overwrite
  689.         -- them while they're active, even if not using appropriate gear bonuses (ie: Daur).
  690.         if maxsongs < table.length(custom_timers) then
  691.             maxsongs = table.length(custom_timers)
  692.         end
  693.        
  694.         -- Create or update new song timers.
  695.         if table.length(custom_timers) < maxsongs then
  696.             custom_timers[spell.name] = current_time + dur
  697.             send_command('timers create "'..spell.name..'" '..dur..' down')
  698.         else
  699.             local rep,repsong
  700.             for song_name,expires in pairs(custom_timers) do
  701.                 if current_time + dur > expires then
  702.                     if not rep or rep > expires then
  703.                         rep = expires
  704.                         repsong = song_name
  705.                     end
  706.                 end
  707.             end
  708.             if repsong then
  709.                 custom_timers[repsong] = nil
  710.                 send_command('timers delete "'..repsong..'"')
  711.                 custom_timers[spell.name] = current_time + dur
  712.                 send_command('timers create "'..spell.name..'" '..dur..' down')
  713.             end
  714.         end
  715.     end
  716. end
  717.  
  718. -- Function to calculate the duration of a song based on the equipment used to cast it.
  719. -- Called from adjust_timers(), which is only called on aftercast().
  720. function calculate_duration(spellName, spellMap)
  721.     local mult = 1
  722.     if player.equipment.range == 'Daurdabla' then mult = mult + 0.3 end -- change to 0.25 with 90 Daur
  723.     if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 end -- change to 0.3 with 95 Gjall
  724.    
  725.     if player.equipment.main == "Carnwenhan" then mult = mult + 0.1 end -- 0.1 for 75, 0.4 for 95, 0.5 for 99/119
  726.     if player.equipment.main == "Legato Dagger" then mult = mult + 0.05 end
  727.     if player.equipment.sub == "Legato Dagger" then mult = mult + 0.05 end
  728.     if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
  729.     if player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  730.     if player.equipment.legs == "Mdk. Shalwar +1" then mult = mult + 0.1 end
  731.     if player.equipment.feet == "Brioso Slippers +3" then mult = mult + 0.1 end
  732.     if player.equipment.feet == "Brioso Slippers +3" then mult = mult + 0.11 end
  733.    
  734.     if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet" then mult = mult + 0.1 end
  735.     if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +3" then mult = mult + 0.1 end
  736.     if spellMap == 'Madrigal' and player.equipment.head == "Fili Calot +2" then mult = mult + 0.1 end
  737.     if spellMap == 'Minuet' and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  738.     if spellMap == 'March' and player.equipment.hands == 'Ad. Mnchtte. +2' then mult = mult + 0.1 end
  739.     if spellMap == 'Ballad' and player.equipment.legs == "Fili Rhingrave +2" then mult = mult + 0.1 end
  740.     if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Fili Cothurnes +2" then mult = mult + 0.1 end
  741.    
  742.     if buffactive.Troubadour then
  743.         mult = mult*2
  744.     end
  745.     if spellName == "Sentinel's Scherzo" then
  746.         if buffactive['Soul Voice'] then
  747.             mult = mult*2
  748.         elseif buffactive['Marcato'] then
  749.             mult = mult*1.5
  750.         end
  751.     end
  752.    
  753.     local totalDuration = math.floor(mult*120)
  754.  
  755.     return totalDuration
  756. end
  757.  
  758.  
  759.  
  760.  
  761. -- Function to reset timers.
  762. function reset_timers()
  763.     for i,v in pairs(custom_timers) do
  764.         send_command('timers delete "'..i..'"')
  765.     end
  766.     custom_timers = {}
  767. end
  768.  
  769.  
  770. -- Select default macro book on initial load or subjob change.
  771. function select_default_macro_book()
  772.     set_macro_page(1, 10)
  773. end
  774.  
  775.  
  776. windower.raw_register_event('zone change',reset_timers)
  777. windower.raw_register_event('logout',reset_timers)
  778.  
  779.  
Advertisement
Add Comment
Please, Sign In to add comment