Advertisement
Lygre

SCH consolidated

Dec 12th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 43.34 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job.  Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. --[[
  6.         Custom commands:
  7.         Shorthand versions for each strategem type that uses the version appropriate for
  8.         the current Arts.
  9.                                         Light Arts              Dark Arts
  10.         gs c scholar light              Light Arts/Addendum
  11.         gs c scholar dark                                       Dark Arts/Addendum
  12.         gs c scholar cost               Penury                  Parsimony
  13.         gs c scholar speed              Celerity                Alacrity
  14.         gs c scholar aoe                Accession               Manifestation
  15.         gs c scholar power              Rapture                 Ebullience
  16.         gs c scholar duration           Perpetuance
  17.         gs c scholar accuracy           Altruism                Focalization
  18.         gs c scholar enmity             Tranquility             Equanimity
  19.         gs c scholar skillchain                                 Immanence
  20.         gs c scholar addendum           Addendum: White         Addendum: Black
  21. --]]
  22.  
  23.  
  24.  
  25. -- Initialization function for this job file.
  26. function get_sets()
  27.     mote_include_version = 2
  28.    
  29.     include('organizer-lib')
  30.     -- Load and initialize the include file.
  31.     include('Mote-Include.lua')
  32. end
  33.  
  34.  
  35. function user_setup()
  36.     send_command('bind ^f10 gs c toggle MagicBurst')
  37.     send_command('bind !f11 gs c cycle MagicalDefenseMode')
  38.  
  39. end
  40.  
  41. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  42. function job_setup()
  43.     info.addendumNukes = S{"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
  44.         "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  45.  
  46.         Non_Obi_Spells = S{
  47.                         'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  48.                         'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  49.  
  50.         Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  51.         Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  52.        
  53.     state.OffenseMode:options('None', 'Locked')
  54.     state.CastingMode:options('Normal', 'Resistant')
  55.     state.IdleMode:options('Normal', 'PDT', 'MDT')
  56.     state.PhysicalDefenseMode:options('PDT')
  57.     state.MagicalDefenseMode:options('MDT','Meva')
  58.    
  59.     state.MagicBurst = M(false, 'Magic Burst')
  60.  
  61.     gear.RegenCape = {name="Bookworm's Cape", augments={'INT+2','Helix eff. dur. +13','"Regen" potency+9',}}
  62.     gear.HelixCape = {name="Bookworm's Cape", augments={'INT+4','MND+4','Helix eff. dur. +20',}}
  63.     gear.NukeStaff = {name="Akademos", augments={'INT+15','"Mag.Atk.Bns."+15','Mag. Acc.+15',}}
  64.     gear.EnfeebStaff = {name="Akademos", augments={'Mag. Acc.+20','Enha.mag. skill +15','Enfb.mag. skill +15',}}
  65.  
  66.     info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder"}
  67.     info.mid_nukes = S{"Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II",
  68.                        "Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
  69.                        "Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",}
  70.     info.high_nukes = S{"Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  71.  
  72.     send_command('bind ^` input /ma Stun <t>')
  73.     send_command('bind @` gs c toggle MagicBurst')
  74.        
  75.     state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  76.     update_active_strategems()
  77.     select_default_macro_book()
  78.  
  79.     custom_timers = {}
  80. end
  81.  
  82. -------------------------------------------------------------------------------------------------------------------
  83. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  84. -------------------------------------------------------------------------------------------------------------------
  85.  
  86. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  87.  
  88. function user_unload()
  89.     send_command('unbind !^`')
  90. end
  91.  
  92.  
  93. function init_gear_sets()
  94.     --------------------------------------
  95.     -- Start defining the sets
  96.     --------------------------------------
  97.  
  98.     -- Precast Sets
  99.  
  100.     -- Precast sets to enhance JAs
  101.  
  102.     sets.precast.JA['Tabula Rasa'] = {legs="Pedagogy Pants +1"}
  103.  
  104.  
  105.     -- Fast cast sets for spells
  106.  
  107.     sets.precast.FC = {main="Oranyan",sub="Clerisy strap",ammo="Sapience orb",
  108.         head=gear.merlhead_fc,neck="Voltsurge torque",ear1="Enchanter earring +1",ear2="loquacious Earring",
  109.         body=gear.melbody_fc,hands="Gendewitha Gages +1",ring1="Prolix Ring",ring2="Weatherspoon Ring",
  110.         back="Perimede cape",waist="Witful Belt",legs="Psycloth lappas",feet=gear.merlfeet_fc }
  111.    
  112.     --main="Apamajas II",sub="Arbuda grip",
  113.     sets.precast.FC.Stun = {main="Oranyan",sub="Clerisy strap",ammo="Sapience orb",
  114.         head=gear.merlhead_fc,neck="Voltsurge Torque",ear1="Enchanter earring +1",ear2="loquacious Earring",
  115.         body=gear.merlbody_fc,hands="Gendewitha Gages +1",ring1="Prolix Ring",ring2="Weatherspoon Ring",
  116.         back="Swith cape +1",waist="Witful Belt",legs="Psycloth lappas",feet=gear.merlfeet_fc}
  117.  
  118.     sets.precast.FC.Arts = {feet="Academic's loafers +1"}
  119.  
  120.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  121.  
  122.     sets.precast.FC['Enhancing Magic'].Stoneskin = set_combine(sets.precast.FC, {waist="Siegel Sash",legs="Doyen pants"})
  123.  
  124.     sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {ear2="Barkarole earring"})
  125.  
  126.     sets.precast.FC.Cure = set_combine(sets.precast.FC,
  127.         {ear1="Mendicant's earring",
  128.         body="Heka's Kalasiris",
  129.         legs="Doyen Pants"})
  130.  
  131.     sets.precast.FC.Curaga = sets.precast.FC.Cure
  132.  
  133.     sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
  134.  
  135.     sets.precast.WS = {
  136.         head="Blistering Sallet",neck="Fotia gorget",ear1="Telos Earring",ear2="Moonshade Earring",
  137.         body="Kaykaus bliaut",hands=gear.chirhands_sc,ring1="Petrov Ring",ring2="Cacoethic Ring",
  138.         back="Aurist's cape +1",waist="Fotia Belt",legs=gear.tellegs_enh,feet=gear.chirfeet}
  139.    
  140.     sets.precast.WS['Myrkr'] = {ammo="Psilomene",
  141.         head="Kaykaus Mitra",neck="Nodens gorget",ear1="loquacious earring", ear2="Moonshade earring",
  142.         body="Amalric doublet", hands="Kaykaus cuffs", ring1="Sangoma ring", ring2="Mephitas's Ring +1",
  143.         back="Aurist's cape +1", waist="Fucho-no-obi", legs="Amalric slops", feet="Arbatel loafers +1"}
  144.  
  145.     sets.precast.WS['Shattersoul'] = {ammo="Pemphredo tathlum",
  146.         head=gear.chirhead,neck="Fotia gorget", ear1="Barkarole earring", ear2="Moonshade earring",
  147.         body="Kaykaus bliaut",hands=gear.chirhands_sc,ring1="Shiva Ring +1",ring2="Shiva Ring +1",
  148.         back="Lugh's cape",waist="Fotia belt", legs="Amalric slops",feet=gear.merlfeet_refresh }
  149.  
  150.     -- Midcast Sets
  151.  
  152.     sets.midcast.FastRecast = {main="Oranyan",sub="Thrace strap",ammo="Hasty pinion +1",
  153.         head=gear.merlhead_fc,neck="Voltsurge Torque",ear1="Loquacious earring",ear2="Enchanter earring +1",
  154.         body=gear.merlbody_fc,hands="Gendewitha Gages +1",ring1="Prolix Ring",ring2="Weatherspoon Ring",
  155.         back="Swith Cape +1",waist="Ninurta's sash",legs="Psycloth lappas",feet=gear.merlfeet_fc}
  156.  
  157.     sets.midcast.Cure = {ammo="Psilomene",
  158.         head="Kaykaus mitra",neck="Incanter's Torque",ear1="Calamitous Earring",ear2="Mendicant's earring",
  159.         body="Kaykaus bliaut",hands="Telchine gloves",ring1="Haoma's Ring",ring2="Lebeche Ring",
  160.         back="Tempered cape +1",waist="Bishop's sash",legs="Academic's pants +1",feet="Vanya clogs"}
  161.  
  162.     sets.midcast.CureWithLightWeather = {main="Chatoyant staff",sub="Arbuda grip",ammo="Psilomene",
  163.         head="Kaykaus mitra",neck="Incanter's Torque",ear1="Calamitous Earring",ear2="Mendicant's earring",
  164.         body="Kaykaus bliaut",hands="Kaykaus cuffs",ring1="Haoma's Ring",ring2="Haoma's Ring",
  165.         back="Twilight cape",waist="Hachirin-no-obi",legs=gear.chirlegs,feet="Vanya clogs"}
  166.  
  167.     sets.midcast.Curaga = sets.midcast.Cure
  168.  
  169.     sets.midcast.SelfCure = set_combine(sets.midcast.Cure, {hands=gear.chirhands_sc,waist="Gishdubar Sash",ring1="Kunaji Ring",ring2="Asklepian Ring"})
  170.  
  171.     sets.midcast.Cursna = set_combine(sets.midcast.FastRecast,{
  172.         head="Kaykaus mitra",neck="Malison Medallion",ear1="Calamitous Earring",
  173.         body="Pedagogy gown +1",hands="Hieros Mittens",ring1="Haoma's Ring",ring2="Haoma's Ring",
  174.         back="Tempered cape +1",waist="Ninurta's sash",legs="Academic's pants +1",feet="Vanya clogs"})
  175.  
  176.     sets.midcast['Enhancing Magic'] = {main="Oranyan",sub="Fulcio grip",ammo="Savant's Treatise",
  177.         head="Telchine Cap",neck="Incanter's Torque",ear1="Andoaa earring",
  178.         body="Telchine Chas.",hands="Telchine gloves",
  179.         waist="Olympus Sash",legs=gear.tellegs_enh,feet="Telchine Pigaches"}
  180.  
  181.     sets.midcast.Storm = sets.midcast['Enhancing Magic']
  182.        
  183.     sets.midcast.Regen = set_combine(sets.midcast['Enhancing Magic'], {main="Bolelabunga",sub="Genmei Shield",
  184.         head="Arbatel Bonnet +1",
  185.         back=gear.RegenCape})
  186.    
  187.     sets.midcast.Haste = set_combine(sets.midcast['Enhancing Magic'],
  188.         {ammo="Sapience orb",
  189.         neck="Voltsurge torque",ear1="Enchanter earring +1",ear2="Loquacious earring",
  190.         ring1="Prolix ring",ring2="Weatherspoon ring",
  191.         back="Swith cape +1",waist="Ninurta's sash"})
  192.  
  193.     sets.midcast.BarElement = set_combine(sets.midcast['Enhancing Magic'],{legs="Shedir seraweels"})
  194.    
  195.     sets.midcast.Refresh = set_combine(sets.midcast['Enhancing Magic'],
  196.         {head="Amalric coif",waist="Gishdubar sash"})
  197.  
  198.     sets.midcast.Phalanx = set_combine(sets.midcast['Enhancing Magic'],
  199.         {})
  200.  
  201.     sets.midcast.Aquaveil = set_combine(sets.midcast['Enhancing Magic'],
  202.         {head=gear.chirhead,
  203.         waist="Emphatikos Rope",legs="Shedir seraweels"})  
  204.  
  205.     sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash",neck="Nodens Gorget",legs="Shedir seraweels"})
  206.  
  207.  
  208.     sets.midcast.Protect = set_combine(sets.midcast['Enhancing Magic'],{ring2="Defending Ring"})
  209.     sets.midcast.Protectra = sets.midcast.Protect
  210.     sets.midcast.Shell = set_combine(sets.midcast['Enhancing Magic'],{ring2="Defending Ring"})
  211.     sets.midcast.Shellra = sets.midcast.Shell
  212.  
  213.  
  214.     -- Custom spell classes
  215.     sets.midcast.MndEnfeebles = {main=gear.EnfeebStaff,sub="Clerisy Strap",ammo="Pemphredo tathlum",
  216.         head=gear.chirhead,neck="Incanter's torque",ear1="Barkarole Earring",ear2="Digni. Earring",
  217.         body=gear.chirbody,hands="Kaykaus cuffs",ring1="Globidonta Ring",ring2="Weatherspoon Ring",
  218.         back="Aurist's cape +1",waist="Luminary Sash",legs=gear.chirlegs,feet="Skaoi Boots"}
  219.  
  220.     sets.midcast.MndEnfeebles.Resistant = {main=gear.EnfeebStaff,sub="Clerisy Strap",ammo="Pemphredo tathlum",
  221.         head=gear.chirhead,neck="Incanter's torque",ear1="Barkarole Earring",ear2="Digni. Earring",
  222.         body=gear.chirbody,hands="Kaykaus cuffs",ring1="Globidonta Ring",ring2="Weatherspoon Ring",
  223.         back="Lugh's cape",waist="Luminary Sash",legs=gear.chirlegs,feet="Skaoi Boots"}
  224.  
  225.     sets.midcast.Dispel = {main=gear.EnfeebStaff,sub="Clerisy Strap",ammo="Pemphredo tathlum",
  226.         head=gear.chirhead,neck="Incanter's torque",ear1="Barkarole Earring",ear2="Digni. Earring",
  227.         body=gear.chirbody,hands="Kaykaus cuffs",ring1="Weatherspoon Ring",ring2="Archon ring",
  228.         back="Lugh's cape",waist="Luminary Sash",legs=gear.chirlegs,feet="Skaoi Boots"}
  229.  
  230.     sets.midcast.Dispel.Resistant = {main=gear.EnfeebStaff,sub="Clerisy Strap",ammo="Pemphredo tathlum",
  231.         head=gear.chirhead,neck="Incanter's torque",ear1="Barkarole Earring",ear2="Digni. Earring",
  232.         body=gear.chirbody,hands="Kaykaus cuffs",ring1="Weatherspoon Ring",ring2="Archon ring",
  233.         back="Lugh's cape",waist="Luminary Sash",legs=gear.chirlegs,feet="Skaoi Boots"}
  234.  
  235.     sets.midcast.IntEnfeebles = {main=gear.EnfeebStaff,sub="Clerisy Strap",ammo="Pemphredo tathlum",
  236.         head=gear.chirhead,neck="Incanter's torque",ear1="Barkarole Earring",ear2="Digni. Earring",
  237.         body=gear.chirbody,hands="Kaykaus cuffs",ring1="Shiva Ring +1",ring2="Shiva Ring +1",
  238.         back="Lugh's cape",waist="Luminary Sash",legs=gear.chirlegs,feet="Skaoi Boots"}
  239.  
  240.     sets.midcast.IntEnfeebles.Resistant = {main=gear.EnfeebStaff,sub="Clerisy Strap",ammo="Pemphredo tathlum",
  241.         head=gear.chirhead,neck="Incanter's torque",ear1="Digni. Earring",ear2="Barkarole Earring",
  242.         body=gear.chirbody,hands="Kaykaus cuffs",ring1="Shiva Ring +1",ring2="Weatherspoon Ring",
  243.         back="Lugh's cape",waist="Luminary Sash",legs=gear.chirlegs,feet="Skaoi Boots"}
  244.    
  245.     sets.midcast.SpecialEnfeebles = {main=gear.EnfeebStaff,sub="Clerisy Strap",ammo="Pemphredo tathlum",
  246.         head="Kaykaus mitra",neck="Incanter's torque",ear1="Barkarole earring", ear2="Digni. earring",
  247.         body=gear.merlbody_nuke,hands="Kaykaus cuffs",ring1="Globidonta ring",ring2="Weatherspoon ring",
  248.         back="Lugh's cape",waist="Luminary sash",legs=gear.chirlegs,feet="Skaoi Boots"}
  249.        
  250.     sets.midcast.SpecialEnfeebles.Resistant = set_combine(sets.midcast.SpecialEnfeebles,
  251.         {head="Amalric coif"})
  252.  
  253.     sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
  254.  
  255.     sets.midcast['Dark Magic'] = {main="Rubicundity",sub="Genmei shield",ammo="Pemphredo tathlum",
  256.         head="Pixie Hairpin +1",neck="Incanter's Torque",ear1="Barkarole Earring",ear2="Gwati Earring",
  257.         body="Shango robe",hands="Amalric gages",ring1="Evanescence Ring",ring2="Archon Ring",
  258.         back=gear.RegenCape,waist="Eschan Stone",legs="Pedagogy pants +1",feet=gear.merlfeet_da}
  259.  
  260.     sets.midcast.Kaustra = {main="Rubicundity",sub="Genmei shield",range=empty,ammo="Pemphredo tathlum",
  261.         head="Pixie Hairpin +1",neck="Incanter's torque",ear1="Barkarole Earring",ear2="Friomisi Earring",
  262.         body=gear.merlbody_nuke,hands="Amalric gages",ring1="Shiva Ring +1",ring2="Archon Ring",
  263.         back="Lugh's cape",waist="Refoccilation Stone",legs=gear.merllegs_nuke,feet=gear.merlfeet_mb}
  264.  
  265.    
  266.  
  267.     sets.midcast.Drain = {main="Rubicundity",sub="Genmei shield",ammo="Pemphredo tathlum",
  268.         head="Pixie Hairpin +1",neck="Incanter's Torque",ear1="Barkarole Earring",ear2="Gwati Earring",
  269.         body=gear.merlbody_da,hands=gear.chirhands_da,ring1="Evanescence Ring",ring2="Archon Ring",
  270.         back=gear.RegenCape,waist="Fucho-no-obi",legs=gear.merllegs_da,feet=gear.merlfeet_da}
  271.  
  272.     sets.midcast.Aspir = sets.midcast.Drain
  273.  
  274.     sets.midcast.Stun = {main="Oranyan",sub="Clerisy Strap",ammo="Hasty Pinion +1",
  275.         head=gear.merlhead_fc,neck="Voltsurge Torque",ear1="Enchanter earring +1",ear2="loquacious Earring",
  276.         body=gear.merlbody_fc,hands="Gendewitha Gages +1",ring1="Rahab Ring",ring2="Weatherspoon Ring",
  277.         back="Swith cape +1",waist="Ninurta's sash",legs="Psycloth lappas",feet=gear.merlfeet_fc}
  278.  
  279.     sets.midcast.Stun.Resistant = set_combine(sets.midcast.Stun, {main="Oranyan",
  280.         back="Perimede cape"})
  281.    
  282.     sets.midcast.Helix = {main=gear.NukeStaff,sub="Thrace Strap",ammo="Dosis Tathlum",
  283.         head=gear.merlhead_nuke, neck="Saevus pendant +1", ear1="Friomisi Earring", ear2="Barkarole earring",
  284.         body=gear.merlbody_nuke, hands=gear.chirhands_nuke, ring1="Shiva Ring +1", ring2="Shiva Ring +1",
  285.         back="Lugh's cape", waist="Refoccilation Stone", legs=gear.merllegs_nuke, feet=gear.merlfeet_mb }
  286.  
  287.     sets.midcast.Helix.Resistant = {main=gear.NukeStaff,sub="Thrace Strap",ammo="Pemphredo Tathlum",
  288.         head=gear.merlhead_nuke, neck="Sanctity Necklace", ear1="Friomisi Earring", ear2="Barkarole earring",
  289.         body=gear.merlbody_nuke, hands=gear.chirhands_nuke, ring1="Shiva Ring +1", ring2="Shiva Ring +1",
  290.         back="Lugh's cape", waist="Eschan Stone", legs=gear.merllegs_nuke, feet=gear.merlfeet_mb }
  291.  
  292.     sets.midcast['Luminohelix II'] = set_combine(sets.midcast.Helix, {ring1="Weatherspoon Ring"})
  293.    
  294.     sets.midcast['Noctohelix II'] = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1",ring1="Archon Ring"})
  295.  
  296.     -- Elemental Magic sets are default for handling low-tier nukes.
  297.     sets.midcast['Elemental Magic'] = {main=gear.NukeStaff,sub="Thrace strap",ammo="Dosis Tathlum",
  298.         head=gear.merlhead_nuke,neck="Saevus pendant +1",ear1="Barkarole Earring",ear2="Friomisi Earring",
  299.         body=gear.merlbody_nuke,hands=gear.chirhands_nuke,ring1="Shiva Ring +1",ring2="Shiva Ring +1",
  300.         back="Lugh's cape",waist="Refoccilation Stone",legs=gear.merllegs_nuke,feet=gear.chirfeet}
  301.  
  302.     sets.midcast['Elemental Magic'].Resistant = {main=gear.NukeStaff,sub="Niobid strap",ammo="Pemphredo tathlum",
  303.         head=gear.merlhead_nuke,neck="Sanctity necklace",ear1="Barkarole Earring",ear2="Friomisi Earring",
  304.         body=gear.merlbody_nuke,hands=gear.chirhands_macc,ring1="Shiva Ring +1",ring2="Shiva Ring +1",
  305.         back="Lugh's cape",waist="Eschan Stone",legs=gear.merllegs_nuke,feet=gear.chirfeet}
  306.  
  307.    
  308.  
  309.     -- Custom refinements for certain nuke tiers
  310.     sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'],
  311.         {sub="Thrace strap",ammo="Pemphredo tathlum",
  312.         })
  313.  
  314.     sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'].Resistant,
  315.         {})
  316.  
  317.     sets.magic_burst = {main=gear.NukeStaff,
  318.         head=gear.merlhead_mb,neck="Mizukage-no-kubikazari",
  319.         body=gear.merlbody_mb,hands="Amalric gages", ring1="Mujin Band",
  320.         legs=gear.merllegs_mb }
  321.  
  322.  
  323.  
  324.     sets.midcast.Impact = {main=gear.EnfeebStaff,sub="Thrace strap",ammo="Pemphredo tathlum",
  325.         head=empty,neck="Incanter's torque",ear1="Barkarole Earring",ear2="Gwati Earring",
  326.         body="Twilight Cloak",hands=gear.chirhands_macc,ring1="Weatherspoon Ring",ring2="Archon Ring",
  327.         back="Lugh's cape",waist="Eschan Stone",legs=gear.merllegs_nuke,feet=gear.merlfeet_mb}
  328.  
  329.  
  330.     -- Sets to return to when not performing an action.
  331.  
  332.     -- Resting sets
  333.     sets.resting = {main="Bolelabunga",sub="Genmei Shield",ammo="Homiliary",
  334.         head="Befouled crown",
  335.         body="Amalric doublet",legs="Assiduity pants +1"}
  336.  
  337.  
  338.     -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  339.  
  340.     sets.idle.Town = {main=gear.NukeStaff,sub="Niobid strap",ammo="Homiliary",
  341.         head="Arbatel bonnet +1",neck="Loricate torque +1",ear1="Sanare Earring",ear2="Infused Earring",
  342.         body=gear.merlbody_nuke,hands=gear.chirhands_sc,ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  343.         back="Solemnity Cape",waist="Slipor Sash",legs="Assiduity pants +1",feet="Herald's gaiters"}
  344.  
  345.     sets.idle.Field = {main="Bolelabunga",sub="Genmei shield",ammo="Homiliary",
  346.         head="Befouled crown",neck="Loricate torque +1",ear1="Sanare Earring",ear2="Zennaroi Earring",
  347.         body="Amalric doublet",hands=gear.chirhands_sc,ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  348.         back="Solemnity Cape",waist="Slipor Sash",legs="Assiduity pants +1",feet=gear.merlfeet_refresh }
  349.  
  350.     sets.idle.Field.PDT = {main="Bolelabunga",sub="Genmei Shield",ammo="Homiliary",
  351.         head="Befouled crown",neck="Loricate torque +1",ear1="Impregnable Earring",ear2="Genmei Earring",
  352.         body="Vrikodara jupon",hands=gear.chirhands_sc,ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  353.         back="Solemnity Cape",waist="Slipor Sash",legs="Assiduity pants +1",feet=gear.merlfeet_refresh }
  354.  
  355.     sets.idle.Field.MDT = {main="Bolelabunga",sub="Genmei Shield",ammo="Homiliary",
  356.         head="Befouled crown",neck="Loricate torque +1",ear1="Sanare Earring",ear2="Zennaroi Earring",
  357.         body="Vrikodara Jupon",hands=gear.chirhands_sc,ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  358.         back="Solemnity cape",waist="Slipor Sash",legs="Assiduity pants +1",feet="Vanya clogs"}
  359.  
  360.  
  361.     sets.idle.Field.Stun = {main="Akademos",sub="Clerisy Strap",ammo="Sapience orb",
  362.         head="Amalric coif",neck="Voltsurge Torque",ear1="Enchanter earring +1",ear2="Loquacious Earring",
  363.         body="Vrikodara jupon",hands="Gendewitha Gages +1",ring1="Prolix Ring",ring2="Sangoma Ring",
  364.         back="Swith Cape +1",waist="Witful Belt",legs="Assiduity pants +1",feet="Pedagogy loafers +1"}
  365.  
  366.     sets.idle.Weak = {main="Bolelabunga",sub="Genmei Shield",ammo="Homiliary",
  367.         head="Befouled crown",neck="Loricate torque +1",ear1="Impregnable Earring",ear2="Genmei Earring",
  368.         body="Vrikodara jupon",hands=gear.chirhands_sc,ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  369.         back="Solemnity Cape",waist="Slipor Sash",legs="Assiduity pants +1",feet=gear.merlfeet_refresh }
  370.  
  371.     -- Defense sets
  372.     --42% discounting main/sub
  373.     sets.defense.PDT = {main="Mafic Cudgel",sub="Genmei Shield",ammo="Brigantia Pebble",
  374.         head=gear.chirhead,neck="Loricate torque +1",ear1="Impregnable Earring",ear2="Genmei Earring",
  375.         body="Vrikodara jupon",hands="Gendewitha Gages +1",ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  376.         back="Solemnity Cape",waist="Slipor Sash",legs=gear.merllegs_dt,feet=gear.merlfeet_dt}
  377.     --35% discounting main/sub
  378.     sets.defense.MDT = {main="Mafic Cudgel",sub="Genmei Shield",ammo="Vanir Battery",
  379.         head=gear.chirhead,neck="Loricate torque +1",ear1="Sanare Earring",ear2="Zennaroi Earring",
  380.         body="Vrikodara Jupon",hands=gear.chirhands_macc,ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  381.         back="Solemnity cape",waist="Slipor Sash",legs=gear.chirlegs_dt,feet=gear.merlfeet_dt }
  382.    
  383.     sets.defense.Meva = set_combine(sets.defense.MDT,{head=gear.chirhead})
  384.  
  385.     sets.Kiting = {feet="Herald's gaiters"}
  386.  
  387.     sets.latent_refresh = {waist="Fucho-no-obi"}
  388.  
  389.     -- Engaged sets
  390.  
  391.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  392.     -- sets if more refined versions aren't defined.
  393.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  394.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  395.  
  396.     -- Normal melee group
  397.     sets.engaged = {
  398.         head="Befouled Crown",neck="Loricate torque +1",
  399.         body="Vrikodara jupon",hands=gear.chirhands_sc,ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  400.         back="Solemnity Cape",waist="Eschan Stone",legs=gear.merllegs_dt,feet=gear.merlfeet_dt }
  401.  
  402.  
  403.     -- Elemental Obi/Twilight Cape --
  404.     sets.Obi = {main=gear.NukeStaff,
  405.         back="Twilight Cape",waist='Hachirin-no-Obi'}
  406.        
  407.     -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  408.     sets.buff['Ebullience'] = {head="Arbatel Bonnet +1"}
  409.     sets.buff['Rapture'] = {head="Arbatel Bonnet +1"}
  410.     sets.buff['Perpetuance'] = {hands="Arbatel bracers +1"}
  411.     sets.buff['Immanence'] = {hands="Arbatel bracers +1",back="Lugh's cape",legs="Amalric slops"}
  412.     sets.buff['Penury'] = {}
  413.     sets.buff['Parsimony'] = {}
  414.     sets.buff['Celerity'] = {feet="Pedagogy Loafers +1"}
  415.     sets.buff['Alacrity'] = {feet="Pedagogy Loafers +1"}
  416.  
  417.     sets.buff['Klimaform'] = {feet="Arbatel loafers +1"}
  418.  
  419.     sets.buff.FullSublimation = {head="Academic's Mortarboard +1", body="Pedagogy Gown +1", ear1="Savant's Earring"}
  420.     sets.buff.PDTSublimation = {head="Academic's Mortarboard +1", body="Pedagogy Gown +1", ear1="Savant's Earring"}
  421.  
  422. end
  423. -- Define sets and vars used by this job file.
  424.  
  425. -------------------------------------------------------------------------
  426. --Pretarget
  427. -------------------------------------------------------------------------
  428. function pretarget(spell, action, spellMap, eventArgs)
  429.     if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  430.         cancel_spell()
  431.         send_command('input /item "Echo Drops" <me>')
  432.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  433.         degrade_spell(spell, Cure_Spells)
  434.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  435.         degrade_spell(spell, Curaga_Spells)
  436.     end
  437. end
  438. -----------------------------------------------------------------
  439. --Precast
  440. ------------------------------------------------------------------
  441. function job_precast(spell, action, spellMap)
  442.     if not midaction() then
  443.         if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  444.         cancel_spell()
  445.         send_command('input /item "Echo Drops" <me>')
  446.             if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  447.                 equip(sets.precast.FC.Cure)
  448.             end
  449.             if spell.english == "Impact" then
  450.                 equip(set_combine(sets.precast.FC,{body="Twilight Cloak"}))
  451.             end
  452.         end
  453.     end
  454. end
  455.  
  456. function job_post_precast(spell, action, spellMap, eventArgs)
  457.         if (buffactive['Addendum: White'] or buffactive['Light Arts']) and spell.type == 'WhiteMagic' then
  458.             equip(sets.precast.FC.Arts)
  459.         end
  460.         if (buffactive['Addendum: Black'] or buffactive['Dark Arts']) and spell.type == 'BlackMagic' then
  461.             equip(sets.precast.FC.Arts)
  462.         end
  463. end
  464.  
  465. -----------------------------------------------------------------------
  466. --Midcast
  467. -------------------------------------------------------------------------
  468. function job_midcast(spell, action, spellMap, eventArgs)
  469.     equipSet = {}
  470.                 if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' or spell.type == 'BardSong' then
  471.                     equipSet = sets.midcast
  472.                 elseif string.find(spell.english,'helix') then
  473.                     equipSet = equipSet.Helix
  474.                         elseif string.find(spell.english,'Cure') then
  475.                             equipSet = equipSet.Cure
  476.                             if spell.target.name == player.name then
  477.                                 equipSet = equipSet.SelfCure
  478.                             end
  479.                         elseif string.find(spell.english,'Cura') then
  480.                             equipSet = equipSet.Curaga
  481.                         elseif string.find(spell.english,'Banish') then
  482.                             equipSet = set_combine(equipSet.MndEnfeebles)
  483.                         elseif spell.english == "Stoneskin" then
  484.                             equipSet = equipSet.Stoneskin
  485.                             if buffactive.Stoneskin then
  486.                                 send_command('cancel stoneskin')
  487.                             end
  488.                         elseif spell.english == "Sneak" then
  489.                             if spell.target.name == player.name and buffactive['Sneak'] then
  490.                                 send_command('cancel sneak')
  491.                             end
  492.                             equipSet = equipSet.Haste
  493.                         elseif string.find(spell.english,'Utsusemi') then
  494.                             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  495.                                 send_command('@wait 1.7;cancel Copy Image*')
  496.                             end
  497.                             equipSet = equipSet.Haste
  498.                         elseif spell.english == 'Monomi: Ichi' then
  499.                             if buffactive['Sneak'] then
  500.                                 send_command('@wait 1.7;cancel sneak')
  501.                             end
  502.                             equipSet = equipSet.Haste
  503.                         else
  504.                         if equipSet[spell.english] then
  505.                                 equipSet = equipSet[spell.english]
  506.                         end
  507.                         if equipSet[spell.skill] then
  508.                                 equipSet = equipSet[spell.skill]
  509.                         end
  510.                         if equipSet[spell.type] then
  511.                                 equipSet = equipSet[spell.type]
  512.                         end
  513.                        
  514.                         if string.find(spell.english,'Cure')  and (world.weather_element == spell.element) or  (world.day_element == spell.element) then
  515.                                 equipSet = set_combine(equipSet,sets.Obi)
  516.                         end    
  517.                         if ((spell.english == 'Drain') or (spell.english == 'Aspir')) and ((world.day_element == spell.element) or (world.weather_element == spell.element)) then
  518.                                 equipSet = set_combine(equipSet,sets.Obi)
  519.                         end  
  520.             end
  521.     if equipSet[spell.english] then
  522.         equipSet = equipSet[spell.english]
  523.     end
  524.     equip(equipSet)
  525. end
  526.  
  527.  
  528. -------------------------------------------------------------------------------------------------------------------
  529. -- Job-specific hooks for standard casting events.
  530. -------------------------------------------------------------------------------------------------------------------
  531.  
  532. -- Run after the general midcast() is done.
  533. function job_post_midcast(spell, action, spellMap, eventArgs)
  534.     if spell.action_type == 'Magic' then
  535.         apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
  536.        if spell.skill == 'Elemental Magic' and spell.english ~= 'Impact' then
  537.             if spell.element == world.day_element or spell.element == world.weather_element then
  538.                 equip(sets.Obi)
  539.                 if string.find(spell.english,'helix') then
  540.                     if state.MagicBurst.value then
  541.                         equip(set_combine(sets.magic_burst,{back=gear.HelixCape}))
  542.                     end
  543.                 elseif state.MagicBurst.value then
  544.                     equip(sets.magic_burst)
  545.                 end
  546.             elseif state.MagicBurst.value then
  547.                 equip(sets.magic_burst)
  548.             end
  549.        end
  550.        if string.find(spell.english,'Cur') and spell.target.name == player.name then
  551.             equip(sets.midcast.SelfCure)
  552.        end
  553.     end
  554.     if not spell.interrupted then
  555.         if spell.english == "Sleep II" then -- Sleep II Countdown --
  556.             send_command('wait 60;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  557.         elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  558.             send_command('wait 30;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  559.         elseif spell.english == "Break" then -- Break Countdown --
  560.             send_command('wait 25;input /echo Break Effect: [WEARING OFF IN 5 SEC.]')
  561.         elseif spell.english == "Poison II" then
  562.             send_command('wait 90;input /echo Poison Effect: [WEARING OFF IN 30 SEC.];wait 20;input /echo Poison Effect: [WEARING OFF IN 10 SEC.]')
  563.         end
  564.     end
  565. end
  566.  
  567. function job_aftercast(spell, action, spellMap, eventArgs)
  568.      if not spell.interrupted then
  569.          if spell.skill == 'Elemental Magic' then
  570.             ---state.MagicBurst:reset()
  571.         elseif spell.skill == 'Enhancing Magic' then
  572.                 --adjust_timers(spell, spellMap)
  573.             end
  574.     end
  575.     handle_equipping_gear(player.status)
  576. end
  577. function job_post_aftercast(spell, action, spellMap, eventArgs)
  578. ---auto_sublimation()
  579. end
  580.  
  581. -- Function to create custom buff-remaining timers with the Timers plugin,
  582.  
  583. -- keeping only the actual valid songs rather than spamming the default
  584.  
  585. -- buff remaining timers.
  586.  
  587. --[[function adjust_timers(spell, spellMap)
  588.     local current_time = os.time()
  589.     local temp_timer_list = {}
  590.     local dur = calculate_duration(spell, spellName, spellMap)
  591.          custom_timers[spell.name] = nil
  592.          send_command('timers delete "'..spell.name..' ['..spell.target.name..']"')
  593.          custom_timers[spell.name] = current_time + dur
  594.          send_command('@wait 1;timers create "'..spell.name..' ['..spell.target.name..']" '..dur..' down')
  595. end
  596.  
  597. function calculate_duration(spell, spellName, spellMap)
  598.  
  599.     local mult = 1.00
  600.  
  601.     if player.equipment.Head == 'Telchine Cap' then mult = mult + 0.09 end
  602.     if player.equipment.Body == 'Telchine Chas.' then mult = mult + 0.09 end
  603.     if player.equipment.Hands == 'Telchine Gloves' then mult = mult + 0.09 end
  604.     if player.equipment.Legs == 'Telchine Braconi' then mult = mult + 0.09 end
  605.     if player.equipment.Feet == 'Telchine Pigaches' then mult = mult + 0.10 end
  606.    
  607.     if player.equipment.Feet == 'Estq. Houseaux +2' then mult = mult + 0.20 end
  608.     if player.equipment.Legs == 'Futhark Trousers' then mult = mult + 0.10 end
  609.     if player.equipment.Legs == 'Futhark Trousers +1' then mult = mult + 0.20 end
  610.     if player.equipment.Hands == 'Atrophy Gloves' then mult = mult + 0.15 end
  611.     if player.equipment.Hands == 'Atrophy Gloves +1' then mult = mult + 0.16 end
  612.     if player.equipment.Back == 'Estoqueur\'s Cape' then mult = mult + 0.10 end
  613.     if player.equipment.Hands == 'Dynasty Mitts' then mult = mult + 0.05 end
  614.     if player.equipment.Body == 'Shabti Cuirass' then mult = mult + 0.09 end
  615.     if player.equipment.Body == 'Shabti Cuirass +1' then mult = mult + 0.10 end
  616.     if player.equipment.Feet == 'Leth. Houseaux' then mult = mult + 0.25 end
  617.     if player.equipment.Feet == 'Leth. Houseaux +1' then mult = mult + 0.30 end
  618.     if player.equipment.Head == 'Erilaz Galea' then mult = mult + 0.10 end
  619.     if player.equipment.Head == 'Erilaz Galea +1' then mult = mult + 0.15 end
  620.  
  621.     local base = 0
  622.  
  623.     if spell.name == 'Haste' then base = base + 180 end
  624.     if spell.name:startswith("Bar") then base = base + 480 end
  625.     if spell.name == 'Aquaveil' then base = base + 600 end
  626.     if string.find(spell.english,'storm') then base = base + 180 end
  627.     if spell.name == 'Auspice' then base = base + 180 end
  628.     if spell.name:startswith("Boost") then base = base + 300 end
  629.     if spell.name == 'Phalanx' then base = base + 180 end
  630.     if spell.name:startswith("Refresh") then base = base + 150 end
  631.     if spell.name:startswith("Regen") then
  632.         base = base + 60
  633.         if buffactive['Light arts'] and player.main_job == 'SCH' then
  634.             base = base*2+60
  635.         -----the *2 here is the additional 60sec from Light Arts job points maxed
  636.         -----+48 is from light arts, +12 more from telchine chas.
  637.         elseif player.main_job == 'WHM' then
  638.             base = base + 60
  639.             if player.equipment.Hands == 'Ebers Mitts' then
  640.                 base = base +  20
  641.             elseif player.equipment.Hands == 'Ebers Mitts +1' then
  642.                 base = base + 22
  643.             end
  644.             if player.equipment.Legs == 'Theo. Pantaloons' or player.equipment.Legs == 'Theo. Pant. +1' then
  645.                 base = base + 18
  646.             end
  647.         end
  648.     end
  649.     if spell.name == 'Adloquium' then base = base + 180 end
  650.     if spell.name:startswith("Animus") then base = base + 180 end
  651.     if spell.name == 'Crusade' then base = base + 300 end
  652.     if spell.name == 'Embrava' then base = base + 90 end
  653.     if spell.name:startswith("En") then base = base + 180 end
  654.     if spell.name:startswith("Flurry") then base = base + 180 end
  655.     if spell.name == 'Foil' then base = base + 30 end
  656.     if spell.name:startswith("Gain") then base = base + 180 end
  657.     if spell.name == 'Reprisal' then base = base + 60 end
  658.     if spell.name:startswith("Temper") then base = base + 180 end
  659.     if string.find(spell.english,'Spikes') then base = base + 180 end
  660.  
  661.     if buffactive['Perpetuance'] then
  662.         if player.equipment.Hands == 'Arbatel Bracers' then
  663.             mult = mult*2.5
  664.         elseif player.equipment.Hands == 'Arbatel Bracers +1' then
  665.             mult = mult*2.55
  666.         else
  667.             mult = mult*2
  668.         end
  669.     end
  670.  
  671.     if buffactive['Composure'] then
  672.         if spell.target.type == 'SELF' then
  673.             mult = mult*3
  674.         else
  675.             mult = mult
  676.         end
  677.     end        
  678.     local totalDuration = math.floor(mult*base)
  679.  
  680.     --print(totalDuration)
  681.  
  682.     return totalDuration
  683. end
  684.  
  685. function reset_timers()
  686.     for i,v in pairs(custom_timers) do
  687.         send_command('timers delete "'..i..'"')
  688.     end
  689.     custom_timers = {}
  690. end]]
  691.  
  692. -------------------------------------------------------------------------------------------------------------------
  693. -- Job-specific hooks for non-casting events.
  694. -------------------------------------------------------------------------------------------------------------------
  695.  
  696. -- Called when a player gains or loses a buff.
  697. -- buff == buff gained or lost
  698. -- gain == true if the buff was gained, false if it was lost.
  699. function job_buff_change(buff, gain)
  700.     if state.Buff[buff] ~= nil then
  701.         state.Buff[buff] = gain
  702.     end
  703.     if buff == "Sublimation: Activated" then
  704.         handle_equipping_gear(player.status)
  705.     end
  706. end
  707.  
  708. function update_sublimation()
  709.     state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  710. end
  711.  
  712. function auto_sublimation()
  713.     local abil_recasts = windower.ffxi.get_ability_recasts()
  714.     if not (buffactive['Sublimation: Activated'] or buffactive['Sublimation: Complete']) then
  715.         if not (buffactive['Invisible'] or buffactive['Weakness']) then
  716.             if abil_recasts[234] == 0 then
  717.                 send_command('@wait 2;input /ja "Sublimation" <me>')
  718.             end
  719.         end
  720.     elseif buffactive['Sublimation: Complete'] then
  721.         if (player.max_mp - player.mp) > 500 and abil_recasts[234] == 0 then
  722.                 send_command('@wait 2;input /ja "Sublimation" <me>')
  723.         end
  724.     end        
  725. end
  726.  
  727. -- Handle notifications of general user state change.
  728. function job_state_change(stateField, newValue, oldValue)
  729.     if stateField == 'Offense Mode' then
  730.         if newValue == 'Locked' then
  731.             disable('main','sub','range')
  732.         else
  733.             enable('main','sub','range')
  734.         end
  735.     end
  736. end
  737.  
  738. -------------------------------------------------------------------------------------------------------------------
  739. -- User code that supplements standard library decisions.
  740. -------------------------------------------------------------------------------------------------------------------
  741.  
  742. -- Custom spell mapping.
  743. function job_get_spell_map(spell, default_spell_map)
  744.     if spell.action_type == 'Magic' then
  745.         if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
  746.             if world.weather_element == 'Light' then
  747.                 return 'CureWithLightWeather'
  748.             end
  749.         elseif spell.skill == 'Enfeebling Magic' then
  750.             if spell.type == 'WhiteMagic' then
  751.                 return 'MndEnfeebles'
  752.             elseif spell.english == 'Frazzle' or spell.english == 'Distract' then
  753.                 return 'SpecialEnfeebles'
  754.             else
  755.                 return 'IntEnfeebles'
  756.             end
  757.         elseif spell.skill == 'Elemental Magic' then
  758.             if info.low_nukes:contains(spell.english) then
  759.                 return 'LowTierNuke'
  760.             elseif info.mid_nukes:contains(spell.english) then
  761.                 return 'MidTierNuke'
  762.             elseif info.high_nukes:contains(spell.english) then
  763.                 return 'HighTierNuke'
  764.             end
  765.         end
  766.     end
  767. end
  768.  
  769. function customize_idle_set(idleSet)
  770.     if state.Buff['Sublimation: Activated'] then
  771.         if state.IdleMode.value == 'Normal' then
  772.             idleSet = set_combine(idleSet, sets.buff.FullSublimation)
  773.         elseif state.IdleMode.value == 'PDT' or state.IdleMode.value == 'MDT' then
  774.             idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
  775.         end
  776.     end
  777.  
  778.     if player.mpp < 51 then
  779.         idleSet = set_combine(idleSet, sets.latent_refresh)
  780.     end
  781.  
  782.     return idleSet
  783. end
  784.  
  785. -- Called by the 'update' self-command.
  786. function job_update(cmdParams, eventArgs)
  787.    -- if cmdParams[1] == 'user' and not (buffactive['light arts']      or buffactive['dark arts'] or
  788.      --                  buffactive['addendum: white'] or buffactive['addendum: black']) then
  789.        -- if state.IdleMode.value == 'Stun' then
  790.          --   send_command('@input /ja "Dark Arts" <me>')
  791.         --else
  792.           --  send_command('@input /ja "Light Arts" <me>')
  793.         --end
  794.     --end
  795.  
  796.     update_active_strategems()
  797.     update_sublimation()
  798. end
  799.  
  800. -- Function to display the current relevant user state when doing an update.
  801. -- Return true if display was handled, and you don't want the default info shown.
  802. function display_current_job_state(eventArgs)
  803.     display_current_caster_state()
  804.     eventArgs.handled = true
  805. end
  806.  
  807. -------------------------------------------------------------------------------------------------------------------
  808. -- User code that supplements self-commands.
  809. -------------------------------------------------------------------------------------------------------------------
  810. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  811. -- Called for direct player commands.
  812. function job_self_command(cmdParams, eventArgs)
  813.     if cmdParams[1]:lower() == 'scholar' then
  814.         handle_strategems(cmdParams)
  815.         eventArgs.handled = true
  816.  
  817.     end
  818. end
  819.  
  820. -------------------------------------------------------------------------------------------------------------------
  821. -- Utility functions specific to this job.
  822. -------------------------------------------------------------------------------------------------------------------
  823.  
  824. -- Reset the state vars tracking strategems.
  825. function update_active_strategems()
  826.     state.Buff['Ebullience'] = buffactive['Ebullience'] or false
  827.     state.Buff['Rapture'] = buffactive['Rapture'] or false
  828.     state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
  829.     state.Buff['Immanence'] = buffactive['Immanence'] or false
  830.     state.Buff['Penury'] = buffactive['Penury'] or false
  831.     state.Buff['Parsimony'] = buffactive['Parsimony'] or false
  832.     state.Buff['Celerity'] = buffactive['Celerity'] or false
  833.     state.Buff['Alacrity'] = buffactive['Alacrity'] or false
  834.  
  835.     state.Buff['Klimaform'] = buffactive['Klimaform'] or false
  836. end
  837.  
  838.  
  839. -- Equip sets appropriate to the active buffs, relative to the spell being cast.
  840. function apply_grimoire_bonuses(spell, action, spellMap)
  841.     if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
  842.         equip(sets.buff['Perpetuance'])
  843.     end
  844.     if (spellMap == 'Cure' or spellMap == 'Curaga') and (buffactive['Light Arts'] or buffactive['Addendum: White']) then
  845.         if state.Buff.Rapture then
  846.                 equip(sets.buff['Rapture'])
  847.         end
  848.     end
  849.     if spell.skill == 'Elemental Magic' and spellMap ~= 'ElementalEnfeeble' then
  850.         if state.Buff.Ebullience and spell.english ~= 'Impact' and not state.MagicBurst.value then
  851.             equip(sets.buff['Ebullience'])
  852.         end
  853.         if state.Buff.Immanence then
  854.             equip(sets.buff['Immanence'])
  855.         end
  856.         if state.Buff.Klimaform and spell.element == world.weather_element then
  857.             equip(sets.buff['Klimaform'])
  858.         end
  859.     end
  860.  
  861.     if state.Buff.Penury then equip(sets.buff['Penury']) end
  862.     if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
  863.     if state.Buff.Celerity then equip(sets.buff['Celerity']) end
  864.     if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
  865. end
  866.  
  867.  
  868. -- General handling of strategems in an Arts-agnostic way.
  869. -- Format: gs c scholar <strategem>
  870. function handle_strategems(cmdParams)
  871.     -- cmdParams[1] == 'scholar'
  872.     -- cmdParams[2] == strategem to use
  873.  
  874.     if not cmdParams[2] then
  875.         add_to_chat(123,'Error: No strategem command given.')
  876.         return
  877.     end
  878.    
  879.     local currentStrats = get_current_strategem_count()
  880.     local newStratCount = currentStrats - 1
  881.     if currentStrats > 0 then
  882.         add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
  883.     else
  884.         add_to_chat(122, '***Out of stratagems! Cancelling...***')
  885.         return
  886.     end
  887.     local strategem = cmdParams[2]:lower()
  888.  
  889.     if strategem == 'light' then
  890.         if buffactive['light arts'] then
  891.             send_command('input /ja "Addendum: White" <me>')
  892.         elseif buffactive['addendum: white'] then
  893.             add_to_chat(122,'Error: Addendum: White is already active.')
  894.         else
  895.             send_command('input /ja "Light Arts" <me>')
  896.         end
  897.     elseif strategem == 'dark' then
  898.         if buffactive['dark arts'] then
  899.             send_command('input /ja "Addendum: Black" <me>')
  900.         elseif buffactive['addendum: black'] then
  901.             add_to_chat(122,'Error: Addendum: Black is already active.')
  902.         else
  903.             send_command('input /ja "Dark Arts" <me>')
  904.         end
  905.     elseif buffactive['light arts'] or buffactive['addendum: white'] then
  906.         if strategem == 'cost' then
  907.             send_command('input /ja Penury <me>')
  908.         elseif strategem == 'speed' then
  909.             send_command('input /ja Celerity <me>')
  910.         elseif strategem == 'aoe' then
  911.             send_command('input /ja Accession <me>')
  912.         elseif strategem == 'power' then
  913.             send_command('input /ja Rapture <me>')
  914.         elseif strategem == 'duration' then
  915.             send_command('input /ja Perpetuance <me>')
  916.         elseif strategem == 'accuracy' then
  917.             send_command('input /ja Altruism <me>')
  918.         elseif strategem == 'enmity' then
  919.             send_command('input /ja Tranquility <me>')
  920.         elseif strategem == 'skillchain' then
  921.             add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
  922.         elseif strategem == 'addendum' then
  923.             send_command('input /ja "Addendum: White" <me>')
  924.         else
  925.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  926.         end
  927.     elseif buffactive['dark arts']  or buffactive['addendum: black'] then
  928.         if strategem == 'cost' then
  929.             send_command('input /ja Parsimony <me>')
  930.         elseif strategem == 'speed' then
  931.             send_command('input /ja Alacrity <me>')
  932.         elseif strategem == 'aoe' then
  933.             send_command('input /ja Manifestation <me>')
  934.         elseif strategem == 'power' then
  935.             send_command('input /ja Ebullience <me>')
  936.         elseif strategem == 'duration' then
  937.             add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
  938.         elseif strategem == 'accuracy' then
  939.             send_command('input /ja Focalization <me>')
  940.         elseif strategem == 'enmity' then
  941.             send_command('input /ja Equanimity <me>')
  942.         elseif strategem == 'skillchain' then
  943.             send_command('input /ja Immanence <me>')
  944.         elseif strategem == 'addendum' then
  945.             send_command('input /ja "Addendum: Black" <me>')
  946.         else
  947.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  948.         end
  949.     else
  950.         add_to_chat(123,'No arts has been activated yet.')
  951.     end
  952. end
  953.  
  954.  
  955. -- Gets the current number of available strategems based on the recast remaining
  956. -- and the level of the sch.
  957. function get_current_strategem_count()
  958.     -- returns recast in seconds.
  959.     local allRecasts = windower.ffxi.get_ability_recasts()
  960.     local stratsRecast = allRecasts[231]
  961.  
  962.     --[[local maxStrategems = (player.main_job_level + 10) / 20]]
  963.     local maxStrategems = 5
  964.    
  965.     local fullRechargeTime = 5*33
  966.  
  967.     local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
  968.  
  969.     return currentCharges
  970. end
  971.  
  972.  
  973. -- Select default macro book on initial load or subjob change.
  974. function select_default_macro_book()
  975.     set_macro_page(1, 18)
  976. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement