Advertisement
Zadora

Zadora_SCH

Sep 29th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 40.65 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. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  35. function job_setup()
  36.     info.addendumNukes = S{"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
  37.         "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  38.  
  39.         Non_Obi_Spells = S{
  40.                         'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  41.                         'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  42.  
  43.         Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  44.         Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  45.  
  46.     state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  47.     update_active_strategems()
  48. end
  49.  
  50. -------------------------------------------------------------------------------------------------------------------
  51. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  52. -------------------------------------------------------------------------------------------------------------------
  53.  
  54. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  55. function user_setup()
  56.     state.OffenseMode:options('None', 'Normal')
  57.     state.CastingMode:options('Normal', 'Resistant', 'Mburst')
  58.     state.IdleMode:options('Normal', 'PDT','MDT','Hybrid')
  59.  
  60.     MagicBurstIndex = 1
  61.     state.MagicBurst = M(false, 'Magic Burst') 
  62.  
  63.     info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder"}
  64.     info.mid_nukes = S{"Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II",
  65.                        "Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
  66.                        "Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",}
  67.     info.high_nukes = S{"Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
  68.  
  69. gear.DarkRing.PDT = {name="Dark Ring", augments={'Phys. dmg. taken -5%','Magic dmg. taken -4%',}}
  70.  gear.RegenCape = {name="Bookworm's Cape", augments={'INT+5','Helix eff. dur. +20','"Regen" potency+10',}}
  71. gear.HelixCape = {name="Bookworm's Cape", augments={'INT+5','Helix eff. dur. +20','"Regen" potency+10',}}
  72.     send_command('bind ^` input /ma Stun <t>')
  73.  
  74.     select_default_macro_book()
  75. end
  76.  
  77. function user_unload()
  78.     send_command('unbind ^`')
  79.     send_command('bind @` gs c toggle MagicBurst')
  80. end
  81.  
  82.  
  83. -- Define sets and vars used by this job file.
  84. function init_gear_sets()
  85.     --------------------------------------
  86.     -- Start defining the sets
  87.     --------------------------------------
  88.  
  89.     -- Precast Sets
  90.  
  91.     -- Precast sets to enhance JAs
  92.  
  93.     sets.precast.JA['Tabula Rasa'] = {legs="Pedagogy Pants"}
  94.  
  95.  
  96.     -- Fast cast sets for spells
  97.  
  98.     sets.precast.FC = {main="",sub="",ammo="",
  99.         head="Pedagogy Mortarboard +1",neck="Voltsurge torque",ear1="",ear2="loquacious Earring",
  100.         body="Vrikodara jupon",hands="Gendewitha Gages",ring1="Prolix Ring",ring2="Lebeche Ring",
  101.         back="Swith Cape",waist="Witful Belt",legs="Psycloth Lappas",feet="Pedagogy loafers +1"}
  102.    
  103.     sets.precast.FC.Arts = {main="",sub="",ammo="",
  104.         head="Pedagogy Mortarboard +1",neck="Voltsurge torque",ear1="Enchanter earring +1",ear2="loquacious Earring",
  105.         body="Vrikodara jupon",hands="Gendewitha Gages",ring1="Prolix Ring",ring2="Lebeche Ring",
  106.         back="Swith Cape",waist="Witful Belt",legs="Psycloth Lappas",feet="Academic's loafers +1"}
  107.  
  108.     sets.precast.FC.Stun = {main="",sub="",ammo="",
  109.         head="Nahtirah Hat",neck="Voltsurge Torque",ear1="Enchanter earring +1",ear2="loquacious Earring",
  110.         body="Vrikodara jupon",hands="Gendewitha Gages",ring1="Prolix Ring",ring2="Sangoma Ring",
  111.         back="Swith Cape",waist="Ninurta's sash",legs="Psycloth Lappasfas",feet="Pedagogy loafers +1"}
  112.  
  113.     sets.precast.FC.Haste = {main="",sub="",ammo="",
  114.         head="Arbatel Bonnet",neck="Voltsurge torque",ear1="Enchanter earring +1",ear2="loquacious Earring",
  115.         body="Arbatel gown +1",hands="Arbatel bracers +1",ring1="Prolix Ring",ring2="Lebeche Ring",
  116.         back="Ogapepo cape",waist="Witful Belt",legs="Arbatel pants +1",feet="Arbatel loafers +1"}
  117.  
  118.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  119.  
  120.     sets.precast.FC['Enhancing Magic'].Stoneskin = set_combine(sets.precast.FC, {head="Umuthi Hat",waist="Siegel Sash",legs="Doyen pants"})
  121.  
  122.     sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="",ear2="Barkarole earring"})
  123.  
  124.     sets.precast.FC.Cure = set_combine(sets.precast.FC,
  125. {main="",sub="",body="Heka's Kalasiris",back="Pahtli Cape",legs="Doyen Pants"})
  126.  
  127.     sets.precast.FC.Curaga = sets.precast.FC.Cure
  128.  
  129.     sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
  130.  
  131.     sets.precast.WS = {
  132.         head="Nahtirah Hat",neck="Fotia gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  133.         body="Vanya robe",hands="Gendewitha Gages",ring1="Rajas Ring",ring2="Metamorph Ring",
  134.         back="Refraction Cape",waist="Fotia Belt",legs="Telchine Braconi",feet="Battlecast gaiters"}
  135.    
  136.  
  137.  
  138.     -- Midcast Sets
  139.  
  140.     sets.midcast.FastRecast = {ammo="",
  141.         head="Nahtirah Hat",ear1="Enchanter earring +1",ear2="Loquacious Earring",
  142.         body="Vrikodara jupon",hands="Gendewitha Gages",ring1="Prolix Ring",
  143.         back="Swith Cape",waist="Witful Belt",legs="Psycloth Lappas",feet="Pedagogy loafers +1"}
  144.  
  145.     sets.midcast.Cure = {main="",sub="",ammo="Psilomene",
  146.         head="",neck="Colossus's Torque",ear1="",ear2="",
  147.         body="Pedagogy gown +1",hands="Telchine gloves",ring1="Lebeche Ring",ring2="Sirona's Ring",
  148.         back="Tempered Cape",waist="",legs="Academic's pants +1",feet="Medium's Sabots"}
  149.  
  150.     sets.midcast.CureWithLightWeather = {main="Tamaxchi",sub="Genbu's Shield",ammo="Psilomene",
  151.         head="Kaykaus mitra",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Beatific Earring",
  152.         body="Arbatel gown +1",hands="Pedagogy bracers",ring1="Lebeche Ring",ring2="Sirona's Ring",
  153.         back="Tempered Cape",waist="Bishop's sash",legs="Academic's pants +1",feet="Vanya clogs"}
  154.  
  155.     sets.midcast.Curaga = sets.midcast.Cure
  156.  
  157.  
  158.     sets.midcast.Cursna = set_combine(sets.midcast.FastRecast,{
  159.         neck="Malison Medallion",ear2="Beatific Earring",
  160.         body="Pedagogy gown +1",hands="Hieros Mittens",ring1="Ephedra Ring",ring2="Sirona's Ring",
  161.         back="Tempered Cape",waist="Bishop's Sash",legs="Academic's Pants +1",feet="Vanya clogs"})
  162.  
  163.     sets.midcast['Enhancing Magic'] = {main="",sub="",ammo="",
  164.         head="Arbatel Bonnet",neck="Incanter's Torque",ear1="",
  165.         body="",hands="Arbatel bracers +1",back="",
  166.         waist="",legs="Academic's pants +1",feet=""}
  167.    
  168.     sets.midcast.Regen = set_combine(sets.midcast['Enhancing Magic'], {main="Bolelabunga",sub="Genbu's Shield",
  169.         legs="",back=gear.RegenCape})
  170.  
  171.     sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash",neck="",ear1=""})
  172.  
  173.     sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {feet="Pedagogy Loafers +1"})
  174.  
  175.     --Refresh Spell--
  176.     sets.midcast.Refresh = set_combine(sets.midcast['Enhancing Magic'], {head="Amalric Coif",waist="Gishdubar Sash",feet="Inspirited Boots"})
  177.  
  178.     --Protect/Shell--
  179.     sets.midcast.Protect = {ring1="Sheltered Ring"}
  180.     sets.midcast.Protectra = sets.midcast.Protect
  181.  
  182.     sets.midcast.Shell = {ring1="Sheltered Ring"}
  183.     sets.midcast.Shellra = sets.midcast.Shell
  184.  
  185.  
  186.     -- Custom spell classes
  187.     sets.midcast.MndEnfeebles = {main="Akademos",sub="",ammo="Aurole",
  188.         head="Befouled Crown",neck="Incanter's Torque",ear1="Barkarole Earring",ear2="Gwati Earring",
  189.         body="Vanya Robe",hands="",ring1="Globidonta Ring",ring2="Sangoma Ring",
  190.         back="",waist="",legs="Psycloth Lappas",feet="Medium's sabots"}
  191.  
  192. sets.midcast.MndEnfeebles.Resistant = {main="Akademos",sub="Mephitis Grip",ammo="Plumose sachet",
  193.         head="",neck="Incanter's Torque",ear1="Barkarole Earring",ear2="Gwati Earring",
  194.         body="Vanya Robe",hands="Kaykaus cuffs",ring1="Globidonta Ring",ring2="Metamorph Ring",
  195.         back="",waist="",legs="Psycloth Lappas",feet="Medium's sabots"}
  196.  
  197.     sets.midcast.IntEnfeebles = {main="Akademos",sub="Benthos Grip",ammo="Plumose sachet",
  198.         head="Helios Band",neck="Imbodla necklace",ear1="Psystorm Earring",ear2="Barkarole Earring",
  199.         body="Vanya Robe",hands="Kaykaus cuffs",ring1="Globidonta Ring",ring2="Metamorph Ring",
  200.         back="Refraction Cape",waist="Eschan Stone",legs="Arbatel pants +1",feet="Medium's sabots"}
  201.  
  202.     sets.midcast.IntEnfeebles.Resistant = {main="Akademos",sub="Mephitis Grip",ammo="Plumose sachet",
  203.         head="Helios Band",neck="Imbodla necklace",ear1="Gwati Earring",ear2="Barkarole Earring",
  204.         body="Vanya Robe",hands="Kaykaus cuffs",ring1="Globidonta Ring",ring2="Metamorph Ring",
  205.         back="Refraction Cape",waist="Eschan Stone",legs="Arbatel pants +1",feet="Medium's sabots"}
  206.  
  207.  
  208.     sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
  209.  
  210.     sets.midcast['Dark Magic'] = {main="Rubicundity",sub="Genbu's shield",ammo="Plumose sachet",
  211.         head="Helios band",neck="Aesir Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  212.         body="Arbatel gown +1",hands="Helios Gloves",ring1="Evanescence Ring",ring2="Sangoma Ring",
  213.         back=gear.HelixCape,waist="Eschan Stone",legs="Arbatel pants +1",feet="Helios boots"}
  214.  
  215.     sets.midcast.Kaustra = {main="Akademos",sub="Benthos Grip",ammo="Plumose sachet",
  216.         head="Buremte Hat",neck="Eddy Necklace",ear1="Barkarole Earring",ear2="Friomisi Earring",
  217.         body="Witching Robe",hands="Loagaeth cuffs",ring1="Metamorph Ring",ring2="Acumen Ring",
  218.         back="Bookworm's cape",waist="Eschan Stone",legs="Arbatel Pants +1",feet="Inspirited Boots"}
  219.  
  220.     sets.midcast.Drain = {main="",sub="",ammo="",
  221.         head="Amalric Coif",neck="Icantor's Torque",ear1="Barkarole Earring",ear2="Gwati Earring",
  222.         body="Arbatel gown +1",hands="Helios Gloves",ring1="Evanescence Ring",ring2="Sangoma Ring",
  223.         back=gear.HelixCape,waist="Fucho-no-Obi",legs="Pedagogy pants",feet="Helios boots"}
  224.  
  225.     sets.midcast.Aspir = sets.midcast.Drain
  226.  
  227.     sets.midcast.Stun = {main="Apamajas II",sub="Arbuda Grip",ammo="Incantor Stone",
  228.         head="Nahtirah Hat",neck="Voltsurge Torque",ear1="Enchanter earring +1",ear2="loquacious Earring",
  229.         body="Vrikodara Jupon",hands="Gendewitha Gages",ring1="Prolix Ring",ring2="Sangoma Ring",
  230.         back="Swith Cape",waist="Ninurta's sash",legs="Lengo pants",feet="Pedagogy loafers +1"}
  231.  
  232.     sets.midcast.Stun.Resistant = set_combine(sets.midcast.Stun, {main="Marin Staff",ammo="Plumose sachet"})
  233.    
  234.     sets.midcast.Helix = {main="Akademos",sub="Zuuxowu Grip",ammo="Dosis Tathlum",
  235.         head="Buremte Hat", neck="Saevus pendant +1", ear1="Friomisi Earring", ear2="Barkarole earring",
  236.         body="Witching robe", hands="Otomi Gloves", ring1="Metamorph Ring", ring2="Acumen Ring",
  237.         back=gear.HelixCape, waist="Eschan Stone", legs="Hagondes Pants", feet="Inspirited Boots"}
  238.  
  239.     sets.midcast.Helix.Mburst = {main="Akademos",sub="Willpower Grip",ammo="Dosis Tathlum",
  240.         head="Helios band", neck="Saevus pendant +1", ear1="Friomisi Earring", ear2="Barkarole earring",
  241.         body="Helios Jacket", hands="Helios Gloves", ring1="Locus Ring", ring2="Acumen Ring",
  242.         back=gear.HelixCape, waist="Eschan Stone", legs="Hagondes Pants", feet="Helios Boots"}
  243.  
  244.  
  245.     -- Elemental Magic sets are default for handling low-tier nukes.
  246.     sets.midcast['Elemental Magic'] = {main="Akademos",sub="Zuuxowu grip",ammo="Dosis Tathlum",
  247.         head="Helios Band",neck="Saevus pendant +1",ear1="Barkarole Earring",ear2="Friomisi Earring",
  248.         body="Witching Robe",hands="Amalric Gages",ring1="Shiva Ring +1",ring2="Shiva Ring +1",
  249.         back="Bookworm's cape",waist="Eschan Stone",legs="Amalric Slops",feet="Amalric Nails"}
  250.  
  251.     sets.midcast['Elemental Magic'].Resistant = {main="Akademos",sub="Benthos Grip",ammo="Plumose sachet",
  252.         head="Helios Band",neck="Eddy Necklace",ear1="Barkarole Earring",ear2="Friomisi Earring",
  253.         body="Arbatel gown +1",hands="Amalric Gages",ring1="Metamorph Ring",ring2="Acumen Ring",
  254.         back="Bookworm's Cape",waist="Eschan Stone",legs="",feet="Helios Boots"}
  255.  
  256.     sets.midcast['Elemental Magic'].MBurst = {main="Akademos",sub="Wiseman Grip",ammo="Dosis Tathlum",
  257.         head="Helios Band",neck="Mizu. Kubikazari",ear1="Barkarole Earring",ear2="Friomisi Earring",
  258.         body="Helios Jacket",hands="Amalric Gages",ring1="Mujin Ring",ring2="Locus Ring",
  259.         back="Bookworm's cape",waist="Refoccilation Stone",legs="Amalric Slops",feet="Helios Boots"}
  260.  
  261. --Magic Burst--
  262.     sets.magic_burst = {head="Helios band",neck="Mizukage-no-Kubikazari",body="Helios Jacket",hands="Amalric Gages",
  263.         ring1="Locus Ring", ring2="Mujin Band",feet="Amalric Nails"}
  264.        
  265.     -- Custom refinements for certain nuke tiers
  266.     sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'],
  267.         {sub="Willpower grip",ammo="Witchstone",hands="Amalric Gages",feet="Helios Boots"})
  268.  
  269.     sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'].Resistant,
  270.         {sub="Willpower grip",body="Witching Robe",hands="Amalric Gages"})
  271.  
  272.     sets.midcast['Elemental Magic'].HighTierNuke.MBurst = {main="Akademos",sub="Willpower grip",ammo="Dosis Tathlum",
  273.         head="Helios Band",neck="Mizu. Kubikazari",ear1="Barkarole Earring",ear2="Friomisi Earring",
  274.         body="Amalric Doublet",hands="Amalric Gages",ring1="Mujin Ring",ring2="Locus Ring",
  275.         back="Bookworm's cape",waist="Refoccilation Stone",legs="Amalric Slops",feet="Amalric Nails"}
  276.  
  277.  
  278.  
  279.     sets.midcast.Impact = {main="Akademos",sub="Mephitis Grip",ammo="Dosis Tathlum",
  280.         head=empty,neck="Eddy Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
  281.         body="Twilight Cloak",hands="Lurid Mitts",ring1="Metamorph Ring",ring2="Sangoma Ring",
  282.         back="Bookworm's Cape",waist="Eschan Stone",legs="Arbatel Pants +1",feet="Medium's Sabots"}
  283.  
  284.  
  285.     -- Sets to return to when not performing an action.
  286.  
  287.     -- Resting sets
  288.     sets.resting = {main="Bolelabunga",sub="Genbu's Shield",
  289.         head="Befouled Crown",
  290.         body="Witching Robe",hands="Serpentes Cuffs",legs="Assiduity Pants",feet="Serpentes Sabots"}
  291.  
  292.  
  293.     -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  294.  
  295.     sets.idle.Town = {main="Akademos",sub="Willpower Grip",ammo="",
  296.         head="Arbatel Bonnet",neck="Twilight Torque",ear1="",ear2="",
  297.         body="Witching Robe",hands="",ring1="",ring2="Defending Ring",
  298.         back="Izdubar Mantle",waist="",legs="Assiduity pants",feet="Herald's Gaiters"}
  299.  
  300.     sets.idle.Field = {main="Akademos",sub="Willpower grip",ammo="",
  301.         head="Befouled Crown",neck="Twilight torque",ear1="Barkarole Earring",ear2="",
  302.         body="Witching Robe",hands="Amalric Gages",ring1="Defending Ring",ring2="Vocane Ring",
  303.         back="Izdubar Mantle",waist="Fucho-no-Obi",legs="Assiduity Pants",feet="Herald's Gaiters"}
  304.  
  305.     sets.idle.Field.PDT = {main="Mafic Cudgel",sub="Genbu's Shield",ammo="Impatiens",
  306.         head="Hagondes Hat",neck="Twilight Torque",ear1="Sanare Earring",ear2="Spellbreaker Earring",
  307.         body="Vrikodara Jupon",hands="Gendewitha Gages",ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  308.         back="Repulse Mantle",waist="Slipor Sash",legs="Hagondes pants",feet="Battlecast gaiters"}
  309.  
  310. sets.idle.Field.MDT = {main="Bolelabunga",sub="Genbu's Shield",ammo="Impatiens",
  311.         head="Arbatel Bonnet",neck="Twilight Torque",ear1="Sanare Earring",ear2="Spellbreaker Earring",
  312.         body="Onca Suit",hands=empty,ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  313.         back="Hexerei cape",waist="Slipor Sash",legs=empty,feet=empty}
  314.  
  315.  
  316. sets.idle.Field.Hybrid = {main="Mafic Cudgel",sub="Genbu's Shield",ammo="Impatiens",
  317.         head="Hagondes Hat",neck="Twilight Torque",ear1="Sanare Earring",ear2="Spellbreaker Earring",
  318.         body="Onca Suit",hands=empty,ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  319.         back="Hexerei cape",waist="Slipor Sash",legs=empty,feet=empty}
  320.  
  321.  
  322.     sets.idle.Field.Stun = {main="Akademos",sub="Mephitis Grip",ammo="Impatiens",
  323.         head="Nahtirah Hat",neck="Aesir Torque",ear1="Enchanter earring +1",ear2="Loquacious Earring",
  324.         body="Vrikodara jupon",hands="Gendewitha Gages",ring1="Prolix Ring",ring2="Sangoma Ring",
  325.         back="Swith Cape",waist="Witful Belt",legs="Assiduity Pants",feet="Pedagogy loafers +1"}
  326.  
  327.     sets.idle.Weak = {main="Akademos",sub="Mephitis grip",ammo="Incantor Stone",
  328.         head=empty,neck="Twilight Torque",ear1="Sanare Earring",ear2="",
  329.         body="",hands="Gendewitha Gages",ring1="",ring2="",
  330.         back="",waist="",legs="Assiduity Pants",feet=""}
  331.  
  332.     -- Defense sets
  333.  
  334.     sets.defense.PDT = {main="Mafic Cudgel",sub="Genbu's Shield",ammo="Impatiens",
  335.         head="Arbatel Bonnet",neck="Twilight Torque",ear1="Sanare Earring",ear2="Spellbreaker Earring",
  336.         body="Vrikodara Jupon",hands="Gendewitha Gages",ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  337.         back="Repulse Mantle",waist="Slipor Sash",legs="Hagondes pants",feet="Battlecast gaiters"}
  338.  
  339.     sets.defense.MDT = {main="Akademos",sub="Vallus grip",ammo="Incantor Stone",
  340.         head="Nahtirah Hat",neck="Twilight Torque",ear1="Sanare Earring",ear2="Spellbreaker Earring",
  341.         body="Vanya Robe",hands="Gendewitha Gages",ring1=gear.DarkRing.PDT,ring2="Defending Ring",
  342.         back="Hexerei Cape",waist="Slipor Sash",legs="Hagondes pants",feet="Battlecast gaiters"}
  343.  
  344.     sets.Kiting = {ring1=""}
  345.  
  346.     sets.latent_refresh = {waist="Fucho-no-obi"}
  347.  
  348.     -- Engaged sets
  349.  
  350.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  351.     -- sets if more refined versions aren't defined.
  352.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  353.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  354.  
  355.     -- Normal melee group
  356.     sets.engaged = {
  357.         head="Umuthi Hat",neck="Twilight Torque",ear1="Steelflash Earring",ear2="Bladeborn Earring",
  358.         body="Onca Suit",hands=empty,ring1="Rajas Ring",ring2="Defending Ring",
  359.         back="Hexerei Cape",waist="Eschan Stone",legs=empty,feet=empty}
  360.  
  361.  
  362.     -- Elemental Obi/Twilight Cape --
  363.         sets.Obi = {main="Akademos",back="Twilight Cape",waist='Hachirin-no-Obi'}
  364.        
  365.  
  366.     -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  367.     sets.buff['Ebullience'] = {head="Arbatel Bonnet"}
  368.     sets.buff['Rapture'] = {head="Arbatel Bonnet"}
  369.     sets.buff['Perpetuance'] = {hands="Arbatel bracers +1"}
  370.     sets.buff['Immanence'] = {hands="Arbatel bracers +1", legs="Amalric Slops"}
  371.     sets.buff['Penury'] = {legs="Arbatel pants +1"}
  372.     sets.buff['Parsimony'] = {legs="Arbatel pants +1"}
  373.     sets.buff['Celerity'] = {feet="Pedagogy Loafers +1"}
  374.     sets.buff['Alacrity'] = {feet="Pedagogy Loafers +1"}
  375.  
  376.     sets.buff['Klimaform'] = {feet="Arbatel loafers +1"}
  377.  
  378.     sets.buff.FullSublimation = {head="Academic's Mortarboard +1", body="Pedagogy Gown +1", ear1="Savant's Earring"}
  379.     sets.buff.PDTSublimation = {head="Academic's Mortarboard +1",ear1="Savant's Earring"}
  380.  
  381. end
  382.  
  383. -------------------------------------------------------------------------
  384. --Pretarget
  385. -------------------------------------------------------------------------
  386. function pretarget(spell,action)
  387.     if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  388.                         cancel_spell()
  389.                         send_command('input /item "Echo Drops" <me>')
  390.                 elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  391.                         degrade_spell(spell,Cure_Spells)
  392.                 elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  393.                         degrade_spell(spell,Curaga_Spells)
  394.                 elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  395.                         if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  396.                                 cancel_spell()
  397.                                 send_command('input /ja Addendum: White <me>')
  398.                         elseif spell.english == "Manifestation" then
  399.                                 cancel_spell()
  400.                                 send_command('input /ja Accession <me>')
  401.                         elseif spell.english == "Alacrity" then
  402.                                 cancel_spell()
  403.                                 send_command('input /ja Celerity <me>')
  404.                         elseif spell.english == "Parsimony" then
  405.                                 cancel_spell()
  406.                                 send_command('input /ja Penury <me>')
  407.                 end
  408.                 elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  409.                         if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  410.                                 cancel_spell()
  411.                                 send_command('input /ja Addendum: Black <me>')
  412.                         elseif spell.english == "Accession" then
  413.                                 cancel_spell()
  414.                                 send_command('input /ja Manifestation <me>')
  415.                         elseif spell.english == "Celerity" then
  416.                                 cancel_spell()
  417.                                 send_command('input /ja Alacrity <me>')
  418.                         elseif spell.english == "Penury" then
  419.                                 cancel_spell()
  420.                                 send_command('input /ja Parsimony <me>')
  421.                 end
  422.     end
  423. end
  424. -----------------------------------------------------------------
  425. --Precast
  426. ------------------------------------------------------------------
  427. function job_precast(spell, action, spellMap, eventArgs)
  428.     if spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  429.         if buffactive.silence then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  430.                         cancel_spell()
  431.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  432.                         return
  433.                         else
  434.                         if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  435.                                 equip(sets.precast.FC.Cure)
  436.                         elseif spell.english == "Impact" then
  437.                                 equip(set_combine(sets.precast.FC,{body="Twilight Cloak"}))
  438.                   elseif spell.type == WhiteMagic and buffactive['Light Arts'] then
  439.                     equip(sets.precast.FC.Arts)
  440.            
  441.                 elseif spell.type == BlackMagic and buffactive['Dark Arts'] then
  442.                     equip(sets.precast.FC.Arts)
  443.            
  444.                            else
  445.                                 equip(sets.precast.FC)
  446.                         end
  447.            
  448.                 end
  449.            end
  450.     end
  451. -----------------------------------------------------------------------
  452. --Midcast
  453. -------------------------------------------------------------------------
  454. function job_post_midcast(spell, action, spellMap, eventArgs)
  455.     if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
  456.         equip(sets.magic_burst)
  457.     end
  458.         if spell.skill == 'Elemental Magic' then
  459.         if spell.element == world.day_element or spell.element == world.weather_element then
  460.             equip(equipSet, sets.Obi)
  461.             end
  462.             end
  463. end
  464.  
  465. function job_midcast(spell, action, spellMap, eventArgs)
  466.     equipSet = {}
  467.                         if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' or spell.type == 'BardSong' then
  468.                                 equipSet = sets.midcast
  469.  
  470.                         elseif string.find(spell.english,'Cure') then
  471.                                 equipSet = equipSet.Cure
  472.                         elseif string.find(spell.english,'Cura') then
  473.                                 equipSet = equipSet.Curaga
  474.                         elseif string.find(spell.english,'Banish') then
  475.                                 equipSet = set_combine(equipSet.MndEnfeebles)
  476.                         elseif spell.english == "Stoneskin" then
  477.                           equipSet = equipSet.Stoneskin
  478.                                 if buffactive.Stoneskin then
  479.                                         send_command('cancel stoneskin')
  480.                             end
  481.                         elseif spell.english == "Sneak" then
  482.                                 if spell.target.name == player.name and buffactive['Sneak'] then
  483.                                         send_command('cancel sneak')
  484.                                 end
  485.                                 equipSet = equipSet.Haste
  486.                         elseif string.find(spell.english,'Utsusemi') then
  487.                                 if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  488.                                         send_command('@wait 1.7;cancel Copy Image*')
  489.                                 end
  490.                                 equipSet = equipSet.Haste
  491.                         elseif spell.english == 'Monomi: Ichi' then
  492.                                 if buffactive['Sneak'] then
  493.                                         send_command('@wait 1.7;cancel sneak')
  494.                                 end
  495.                                 equipSet = equipSet.Haste
  496.                    
  497.                                                  
  498.                         else
  499.                         if equipSet[spell.english] then
  500.                                 equipSet = equipSet[spell.english]
  501.                         end
  502.                         if equipSet[spell.skill] then
  503.                                 equipSet = equipSet[spell.skill]
  504.                         end
  505.                         if equipSet[spell.type] then
  506.                                 equipSet = equipSet[spell.type]
  507.                         end
  508.                        
  509.                         if string.find(spell.english,'Cure')  and (world.weather_element == spell.element) or  (world.day_element == spell.element) then
  510.                                 equipSet = set_combine(equipSet,sets.Obi)
  511.                         end    
  512.                         if ((spell.english == 'Drain') or (spell.english == 'Aspir')) and ((world.day_element == spell.element) or (world.weather_element == spell.element)) then
  513.                                 equipSet = set_combine(equipSet,sets.Obi)
  514.                         end  
  515.             end
  516.     if equipSet[spell.english] then
  517.         equipSet = equipSet[spell.english]
  518.     end
  519.     equip(equipSet)
  520. end
  521.  
  522.  
  523. -------------------------------------------------------------------------------------------------------------------
  524. -- Job-specific hooks for standard casting events.
  525. -------------------------------------------------------------------------------------------------------------------
  526.  
  527. -- Run after the general midcast() is done.
  528. function job_post_midcast(spell, action, spellMap, eventArgs)
  529.     if spell.action_type == 'Magic' then
  530.         apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
  531.     end
  532.     if spell.skill == 'Elemental Magic' then
  533.         if spell.element == world.day_element or spell.element == world.weather_element then
  534.             equip(equipSet, sets.Obi)
  535.             if string.find(spell.english,'helix') then
  536.                             equip(sets.midcast.Helix)
  537.             end
  538.         end
  539.     end
  540.     if not spell.interrupted then
  541.                 if spell.english == "Sleep II" then -- Sleep II Countdown --
  542.                         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.]')
  543.                 elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  544.                         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.]')
  545.                 elseif spell.english == "Break" then -- Break Countdown --
  546.                         send_command('wait 25;input /echo Break Effect: [WEARING OFF IN 5 SEC.]')
  547.                                 elseif spell.english == "Paralyze" then -- Paralyze Countdown --
  548.                                                 send_command('wait 115;input /echo Paralyze Effect: [WEARING OFF IN 5 SEC.]')
  549.                                 elseif spell.english == "Slow" then -- Slow Countdown --
  550.                                                 send_command('wait 115;input /echo Slow Effect: [WEARING OFF IN 5 SEC.]')
  551.                                 elseif spell.english == "Banish II" then -- Banish II Countdown --
  552.                         send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  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 == 'Normal' then
  574.             disable('main','sub','range')
  575.         else
  576.             enable('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.     end
  658. end
  659.  
  660. -------------------------------------------------------------------------------------------------------------------
  661. -- Utility functions specific to this job.
  662. -------------------------------------------------------------------------------------------------------------------
  663.  
  664. -- Reset the state vars tracking strategems.
  665. function update_active_strategems()
  666.     state.Buff['Ebullience'] = buffactive['Ebullience'] or false
  667.     state.Buff['Rapture'] = buffactive['Rapture'] or false
  668.     state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
  669.     state.Buff['Immanence'] = buffactive['Immanence'] or false
  670.     state.Buff['Penury'] = buffactive['Penury'] or false
  671.     state.Buff['Parsimony'] = buffactive['Parsimony'] or false
  672.     state.Buff['Celerity'] = buffactive['Celerity'] or false
  673.     state.Buff['Alacrity'] = buffactive['Alacrity'] or false
  674.  
  675.     state.Buff['Klimaform'] = buffactive['Klimaform'] or false
  676. end
  677.  
  678. function update_sublimation()
  679.     state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  680. end
  681.  
  682. -- Equip sets appropriate to the active buffs, relative to the spell being cast.
  683. function apply_grimoire_bonuses(spell, action, spellMap)
  684.     if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
  685.         equip(sets.buff['Perpetuance'])
  686.     end
  687.     if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
  688.         equip(sets.buff['Rapture'])
  689.     end
  690.     if spell.skill == 'Elemental Magic' and spellMap ~= 'ElementalEnfeeble' then
  691.         if state.Buff.Ebullience and spell.english ~= 'Impact' then
  692.             equip(sets.buff['Ebullience'])
  693.         end
  694.         if state.Buff.Immanence then
  695.             equip(sets.buff['Immanence'])
  696.         end
  697.         if state.Buff.Klimaform and spell.element == world.weather_element then
  698.             equip(sets.buff['Klimaform'])
  699.         end
  700.     end
  701.  
  702.     if state.Buff.Penury then equip(sets.buff['Penury']) end
  703.     if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
  704.     if state.Buff.Celerity then equip(sets.buff['Celerity']) end
  705.     if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
  706. end
  707.  
  708.  
  709. -- General handling of strategems in an Arts-agnostic way.
  710. -- Format: gs c scholar <strategem>
  711. function handle_strategems(cmdParams)
  712.     -- cmdParams[1] == 'scholar'
  713.     -- cmdParams[2] == strategem to use
  714.  
  715.     if not cmdParams[2] then
  716.         add_to_chat(123,'Error: No strategem command given.')
  717.         return
  718.     end
  719.    
  720.     local currentStrats = get_current_strategem_count()
  721.     local newStratCount = currentStrats - 1
  722.     if currentStrats > 0 then
  723.         add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
  724.     else
  725.         add_to_chat(122, '***Out of stratagems! Cancelling...***')
  726.         return
  727.     end
  728.     local strategem = cmdParams[2]:lower()
  729.  
  730.     if strategem == 'light' then
  731.         if buffactive['light arts'] then
  732.             send_command('input /ja "Addendum: White" <me>')
  733.         elseif buffactive['addendum: white'] then
  734.             add_to_chat(122,'Error: Addendum: White is already active.')
  735.         else
  736.             send_command('input /ja "Light Arts" <me>')
  737.         end
  738.     elseif strategem == 'dark' then
  739.         if buffactive['dark arts'] then
  740.             send_command('input /ja "Addendum: Black" <me>')
  741.         elseif buffactive['addendum: black'] then
  742.             add_to_chat(122,'Error: Addendum: Black is already active.')
  743.         else
  744.             send_command('input /ja "Dark Arts" <me>')
  745.         end
  746.     elseif buffactive['light arts'] or buffactive['addendum: white'] then
  747.         if strategem == 'cost' then
  748.             send_command('input /ja Penury <me>')
  749.         elseif strategem == 'speed' then
  750.             send_command('input /ja Celerity <me>')
  751.         elseif strategem == 'aoe' then
  752.             send_command('input /ja Accession <me>')
  753.         elseif strategem == 'power' then
  754.             send_command('input /ja Rapture <me>')
  755.         elseif strategem == 'duration' then
  756.             send_command('input /ja Perpetuance <me>')
  757.         elseif strategem == 'accuracy' then
  758.             send_command('input /ja Altruism <me>')
  759.         elseif strategem == 'enmity' then
  760.             send_command('input /ja Tranquility <me>')
  761.         elseif strategem == 'skillchain' then
  762.             add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
  763.         elseif strategem == 'addendum' then
  764.             send_command('input /ja "Addendum: White" <me>')
  765.         else
  766.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  767.         end
  768.     elseif buffactive['dark arts']  or buffactive['addendum: black'] then
  769.         if strategem == 'cost' then
  770.             send_command('input /ja Parsimony <me>')
  771.         elseif strategem == 'speed' then
  772.             send_command('input /ja Alacrity <me>')
  773.         elseif strategem == 'aoe' then
  774.             send_command('input /ja Manifestation <me>')
  775.         elseif strategem == 'power' then
  776.             send_command('input /ja Ebullience <me>')
  777.         elseif strategem == 'duration' then
  778.             add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
  779.         elseif strategem == 'accuracy' then
  780.             send_command('input /ja Focalization <me>')
  781.         elseif strategem == 'enmity' then
  782.             send_command('input /ja Equanimity <me>')
  783.         elseif strategem == 'skillchain' then
  784.             send_command('input /ja Immanence <me>')
  785.         elseif strategem == 'addendum' then
  786.             send_command('input /ja "Addendum: Black" <me>')
  787.         else
  788.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  789.         end
  790.     else
  791.         add_to_chat(123,'No arts has been activated yet.')
  792.     end
  793. end
  794.  
  795.  
  796. -- Gets the current number of available strategems based on the recast remaining
  797. -- and the level of the sch.
  798. function get_current_strategem_count()
  799.     -- returns recast in seconds.
  800.     local allRecasts = windower.ffxi.get_ability_recasts()
  801.     local stratsRecast = allRecasts[231]
  802.  
  803.     local maxStrategems = (player.main_job_level + 10) / 20
  804.  
  805.     local fullRechargeTime = 5*33
  806.  
  807.     local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
  808.  
  809.     return currentCharges
  810. end
  811.  
  812.  
  813. -- Select default macro book on initial load or subjob change.
  814. function select_default_macro_book()
  815.     set_macro_page(5, 13)
  816. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement