Guest User

Untitled

a guest
Jan 11th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.86 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Initialization function that defines sets and variables to be used.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. -- Last Modified: 1/11/2014
  6.  
  7. -- IMPORTANT: Make sure to also get the Mote-Include.lua file to go with this.
  8.  
  9. function get_sets()
  10.     -- Load and initialize the include file that this depends on.
  11.     include('Mote-Include.lua')
  12.     init_include()
  13.    
  14.     -- Options: Override default values
  15.     options.OffenseModes = {'Normal', 'Acc', 'Ammo', "AmmoAcc", "TP"}
  16.     options.DefenseModes = {'Normal', 'PDT'}
  17.     options.WeaponskillModes = {'Normal', 'Acc', 'Ammo', "AmmoAcc"}
  18.     options.CastingModes = {'Normal'}
  19.     options.IdleModes = {'Normal'}
  20.     options.RestingModes = {'Normal'}
  21.     options.PhysicalDefenseModes = {'PDT'}
  22.     options.MagicalDefenseModes = {'MDT'}
  23.  
  24.     state.Defense.PhysicalMode = 'PDT'
  25.  
  26.     --------------------------------------
  27.     -- Start defining the sets
  28.     --------------------------------------
  29.    
  30.     U_Shot_Ammo = S{'Aeolus Arrow','Animikii Bullet','Crossbow Bolt'}
  31.     DefaultGun = "Eminent Gun"
  32.     DefaultBow = "Eminent Bow"
  33.     DefaultXBow = "Eminent Crossbow"
  34.     DefaultGunAmmo = {ammo="Titanium Bullet"}
  35.     DefaultBowAmmo = {ammo="Tulfaire Arrow"}
  36.     DefaultXBowAmmo = {ammo="Dark Adaman Bolt"}
  37.     DefaultAmmo = DefaultBowAmmo
  38.    
  39.     -- Weaponskill sets to be used later in functions
  40.     ranged_ws = S{"Flaming Arrow", "Piercing Arrow", "Dulling Arrow", "Sidewinder", "Arching Arrow",
  41.     "Empyreal Arrow", "Refulgent Arrow", "Apex Arrow", "Namas Arrow", "Jishnu's Radiance", "Hot Shot",
  42.     "Split Shot", "Sniper Shot", "Slug Shot", "Heavy Shot", "Detonator", "Last Stand", "Trueflight","Wildfire"}
  43.    
  44.     SoilBeltWS = S{"Numbing Shot", "Wildfire"}
  45.     LightBeltWS = S{"Flaming Arrow", "Piercing Arrow", "Dulling Arrow", "Sidewinder", "Blast Arrow", "Arching Arrow",
  46.     "Empyreal Arrow", "Refulgent Arrow", "Apex Arrow", "Namas Arrow", "Jishnu's Radiance", "Hot Shot",
  47.     "Split Shot", "Sniper Shot", "Slug Shot", "Blast Shot", "Heavy Shot", "Detonator", "Last Stand", "Trueflight"}
  48.     LightNeckWS = S{"Flaming Arrow", "Piercing Arrow", "Dulling Arrow", "Sidewinder", "Blast Arrow", "Arching Arrow",
  49.     "Empyreal Arrow", "Refulgent Arrow", "Apex Arrow", "Namas Arrow", "Jishnu's Radiance", "Hot Shot",
  50.     "Split Shot", "Sniper Shot", "Slug Shot", "Blast Shot", "Heavy Shot", "Detonator", "Last Stand", "Trueflight"}
  51.  
  52.     -- Precast Sets
  53.    
  54.     sets.RangedAttack = {neck="Ocachi Gorget",ring1="K'ayres Ring",ring2="Rajas Ring",back="Libeccio Mantle",
  55.         ear1="Volley Earring",ear2="Moonshade Earring",waist="Scout's Belt"}
  56.    
  57.     sets.RangedAttack.Acc = set_combine(sets.RangedAttack, {neck="Ej Necklace",ring1="Paqichikaji Ring"})
  58.    
  59.     sets.RangedAttack.Ammo = set_combine(sets.RangedAttack, {head="Scout's Beret +2"})
  60.     sets.RangedAttack.AmmoAcc = set_combine(sets.RangedAttack.Acc, {head="Scout's Beret +2"})
  61.    
  62.     sets.RangedAttack.TP = set_combine(sets.RangedAttack, {back="Sylvan Chlamys", ear2="Bladeborn Earring"})
  63.    
  64.     sets.precast.Step = {ear2="Choreia Earring"}
  65.     sets.precast.JA['Bounty Shot'] = {hands="Sylvan Glovelettes +2"}
  66.     sets.precast.JA['Scavenge'] = {feet="Orion Socks"}
  67.    
  68.     -- Weaponskill sets
  69.     -- Default set for any weaponskill that isn't any more specifically defined
  70.    
  71.     sets.precast.WS = set_combine(sets.RangedAttack, {
  72.         neck="Ocachi Gorget",ear1="Clearview Earring",
  73.         ring1="K'ayres Ring",ring2="Rajas Ring",
  74.         back="Sylvan Chlamys"})
  75.        
  76.     sets.precast.WS.Acc = set_combine(sets.precast.WS, {neck="Ej Necklace",back="Libeccio Mantle"})
  77.    
  78.     sets.precast.WS.Ammo = set_combine(sets.precast.WS, {head="Scout's Beret +2"})
  79.     sets.precast.WS.AmmoAcc = set_combine(sets.precast.WS.Acc, {head="Scout's Beret +2"})
  80.     -- Resting sets
  81.     sets.resting = {}
  82.    
  83.     -- Idle sets
  84.     sets.idle = {
  85.         head="Orion Beret",neck="Twilight Torque",ear1="Volley Earring",ear2="Moonshade Earring",
  86.         body="Orion Jerkin +1",hands="Buremte Gloves",ring1="Dark Ring",ring2="Dark Ring",
  87.         back="Shadow Mantle",waist="Scout's Belt",legs="Nahtirah Trousers",feet="Orion Socks"}
  88.  
  89.     -- Defense sets
  90.     sets.defense.PDT = set_combine(sets.idle, {})
  91.  
  92.     sets.defense.MDT = set_combine(sets.idle, {})
  93.  
  94.     sets.Kiting = {}
  95.  
  96.     -- Engaged sets
  97.    
  98.     sets.engaged = set_combine(sets.idle, {neck="Asperity Necklace",ear1="Steelflash Earring",ear2="Bladeborn Earring",
  99.         ring1="K'ayres Ring",ring2="Rajas Ring",
  100.         back="Sylvan Chlamys",waist="Hurch'lan Sash"})
  101.     sets.engaged.Acc = set_combine(sets.engaged, {})
  102.     sets.engaged.Ammo = set_combine(sets.engaged, {})
  103.    
  104.     -- initialize sets Macro to Book 20, Page 1
  105.     windower.send_command('input /macro book 20;wait .1;input /macro set 1')
  106.     gearswap_binds_on_load()
  107.  
  108.     -- binds Ctrl+- and Ctrl+= to targeting modes
  109.     windower.send_command('bind ^- gs c toggle target')
  110.     windower.send_command('bind ^= gs c cycle targetmode')
  111. end
  112.  
  113. -- Called when this job file is unloaded (eg: job change)
  114. function file_unload()
  115.     --spellcast_binds_on_unload()
  116. end
  117.  
  118. -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
  119. function job_pretarget(spell, action, spellMap, eventArgs)
  120.  
  121. end
  122.  
  123. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  124. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  125. function job_precast(spell, action, spellMap, eventArgs)
  126.     if spell.type:lower() == 'weaponskill' then
  127.         if (spell.target.distance >8 and not ranged_ws[spell.name]) or (spell.target.distance >21) then
  128.             add_to_chat(122,"Distance too great for WeaponSkill /Canceling")
  129.             eventArgs.cancel = true
  130.             return
  131.         elseif state.Defense.Active then
  132.             -- Don't gearswap for weaponskills when Defense is on.
  133.             eventArgs.handled = true
  134.         end
  135.     end
  136.    
  137.     if player.equipment.range == DefaultGun then
  138.         DefaultAmmo = DefaultGunAmmo
  139.     elseif player.equipment.range == DefaultBow then
  140.         DefaultAmmo = DefaultBowAmmo
  141.     elseif player.equipment.range == DefaultXBow then
  142.         DefaultAmmo = DefaultXBowAmmo
  143.     end
  144.    
  145.     if U_Shot_Ammo[player.equipment.ammo] and not buffactive['unlimited shot'] or player.equipment.ammo == 'empty' then
  146.         -- to avoid the ammo being left in, if the default ammo is not present in inventory
  147.         add_to_chat(122,"Unlimited Shot not Active or Ammo Empty, Using Default Ammo")
  148.         equip(DefaultAmmo)
  149.     end
  150. end
  151.  
  152. -- Run after the default precast() is done.
  153. -- eventArgs is the same one used in job_precast, in case information needs to be persisted.
  154. -- This is where you place gear swaps you want in precast but applied on top of the default armor
  155. function job_post_precast(spell, action, spellMap, eventArgs)
  156.     -- Normal Ranged Attack
  157.     if spell.name == 'Ranged' then
  158.         if state.OffenseMode == 'Acc' then
  159.             equip(sets.RangedAttack.Acc)
  160.         elseif state.OffenseMode == 'Ammo' then
  161.             equip(sets.RangedAttack.Ammo)
  162.         elseif state.OffenseMode == 'AmmoAcc' then
  163.             equip(sets.RangedAttack.AmmoAcc)
  164.         elseif state.OffenseMode == "TP" then
  165.             equip(sets.RangedAttack.TP)
  166.         else
  167.             equip(sets.RangedAttack)
  168.         end
  169.     end
  170.  
  171.     -- Job Abilities
  172.     if spell.name == 'Spectral Jig' and buffactive.sneak then
  173.         send_command('cancel 71')
  174.     end
  175. end
  176.  
  177. -- Return a customized weaponskill mode to use for weaponskill sets.
  178. -- Don't return anything if you're not overriding the default value.
  179. function get_job_wsmode(spell, action, spellMap)
  180.  
  181. end
  182.  
  183. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  184. -- Midcast actions
  185. function job_midcast(spell, action, spellMap, eventArgs)
  186.     if SoilBeltWS[spell.name] then
  187.         equip({waist="Soil Belt"})
  188.     end
  189.    
  190.     if LightBeltWS[spell.name] then
  191.         equip({waist="Light Belt"})
  192.     end
  193.    
  194.     if LightNeckWS[spell.name] then
  195.         equip({neck="Light Gorget"})
  196.     end
  197. end
  198.  
  199. -- Run after the default midcast() is done.
  200. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  201. function job_post_midcast(spell, action, spellMap, eventArgs)
  202.  
  203. end
  204.  
  205. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  206. function job_aftercast(spell, action, spellMap, eventArgs)
  207. end
  208.  
  209. -- Run after the default aftercast() is done.
  210. -- eventArgs is the same one used in job_aftercast, in case information needs to be persisted.
  211. function job_post_aftercast(spell, action, spellMap, eventArgs)
  212.  
  213. end
  214.  
  215. -------------------------------------------------------------------------------------------------------------------
  216. -- Customization hooks for idle and melee sets, after they've been automatically constructed.
  217. -------------------------------------------------------------------------------------------------------------------
  218.  
  219. -- Called before the Include starts constructing melee/idle/resting sets.
  220. -- Can customize state or custom melee class values at this point.
  221. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  222. function job_handle_equipping_gear(status, eventArgs)
  223.  
  224. end
  225.  
  226. -- Modify the default idle set after it was constructed.
  227. function customize_idle_set(idleSet)
  228.     return idleSet
  229. end
  230.  
  231. -- Modify the default melee set after it was constructed.
  232. function customize_melee_set(meleeSet)
  233.     return meleeSet
  234. end
  235.  
  236. -------------------------------------------------------------------------------------------------------------------
  237. -- General hooks for other events.
  238. -------------------------------------------------------------------------------------------------------------------
  239.  
  240. -- Called when the player's status changes.
  241. function job_status_change(newStatus, oldStatus, eventArgs)
  242.     --handle_equipping_gear(newStatus)
  243. end
  244.  
  245. -- Called when a player gains or loses a buff.
  246. -- buff == buff gained or lost
  247. -- gain == true if the buff was gained, false if it was lost.
  248. function job_buff_change(buff, gain)
  249.  
  250. end
  251.  
  252.  
  253. -------------------------------------------------------------------------------------------------------------------
  254. -- User code that supplements self-commands.
  255. -------------------------------------------------------------------------------------------------------------------
  256.  
  257. -- Called for custom player commands.
  258. function job_self_command(cmdParams, eventArgs)
  259.  
  260. end
  261.  
  262. -- Called by the 'update' self-command, for common needs.
  263. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  264. function job_update(cmdParams, eventArgs)
  265.  
  266. end
  267.  
  268. -- Handle notifications of user state values being changed.
  269. function job_state_change(stateField, newValue)
  270.  
  271. end
  272.  
  273. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  274. function display_current_job_state(eventArgs)
  275.  
  276. end
  277.  
  278. -------------------------------------------------------------------------------------------------------------------
  279. -- Utility functions specific to this job.
  280. -------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment