Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- -- Setup functions for this job. Generally should not be modified.
- -------------------------------------------------------------------------------------------------------------------
- --- Addon command is : //acon list
- res = require 'resources'
- require 'tables'
- files = require 'files'
- function get_sets()
- mote_include_version = 2
- -- Load and initialize the include file.
- include('Mote-Include.lua')
- include('organizer-lib')
- end
- -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
- function job_setup()
- -- 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'
- }
- petWeaponskills = S{"Slapstick", "Knockout", "Magic Mortar",
- "Chimera Ripper", "String Clipper", "Cannibal Blade", "Bone Crusher", "String Shredder",
- "Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
- -- 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.
- -------------------------------------------------------------------------------------------------------------------
- function user_setup()
- state.OffenseMode:options('Normal', 'Acc', 'Event', 'Pet')
- state.HybridMode:options ('Normal')
- state.WeaponskillMode:options('Normal')
- state.CastingMode:options('Normal')
- state.IdleMode:options('Normal', 'PetPDT')
- state.PhysicalDefenseMode:options('PDT')
- state.MagicalDefenseMode:options('MDT')
- 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()
- send_command('bind %v input //exec TEMP.txt')
- send_command('bind %c input //exec CAP.txt')
- send_command('bind %w input //exec warp.txt')
- send_command('bind %d input //exec dem.txt')
- send_command('alias geref input /echo ~ Geo Refresh ~;input /ma Geo-Refresh <st>')
- send_command('alias gehas input /echo ~ Geo Haste ~;input /ma Geo-Haste <st>')
- send_command('alias gefur input /echo ~ Geo Fury ~;input /ma Geo-Fury <st>')
- send_command('alias gereg input /echo ~ Geo Regen ~;input /ma Geo-Regen <st>')
- send_command('alias geatt input /echo ~ Geo Attunement ~;input /ma Geo-Attunement <st>')
- send_command('alias si input /echo ~ Sneak + Invisible ~;input /ma sneak <me>;wait 5;input /ma invisible <me>')
- send_command('alias sn input /echo ~ Sneak ~;input /ma sneak <st>')
- send_command('alias in input /echo ~ Invisible ~;input /ma invisible <st>')
- send_command('alias p input /echo ~ Paralyna ~;input /ma paralyna <st>')
- send_command('alias po input /echo ~ Poisona ~;input /ma poisona <st>')
- send_command('alias era input /echo ~ Erase ~;input /ma erase <st>')
- send_command('alias cur input /echo ~ Cursna ~;input /ma cursna <st>')
- send_command('alias sil input /echo ~ Silena ~;input /ma silena <st>')
- send_command('alias sto input /echo ~ Stona ~;input /ma stona <st>')
- send_command('alias bli input /echo ~ Blindna ~;input /ma blindna <st>')
- send_command('alias bss input /echo ~ SS + Blink ~;input /ma stoneskin;wait 9;input /ma blink')
- send_command('alias ss input /echo ~ SS ~;input /ma stoneskin')
- send_command('alias bli input /echo ~ Blink ~;input /ma blink')
- send_command('alias ref input /echo ~ Refresh ~;input /ma refresh <st>')
- send_command('alias rr input /echo ~ RR ~;input /ma reraise')
- send_command('alias aqu input /echo ~ Aquaveil ~;input /ma aquaveil')
- send_command('alias ec input /echo ~ Echo ~;input /item "Echo Drops" <me>')
- send_command('alias hol input /echo ~ Holy Water ~;input /item "Holy Water" <me>')
- send_command('alias cur input /echo ~ Cure IV ~;input /ma Cure IV <st>')
- send_command('alias m input /echo ~ Mount ~;input /mount "Fenrir" <me>')
- send_command('bind %z input /echo ~ Emergency CURE ~;input /ma "Cure IV" <me>')
- send_command('input /macro book 15;wait 1;input /macro set 1;wait 10;input /lockstyleset 15')
- end
- -- Define sets used by this job file.
- function init_gear_sets()
- -- Precast Sets ----------------
- sets.precast = {}
- sets.precast.FC = {
- head="Herculean Helm",
- neck="Orunmila's Torque",
- right_ear="Loquac. Earring",
- right_ring="Prolix Ring",
- legs="Gyve Trousers",
- feet="Regal Pumps +1"}
- -- Precast sets to enhance JAs -------------------
- sets.precast.JA = {}
- sets.precast.JA['Tactical Switch'] = {fee="Karagoz Scarpe"}
- sets.precast.JA['Repair'] = {feet="Foire Bab. +1", right_ear="Pratik Earring", left_ear="Guignol Earring"}
- sets.precast.JA.Maneuver = {body="Karagoz Farsetto", hands="Foire Dastanas +2", back="Visucius's Mantle"}
- sets.precast.JA['Activate'] = {back="Visucius's Mantle"}
- sets.precast.JA['Overdrive'] = {body="Pitre Tobe +1"}
- -- Waltz set (chr and vit) --------------------------
- sets.precast.Waltz = {}
- -- Weaponskill sets ---------------------------------
- sets.precast.WS = {
- main="Midnights",
- head="Herculean Helm",
- neck="Fotia Gorget",
- right_ear="moonshade Earring",
- body="Foire Tobe +2",
- hands="Herculean Gloves",
- right_ring="Niqmaddu Ring",
- left_ring="Regal Ring",
- waist="Fotia Belt",
- legs="Herculean Trousers",
- feet="Herculean Boots",
- left_ear="Cessance Earring",
- back="Visucius's Mantle"}
- -- Midcast Sets -------------------------
- -- Midcast sets for pet actions----------
- sets.midcast = {}
- sets.midcast.Pet = {}
- sets.midcast.Pet.Cure = {legs="Foire Churidars +1"}
- sets.midcast['Dark Magic'] = {head="Tali'ah Turban +2", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1"}
- sets.midcast.Pet['Elemental Magic'] = {head="Tali'ah Turban +2", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", feet="Karagoz Scarpe"}
- sets.midcast.Pet['Enhancing Magic'] = {head="Tali'ah Turban +2", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", feet="Karagoz Scarpe"}
- sets.midcast.Pet['Enfeebling Magic'] = {head="Tali'ah Turban +2", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", feet="Karagoz Scarpe"}
- sets.midcast.Pet.Weaponskill = {head="Karagoz Capello", hands="Karagoz Guanti +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", back="Dispersal Mantle"}
- -- Idle sets ------------------------
- sets.idle = {}
- sets.Resting = sets.Idle
- sets.idle.Normal = {
- main="Midnights",
- range="Animator P +1",
- head="Pitre Taj +1",
- neck="Ampath Necklace",
- right_ear="Handler's Earring +1",
- left_ear="Handler's Earring",
- body="Pitre Tobe +1",
- hands="Tali'ah Gages +1",
- right_ring="Warp Ring",
- left_ring="Shneddick Ring",
- waist="Klouskap Sash",
- legs="Desultor Tassets",
- feet="Tali'ah Crackows +2",
- back="Visuciu's Mantle"}
- sets.idle.Town = {
- head="Pitre Taj +1",
- neck="Combatant's Torque",
- right_ear="Handler's Earring",
- left_ear="Handler's Earring +1",
- body="Tali'ah Manteel +1",
- hands="Tali'ah Gages +1",
- right_ring="Niqmaddu Ring",
- left_ring="Shneddick Ring",
- waist="Klouskap Sash",
- legs="Desultor Tassets",
- feet="Tali'ah Crackows +2",
- back="Visuciu's Mantle"}
- -- 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="Midnights",
- range="Animator P +1",
- head="Pitre Taj +1",
- neck="Shulmanu Collar",
- right_ear="Handler's Earring +1",
- left_ear="Handler's Earring",
- body="Pitre Tobe +1",
- hands="Tali'ah Gages +1",
- right_ring="Varar Ring",
- left_ring="Varar Ring",
- waist="Klouskap Sash",
- legs="Kara. Pantaloni +1",
- feet="Foire Bab. +1",
- back="Visuciu's Mantle"}
- sets.idle.PetPDT = {
- head="Anwig Salade",
- neck="Adad Amulet",
- right_ear="Handler's Earring",
- left_ear="Handler's Earring +1",
- body="Pitre Tobe +1",
- hands="Pitre Tobe +1",
- right_ring="Varar Ring",
- left_ring="Varar Ring",
- waist="Klouskap Sash",
- legs="Kara. Pantaloni +1",
- feet="Tali'ah Crackows +2",
- back="Visucius's Mantle"}
- sets.idle.Pet.Engaged.Ranged = set_combine(sets.idle.Pet.Engaged, {head="Tali'ah Turban +2", body="Tali'ah Manteel +1", legs="Tali'ah Seraweels", fee="Tali'ah Crackows +2", back="Visuciu's Mantle"})
- sets.idle.Pet.Engaged.Nuke = set_combine(sets.idle.Pet.Engaged, {head="Tali'ah Turban +2", right_ear="Enmerkar Earring", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", back="Visuciu's Mantle"})
- sets.idle.Pet.Engaged.Magic = set_combine(sets.idle.Pet.Engaged, {head="Tali'ah Turban +2", right_ear="Enmerkar Earring", hands="Tali'ah Gages +1", body="Tali'ah Manteel +1", legs="Kara. Pantaloni +1", back="Visuciu's Mantle"})
- -- Defense sets --------------------------------------------
- sets.defense = {}
- sets.defense.PDT = {
- head="Hizamaru Somen +1",
- neck="Loricate Torque +1",
- right_ear="Thureous Earring",
- left_ear="Ethereal Earring",
- body="Hizamaru Haramaki",
- hands="Herculean Gloves",
- right_ring="Patricius Ring",
- left_ring="Defending Ring",
- waist="Flume Belt",
- legs="Tali'ah Seraweels",
- feet="Herculean Boots",
- back="Xucau Mantle"}
- sets.defense.MDT = {
- head="Hizamaru Somen +1",
- neck="Warder's Charm",
- body="Hizamaru Haramaki",
- right_ear="Spellbr. Earring",
- left_ear="Zealous Earring",
- right_ring="Chirich Ring",
- left_ring="Shadow Ring",
- hands="Foire Dastanas +2",
- waist="Flume Belt",
- legs="Assid. Pants +1",
- feet="Herculean Boots",
- back="Toro Cape"}
- -- Engaged sets --------------------------------------------------------
- sets.engaged = {}
- sets.engaged.Normal = {
- main="Midnights",
- range="Animator P +1",
- head="Tali'ah Turban +2",
- neck="Shulmanu Collar",
- right_ear="Enmerkar Earring",
- left_ear="Cessance Earring",
- body="Pitre Tobe +1",
- hands="Foire Dastanas +2",
- right_ring="Varar Ring",
- left_ring="Varar Ring",
- waist="Klouskap Sash",
- legs="Kara. Pantaloni +1",
- feet="Tali'ah Crackows +2",
- back="Mecisto. Mantle"}
- sets.engaged.Acc = {
- main="Midnights",
- range="Animator P +1",
- head="Tali'ah Turban +2",
- neck="Shulmanu Collar",
- right_ear="Zennaroi Earring",
- left_ear="Cessance Earring",
- body="Tali'ah Manteel +1",
- hands="Tali'ah Gages +1",
- right_ring="Varar Ring",
- left_ring="Varar Ring",
- waist="Klouskap Sash",
- legs="Tali'ah Sera. +1",
- feet="Tali'ah Crackows +2",
- back="Visucius's Mantle"}
- sets.engaged.Event = {
- range="Animator P +1",
- head="Pitre Taj +1",
- neck="Shulmanu Collar",
- right_ear="Steelflash Earring",
- left_ear="Cessance Earring",
- body="Pitre Tobe +1",
- hands="Foire Dastanas +2",
- right_ring="Varar Ring",
- left_ring="Varar Ring",
- waist="Klouskap Sash",
- legs="Kara. Pantaloni +1",
- feet="Tali'ah Crackows +2",
- back="Visucius's Mantle"}
- sets.engaged.Pet = {
- head="Anwig Salade",
- neck="Adad Amulet",
- right_ear="Handler's Earring",
- left_ear="Handler's Earring +1",
- body="Pitre Tobe +1",
- hands="Tali'ah Gages +1",
- right_ring="Varar Ring",
- left_ring="Varar Ring",
- waist="Isa Belt",
- legs="Tali'ah Sera. +1",
- feet="Tali'ah Crackows +2",
- back="Visucius's Mantle"}
- sets.reive = {neck="Ygnas's Resolve +1", back="Dispersal Mantle"}
- end
- -------------------------------------------------------------------------------------------------------------------
- -- Job-specific hooks for non-casting events.
- -------------------------------------------------------------------------------------------------------------------
- function display_current_job_state(eventArgs)
- display_pet_status()
- end
- function job_pet_change(pet, gain)
- update_pet_mode()
- end
- function status_change(new,tab)
- handle_equipping_gear(player.status)
- if new == 'Resting' then
- equip(sets.Resting)
- else
- equip(sets.idle.Current)
- end
- end
- function job_pet_status_change(newStatus, oldStatus)
- if newStatus == 'Engaged' then
- display_pet_status()
- end
- end
- function job_state_change(stateField, newValue, oldValue)
- job_handle_equipping_gear(player.status)
- equip(sets.idle.Current)
- end
- 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
- function get_pet_mode()
- if pet.isvalid then
- return petModes[pet.head] or 'None'
- else
- return 'None'
- end
- end
- function update_pet_mode()
- state.PetMode:set(get_pet_mode())
- update_custom_groups()
- end
- function job_update(cmdParams, eventArgs)
- update_pet_mode()
- end
- function update_custom_groups()
- classes.CustomIdleGroups:clear()
- if pet.isvalid then
- classes.CustomIdleGroups:append(state.PetMode.value)
- end
- end
- function display_pet_status()
- if pet.isvalid then
- local petInfoString = pet.name..' ['..pet.head..']: '..tostring(pet.status)..' 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
- 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
- if playerStatus == 'Idle' then
- equip(sets.idle.Current)
- end
- end
- function check_height()
- selfz = math.floor(windower.ffxi.get_mob_by_index(player.index).z * 10)/10
- targetz = math.floor(windower.ffxi.get_mob_by_index(player.target.index).z * 10)/10
- heightdiff = selfz - targetz
- targdistance = math.floor(windower.ffxi.get_mob_by_index(player.target.index).distance:sqrt() * 10+0.5)/10
- send_command('input /echo My Height:'..selfz..' Target Height:'..targetz..' Height Difference:'..heightdiff..' Target Distance:'..targdistance..'')
- end
- function job_precast(spell)
- if spell.type == 'WeaponSkill' then
- local range_mult = {
- [2] = 1.55,
- [3] = 1.490909,
- [4] = 1.44,
- [5] = 1.377778,
- [6] = 1.30,
- [7] = 1.15,
- [8] = 1.25,
- [9] = 1.377778,
- [10] = 1.45,
- [11] = 1.454545454545455,
- [12] = 1.666666666666667,
- }
- ability_distance = res.weapon_skills[spell.id].range
- if spell.target.distance > (ability_distance * range_mult[ability_distance] + spell.target.model_size + player.model_size) then
- cancel_spell()
- add_to_chat(3, spell.name..' Canceled: [Out of Range]')
- send_command('gs c update')
- return
- end
- end
- if spell.name == 'Utsusemi: Ichi' and (buffactive['Copy Image (3)'] or buffactive ['Copy Image (4+)']) then
- cancel_spell()
- send_command('@wait 1;')
- equip(sets.idle.Current)
- return
- end
- if spell.type == 'WeaponSkill' and player.tp < 1000 then
- cancel_spell()
- send_command('gs c update')
- windower.add_to_chat(50,'*** Waiting on TP ***')
- return
- end
- if spell.type == "WeaponSkill" then
- tpspent = spell.tp_cost
- add_to_chat(200,'-----------> WS <-----------')
- add_to_chat(003,'Name:'..spell.name..' Base TP:'..tpspent..'')
- if (#spell.skillchain_a > 1) then
- skillchainproperties = spell.skillchain_a
- end
- if (#spell.skillchain_b > 1) then
- skillchainproperties = skillchainproperties ..' '.. spell.skillchain_b
- end
- if (#spell.skillchain_c) then
- skillchainproperties = skillchainproperties ..' '.. spell.skillchain_c
- end
- add_to_chat(003,'Skillchain Properties:'..skillchainproperties..'')
- end
- if spell.type == 'WeaponSkill' and buffactive.Amnesia then
- cancel_spell()
- send_command('gs c update')
- windower.add_to_chat(50,'*** Canceling Ability - Currently have Amnesia ***')
- return
- end
- end
- function job_buff_change(status,gain_or_loss)
- if (gain_or_loss) then
- add_to_chat(158,'-------> Gained Buff: '..status..' <-------')
- if status == "sleep" then
- equip(sets.WakeSleep)
- end
- if status == "KO" then
- send_command('input /party These tears... they sting-wing....')
- end
- else
- add_to_chat(039,'-------> Lost Buff: '..status..' <-------')
- end
- end
- function job_pet_midcast(spell, spellMap, action)
- if petWeaponskills:contains(spell.english) then
- equip(sets.midcast.Pet.Weaponskill)
- windower.add_to_chat(50,'---> PET TP: '..pet_tp..' PET WS: '..spell.name..' <---')
- end
- if spell.action_type == 'Magic' then
- equip(sets.midcast.Pet['Elemental Magic'])
- windower.add_to_chat(50,'---> PET Elemental SET <---')
- end
- end
- function job_aftercast(eventArgs, action)
- if pet.isvalid then
- if pet_midaction() then
- eventArgs.handled = true
- else
- handle_equipping_gear(player.status, newStatus)
- end
- end
- end
- pet_tp=0
- packets = require('packets')
- function update_pet_tp(id,data)
- if id == 0x068 then
- pet_tp = 0
- local update = packets.parse('incoming', data)
- pet_tp = update["Pet TP"]
- windower.send_command('lua c gearswap c pet_tp '..pet_tp)
- --print(pet_tp)
- --log_data_structure(update)
- --log_data_structure(pet_tp)
- --debuginfo = debug.getinfo(1)
- --log_data_structure(debuginfo)
- --print('here')
- --log_data_structure(data)
- end
- end
- id = windower.raw_register_event('incoming chunk', update_pet_tp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement