Boposhopo

SCH Lua

Jul 14th, 2025
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 31.82 KB | Gaming | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job.  Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- Initialization function for this job file.
  6. function get_sets()
  7.     mote_include_version = 2
  8.  
  9.     -- Load and initialize the include file.
  10.     include('Mote-Include.lua')
  11. end
  12.  
  13. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  14. function job_setup()
  15.  
  16.     state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  17.     update_active_strategems()
  18.    
  19.     send_command('wait 6;input /lockstyleset 10')
  20. end
  21.  
  22. -------------------------------------------------------------------------------------------------------------------
  23. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  24. -------------------------------------------------------------------------------------------------------------------
  25.  
  26. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  27. function user_setup()
  28.     state.OffenseMode:options('None', 'Normal')
  29.     state.CastingMode:options('Normal', 'Resistant')
  30.     state.IdleMode:options('Normal', 'PDT')
  31.  
  32.     select_default_macro_book()
  33. end
  34.  
  35. -- Define sets and vars used by this job file.
  36. function init_gear_sets()
  37.     --------------------------------------
  38.     -- Start defining the sets
  39.     --------------------------------------
  40.  
  41.     -- Precast Sets
  42.  
  43.     -- Precast sets to enhance JAs
  44.  
  45.     sets.precast.JA['Tabula Rasa'] = {legs="Pedagogy Pants +3"}
  46.  
  47.  
  48.     -- Fast cast sets for spells
  49.  
  50.     sets.precast.FC = {ammo="Sapience Orb",
  51.         head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+27','"Fast Cast"+6','MND+8',}},
  52.         body={ name="Agwu's Robe", augments={'Path: A',}},
  53.         hands={ name="Gende. Gages +1", augments={'Phys. dmg. taken -3%','Magic dmg. taken -2%','Song spellcasting time -5%',}},
  54.         legs="Volte Brais",
  55.         feet="Regal Pumps +1",
  56.         neck="Warder's Charm +1",
  57.         waist="Embla Sash",
  58.         left_ear="Malignance Earring",
  59.         right_ear="Loquac. Earring",
  60.         left_ring="Kishar Ring",
  61.         right_ring="Shneddick Ring",
  62.         back={ name="Lugh's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},} --10
  63.  
  64.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
  65.  
  66.     sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {})
  67.  
  68.     sets.precast.FC.Cure = set_combine(sets.precast.FC, {})
  69.  
  70.     sets.precast.FC.Curaga = set_combine(sets.precast.FC, {})
  71.  
  72.     sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
  73.  
  74.  
  75.     -- Midcast Sets
  76.  
  77.     sets.midcast.FastRecast = {ammo="Sapience Orb",
  78.         head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+27','"Fast Cast"+6','MND+8',}},
  79.         body="Agwu's Robe",
  80.         hands={ name="Gende. Gages +1", augments={'Phys. dmg. taken -3%','Magic dmg. taken -2%','Song spellcasting time -5%',}},
  81.         legs="Volte Brais",
  82.         feet="Regal Pumps +1",
  83.         waist="Embla Sash",
  84.         left_ear="Malignance Earring",
  85.         right_ear="Loquac. Earring",
  86.         left_ring="Kishar Ring",
  87.         back={ name="Lugh's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  88.  
  89.     sets.midcast.Cure = {head={ name="Kaykaus Mitra +1", augments={'MP+80','"Cure" spellcasting time -7%','Enmity-6',}},
  90.         body={ name="Kaykaus Bliaut +1", augments={'MP+80','MND+12','Mag. Acc.+20',}},
  91.         hands={ name="Kaykaus Cuffs", augments={'MP+60','MND+10','Mag. Acc.+15',}},
  92.         legs="Acad. Pants +3",
  93.         feet="Regal Pumps +1",
  94.         neck="Nodens Gorget",
  95.         waist="Gishdubar Sash",
  96.         left_ear="Mendi. Earring",
  97.         right_ear="Beatific Earring",
  98.         left_ring="Naji's Loop",
  99.         right_ring="Stikini Ring",
  100.         back="Oretan. Cape +1",}
  101.  
  102.     sets.midcast.CureWithLightWeather = {head={ name="Kaykaus Mitra +1", augments={'MP+80','"Cure" spellcasting time -7%','Enmity-6',}},
  103.         body={ name="Kaykaus Bliaut +1", augments={'MP+80','MND+12','Mag. Acc.+20',}},
  104.         hands={ name="Kaykaus Cuffs", augments={'MP+60','MND+10','Mag. Acc.+15',}},
  105.         legs="Acad. Pants +3",
  106.         feet="Regal Pumps +1",
  107.         neck="Nodens Gorget",
  108.         waist="Gishdubar Sash",
  109.         left_ear="Mendi. Earring",
  110.         right_ear="Beatific Earring",
  111.         left_ring="Naji's Loop",
  112.         right_ring="Stikini Ring",
  113.         back="Oretan. Cape +1",}
  114.  
  115.     sets.midcast.Curaga = set_combine(sets.midcast.Cure, {})
  116.  
  117.     sets.midcast.Regen = {main="Musa",
  118.         sub="Enki Strap",
  119.         head="Arbatel Bonnet +3",
  120.         body={ name="Telchine Chas.", augments={'Enh. Mag. eff. dur. +10',}},
  121.         hands="Arbatel bracers +3",
  122.         legs={ name="Telchine Braconi", augments={'"Cure" potency +8%','Enh. Mag. eff. dur. +9',}},
  123.         feet={ name="Telchine Pigaches", augments={'"Fast Cast"+4','Enh. Mag. eff. dur. +10',}},
  124.         waist="Embla Sash",
  125.         left_ring="Stikini Ring",
  126.         right_ring="Stikini Ring",
  127.         back="Bookworm's Cape"}
  128.        
  129.     sets.midcast.Cursna = {main={ name="Gada", augments={'Enh. Mag. eff. dur. +6','Mag. Acc.+13','"Mag.Atk.Bns."+7','DMG:+2',}},
  130.         head={ name="Vanya Hood", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
  131.         body={ name="Vanya Robe", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
  132.         legs="Acad. Pants +3",
  133.         feet={ name="Vanya Clogs", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
  134.         neck="Debilis Medallion",
  135.         waist="Gishdubar Sash",
  136.         left_ear="Beatific Earring",
  137.         left_ring="Menelaus's Ring",
  138.         right_ring="Haoma's Ring",
  139.         back="Oretan. Cape +1",}
  140.        
  141.     sets.midcast.Erase = set_combine(sets.midcast.FastRecast, {})
  142.  
  143.     sets.midcast['Enhancing Magic'] = {main="Musa",
  144.         sub="Enki Strap",
  145.         head={ name="Telchine Cap", augments={'Enh. Mag. eff. dur. +9',}},
  146.         body={ name="Telchine Chas.", augments={'Enh. Mag. eff. dur. +10',}},
  147.         hands={ name="Telchine Gloves", augments={'Enh. Mag. eff. dur. +10',}},
  148.         legs={ name="Telchine Braconi", augments={'"Cure" potency +8%','Enh. Mag. eff. dur. +9',}},
  149.         feet={ name="Telchine Pigaches", augments={'"Fast Cast"+4','Enh. Mag. eff. dur. +10',}},
  150.         waist="Embla Sash",
  151.         left_ring="Stikini Ring",
  152.         right_ring="Stikini Ring",
  153.         back={ name="Lugh's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  154.  
  155.     sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash", neck="Nodens Gorget"})
  156.    
  157.     sets.midcast.Aquaveil = set_combine(sets.midcast['Enhancing Magic'], {head="Amalric Coif +1", hands="Regal Cuffs"})
  158.    
  159.     sets.midcast.Refresh = set_combine(sets.midcast['Enhancing Magic'], {})
  160.  
  161.     sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {})
  162.    
  163.     sets.midcast.Haste = set_combine(sets.midcast['Enhancing Magic'], {})
  164.    
  165.     sets.midcast.Flurry = set_combine(sets.midcast['Enhancing Magic'], {})
  166.    
  167.     sets.midcast.Embrava = set_combine(sets.midcast['Enhancing Magic'], {})
  168.  
  169.     sets.midcast.Protect = {main="Musa",
  170.         sub="Enki Strap",
  171.         head={ name="Telchine Cap", augments={'Enh. Mag. eff. dur. +9',}},
  172.         body={ name="Telchine Chas.", augments={'Enh. Mag. eff. dur. +10',}},
  173.         hands={ name="Telchine Gloves", augments={'Enh. Mag. eff. dur. +10',}},
  174.         legs={ name="Telchine Braconi", augments={'"Cure" potency +8%','Enh. Mag. eff. dur. +9',}},
  175.         feet={ name="Telchine Pigaches", augments={'"Fast Cast"+4','Enh. Mag. eff. dur. +10',}},
  176.         waist="Embla Sash",
  177.         left_ring="Sheltered Ring",
  178.         right_ring="Stikini Ring",
  179.         back={ name="Lugh's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  180.        
  181.     sets.midcast.Protectra = set_combine(sets.midcast.Protect, {})
  182.  
  183.     sets.midcast.Shell = set_combine(sets.midcast.Protect, {})
  184.     sets.midcast.Shellra = set_combine(sets.midcast.Protect, {})
  185.  
  186.  
  187.     -- Custom spell classes
  188.     sets.midcast.MndEnfeebles = {main={ name="Opashoro", priority=2},
  189.         sub="Enki Strap",
  190.         ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
  191.         head="Arbatel Bonnet +3",
  192.         body="arbatel gown +3",
  193.         hands="Regal Cuffs",
  194.         legs="Arbatel Pants +3",
  195.         feet="Arbatel Loafers +3",
  196.         neck="Argute Stole +2",
  197.         waist={ name="Obstin. Sash", augments={'Path: A',}},
  198.         left_ear="Malignance Earring",
  199.         right_ear="Crep. Earring",
  200.         left_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
  201.         right_ring="Kishar Ring",
  202.         back={ name="Lugh's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Fast Cast"+10','Phys. dmg. taken-10%',}},}
  203.  
  204.     sets.midcast.IntEnfeebles = {main={ name="Opashoro", priority=2},
  205.         sub="Enki Strap",
  206.         ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
  207.         head="Arbatel Bonnet +3",
  208.         body="arbatel gown +3",
  209.         hands="Regal Cuffs",
  210.         legs="Arbatel Pants +3",
  211.         feet="Arbatel Loafers +3",
  212.         neck="Argute Stole +2",
  213.         waist={ name="Obstin. Sash", augments={'Path: A',}},
  214.         left_ear="Malignance Earring",
  215.         right_ear="Arbatel Earring +1",
  216.         left_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
  217.         right_ring="Kishar Ring",
  218.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  219.  
  220.     sets.midcast.ElementalEnfeeble = set_combine(sets.midcast.IntEnfeebles, {})
  221.  
  222.     sets.midcast['Dark Magic'] = {main={ name="Opashoro", priority=2},
  223.         sub="Enki Strap",
  224.         ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
  225.         head="Arbatel Bonnet +3",
  226.         body="Arbatel Gown +3",
  227.         hands="Arbatel Bracers +3",
  228.         legs="Arbatel Pants +3",
  229.         feet="Arbatel Loafers +3",
  230.         neck="Argute Stole +2",
  231.         waist={ name="Obstin. Sash", augments={'Path: A',}},
  232.         left_ear="Malignance Earring",
  233.         right_ear={ name="Arbatel Earring +1", augments={'System: 1 ID: 1676 Val: 0','Mag. Acc.+13','Enmity-3',}},
  234.         left_ring="Stikini Ring",
  235.         right_ring="Stikini Ring",
  236.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  237.  
  238.     sets.midcast.Kaustra = {main={ name="Opashoro", priority=2},
  239.         sub="Enki Strap",
  240.         ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
  241.         head="Pixie Hairpin +1",
  242.         body={ name="Agwu's Robe", augments={'Path: A',}},
  243.         hands={ name="Agwu's Gages", augments={'Path: A',}},
  244.         legs={ name="Agwu's Slops", augments={'Path: A',}},
  245.         feet="Arbatel Loafers +3",
  246.         neck="Argute Stole +2",
  247.         waist="Skrymir Cord",
  248.         left_ear="Regal Earring",
  249.         right_ear="Malignance Earring",
  250.         left_ring="Freke Ring",
  251.         right_ring="Metamorph Ring +1",
  252.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  253.  
  254.     sets.midcast.Drain = {main={ name="Opashoro", priority=2},
  255.         sub="Enki Strap",
  256.         ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
  257.         head="Pixie Hairpin +1",
  258.         body="Arbatel Gown +3",
  259.         hands={ name="Agwu's Gages", augments={'Path: A',}},
  260.         legs="Arbatel Pants +3",
  261.         feet={ name="Agwu's Pigaches", augments={'Path: A',}},
  262.         neck="Erra Pendant",
  263.         waist="Fucho-no-Obi",
  264.         left_ear="Malignance Earring",
  265.         right_ear="Hirudinea Earring",
  266.         left_ring="Evanescence Ring",
  267.         right_ring="Archon Ring",
  268.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  269.  
  270.     sets.midcast.Aspir = set_combine(sets.midcast.Drain, {})
  271.  
  272.     sets.midcast.Stun =  set_combine(sets.midcast.IntEnfeebles, {})
  273.  
  274.     sets.midcast.Stun.Resistant = set_combine(sets.midcast.Stun, {})
  275.    
  276.     sets.midcast['Absorb-TP'] = {main={ name="Opashoro", priority=2},
  277.         sub="Enki Strap",
  278.         ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
  279.         head="Arbatel Bonnet +3",
  280.         body="Arbatel Gown +3",
  281.         hands="Arbatel Bracers +3",
  282.         legs="Pedagogy Pants +3",
  283.         feet="Arbatel Loafers +3",
  284.         neck="Argute Stole +2",
  285.         waist={ name="Obstin. Sash", augments={'Path: A',}},
  286.         left_ear="Malignance Earring",
  287.         right_ear={ name="Arbatel Earring +1", augments={'System: 1 ID: 1676 Val: 0','Mag. Acc.+13','Enmity-3',}},
  288.         left_ring="Stikini Ring",
  289.         right_ring="Stikini Ring",
  290.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  291.  
  292.  
  293.     -- Elemental Magic sets are default for handling low-tier nukes.
  294.     sets.midcast['Elemental Magic'] = {main={ name="Opashoro", priority=2},
  295.         sub="Enki Strap",
  296.         ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
  297.         head={ name="Agwu's Cap", augments={'Path: A',}},
  298.         body={ name="Agwu's Robe", augments={'Path: A',}},
  299.         hands={ name="Agwu's Gages", augments={'Path: A',}},
  300.         legs={ name="Agwu's Slops", augments={'Path: A',}},
  301.         feet="Arbatel Loafers +3",
  302.         neck="Argute Stole +2",
  303.         waist="Skrymir Cord",
  304.         left_ear="Regal Earring",
  305.         right_ear="Malignance Earring",
  306.         left_ring="Freke Ring",
  307.         right_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
  308.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  309.  
  310.     sets.midcast['Elemental Magic'].Resistant = {main={ name="Opashoro", priority=2},
  311.         sub="Enki Strap",
  312.         ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
  313.         head={ name="Agwu's Cap", augments={'Path: A',}},
  314.         body="Arbatel Gown +3",
  315.         hands={ name="Agwu's Gages", augments={'Path: A',}},
  316.         legs="Arbatel Pants +3",
  317.         feet="Arbatel Loafers +3",
  318.         neck="Argute Stole +2",
  319.         waist="Skrymir Cord",
  320.         left_ear="Regal Earring",
  321.         right_ear="Arbatel Earring +1",
  322.         left_ring="Freke Ring",
  323.         right_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
  324.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  325.  
  326.     sets.midcast.Helix = set_combine(sets.midcast['Elemental Magic'], {right_ring="Mujin Band", right_ear="Arbatel Earring +1"})
  327.    
  328.     sets.midcast.DarkHelix = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1", left_ring="Archon Ring"})
  329.  
  330.     sets.midcast.Impact = {}
  331.  
  332.  
  333.     -- Sets to return to when not performing an action.
  334.  
  335.     -- Resting sets
  336.     sets.resting = {}
  337.  
  338.  
  339.     -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  340.  
  341.     sets.idle.Town = {main={ name="Opashoro", priority=2},
  342.         sub="Enki Strap",
  343.         ammo="Homiliary",
  344.         head="Arbatel Bonnet +3",
  345.         body="arbatel gown +3",
  346.         hands={ name="Nyame Gauntlets", augments={'Path: A',}},
  347.         legs="Volte Brais",
  348.         feet={ name="Nyame Sollerets", augments={'Path: B',}},
  349.         neck="Warder's Charm +1",
  350.         waist="Carrier's Sash",
  351.         left_ear="Etiolation Earring",
  352.         right_ear="Infused Earring",
  353.         left_ring="Defending Ring",
  354.         right_ring="Shneddick Ring",
  355.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  356.  
  357.     sets.idle.Field = {main={ name="Opashoro", priority=2},
  358.         sub="Enki Strap",
  359.         ammo="Homiliary",
  360.         head="Arbatel Bonnet +3",
  361.         body="arbatel gown +3",
  362.         hands={ name="Nyame Gauntlets", augments={'Path: A',}},
  363.         legs="Volte Brais",
  364.         feet={ name="Nyame Sollerets", augments={'Path: B',}},
  365.         neck="Warder's Charm +1",
  366.         waist="Carrier's Sash",
  367.         left_ear="Etiolation Earring",
  368.         right_ear="Infused Earring",
  369.         left_ring="Defending Ring",
  370.         right_ring="Shneddick Ring",
  371.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  372.  
  373.     sets.idle.Weak = {main={ name="Opashoro", priority=2},
  374.         sub="Enki Strap",
  375.         ammo="Homiliary",
  376.         head="Arbatel Bonnet +3",
  377.         body="arbatel gown +3",
  378.         hands={ name="Nyame Gauntlets", augments={'Path: A',}},
  379.         legs="Volte Brais",
  380.         feet={ name="Nyame Sollerets", augments={'Path: B',}},
  381.         neck="Warder's Charm +1",
  382.         waist="Carrier's Sash",
  383.         left_ear="Etiolation Earring",
  384.         right_ear="Infused Earring",
  385.         left_ring="Defending Ring",
  386.         right_ring="Shneddick Ring",
  387.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},}
  388.  
  389.     -- Defense sets
  390.  
  391.     sets.latent_refresh = {waist="Fucho-no-obi"}
  392.  
  393.     -- Engaged sets
  394.  
  395.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  396.     -- sets if more refined versions aren't defined.
  397.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  398.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  399.  
  400.     -- Normal melee group
  401.     sets.engaged = {ammo="Oshasha's Treatise",
  402.         head="Arbatel Bonnet +3",
  403.         body={ name="Nyame Mail", augments={'Path: B',}},
  404.         hands="Nyame Gauntlets",
  405.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  406.         feet="Arbatel Loafers +3",
  407.         neck="Sanctity Necklace",
  408.         waist="Cornelia's Belt",
  409.         left_ear="Crep. Earring",
  410.         right_ear="Telos Earring",
  411.         left_ring="Lehko's Ring",
  412.         right_ring="Chirich Ring +1",
  413.         back={ name="Lugh's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},}
  414.        
  415.        
  416.     sets.precast.WS = {ammo="Sroda Tathlum",
  417.         head={ name="Agwu's Cap", augments={'Path: A',}},
  418.         body={ name="Nyame Mail", augments={'Path: B',}},
  419.         hands="Nyame Gauntlets",
  420.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  421.         feet="Arbatel Loafers +3",
  422.         neck="Sibyl Scarf",
  423.         waist="Hachirin-no-Obi",
  424.         left_ear="Regal Earring",
  425.         right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  426.         left_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
  427.         right_ring="Freke Ring",
  428.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  429.        
  430.     sets.precast.WS['Cataclysm'] = {ammo="Sroda Tathlum",
  431.         head="Pixie Hairpin +1",
  432.         body={ name="Nyame Mail", augments={'Path: B',}},
  433.         hands="Nyame Gauntlets",
  434.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  435.         feet="Arbatel Loafers +3",
  436.         neck="Sibyl Scarf",
  437.         waist="Hachirin-no-Obi",
  438.         left_ear="Malignance Earring",
  439.         right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  440.         left_ring="Epaminondas's Ring",
  441.         right_ring="Archon Ring",
  442.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  443.        
  444.     sets.precast.WS['Omniscience'] = set_combine(sets.precast.WS['Cataclysm'], {right_ear="Regal Earring"})
  445.        
  446.     sets.precast.WS['Earth Crusher'] = {ammo="Sroda Tathlum",
  447.         head={ name="Agwu's Cap", augments={'Path: A',}},
  448.         body={ name="Nyame Mail", augments={'Path: B',}},
  449.         hands="Nyame Gauntlets",
  450.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  451.         feet="Arbatel Loafers +3",
  452.         neck="Sibyl Scarf",
  453.         waist="Hachirin-no-Obi",
  454.         left_ear="Regal Earring",
  455.         right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  456.         left_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
  457.         right_ring="Freke Ring",
  458.         back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  459.        
  460.     sets.precast.WS['Oshala'] = {ammo="Oshasha's Treatise",
  461.         head={ name="Nyame Helm", augments={'Path: B',}},
  462.         body={ name="Nyame Mail", augments={'Path: B',}},
  463.         hands="Nyame Gauntlets",
  464.         legs={ name="Nyame Flanchard", augments={'Path: B',}},
  465.         feet={ name="Nyame Sollerets", augments={'Path: B',}},
  466.         neck="Rep. Plat. Medal",
  467.         waist="Cornelia's Belt",
  468.         left_ear="Ishvara Earring",
  469.         right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
  470.         left_ring="Shukuyu Ring",
  471.         right_ring="Epaminondas's Ring",
  472.         back={ name="Lugh's Cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},}
  473.        
  474.     sets.precast.WS['Retribution'] = set_combine(sets.precast.WS['Oshala'], {})
  475.  
  476.  
  477.  
  478.     -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
  479.     sets.buff['Ebullience'] = {head="Arbatel Bonnet +3"}
  480.     sets.buff['Rapture'] = {head="Arbatel Bonnet +3"}
  481.     sets.buff['Perpetuance'] = {hands="Arbatel bracers +3"}
  482.     sets.buff['Immanence'] = {hands="Arbatel bracers +3"}
  483.     sets.buff['Penury'] = {}
  484.     sets.buff['Parsimony'] = {}
  485.     sets.buff['Celerity'] = {}
  486.     sets.buff['Alacrity'] = {}
  487.     sets.buff['Focalization'] = {head="Pedagogy Mortarboard +3"}
  488.     sets.buff['Klimaform'] = {feet="Arbatel Loafers +3"}
  489.  
  490.     sets.buff.FullSublimation = {waist="Embla Sash",}
  491.     sets.buff.PDTSublimation = {}
  492.    
  493.     sets.Obi = {waist="Hachirin-no-Obi"}
  494.  
  495. end
  496.  
  497. -------------------------------------------------------------------------------------------------------------------
  498. -- Job-specific hooks for standard casting events.
  499. -------------------------------------------------------------------------------------------------------------------
  500.  
  501. -- Run after the general midcast() is done.
  502. function job_post_midcast(spell, action, spellMap, eventArgs)
  503.     if spell.action_type == 'Magic' then
  504.         apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
  505.     end
  506.     if spell.skill == 'Elemental Magic' then
  507.        if spellMap == "Helix" then
  508.             equip(sets.midcast['Elemental Magic'])
  509.             if spell.english:startswith('Nocto') then
  510.                 equip(sets.midcast.DarkHelix)
  511.             else
  512.                 equip(sets.midcast.Helix)
  513.         end
  514.         if buffactive['Klimaform'] and spell.element == world.weather_element then
  515.             equip(sets.buff['Klimaform'])
  516.         end
  517.     end
  518.     if spell.skill == 'Elemental Magic' or spell.english == "Kaustra" then
  519.         if (spell.element == world.weather_element and (get_weather_intensity() == 2 and spell.element ~= elements.weak_to[world.day_element])) and spellMap ~= 'Helix' then
  520.             equip(sets.Obi)
  521.        elseif (spell.element == world.day_element and spell.element == world.weather_element) and spellMap ~= 'Helix' then
  522.             equip(sets.Obi)
  523.        elseif (spell.element == world.day_element or spell.element == world.weather_element) and spellMap ~= 'Helix' then
  524.             equip(sets.Obi)
  525.             end
  526.         end
  527.         if spell.action_type == 'Magic' then
  528.         apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
  529.         end
  530.     end
  531. end
  532.  
  533. -------------------------------------------------------------------------------------------------------------------
  534. -- Job-specific hooks for non-casting events.
  535. -------------------------------------------------------------------------------------------------------------------
  536.  
  537. -- Called when a player gains or loses a buff.
  538. -- buff == buff gained or lost
  539. -- gain == true if the buff was gained, false if it was lost.
  540. function job_buff_change(buff, gain)
  541.     if buff == "Sublimation: Activated" then
  542.         handle_equipping_gear(player.status)
  543.     end
  544. end
  545.  
  546. -- Handle notifications of general user state change.
  547. function job_state_change(stateField, newValue, oldValue)
  548.     if stateField == 'Offense Mode' then
  549.         if newValue == 'Normal' then
  550.             disable('main','sub','range')
  551.         else
  552.             enable('main','sub','range')
  553.         end
  554.     end
  555. end
  556.  
  557. -------------------------------------------------------------------------------------------------------------------
  558. -- User code that supplements standard library decisions.
  559. -------------------------------------------------------------------------------------------------------------------
  560.  
  561. -- Custom spell mapping.
  562. function job_get_spell_map(spell, default_spell_map)
  563.     if spell.action_type == 'Magic' then
  564.         if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
  565.             if world.weather_element == 'Light' then
  566.                 return 'CureWithLightWeather'
  567.             end
  568.         elseif spell.skill == 'Enfeebling Magic' then
  569.             if spell.type == 'WhiteMagic' then
  570.                 return 'MndEnfeebles'
  571.             else
  572.                 return 'IntEnfeebles'
  573.             end
  574.             end
  575.         end
  576.     end
  577.  
  578. function customize_idle_set(idleSet)
  579.     if state.Buff['Sublimation: Activated'] then
  580.         if state.IdleMode.value == 'Normal' then
  581.             idleSet = set_combine(idleSet, sets.buff.FullSublimation)
  582.         elseif state.IdleMode.value == 'PDT' then
  583.             idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
  584.         end
  585.     end
  586.  
  587.     if player.mpp < 51 then
  588.         idleSet = set_combine(idleSet, sets.latent_refresh)
  589.     end
  590.  
  591.     return idleSet
  592. end
  593.  
  594. -- Called by the 'update' self-command.
  595. function job_update(cmdParams, eventArgs)
  596.     if cmdParams[1] == 'user' and not (buffactive['light arts']      or buffactive['dark arts'] or
  597.                        buffactive['addendum: white'] or buffactive['addendum: black']) then
  598.         if state.IdleMode.value == 'Stun' then
  599.             send_command('@input /ja "Dark Arts" <me>')
  600.         else
  601.             send_command('@input /ja "Light Arts" <me>')
  602.         end
  603.     end
  604.  
  605.     update_active_strategems()
  606.     update_sublimation()
  607. end
  608.  
  609. -- Function to display the current relevant user state when doing an update.
  610. -- Return true if display was handled, and you don't want the default info shown.
  611. function display_current_job_state(eventArgs)
  612.     display_current_caster_state()
  613.     eventArgs.handled = true
  614. end
  615.  
  616. -------------------------------------------------------------------------------------------------------------------
  617. -- User code that supplements self-commands.
  618. -------------------------------------------------------------------------------------------------------------------
  619.  
  620. -- Called for direct player commands.
  621. function job_self_command(cmdParams, eventArgs)
  622.     if cmdParams[1]:lower() == 'scholar' then
  623.         handle_strategems(cmdParams)
  624.         eventArgs.handled = true
  625.     end
  626. end
  627.  
  628. -------------------------------------------------------------------------------------------------------------------
  629. -- Utility functions specific to this job.
  630. -------------------------------------------------------------------------------------------------------------------
  631.  
  632. -- Reset the state vars tracking strategems.
  633. function update_active_strategems()
  634.     state.Buff['Ebullience'] = buffactive['Ebullience'] or false
  635.     state.Buff['Rapture'] = buffactive['Rapture'] or false
  636.     state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
  637.     state.Buff['Immanence'] = buffactive['Immanence'] or false
  638.     state.Buff['Penury'] = buffactive['Penury'] or false
  639.     state.Buff['Parsimony'] = buffactive['Parsimony'] or false
  640.     state.Buff['Celerity'] = buffactive['Celerity'] or false
  641.     state.Buff['Alacrity'] = buffactive['Alacrity'] or false
  642.  
  643.     state.Buff['Klimaform'] = buffactive['Klimaform'] or false
  644. end
  645.  
  646. function update_sublimation()
  647.     state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
  648. end
  649.  
  650. -- Equip sets appropriate to the active buffs, relative to the spell being cast.
  651. function apply_grimoire_bonuses(spell, action, spellMap)
  652.     if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
  653.         equip(sets.buff['Perpetuance'])
  654.     end
  655.     if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
  656.         equip(sets.buff['Rapture'])
  657.     end
  658.     if (spell.skill == 'Elemental Magic' or spell.skill == 'Dark Magic') and spellMap ~= 'ElementalEnfeeble' then
  659.         if state.Buff.Ebullience and spell.english ~= 'Impact' then
  660.             equip(sets.buff['Ebullience'])
  661.         end
  662.         if state.Buff.Immanence then
  663.             equip(sets.buff['Immanence'])
  664.         end
  665.         if state.Buff.Klimaform and spell.element == world.weather_element then
  666.             equip(sets.buff['Klimaform'])
  667.         end
  668.     end
  669.  
  670.     if state.Buff.Penury then equip(sets.buff['Penury']) end
  671.     if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
  672.     if state.Buff.Celerity then equip(sets.buff['Celerity']) end
  673.     if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
  674. end
  675.  
  676.  
  677. -- General handling of strategems in an Arts-agnostic way.
  678. -- Format: gs c scholar <strategem>
  679. function handle_strategems(cmdParams)
  680.     -- cmdParams[1] == 'scholar'
  681.     -- cmdParams[2] == strategem to use
  682.  
  683.     if not cmdParams[2] then
  684.         add_to_chat(123,'Error: No strategem command given.')
  685.         return
  686.     end
  687.     local strategem = cmdParams[2]:lower()
  688.  
  689.     if strategem == 'light' then
  690.         if buffactive['light arts'] then
  691.             send_command('input /ja "Addendum: White" <me>')
  692.         elseif buffactive['addendum: white'] then
  693.             add_to_chat(122,'Error: Addendum: White is already active.')
  694.         else
  695.             send_command('input /ja "Light Arts" <me>')
  696.         end
  697.     elseif strategem == 'dark' then
  698.         if buffactive['dark arts'] then
  699.             send_command('input /ja "Addendum: Black" <me>')
  700.         elseif buffactive['addendum: black'] then
  701.             add_to_chat(122,'Error: Addendum: Black is already active.')
  702.         else
  703.             send_command('input /ja "Dark Arts" <me>')
  704.         end
  705.     elseif buffactive['light arts'] or buffactive['addendum: white'] then
  706.         if strategem == 'cost' then
  707.             send_command('input /ja Penury <me>')
  708.         elseif strategem == 'speed' then
  709.             send_command('input /ja Celerity <me>')
  710.         elseif strategem == 'aoe' then
  711.             send_command('input /ja Accession <me>')
  712.         elseif strategem == 'power' then
  713.             send_command('input /ja Rapture <me>')
  714.         elseif strategem == 'duration' then
  715.             send_command('input /ja Perpetuance <me>')
  716.         elseif strategem == 'accuracy' then
  717.             send_command('input /ja Altruism <me>')
  718.         elseif strategem == 'enmity' then
  719.             send_command('input /ja Tranquility <me>')
  720.         elseif strategem == 'skillchain' then
  721.             add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
  722.         elseif strategem == 'addendum' then
  723.             send_command('input /ja "Addendum: White" <me>')
  724.         else
  725.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  726.         end
  727.     elseif buffactive['dark arts']  or buffactive['addendum: black'] then
  728.         if strategem == 'cost' then
  729.             send_command('input /ja Parsimony <me>')
  730.         elseif strategem == 'speed' then
  731.             send_command('input /ja Alacrity <me>')
  732.         elseif strategem == 'aoe' then
  733.             send_command('input /ja Manifestation <me>')
  734.         elseif strategem == 'power' then
  735.             send_command('input /ja Ebullience <me>')
  736.         elseif strategem == 'duration' then
  737.             add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
  738.         elseif strategem == 'accuracy' then
  739.             send_command('input /ja Focalization <me>')
  740.         elseif strategem == 'enmity' then
  741.             send_command('input /ja Equanimity <me>')
  742.         elseif strategem == 'skillchain' then
  743.             send_command('input /ja Immanence <me>')
  744.         elseif strategem == 'addendum' then
  745.             send_command('input /ja "Addendum: Black" <me>')
  746.         else
  747.             add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
  748.         end
  749.     else
  750.         add_to_chat(123,'No arts has been activated yet.')
  751.     end
  752. end
  753.  
  754.  
  755. -- Gets the current number of available strategems based on the recast remaining
  756. -- and the level of the sch.
  757. function get_current_strategem_count()
  758.     -- returns recast in seconds.
  759.     local allRecasts = windower.ffxi.get_ability_recasts()
  760.     local stratsRecast = allRecasts[231]
  761.  
  762.     local maxStrategems = (player.main_job_level + 10) / 20
  763.  
  764.     local fullRechargeTime = 4*60
  765.  
  766.     local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
  767.  
  768.     return currentCharges
  769. end
  770.  
  771.  
  772. -- Select default macro book on initial load or subjob change.
  773. function select_default_macro_book()
  774.     set_macro_page(1, 3)
  775. end
Advertisement
Add Comment
Please, Sign In to add comment