LauEra

SAM.lua

Mar 17th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.57 KB | None | 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.  
  14. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  15. function job_setup()
  16.     state.Buff.Hasso = buffactive.Hasso or false
  17.     state.Buff.Seigan = buffactive.Seigan or false
  18.     state.Buff.Sekkanoki = buffactive.Sekkanoki or false
  19.     state.Buff.Sengikori = buffactive.Sengikori or false
  20.     state.Buff['Meikyo Shisui'] = buffactive['Meikyo Shisui'] or false
  21. end
  22.  
  23. -------------------------------------------------------------------------------------------------------------------
  24. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  25. -------------------------------------------------------------------------------------------------------------------
  26.  
  27. -- Setup vars that are user-dependent.
  28. function user_setup()
  29.     state.OffenseMode:options('GreatKatana', 'Polearm', 'Sword')
  30.     state.HybridMode:options('Normal', 'PDT', 'Reraise')
  31.     state.WeaponskillMode:options('Normal', 'Acc', 'Mod')
  32.     state.PhysicalDefenseMode:options('PDT', 'Reraise')
  33.  
  34.     update_combat_form()
  35.    
  36.     -- Additional local binds
  37.    
  38.    
  39.  
  40.     select_default_macro_book()
  41. end
  42.  
  43.  
  44. -- Called when this job file is unloaded (eg: job change)
  45. function user_unload()
  46.    
  47. end
  48.  
  49.  
  50. -- Define sets and vars used by this job file.
  51. function init_gear_sets()
  52.     --------------------------------------
  53.     -- Start defining the sets
  54.     --------------------------------------
  55.    
  56.     -- Precast Sets
  57.     sets.precast.FC = {ear1="Loquacious Earring"}
  58.    
  59.     -- Precast sets to enhance JAs
  60.     sets.precast.JA.Meditate = {head="Myochin Kabuto",hands="Saotome Kote"}
  61.     sets.precast.JA['Third Eye'] = {legs="Saotome Haidate"}
  62.    
  63.  
  64.     -- Waltz set (chr and vit)
  65.    
  66.        
  67.     -- Don't need any special gear for Healing Waltz.
  68.    
  69.  
  70.        
  71.     -- Weaponskill sets
  72.     -- Default set for any weaponskill that isn't any more specifically defined
  73.    
  74.     sets.precast.WS = {head="Gnadbhod's Helm",neck="Justice Torque",ear1="Brutal Earring",ear2="Bushinomimi",
  75.         body="Haubergeon +1",hands="Alkyoneus's Bracelets",ring1="Rajas Ring",ring2="Flame Ring",
  76.         back="Cerberus Mantle +1",waist="Warwolf Belt",legs="Hachiryu Haidate",feet="Hachiman Sune-ate +1"}
  77.  
  78.  
  79.     -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
  80.    
  81.     sets.precast.WS['Tachi: Shoha'] = set_combine(sets.precast.WS, {neck="Thunder Gorget"})
  82.  
  83.     sets.precast.WS['Tachi: Kasha'] = set_combine(sets.precast.WS, {neck="Light Gorget"})
  84.  
  85.     sets.precast.WS['Tachi: Gekko'] = set_combine(sets.precast.WS, {neck="Aqua Gorget"})
  86.  
  87.     sets.precast.WS['Tachi: Yukikaze'] = set_combine(sets.precast.WS, {neck="Snow Gorget"})
  88.  
  89.     sets.precast.WS['Tachi: Kaiten'] = set_combine(sets.precast.WS, {neck="Soil Gorget"})
  90.  
  91.     sets.precast.WS['Tachi: Jinpu'] = set_combine(sets.precast.WS, {neck="Soil Gorget"})
  92.    
  93.     sets.precast.WS['Penta Thrust'] = set_combine(sets.precast.WS, {head="Ace's Helm",
  94.         body="Hachiryu Haramaki",
  95.         hands="Alkyoneus's Bracelets",
  96.         legs="Hachiryu Haidate",
  97.         feet="Sao. Sune-Ate +1",
  98.         neck="Love Torque",
  99.         waist="Warwolf Belt",
  100.         left_ear={ name="Brutal Earring", augments={'"Dbl.Atk."+2','"Dbl.Atk."+1',}},
  101.         right_ear="Hollow Earring",
  102.         left_ring="Rajas Ring",
  103.         right_ring={ name="Toreador's Ring", augments={'"Triple Atk."+2','Accuracy+1',}},
  104.         back="Cerberus Mantle +1"})
  105.    
  106.     sets.precast.WS['Stardiver'] = set_combine(sets.precast.WS, {neck="Soil Gorget",
  107.         head="Ace's Helm",
  108.         body="Hachiryu Haramaki",
  109.         hands="Alkyoneus's Bracelets",
  110.         legs="Hachiryu Haidate",
  111.         feet="Sao. Sune-Ate +1",
  112.         neck="Love Torque",
  113.         waist="Warwolf Belt",
  114.         left_ear={ name="Brutal Earring", augments={'"Dbl.Atk."+2','"Dbl.Atk."+1',}},
  115.         right_ear="Hollow Earring",
  116.         left_ring="Rajas Ring",
  117.         right_ring={ name="Toreador's Ring", augments={'"Triple Atk."+2','Accuracy+1',}},
  118.         back="Cerberus Mantle +1"})
  119.    
  120.     sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {head="Gnadbhod's Helm",
  121.         body="Hachiryu Haramaki",
  122.         hands="Hachiman Kote +1",
  123.         legs="Hachiryu Haidate",
  124.         feet="Hmn. Sune-Ate +1",
  125.         neck="Soil Gorget",
  126.         waist="Warwolf Belt",
  127.         left_ear={ name="Brutal Earring", augments={'"Dbl.Atk."+2','"Dbl.Atk."+1',}},
  128.         right_ear="Harmonius Earring",
  129.         left_ring="Rajas Ring",
  130.         right_ring={ name="Toreador's Ring", augments={'"Triple Atk."+2','Accuracy+1',}},
  131.         back="Cerb. Mantle +1"})
  132.    
  133.     sets.precast.WS['Sidewinder'] = set_combine(sets.precast.WS, {neck="Aqua Gorget",head="Optical Hat",hands="Seiryu's Kote",feet="Hachiryu Sune-ate",
  134.         ring2="Flame Ring",back="Amemet Mantle +1",waist="Buccaneer's Belt", body="Kirin's Osode"})
  135.  
  136.     -- Midcast Sets
  137.  
  138.     sets.midcast.Utsusemi = {head="Walahra Turban",neck="Evasion Torque",ear1="Loquacious Earring",ear2="Ethereal Earring",
  139.                     body="Arhat's Gi +1",hands="Dusk Gloves +1",ring1="Rajas Ring",ring2="Defending Ring",
  140.                     back="Boxer's Mantle",waist="Velocious Belt",legs="Byakko's Haidate",feet="Enkidu's Leggings"}
  141.    
  142.     -- Sets to return to when not performing an action.
  143.    
  144.     -- Resting sets
  145.  
  146.     sets.resting = {head="Ace's Helm",neck="Justice Torque",ear1="Brutal Earring",ear2="Bushinomimi",
  147.         body="Hachiryu Haramaki",hands="Hachiryu Kote",ring1="Rajas Ring",ring2="Toreador's Ring",
  148.         back="Cerberus Mantle +1",waist="Velocious Belt",legs="Hachiryu Haidate",feet="Hachiryu Sune-ate"}
  149.    
  150.  
  151.     -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  152.    
  153.     sets.idle = {head="Walahra Turban",neck="Justice Torque",ear1="Brutal Earring",ear2="Bushinomimi",
  154.         body="Arhat's Gi +1",hands="Seiryu's Kote",ring1="Rajas Ring",ring2="Defending Ring",
  155.         back="Boxer's Mantle",waist="Velocious Belt",legs="Byakko's Haidate",feet="Hachiryu Sune-ate"} 
  156.    
  157.     sets.idle.Town = {head="Ace's Helm",neck="Justice Torque",ear1="Brutal Earring",ear2="Bushinomimi",
  158.         body="Hachiryu Haramaki",hands="Hachiryu Kote",ring1="Rajas Ring",ring2="Toreador's Ring",
  159.         back="Cerberus Mantle +1",waist="Velocious Belt",legs="Hachiryu Haidate",feet="Hachiryu Sune-ate"}
  160.    
  161.     -- Defense sets
  162.  
  163.     -- Engaged sets
  164.    
  165.     sets.engaged.GreatKatana = {head="Walahra Turban",neck="Justice Torque",ear1="Brutal Earring",ear2="Bushinomimi",
  166.         body="Hachiryu Haramaki",hands="Hachiman Kote +1",ring1="Rajas Ring",ring2="Toreador's Ring",
  167.         back="Cerberus Mantle +1",waist="Velocious Belt",legs="Byakko's Haidate",feet="Hachiman Sune-ate +1"}
  168.        
  169.     sets.engaged.Polearm = {head="Walahra Turban",neck="Love Torque",ear1="Brutal Earring",ear2="Hollow Earring",
  170.         body="Hachiryu Haramaki",hands="Dusk Gloves +1",ring1="Rajas Ring",ring2="Toreador's Ring",
  171.         back="Cuchulain's Mantle",waist="Velocious Belt",legs="Byakko's Haidate",feet="Hachiman Sune-ate +1"}
  172.        
  173.     sets.engaged.Sword = {
  174.     head={ name="Walahra Turban", augments={'"Store TP"+8',}},
  175.     body="Hachiryu Haramaki",
  176.     hands="Dusk Gloves +1",
  177.     legs="Byakko's Haidate",
  178.     feet="Enkidu's Leggings",
  179.     neck="Fortitude Torque",
  180.     waist={ name="Velocious Belt", augments={'DEX+3','Fire resistance+20','Fire resistance+20',}},
  181.     left_ear={ name="Brutal Earring", augments={'"Dbl.Atk."+2','"Dbl.Atk."+1',}},
  182.     right_ear="Hollow Earring",
  183.     left_ring="Rajas Ring",
  184.     right_ring={ name="Toreador's Ring", augments={'"Triple Atk."+2','Accuracy+1',}},
  185.     back="Cuchulain's Mantle"}
  186.  
  187.     end
  188.  
  189.  
  190. -------------------------------------------------------------------------------------------------------------------
  191. -- Job-specific hooks for standard casting events.
  192. -------------------------------------------------------------------------------------------------------------------
  193.  
  194.  
  195.  
  196. -- Run after the default precast() is done.
  197. -- eventArgs is the same one used in job_precast, in case information needs to be persisted.
  198. function job_post_precast(spell, action, spellMap, eventArgs)
  199.     if spell.type:lower() == 'weaponskill' then
  200.         if state.Buff.Sekkanoki then
  201.             equip(sets.buff.Sekkanoki)
  202.         end
  203.         if state.Buff.Sengikori then
  204.             equip(sets.buff.Sengikori)
  205.         end
  206.         if state.Buff['Meikyo Shisui'] then
  207.             equip(sets.buff['Meikyo Shisui'])
  208.         end
  209.     end
  210. end
  211.  
  212.  
  213. -- Run after the default midcast() is done.
  214. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  215. function job_post_midcast(spell, action, spellMap, eventArgs)
  216.     -- Effectively lock these items in place.
  217.     if state.HybridMode.value == 'Reraise' or
  218.         (state.DefenseMode.value == 'Physical' and state.PhysicalDefenseMode.value == 'Reraise') then
  219.         equip(sets.Reraise)
  220.     end
  221. end
  222.  
  223. -------------------------------------------------------------------------------------------------------------------
  224. -- User code that supplements standard library decisions.
  225. -------------------------------------------------------------------------------------------------------------------
  226.  
  227. -- Called by the 'update' self-command, for common needs.
  228.  
  229.  
  230.  
  231. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  232. function display_current_job_state(eventArgs)
  233.  
  234. end
  235.  
  236. -------------------------------------------------------------------------------------------------------------------
  237. -- Utility functions specific to this job.
  238. -------------------------------------------------------------------------------------------------------------------
  239.  
  240. function update_combat_form()
  241.     if areas.Adoulin:contains(world.area) and buffactive.ionis then
  242.         state.CombatForm:set('Adoulin')
  243.     else
  244.         state.CombatForm:reset()
  245.     end
  246. end
  247.  
  248. -- Select default macro book on initial load or subjob change.
  249. function select_default_macro_book()
  250.     -- Default macro set/book
  251.     if player.sub_job == 'WAR' then
  252.         set_macro_page(1, 11)
  253.     elseif player.sub_job == 'DNC' then
  254.         set_macro_page(1, 11)
  255.     elseif player.sub_job == 'THF' then
  256.         set_macro_page(1, 11)
  257.     elseif player.sub_job == 'NIN' then
  258.         set_macro_page(1, 11)
  259.     else
  260.         set_macro_page(1, 11)
  261.     end
  262. end
Advertisement
Add Comment
Please, Sign In to add comment