Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Trigger Macro
- -- Macro -
- -- /console gs c set ResistMagic Resist
- -------------------------------------------------------------------------------------------------------------------
- -- Setup functions for this job. Generally should not be modified.
- -------------------------------------------------------------------------------------------------------------------
- -- Initialization function for this job file.
- function get_sets()
- mote_include_version = 2
- -- Load and initialize the include file.
- include('Mote-Include.lua')
- end
- -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
- function job_setup()
- -- List of pet weaponskills to check for
- petWeaponskills = S{"Slapstick", "Knockout", "Magic Mortar",
- "Chimera Ripper", "String Clipper", "Cannibal Blade", "Bone Crusher", "String Shredder",
- "Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
- -- Map automaton heads to combat roles
- petModes = {
- ['Harlequin Head'] = 'Melee',
- ['Sharpshot Head'] = 'Ranged',
- ['Valoredge Head'] = 'Tank',
- ['Stormwaker Head'] = 'Magic',
- ['Soulsoother Head'] = 'Heal',
- ['Spiritreaver Head'] = 'Nuke'
- }
- -- Subset of modes that use magic
- magicPetModes = S{'Nuke','Heal','Magic'}
- -- Var to track the current pet mode.
- state.PetMode = M{['description']='Pet Mode', 'None', 'Melee', 'Ranged', 'Tank', 'Magic', 'Heal', 'Nuke'}
- -- Var to track Pet Magic Accuracy
- state.ResistMagic = M{['description']='Pet Magic', 'None', 'Resist'}
- end
- -------------------------------------------------------------------------------------------------------------------
- -- User setup functions for this job. Recommend that these be overridden in a sidecar file.
- -------------------------------------------------------------------------------------------------------------------
- -- Setup vars that are user-dependent. Can override this function in a sidecar file.
- function user_setup()
- state.OffenseMode:options('Normal', 'Acc', 'Fodder')
- state.HybridMode:options('Normal', 'DT')
- state.WeaponskillMode:options('Normal', 'Acc', 'Fodder')
- state.PhysicalDefenseMode:options('PDT', 'Evasion')
- -- Default maneuvers 1, 2, 3 and 4 for each pet mode.
- defaultManeuvers = {
- ['Melee'] = {'Fire Maneuver', 'Thunder Maneuver', 'Wind Maneuver', 'Light Maneuver'},
- ['Ranged'] = {'Wind Maneuver', 'Fire Maneuver', 'Thunder Maneuver', 'Light Maneuver'},
- ['Tank'] = {'Earth Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Wind Maneuver'},
- ['Magic'] = {'Ice Maneuver', 'Light Maneuver', 'Dark Maneuver', 'Earth Maneuver'},
- ['Heal'] = {'Light Maneuver', 'Dark Maneuver', 'Water Maneuver', 'Earth Maneuver'},
- ['Nuke'] = {'Ice Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Earth Maneuver'}
- }
- update_pet_mode()
- end
- -- Define sets used by this job file.
- function init_gear_sets()
- -- Precast Sets
- -- Fast cast sets for spells
- sets.precast.FC = {}
- sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {})
- -- Precast sets to enhance JAs
- sets.precast.JA['Tactical Switch'] = {}
- sets.precast.JA['Repair'] = {}
- sets.precast.JA.Maneuver = {}
- -- Waltz set (chr and vit)
- sets.precast.Waltz = {}
- -- Don't need any special gear for Healing Waltz.
- sets.precast.Waltz['Healing Waltz'] = {}
- -- Weaponskill sets
- -- Default set for any weaponskill that isn't any more specifically defined
- sets.precast.WS = {}
- -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
- sets.precast.WS['Stringing Pummel'] = set_combine(sets.precast.WS, {})
- sets.precast.WS['Stringing Pummel'].Mod = set_combine(sets.precast.WS['Stringing Pummel'], {})
- sets.precast.WS['Victory Smite'] = set_combine(sets.precast.WS, {})
- sets.precast.WS['Shijin Spiral'] = set_combine(sets.precast.WS, {})
- -- Midcast Sets
- sets.midcast.FastRecast = {}
- -- Midcast sets for pet actions
- sets.midcast.Pet.Cure = {}
- sets.midcast.Pet['Elemental Magic'] = {
- head="Otronif Mask +1", body="Otro. Harness +1", hands="Otronif Gloves +1",
- legs="Otronif Brais +1", feet="Otronif Boots +1"}
- sets.midcast.Pet['Elemental Magic'].Resist = {
- head="Karagoz Capello +1", body="Kara. Farsetto +1", hands="Karagoz Guanti +1",
- legs="Kara. Pantaloni +1", feet="Karagoz Scarpe +1"}
- sets.midcast.Pet['Enfeebling Magic'] = {}
- sets.midcast.Pet.WeaponSkill = {}
- -- Sets to return to when not performing an action.
- -- Resting sets
- sets.resting = {}
- -- Idle sets
- sets.idle = {}
- sets.idle.Town = set_combine(sets.idle, {})
- -- Set for idle while pet is out (eg: pet regen gear)
- sets.idle.Pet = sets.idle
- -- Idle sets to wear while pet is engaged
- sets.idle.Pet.Engaged = {}
- sets.idle.Pet.Engaged.Ranged = set_combine(sets.idle.Pet.Engaged, {})
- sets.idle.Pet.Engaged.Nuke = set_combine(sets.idle.Pet.Engaged, {})
- sets.idle.Pet.Engaged.Magic = set_combine(sets.idle.Pet.Engaged, {})
- -- Defense sets
- sets.defense.Evasion = {}
- sets.defense.PDT = {}
- sets.defense.MDT = {}
- sets.Kiting = {}
- -- Engaged sets
- -- Normal melee group
- sets.engaged = {
- head="Taeon Chapeau", neck="Sanctity Necklace", ear1="Etiolation Earring",
- body="Taeon Tabard", hands="Taeon Gloves", ring1="Kunaji Ring", ring2="Vengeful Ring",
- back="Prodigious Mantle", waist="Steppe Sash", legs="Taeon Tights", feet="Taeon Boots"}
- sets.engaged.Acc = {}
- sets.engaged.DT = {}
- sets.engaged.Acc.DT = {}
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Job-specific hooks for standard casting events.
- -------------------------------------------------------------------------------------------------------------------
- -- Called when pet is about to perform an action
- function job_pet_midcast(spell, action, spellMap, eventArgs)
- if spell.skill == 'Elemental Magic' then
- if state.ResistMagic.value == 'Resist' then
- equip(sets.midcast.Pet['Elemental Magic'].Resist)
- else
- equip(sets.midcast.Pet['Elemental Magic'])
- end
- end
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Job-specific hooks for non-casting events.
- -------------------------------------------------------------------------------------------------------------------
- -- 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)
- if buff == 'Wind Maneuver' then
- handle_equipping_gear(player.status)
- end
- end
- -- Called when a player gains or loses a pet.
- -- pet == pet gained or lost
- -- gain == true if the pet was gained, false if it was lost.
- function job_pet_change(pet, gain)
- update_pet_mode()
- end
- -- Called when the pet's status changes.
- function job_pet_status_change(newStatus, oldStatus)
- if newStatus == 'Engaged' then
- display_pet_status()
- end
- end
- -------------------------------------------------------------------------------------------------------------------
- -- User code that supplements standard library decisions.
- -------------------------------------------------------------------------------------------------------------------
- -- 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)
- update_pet_mode()
- end
- -- Set eventArgs.handled to true if we don't want the automatic display to be run.
- function display_current_job_state(eventArgs)
- display_pet_status()
- end
- -------------------------------------------------------------------------------------------------------------------
- -- User self-commands.
- -------------------------------------------------------------------------------------------------------------------
- -- Called for custom player commands.
- function job_self_command(cmdParams, eventArgs)
- if cmdParams[1] == 'maneuver' then
- if pet.isvalid then
- local man = defaultManeuvers[state.PetMode.value]
- if man and tonumber(cmdParams[2]) then
- man = man[tonumber(cmdParams[2])]
- end
- if man then
- send_command('input /pet "'..man..'" <me>')
- end
- else
- add_to_chat(123,'No valid pet.')
- end
- end
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Utility functions specific to this job.
- -------------------------------------------------------------------------------------------------------------------
- -- Get the pet mode value based on the equipped head of the automaton.
- -- Returns nil if pet is not valid.
- function get_pet_mode()
- if pet.isvalid then
- return petModes[pet.head] or 'None'
- else
- return 'None'
- end
- end
- -- Update state.PetMode, as well as functions that use it for set determination.
- function update_pet_mode()
- state.PetMode:set(get_pet_mode())
- update_custom_groups()
- end
- -- Update custom groups based on the current pet.
- function update_custom_groups()
- classes.CustomIdleGroups:clear()
- if pet.isvalid then
- classes.CustomIdleGroups:append(state.PetMode.value)
- end
- end
- -- Display current pet status.
- function display_pet_status()
- if pet.isvalid then
- local petInfoString = pet.name..' ['..pet.head..']: '..tostring(pet.status)..' TP='..tostring(pet.tp)..' HP%='..tostring(pet.hpp)
- if magicPetModes:contains(state.PetMode.value) then
- petInfoString = petInfoString..' MP%='..tostring(pet.mpp)
- end
- add_to_chat(122,petInfoString)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement