Advertisement
Guest User

RNG

a guest
Jan 24th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.13 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.Barrage = buffactive.Barrage or false
  17.     state.Buff.Camouflage = buffactive.Camouflage or false
  18.     state.Buff['Unlimited Shot'] = buffactive['Unlimited Shot'] or false
  19. end
  20.  
  21. -------------------------------------------------------------------------------------------------------------------
  22. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  23. -------------------------------------------------------------------------------------------------------------------
  24.  
  25. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  26. function user_setup()
  27.     state.OffenseMode:options('Normal', 'Melee')
  28.     state.RangedMode:options('Normal', 'Acc')
  29.     state.WeaponskillMode:options('Normal', 'Acc')
  30.    
  31.     gear.default.weaponskill_neck = "Breeze Gorget"
  32.    
  33.      state.AutoRA = M{['description']='Auto RA', 'Normal', 'Shoot', 'WS' }
  34.      auto_gun_ws = "Coronach"
  35.    
  36.     DefaultAmmo = { ['Annihilator'] = "Silver Bullet"}
  37.     U_Shot_Ammo = { ['Annihilator'] = "Silver Bullet"}
  38.  
  39.     select_default_macro_book()
  40.  
  41.     send_command('bind f9 gs c cycle RangedMode')
  42.     send_command('bind ^f9 gs c cycle OffenseMode')
  43. end
  44.  
  45.  
  46. -- Called when this job file is unloaded (eg: job change)
  47. function user_unload()
  48.     send_command('unbind f9')
  49.     send_command('unbind ^f9')
  50. end
  51.  
  52.  
  53. -- Set up all gear sets.
  54. function init_gear_sets()
  55.     --------------------------------------
  56.     -- Precast sets
  57.     --------------------------------------
  58.  
  59.     -- Precast sets to enhance JAs
  60.     sets.precast.JA['Bounty Shot'] = {}
  61.     sets.precast.JA['Camouflage'] = {}
  62.     sets.precast.JA['Scavenge'] = {}
  63.     sets.precast.JA['Shadowbind'] = {}
  64.     sets.precast.JA['Sharpshot'] = {}
  65.     sets.precast.JA['Barrage'] = sets.buff.Barrage
  66.  
  67.  
  68.     -- Fast cast sets for spells
  69.  
  70.     sets.precast.FC = {}
  71.  
  72.     sets.precast.FC.Utsusemi = set_combine(sets.precast.FC)
  73.  
  74.  
  75.     -- Ranged sets (snapshot)
  76.    
  77.     sets.precast.RA = {head="Scout's Beret +1"}
  78.  
  79.  
  80.     -- Weaponskill sets
  81.     -- Default set for any weaponskill that isn't any more specifically defined
  82.     sets.precast.WS.Acc = {
  83.         head="Enkidu's Cap",
  84.         body="Kirin's Osode",
  85.         hands="Seiryu's Kote",
  86.         legs="Byakko's Haidate",
  87.         feet="Hachiryu Sune-Ate",
  88.         neck="Breeze Gorget",
  89.         waist="Scout's Belt",
  90.         left_ear="Hollow Earring",
  91.         right_ear="Pixie Earring",
  92.         left_ring="Thunder Ring",
  93.         right_ring="Rajas Ring",
  94.         back="Amemet Mantle +1"}
  95.        
  96.     sets.precast.WS = {
  97.         head="Enkidu's Cap",
  98.         body="Kirin's Osode",
  99.         hands="Crimson Finger Gauntlets",
  100.         legs="Hachiryu Haidate",
  101.         feet="Scout's Socks +1",
  102.         neck="Breeze Gorget",
  103.         waist="Scout's Belt",
  104.         left_ear="Hollow Earring",
  105.         right_ear="Harmonius Earring",
  106.         left_ring="Flame Ring",
  107.         right_ring="Rajas Ring",
  108.         back="Amemet Mantle +1"}
  109.        
  110.     sets.precast.WS['Slug Shot'] = set_combine(sets.precast.WS, {legs="Hachiryu Haidate",ear2="Suppanomimi",ring1="Breeze Ring",back="Amemet Mantle +1"})
  111.  
  112.    
  113.  
  114.     -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
  115.  
  116.  
  117.     --------------------------------------
  118.     -- Midcast sets
  119.     --------------------------------------
  120.  
  121.     -- Fast recast for spells
  122.    
  123.     sets.midcast.FastRecast = {}
  124.  
  125.     sets.midcast.Utsusemi = {}
  126.  
  127.     -- Ranged sets
  128.  
  129.     sets.midcast.RA = {
  130.         head="Enkidu's Cap",
  131.         body="Kyudogi +1",
  132.         hands="Crimson Fng. Gnt.",
  133.         legs="Sct. Braccae +1",
  134.         feet="Sct. Socks +1",
  135.         neck="Faith Torque",
  136.         waist="Scout's Belt",
  137.         left_ear="Hollow Earring",
  138.         right_ear="Harmonius Earring",
  139.         left_ring="Merman's Ring",
  140.         right_ring="Rajas Ring",
  141.         back="Amemet Mantle +1"}
  142.    
  143.     sets.midcast.RA.Acc = {
  144.         head="Optical Hat",
  145.         body="Kyudogi +1",
  146.         hands="Seiryu's Kote",
  147.         legs="Sct. Braccae +1",
  148.         feet="Hachiryu Sune-Ate",
  149.         neck="Faith Torque",
  150.         waist="Scout's Belt",
  151.         left_ear="Hollow Earring",
  152.         right_ear="Suppanomimi",
  153.         left_ring="Merman's Ring",
  154.         right_ring="Rajas Ring",
  155.         back="Amemet Mantle +1"}
  156.  
  157.    
  158.  
  159.    
  160.    
  161.     --------------------------------------
  162.     -- Idle/resting/defense/etc sets
  163.     --------------------------------------
  164.  
  165.     -- Sets to return to when not performing an action.
  166.  
  167.     -- Resting sets
  168.     sets.resting = {}
  169.  
  170.     -- Idle sets
  171.     sets.idle = {
  172.         head="Sct. Beret +1",
  173.         body="Sct. Jerkin +1",
  174.         hands="Seiryu's Kote",
  175.         legs="Blood Cuisses",
  176.         feet="Trotter Boots",
  177.         neck="Faith Torque",
  178.         waist="Scout's Belt",
  179.         left_ear="Hollow Earring",
  180.         right_ear="Harmonius Earring",
  181.         left_ring="Merman's Ring",
  182.         right_ring="Rajas Ring",
  183.         back="Amemet Mantle +1"}
  184.    
  185.     sets.idle.Town = {
  186.         main={ name="Ridill", augments={'DMG:+15',}},
  187.         sub="Kraken Club",
  188.         range="Annihilator",
  189.         ammo="Silver Bullet",
  190.         head="Gnadbhod's Helm",
  191.         body="Kyudogi +1",
  192.         hands="Seiryu's Kote",
  193.         legs="Blood Cuisses",
  194.         feet="Trotter Boots",
  195.         neck="Faith Torque",
  196.         waist="Buccaneer's Belt",
  197.         left_ear="Hollow Earring",
  198.         right_ear="Harmonius Earring",
  199.         left_ring="Flame Ring",
  200.         right_ring="Rajas Ring",
  201.         back="Amemet Mantle +1"}
  202.    
  203.     -- Defense sets
  204.     sets.defense.PDT = {}
  205.  
  206.     sets.defense.MDT = {}
  207.  
  208.     sets.Kiting = {legs="Blood Cuisses",feet="Trotter Boots"}
  209.  
  210.  
  211.     --------------------------------------
  212.     -- Engaged sets
  213.     --------------------------------------
  214.     sets.engaged = {
  215.         head="Enkidu's Cap",
  216.         body="Kyudogi +1",
  217.         hands="Crimson Fng. Gnt.",
  218.         legs="Sct. Braccae +1",
  219.         feet="Sct. Socks +1",
  220.         neck="Faith Torque",
  221.         waist="Scout's Belt",
  222.         left_ear="Hollow Earring",
  223.         right_ear="Harmonius Earring",
  224.         left_ring="Merman's Ring",
  225.         right_ring="Rajas Ring",
  226.         back="Amemet Mantle +1"}
  227.  
  228.     sets.engaged.Acc = {
  229.         head="Optical Hat",
  230.         body="Kyudogi +1",
  231.         hands="Seiryu's Kote",
  232.         legs="Sct. Braccae +1",
  233.         feet="Hachiryu Sune-Ate",
  234.         neck="Faith Torque",
  235.         waist="Scout's Belt",
  236.         left_ear="Hollow Earring",
  237.         right_ear="Suppanomimi",
  238.         left_ring="Merman's Ring",
  239.         right_ring="Rajas Ring",
  240.         back="Amemet Mantle +1"}
  241.    
  242.     sets.engaged.Melee = {
  243.     main={ name="Kraken Club", augments={'DMG:+7',}},
  244.     range="Annihilator",
  245.     ammo="Silver Bullet",
  246.     head={ name="Walahra Turban", augments={'"Store TP"+8',}},
  247.     body="Hachiryu Haramaki",
  248.     hands="Dusk Gloves +1",
  249.     legs="Byakko's Haidate",
  250.     feet="Enkidu's Leggings",
  251.     neck="Peacock Amulet",
  252.     waist={ name="Velocious Belt", augments={'DEX+3','Fire resistance+20','Fire resistance+20',}},
  253.     left_ear="Hollow Earring",
  254.     right_ear="Suppanomimi",
  255.     left_ring={ name="Toreador's Ring", augments={'"Triple Atk."+2','Accuracy+1',}},
  256.     right_ring="Rajas Ring",
  257.     back="Cuchulain's Mantle"}
  258.     --------------------------------------
  259.     -- Custom buff sets
  260.     --------------------------------------
  261.  
  262.     sets.buff.Barrage = sets.midcast.RA.Acc
  263.     sets.buff.Camouflage = {}
  264. end
  265.  
  266. -------------------------------------------------------------------------------------------------------------------
  267. -- Job-specific hooks for standard casting events.
  268. -------------------------------------------------------------------------------------------------------------------
  269.  
  270. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  271. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  272. function job_precast(spell, action, spellMap, eventArgs)
  273.     if spell.action_type == 'Ranged Attack' then
  274.         state.CombatWeapon:set(player.equipment.range)
  275.     end
  276.  
  277.     if spell.action_type == 'Ranged Attack' or
  278.       (spell.type == 'WeaponSkill' and (spell.skill == 'Marksmanship' or spell.skill == 'Archery')) then
  279.         check_ammo(spell, action, spellMap, eventArgs)
  280.     end
  281.    
  282.     if state.DefenseMode.value ~= 'None' and spell.type == 'WeaponSkill' then
  283.         -- Don't gearswap for weaponskills when Defense is active.
  284.         eventArgs.handled = true
  285.     end
  286. end
  287.  
  288.  
  289. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  290. function job_midcast(spell, action, spellMap, eventArgs)
  291.     if spell.action_type == 'Ranged Attack' and state.Buff.Barrage then
  292.         equip(sets.buff.Barrage)
  293.         eventArgs.handled = true
  294.     end
  295. end
  296.  
  297. -------------------------------------------------------------------------------------------------------------------
  298. -- Job-specific hooks for non-casting events.
  299. -------------------------------------------------------------------------------------------------------------------
  300.  
  301. -- Called when a player gains or loses a buff.
  302. -- buff == buff gained or lost
  303. -- gain == true if the buff was gained, false if it was lost.
  304. function job_buff_change(buff, gain)
  305.     if buff == "Camouflage" then
  306.         if gain then
  307.             equip(sets.buff.Camouflage)
  308.             disable('body')
  309.         else
  310.             enable('body')
  311.         end
  312.     end
  313. end
  314.  
  315. -------------------------------------------------------------------------------------------------------------------
  316. -- User code that supplements standard library decisions.
  317. -------------------------------------------------------------------------------------------------------------------
  318.  
  319. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  320. function display_current_job_state(eventArgs)
  321.  
  322. end
  323.  
  324. -------------------------------------------------------------------------------------------------------------------
  325. -- Utility functions specific to this job.
  326. -------------------------------------------------------------------------------------------------------------------
  327.  
  328. -- Check for proper ammo when shooting or weaponskilling
  329. function check_ammo(spell, action, spellMap, eventArgs)
  330.     -- Filter ammo checks depending on Unlimited Shot
  331.     if state.Buff['Unlimited Shot'] then
  332.         if player.equipment.ammo ~= U_Shot_Ammo[player.equipment.range] then
  333.             if player.inventory[U_Shot_Ammo[player.equipment.range]] or player.wardrobe[U_Shot_Ammo[player.equipment.range]] then
  334.                 add_to_chat(122,"Unlimited Shot active. Using custom ammo.")
  335.                 equip({ammo=U_Shot_Ammo[player.equipment.range]})
  336.             elseif player.inventory[DefaultAmmo[player.equipment.range]] or player.wardrobe[DefaultAmmo[player.equipment.range]] then
  337.                 add_to_chat(122,"Unlimited Shot active but no custom ammo available. Using default ammo.")
  338.                 equip({ammo=DefaultAmmo[player.equipment.range]})
  339.             else
  340.                 add_to_chat(122,"Unlimited Shot active but unable to find any custom or default ammo.")
  341.             end
  342.         end
  343.     else
  344.         if player.equipment.ammo == U_Shot_Ammo[player.equipment.range] and player.equipment.ammo ~= DefaultAmmo[player.equipment.range] then
  345.             if DefaultAmmo[player.equipment.range] then
  346.                 if player.inventory[DefaultAmmo[player.equipment.range]] then
  347.                     add_to_chat(122,"Unlimited Shot not active. Using Default Ammo")
  348.                     equip({ammo=DefaultAmmo[player.equipment.range]})
  349.                 else
  350.                     add_to_chat(122,"Default ammo unavailable.  Removing Unlimited Shot ammo.")
  351.                     equip({ammo=empty})
  352.                 end
  353.             else
  354.                 add_to_chat(122,"Unable to determine default ammo for current weapon.  Removing Unlimited Shot ammo.")
  355.                 equip({ammo=empty})
  356.             end
  357.         elseif player.equipment.ammo == 'empty' then
  358.             if DefaultAmmo[player.equipment.range] then
  359.                 if player.inventory[DefaultAmmo[player.equipment.range]] then
  360.                     add_to_chat(122,"Using Default Ammo")
  361.                     equip({ammo=DefaultAmmo[player.equipment.range]})
  362.                 else
  363.                     add_to_chat(122,"Default ammo unavailable.  Leaving empty.")
  364.                 end
  365.             else
  366.                 add_to_chat(122,"Unable to determine default ammo for current weapon.  Leaving empty.")
  367.             end
  368.         elseif player.inventory[player.equipment.ammo].count < 15 then
  369.             add_to_chat(122,"Ammo '"..player.inventory[player.equipment.ammo].shortname.."' running low ("..player.inventory[player.equipment.ammo].count..")")
  370.         end
  371.     end
  372. end
  373.  
  374.  
  375.  
  376. -- Select default macro book on initial load or subjob change.
  377. function select_default_macro_book()
  378.     set_macro_page(5, 1)
  379. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement