Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- -- 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'] = 'Melee',
- ['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'}
- 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()
- select_default_macro_book()
- 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['Overdrive'] = {body="Pitre Tobe +3"}
- sets.precast.JA['Tactical Switch'] = {}
- sets.precast.JA['Repair'] = {Ear1="Guignol Earring"}
- sets.precast.JA.Maneuver = {
- -- main="Midnights",
- neck="Buffoon's Collar",
- body="Karagoz Farsetto",
- hands="Puppetry Dastanas",
- back="Visucius's Mantle",
- head="Rao Kabuto",
- waist="Salire Belt",
- left_ear="Lifestorm Earring",
- right_ear="Mache Earring +1",
- left_ring="Stikini Ring +1",
- right_ring="Stikini Ring +1",
- legs={ name="Samnuha Tights", augments={'STR+10','DEX+10','"Dbl.Atk."+3','"Triple Atk."+3',}},
- feet="Rao Sune-Ate",
- }
- -- 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'] = {}
- sets.midcast.Pet.WeaponSkill = {
- head={ name="Taeon Chapeau", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
- body="Pitre Tobe +3",
- hands={ name="Taeon Gloves", augments={'Pet: Accuracy+23 Pet: Rng. Acc.+23','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
- legs={ name="Taeon Tights", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}},
- feet={ name="Taeon Boots", augments={'Pet: Accuracy+24 Pet: Rng. Acc.+24','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
- neck="Shulmanu Collar",
- waist="Klouskap Sash +1",
- left_ear="Domes. Earring",
- right_ear="Enmerkar Earring",
- left_ring={name="Varar Ring +1", bag="Wardrobe"},
- right_ring={name="Varar Ring +1", bag="Wardrobe4"},
- back="Visucius's Mantle"
- }
- -- Sets to return to when not performing an action.
- -- Resting sets
- sets.resting = {}
- -- Idle sets
- sets.idle = {
- main="Ohtas",
- head="Rao Kabuto",
- body="Hiza. Haramaki +2",
- hands="Rao Kote",
- legs="Assiduity Pants +1",
- feet="Hermes' Sandals",
- neck="Sanctity Necklace",
- waist="Isa Belt",
- left_ear="Dawn Earring",
- right_ear="Infused Earring",
- left_ring="Defending Ring",
- right_ring="Stikini Ring +1",
- back="Solemnity Cape",
- }
- sets.idle.Town = set_combine(sets.idle, {body="Councilor's Garb"})
- -- 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 = {
- main={ name="Ohtas", augments={'Accuracy+70','Pet: Accuracy+70','Pet: Haste+10%',}},
- range="Animator P +1",
- ammo="Automat. Oil +3",
- head={ name="Taeon Chapeau", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
- body="Pitre Tobe +3",
- hands={ name="Taeon Gloves", augments={'Pet: Accuracy+23 Pet: Rng. Acc.+23','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
- legs={ name="Taeon Tights", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}},
- feet={ name="Taeon Boots", augments={'Pet: Accuracy+24 Pet: Rng. Acc.+24','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
- neck="Shulmanu Collar",
- waist="Klouskap Sash +1",
- left_ear="Domes. Earring",
- right_ear="Enmerkar Earring",
- left_ring="Varar Ring +1",
- right_ring="Thurandaut Ring",
- back="Visucius's Mantle"
- }
- 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 = {
- main="Ohtas",
- head={ name="Rao Kabuto", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
- body="Rao Togi +1",
- hands={ name="Rao Kote", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
- legs={ name="Taeon Tights", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}},
- feet={ name="Rao Sune-Ate", augments={'Pet: HP+100','Pet: Accuracy+15','Pet: Damage taken -3%',}},
- neck="Shepherd's Chain",
- waist="Klouskap Sash +1",
- left_ear="Handler's Earring +1",
- right_ear="Enmerkar Earring",
- left_ring="Thurandaut Ring",
- right_ring={name="Varar Ring +1"},
- back="Visucius's Mantle"
- }
- sets.defense.MDT = {
- main="Ohtas",
- range="Animator P +1",
- head={ name="Anwig Salade", augments={'Attack+3','Pet: Damage taken -10%','Accuracy+3','Pet: Haste+5',}},
- body="Rao Togi +1",
- hands={ name="Taeon Gloves", augments={'Pet: Accuracy+23 Pet: Rng. Acc.+23','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
- legs={ name="Taeon Tights", augments={'Pet: Accuracy+25 Pet: Rng. Acc.+25','Pet: "Dbl. Atk."+4','Pet: Damage taken -4%',}},
- feet={ name="Taeon Boots", augments={'Pet: Accuracy+24 Pet: Rng. Acc.+24','Pet: "Dbl. Atk."+5','Pet: Damage taken -4%',}},
- neck="Shulmanu Collar",
- waist="Klouskap Sash +1",
- left_ear="Domes. Earring",
- right_ear="Enmerkar Earring",
- left_ring="Thurandaut Ring",
- right_ring="Varar Ring +1",
- back={ name="Visucius's Mantle", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Accuracy+20 Attack+20','Pet: Accuracy+10 Pet: Rng. Acc.+10','Pet: Haste+10','System: 1 ID: 1247 Val: 4',}},
- }
- sets.Kiting = {feet="Hermes' Sandals"}
- -- Engaged sets
- -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
- -- sets if more refined versions aren't defined.
- -- If you create a set with both offense and defense modes, the offense mode should be first.
- -- EG: sets.engaged.Dagger.Accuracy.Evasion
- -- Normal melee group
- sets.engaged = set_combine(sets.idle.Pet.Engaged, {})
- sets.engaged.Acc = set_combine(sets.Engaged, {})
- sets.engaged.DT = set_combine(sets.Engaged, {})
- sets.engaged.Acc.DT = set_combine(sets.Engaged, {})
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Job-specific hooks that are called to process player actions at specific points in time.
- -------------------------------------------------------------------------------------------------------------------
- function job_precast(spell, action, spellMap, eventArgs)
- if spell.english == 'Deploy' then
- equip(sets.midcast.Pet.WeaponSkill)
- end
- end
- -- function job_post_precast(spell, action, spellMap, eventArgs)
- -- job_update(cmdParams, eventArgs)
- -- end
- -- Called when pet is about to perform an action
- function job_pet_precast(spell, action, spellMap, eventArgs)
- if petWeaponskills:contains(spell.english) then
- classes.CustomClass = "Weaponskill"
- end
- end
- -- function job_midcast(spell, action, spellMap, eventArgs)
- -- job_update(cmdParams, eventArgs)
- -- 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 petWeaponskills:contains(spell.english) then
- classes.CustomClass = "Weaponskill"
- 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)
- job_handle_equipping_gear(playerStatus, eventArgs)
- else
- job_update(cmdParams, eventArgs)
- handle_equipping_gear(player.status)
- job_handle_equipping_gear(playerStatus, eventArgs)
- 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
- -- Updates gear based on pet status changes.
- function job_pet_status_change(newStatus, oldStatus, eventArgs)
- if newStatus == 'Idle' or newStatus == 'Engaged' then
- handle_equipping_gear(player.status)
- 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
- -- Engage updates
- function job_handle_equipping_gear(playerStatus, eventArgs)
- classes.CustomMeleeGroups:clear()
- if pet.status=="Engaged" then
- classes.CustomMeleeGroups:append('PetEngaged')
- classes.CustomMeleeGroups: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
- -- Select default macro book on initial load or subjob change.
- function select_default_macro_book()
- -- Default macro set/book
- if player.sub_job == 'DNC' then
- set_macro_page(5, 2)
- elseif player.sub_job == 'NIN' then
- set_macro_page(5, 2)
- elseif player.sub_job == 'THF' then
- set_macro_page(5, 2)
- else
- set_macro_page(5, 2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement