Loire

Tuba-SCH

Aug 29th, 2015
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 29.50 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.     include('organizer-lib')
  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.  
  52.         elements.obi_of = {['Light']='Hachirin-no-Obi', ['Dark']='Hachirin-no-Obi', ['Fire']='Hachirin-no-Obi', ['Ice']='Hachirin-no-Obi', ['Wind']='Hachirin-no-Obi',
  53.      ['Earth']='Hachirin-no-Obi', ['Lightning']='Hachirin-no-Obi', ['Water']='Hachirin-no-Obi'}
  54.  
  55.     state.OffenseMode:options('None', 'Normal')
  56.     state.CastingMode:options('Normal', 'Resistant', 'MagicBurst')
  57.     state.IdleMode:options('Normal', 'PDT')
  58.  
  59.  
  60.     info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder"}
  61.     info.helix_nukes = S{"Geohelix", "Hydrohelix", "Anemohelix", "Pyrohelix", "Cryohelix", "Ionohelix", "Luminohelix", "Noctohelix",
  62.                         "Geohelix II", "Hydrohelix II", "Anemohelix II", "Pyrohelix II", "Cryohelix II", "Ionohelix II", "Luminohelix II", "Noctohelix II"}
  63.     info.mid_nukes = S{"Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II",
  64.                        "Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
  65.                        "Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",}
  66.     info.high_nukes = S{"Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  67.  
  68.     info.storm_weather = S{"Sandstorm", "Rainstorm", "Windstorm", "Firestorm", "Hailstorm", "Thunderstorm", "Voidstorm", "Aurorastorm",
  69.     "Sandstorm II", "Rainstorm II", "Windstorm II", "Firestorm II", "Hailstorm II", "Thunderstorm II", "Voidstorm II", "Aurorastorm II"}
  70.  
  71.     gear.macc_hagondes = {name="Hagondes Cuffs", augments={'Phys. dmg. taken -3%','Mag. Acc.+29'}}
  72.  
  73.     send_command('bind ^` input /ma Stun <t>')
  74.     send_command('bind !` input /ma Stun <t>')
  75.     send_command('bind f10 gs c cycle CastingMode')
  76.  
  77. end
  78.  
  79. function user_unload()
  80.     send_command('unbind ^`')
  81.     send_command('unbind !`')  
  82. end
  83.  
  84.  
  85. -- Define sets and vars used by this job file.
  86. function init_gear_sets()
  87.     --------------------------------------
  88.     -- Start defining the sets
  89.     --------------------------------------
  90.  
  91.     -- Precast Sets
  92.     sets.precast.WS['Myrkr'] = {ammo="Vanir Battery",
  93.         head=empty,neck="Orunmila's Torque",ear1="Etiolation Earring",ear2="Gifted Earring",
  94.         body="Respite Cloak",hands="Otomi Gloves",ring1="Prolix Ring",ring2="Sangoma Ring",
  95.         back="Tempered Cape +1",waist="Yamabuki-no-obi",legs="Orvail Pants +1",feet="Regal Pumps +1"}
  96.     -- Precast sets to enhance JAs
  97.  
  98.     sets.precast.JA['Tabula Rasa'] = {legs="Pedagogy Pants"}
  99.  
  100.  
  101.     -- Fast cast sets for spells
  102.  
  103.     sets.precast.FC = {main="Grioavolr",sub="Vivid Strap +1",ammo="Impatiens",
  104.         head="Nahtirah Hat",neck="Orunmila's Torque",ear2="Loquacious Earring",
  105.         body="Anhur Robe",hands="Gende. Gages +1",ring1="Lebeche Ring",ring2="Weather. Ring",
  106.         back="Swith Cape +1",waist="Witful Belt",legs="Psycloth Lappas",feet="Regal Pumps +1"}
  107.  
  108.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  109.  
  110.     sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {})
  111.  
  112.     sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Heka's Kalasiris",back="Pahtli Cape"})
  113.  
  114.     sets.precast.FC.Curaga = sets.precast.FC.Cure
  115.  
  116.     sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
  117.  
  118.     sets.precast.Stoneskin = set_combine(sets.precast.FC['Enhancing Magic'], {head="Umuthi Hat"})
  119.  
  120.     -- Midcast Sets
  121.  
  122.     sets.midcast.FastRecast = {ammo="Incantor Stone",
  123.         head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Gifted Earring",ear2="Loquacious Earring",
  124.         body="Vanir Cotehardie",hands="Gende. Gages +1",ring1="Prolix Ring",ring2="Weather. Ring",
  125.         back="Swith Cape +1",waist="Goading Belt",legs="Psycloth Lappas",feet="Regal Pumps +1"}
  126.  
  127.     sets.midcast.Cure = {main="Tamaxchi",sub="Sors Shield",ammo="Oreiad's Tathlum",
  128.         head="Gende. Caubeen +1",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Novia Earring",
  129.         body="Gendewitha Bliaut +1",hands="Gende. Gages +1",ring1="Weather. Ring",ring2="Sirona's Ring",
  130.         back="Tempered Cape +1",waist="Bishop's Sash",legs="Chironic Hose",feet="Peda. Loafers +1"}
  131.  
  132.     sets.midcast.CureWithLightWeather = {main="Chatoyant Staff",sub="Achaq Grip",ammo="Oreiad's Tathlum",
  133.         head="Gende. Caubeen +1",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Novia Earring",
  134.         body="Gendewitha Bliaut +1",hands="Bokwus Gloves",ring1="Weather. Ring",ring2="Sirona's Ring",
  135.         back="Tempered Cape +1",waist="Bishop's Sash",legs="Chironic Hose",feet="Peda. Loafers +1"}
  136.  
  137.     sets.midcast.Curaga = sets.midcast.Cure
  138.  
  139.     sets.midcast.Regen = {main="Bolelabunga",head="Arbatel Bonnet +1",body="Telchine Chas.",back="Bookworm's Cape"}
  140.  
  141.     sets.midcast.Cursna = {
  142.         neck="Debilis Medallion",ear1="Beatific Earring",ear2="Healing Earring",
  143.         hands="Hieros Mittens",ring1="Haoma's Ring",ring2="Sirona's Ring",
  144.         back="Tempered Cape +1",waist="Bishop's Sash",legs="Assiduity Pants +1",feet="Gende. Galosh. +1"}
  145.  
  146.     sets.midcast['Enhancing Magic'] = {ammo="Savant's Treatise",
  147.         head="Telchine Cap",neck="Colossus's Torque",ear1="Andoaa Earring",ear2="Gifted Earring",
  148.         body="Telchine Chas.",hands="Chironic Gloves",
  149.         back="Merciful Cape",waist="Olympus Sash",legs="Shedir Seraweels", feet="Regal Pumps +1"}
  150.  
  151.     sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {head="Umuthi Hat",waist="Siegel Sash"})
  152.    
  153.     sets.midcast.Aquaveil = set_combine(sets.midcast['Enhancing Magic'], {main="Vadose Rod",legs="Shedir Seraweels"})  
  154.  
  155.     sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {feet="Pedagogy Loafers +1"})
  156.  
  157.     sets.midcast.Protect = set_combine(sets.midcast['Enhancing Magic'], {ring1="Sheltered Ring"})
  158.     sets.midcast.Protectra = sets.midcast.Protect
  159.  
  160.     sets.midcast.Shell = sets.midcast.Protect
  161.     sets.midcast.Shellra = sets.midcast.Shell
  162.  
  163.  
  164.     -- Custom spell classes
  165.     sets.midcast.MndEnfeebles = {main="Grioavolr",sub="Mephitis Grip",range="Aureole",
  166.         head="Befouled Crown",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  167.         body="Vanya Robe",hands="Lurid Mitts",ring1="Weather. Ring",ring2="Levia. Ring +1",
  168.         back="Refraction Cape",waist="Luminary Sash",legs="Psycloth Lappas",feet="Artsieq Boots"}
  169.  
  170.     sets.midcast.IntEnfeebles = {main="Akademos",sub="Mephitis Grip",range="Pemphredo Tathlum",
  171.         head="Befouled Crown",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  172.         body="Vanya Robe",hands="Amalric Gages",ring1="Weather. Ring",ring2="Sangoma Ring",
  173.         back="Refraction Cape",waist="Yamabuki-no-obi",legs="Chironic Hose",feet="Merlinic Crackows"}
  174.  
  175.     sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
  176.  
  177.     sets.midcast['Dark Magic'] = {main="Akademos",sub="Mephitis Grip",range="Pemphredo Tathlum",
  178.         head="Befouled Crown",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  179.         body="Vanya Robe",hands="Amalric Gages",ring1="Weather. Ring",ring2="Sangoma Ring",
  180.         back="Bookworm's Cape",waist="Ninurta's Sash",legs="Chironic Hose",feet="Merlinic Crackows"}
  181.  
  182.     sets.midcast.Kaustra = {main="Akademos",sub="Niobid Strap",ammo="Ghastly Tathlum +1",
  183.         head="Merlinic Hood",neck="Eddy Necklace",ear1="Strophadic Earring",ear2="Friomisi Earring",
  184.         body="Hagondes Coat +1",hands="Amalric Gages",ring1="Shiva Ring +1",ring2="Acumen Ring",
  185.         back="Bookworm's Cape",waist="Yamabuki-no-obi",legs="Chironic Hose",feet="Chironic Slippers"}
  186.  
  187.     sets.midcast.Drain = {main="Grioavolr",sub="Mephitis Grip",range="Pemphredo Tathlum",
  188.         head="Befouled Crown",neck="Weike Torque",ear1="Gwati Earring",ear2="Hirudinea Earring",
  189.         body="Vanya Robe",hands="Amalric Gages",ring1="Weather. Ring",ring2="Sangoma Ring",
  190.         back="Bookworm's Cape",waist="Fucho-no-Obi",legs="Chironic Hose",feet="Chironic Slippers"}
  191.  
  192.     sets.midcast.Aspir = sets.midcast.Drain
  193.  
  194.     sets.midcast.Stun = {main="Grioavolr",sub="Mephitis Grip",ammo="Hasty Pinion +1",
  195.         head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  196.         body="Vanya Robe",hands="Gende. Gages +1",ring1="Prolix Ring",ring2="Sangoma Ring",
  197.         back="Refraction Cape",waist="Ninurta's Sash",legs="Chironic Hose",feet="Chironic Slippers"}
  198.  
  199.     sets.midcast.Stun.Resistant = set_combine(sets.midcast.Stun, {main="Grioavolr"})
  200.  
  201.  
  202.     -- Elemental Magic sets are default for handling low-tier nukes.
  203.     sets.midcast['Elemental Magic'] = {main="Akademos",sub="Niobid Strap",ammo="Pemphredo Tathlum",
  204.         head="Merlinic Hood",neck="Eddy Necklace",ear1="Strophadic Earring",ear2="Friomisi Earring",
  205.         body="Merlinic Jubbah",hands="Chironic Gloves",ring1="Shiva Ring +1",ring2="Acumen Ring",
  206.         back="Bookworm's Cape",waist=gear.ElementalObi,legs="Merlinic Shalwar",feet="Chironic Slippers"}
  207.  
  208.     sets.midcast['Elemental Magic'].Resistant = {main="Akademos",sub="Niobid Strap",ammo="Pemphredo Tathlum",
  209.         head="Merlinic Hood",neck="Eddy Necklace",ear1="Strophadic Earring",ear2="Friomisi Earring",
  210.         body="Merlinic Jubbah",hands="Chironic Gloves",ring1="Shiva Ring +1",ring2="Acumen Ring",
  211.         back="Bookworm's Cape",waist=gear.ElementalObi,legs="Merlinic Shalwar",feet="Chironic Slippers"}
  212.        
  213.     sets.midcast['Elemental Magic'].MagicBurst = {main="Akademos",sub="Niobid Strap",ammo="Pemphredo Tathlum",
  214.         head="Merlinic Hood",neck="Mizu. Kubikazari",ear1="Strophadic Earring",ear2="Friomisi Earring",
  215.         body="Wretched Coat +1",hands="Amalric Gages",ring1="Locus Ring",ring2="Mujin Band",
  216.         back="Seshaw Cape",waist=gear.ElementalObi,legs="Merlinic Shalwar",feet="Merlinic Crackows"}       
  217.  
  218.     sets.midcast['Elemental Magic'].HelixNuke = {main="Akademos",sub="Niobid Strap",ammo="Ghastly Tathlum +1",
  219.         head="Merlinic Hood",neck="Eddy Necklace",ear1="Strophadic Earring",ear2="Friomisi Earring",
  220.         body="Merlinic Jubbah",hands="Amalric Gages",ring1="Shiva Ring +1",ring2="Acumen Ring",
  221.         back="Bookworm's Cape",waist="Yamabuki-no-Obi",legs="Merlinic Shalwar",feet="Merlinic Crackows"}
  222.        
  223.     -- Custom refinements for certain nuke tiers
  224.     sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'], {sub="Niobid Strap"})
  225.  
  226.     sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'].Resistant, {sub="Niobid Strap"})
  227.  
  228.     sets.midcast.Impact = {main="Akademos",sub="Mephitis Grip",ammo="Pemphredo Tathlum",
  229.         head=empty,neck="Eddy Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  230.         body="Twilight Cloak",hands="Amalric Gages",ring1="Shiva Ring +1",ring2="Weather. Ring",
  231.         back="Bookworm's Cape",waist="Yamabuki-no-obi",legs="Chironic Hose",feet="Chironic Slippers"}
  232.  
  233.  
  234.     -- Sets to return to when not performing an action.
  235.  
  236.     -- Resting sets
  237.     sets.resting = {main="Terra's Staff",sub="Oneiros Grip",ammo="Vanir Battery",
  238.         head=empty,neck="Loricate Torque +1",ear1="Black Earring",ear2="Moonshade Earring",
  239.         body="Respite Cloak",hands="Gende. Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  240.         back="Umbra Cape",waist="Slipor Sash",legs="Assiduity Pants +1",feet="Gende. Galosh. +1"}
  241.  
  242.  
  243.     -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  244.  
  245.     sets.idle.Town = {main="Akademos",sub="Oneiros Grip",ammo="Vanir Battery",
  246.         head="Chef's Hat",neck="Wiglen Gorget",ear1="Black Earring",ear2="Moonshade Earring",
  247.         body="Hagondes Coat +1",hands="Arbatel Bracers +1",ring1="Dark Ring",ring2="Dark Ring",
  248.         back="Umbra Cape",waist="Slipor Sash",legs="Chironic Hose",feet="Regal Pumps +1"}
  249.  
  250.     sets.idle.Field = {main="Terra's Staff",sub="Oneiros Grip",ammo="Vanir Battery",
  251.         head="Befouled Crown",neck="Loricate Torque +1",ear1="Black Earring",ear2="Moonshade Earring",
  252.         body="Gende. Bilaut +1",hands="Gende. Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  253.         back="Umbra Cape",waist="Slipor Sash",legs="Assiduity Pants +1",feet="Gende. Galosh. +1"}
  254.  
  255.     sets.idle.Field.PDT = {main="Terra's Staff",sub="Oneiros Grip",ammo="Vanir Battery",
  256.         head="Befouled Crown",neck="Loricate Torque +1",ear1="Black Earring",ear2="Moonshade Earring",
  257.         body="Gende. Bilaut +1",hands="Gende. Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  258.         back="Umbra Cape",waist="Slipor Sash",legs="Assiduity Pants +1",feet="Gende. Galosh. +1"}
  259.  
  260.     sets.idle.Field.Stun = {main="Grioavolr",sub="Mephitis Grip",ammo="Hasty Pinion +1",
  261.         head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  262.         body="Vanya Robe",hands="Gende. Gages +1",ring1="Prolix Ring",ring2="Sangoma Ring",
  263.         back="Refraction Cape",waist="Ninurta's Sash",legs="Psycloth Lappas",feet="Regal Pumps +1"}
  264.  
  265.     sets.idle.Weak = {main="Terra's Staff",sub="Oneiros Grip",ammo="Vanir Battery",
  266.         head="Befouled Crown",neck="Loricate Torque +1",ear1="Black Earring",ear2="Moonshade Earring",
  267.         body="Gende. Bilaut +1",hands="Gende. Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  268.         back="Umbra Cape",waist="Slipor Sash",legs="Assiduity Pants +1",feet="Gende. Galosh. +1"}
  269.  
  270.     -- Defense sets
  271.  
  272.     sets.defense.PDT = {main=gear.Staff.PDT,sub="Oneiros Grip",ammo="Vanir Battery",
  273.         neck="Loricate Torque +1",ear1="Black Earring",ear2="Moonshade Earring",
  274.         body="Respite Cloak",hands="Gende. Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  275.         back="Umbra Cape",waist="Slipor Sash",legs="Assiduity Pants +1",feet="Gende. Galosh. +1"}
  276.  
  277.     sets.defense.MDT = {main=gear.Staff.PDT,sub="Oneiros Grip",ammo="Vanir Battery",
  278.         neck="Loricate Torque +1",ear1="Black Earring",ear2="Moonshade Earring",
  279.         body="Respite Cloak",hands="Gende. Gages +1",ring1="Dark Ring",ring2="Dark Ring",
  280.         back="Umbra Cape",waist="Slipor Sash",legs="Assiduity Pants +1",feet="Gende. Galosh. +1"}
  281.  
  282.     sets.Kiting = {feet="Herald's Gaiters"}
  283.  
  284.     sets.latent_refresh = {waist="Fucho-no-obi"}
  285.  
  286.     -- Engaged sets
  287.  
  288.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  289.     -- sets if more refined versions aren't defined.
  290.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  291.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  292.  
  293.     -- Normal melee group
  294.     sets.engaged = {ammo="Vanir Battery",
  295.         neck="Loricate Torque +1",ear1="Black Earring",ear2="Black Earring",
  296.         body="Respite Cloak",hands="Lurid Mitts",ring1="Dark Ring",ring2="Defending Ring",
  297.         back="Umbra Cape",waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Gende. Galosh. +1"}
  298.  
  299.  
  300.  
  301.     -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  302.     sets.buff['Ebullience'] = {head="Arbatel Bonnet +1"}
  303.     sets.buff['Rapture'] = {head="Arbatel Bonnet +1"}
  304.     sets.buff['Perpetuance'] = {hands="Arbatel Bracers +1"}
  305.     sets.buff['Immanence'] = {hands="Arbatel Bracers +1"}
  306.     sets.buff['Penury'] = {legs="Savant's Pants +2"}
  307.     sets.buff['Parsimony'] = {legs="Savant's Pants +2"}
  308.     sets.buff['Celerity'] = {feet="Pedagogy Loafers +1"}
  309.     sets.buff['Alacrity'] = {feet="Pedagogy Loafers +1"}
  310.  
  311.     sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}
  312.  
  313.     sets.buff.FullSublimation = {body="Respite Cloak",ear1="Savant's Earring"}
  314.         -- head="Academic's Mortarboard",ear1="Savant's Earring",body="Pedagogy Gown
  315.     sets.buff.PDTSublimation = {body="Respite Cloak",ear1="Savant's Earring"}
  316.         -- head="Academic's Mortarboard",ear1="Savant's Earring"
  317.     --sets.buff['Sandstorm'] = {feet="Desert Boots"}
  318. end
  319.  
  320. -------------------------------------------------------------------------------------------------------------------
  321. -- Job-specific hooks for standard casting events.
  322. -------------------------------------------------------------------------------------------------------------------
  323.  
  324. -- Run after the general midcast() is done.
  325. function job_post_midcast(spell, action, spellMap, eventArgs)
  326.     if spell.action_type == 'Magic' then
  327.         apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
  328.     end
  329. end
  330.  
  331. -------------------------------------------------------------------------------------------------------------------
  332. -- Job-specific hooks for non-casting events.
  333. -------------------------------------------------------------------------------------------------------------------
  334.  
  335. -- Called when a player gains or loses a buff.
  336. -- buff == buff gained or lost
  337. -- gain == true if the buff was gained, false if it was lost.
  338. function job_buff_change(buff, gain)
  339.     if buff == "Sublimation: Activated" then
  340.         handle_equipping_gear(player.status)
  341.     end
  342. end
  343.  
  344. -- Handle notifications of general user state change.
  345. function job_state_change(stateField, newValue, oldValue)
  346.     if stateField == 'Offense Mode' then
  347.         if newValue == 'Normal' then
  348.             disable('main','sub','range')
  349.         else
  350.             enable('main','sub','range')
  351.         end
  352.     end
  353. end
  354.  
  355. -------------------------------------------------------------------------------------------------------------------
  356. -- User code that supplements standard library decisions.
  357. -------------------------------------------------------------------------------------------------------------------
  358.  
  359. -- Custom spell mapping.
  360. function job_get_spell_map(spell, default_spell_map)
  361.     if spell.action_type == 'Magic' then
  362.         if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
  363.             if world.weather_element == 'Light' then
  364.                 return 'CureWithLightWeather'
  365.             end
  366.         elseif spell.skill == 'Enfeebling Magic' then
  367.             if spell.type == 'WhiteMagic' then
  368.                 return 'MndEnfeebles'
  369.             else
  370.                 return 'IntEnfeebles'
  371.             end
  372.         elseif spell.skill == 'Elemental Magic' then
  373.             if info.low_nukes:contains(spell.english) then
  374.                 return 'LowTierNuke'
  375.             elseif info.helix_nukes:contains(spell.english) then
  376.                 return 'HelixNuke' 
  377.             elseif info.mid_nukes:contains(spell.english) then
  378.                 return 'MidTierNuke'
  379.             elseif info.high_nukes:contains(spell.english) then
  380.                 return 'HighTierNuke'
  381.             end
  382.         end
  383.     end
  384. end
  385.  
  386. function customize_idle_set(idleSet)
  387.     if state.Buff['Sublimation: Activated'] then
  388.         if state.IdleMode.value == 'Normal' then
  389.             idleSet = set_combine(idleSet, sets.buff.FullSublimation)
  390.         elseif state.IdleMode.value == 'PDT' then
  391.             idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
  392.         end
  393.     end
  394.  
  395.     if player.mpp < 51 then
  396.         idleSet = set_combine(idleSet, sets.latent_refresh)
  397.     end
  398.  
  399.     return idleSet
  400. end
  401.  
  402. -- Called by the 'update' self-command.
  403. function job_update(cmdParams, eventArgs)
  404.     if cmdParams[1] == 'user' and not (buffactive['light arts']      or buffactive['dark arts'] or
  405.                        buffactive['addendum: white'] or buffactive['addendum: black']) then
  406.         if state.IdleMode.value == 'Stun' then
  407.             send_command('@input /ja "Dark Arts" <me>')
  408.         else
  409.             send_command('@input /ja "Light Arts" <me>')
  410.         end
  411.     end
  412.  
  413.     update_active_strategems()
  414.     update_sublimation()
  415. end
  416.  
  417. -- Function to display the current relevant user state when doing an update.
  418. -- Return true if display was handled, and you don't want the default info shown.
  419. function display_current_job_state(eventArgs)
  420.     display_current_caster_state()
  421.     eventArgs.handled = true
  422. end
  423.  
  424. -------------------------------------------------------------------------------------------------------------------
  425. -- User code that supplements self-commands.
  426. -------------------------------------------------------------------------------------------------------------------
  427.  
  428. -- Called for direct player commands.
  429. function job_self_command(cmdParams, eventArgs)
  430.     if cmdParams[1]:lower() == 'scholar' then
  431.         handle_strategems(cmdParams)
  432.         eventArgs.handled = true
  433.     end
  434. end
  435.  
  436. -------------------------------------------------------------------------------------------------------------------
  437. -- Utility functions specific to this job.
  438. -------------------------------------------------------------------------------------------------------------------
  439.  
  440. -- Reset the state vars tracking strategems.
  441. function update_active_strategems()
  442.     state.Buff['Ebullience'] = buffactive['Ebullience'] or false
  443.     state.Buff['Rapture'] = buffactive['Rapture'] or false
  444.     state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
  445.     state.Buff['Immanence'] = buffactive['Immanence'] or false
  446.     state.Buff['Penury'] = buffactive['Penury'] or false
  447.     state.Buff['Parsimony'] = buffactive['Parsimony'] or false
  448.     state.Buff['Celerity'] = buffactive['Celerity'] or false
  449.     state.Buff['Alacrity'] = buffactive['Alacrity'] or false
  450.  
  451.     state.Buff['Klimaform'] = buffactive['Klimaform'] or false
  452. end
  453.  
  454. function update_sublimation()
  455.     state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  456. end
  457.  
  458. -- Equip sets appropriate to the active buffs, relative to the spell being cast.
  459. function apply_grimoire_bonuses(spell, action, spellMap)
  460.     if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
  461.         equip(sets.buff['Perpetuance'])
  462.     end
  463.     if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
  464.         equip(sets.buff['Rapture'])
  465.     end
  466.     if spell.skill == 'Elemental Magic' and spellMap ~= 'ElementalEnfeeble' then
  467.         if state.Buff.Ebullience and spell.english ~= 'Impact' then
  468.             equip(sets.buff['Ebullience'])
  469.         end
  470.         if state.Buff.Immanence then
  471.             equip(sets.buff['Immanence'])
  472.         end
  473.         if state.Buff.Klimaform and spell.element == world.weather_element then
  474.             equip(sets.buff['Klimaform'])
  475.         end
  476.     end
  477.  
  478.     if state.Buff.Penury then equip(sets.buff['Penury']) end
  479.     if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
  480.     if state.Buff.Celerity then equip(sets.buff['Celerity']) end
  481.     if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
  482. end
  483.  
  484.  
  485. -- General handling of strategems in an Arts-agnostic way.
  486. -- Format: gs c scholar <strategem>
  487. function handle_strategems(cmdParams)
  488.     -- cmdParams[1] == 'scholar'
  489.     -- cmdParams[2] == strategem to use
  490.  
  491.     if not cmdParams[2] then
  492.         add_to_chat(123,'Error: No strategem command given.')
  493.         return
  494.     end
  495.     local strategem = cmdParams[2]:lower()
  496.  
  497.     if strategem == 'light' then
  498.         if buffactive['light arts'] then
  499.             send_command('input /ja "Addendum: White" <me>')
  500.         elseif buffactive['addendum: white'] then
  501.             add_to_chat(122,'Error: Addendum: White is already active.')
  502.         else
  503.             send_command('input /ja "Light Arts" <me>')
  504.         end
  505.     elseif strategem == 'dark' then
  506.         if buffactive['dark arts'] then
  507.             send_command('input /ja "Addendum: Black" <me>')
  508.         elseif buffactive['addendum: black'] then
  509.             add_to_chat(122,'Error: Addendum: Black is already active.')
  510.         else
  511.             send_command('input /ja "Dark Arts" <me>')
  512.         end
  513.     elseif buffactive['light arts'] or buffactive['addendum: white'] then
  514.         if strategem == 'cost' then
  515.             send_command('input /ja Penury <me>')
  516.         elseif strategem == 'speed' then
  517.             send_command('input /ja Celerity <me>')
  518.         elseif strategem == 'aoe' then
  519.             send_command('input /ja Accession <me>')
  520.         elseif strategem == 'power' then
  521.             send_command('input /ja Rapture <me>')
  522.         elseif strategem == 'duration' then
  523.             send_command('input /ja Perpetuance <me>')
  524.         elseif strategem == 'accuracy' then
  525.             send_command('input /ja Altruism <me>')
  526.         elseif strategem == 'enmity' then
  527.             send_command('input /ja Tranquility <me>')
  528.         elseif strategem == 'skillchain' then
  529.             add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
  530.         elseif strategem == 'addendum' then
  531.             send_command('input /ja "Addendum: White" <me>')
  532.         else
  533.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  534.         end
  535.     elseif buffactive['dark arts']  or buffactive['addendum: black'] then
  536.         if strategem == 'cost' then
  537.             send_command('input /ja Parsimony <me>')
  538.         elseif strategem == 'speed' then
  539.             send_command('input /ja Alacrity <me>')
  540.         elseif strategem == 'aoe' then
  541.             send_command('input /ja Manifestation <me>')
  542.         elseif strategem == 'power' then
  543.             send_command('input /ja Ebullience <me>')
  544.         elseif strategem == 'duration' then
  545.             add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
  546.         elseif strategem == 'accuracy' then
  547.             send_command('input /ja Focalization <me>')
  548.         elseif strategem == 'enmity' then
  549.             send_command('input /ja Equanimity <me>')
  550.         elseif strategem == 'skillchain' then
  551.             send_command('input /ja Immanence <me>')
  552.         elseif strategem == 'addendum' then
  553.             send_command('input /ja "Addendum: Black" <me>')
  554.         else
  555.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  556.         end
  557.     else
  558.         add_to_chat(123,'No arts has been activated yet.')
  559.     end
  560. end
  561.  
  562.  
  563. -- Gets the current number of available strategems based on the recast remaining
  564. -- and the level of the sch.
  565. function get_current_strategem_count()
  566.     -- returns recast in seconds.
  567.     local allRecasts = windower.ffxi.get_ability_recasts()
  568.     local stratsRecast = allRecasts[231]
  569.  
  570.     local maxStrategems = (player.main_job_level + 10) / 20
  571.  
  572.     local fullRechargeTime = 4*60
  573.  
  574.     local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
  575.  
  576.     return currentCharges
  577. end
  578.  
  579.  
  580. -- Puts in Aftercast timers for sleep and stun lines in linkshell.
  581. function job_aftercast(spell, action, spellMap, eventArgs)
  582.         if not spell.interrupted then
  583.                 if spell.english == "Sleep II" then
  584.                         send_command('timers create "Sleep 2 '..spell.target.name..'" 90 down')
  585.                 elseif spell.english == "Sleep" then
  586.                         send_command('timers create "Sleep '..spell.target.name..'" 60 down')
  587.                 elseif spell.english == "Sleepga" then
  588.                         send_command('timers create "Sleepga '..spell.target.name..'" 60 down')
  589.                 elseif spell.english == "Stun" then
  590.                         send_command('exec StunningBear.txt')
  591.                 end
  592.         end
  593. end
  594.  
  595. -- Select default macro book on initial load or subjob change.
  596. function select_default_macro_book()
  597.     -- Default macro set/book
  598.     if player.sub_job == 'RDM' then
  599.         set_macro_page(1, 2)
  600.     elseif player.sub_job == 'NIN' then
  601.         set_macro_page(1, 2)
  602.     elseif player.sub_job == 'SAM' then
  603.         set_macro_page(1, 2)
  604.     else
  605.         set_macro_page(1, 2)
  606.     end
  607. end
Advertisement
Add Comment
Please, Sign In to add comment