Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- -- Initialization function that defines sets and variables to be used.
- -------------------------------------------------------------------------------------------------------------------
- -- Last Modified: 1/18/2014 12:00AM EST
- -- IMPORTANT: Make sure to also get the Mote-Include.lua file to go with this.
- -- Features/Changes
- -- Normal/Accuracy/TP build modes for Ranged Attacks (Offense Mode)
- -- Normal/Accuracy for Weaponskills
- -- Engaged set for Normal/Accuracy/TP
- -- The Casting, Resting, PDT/MDT modes aren't really used, but the sets are there
- -- so fill in equipment as needed, they're merged from idle
- --
- -- Precast set for Ranged (Misc->Ranged) set
- -- Midcast set for Ranged (Follows Offense Mode)
- --
- -- A set for Unlimited Shot is there, filled with ammo that should only be used with unlimited shot
- -- There's a function in precast that makes sure the buff is active, otherwise equips the default ammo
- -- this check won't protect against multi-hit WS or barrage.
- --
- -- Ability to set the default amunition used for different weapons
- -- simply set DefaultAmmo["Name of Ranged Weapon"] = "Name of Ammo"
- -- This is used in case ammo slot is empty, or special ammo needs to be replaced in precast
- -- If it can't find the ammo or weapon, it'll simply keep the ammo slot empty to protect
- -- against the possibility of spending the rare/ex amunition.
- --
- -- A Ranged WS set has been created to prevent WS from being fired over 21 yalms
- -- All other WS not included are prevent from being fired over 8 yalms
- -- the Ranged WS set does not include short-ranged WS or cor-only WS
- --
- -- A simple JA precast for Steps, BountyShot, and Scavenge are set
- -- A if/then condition for Camouflage is in place to keep body the same
- -- if the buff is active (set to match idle/engaged body)
- --
- -- Barrage if/then set to equip Orion Bracers in post_precast if the buff is active
- -- The Set sets.BarrageMid is combined form the Ranged Accuracy Set.
- --
- -- Low ammunition warning implemented (warns if the TOTAL amount of ammo in the current slot is under 15)
- --
- -- Sneak-Cancelation performed when Spectral Jig is used, and sneak is still active.
- function get_sets()
- -- Load and initialize the include file that this depends on.
- include('Mote-Include.lua')
- init_include()
- -- Options: Override default values
- -- Resting, PDT/MDT sets are currently blank, fill as needed below
- options.OffenseModes = {'Normal', 'Acc', "TP"}
- options.DefenseModes = {'Normal', 'PDT'}
- options.WeaponskillModes = {'Normal', 'Acc'}
- options.CastingModes = {'Normal'}
- options.IdleModes = {'Normal','Ammo'}
- options.RestingModes = {'Normal'}
- options.PhysicalDefenseModes = {'PDT'}
- options.MagicalDefenseModes = {'MDT'}
- state.Defense.PhysicalMode = 'PDT'
- --------------------------------------
- -- Start defining the sets
- --------------------------------------
- -- List of ammunition that should only be used under unlimited shot
- -- Does not currently protect from being lost in multi-hit weapon skills
- U_Shot_Ammo = S{'Aeolus Arrow','Animikii Bullet','Crossbow Bolt'}
- -- Simply add a line of DefaultAmmo["Weapon"] = "Ammo Name"
- -- to add another default ammo choice for specific weapon
- DefaultAmmo = {}
- DefaultAmmo["Eminent Gun"] = "Titanium Bullet"
- DefaultAmmo["Echidna's Bow"] = "Tulfaire Arrow"
- DefaultAmmo["Eminent Bow"] = "Tulfaire Arrow"
- DefaultAmmo["Eminent Crossbow"] = "Bloody Bolt"
- DefaultAmmo["Astrild"] = "Ruszor Arrow"
- DefaultAmmo["Gandiva"] = "Tulfaire Arrow"
- -- List of all ranged WS that can be fired up to 21 yalms from target
- -- It excludes Cor-only WS, as well as the few short-ranged WS (blast arrow, etc)
- ranged_ws = S{"Flaming Arrow", "Piercing Arrow", "Dulling Arrow", "Sidewinder", "Arching Arrow",
- "Empyreal Arrow", "Refulgent Arrow", "Apex Arrow", "Namas Arrow", "Jishnu's Radiance", "Hot Shot",
- "Split Shot", "Sniper Shot", "Slug Shot", "Heavy Shot", "Detonator", "Last Stand",
- "Coronach", "Trueflight", "Wildfire"}
- -- Misc. Job Ability precasts
- sets.precast.Step = {ear2="Choreia Earring"}
- sets.precast.JA['Bounty Shot'] = {hands="Sylvan Glovelettes +2"}
- sets.precast.JA['Scavenge'] = {feet="Orion Socks"}
- -- Idle Set (my 'base', makes it easier to not repeat re-used items)
- sets.idle = {
- head="Orion Beret",neck="Twilight Torque",ear1="Volley Earring",ear2="Moonshade Earring",
- body="Orion Jerkin +1",hands="Manibozho Gloves",ring1="Dark Ring",ring2="Dark Ring",
- back="Shadow Mantle",waist="Scout's Belt",legs="Nahtirah Trousers",feet="Orion Socks"}
- -- Engaged sets
- sets.engaged = set_combine(sets.idle, {
- neck="Asperity Necklace",ear1="Steelflash Earring",ear2="Bladeborn Earring",
- ring1="K'ayres Ring",ring2="Rajas Ring",
- back="Sylvan Chlamys",waist="Hurch'lan Sash"})
- sets.engaged.Acc = set_combine(sets.engaged, {
- neck="Ej Necklace",
- hands="Buremte Gloves"})
- sets.engaged.TP = set_combine(sets.engaged, {
- })
- -- No TP Build currently for engaged, fill as needed
- -- Ranged Attack Sets (normal, not WeaponSkills)
- sets.precast.Misc = {}
- sets.midcast.Misc = {}
- sets.precast.Misc['Ranged'] = set_combine(sets.idle, {
- head="Sylvan Gapette +2",
- body="Sylvan Caban +2",hands="Iuitl Wristbands",
- pants="Nahtirah Trousers"})
- -- AF3 Head +5, AF3 Body +5 (under velocity shot), Iuitl 10%, Nahtirah 9%
- -- Impulse Belt (3%) Recommended for 3rd "snapshot" item
- -- 5/5 Snapshot Merit gives 10%
- -- One thing to bear in mind, changing body when Camoflauge is on, will drop Camo.
- --Commented out for now, Orion Beret +1 will give significant rapid shot increase
- --Which may aid to TP build even if the shot is weaker
- --
- --sets.precast.Misc['Ranged'].TP = set_combine(sets.precast.Misc['Ranged'], {
- -- head="Orion Beret +1"})
- sets.midcast.Misc['Ranged'] = set_combine(sets.idle, {
- neck="Ocachi Gorget",
- ring1="K'ayres Ring",ring2="Rajas Ring",
- back="Libeccio Mantle",waist="Scout's Belt"})
- sets.midcast.Misc['Ranged'].Acc = set_combine(sets.midcast.Misc['Ranged'], {
- neck="Ej Necklace",
- hands="Buremte Gloves",ring1="Paqichikaji Ring"})
- sets.midcast.Misc['Ranged'].TP = set_combine(sets.midcast.Misc['Ranged'], {
- head="Scout's Beret +2",
- back="Sylvan Chlamys", ear2="Bladeborn Earring"})
- -- Only the Augmented (Trial 5004) Scout's Beret +2 is recommended
- -- For Extra 5% TP per shot [w/o aug. mainly good for recycle which is already capped]
- -- Weaponskill sets
- -- No longer need a list of weaponskills with belts and gorgets
- -- It's handled by gear.ElementalBelt and gear.ElementalGorget
- -- Check UserGlobals.lua for defaults, blank defaults to continue using TP/idle gear
- sets.precast.WS = set_combine(sets.midcast.Misc['Ranged'], {
- ear1="Clearview Earring",
- back="Sylvan Chlamys", waist=gear.ElementalBelt, neck=gear.ElementalGorget})
- sets.precast.WS.Acc = set_combine(sets.precast.WS, {
- neck="Ej Necklace",
- hands="Buremte Gloves",ring1="Paqichikaji Ring",
- back="Libeccio Mantle"})
- -- Resting sets
- sets.resting = {}
- -- Defense sets
- sets.defense.PDT = set_combine(sets.idle, {})
- sets.defense.MDT = set_combine(sets.idle, {})
- sets.Kiting = {feet="Fajin Boots"} -- Fajin Boots (+18% Movement) recommended for kiting
- -- Barrage Set
- sets.BarrageMid = set_combine(sets.midcast.Misc['Ranged'].Acc, {
- hands="Orion Bracers"})
- -- initialize sets Macro to Book 20, Page 1
- -- set_macro_page(1,20)
- binds_on_load()
- -- binds Ctrl+- and Ctrl+= to targeting modes
- windower.send_command('bind ^- gs c toggle target')
- windower.send_command('bind ^= gs c cycle targetmode')
- end
- -- Called when this job file is unloaded (eg: job change)
- function file_unload()
- --spellcast_binds_on_unload()
- end
- -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
- function job_pretarget(spell, action, spellMap, eventArgs)
- end
- -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
- -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
- function job_precast(spell, action, spellMap, eventArgs)
- if spell.type:lower() == 'weaponskill' then
- if player.status ~= "Engaged" or player.tp < 100 then
- eventArgs.cancel = true
- return
- end
- if (spell.target.distance >8 and not ranged_ws[spell.name]) or (spell.target.distance >21) then
- -- Cancel Action if distance is too great, saving TP
- add_to_chat(122,"Distance too great for WeaponSkill /Canceling")
- eventArgs.cancel = true
- return
- elseif state.Defense.Active then
- -- Don't gearswap for weaponskills when Defense is on.
- eventArgs.handled = true
- end
- end
- if spell.name == "Ranged" or spell.type:lower() == 'weaponskill' then
- -- If ammo is empty, or special ammo being used without buff, replace with default ammo
- if U_Shot_Ammo[player.equipment.ammo] and not buffactive['unlimited shot'] or player.equipment.ammo == 'empty' then
- if DefaultAmmo[player.equipment.range] and player.inventory[DefaultAmmo[player.equipment.range]] then
- add_to_chat(122,"Unlimited Shot not Active or Ammo Empty, Using Default Ammo")
- equip({ammo=DefaultAmmo[player.equipment.range]})
- else
- add_to_chat(122,"Either Defaul Ammo is Unavailable or Unknown Weapon. Staying empty")
- equip({ammo=empty})
- end
- end
- if not buffactive['unlimited shot'] then
- -- If not empty, and if unlimited shot is not active
- -- Not doing it for unlimited shot to avoid excessive log
- if player.equipment.ammo ~= 'empty' then
- if player.inventory[player.equipment.ammo].count < 15 then
- add_to_chat(122,"Ammo '"..player.inventory[player.equipment.ammo].shortname.."' running low ("..player.inventory[player.equipment.ammo].count..")")
- end
- end
- end
- end
- end
- -- Run after the default precast() is done.
- -- eventArgs is the same one used in job_precast, in case information needs to be persisted.
- -- This is where you place gear swaps you want in precast but applied on top of the precast sets
- function job_post_precast(spell, action, spellMap, eventArgs)
- if spell.name == 'Spectral Jig' and buffactive.sneak then
- -- If sneak is active when using, cancel before completion
- send_command('cancel 71')
- end
- if buffactive["Camouflage"] then
- -- to avoid interuptions in the Camouflage duration
- equip({body="Orion Jerkin +1"})
- end
- end
- -- Return a customized weaponskill mode to use for weaponskill sets.
- -- Don't return anything if you're not overriding the default value.
- function get_job_wsmode(spell, action, spellMap)
- end
- -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
- -- Midcast actions
- function job_midcast(spell, action, spellMap, eventArgs)
- end
- -- Run after the default midcast() is done.
- -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
- function job_post_midcast(spell, action, spellMap, eventArgs)
- if buffactive["Barrage"] then
- equip(sets.BarrageMid)
- end
- end
- -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
- function job_aftercast(spell, action, spellMap, eventArgs)
- end
- -- Run after the default aftercast() is done.
- -- eventArgs is the same one used in job_aftercast, in case information needs to be persisted.
- function job_post_aftercast(spell, action, spellMap, eventArgs)
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Customization hooks for idle and melee sets, after they've been automatically constructed.
- -------------------------------------------------------------------------------------------------------------------
- -- Called before the Include starts constructing melee/idle/resting sets.
- -- Can customize state or custom melee class values at this point.
- -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
- function job_handle_equipping_gear(status, eventArgs)
- end
- -- Modify the default idle set after it was constructed.
- function customize_idle_set(idleSet)
- return idleSet
- end
- -- Modify the default melee set after it was constructed.
- function customize_melee_set(meleeSet)
- return meleeSet
- end
- -------------------------------------------------------------------------------------------------------------------
- -- General hooks for other events.
- -------------------------------------------------------------------------------------------------------------------
- -- Called when the player's status changes.
- function job_status_change(newStatus, oldStatus, eventArgs)
- --handle_equipping_gear(newStatus)
- end
- -- Called when a player gains or loses a buff.
- -- buff == buff gained or lost
- -- gain == true if the buff was gained, false if it was lost.
- function job_buff_change(buff, gain)
- end
- -------------------------------------------------------------------------------------------------------------------
- -- User code that supplements self-commands.
- -------------------------------------------------------------------------------------------------------------------
- -- Called for custom player commands.
- function job_self_command(cmdParams, eventArgs)
- end
- -- Called by the 'update' self-command, for common needs.
- -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
- function job_update(cmdParams, eventArgs)
- end
- -- Handle notifications of user state values being changed.
- function job_state_change(stateField, newValue)
- end
- -- Set eventArgs.handled to true if we don't want the automatic display to be run.
- function display_current_job_state(eventArgs)
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Utility functions specific to this job.
- -------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement