Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- -- Setup functions for this job. Generally should not be modified.
- -------------------------------------------------------------------------------------------------------------------
- include('organizer-lib')
- -- Initialization function for this job file.
- function get_sets()
- mote_include_version = 2
- -- Load and initialize the include file.
- include('Mote-Include.lua')
- end
- Burden = 0
- BurdenLimit = 30+50
- Mane = {"Wind", "Light", "Thunder"}
- ManeRound = 1
- TypeM = S{"Fire", "Water", "Earth", "Wind", "Dark", "Light", "Ice", "Thunder" }
- Colors = {}
- Colors["Fire"] = "\\cs(102, 0, 0)"
- Colors["Water"] = "\\cs(0, 51, 102)"
- Colors["Wind"] = "\\cs(51, 102, 0)"
- Colors["Dark"] = "\\cs(0, 0, 0)"
- Colors["Light"] = "\\cs(255, 255, 255)"
- Colors["Earth"] = "\\cs(139, 69, 19)"
- Colors["Ice"] = "\\cs(0, 204, 204)"
- Colors["Thunder"] = "\\cs(51, 0, 102)"
- tb_name = "puphelp"
- visible = true
- textinbox = ''
- textinbox = textinbox..' \\cs(0, 0, 0) Maneuvers :\\cr '..Colors[Mane[1]]..Mane[1]..'\\cr-'..Colors[Mane[2]]..Mane[2]..'\\cr-'..Colors[Mane[3]]..Mane[3]..' \\cr \n'
- textinbox = textinbox..' \\cs(0, 0, 0) Burden : '..Burden..'('..BurdenLimit..')\\cr \n'
- windower.text.create(tb_name)
- windower.text.set_location(tb_name, 700, 150)
- windower.text.set_bg_color(tb_name, 200, 96, 96, 96)
- windower.text.set_color(tb_name, 255, 147, 161, 161)
- windower.text.set_font(tb_name, "Arial")
- windower.text.set_font_size(tb_name, 10)
- windower.text.set_bold(tb_name, true)
- windower.text.set_italic(tb_name, false)
- windower.text.set_text(tb_name, textinbox)
- windower.text.set_bg_visibility(tb_name, visible)
- local player = windower.ffxi.get_player()
- function refresh()
- textinbox = ''
- -- GEO SPELL
- if (pet) then
- textinbox = textinbox..' \\cs(0, 0, 0) '..pet.name..' \n- HP :'..pet.hp..'/'..pet.max_hp..' \n- MP : '..pet.mp..'/'..pet.max_mp..' \n- TP : '..tostring(pet.tp)..' \\cr \n'
- end
- textinbox = textinbox..' \\cs(0, 0, 0) Maneuvers :\\cr '..Colors[Mane[1]]..Mane[1]..'\\cr-'..Colors[Mane[2]]..Mane[2]..'\\cr-'..Colors[Mane[3]]..Mane[3]..' \\cr \n'
- if (pet) and Burden <= BurdenLimit then
- textinbox = textinbox..' \\cs(0, 0, 0) Burden : '..Burden..'('..BurdenLimit..')\\cr \n'
- elseif (pet) and Burden > BurdenLimit then
- textinbox = textinbox..' \\cs(255, 0, 0) Burden : '..Burden..'('..BurdenLimit..') - COOLDOWN ASAP\\cr \n'
- risk = Burden - BurdenLimit + 5
- textinbox = textinbox..' \\cs(255, 0, 0) Overload risk estimated = '..risk..'%\\cr \n'
- end
- windower.text.set_text(tb_name, textinbox)
- 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'}
- 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 = {head="Haruspex Hat",ear2="Loquacious Earring",hands="Thaumas Gloves"}
- sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})
- -- Precast sets to enhance JAs
- sets.precast.JA['Tactical Switch'] = {feet="Cirque Scarpe +2"}
- sets.precast.JA['Repair'] = {feet="Foire Babouches"}
- sets.precast.JA.Maneuver = {neck="Buffoon's Collar",body="Karagoz Farsetto",hands="Foire Dastanas",back="Dispersal Mantle", ear1="Burana Earring"}
- -- Waltz set (chr and vit)
- sets.precast.Waltz = {
- head="Whirlpool Mask",ear1="Roundel Earring",
- body="Otronif Harness +1",hands="Otronif Gloves",ring1="Spiral Ring",
- back="Iximulew Cape",legs="Nahtirah Trousers",feet="Thurandaut Boots +1"}
- -- 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 = {
- head="Lilitu Headpiece",neck="Fotia Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
- body="Samnuha Coat",hands="Taeon Gloves",ring1="Ifrit Ring",ring2="Ifrit Ring",
- back="Dispersal Mantle",waist="Fotia Belt",legs="Samnuha Tights",feet="Taeon Boots"}
- -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
- sets.precast.WS['Stringing Pummel'] = sets.precast.WS
- sets.precast.WS['Stringing Pummel'].Mod = set_combine(sets.precast.WS['Stringing Pummel'], {legs="Nahtirah Trousers"})
- sets.precast.WS['Victory Smite'] = sets.precast.WS
- sets.precast.WS['Shijin Spiral'] = sets.precast.WS
- -- Midcast Sets
- sets.midcast.FastRecast = {
- head="Haruspex Hat",ear2="Loquacious Earring",
- body="Otronif Harness +1",hands="Regimen Mittens",
- legs="Manibozho Brais",feet="Otronif Boots +1"}
- -- Midcast sets for pet actions
- sets.midcast.Pet.Cure = {legs="Foire Churidars"}
- sets.midcast.Pet['Elemental Magic'] = {feet="Naga Kyahan", ear1="Burana Earring", ear2="Cirque Earring"}
- sets.midcast.Pet.WeaponSkill = {head="Karagoz Capello +1", hands="Karagoz Guanti +1", legs="Kara. Pantaloni +1", feet="Naga Kyahan"}
- -- Sets to return to when not performing an action.
- -- Resting sets
- sets.resting = {head="Pitre Taj",neck="Wiglen Gorget",
- ring1="Sheltered Ring",ring2="Paguroidea Ring"}
- -- Idle sets
- sets.idle = {range="Divinator",
- head="Pitre Taj",neck="Wiglen Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
- body="Pitre Tobe +1",hands="Regimen Mittens",ring1="Sheltered Ring",ring2="Paguroidea Ring",
- back="Mecisto. Mantle",waist="Hurch'lan Sash",legs="Foire Churidars",feet="Hermes' Sandals"}
- sets.idle.Town = set_combine(sets.idle, {main="Tinhaspa"})
- -- 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 = {
- head="Foire Taj",neck="Wiglen Gorget",ear1="Burana Earring",ear2="Domes. Earring",
- body="Rawhide Vest",hands="Regimen Mittens",ring1="Sheltered Ring",ring2="Paguroidea Ring",
- back="Dispersal Mantle",waist="Hurch'lan Sash",legs="Kara. Pantaloni +1",feet="Rawhide Boots"}
- sets.idle.Pet.Engaged.Ranged = set_combine(sets.idle.Pet.Engaged, {legs="Kara. Pantaloni +1"})
- sets.idle.Pet.Engaged.Nuke = set_combine(sets.idle.Pet.Engaged, {legs="Kara. Pantaloni +1"})
- sets.idle.Pet.Engaged.Magic = set_combine(sets.idle.Pet.Engaged, {legs="Kara. Pantaloni +1",feet="Cirque Scarpe +2"})
- -- Defense sets
- sets.defense.Evasion = {
- head="Whirlpool Mask",neck="Twilight Torque",
- body="Otronif Harness +1",hands="Otronif Gloves",ring1="Defending Ring",ring2="Beeline Ring",
- back="Ik Cape",waist="Hurch'lan Sash",legs="Nahtirah Trousers",feet="Otronif Boots +1"}
- sets.defense.PDT = {
- head="Whirlpool Mask",neck="Twilight Torque",
- body="Otronif Harness +1",hands="Otronif Gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
- back="Shadow Mantle",waist="Hurch'lan Sash",legs="Nahtirah Trousers",feet="Otronif Boots +1"}
- sets.defense.MDT = {
- head="Whirlpool Mask",neck="Twilight Torque",
- body="Otronif Harness +1",hands="Otronif Gloves",ring1="Defending Ring",ring2="Shadow Ring",
- back="Tuilha Cape",waist="Hurch'lan Sash",legs="Nahtirah Trousers",feet="Otronif Boots +1"}
- 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 = {
- head="Karagoz Capello +1",neck="Asperity Necklace",ear1="Burana Earring",ear2="Domes. Earring",
- body="Rawhide Vest",hands="Taeon Gloves",ring1="Petrov Ring",ring2="Epona's Ring",
- back="Dispersal Mantle",waist="Hurch'lan Sash",legs="Samnuha Tights",feet="Rawhide Boots"}
- sets.engaged.Acc = {
- head="Whirlpool Mask",neck="Ej Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
- body="Qaaxo Harness",hands="Otronif Gloves",ring1="Rajas Ring",ring2="Epona's Ring",
- back="Dispersal Mantle",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Otronif Boots +1"}
- sets.engaged.DT = {
- head="Whirlpool Mask",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
- body="Otronif Harness +1",hands="Regimen Mittens",ring1="Defending Ring",ring2="Epona's Ring",
- back="Iximulew Cape",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Otronif Boots +1"}
- sets.engaged.Acc.DT = {
- head="Whirlpool Mask",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
- body="Otronif Harness +1",hands="Regimen Mittens",ring1="Defending Ring",ring2="Beeline Ring",
- back="Iximulew Cape",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Otronif Boots +1"}
- 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
- autos= false
- -------------------------------------------------------------------------------------------------------------------
- -- 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)
- 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
- -- 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(2, 9)
- elseif player.sub_job == 'NIN' then
- set_macro_page(3, 9)
- elseif player.sub_job == 'THF' then
- set_macro_page(4, 9)
- else
- set_macro_page(1, 9)
- end
- end
- function job_precast(spell, action, spellMap, eventArgs)
- if string.find(spell.english,'Maneuver') then
- if spell.english ~= Mane[ManeRound]..' Maneuver' and windower.ffxi.get_ability_recasts()[210] and not buffactive.amnesia then
- cancel_spell()
- send_command('input /ja "'..Mane[ManeRound]..' Maneuver" <me>')
- else
- return
- end
- end
- end
- function job_aftercast(spell, action, spellMap, eventArgs)
- if string.find(spell.english,'Maneuver') then
- if ManeRound == 1 then
- ManeRound = 2
- elseif ManeRound == 2 then
- ManeRound = 3
- else
- ManeRound = 1
- end
- Burden = Burden +15
- elseif spell.english == "Cooldown" then
- Burden = round(Burden/2)
- end
- end
- fps = 1
- sec = 0
- oldtiming = os.time()
- windower.register_event('prerender', function()
- if fps < 50 then
- fps = fps +1
- else
- fps = 1
- end
- if fps == 1 then
- timing = os.time()
- if(timing-oldtiming > 3) then
- if Burden > 0 then
- Burden = Burden -1
- end
- oldtiming = os.time()
- end
- --- AUTOMANEUVER
- --if not buffactive[Mane[1]..' Maneuver'] and autos then
- -- add_to_chat(204,"Maneuver lost")
- -- send_command('input /ja "Fire Maneuver" <me>')
- --elseif not buffactive[Mane[2]..' Maneuver'] and autos then
- -- add_to_chat(204,"Maneuver lost")
- -- send_command('input /ja "Fire Maneuver" <me>')
- --elseif not buffactive[Mane[2]..' Maneuver'] and autos then
- -- add_to_chat(204,"Maneuver lost")
- -- send_command('input /ja "Fire Maneuver" <me>')
- --end
- refresh()
- end
- end)
- choosing = false
- wchoos = 0
- windower.register_event('chat message', function(original, sender, mode, gm)
- local match
- if sender == player.name then
- if original == "man" or original == "Man" or original == "Maneuver" or original == "maneuver" then
- if ManeRound == 1 and windower.ffxi.get_ability_recasts()[210] and not buffactive.amnesia then
- send_command('input /ja "'..Mane[1]..' Maneuver" <me>')
- elseif ManeRound == 2 and windower.ffxi.get_ability_recasts()[210] and not buffactive.amnesia then
- send_command('input /ja "'..Mane[2]..' Maneuver" <me>')
- elseif ManeRound == 3 and windower.ffxi.get_ability_recasts()[210] and not buffactive.amnesia then
- send_command('input /ja "'..Mane[3]..' Maneuver" <me>')
- end
- elseif original == "1" and not choosing then
- wchoos = 1
- add_to_chat(204,"Choose your First maneuver :")
- choosing = true
- elseif original == "2" and not choosing then
- wchoos = 2
- add_to_chat(204,"Choose your Second maneuver :")
- choosing = true
- elseif original == "3" and not choosing then
- wchoos = 3
- add_to_chat(204,"Choose your Third maneuver :")
- choosing = true
- elseif choosing then
- if TypeM:contains(original) then
- add_to_chat(204,""..original.." Maneuver choosed")
- Mane[wchoos] = original
- wchoos = 0
- choosing = false
- end
- elseif original == "start" then
- autos= true
- add_to_chat(204,"AutoManeuver started")
- print(autos)
- elseif original == "stop" then
- autos= false
- add_to_chat(204,"AutoManeuver stoped")
- else
- comd = string.split(original, ",")
- for i=1, 3, 1 do
- if TypeM:contains(comd[i]) then
- add_to_chat(204,"Maneuver "..i.." = "..comd[i].."")
- Mane[i] = comd[i]
- end
- end
- end
- end
- return sender, mode, gm
- end)
- function round(num, dec)
- local mult = 10^(dec or 0)
- return math.floor(num * mult + 0.5) / mult
- end
- RWSTrigger = S{"Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
- MWSTrigger = S{"Slapstick", "Knockout", "Chimera Ripper", "String Clipper", "Cannibal Blade", "Bone Crusher", "String Shredder"}
- HPWSTrigger = S{"Magic Mortar"}
- --- Delve Assistant
- windower.register_event('incoming text', function(original, modified, mode)
- local match
- -- AutoWS trigger
- match = original:match('Genta readies ([%s%w]+)%.')
- if RWSTrigger:contains(match) then
- equip(sets.midcast.Pet.WeaponSkill)
- add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Genta is Range WSing ] *-*-*-*-*-*-*-*-*')
- elseif MWSTrigger:contains(match) then
- equip(sets.midcast.Pet.WeaponSkill)
- add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Genta is Melee WSing ] *-*-*-*-*-*-*-*-*')
- elseif HPWSTrigger:contains(match) then
- equip(sets.midcast.Pet.WeaponSkill)
- add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Genta is Magic Mortaring ] *-*-*-*-*-*-*-*-*')
- end
- return modified, mode
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement