Marvo

Untitled

Jun 9th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 33.40 KB | None | 0 0
  1. -- Current Owner: AlanWarren, aka ~ Orestes
  2. -- Orinal file credit KBEEZIE
  3. -- current file resides @ https://github.com/AlanWarren/gearswap
  4.  
  5. --[[
  6. === General Notes ===
  7. I've added options so anyone can use this script with any weapon they want. Look towards the top of this script for
  8. gear.Bow, gear.Gun, and gear.Stave. There's also a toggle for use_night_earring that you can set to false if you
  9. don't have or want to use Fenrir's Earring.
  10.  
  11. Debug: //gs debugmode
  12. //gs showswaps
  13.  
  14. Auto RA:
  15. gs c toggle autora
  16.  
  17. === Some Notes On Sets ===
  18. 1) Annihilator + Hurlbat - This is used whenever ranged accuracy is a concern, or when I want war SJ's fencer bonus
  19. 2) Annihilator + Mekki Shakki - These sets have higher ranged attack, and generally do more damage at the cost of some racc.
  20. 3) Yoichi + Mekki Shakki + Decoy Down - This set is a bit light on racc/ratk, with focus on 4-hit and -enmity
  21. 4) Yoichi + Mekki Shakki + Decoy Up - This set is high ratk, with less focus on racc since Yoichi's aftermath provides a bit
  22. 5) Yoichi + Hurlbat - This set is pretty much a wash since bow needs so much STP to x-hit. Normally this would be a higher
  23. racc set for Bow, but it doesn't really accomplish this well right now. Stick to staves for bow..
  24. 6) Annihilator + SAM Subjob - This is "messing around" set that will 3-hit with all 3 shots proc'ing recycle!
  25.  
  26. === Toggles ===
  27. 1) Normal aims to be a 4-hit with as few recycle procs as I can possibly gear for without sacrificing too much.
  28. I will usually start out with this set, and occasionaly stick with it if my food allows decent racc.
  29. 2) Mod adds a bit more acc, while maintaining 4 hit (may require more recycle procs)
  30. I generally use this set on anything Difficult+, or delve2. Sometimes it allows me to eat meat.
  31. 3) Acc is full blown racc with minimal concern for anything else. Some sets will 4-hit with with all 4 shots proc'ing recycle
  32. This mode is only used when fighting difficult content, and all buffs drop.
  33.  
  34. === Modes ===
  35. 1) Non-specific default sets are for Gun. They assume a 1 handed weapon since Hurlbat is my default for Annihilator.
  36. * Gun2H set is used whenever your main weapon is equal to gear.Stave. This set was designed for Mekki + Bloodrain
  37. 1) Bow sets will activate by equipping whichever bow you defined in gear.Bow
  38. * Bow sets assume a stave + strap combination
  39. * Decoy1H and Bow1H will be used whenever you're NOT using gear.Stave i.e. Hurlbat
  40. 2) Decoy set only applies while decoy is active AND you're using Bow
  41. * Standard Bow set uses -enmity gear, while maintaining 4-hit (with 4/4 recycle proc)
  42. * Decoy set removes -enmity gear for a normal 4-hit setup (3/4 or 2/4 recycle proc)
  43. 3) Fenrir's earring is equipped at night for WS. You can disable this by setting use_night_earring = false
  44. 4) During Overkill, I use a special set for precast/midcast containing rapidshot / doubleshot dmg gear.
  45.  
  46. === In Precast ===
  47. 1) Checks to make sure you're in an engaged state and have 100+ TP before firing a weaponskill
  48. 2) Checks the distance to target to prevent WS from being fired when target is too far (prevents TP loss)
  49. 3) Does not allow gear-swapping on weaponskills when Defense mode is enabled
  50. 4) Checks to see of "Unlimited Shot" buff is on, if there's any special ammo defined in sets equipped
  51. 5) Checks for empty ammo (or special without buff) and fills in the default ammunition for that weapon
  52. ^ keeps empty if that ammo cannot be found, or there is no match to the weapon equipped
  53. 6) Provides a low ammunition warning if current ammo in slot (counts all in inventory) is less than 15
  54. ^ If you have 5 Tulfaire arrows in slot, but 20 also in inventory it see's it as 25 total
  55.  
  56. === In Midcast ===
  57. If Sneak is active, sends the cancel command before Spectral Jig finish casting
  58.  
  59. === In Post-Midcast ===
  60. If Barrage Buff is active, equips sets.BarrageMid
  61.  
  62. === In Buff Change ===
  63. If Camouflage is active, disable body swaping
  64. This is done to preserve the +100 Camouflage Duration given by Orion Jerkin
  65. --]]
  66.  
  67. function get_sets()
  68.         -- Load and initialize the include file.
  69.         include('Mote-Include.lua')
  70. end
  71.  
  72. function user_setup()
  73.         send_command('bind f9 gs c cycle RangedMode')
  74.         send_command('bind ^] gs c cycle OffenseMode')
  75.         send_command('bind ^f9 gs c cycle DefenseMode')
  76.         send_command('bind !f9 gs c cycle WeaponskillMode')
  77.         send_command('bind ^- gs c toggle AutoRA')
  78.         send_command('bind ^[ input /lockstyle on')
  79. end
  80.  
  81.  
  82.  
  83. function job_setup()
  84.     determine_ranged()
  85.     state.Buff.Camouflage = buffactive.camouflage or false
  86.     state.Buff.Overkill = buffactive.overkill or false
  87.  
  88.    
  89. end
  90.  
  91. -- Called when this job file is unloaded (eg: job change)
  92. function file_unload()
  93.     binds_on_unload()
  94. end
  95.  
  96. function init_gear_sets()
  97.         gear.Gun = "Annihilator"
  98.         gear.Bow = "Yoichinoyumi"
  99.         gear.Stave = "Mekki Shakki"
  100.        
  101.         -- Auto RA + WS
  102.         state.AutoRA = false
  103.         -- Overriding Global Defaults for this job
  104.         gear.default.weaponskill_neck = "Ocachi Gorget"
  105.         gear.default.weaponskill_waist = "Elanid Belt"
  106.  
  107.         -- List of ammunition that should only be used under unlimited shot
  108.         U_Shot_Ammo = S{'Animikii Bullet'}
  109.        
  110.         -- Simply add a line of DefaultAmmo["Weapon"] = "Ammo Name"
  111.         DefaultAmmo = {}
  112.         DefaultAmmo[gear.Gun] = "Achiyalabopa Bullet"
  113.         DefaultAmmo[gear.Bow] = "Achiyalabopa Arrow"
  114.        
  115.         -- Options: Override default values
  116.         options.OffenseModes = {'Normal', 'Melee'}
  117.         options.RangedModes = {'Normal', 'Mod', 'Acc'}
  118.         options.DefenseModes = {'Normal', 'PDT'}
  119.         options.WeaponskillModes = {'Normal', 'Mod', 'Acc'}
  120.         options.PhysicalDefenseModes = {'PDT'}
  121.         options.MagicalDefenseModes = {'MDT'}
  122.         state.Defense.PhysicalMode = 'PDT'
  123.  
  124.         -- Misc. Job Ability precasts
  125.         sets.precast.JA['Bounty Shot'] = {hands="Sylvan Glovelettes +2"}
  126.         sets.precast.JA['Double Shot'] = {head="Sylvan Gapette +2"}
  127.         sets.precast.JA['Camouflage'] = {body="Orion Jerkin"}
  128.         sets.precast.JA['Sharpshot'] = {legs="Hunter's Braccae +1"}
  129.         sets.precast.JA['Velocity Shot'] = {body="Sylvan Caban +2"}
  130.         sets.precast.JA['Scavenge'] = {feet="Orion Socks"}
  131.  
  132.         sets.precast.JA['Eagle Eye Shot'] = {
  133.             head="Ux'uxkaj Cap",
  134.             neck="Rancor Collar",
  135.             ear1="Flame Pearl",
  136.             ear2="Flame Pearl",
  137.             body="Kyujutsugi",
  138.             hands="Orion Bracers +1",
  139.             ring1="Rajas Ring",
  140.             ring2="Pyrosoul Ring",
  141.             back="Buquwik Cape",
  142.             waist="Elanid Belt",
  143.             legs="Arcadian Braccae",
  144.             feet="Arcadian Socks +1"
  145.         }
  146.         sets.precast.JA['Eagle Eye Shot'].Mod = set_combine(sets.precast.JA['Eagle Eye Shot'], {
  147.             back="Lutian Cape",
  148.             ring2="Longshot Ring",
  149.             feet="Orion Socks +1"
  150.         })
  151.         sets.precast.JA['Eagle Eye Shot'].Acc = set_combine(sets.precast.JA['Eagle Eye Shot'].Mod, {
  152.             neck="Iqabi Necklace",
  153.             waist="Elanid Belt"
  154.         })
  155.  
  156.  
  157.         select_default_macro_book()
  158.  
  159.         sets.idle = {
  160.             head="Ocelomeh headpiece +1",
  161.             neck="Wiglen gorget",
  162.             ear1="Novia Earring",
  163.             ear2="Sanare Earring",
  164.             body="Kheper Jacket",
  165.             hands="Buremte Gloves",
  166.             ring1="Sheltered Ring",
  167.             ring2="Paguroidea Ring",
  168.             back="Iximulew cape",
  169.             waist="Chuq'aba Belt",
  170.             legs="Ighwa trousers",
  171.             feet="Skadi's jambeaux +1"
  172.         }
  173.  
  174.        
  175.  
  176.         -- Engaged sets
  177.         sets.engaged =  {
  178.             head="Whirlpool Mask",
  179.             neck="Rancor Collar",
  180.             ear1="Heartseeker Earring",
  181.             ear2="Steelflash Earring",
  182.             body="Kyujutsugi",
  183.             hands="Buremte gloves",
  184.             ring1="Rajas Ring",
  185.             ring2="Epona's Ring",
  186.             back="Letalis Mantle",
  187.             waist="Hurch'lan Sash",
  188.             legs="Manibozho Brais",
  189.             feet="Manibozho Boots"
  190.         }
  191.  
  192.         sets.engaged.Bow = sets.engaged
  193.  
  194.         sets.engaged.Melee = {
  195.             head="Whirlpool Mask",
  196.             neck="Rancor Collar",
  197.             ear1="Heartseeker Earring",
  198.             ear2="Steelflash Earring",
  199.             body="Manibozho jerkin",
  200.             hands="Buremte gloves",
  201.             ring1="Rajas Ring",
  202.             ring2="Epona's Ring",
  203.             back="Letalis Mantle",
  204.             waist="Hurch'lan Sash",
  205.             legs="Manibozho Brais",
  206.             feet="Manibozho Boots"
  207.         }
  208.        
  209.         -- Ranged Attack Sets
  210.  
  211.         -- Snapshot
  212.         sets.precast.RA = {
  213.             head="Sylvan Gapette +2",
  214.             neck="Ocachi Gorget",
  215.             ear1="Volley Earring",
  216.             ear2="Clearview Earring",
  217.             body="Sylvan Caban +2",
  218.             hands="Iuitl Wristbands",
  219.             ring1="Rajas Ring",
  220.             ring2="Pyrosoul Ring",
  221.             back="Lutian Cape",
  222.             waist="Impulse Belt",
  223.             legs="Nahtirah Trousers",
  224.             feet="Wurrukatte Boots"            
  225.         }
  226.  
  227.        
  228.         sets.midcast.RA = {
  229.             head="Arcadian Beret +1",
  230.             neck="Ocachi Gorget",
  231.             ear1="Volley Earring",
  232.             ear2="Clearview Earring",
  233.             body="Kyujutsugi",
  234.             hands="Sigyn's Bazubands", -- "Arcadian Bracers"
  235.             ring1="Rajas Ring",
  236.             ring2="Pyrosoul Ring",
  237.             back="Lutian Cape",
  238.             waist="Elanid Belt",
  239.             legs="Nahtirah Trousers",
  240.             feet="Orion Socks"
  241.         }
  242.        
  243.         -- Gun Mod
  244.         -- STP: 31 ~ 86.8 TP after 4 hits (3/4 recycle required)
  245.         -- Racc: 287.25
  246.         -- Ratk: 206.25
  247.         -- AGI: 151
  248.         -- STR: 91
  249.         sets.midcast.RA.Mod = set_combine(sets.midcast.RA, {
  250.             hands="Seiryu's Kote",
  251.             ring2="Longshot Ring",
  252.             back="Lutian Cape"
  253.         })
  254.  
  255.         -- Gun Acc
  256.         -- STP: 21 ~ 80 TP after 4 hits (4/4 recycle required)
  257.         -- Racc: 316.25
  258.         -- Ratk: 177.75
  259.         -- AGI: 151
  260.         -- STR: 86
  261.         sets.midcast.RA.Acc = set_combine(sets.midcast.RA.Mod, {
  262.             neck="Iqabi Necklace",
  263.             ring1="Hajduk Ring"
  264.         })
  265.  
  266.         -- sam subjob
  267.         --sets.midcast.RA.SAM = sets.midcast.RA
  268.         --sets.midcast.RA.SAM.Mod = sets.midcast.RA.Mod
  269.         --sets.midcast.RA.SAM.Acc = sets.midcast.RA.Acc
  270.  
  271.  
  272.         -- Stave + Strap set for Gun
  273.         -- STP: 38 ~ 91.6 TP after 4 hits (2/4 recycle required)
  274.         -- Racc: 242
  275.         -- Ratk: 262.75
  276.         -- AGI: 136
  277.         -- STR: 109
  278.         sets.midcast.RA.Gun2H = set_combine(sets.midcast.RA, {
  279.             --main="Mekki Shakki",
  280.             --sub="Bloodrain Strap",
  281.             legs="Nahtirah Trousers",
  282.             back="Lutian Cape",
  283.         })
  284.  
  285.         -- STP: 38 ~ 91.6 TP after 4 hits (2/4 recycle required)
  286.         -- Racc: 269
  287.         -- Ratk: 229
  288.         -- AGI: 134
  289.         -- STR: 104
  290.         sets.midcast.RA.Mod.Gun2H = set_combine(sets.midcast.RA.Gun2H, {
  291.             legs="Aetosaur Trousers +1",
  292.             ring2="Longshot Ring"
  293.         })
  294.  
  295.         -- STP: 32 ~ 87.6 TP after 4 hits (3/4 recycle required)
  296.         -- Racc: 295.25
  297.         -- Ratk: 176.5
  298.         -- AGI: 141
  299.         -- STR: 91
  300.         sets.midcast.RA.Acc.Gun2H = set_combine(sets.midcast.RA.Mod.Gun2H, {
  301.             hands="Seiryu's Kote",
  302.             neck="Iqabi Necklace",
  303.             ring1="Hajduk Ring"
  304.         })
  305.        
  306.         -- This is a 3-hit build with 3 out of 3 recycle procs and /sam sub.
  307.         -- It's used automatically by having /sam and gear.Stave equipped. (sacrifices should be obvious)
  308.         -- STP: 57
  309.         -- Racc: 200.5
  310.         -- Ratk: 201.5
  311.         -- AGI: 110
  312.         -- STR: 81
  313.         --sets.midcast.RA.SAM.Gun2H = {
  314.         -- head="Arcadian Beret +1",
  315.         -- neck="Ocachi Gorget",
  316.         -- ear1="Volley Earring",
  317.         -- ear2="Tripudio Earring",
  318.         -- body="Kyujutsugi",
  319.         -- hands="Sigyn's Bazubands",
  320.         -- ring1="Rajas Ring",
  321.         -- ring2="K'ayres Ring",
  322.         -- back="Sylvan Chlamys",
  323.         -- waist="Patentia Sash",
  324.         -- legs="Sylvan Bragues +2",
  325.         -- feet="Orion Socks +1"
  326.         --}
  327.         --sets.midcast.RA.SAM.Mod.Gun2H = set_combine(sets.midcast.RA.SAM.Gun2H, {
  328.         -- waist="Elanid Belt",
  329.         -- legs="Aetosaur Trousers +1"
  330.         --})
  331.         --sets.midcast.RA.SAM.Acc.Gun2H = set_combine(sets.midcast.RA.SAM.Mod.Gun2H, {
  332.         -- ring1="Longshot Ring",
  333.         -- ring2="Paqichikaji Ring",
  334.         -- back="Lutian Cape"
  335.         --})
  336.  
  337.        
  338.         -- Bow
  339.         -- This set is only used while Decoy Shot is OFF
  340.         -- -Enmity is the goal, while keeping STP in slots with little sacrifice to -enmity.
  341.         sets.midcast.RA.Bow = {
  342.             head="Arcadian Beret +1",
  343.             neck="Ocachi Gorget",
  344.             ear1="Volley Earring",
  345.             ear2="Novia Earring",
  346.             body="Kyujutsugi",
  347.             hands="Sylvan Glovelettes +2",
  348.             ring1="Rajas Ring",
  349.             ring2="Paqichikaji Ring",
  350.             back="Sylvan Chlamys",
  351.             waist="Elanid Belt",
  352.             legs="Nahtirah Trousers",
  353.             feet="Arcadian Socks +1"
  354.         }
  355.         -- Mod toggle for Bow. This set ignores the decoy shot feature, and gears for damage.
  356.         -- All around good set for events, but not when you care a lot about -enmity
  357.         sets.midcast.RA.Mod.Bow = set_combine(sets.midcast.RA.Bow, {
  358.             ear2="Clearview Earring",
  359.             ring2="Pyrosoul Ring",
  360.             waist="Elanid Belt"
  361.         })
  362.         -- High accuracy set
  363.         sets.midcast.RA.Acc.Bow = set_combine(sets.midcast.RA.Bow, {
  364.             ear2="Clearview Earring",
  365.             waist="Elanid Belt",
  366.             legs="Arcadian Braccae",
  367.             feet="Orion Socks"
  368.         })
  369.         -- 1 handed weapon set for Bow. (Hurlbat, etc.)
  370.         sets.midcast.RA.Bow1H = set_combine(sets.midcast.RA.Bow, {
  371.             ear2="Clearview Earring",
  372.             ring2="Paqichikaji Ring",
  373.             hands="Skadi's bazubands",
  374.             back="Lutian Cape"
  375.         })
  376.        
  377.         -- Mod toggle for 1-handed wpn. with Bow. Full DD set.
  378.         sets.midcast.RA.Mod.Bow1H = set_combine(sets.midcast.RA.Bow1H, {
  379.             ear2="Clearview Earring",
  380.             hands="Sylvan Glovelettes +2",
  381.             ring2="Pyrosoul Ring",
  382.             legs="Nahtirah Trousers"
  383.         })
  384.         sets.midcast.RA.Acc.Bow1H = sets.midcast.RA.Acc.Bow
  385.  
  386.         -- This set will activate when using Bow, and Decoy Shot is ON
  387.         sets.midcast.RA.Decoy = set_combine(sets.midcast.RA.Bow, {
  388.             ear2="Clearview Earring",
  389.             ring2="Pyrosoul Ring",
  390.             waist="Elanid Belt"
  391.         })
  392.         -- 1-handed weapon set used when decoy shot is ON
  393.         sets.midcast.RA.Decoy1H = set_combine(sets.midcast.RA.Decoy, {
  394.             back="Lutian Cape",
  395.             hands="Skadi's bazubands"
  396.         })
  397.         -- High Accuracy set
  398.         sets.midcast.RA.Acc.Decoy = set_combine(sets.midcast.RA.Decoy, {
  399.             ring2="Paqichikaji Ring",
  400.             feet="Orion Socks"
  401.         })
  402.         sets.midcast.RA.Acc.Decoy1H = sets.midcast.RA.Acc.Decoy
  403.  
  404.         -- Weaponskill sets  
  405.         sets.Coronach = {}
  406.         sets.Detonator = {}
  407.         sets.LastStand = {}
  408.         sets.Namas = {}
  409.         sets.Jishnus = {}
  410.         sets.Sidewinder = {}
  411.         sets.Wildfire = {}
  412.  
  413.         sets.precast.WS = {}
  414.         sets.precast.WS = {
  415.             head="Ux'uxkaj Cap",
  416.             neck="Ocachi Gorget",
  417.             ear1="Flame Pearl",
  418.             ear2="Flame Pearl",
  419.             body="Kyujutsugi",
  420.             hands="Orion Bracers +1", -- Arcadian
  421.             ring1="Rajas Ring",
  422.             ring2="Pyrosoul Ring",
  423.             back="Buquwik Cape",
  424.             waist="Elanid Belt",
  425.             legs="Nahtirah Trousers",
  426.             feet="Arcadian Socks +1" -- Orion
  427.         }
  428.         sets.precast.WS.Mod = set_combine(sets.precast.WS, {
  429.             back="Lutian Cape",
  430.             legs="Arcadian braccae"
  431.         })
  432.         sets.precast.WS.Acc = set_combine(sets.precast.WS, {
  433.            ear2="Volley Earring",
  434.            legs="Aetosaur Trousers +1",
  435.            hands="Sigyn's Bazubands",
  436.            back="Lutian Cape"
  437.         })
  438.  
  439.         -- WILDFIRE
  440.         sets.Wildfire = {
  441.             head="Seiokona Beret",
  442.             body="Orion Jerkin +1",
  443.             ear1="Crematio Earring",
  444.             ear2="Friomisi Earring",
  445.             neck="Stoicheion Medal",
  446.             waist="Aquiline Belt",
  447.             legs="Shneddick Tights",
  448.             back="Toro Cape",
  449.             feet="Arcadian Socks +1"
  450.         }
  451.         sets.precast.WS['Wildfire'] = set_combine(sets.precast.WS, sets.Wildfire)
  452.         sets.precast.WS['Wildfire'].Mod = set_combine(sets.precast.WS.Mod, sets.Wildfire)
  453.         sets.precast.WS['Wildfire'].Acc = set_combine(sets.precast.WS.Acc, sets.Wildfire)
  454.  
  455.         -- CORONACH
  456.         sets.Coronach = {
  457.            neck="Breeze Gorget",
  458.            waist="Thunder Belt"
  459.         }
  460.         sets.precast.WS['Coronach'] = set_combine(sets.precast.WS, sets.Coronach)
  461.         sets.precast.WS['Coronach'].Mod = set_combine(sets.precast.WS.Mod, sets.Coronach)
  462.         sets.precast.WS['Coronach'].Acc = set_combine(sets.precast.WS.Acc, sets.Coronach)
  463.  
  464.         -- LAST STAND
  465.         sets.LastStand = {
  466.            neck="Aqua Gorget",
  467.            ring2="Stormsoul Ring",
  468.            waist="Light Belt",
  469.            feet="Arcadian Socks +1"
  470.         }
  471.         sets.precast.WS['Last Stand'] = set_combine(sets.precast.WS, sets.LastStand)
  472.         sets.precast.WS['Last Stand'].Mod = set_combine(sets.precast.WS.Mod, sets.LastStand)
  473.         sets.precast.WS['Last Stand'].Acc = set_combine(sets.precast.WS.Acc, sets.LastStand)
  474.        
  475.         -- DETONATOR
  476.         sets.Detonator = {
  477.            neck="Flame Gorget",
  478.            waist="Light Belt",
  479.            feet="Arcadian Socks +1"
  480.         }
  481.         sets.precast.WS['Detonator'] = set_combine(sets.precast.WS, sets.Detonator)
  482.         sets.precast.WS['Detonator'].Mod = set_combine(sets.precast.WS.Mod, sets.Detonator)
  483.         sets.precast.WS['Detonator'].Acc = set_combine(sets.precast.WS.Acc, sets.Detonator)
  484.  
  485.         -- NAMAS
  486.         sets.Namas = {
  487.             neck="Light Gorget",
  488.             waist="Light Belt",
  489.             back="Sylvan Chlamys",
  490.             feet="Arcadian Socks +1"
  491.         }
  492.         sets.precast.WS['Namas Arrow'] = set_combine(sets.precast.WS, sets.Namas)
  493.         sets.precast.WS['Namas Arrow'].Mod = set_combine(sets.precast.WS.Mod, sets.Namas)
  494.         sets.precast.WS['Namas Arrow'].Acc = set_combine(sets.precast.WS.Acc, sets.Namas)
  495.         sets.precast.WS['Namas Arrow'].STP = set_combine(sets.precast.WS['Namas Arrow'], {head="Arcadian Beret +1"})
  496.  
  497.         -- JISHNUS
  498.         sets.Jishnus = {
  499.             neck="Light Gorget",
  500.             ear2="Novia Earring",
  501.             waist="Light Belt",
  502.             feet="Arcadian Socks +1",
  503.             ring2="Thundersoul Ring",
  504.             back="Rancorous Mantle"
  505.         }
  506.         sets.precast.WS['Jishnu\'s Radiance'] = set_combine(sets.precast.WS, sets.Jishnus)
  507.         sets.precast.WS['Jishnu\'s Radiance'].Mod = set_combine(sets.precast.WS.Mod, sets.Jishnus)
  508.         sets.precast.WS['Jishnu\'s Radiance'].Acc = set_combine(sets.precast.WS.Acc, sets.Jishnus)
  509.  
  510.         -- SIDEWINDER
  511.         sets.Sidewinder = {
  512.             neck="Light Gorget",
  513.             waist="Light Belt",
  514.             back="Buquwik Cape",
  515.             feet="Arcadian Socks +1"
  516.         }
  517.         sets.precast.WS['Sidewinder'] = set_combine(sets.precast.WS, sets.Sidewinder)
  518.         sets.precast.WS['Sidewinder'].Mod = set_combine(sets.precast.WS.Mod, sets.Sidewinder)
  519.         sets.precast.WS['Sidewinder'].Acc = set_combine(sets.precast.WS.Acc, sets.Sidewinder)
  520.  
  521.         sets.precast.WS['Refulgent Arrow'] = sets.precast.WS['Sidewinder']
  522.         sets.precast.WS['Refulgent Arrow'].Mod = sets.precast.WS['Sidewinder'].Mod
  523.         sets.precast.WS['Refulgent Arrow'].Acc = sets.precast.WS['Sidewinder'].Acc
  524.        
  525.         -- Resting sets
  526.         sets.resting = {}
  527.        
  528.         -- Defense sets
  529.         sets.defense.PDT = {
  530.         head="Whirlpool Mask",neck="Twilight Torque",
  531.         body="Manibozho Jerkin",hands="Iuitl Wristbands",ring1="Dark Ring",ring2="Dark ring",
  532.         back="Shadow Mantle",waist="Phasmida Belt",legs="Ighwa Trousers",feet="Iuitl Gaiters"}
  533.        
  534.         sets.defense.MDT = {
  535.         head="Whirlpool Mask",neck="Twilight Torque",
  536.         body="Manibozho Jerkin",hands="Iuitl Wristbands",ring1="Shadow Ring",right_ring={ name="Dark Ring", augments={'Phys. dmg. taken -3%','Magic dmg. taken -5%',}},
  537.         back="Engulfer Cape",waist="Phasmida Belt",legs="Ighwa Trousers",feet="Iuitl Gaiters"}
  538.         --sets.Kiting = {feet="Skadi jam +1"}
  539.        
  540.         -- Barrage Set
  541.         sets.BarrageMid = {
  542.             head="Uk'uxkaj Cap",
  543.             neck="Rancor Collar",
  544.             ear1="Volley Earring",
  545.             ear2="Clearview Earring",
  546.             body="Kyujutsugi",
  547.             hands="Orion Bracers +1",
  548.             ring1="Paqichikaji Ring",
  549.             ring2="Arewe Ring +1",
  550.             back="Lutian Cape",
  551.             waist="Elanid Belt",
  552.             legs="Arcadian Braccae",
  553.             feet="Orion Socks"
  554.         }
  555.  
  556.         sets.buff.Camouflage =  {body="Orion Jerkin"}
  557.  
  558.         sets.Overkill =  {
  559.             head="Arcadian Beret +1",
  560.             neck="Ocachi Gorget",
  561.             ear1="Volley Earring",
  562.             ear2="Tripudio Earring",
  563.             body="Arcadian Jerkin",
  564.             hands="Buremte gloves", -- "Arcadian Bracers +1"
  565.             ring1="Rajas Ring",
  566.             ring2="Paqichikaji Ring",
  567.             back="Lutian Cape",
  568.             waist="Elanid Belt",
  569.             feet="Arcadian Socks +1"
  570.         }
  571.        
  572.         sets.Overkill.Preshot = set_combine(sets.precast.RA, {
  573.             -- head="Orion Beret +1",
  574.             feet="Arcadian Socks +1"
  575.         })
  576. end
  577.  
  578.  
  579. function job_pretarget(spell, action, spellMap, eventArgs)
  580.     if spell.action_type == 'Ranged Attack' then -- Auto WS/Decoy Shot/Double Shot --
  581.         if player.tp >= 100 and state.AutoRA and not buffactive.amnesia then
  582.             cancel_spell()
  583.             use_weaponskill()
  584.         end
  585.     end
  586. end
  587. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  588. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  589.  
  590. function job_precast(spell, action, spellMap, eventArgs)
  591.         if spell.type:lower() == 'weaponskill' then
  592.             --if player.status ~= "Engaged" or player.tp < 100 then
  593.             if player.tp < 100 then
  594.                     eventArgs.cancel = true
  595.                     return
  596.             end
  597.             if ((spell.target.distance >8 and spell.skill ~= 'Archery' and spell.skill ~= 'Marksmanship') or (spell.target.distance >21)) then
  598.                 -- Cancel Action if distance is too great, saving TP
  599.                 add_to_chat(122,"Outside Ranged WS Range! /Canceling")
  600.                 eventArgs.cancel = true
  601.                 return
  602.  
  603.             elseif state.Defense.Active then
  604.                 -- Don't gearswap for weaponskills when Defense is on.
  605.                 eventArgs.handled = true
  606.             end
  607.         end
  608.         -- add support for RangedMode toggles to EES
  609.         if spell.english == 'Eagle Eye Shot' then
  610.             classes.JAMode = state.RangedMode
  611.         end
  612.        
  613.         if spell.type == 'Waltz' then
  614.                 refine_waltz(spell, action, spellMap, eventArgs)
  615.         end
  616.        
  617.         if spell.name == "Ranged" or spell.type:lower() == 'weaponskill' then
  618.                 -- If ammo is empty, or special ammo being used without buff, replace with default ammo
  619.                 if U_Shot_Ammo[player.equipment.ammo] and not buffactive['unlimited shot'] or player.equipment.ammo == 'empty' then
  620.                         if DefaultAmmo[player.equipment.range] and player.inventory[DefaultAmmo[player.equipment.range]] then
  621.                                 add_to_chat(122,"Unlimited Shot not Active or Ammo Empty, Using Default Ammo")
  622.                                 equip({ammo=DefaultAmmo[player.equipment.range]})
  623.                         else
  624.                                 add_to_chat(122,"Either Default Ammo is Unavailable or Unknown Weapon. Staying empty")
  625.                                 equip({ammo=empty})
  626.                         end
  627.                 end
  628.                 if not buffactive['unlimited shot'] then
  629.                         -- If not empty, and if unlimited shot is not active
  630.                         -- Not doing it for unlimited shot to avoid excessive log
  631.                         if player.equipment.ammo ~= 'empty' then
  632.                                 if player.inventory[player.equipment.ammo].count < 15 then
  633.                                         add_to_chat(122,"Ammo '"..player.inventory[player.equipment.ammo].shortname.."' running low ("..player.inventory[player.equipment.ammo].count..")")
  634.                                 end
  635.                         end
  636.                 end
  637.         end
  638. end
  639.  
  640. -- Run after the default precast() is done.
  641. -- eventArgs is the same one used in job_precast, in case information needs to be persisted.
  642. -- This is where you place gear swaps you want in precast but applied on top of the precast sets
  643. function job_post_precast(spell, action, spellMap, eventArgs)
  644.     if state.Buff.Camouflage then
  645.         equip(sets.buff.Camouflage)
  646.     elseif state.Buff.Overkill then
  647.         equip(sets.Overkill.Preshot)
  648.     end
  649.    
  650. end
  651.  
  652. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  653. function job_midcast(spell, action, spellMap, eventArgs)
  654.     -- add support for SAM set
  655.     --if spell.action_type == 'Ranged Attack' then
  656. -- if player.sub_job == 'SAM' then
  657.     -- add_to_chat(122, 'SAM SUB')
  658.     -- classes.CustomClass = 'SAM'
  659.     -- end
  660.     --end
  661.     if spell.name == 'Spectral Jig' and buffactive.sneak then
  662.         -- If sneak is active when using, cancel before completion
  663.         send_command('cancel 71')
  664.     end
  665. end
  666.  
  667.  
  668. -- Run after the default midcast() is done.
  669. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  670. function job_post_midcast(spell, action, spellMap, eventArgs)
  671.     if buffactive.barrage then
  672.         equip(sets.BarrageMid)
  673.     end
  674.     if state.Buff.Camouflage then
  675.         equip(sets.buff.Camouflage)
  676.     end
  677.     if state.Buff.Overkill then
  678.         equip(sets.Overkill)
  679.     end
  680. end
  681.  
  682. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  683. function job_aftercast(spell, action, spellMap, eventArgs)
  684.     if spell.action_type == 'Ranged Attack' and state.AutoRA then
  685.         use_ra()
  686.     end
  687.     if not spell.interrupted then
  688.         if state.Buff[spell.name] ~= nil then
  689.             state.Buff[spell.name] = true
  690.         end
  691.  
  692.         if state.Buff['Camouflage'] then
  693.             send_command('@wait .5;gs disable body')
  694.         else
  695.             enable('body')
  696.         end
  697.     end
  698. end
  699.  
  700. -- Run after the default aftercast() is done.
  701. -- eventArgs is the same one used in job_aftercast, in case information needs to be persisted.
  702. function job_post_aftercast(spell, action, spellMap, eventArgs)
  703.  
  704. end
  705.  
  706. -- Called before the Include starts constructing melee/idle/resting sets.
  707. -- Can customize state or custom melee class values at this point.
  708. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  709.  
  710.  
  711. function customize_idle_set(idleSet)
  712. if state.Buff.Camouflage then
  713. idleSet = set_combine(idleSet, sets.buff.Camouflage)
  714. end
  715.     return idleSet
  716. end
  717.  
  718. function customize_melee_set(meleeSet)
  719.     if state.Buff.Camouflage then
  720.      meleeSet = set_combine(meleeSet, sets.buff.Camouflage)
  721.     end
  722.     if state.Buff.Overkill then
  723.      meleeSet = set_combine(meleeSet, sets.Overkill)
  724.     end
  725.     return meleeSet
  726. end
  727.  
  728. function job_status_change(newStatus, oldStatus, eventArgs)
  729.     if camo_active() then
  730.         send_command('@wait .5;gs disable body')
  731.     else
  732.         enable('body')
  733.     end
  734. determine_ranged()
  735. end
  736.  
  737. -- Called when a player gains or loses a buff.
  738. -- buff == buff gained or lost
  739. -- gain == true if the buff was gained, false if it was lost.
  740. function job_buff_change(buff, gain)
  741.     --if S{"courser's roll"}:contains(buff:lower()) then
  742.     --if string.find(buff:lower(), 'samba') then
  743.  
  744.     if state.Buff[buff] ~= nil then
  745.         state.Buff[buff] = gain
  746. determine_ranged()
  747.         handle_equipping_gear(player.status)
  748.     end
  749.  
  750. end
  751.  
  752. -------------------------------------------------------------------------------------------------------------------
  753. -- User code that supplements self-commands.
  754. -------------------------------------------------------------------------------------------------------------------
  755.  
  756. -- Called for custom player commands.
  757. function job_self_command(cmdParams, eventArgs)
  758. end
  759.  
  760. -- Called by the 'update' self-command, for common needs.
  761. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  762. function job_update(cmdParams, eventArgs)
  763.     determine_ranged()
  764.     -- called here incase buff_change failed to update value
  765.     state.Buff.Camouflage = buffactive.camouflage or false
  766.     state.Buff.Overkill = buffactive.overkill or false
  767.     state.Buff['Decoy Shot'] = buffactive['Decoy Shot'] or false
  768.  
  769.     if camo_active() then
  770.         send_command('@wait .5;gs disable body')
  771.     else
  772.         enable('body')
  773.     end
  774. end
  775.  
  776. -- Return a customized weaponskill mode to use for weaponskill sets.
  777. -- Don't return anything if you're not overriding the default value.
  778. --function get_custom_wsmode(spell, action, default_wsmode)
  779. -- if state.RangedMode ~= 'Normal' and S(options.WeaponskillModes):contains(state.RangedMode) then
  780. -- return state.RangedMode
  781. -- end
  782. --end
  783.  
  784. -- Job-specific toggles.
  785. function job_toggle(field)
  786.     if field:lower() == 'autora' then
  787.         state.AutoRA = not state.AutoRA
  788.         --return "Use Auto RA", state.AutoRA
  789.         return state.AutoRA
  790.     end
  791. end
  792.  
  793. -- Request job-specific mode lists.
  794. -- Return the list, and the current value for the requested field.
  795. function job_get_option_modes(field)
  796.     if field:lower() == 'autora' then
  797.         return state.AutoRA
  798.     end
  799. end
  800.  
  801. -- Set job-specific mode values.
  802. -- Return true if we recognize and set the requested field.
  803. function job_set_option_mode(field, val)
  804.     if field:lower() == 'autora' then
  805.         state.AutoRA = val
  806.         return true
  807.     end
  808. end
  809.  
  810. -- Handle auto-targetting based on local setup.
  811. function job_auto_change_target(spell, action, spellMap, eventArgs)
  812.  
  813. end
  814.  
  815. -- Handle notifications of user state values being changed.
  816. function job_state_change(stateField, newValue, oldValue)
  817.  
  818. end
  819.  
  820. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  821. function display_current_job_state(eventArgs)
  822.     local msg = ''
  823.     if state.AutoRA then
  824.         msg = '[Auto RA: ON]'
  825.     else
  826.         msg = '[Auto RA: OFF]'
  827.     end
  828.  
  829.     add_to_chat(122, 'Ranged: '..state.RangedMode..'/'..state.DefenseMode..', WS: '..state.WeaponskillMode..', '..msg)
  830.    
  831.     eventArgs.handled = true
  832.  
  833. end
  834.  
  835. function determine_ranged()
  836.     -- cleanup everything each time function is called
  837. classes.CustomRangedGroups:clear()
  838. classes.CustomMeleeGroups:clear()
  839.  
  840.     if player.equipment.range == gear.Bow then
  841.         -- if decoy is up
  842.         if buffactive['Decoy Shot'] then
  843.             -- default decoy set assumes staff is used.
  844.             if player.equipment.main == gear.Stave then
  845.                 classes.CustomMeleeGroups:append('Decoy')
  846. classes.CustomRangedGroups:append('Decoy')
  847.             else -- append the 1 handed weapon class
  848.                 classes.CustomMeleeGroups:append('Decoy1H')
  849. classes.CustomRangedGroups:append('Decoy1H')
  850.             end
  851.         else
  852.             if player.equipment.main == gear.Stave then
  853.                 classes.CustomMeleeGroups:append('Bow')
  854. classes.CustomRangedGroups:append('Bow')
  855.             else -- one handed weapon setup
  856.                 classes.CustomMeleeGroups:append('Bow1H')
  857. classes.CustomRangedGroups:append('Bow1H')
  858.             end
  859.         end
  860.  
  861.     elseif player.equipment.range == gear.Gun then
  862.  
  863.         if player.equipment.main == gear.Stave then
  864. classes.CustomRangedGroups:append('Gun2H')
  865.             classes.CustomMeleeGroups:append('Gun2H')
  866.         else -- The default sets.midcast.RangedAttack applies
  867. classes.CustomRangedGroups:clear()
  868. classes.CustomMeleeGroups:clear()
  869.         end
  870.  
  871.     end
  872. end
  873.  
  874. function use_weaponskill()
  875.     if player.equipment.range == gear.Bow then
  876.         send_command('input /ws "Namas Arrow" <t>')
  877.     elseif player.equipment.range == gear.Gun then
  878.         send_command('input /ws "Coronach" <t>')
  879.     end
  880. end
  881.  
  882. function use_ra()
  883.     send_command('@wait 2.7; input /ra <t>')
  884. end
  885.  
  886. function camo_active()
  887.     return state.Buff['Camouflage']
  888. end
  889. -------------------------------------------------------------------------------------------------------------------
  890. -- Utility functions specific to this job.
  891. -------------------------------------------------------------------------------------------------------------------
  892.  
  893. -- Select default macro book on initial load or subjob change.
  894. function select_default_macro_book()
  895.     -- Default macro set/book
  896.     if player.sub_job == 'WAR'then
  897.             set_macro_page(1, 2)
  898.     elseif player.sub_job == 'SAM' then
  899.             set_macro_page(2, 2)
  900.     else
  901.         set_macro_page(1, 2)
  902.     end
  903. end
Add Comment
Please, Sign In to add comment