Guest User

Arislan-SCH

a guest
Feb 2nd, 2016
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.10 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job.  Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. --[[
  6.         Custom commands:
  7.  
  8.         Shorthand versions for each strategem type that uses the version appropriate for
  9.         the current Arts.
  10.  
  11.                                         Light Arts              Dark Arts
  12.  
  13.         gs c scholar light              Light Arts/Addendum
  14.         gs c scholar dark                                       Dark Arts/Addendum
  15.         gs c scholar cost               Penury                  Parsimony
  16.         gs c scholar speed              Celerity                Alacrity
  17.         gs c scholar aoe                Accession               Manifestation
  18.         gs c scholar power              Rapture                 Ebullience
  19.         gs c scholar duration           Perpetuance
  20.         gs c scholar accuracy           Altruism                Focalization
  21.         gs c scholar enmity             Tranquility             Equanimity
  22.         gs c scholar skillchain                                 Immanence
  23.         gs c scholar addendum           Addendum: White         Addendum: Black
  24. --]]
  25.  
  26.  
  27.  
  28. -- Initialization function for this job file.
  29. function get_sets()
  30.     mote_include_version = 2
  31.  
  32.     -- Load and initialize the include file.
  33.     include('Mote-Include.lua')
  34. end
  35.  
  36. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  37. function job_setup()
  38.     info.addendumNukes = S{"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
  39.         "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  40.  
  41.     state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  42.     update_active_strategems()
  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('None', 'Normal', 'Refresh')
  52.     state.CastingMode:options('Normal', 'Seidr', 'Resistant')
  53.     state.IdleMode:options('Normal', 'PDT', 'MDT')
  54.    
  55.     state.MagicBurst = M(false, 'Magic Burst')
  56.     state.MPCoat = M(false, 'MP Coat')
  57.    
  58.     info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder"}
  59.     info.mid_nukes = S{"Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II",
  60.                        "Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
  61.                        "Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
  62.                        "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  63.     info.mid_nukes = S{}
  64.     info.high_nukes = S{}
  65.  
  66.     gear.default.weaponskill_waist = "Windbuffet Belt +1"  
  67.     gear.default.obi_waist = "Refoccilation Stone"
  68.     gear.default.obi_back = "Bookworm's Cape"
  69.     gear.MPCoat = "Seidr Cotehardie"
  70.  
  71.     -- Additional local binds
  72.     send_command('bind ^` input /ma Stun <t>')
  73.     send_command('bind !` gs c toggle MagicBurst')
  74.     send_command('bind ^- gs c scholar light')
  75.     send_command('bind ^= gs c scholar dark')
  76.     send_command('bind !- gs c scholar addendum')
  77.     send_command('bind != gs c scholar addendum')
  78.     send_command('bind ^[ gs c scholar power')
  79.     send_command('bind ^] gs c scholar accuracy')
  80.     send_command('bind ![ gs c scholar aoe')
  81.     send_command('bind !] gs c scholar duration')
  82.     send_command('bind ^, input /ma Sneak <stpc>')
  83.     send_command('bind ^. input /ma Invisible <stpc>')
  84.    
  85.     select_default_macro_book()
  86. end
  87.  
  88. -- Called when this job file is unloaded (eg: job change)
  89. function user_unload()
  90.     send_command('unbind ^`')
  91.     send_command('unbind !`')
  92.     send_command('unbind ^-')
  93.     send_command('unbind ^=')
  94.     send_command('unbind !-')
  95.     send_command('unbind !=')
  96.     send_command('unbind ^[')
  97.     send_command('unbind ^]')
  98.     send_command('unbind ![')
  99.     send_command('unbind !]')
  100.     send_command('unbind ^,')
  101.     send_command('unbind !.')
  102. end
  103.  
  104.  
  105.  
  106. -- Define sets and vars used by this job file.
  107. function init_gear_sets()
  108.     --------------------------------------
  109.     -- Start defining the sets
  110.     --------------------------------------
  111.    
  112.     ---- Precast Sets ----
  113.    
  114.     -- Precast sets to enhance JAs
  115.    
  116.    sets.precast.JA['Tabula Rasa'] = {
  117.         legs="Pedagogy Pants"
  118.         }
  119.    
  120.     sets.precast.JA['Enlightenment'] = {
  121.         body="Peda. Gown +1"
  122.         }
  123.  
  124.     -- Fast cast sets for spells
  125.    
  126.     sets.precast.FC = {
  127.         head="Vanya Hood", --10
  128.         body="Shango Robe", --8
  129.         hands="Gende. Gages +1", --7
  130.         legs="Psycloth Lappas", --7
  131.         feet="Regal Pumps +1", --7
  132.         neck="Orunmila's Torque", --5
  133.         ear1="Halasz Earring",
  134.         ear2="Loquacious Earring", --2
  135.         ring1="Prolix Ring", --2
  136.         ring2="Weather. Ring", --5
  137.         back="Swith Cape +1", --3
  138.         waist="Witful Belt", --2
  139.         }
  140.  
  141.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {
  142.         ammo="Impatiens",
  143.         waist="Siegel Sash",
  144.         })
  145.    
  146. --[[    sets.precast.FC.Stoneskin = set_combine(sets.precast.FC['Enhancing Magic'], {
  147.         head="Umuthi Hat",
  148.     })
  149. ]]  
  150.     sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {
  151.         waist="Refoccilation Stone"
  152.         })
  153.    
  154.     sets.precast.FC.Cure = set_combine(sets.precast.FC, {
  155.         sub="Sors Shield", --5
  156.         ammo="Impatiens",
  157.         body="Vanya Robe", --7
  158.         feet="Vanya Clogs", --15
  159.         back="Pahtli Cape",
  160.         })
  161.    
  162.     sets.precast.FC.Curaga = sets.precast.FC.Cure
  163.    
  164. --[[    sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {
  165.         head=empty,
  166.         body="Twilight Cloak"
  167.     })
  168. ]] 
  169.     sets.precast.WS = {
  170.         head="Telchine Cap",
  171.         body="Telchine Chas.",
  172.         hands="Telchine Gloves",
  173.         legs="Telchine Braconi",
  174.         feet="Battlecast Gaiters",
  175.         neck="Lissome Necklace",
  176.         ear1="Steelflash Earring",
  177.         ear2="Bladeborn Earring",
  178.         ring1="Petrov Ring",
  179.         ring2="Ramuh Ring +1",
  180.         back="Toro Cape",
  181.         waist="Windbuffet Belt +1",
  182.         }
  183.  
  184.     sets.precast.WS['Myrkr'] = {
  185.         ammo="Ghastly Tathlum +1",
  186.         head="Pixie Hairpin +1",
  187.         body="Helios Jacket",
  188.         hands="Telchine Gloves",
  189.         legs="Merlinic Shalwar",
  190.         feet="Telchine Pigaches",
  191.         neck="Eddy Necklace",
  192.         ear1="Barkaro. Earring",
  193.         ear2="Loquac. Earring",
  194.         ring1="Mephitas's Ring +1",
  195.         ring2="Sangoma Ring",
  196.         back="Bane Cape",
  197.         waist="Acuity Belt",
  198.         } -- Max MP
  199.    
  200.  
  201.     ---- Precast Sets ----
  202.    
  203.     sets.midcast.FastRecast = {
  204.         head="Merlinic Hood",
  205.         hands="Gende. Gages +1",
  206.         legs="Merlinic Shalwar",
  207.         feet="Regal Pumps +1",
  208.         ear2="Loquac. Earring",
  209.         ring1="Prolix Ring",
  210.         back="Swith Cape +1",
  211.         waist="Witful Belt",
  212.         } -- Haste
  213.    
  214.     sets.midcast.Cure = {
  215.         main="Tamaxchi", --22
  216.         sub="Sors Shield", --3
  217.         head="Gende. Caubeen +1", --10
  218.         body="Vanya Robe",
  219.         hands="Telchine Gloves", --10
  220.         legs="Acad. Pants +1",
  221.         feet="Medium's Sabots", --12
  222.         neck="Incanter's Torque",
  223.         ear2="Loquac. Earring",
  224.         ring1="Haoma's Ring",
  225.         ring2="Sirona's Ring",
  226.         back="Oretan. Cape +1", --6
  227.         waist="Bishop's Sash",
  228.         }
  229.    
  230.     sets.midcast.CureWithLightWeather = set_combine(sets.midcast.Cure, {
  231.         main="Chatoyant Staff",
  232.         })
  233.    
  234.     sets.midcast.Curaga = sets.midcast.Cure
  235.    
  236.     sets.midcast.Regen = {
  237.         main="Bolelabunga",
  238.         sub="Genbu's Shield",
  239.         ammo="Savant's Treatise",
  240.         head="Arbatel Bonnet +1",
  241.         head="Telchine Cap",
  242.         body="Telchine Chas.",
  243.         hands="Telchine Gloves",
  244.         legs="Telchine Braconi",
  245.         feet="Telchine Pigaches",
  246.         neck="Incanter's Torque",
  247.         ear2="Andoaa Earring",
  248.         back="Bookworm's Cape",
  249.         waist="Olympus Sash",
  250.         }
  251.    
  252.     sets.midcast.StatusRemoval = {
  253.         main="Tamaxchi",
  254.         sub="Sors Shield",
  255.         head="Gende. Caubeen +1",
  256.         body="Vanya Robe",
  257.         hands="Telchine Gloves",
  258.         legs="Acad. Pants +1",
  259.         feet="Vanya Clogs",
  260.         neck="Incanter's Torque",
  261.         ear2="Loquac. Earring",
  262.         ring1="Sirona's Ring",
  263.         ring2="Haoma's Ring",
  264.         back="Oretan. Cape +1",
  265.         waist="Bishop's Sash",
  266.         }
  267.    
  268.     sets.midcast.Cursna = {
  269.         feet="Gende. Galoshes +1",
  270.         ring2="Haoma's Ring",
  271.         back="Oretan. Cape +1",
  272.         }
  273.    
  274.     sets.midcast['Enhancing Magic'] = {
  275.         main="Bolelabunga",
  276.         sub="Genbu's Shield",
  277.         ammo="Savant's Treatise",
  278.         head="Befouled Crown",
  279.         body="Telchine Chasuble",
  280.         hands="Telchine Gloves",
  281.         legs="Telchine Braconi",
  282.         feet="Telchine Pigaches",
  283.         neck="Incanter's Torque",
  284.         ear2="Andoaa Earring",
  285.         back="Fi Follet Cape",
  286.         waist="Olympus Sash",
  287.         }
  288.    
  289.     sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {
  290.         neck="Nodens Gorget",
  291.         waist="Siegel Sash",
  292.         })
  293.    
  294.     sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {
  295.         feet="Peda. Loafers",
  296.         })
  297.    
  298.     sets.midcast.Protect = {
  299.         ring2="Sheltered Ring",
  300.         }
  301.  
  302.     sets.midcast.Protectra = sets.midcast.Protect
  303.     sets.midcast.Shell = sets.midcast.Protect
  304.     sets.midcast.Shellra = sets.midcast.Shell
  305.    
  306.     sets.midcast.EnhancingDuration = {
  307.         head="Telchine Cap",
  308.         body="Telchine Chas.",
  309.         hands="Telchine Gloves",
  310.         legs="Telchine Braconi",
  311.         feet="Telchine Pigaches",
  312.         }
  313.    
  314.     -- Custom spell classes
  315.     sets.midcast.MndEnfeebles = {
  316.         main="Akademos",
  317.         sub="Mephitis Grip",
  318. --      range="Aureole",
  319.         head="Merlinic Hood",
  320.         body="Vanya Robe",
  321.         hands="Amalric Gages",
  322.         legs="Psycloth Lappas",
  323.         feet="Medium's Sabots",
  324.         neck="Imbodla Necklace",
  325.         ear1="Barkaro. Earring",
  326.         ear2="Gwati Earring",
  327.         ring1="Sangoma Ring",
  328.         ring2="Weather. Ring",
  329.         back="Aurist's Cape +1",
  330.         waist="Acuity Belt",
  331.         }
  332.    
  333.     sets.midcast.IntEnfeebles = sets.midcast.IntEnfeebles
  334.     sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
  335.    
  336.     sets.midcast['Dark Magic'] = {
  337.         main="Akademos",
  338.         sub="Mephitis Grip",
  339.         ammo="Ghastly Tathlum +1",
  340.         head="Merlinic Hood",
  341.         body="Shango Robe",
  342.         hands="Amalric Gages",
  343.         legs="Pedagogy Pants",
  344.         feet="Medium's Sabots",
  345.         neck="Incanter's Torque",
  346.         ear1="Barkaro. Earring",
  347.         ear2="Gwati Earring",
  348.         ring1="Evanescence Ring",
  349.         ring2="Weather. Ring",
  350.         back="Bookworm's Cape",
  351.         waist=gear.ElementalObi,
  352.         }
  353.    
  354.     sets.midcast.Kaustra = {
  355.         main="Akademos",
  356.         sub="Niobid Strap",
  357.         ammo="Ghastly Tathlum +1",
  358.         head="Pixie Hairpin +1",
  359.         body="Amalric Doublet",
  360.         hands="Amalric Gages",
  361.         legs="Psycloth Lappas",
  362.         feet="Merlinic Crackows",
  363.         neck="Incanter's Torque",
  364.         ear1="Barkaro. Earring",
  365.         ear2="Friomisi Earring",
  366.         ring1="Shiva Ring +1",
  367.         ring2="Shiva Ring +1",
  368.         back=gear.ElementalCape,
  369.         waist=gear.ElementalObi,
  370.         }
  371.    
  372.     sets.midcast.Drain = set_combine(sets.midcast['Dark Magic'], {
  373.         head="Pixie Hairpin +1",
  374.         ear2="Hirudinea Earring",
  375.         ring2="Excelsis Ring",
  376.         waist="Fucho-no-obi",
  377.         })
  378.    
  379.     sets.midcast.Aspir = sets.midcast.Drain
  380.    
  381.     sets.midcast.Stun = sets.midcast['Dark Magic']
  382.    
  383.     -- Elemental Magic
  384.     sets.midcast['Elemental Magic'] = {
  385.         main="Akademos",
  386.         sub="Niobid Strap",
  387.         ammo="Ghastly Tathlum +1",
  388.         head="Merlinic Hood",
  389.         body="Amalric Doublet",
  390.         hands="Amalric Gages",
  391.         legs="Merlinic Shalwar",
  392.         feet="Merlinic Crackows",
  393.         neck="Saevus Pendant +1",
  394.         ear1="Barkaro. Earring",
  395.         ear2="Friomisi Earring",
  396.         ring1="Shiva Ring +1",
  397.         ring2="Shiva Ring +1",
  398.         back="Toro Cape",
  399.         waist=gear.ElementalObi,
  400.         }
  401.  
  402.     sets.midcast['Elemental Magic'].Seidr = set_combine(sets.midcast['Elemental Magic'], {
  403.         body="Seidr Cotehardie",
  404.         })
  405.        
  406.     sets.midcast['Elemental Magic'].Resistant = set_combine(sets.midcast['Elemental Magic'], {
  407.         ear2="Hermetic Earring",
  408.         ring2="Weather. Ring",
  409.         back="Aurist's Cape +1",
  410.         waist="Acuity Belt",
  411.         })
  412.  
  413.     sets.midcast['Elemental Magic'].HighTierNuke = sets.midcast['Elemental Magic']
  414.     sets.midcast['Elemental Magic'].HighTierNuke.Resistant = sets.midcast['Elemental Magic'].Resistant
  415.    
  416. --[[    sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {
  417.         head=empty,
  418.         body="Twilight Cloak"
  419.         })
  420. ]] 
  421.     sets.midcast.Helix = set_combine(sets.midcast['Elemental Magic'], {waist=gear.default.obi_waist})
  422.     sets.midcast.Noctohelix = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})
  423.     sets.midcast.Luminohelix = set_combine(sets.midcast.Helix, {ring1="Weatherspoon Ring"})
  424.    
  425.     ------------------------------------------------------------------------------------------------
  426.     ------------------------------------------ Idle Sets -------------------------------------------
  427.     ------------------------------------------------------------------------------------------------
  428.    
  429.     sets.idle = {
  430.         main="Bolelabunga",
  431.         sub="Genbu's Shield",
  432.         ammo="Homiliary",
  433.         head="Befouled Crown",
  434.         body="Arbatel Gown +1",
  435.         hands="Arbatel Bracers +1",
  436.         legs="Assiduity Pants +1",
  437.         feet="Herald's Gaiters",
  438.         neck="Twilight Torque",
  439.         ear1="Barkaro. Earring",
  440.         ear2="Infused Earring",
  441.         ring1="Shiva Ring +1",
  442.         ring2="Shiva Ring +1",
  443.         back="Bookworm's Cape",
  444.         waist="Refoccilation Stone",
  445.         }
  446.  
  447.     sets.idle.Town = set_combine(sets.idle, {
  448.         main="Akademos",
  449.         sub="Niobid Strap",    
  450.         })
  451.    
  452.     sets.resting = set_combine(sets.idle, {
  453.         main="Chatoyant Staff",
  454.         waist="Austerity Belt +1",
  455.  
  456.         })
  457.    
  458.     ------------------------------------------------------------------------------------------------
  459.     ---------------------------------------- Defense Sets ------------------------------------------
  460.     ------------------------------------------------------------------------------------------------
  461.    
  462.     sets.defense.PDT = {
  463.         main="Bolelabunga",
  464.         sub="Genbu's Shield",
  465.         neck="Twilight Torque",
  466.         ring2="Dark Ring",
  467.         }
  468.    
  469.     sets.defense.MDT = {
  470.         ring2="Dark Ring",
  471.         }
  472.    
  473.     sets.Kiting = {
  474.         feet="Herald's Gaiters"
  475.         }
  476.    
  477.     sets.latent_refresh = {
  478.         waist="Fucho-no-obi"
  479.         }
  480.    
  481.     ------------------------------------------------------------------------------------------------
  482.     ---------------------------------------- Engaged Sets ------------------------------------------
  483.     ------------------------------------------------------------------------------------------------
  484.    
  485.     sets.engaged = {
  486.         head="Telchine Cap",
  487.         body="Helios Jacket",
  488.         hands="Telchine Gloves",
  489.         legs="Telchine Braconi",
  490.         feet="Battlecast Gaiters",
  491.         neck="Lissome Necklace",
  492.         ear1="Steelflash Earring",
  493.         ear2="Bladeborn Earring",
  494.         ring1="Petrov Ring",
  495.         ring2="Ramuh Ring +1",
  496.         back="Bookworm's Cape",
  497.         waist="Windbuffet Belt +1",
  498.         }
  499.    
  500.     sets.engaged.Refresh = sets.idle
  501.    
  502.     ------------------------------------------------------------------------------------------------
  503.     ---------------------------------------- Special Sets ------------------------------------------
  504.     ------------------------------------------------------------------------------------------------
  505.    
  506.     sets.magic_burst = { -- Staff 10
  507.         hands="Amalric Gages", --(5)
  508.         feet="Merlinic Crackows", --11
  509.         neck="Mizu. Kubikazari", --10
  510.         ear2="Static Earring", --5
  511.         ring1="Locus Ring", --5
  512.         ring2="Mujin Band", --(5)
  513.         }
  514.    
  515.     sets.buff['Ebullience'] = {head="Arbatel Bonnet +1"}
  516.     sets.buff['Rapture'] = {head="Arbatel Bonnet +1"}
  517.     sets.buff['Perpetuance'] = {hands="Arbatel Bracers +1"}
  518.     sets.buff['Immanence'] = {hands="Arbatel Bracers +1"}
  519.     sets.buff['Penury'] = {legs="Arbatel Pants +1"}
  520.     sets.buff['Parsimony'] = {legs="Arbatel Pants +1"}
  521.     sets.buff['Celerity'] = {feet="Peda. Loafers"}
  522.     sets.buff['Alacrity'] = {feet="Peda. Loafers"}
  523.     sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}
  524.    
  525.     sets.buff.FullSublimation = {
  526.         head="Acad. Mortar. +1",
  527.         ear1="Savant's Earring",
  528.         body="Peda. Gown +1",
  529.         }
  530. end
  531.  
  532. -------------------------------------------------------------------------------------------------------------------
  533. -- Job-specific hooks for standard casting events.
  534. -------------------------------------------------------------------------------------------------------------------
  535.  
  536. -- Run after the general midcast() is done.
  537. function job_post_midcast(spell, action, spellMap, eventArgs)
  538.     if spell.action_type == 'Magic' then
  539.         apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
  540.     end
  541.     if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
  542.         equip(sets.magic_burst)
  543.     end
  544.     if spell.skill == 'Enhancing Magic' and classes.NoSkillSpells:contains(spell.english) then
  545.         equip(sets.midcast.EnhancingDuration)
  546.     end
  547. end
  548.  
  549. function job_aftercast(spell, action, spellMap, eventArgs)
  550.     if not spell.interrupted then
  551.         if spell.skill == 'Elemental Magic' then
  552.             --state.MagicBurst:reset()
  553.         end
  554.     end
  555. end
  556.  
  557. -------------------------------------------------------------------------------------------------------------------
  558. -- Job-specific hooks for non-casting events.
  559. -------------------------------------------------------------------------------------------------------------------
  560.  
  561. -- Called when a player gains or loses a buff.
  562. -- buff == buff gained or lost
  563. -- gain == true if the buff was gained, false if it was lost.
  564. function job_buff_change(buff, gain)
  565.     if buff == "Sublimation: Activated" then
  566.         handle_equipping_gear(player.status)
  567.     end
  568. end
  569.  
  570. -- Handle notifications of general user state change.
  571. function job_state_change(stateField, newValue, oldValue)
  572.     if stateField == 'Offense Mode' then
  573.         if newValue == 'None' then
  574.             enable('main','sub','range')
  575.         else
  576.             disable('main','sub','range')
  577.         end
  578.     end
  579. end
  580.  
  581. -------------------------------------------------------------------------------------------------------------------
  582. -- User code that supplements standard library decisions.
  583. -------------------------------------------------------------------------------------------------------------------
  584.  
  585. -- Custom spell mapping.
  586. function job_get_spell_map(spell, default_spell_map)
  587.     if spell.action_type == 'Magic' then
  588.         if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
  589.             if world.weather_element == 'Light' then
  590.                 return 'CureWithLightWeather'
  591.             end
  592.         elseif spell.skill == 'Enfeebling Magic' then
  593.             if spell.type == 'WhiteMagic' then
  594.                 return 'MndEnfeebles'
  595.             else
  596.                 return 'IntEnfeebles'
  597.             end
  598.         elseif spell.skill == 'Elemental Magic' then
  599.             if info.low_nukes:contains(spell.english) then
  600.                 return 'LowTierNuke'
  601.             elseif info.mid_nukes:contains(spell.english) then
  602.                 return 'MidTierNuke'
  603.             elseif info.high_nukes:contains(spell.english) then
  604.                 return 'HighTierNuke'
  605.             end
  606.         end
  607.     end
  608. end
  609.  
  610. function customize_idle_set(idleSet)
  611.     if state.Buff['Sublimation: Activated'] then
  612.         if state.IdleMode.value == 'Normal' then
  613.             idleSet = set_combine(idleSet, sets.buff.FullSublimation)
  614.         elseif state.IdleMode.value == 'PDT' then
  615.             idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
  616.         end
  617.     end
  618.  
  619.     if player.mpp < 51 then
  620.         idleSet = set_combine(idleSet, sets.latent_refresh)
  621.     end
  622.  
  623.     return idleSet
  624. end
  625.  
  626. -- Called by the 'update' self-command.
  627. function job_update(cmdParams, eventArgs)
  628. --[[    if cmdParams[1] == 'user' and not (buffactive['light arts']   or buffactive['dark arts'] or
  629.                        buffactive['addendum: white'] or buffactive['addendum: black']) then
  630.         if state.IdleMode.value == 'Stun' then
  631.             send_command('@input /ja "Dark Arts" <me>')
  632.         else
  633.             send_command('@input /ja "Light Arts" <me>')
  634.         end
  635.     end]]
  636.    
  637.     update_active_strategems()
  638.     update_sublimation()
  639. end
  640.  
  641. -- Function to display the current relevant user state when doing an update.
  642. -- Return true if display was handled, and you don't want the default info shown.
  643. function display_current_job_state(eventArgs)
  644.     display_current_caster_state()
  645.     eventArgs.handled = true
  646. end
  647.  
  648. -------------------------------------------------------------------------------------------------------------------
  649. -- User code that supplements self-commands.
  650. -------------------------------------------------------------------------------------------------------------------
  651.  
  652. -- Called for direct player commands.
  653. function job_self_command(cmdParams, eventArgs)
  654.     if cmdParams[1]:lower() == 'scholar' then
  655.         handle_strategems(cmdParams)
  656.         eventArgs.handled = true
  657.     elseif cmdParams[1]:lower() == 'nuke' then
  658.         handle_nuking(cmdParams)
  659.         eventArgs.handled = true
  660.     end
  661. end
  662.  
  663. -------------------------------------------------------------------------------------------------------------------
  664. -- Utility functions specific to this job.
  665. -------------------------------------------------------------------------------------------------------------------
  666.  
  667. -- Reset the state vars tracking strategems.
  668. function update_active_strategems()
  669.     state.Buff['Ebullience'] = buffactive['Ebullience'] or false
  670.     state.Buff['Rapture'] = buffactive['Rapture'] or false
  671.     state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
  672.     state.Buff['Immanence'] = buffactive['Immanence'] or false
  673.     state.Buff['Penury'] = buffactive['Penury'] or false
  674.     state.Buff['Parsimony'] = buffactive['Parsimony'] or false
  675.     state.Buff['Celerity'] = buffactive['Celerity'] or false
  676.     state.Buff['Alacrity'] = buffactive['Alacrity'] or false
  677.  
  678.     state.Buff['Klimaform'] = buffactive['Klimaform'] or false
  679. end
  680.  
  681. function update_sublimation()
  682.     state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  683. end
  684.  
  685. -- Equip sets appropriate to the active buffs, relative to the spell being cast.
  686. function apply_grimoire_bonuses(spell, action, spellMap)
  687.     if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
  688.         equip(sets.buff['Perpetuance'])
  689.     end
  690.     if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
  691.         equip(sets.buff['Rapture'])
  692.     end
  693.     if spell.skill == 'Elemental Magic' and spellMap ~= 'ElementalEnfeeble' then
  694.         if state.Buff.Ebullience and spell.english ~= 'Impact' then
  695.             equip(sets.buff['Ebullience'])
  696.         end
  697.         if state.Buff.Immanence then
  698.             equip(sets.buff['Immanence'])
  699.         end
  700.         if state.Buff.Klimaform and spell.element == world.weather_element then
  701.             equip(sets.buff['Klimaform'])
  702.         end
  703.     end
  704.  
  705.     if state.Buff.Penury then equip(sets.buff['Penury']) end
  706.     if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
  707.     if state.Buff.Celerity then equip(sets.buff['Celerity']) end
  708.     if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
  709. end
  710.  
  711.  
  712. -- General handling of strategems in an Arts-agnostic way.
  713. -- Format: gs c scholar <strategem>
  714. function handle_strategems(cmdParams)
  715.     -- cmdParams[1] == 'scholar'
  716.     -- cmdParams[2] == strategem to use
  717.  
  718.     if not cmdParams[2] then
  719.         add_to_chat(123,'Error: No strategem command given.')
  720.         return
  721.     end
  722.     local strategem = cmdParams[2]:lower()
  723.  
  724.     if strategem == 'light' then
  725.         if buffactive['light arts'] then
  726.             send_command('input /ja "Addendum: White" <me>')
  727.         elseif buffactive['addendum: white'] then
  728.             add_to_chat(122,'Error: Addendum: White is already active.')
  729.         else
  730.             send_command('input /ja "Light Arts" <me>')
  731.         end
  732.     elseif strategem == 'dark' then
  733.         if buffactive['dark arts'] then
  734.             send_command('input /ja "Addendum: Black" <me>')
  735.         elseif buffactive['addendum: black'] then
  736.             add_to_chat(122,'Error: Addendum: Black is already active.')
  737.         else
  738.             send_command('input /ja "Dark Arts" <me>')
  739.         end
  740.     elseif buffactive['light arts'] or buffactive['addendum: white'] then
  741.         if strategem == 'cost' then
  742.             send_command('input /ja Penury <me>')
  743.         elseif strategem == 'speed' then
  744.             send_command('input /ja Celerity <me>')
  745.         elseif strategem == 'aoe' then
  746.             send_command('input /ja Accession <me>')
  747.         elseif strategem == 'power' then
  748.             send_command('input /ja Rapture <me>')
  749.         elseif strategem == 'duration' then
  750.             send_command('input /ja Perpetuance <me>')
  751.         elseif strategem == 'accuracy' then
  752.             send_command('input /ja Altruism <me>')
  753.         elseif strategem == 'enmity' then
  754.             send_command('input /ja Tranquility <me>')
  755.         elseif strategem == 'skillchain' then
  756.             add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
  757.         elseif strategem == 'addendum' then
  758.             send_command('input /ja "Addendum: White" <me>')
  759.         else
  760.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  761.         end
  762.     elseif buffactive['dark arts']  or buffactive['addendum: black'] then
  763.         if strategem == 'cost' then
  764.             send_command('input /ja Parsimony <me>')
  765.         elseif strategem == 'speed' then
  766.             send_command('input /ja Alacrity <me>')
  767.         elseif strategem == 'aoe' then
  768.             send_command('input /ja Manifestation <me>')
  769.         elseif strategem == 'power' then
  770.             send_command('input /ja Ebullience <me>')
  771.         elseif strategem == 'duration' then
  772.             add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
  773.         elseif strategem == 'accuracy' then
  774.             send_command('input /ja Focalization <me>')
  775.         elseif strategem == 'enmity' then
  776.             send_command('input /ja Equanimity <me>')
  777.         elseif strategem == 'skillchain' then
  778.             send_command('input /ja Immanence <me>')
  779.         elseif strategem == 'addendum' then
  780.             send_command('input /ja "Addendum: Black" <me>')
  781.         else
  782.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  783.         end
  784.     else
  785.         add_to_chat(123,'No arts has been activated yet.')
  786.     end
  787. end
  788.  
  789.  
  790. -- Gets the current number of available strategems based on the recast remaining
  791. -- and the level of the sch.
  792. function get_current_strategem_count()
  793.     -- returns recast in seconds.
  794.     local allRecasts = windower.ffxi.get_ability_recasts()
  795.     local stratsRecast = allRecasts[231]
  796.  
  797.     local maxStrategems = (player.main_job_level + 10) / 20
  798.  
  799.     local fullRechargeTime = 4*60
  800.  
  801.     local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
  802.  
  803.     return currentCharges
  804. end
  805.  
  806.  
  807. -- Select default macro book on initial load or subjob change.
  808. function select_default_macro_book()
  809.     set_macro_page(1, 9)
  810. end
Advertisement
Add Comment
Please, Sign In to add comment