Advertisement
Vamperica

SAM

May 13th, 2017
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.91 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('Normal', 'Acc')
  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.     send_command('bind ^` input /ja "Hasso" <me>')
  38.     send_command('bind !` input /ja "Seigan" <me>')
  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.     send_command('unbind ^`')
  47.     send_command('unbind !-')
  48. end
  49.  
  50.  
  51. -- Define sets and vars used by this job file.
  52. function init_gear_sets()
  53.     --------------------------------------
  54.     -- Start defining the sets
  55.     --------------------------------------
  56.    
  57.     -- Precast Sets
  58.     sets.precast.FastCast ={
  59.         ammo="Staunch Tathlum +1",
  60.         head={ name="Rao Kabuto", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  61.         body="Hiza. Haramaki +2",
  62.         hands={ name="Rao Kote", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  63.         legs="Arjuna Breeches",
  64.         feet={ name="Rao Sune-Ate", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  65.         neck="Sanctity Necklace",
  66.         waist="Flume Belt",
  67.         left_ear="Dawn Earring",
  68.         right_ear="Infused Earring",
  69.         left_ring="Defending Ring",
  70.         right_ring="Patricius Ring",
  71.         back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Damage taken-5%',}},
  72.         }
  73.    
  74.     -- Precast sets to enhance JAs
  75.     sets.precast.JA.Meditate = {
  76.         head="Wakido Kabuto +3",
  77.         hands="Sao. Kote",
  78.         back="Smertrios's Mantle",
  79.         }
  80.     sets.precast.JA['Warding Circle'] = {head="Wakido Kabuto +3"}
  81.     sets.precast.JA['Blade Bash'] = {}
  82.  
  83.     -- Waltz set (chr and vit)
  84.     sets.precast.Waltz = {}
  85.        
  86.     -- Don't need any special gear for Healing Waltz.
  87.     sets.precast.Waltz['Healing Waltz'] = {}
  88.        
  89.     -- Weaponskill sets Acc 1070
  90.     -- Default set for any weaponskill that isn't any more specifically defined
  91.     sets.precast.WS = {
  92.         ammo="Knobkierrie",
  93.         head={name="Valorous Mask", augments={'Attack+28','Weapon skill damage +3%','Accuracy+13',}},
  94.         neck="Fotia Gorget",
  95.         ear1="Ishvara Earring",
  96.         ear2="Moonshade Earring",
  97.         body="Sakonji Domaru +3",
  98.         hands={name="Valorous Mitts", augments={'Accuracy+16','Weapon skill damage +3%','AGI+2','Attack+13',}},
  99.         ring1="Epaminondas's Ring",
  100.         ring2="Regal Ring",
  101.         back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%',}},
  102.         waist="Fotia Belt",
  103.         legs="Wakido Haidate +3",
  104.         feet={name="Valorous Greaves", augments={'Accuracy+17 Attack+17','Weapon skill damage +3%',}},
  105.         }
  106.  
  107.     sets.precast.WS.Acc = set_combine(sets.precast.WS, {})
  108.  
  109.     -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
  110.     sets.precast.WS['Tachi: Fudo'] = set_combine(sets.precast.WS, {})
  111.     sets.precast.WS['Tachi: Fudo'].Acc = set_combine(sets.precast.WS.Acc, {})
  112.     sets.precast.WS['Tachi: Fudo'].Mod = set_combine(sets.precast.WS['Tachi: Fudo'], {})
  113.  
  114.     sets.precast.WS['Tachi: Shoha'] = set_combine(sets.precast.WS, {
  115.     head="Flam. Zucchetto +2",
  116.     feet="Flam. Gambieras +2",
  117.     })
  118.  
  119.     sets.precast.WS['Tachi: Shoha'].Acc = set_combine(sets.precast.WS['Tachi: Shoha'], {})
  120.     sets.precast.WS['Tachi: Shoha'].Mod = set_combine(sets.precast.WS['Tachi: Shoha'], {})
  121.  
  122.     sets.precast.WS['Tachi: Rana'] = set_combine(sets.precast.WS['Tachi: Shoha'], {})
  123.     sets.precast.WS['Tachi: Rana'].Acc = set_combine(sets.precast.WS['Tachi: Shoha'].Acc, {})
  124.     sets.precast.WS['Tachi: Rana'].Mod = set_combine(sets.precast.WS['Tachi: Shoha'].Mod, {})
  125.  
  126.     sets.precast.WS['Tachi: Kasha'] = set_combine(sets.precast.WS, {})
  127.     sets.precast.WS['Tachi: Kasha'].Acc = set_combine(sets.precast.WS['Tachi: Fudo'].Acc, {})
  128.  
  129.     sets.precast.WS['Tachi: Gekko'] = set_combine(sets.precast.WS, {})
  130.     sets.precast.WS['Tachi: Gekko'].Acc = set_combine(sets.precast.WS['Tachi: Fudo'].Acc, {})
  131.  
  132.     sets.precast.WS['Tachi: Yukikaze'] = set_combine(sets.precast.WS, {})
  133.     sets.precast.WS['Tachi: Yukikaze'].Acc = set_combine(sets.precast.WS['Tachi: Fudo'].Acc, {})
  134.  
  135.     sets.precast.WS['Tachi: Ageha'] = set_combine(sets.precast.WS, {
  136.         ammo="Knobkierrie",
  137.         head="Flam. Zucchetto +2",
  138.         body="Sakonji Domaru +3",
  139.         hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
  140.         legs="Wakido Haidate +3",
  141.         feet="Flam. Gambieras +2",
  142.         neck="Sanctity Necklace",
  143.         waist="Eschan Stone",
  144.         left_ear="Digni. Earring",
  145.         right_ear="Moonshade Earring",
  146.         left_ring="Niqmaddu Ring",
  147.         right_ring="Regal Ring",
  148.         back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%',}},
  149.         })
  150.     sets.precast.WS['Tachi: Ageha'].Acc = set_combine(sets.precast.WS['Tachi: Fudo'].Acc, {})
  151.  
  152.     sets.precast.WS['Tachi: Jinpu'] = {
  153.     ammo="Knobkierrie",
  154.     head="Flam. Zucchetto +2",
  155.     body={ name="Found. Breastplate", augments={'Accuracy+15','Mag. Acc.+15','Attack+15','"Mag.Atk.Bns."+15',}},
  156.     hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
  157.     legs="Wakido Haidate +3",
  158.     feet={ name="Founder's Greaves", augments={'VIT+10','Accuracy+15','"Mag.Atk.Bns."+15','Mag. Evasion+15',}},
  159.     neck="Fotia Gorget",
  160.     waist="Fotia Belt",
  161.     left_ear="Friomisi Earring",
  162.     right_ear="Moonshade Earring",
  163.     left_ring="Niqmaddu Ring",
  164.     right_ring="Regal Ring",
  165.     back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%',}},
  166.     }
  167.     sets.precast.WS['Tachi: Koki'] = set_combine(sets.precast.WS['Tachi: Jinpu'], {})
  168.     sets.precast.WS['Tachi: Goten'] = set_combine(sets.precast.WS['Tachi: Jinpu'], {})
  169.     sets.precast.WS['Tachi: Kagero'] = set_combine(sets.precast.WS['Tachi: Jinpu'], {})
  170.  
  171.     -- Midcast Sets
  172.     sets.midcast.FastCast = sets.precast.FastCast
  173.  
  174.     -- Sets to return to when not performing an action.
  175.    
  176.     -- Resting sets
  177.     sets.resting = {}
  178.    
  179.     -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
  180.     sets.idle.Town = {
  181.         ammo="Staunch Tathlum +1",
  182.         head="Wakido Kabuto +3",
  183.         body="Councilor's Garb",
  184.         hands={ name="Rao Kote", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  185.         legs="Arjuna Breeches",
  186.         feet={ name="Rao Sune-Ate", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  187.         neck="Sanctity Necklace",
  188.         waist="Flume Belt",
  189.         left_ear="Dawn Earring",
  190.         right_ear="Infused Earring",
  191.         left_ring="Defending Ring",
  192.         right_ring="Patricius Ring",
  193.         back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Damage taken-5%',}},
  194.         }
  195.    
  196.     sets.idle.Field = {
  197.         ammo="Staunch Tathlum +1",
  198.         head="Wakido Kabuto +3",
  199.         body="Hiza. Haramaki +2",
  200.         hands={ name="Rao Kote", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  201.         legs="Arjuna Breeches",
  202.         feet={ name="Rao Sune-Ate", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
  203.         neck="Sanctity Necklace",
  204.         waist="Flume Belt",
  205.         left_ear="Dawn Earring",
  206.         right_ear="Infused Earring",
  207.         left_ring="Defending Ring",
  208.         right_ring="Patricius Ring",
  209.         back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Damage taken-5%',}},
  210.         }
  211.  
  212.     sets.idle.Weak = sets.idle.Field
  213.    
  214.     -- Defense sets
  215.     sets.defense.PDT = {
  216.         ammo="Staunch Tathlum +1",
  217.         head="Ynglinga Sallet",
  218.         body="Tartarus Platemail",
  219.         hands="Wakido Kote +3",
  220.         legs="Arjuna Breeches",
  221.         feet={ name="Amm Greaves", augments={'HP+50','VIT+10','Accuracy+15','Damage taken-2%',}},
  222.         neck="Loricate Torque +1",
  223.         waist="Ioskeha Belt +1",
  224.         left_ear={name="Mache Earring +1", bag="Wardrobe"},
  225.         right_ear={name="Mache Earring +1", bag="Wardrobe2"},
  226.         left_ring="Defending Ring",
  227.         right_ring="Patricius Ring",
  228.         back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Damage taken-5%',}},
  229.         }
  230.  
  231.     sets.defense.Reraise = {}
  232.  
  233.     sets.defense.MDT = {}
  234.  
  235.     sets.Kiting = {feet="Danzo Sune-ate"}
  236.  
  237.     sets.Reraise = {}
  238.  
  239.     -- Engaged sets
  240.  
  241.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  242.     -- sets if more refined versions aren't defined.
  243.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  244.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  245.    
  246.     -- Normal melee group
  247.     -- Delay 450 GK, 25 Save TP => 65 Store TP for a 5-hit (25 Store TP in gear)
  248.  
  249.     -- Acc 1176
  250.     sets.engaged = {
  251.         ammo="Ginsen",
  252.         head="Flam. Zucchetto +2",
  253.         body="Dagon Breast.",
  254.         hands="Wakido Kote +3",
  255.         legs="Wakido Haidate +3",
  256.         feet="Flam. Gambieras +2",
  257.         neck="Moonlight Nodowa",
  258.         waist="Ioskeha Belt +1",
  259.         left_ear="Brutal Earring",
  260.         right_ear="Digni. Earring",
  261.         right_ring="Petrov Ring",
  262.         left_ring="Flamma Ring",
  263.         back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Damage taken-5%',}},
  264.         }
  265.  
  266.     sets.engaged.Acc = set_combine(sets.engaged, {
  267.         left_ear="Mache Earring +1",
  268.         right_ear="Mache Earring +1",
  269.         left_ring="Regal Ring",
  270.         })
  271.     sets.engaged.PDT = set_combine(sets.engaged, {})
  272.     sets.engaged.Acc.PDT = set_combine(sets.engaged, {})
  273.     sets.engaged.Reraise = set_combine(sets.engaged, {})
  274.     sets.engaged.Acc.Reraise = set_combine(sets.engaged, {})
  275.        
  276.     -- Melee sets for in Adoulin, which has an extra 10 Save TP for weaponskills.
  277.     -- Delay 450 GK, 35 Save TP => 89 Store TP for a 4-hit (49 Store TP in gear), 2 Store TP for a 5-hit
  278.     sets.engaged.Adoulin = sets.engaged
  279.     sets.engaged.Adoulin.Acc = sets.engaged.Acc
  280.     sets.engaged.Adoulin.PDT = sets.engaged.PDT
  281.     sets.engaged.Adoulin.Acc.PDT = sets.engaged.Acc.PDT
  282.     sets.engaged.Adoulin.Reraise = sets.engaged.Reraise
  283.     sets.engaged.Adoulin.Acc.Reraise = sets.engaged.Acc.Reraise
  284.  
  285.  
  286.     sets.buff.Sekkanoki = {}
  287.     sets.buff.Sengikori = {}
  288.     sets.buff['Meikyo Shisui'] = {}
  289. end
  290.  
  291.  
  292. -------------------------------------------------------------------------------------------------------------------
  293. -- Job-specific hooks for standard casting events.
  294. -------------------------------------------------------------------------------------------------------------------
  295.  
  296. -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
  297. function job_pretarget(spell, action, spellMap, eventArgs)
  298.     if spell.type == 'WeaponSkill' then
  299.         -- Change any GK weaponskills to polearm weaponskill if we're using a polearm.
  300.         if player.equipment.main=='Quint Spear' or player.equipment.main=='Quint Spear' then
  301.             if spell.english:startswith("Tachi:") then
  302.                 send_command('@input /ws "Penta Thrust" '..spell.target.raw)
  303.                 eventArgs.cancel = true
  304.             end
  305.         end
  306.     end
  307. end
  308.  
  309. -- Run after the default precast() is done.
  310. -- eventArgs is the same one used in job_precast, in case information needs to be persisted.
  311. function job_post_precast(spell, action, spellMap, eventArgs)
  312.     if spell.type:lower() == 'weaponskill' then
  313.         if state.Buff.Sekkanoki then
  314.             equip(sets.buff.Sekkanoki)
  315.         end
  316.         if state.Buff.Sengikori then
  317.             equip(sets.buff.Sengikori)
  318.         end
  319.         if state.Buff['Meikyo Shisui'] then
  320.             equip(sets.buff['Meikyo Shisui'])
  321.         end
  322.     end
  323. end
  324.  
  325.  
  326. -- Run after the default midcast() is done.
  327. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  328. function job_post_midcast(spell, action, spellMap, eventArgs)
  329.     -- Effectively lock these items in place.
  330.     if state.HybridMode.value == 'Reraise' or
  331.         (state.DefenseMode.value == 'Physical' and state.PhysicalDefenseMode.value == 'Reraise') then
  332.         equip(sets.Reraise)
  333.     end
  334. end
  335.  
  336. -------------------------------------------------------------------------------------------------------------------
  337. -- Job-specific hooks for non-casting events.
  338. -------------------------------------------------------------------------------------------------------------------
  339.  
  340. function job_buff_change(status,gain_or_loss)
  341.     handle_equipping_gear(player.status)
  342.     if (gain_or_loss) then  
  343.         add_to_chat(4,'------- Gained Buff: '..status..'-------')
  344.         handle_equipping_gear(player.status)
  345.         if status == "KO" then
  346.             add_to_chat('GAME OVER')
  347.             handle_equipping_gear(player.status)
  348.         end
  349.     else
  350.         add_to_chat(3,'------- Lost Buff: '..status..'-------')
  351.         handle_equipping_gear(player.status)
  352.     end
  353. end
  354.  
  355. -------------------------------------------------------------------------------------------------------------------
  356. -- User code that supplements standard library decisions.
  357. -------------------------------------------------------------------------------------------------------------------
  358.  
  359. -- Called by the 'update' self-command, for common needs.
  360. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  361. function job_update(cmdParams, eventArgs)
  362.     update_combat_form()
  363. end
  364.  
  365. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  366. function display_current_job_state(eventArgs)
  367.  
  368. end
  369.  
  370. -------------------------------------------------------------------------------------------------------------------
  371. -- Utility functions specific to this job.
  372. -------------------------------------------------------------------------------------------------------------------
  373.  
  374. function update_combat_form()
  375.     if areas.Adoulin:contains(world.area) and buffactive.ionis then
  376.         state.CombatForm:set('Adoulin')
  377.     else
  378.         state.CombatForm:reset()
  379.     end
  380. end
  381.  
  382. -- Select default macro book on initial load or subjob change.
  383. function select_default_macro_book()
  384.     -- Default macro set/book
  385.     if player.sub_job == 'WAR' then
  386.         set_macro_page(1, 3)
  387.     elseif player.sub_job == 'DNC' then
  388.         set_macro_page(1, 3)
  389.     elseif player.sub_job == 'THF' then
  390.         set_macro_page(1, 3)
  391.     elseif player.sub_job == 'NIN' then
  392.         set_macro_page(1, 3)
  393.     else
  394.         set_macro_page(1, 3)
  395.     end
  396. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement