Advertisement
Guest User

Untitled

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