|
I could use some help with a Gearswap LUA.
Lakshmi.Zyphos
Serveur: Lakshmi
Game: FFXI
Posts: 70
By Lakshmi.Zyphos 2014-10-15 18:39:20
Right. Decided to come back (Once again!) and I've found that spellcast isn't a thing anymore. While painfully trying to navigate a whole new scripting language, I finally went through and edited my own outta one of Mote's. However, this:
Code sets.midcast['Blue Magic'].SkillBasedBuff = {ammo="Mavi Tathlum",
head="Mirage Keffiyeh +1",neck="Mavi Scarf"
body="",hands="",ring1"",ring2"",
back="",legs="Mavi Tayt +2",feet=""}
Gives back
" '}' expected (to close '{' at line 360) near 'body'."
The error seems to be on line 362. I've no idea what could be causing it.
The entire file, if it might help. Pastebin
I apologize if this isn't the right place to post this, but I've been outta the FFXI loop for quite awhile.
Lakshmi.Byrth
VIP
Serveur: Lakshmi
Game: FFXI
Posts: 6137
By Lakshmi.Byrth 2014-10-15 18:42:13
You need to put a comma after "Mavi Scarf"
[+]
By Selinah 2014-10-15 18:44:10
I notice you are missing the , after "Mavi Scarf" on the second line. Each piece of gear needs to have a , separating them. The last piece of gear listed doesn't need a ,
[+]
Lakshmi.Zyphos
Serveur: Lakshmi
Game: FFXI
Posts: 70
By Lakshmi.Zyphos 2014-10-15 18:44:28
Sigh. Thanks for the quick reply. Cannot believe I missed that.
Lakshmi.Zyphos
Serveur: Lakshmi
Game: FFXI
Posts: 70
By Lakshmi.Zyphos 2014-10-15 20:13:46
Figured I'd just bump this instead of making a new thread. Whenever I cast a spell, or use a WS, or do just about anything that makes me switch sets, I don't switch back to the correct set when I'm finished. So I'll WS and then be TPing in my WS set afterwords. Is there a way to force a set change via a macro?
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2014-10-15 20:14:47
Figured I'd just bump this instead of making a new thread. Whenever I cast a spell, or use a WS, or do just about anything that makes me switch sets, I don't switch back to the correct set when I'm finished. So I'll WS and then be TPing in my WS set afterwords. Is there a way to force a set change via a macro?
/console gs equip setname
[+]
Lakshmi.Zyphos
Serveur: Lakshmi
Game: FFXI
Posts: 70
By Lakshmi.Zyphos 2014-10-15 20:22:46
Thanks. Is there a way to make the script check what state I'm currently in and switch to that?
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2014-10-15 20:52:33
Thanks. Is there a way to make the script check what state I'm currently in and switch to that?
Try..
/console gs EquipSet, should equip whatever set you should be in for your state.
or if your melee set is like ~
Code elseif new == 'Engaged' then
equipSet = sets.TP
and your Set.tp is controlled by buffs / weapon / acc index you can just do
/console gs equip sets.tp
if you dual box and you're concerned it wont do this normally you can also do this!
Code if player.tp < 999 and player.status == 'Engaged' then Equipset
This would then automatically check your set everytime you hit something and your tp is below 999 and would automatically correct it for you.
Another method would be...
Code function aftercast(spell,action)
if spell.type == "WeaponSkill" then
send_command('wait 0.3;gs EquipSet')
end
Necro Bump Detected!
[337 days between previous and next post]
Shiva.Paulu
Serveur: Shiva
Game: FFXI
Posts: 776
By Shiva.Paulu 2015-09-17 20:31:06
When in instanced zones such as Sinister Reign my gearswap lags horribly. I end up having blood pacts execute in precast gear and end up in midcast gear after it's done. Does anyone know why? It happens very inconsistently. It will even happen if I enter Legion or Salvage solo that's how I narrowed it down to instances.
my smn lua i borrowed from another post: Code
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--
-- Also, you'll need the Shortcuts addon to handle the auto-targetting of the custom pact commands.
--[[
Custom commands:
gs c petweather
Automatically casts the storm appropriate for the current avatar, if possible.
gs c siphon
Automatically run the process to: dismiss the current avatar; cast appropriate
weather; summon the appropriate spirit; Elemental Siphon; release the spirit;
and re-summon the avatar.
Will not cast weather you do not have access to.
Will not re-summon the avatar if one was not out in the first place.
Will not release the spirit if it was out before the command was issued.
gs c pact [PactType]
Attempts to use the indicated pact type for the current avatar.
PactType can be one of:
cure
curaga
buffOffense
buffDefense
buffSpecial
debuff1
debuff2
sleep
nuke2
nuke4
bp70
bp75 (merits and lvl 75-80 pacts)
astralflow
--]]
-- Initialization function for this job file.
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()
state.Buff["Avatar's Favor"] = buffactive["Avatar's Favor"] or false
state.Buff["Astral Conduit"] = buffactive["Astral Conduit"] or false
spirits = S{"LightSpirit", "DarkSpirit", "FireSpirit", "EarthSpirit", "WaterSpirit", "AirSpirit", "IceSpirit", "ThunderSpirit"}
avatars = S{"Carbuncle", "Fenrir", "Diabolos", "Ifrit", "Titan", "Leviathan", "Garuda", "Shiva", "Ramuh", "Odin", "Alexander", "Cait Sith"}
magicalRagePacts = S{
'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgment Bolt','Searing Light','Howling Moon','Ruinous Omen',
'Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II',
'Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV',
'Thunderspark','Burning Strike','Meteorite','Nether Blast','Flaming Crush',
'Meteor Strike','Heavenly Strike','Wind Blade','Geocrush','Grand Fall','Thunderstorm',
'Holy Mist','Lunar Bay','Night Terror','Level ? Holy'}
pacts = {}
pacts.cure = {['Carbuncle']='Healing Ruby'}
pacts.curaga = {['Carbuncle']='Healing Ruby II', ['Garuda']='Whispering Wind', ['Leviathan']='Spring Water', ['Shiva']='Sleepga',
['Cait Sith']='Mewing Lullaby', ['Ramuh']='Thunderspark', ['Fenrir']='Heavenward Howl',['Diabolos']='Somnolence'}
pacts.buff1 = {['Carbuncle']='Shining Ruby', ['Ifrit']='Crimson Howl', ['Garuda']='Hastega II', ['Ramuh']='Rolling Thunder', ['Cait Sith']='Mewing Lullaby',
['Fenrir']='Ecliptic Growl', ['Shiva']='Crystal Blessing', ['Titan']='Earthen Ward', ['Diabolos']='Dream Shroud', ['Leviathan']='Soothing Current'}
pacts.buff2 = {['Carbuncle']='Pacifying Ruby', ['Shiva']='Frost Armor', ['Garuda']='Aerial Armor', ['Titan']='Earthen Armor',
['Ramuh']='Lightning Armor', ['Fenrir']='Ecliptic Howl', ['Diabolos']='Night Terror', ['Cait Sith']='Reraise II',
['Shiva']='Frost Armor', ['Ifrit']='Inferno Howl',['Leviathan']='Slowga'}
pacts.debuff = {['Shiva']='Diamond Storm', ['Ramuh']='Shock Squall', ['Leviathan']='Tidal Roar', ['Fenrir']='Lunar Cry',
['Diabolos']='Pavor Nocturnus', ['Cait Sith']='Eerie Eye', ['Carbuncle']='Soothing Ruby', ['Titan']='Crag Throw',
['Ifrit']='Conflag Strike', ['Garuda']='Fleet Wind'}
pacts.sleep = {['Shiva']='Sleepga', ['Diabolos']='Nightmare', ['Cait Sith']='Mewing Lullaby', ['Fenrir']='Lunar Roar'}
pacts.nuke = {['Carbuncle']='Holy Mist',['Ifrit']='Meteor Strike', ['Shiva']='Heavenly Strike', ['Garuda']='Wind Blade', ['Titan']='Geocrush',
['Ramuh']='Thunderstorm', ['Cait Sith']='Level ? Holy', ['Leviathan']='Grand Fall', ['Diabolos']='Nether Blast', ['Fenrir']='Impact'}
pacts.atk = {['Ifrit']='Flaming Crush', ['Shiva']='Rush', ['Garuda']='Predator Claws', ['Titan']='Mountain Buster',
['Ramuh']='Volt Strike', ['Leviathan']='Spinning Dive', ['Carbuncle']='Poison Nails', ['Fenrir']='Eclipse Bite',
['Diabolos']='Blindside',['Cait Sith']='Regal Scratch'}
pacts.astralflow = {['Ifrit']='Inferno', ['Shiva']='Diamond Dust', ['Garuda']='Aerial Blast', ['Titan']='Earthen Fury',
['Ramuh']='Judgment Bolt', ['Leviathan']='Tidal Wave', ['Carbuncle']='Searing Light', ['Fenrir']='Howling Moon',
['Diabolos']='Ruinous Omen', ['Cait Sith']="Altana's Favor"}
-- Wards table for creating custom timers
wards = {}
-- Base duration for ward pacts.
wards.durations = {
['Crimson Howl'] = 60, ['Earthen Armor'] = 60, ['Inferno Howl'] = 60, ['Heavenward Howl'] = 60,
['Rolling Thunder'] = 120, ['Fleet Wind'] = 120,
['Shining Ruby'] = 180, ['Frost Armor'] = 180, ['Lightning Armor'] = 180, ['Ecliptic Growl'] = 180,
['Glittering Ruby'] = 180, ['Hastega II'] = 180, ['Noctoshield'] = 180, ['Ecliptic Howl'] = 180,
['Dream Shroud'] = 180, ['Curing Conduit'] = 180, ['Soothing Current'] = 180, ['Crystal Blessing'] = 180,
-- ['Reraise II'] = 3600
}
-- Icons to use when creating the custom timer.
wards.icons = {
['Earthen Armor'] = 'spells/00299.png', -- 00299 for Titan
['Shining Ruby'] = 'spells/00043.png', -- 00043 for Protect
['Dream Shroud'] = 'spells/00304.png', -- 00304 for Diabolos
['Noctoshield'] = 'spells/00106.png', -- 00106 for Phalanx
['Inferno Howl'] = 'spells/00298.png', -- 00298 for Ifrit
['Hastega'] = 'spells/00358.png', -- 00358 for Hastega
['Rolling Thunder'] = 'spells/00104.png', -- 00358 for Enthunder
['Frost Armor'] = 'spells/00250.png', -- 00250 for Ice Spikes
['Lightning Armor'] = 'spells/00251.png', -- 00251 for Shock Spikes
-- ['Reraise II'] = 'spells/00135.png', -- 00135 for Reraise
['Fleet Wind'] = 'abilities/00074.png', --
}
-- Flags for code to get around the issue of slow skill updates.
wards.flag = false
wards.spell = ''
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('None', 'Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT')
gear.perp_staff = {name="Nirvana"}
select_default_macro_book()
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Precast Sets
--------------------------------------
-- Precast sets to enhance JAs
sets.precast.JA['Astral Flow'] = {head="Glyphic Horn +1"}
sets.precast.JA['Astral Conduit'] = {head="Glyphic Horn +1"}
sets.precast.JA['Elemental Siphon'] = {main="Nirvana",ammo="Esper Stone +1",
head="Con. Horn +1",neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
body="Beck. Doublet +1",hands="Lamassu Mitts +1",ring1="Evoker's Ring",ring2="Fervor Ring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Beck. Spats +1",feet="Beck. Pigaches +1"}
sets.precast.JA['Mana Cede'] = {hands="Beck. Bracers +1"}
-- Pact delay reduction gear
sets.precast.BloodPactWard = {ammo="Seraphicaller",
head="Con. Horn +1",
neck="Empath Necklace", ear1="Gelos Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Fervor Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Incarnation Sash", legs="Enticer's Pants", feet="Helios Boots"}
sets.precast.BloodPactRage = sets.precast.BloodPactWard
-- Fast cast sets for spells
sets.precast.FC = {
head="Nahtirah Hat", neck="Orunmila's Torque",ear2="Loquacious Earring",
body="Marduk's Jubbah +1",hands="Telchine Gloves",ring1="Prolix Ring", ring2="Lebeche Ring",
back="Ogapepo Cape",waist="Witful Belt",legs="Lengo Pants",feet="Chelona Boots +1"}
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {ammo="Seraphicaller",
head="Nahtirah Hat",neck="Fotia Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Count's Garb",hands="Yaoyotl Gloves",ring1="Globidonta Ring",ring2="Strendu Ring",
back="Izdubar Mantle",waist="Fotia Belt",legs="Beck. Spats +1",feet="Umbani BOots"}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Myrkr'] = {ammo="Seraphicaller",
head="Beckoner's Horn +1",neck="Orunmila's Torque",ear1="Loquacious Earring", ear2="Andoaa Earring",
body="Beck. Doublet +1",hands="Beck. Bracers +1",ring1="Evoker's Ring",ring2="Prolix Ring",
back="Conveyance Cape",waist="Mujin Obi",legs="Beck. Spats +1",feet="Beck. Pigaches +1"}
sets.precast.WS['Garland of Bliss'] = {ammo="Seraphicaller",
head="Nahtirah Hat",neck="Fotia Gorget",ear1="Novio Earring",ear2="Friomisi Earring",
body="Count's Garb",hands="Yaoyotl Gloves",ring1="Globidonta Ring",ring2="Strendu Ring",
back="Izdubar Mantle",waist="Fotia Belt",legs="Lengo Pants",feet="Umbani Boots"}
sets.precast.WS[''] = {}
--------------------------------------
-- Midcast sets
--------------------------------------
sets.midcast.FastRecast = {main="Nirvana",ammo="Seraphicaller",
head="Nahtirah Hat", neck="Orunmila's Torque",ear2="Loquacious Earring",
body="Marduk's Jubbah +1",hands="Telchine Gloves",ring1="Prolix Ring",ring2="Lebeche Ring",
back="Ogapepo Cape",waist="Witful Belt",legs="Lengo Pants",feet="Chelona Boots +1"}
sets.midcast.Cure = {ammo="Seraphicaller",
head="Nahtirah Hat", neck="Phalaina Locket", ear2="Roundel Earring",
body="Heka's Kalasiris", hands="Telchine Gloves", ring2="Lebeche Ring",
back="Oretania's Cape", waist="Witful Belt", legs="Nares Trews", feet="Medium's Sabots"}
sets.midcast.Stoneskin = {neck="Stone Gorget",waist="Siegel Sash"}
sets.midcast['Enfeebling Magic'] = {waist="Tarutaru Sash"}
sets.midcast['Elemental Magic'] = {main="Nirvana",sub="Wizzan Grip",
head="Helios Band",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="Count's Garb",hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Acumen Ring",
back="Izdubar Mantle",waist="Eschan Stone",legs="Lengo Pants",feet="Umbani Boots"}
sets.midcast['Dark Magic'] = {main="Nirvana",sub="Wizzan Grip",
head="Nahtirah Hat",neck="Aesir Torque",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Excelsis Ring",ring2="Sangoma Ring",
waist="Fuchi-no-Obi",legs="Bokwus Slops",feet="Bokwus Boots"}
-- Avatar pact sets. All pacts are Ability type.
sets.midcast.Pet.BloodPactWard = {main="Nirvana",ammo="Seraphicaller",
head="Con. Horn +1",neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
body="Beck. Doublet +1",hands="Lamassu Mitts +1",ring1="Evoker's Ring",ring2="Globidonta Ring",
back="Conveyance Cape", waist="Lucidity Sash",legs="Beck. Spats +1", feet="Apogee Pumps"}
sets.midcast.Pet.DebuffBloodPactWard = {main="Nirvana",ammo="Seraphicaller",
head="Con. Horn +1",neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
body="Beck. Doublet +1",hands="Lamassu Mitts +1",ring1="Evoker's Ring",ring2="Globidonta Ring",
back="Conveyance Cape", waist="Lucidity Sash",legs="Beck. Spats +1", feet="Apogee Pumps"}
sets.midcast.Pet.DebuffBloodPactWard.Acc = sets.midcast.Pet.DebuffBloodPactWard
sets.midcast.Pet.PhysicalBloodPactRage = {main="Nirvana",ammo="Seraphicaller",
head="Helios Band", neck="Empath Necklace", ear1="Gelos Earring", ear2="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Fervor Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Incarnation Sash", legs="Apogee Slacks", feet="Helios Boots"}
sets.midcast.Pet.PhysicalBloodPactRage.Acc = sets.midcast.Pet.PhysicalBloodPactRage
sets.midcast.Pet.MagicalBloodPactRage = {main="Espiritus",ammo="Seraphicaller",
head="Helios Band", neck="Eidolon Pendant +1", ear1="Gelos Earring", ear2="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Evoker's Ring", ring2="Fervor Ring",
back="Conveyance Cape", waist="Caller's Sash", legs="Enticer's Pants", feet="Helios Boots"}
sets.midcast.Pet.MagicalBloodPactRage.Acc = sets.midcast.Pet.MagicalBloodPactRage
-- Spirits cast magic spells, which can be identified in standard ways.
sets.midcast.Pet.WhiteMagic = {legs="Beck. Spats +1"}
sets.midcast.Pet['Elemental Magic'] = set_combine(sets.midcast.Pet.BloodPactRage, {legs="Beck. Spats +1"})
sets.midcast.Pet['Elemental Magic'].Resistant = {}
sets.midcast.Pet['Flaming Crush'] = set_combine(sets.midcast.Pet.BloodPactRage, {main="Nirvana",ammo="Seraphicaller",
head="Helios Band", neck="Eidolon Pendant +1", ear2="Gelos Earring", ear1="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Fervor Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Incarnation Sash", legs="Apogee Slacks", feet="Helios Boots"})
sets.midcast.Pet['Nether Blast'] = set_combine(sets.midcast.Pet.BloodPactRage, {main="Espiritus",ammo="Seraphicaller",
head="Helios Band", neck="Eidolon Pendant +1", ear2="Gelos Earring", ear1="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Evoker's Ring", ring2="Globidonta Ring",
back="Conveyance Cape", waist="Caller's Sash", legs="Helios Spats", feet="Helios Boots"})
sets.midcast.Pet['Thunderspark'] = set_combine(sets.midcast.Pet.BloodPactRage, {main="Espiritus",ammo="Seraphicaller",
head="Helios Band", neck="Eidolon Pendant +1", ear2="Gelos Earring", ear1="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Evoker's Ring", ring2="Globidonta Ring",
back="Conveyance Cape", waist="Caller's Sash", legs="Helios Spats", feet="Helios Boots"})
--------------------------------------
-- Idle/resting/defense/etc sets
--------------------------------------
-- Resting sets
sets.resting = {main="Chatoyant Staff",ammo="Mana Ampulla",
head="Beckoner's Horn +1", neck="Eidolon Pendant +1", ear1="Relaxing Earring", ear2="Locuaq. Earring",
body="Shomonjijoe +1",hands="Asteria Mitts +1", ring1="Dark Ring", ring2="Defending Ring",
back="Felicitas Cape +1", waist="Austerity Belt", legs="Assid. Pants +1", feet="Chelona Boots +1"}
-- Idle sets
sets.idle = {main="Nirvana",ammo="Seraphicaller",
head="Beckoner's Horn +1",neck="Twilight Torque",ear1="Colossus's Earring",ear2="Evans Earring",
body="Shomonjijoe +1",hands="Asteria Mitts +1",ring1="Dark Ring",ring2="Defending Ring",
back="Umbra Cape",waist="Fucho-no-Obi",legs="Assid. Pants +1",feet="Herald's Gaiters"}
sets.idle.PDT = {main="Terra's Staff",ammo="Seraphicaller",
neck="Twilight Torque", ear1="Colosuss's Earring",
hands="Spurrina Gages", ring1="Dark Ring", ring2="Defending Ring",
back="Umbra Cape", feet="Plumb Boots"}
-- perp costs:
-- spirits: 7
-- carby: 11 (5 with mitts)
-- fenrir: 13
-- others: 15
-- avatar's favor: -4/tick
-- Max useful -perp gear is 1 less than the perp cost (can't be reduced below 1)
-- Aim for -14 perp, and refresh in other slots.
-- -perp gear:
-- Gridarvor: -5
-- Glyphic Horn +1: -4
-- Beck. Doublet +1/Glyphic Doublet +1: -4
-- Evoker's Ring: -1
-- Convoker's Pigaches: -4
-- total: -18
-- Can make due without either the head or the body, and use +refresh items in those slots.
sets.idle.Avatar = {main="Nirvana", sub="Oneiros Grip",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Rimeice Earring", ear2="Andoaa Earring",
body="Shomonjijoe +1", hands="Asteria Mitts +1", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Assid. Pants +1", feet="Herald's Gaiters"}
sets.idle.PDT.Avatar = {main="Nirvana", sub="Oneiros Grip",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Rimeice Earring", ear2="Andoaa Earring",
body="Shomonjijoe +1", hands="Adhara Gages", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Moepapa Stone", legs="Assid. Pants +1", feet="Con. Pigaches +1"}
sets.idle.Spirit = {main="Nirvana",sub="Vox",ammo="Seraphicaller",
body="Beck. Doublet +1", hands="Lamassu Mitts +1", ring1="Evoker's Ring", ring2="Globidonta Ring",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Glyphic Spats", feet="Apogee Pumps"}
sets.idle.Town = {main="Nirvana", sub="Oneiros Grip",
head="Beckoner's Horn +1", neck="Twilight Torque", ear1="Rimeice Earring", ear2="Colossus's Earring",
body="Shomonjijoe +1", hands="Asteria Mitts +1", ring1="Dark Ring", ring2="Defending Ring",
back="Umbra Cape", waist="Lucidity Sash", legs="Assid. Pants +1", feet="Herald's Gaiters"}
-- Favor uses Caller's Horn instead of Con. Horn +1 for refresh
sets.idle.Avatar.Favor = {main="Nirvana",ammo="Seraphicaller",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Rimeice Earring", ear2="Andoaa Earring",
body="Shomonjijoe +1", hands="Asteria Mitts +1", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Assid. Pants +1",feet="Herald's Gaiters"}
sets.idle.Avatar.Melee = {neck="Empath Necklace",hands="Regimen Mittens",waist="Moepapa Stone",legs="Enticer's Pants",feet="Telchine Pigaches", ear2="Evans Earring", back="Penetrating Cape"}
sets.perp = {main="Nirvana",ammo="Seraphicaller",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Rimeice Earring", ear2="Andoaa Earring",
body="Shomonjijoe +1", hands="Regimen Mittens", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Assid. Pants +1", feet="Con. Pigaches +1"}
-- Caller's Bracer's halve the perp cost after other costs are accounted for.
-- Using -10 (Gridavor, ring, Conv.feet), standard avatars would then cost 5, halved to 2.
-- We can then use Hagondes Coat and end up with the same net MP cost, but significantly better defense.
-- Weather is the same, but we can also use the latent on the pendant to negate the last point lost.
-- sets.perp.Day = {hands="Beck. Bracers +1"}
--sets.perp.Weather = {neck="Caller's Pendant",hands="Beck. Bracers +1"}
-- Carby: Mitts+Conv.feet = 1/tick perp. Everything else should be +refresh
sets.perp.Carbuncle = {main="Nirvana", hands="Asteria Mitts +1"}
sets.perp.CaitSith = {main="Nirvana", hands="Lamassu Mitts +1"}
-- Diabolos's Rope doesn't gain us anything at this time
--sets.perp.Diabolos = {waist="Diabolos's Rope"}
sets.perp.Alexander = {
body="Beck. Doublet +1", hands="Regimen Mittens", ring1="Evoker's Ring", ring2="Fervor Ring",
head="Con. Horn +1", neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Beck. Spats +1", feet="Apogee Pumps"}
sets.perp.Odin = {
body="Beck. Doublet +1", hands="Regimen Mittens", ring1="Evoker's Ring", ring2="Fervor Ring",
head="Con. Horn +1", neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Beck. Spats +1", feet="Apogee Pumps"}
sets.perp.staff_and_grip = {main=gear.perp_staff,sub="Achaq Grip"}
-- Defense sets
sets.defense.PDT = {main="Terra's Staff",
head="Hike Khat",neck="Twilight Torque", ear1="Colosus's Earring",
body="Vrikodara Jupon",hands="Spurrina Gages", ring1="Dark Ring", ring2="Defending Ring",
back="Umbra Cape",legs="Miasmic Pants", feet="Plumb Boots"}
sets.defense.MDT = {
head="Hagondes Hat",neck="Twilight Torque",ear1="Gifted Earring",ear2="Loquacious Earring",
body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Shadow Ring",
back="Umbra Cape",waist="Fucho-no-Obi",legs="Bokwus Slops",feet="Hagondes Sabots"}
sets.Kiting = {feet="Herald's Gaiters"}
sets.latent_refresh = {waist="Fucho-no-obi"}
--------------------------------------
-- Engaged sets
--------------------------------------
-- Normal melee group
sets.engaged = {ammo="Seraphicaller",
head="Beckoner's Horn +1", neck="Empath Necklace", ear1="Bladeborn Earring", ear2="Steelflash Earring",
body="Shomonjijoe +1", hands="Regimen Mittens", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Moepapa Stone", legs="Enticer's Pants", feet="Telchine Pigaches"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- 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 state.Buff['Astral Conduit'] and pet_midaction() then
eventArgs.handled = true
end
end
function job_midcast(spell, action, spellMap, eventArgs)
if state.Buff['Astral Conduit'] and pet_midaction() then
eventArgs.handled = true
end
end
-- Runs when pet completes an action.
function job_pet_aftercast(spell, action, spellMap, eventArgs)
if not spell.interrupted and spell.type == 'BloodPactWard' and spellMap ~= 'DebuffBloodPactWard' then
wards.flag = true
wards.spell = spell.english
send_command('wait 5; gs c reset_ward_flag')
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 state.Buff[buff] ~= nil then
handle_equipping_gear(player.status)
elseif storms:contains(buff) then
handle_equipping_gear(player.status)
end
end
-- Called when the player's pet's status changes.
-- This is also called after pet_change after a pet is released. Check for pet validity.
function job_pet_status_change(newStatus, oldStatus, eventArgs)
if pet.isvalid and not midaction() and not pet_midaction() and (newStatus == 'Engaged' or oldStatus == 'Engaged') then
handle_equipping_gear(player.status, newStatus)
end
end
-- Called when a player gains or loses a pet.
-- pet == pet structure
-- gain == true if the pet was gained, false if it was lost.
function job_pet_change(petparam, gain)
classes.CustomIdleGroups:clear()
if gain then
if avatars:contains(pet.name) then
classes.CustomIdleGroups:append('Avatar')
elseif spirits:contains(pet.name) then
classes.CustomIdleGroups:append('Spirit')
end
else
--select_default_macro_book('reset')
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Custom spell mapping.
function job_get_spell_map(spell)
if spell.type == 'BloodPactRage' then
if magicalRagePacts:contains(spell.english) then
return 'MagicalBloodPactRage'
else
return 'PhysicalBloodPactRage'
end
elseif spell.type == 'BloodPactWard' and spell.target.type == 'MONSTER' then
return 'DebuffBloodPactWard'
end
end
-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
if pet.isvalid then
if pet.element == world.day_element then
idleSet = set_combine(idleSet, sets.perp.Day)
end
if pet.element == world.weather_element then
idleSet = set_combine(idleSet, sets.perp.Weather)
end
if sets.perp[pet.name] then
idleSet = set_combine(idleSet, sets.perp[pet.name])
end
gear.perp_staff.name = elements.perpetuance_staff_of[pet.element]
if gear.perp_staff.name and (player.inventory[gear.perp_staff.name] or player.wardrobe[gear.perp_staff.name]) then
idleSet = set_combine(idleSet, sets.perp.staff_and_grip)
end
if state.Buff["Avatar's Favor"] and avatars:contains(pet.name) then
idleSet = set_combine(idleSet, sets.idle.Avatar.Favor)
end
if pet.status == 'Engaged' then
idleSet = set_combine(idleSet, sets.idle.Avatar.Melee)
end
end
if player.mpp < 51 then
idleSet = set_combine(idleSet, sets.latent_refresh)
end
return idleSet
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)
classes.CustomIdleGroups:clear()
if pet.isvalid then
if avatars:contains(pet.name) then
classes.CustomIdleGroups:append('Avatar')
elseif spirits:contains(pet.name) then
classes.CustomIdleGroups:append('Spirit')
end
end
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
end
-------------------------------------------------------------------------------------------------------------------
-- User self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called for custom player commands.
function job_self_command(cmdParams, eventArgs)
if cmdParams[1]:lower() == 'petweather' then
handle_petweather()
eventArgs.handled = true
elseif cmdParams[1]:lower() == 'siphon' then
handle_siphoning()
eventArgs.handled = true
elseif cmdParams[1]:lower() == 'pact' then
handle_pacts(cmdParams)
eventArgs.handled = true
elseif cmdParams[1] == 'reset_ward_flag' then
wards.flag = false
wards.spell = ''
eventArgs.handled = true
end
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
-- Cast the appopriate storm for the currently summoned avatar, if possible.
function handle_petweather()
if player.sub_job ~= 'SCH' then
add_to_chat(122, "You can not cast storm spells")
return
end
if not pet.isvalid then
add_to_chat(122, "You do not have an active avatar.")
return
end
local element = pet.element
if element == 'Thunder' then
element = 'Lightning'
end
if S{'Light','Dark','Lightning'}:contains(element) then
add_to_chat(122, 'You do not have access to '..elements.storm_of[element]..'.')
return
end
local storm = elements.storm_of[element]
if storm then
send_command('@input /ma "'..elements.storm_of[element]..'" <me>')
else
add_to_chat(123, 'Error: Unknown element ('..tostring(element)..')')
end
end
-- Custom uber-handling of Elemental Siphon
function handle_siphoning()
if areas.Cities:contains(world.area) then
add_to_chat(122, 'Cannot use Elemental Siphon in a city area.')
return
end
local siphonElement
local stormElementToUse
local releasedAvatar
local dontRelease
-- If we already have a spirit out, just use that.
if pet.isvalid and spirits:contains(pet.name) then
siphonElement = pet.element
dontRelease = true
-- If current weather doesn't match the spirit, but the spirit matches the day, try to cast the storm.
if player.sub_job == 'SCH' and pet.element == world.day_element and pet.element ~= world.weather_element then
if not S{'Light','Dark','Lightning'}:contains(pet.element) then
stormElementToUse = pet.element
end
end
-- If we're subbing /sch, there are some conditions where we want to make sure specific weather is up.
-- If current (single) weather is opposed by the current day, we want to change the weather to match
-- the current day, if possible.
elseif player.sub_job == 'SCH' and world.weather_element ~= 'None' then
-- We can override single-intensity weather; leave double weather alone, since even if
-- it's partially countered by the day, it's not worth changing.
if get_weather_intensity() == 1 then
-- If current weather is weak to the current day, it cancels the benefits for
-- siphon. Change it to the day's weather if possible (+0 to +20%), or any non-weak
-- weather if not.
-- If the current weather matches the current avatar's element (being used to reduce
-- perpetuation), don't change it; just accept the penalty on Siphon.
if world.weather_element == elements.weak_to[world.day_element] and
(not pet.isvalid or world.weather_element ~= pet.element) then
-- We can't cast lightning/dark/light weather, so use a neutral element
if S{'Light','Dark','Lightning'}:contains(world.day_element) then
stormElementToUse = 'Wind'
else
stormElementToUse = world.day_element
end
end
end
end
-- If we decided to use a storm, set that as the spirit element to cast.
if stormElementToUse then
siphonElement = stormElementToUse
elseif world.weather_element ~= 'None' and (get_weather_intensity() == 2 or world.weather_element ~= elements.weak_to[world.day_element]) then
siphonElement = world.weather_element
else
siphonElement = world.day_element
end
local command = ''
local releaseWait = 0
if pet.isvalid and avatars:contains(pet.name) then
command = command..'input /pet "Release" <me>;wait 1.1;'
releasedAvatar = pet.name
releaseWait = 10
end
if stormElementToUse then
command = command..'input /ma "'..elements.storm_of[stormElementToUse]..'" <me>;wait 4;'
releaseWait = releaseWait - 4
end
if not (pet.isvalid and spirits:contains(pet.name)) then
command = command..'input /ma "'..elements.spirit_of[siphonElement]..'" <me>;wait 4;'
releaseWait = releaseWait - 4
end
command = command..'input /ja "Elemental Siphon" <me>;'
releaseWait = releaseWait - 1
releaseWait = releaseWait + 0.1
if not dontRelease then
if releaseWait > 0 then
command = command..'wait '..tostring(releaseWait)..';'
else
command = command..'wait 1.1;'
end
command = command..'input /pet "Release" <me>;'
end
if releasedAvatar then
command = command..'wait 1.1;input /ma "'..releasedAvatar..'" <me>'
end
send_command(command)
end
-- Handles executing blood pacts in a generic, avatar-agnostic way.
-- cmdParams is the split of the self-command.
-- gs c [pact] [pacttype]
function handle_pacts(cmdParams)
if areas.Cities:contains(world.area) then
add_to_chat(122, 'You cannot use pacts in town.')
return
end
if not pet.isvalid then
add_to_chat(122,'No avatar currently available. Returning to default macro set.')
select_default_macro_book('reset')
return
end
if spirits:contains(pet.name) then
add_to_chat(122,'Cannot use pacts with spirits.')
return
end
if not cmdParams[2] then
add_to_chat(123,'No pact type given.')
return
end
local pact = cmdParams[2]:lower()
if not pacts[pact] then
add_to_chat(123,'Unknown pact type: '..tostring(pact))
return
end
if pacts[pact][pet.name] then
if pact == 'astralflow' and not buffactive['astral flow'] then
add_to_chat(122,'Cannot use Astral Flow pacts at this time.')
return
end
-- Leave out target; let Shortcuts auto-determine it.
send_command('@input /pet "'..pacts[pact][pet.name]..'"')
else
add_to_chat(122,pet.name..' does not have a pact of type ['..pact..'].')
end
end
-- Event handler for updates to player skill, since we can't rely on skill being
-- correct at pet_aftercast for the creation of custom timers.
windower.raw_register_event('incoming chunk',
function (id)
if id == 0x62 then
if wards.flag then
create_pact_timer(wards.spell)
wards.flag = false
wards.spell = ''
end
end
end)
-- Function to create custom timers using the Timers addon. Calculates ward duration
-- based on player skill and base pact duration (defined in job_setup).
function create_pact_timer(spell_name)
-- Create custom timers for ward pacts.
if wards.durations[spell_name] then
local ward_duration = wards.durations[spell_name]
if ward_duration < 181 then
local skill = player.skills.summoning_magic
if skill > 300 then
skill = skill - 300
--if skill > 200 then skill = 300 end
ward_duration = ward_duration + skill
end
end
local timer_cmd = 'timers c "'..spell_name..'" '..tostring(ward_duration)..' down'
if wards.icons[spell_name] then
timer_cmd = timer_cmd..' '..wards.icons[spell_name]
end
send_command(timer_cmd)
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book(reset)
if reset == 'reset' then
-- lost pet, or tried to use pact when pet is gone
end
-- Default macro set/book
set_macro_page(2, 1)
end
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-09-18 08:39:15
When in instanced zones such as Sinister Reign my gearswap lags horribly. I end up having blood pacts execute in precast gear and end up in midcast gear after it's done. Does anyone know why? It happens very inconsistently. It will even happen if I enter Legion or Salvage solo that's how I narrowed it down to instances.
my smn lua i borrowed from another post: Code
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--
-- Also, you'll need the Shortcuts addon to handle the auto-targetting of the custom pact commands.
--[[
Custom commands:
gs c petweather
Automatically casts the storm appropriate for the current avatar, if possible.
gs c siphon
Automatically run the process to: dismiss the current avatar; cast appropriate
weather; summon the appropriate spirit; Elemental Siphon; release the spirit;
and re-summon the avatar.
Will not cast weather you do not have access to.
Will not re-summon the avatar if one was not out in the first place.
Will not release the spirit if it was out before the command was issued.
gs c pact [PactType]
Attempts to use the indicated pact type for the current avatar.
PactType can be one of:
cure
curaga
buffOffense
buffDefense
buffSpecial
debuff1
debuff2
sleep
nuke2
nuke4
bp70
bp75 (merits and lvl 75-80 pacts)
astralflow
--]]
-- Initialization function for this job file.
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()
state.Buff["Avatar's Favor"] = buffactive["Avatar's Favor"] or false
state.Buff["Astral Conduit"] = buffactive["Astral Conduit"] or false
spirits = S{"LightSpirit", "DarkSpirit", "FireSpirit", "EarthSpirit", "WaterSpirit", "AirSpirit", "IceSpirit", "ThunderSpirit"}
avatars = S{"Carbuncle", "Fenrir", "Diabolos", "Ifrit", "Titan", "Leviathan", "Garuda", "Shiva", "Ramuh", "Odin", "Alexander", "Cait Sith"}
magicalRagePacts = S{
'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgment Bolt','Searing Light','Howling Moon','Ruinous Omen',
'Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II',
'Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV',
'Thunderspark','Burning Strike','Meteorite','Nether Blast','Flaming Crush',
'Meteor Strike','Heavenly Strike','Wind Blade','Geocrush','Grand Fall','Thunderstorm',
'Holy Mist','Lunar Bay','Night Terror','Level ? Holy'}
pacts = {}
pacts.cure = {['Carbuncle']='Healing Ruby'}
pacts.curaga = {['Carbuncle']='Healing Ruby II', ['Garuda']='Whispering Wind', ['Leviathan']='Spring Water', ['Shiva']='Sleepga',
['Cait Sith']='Mewing Lullaby', ['Ramuh']='Thunderspark', ['Fenrir']='Heavenward Howl',['Diabolos']='Somnolence'}
pacts.buff1 = {['Carbuncle']='Shining Ruby', ['Ifrit']='Crimson Howl', ['Garuda']='Hastega II', ['Ramuh']='Rolling Thunder', ['Cait Sith']='Mewing Lullaby',
['Fenrir']='Ecliptic Growl', ['Shiva']='Crystal Blessing', ['Titan']='Earthen Ward', ['Diabolos']='Dream Shroud', ['Leviathan']='Soothing Current'}
pacts.buff2 = {['Carbuncle']='Pacifying Ruby', ['Shiva']='Frost Armor', ['Garuda']='Aerial Armor', ['Titan']='Earthen Armor',
['Ramuh']='Lightning Armor', ['Fenrir']='Ecliptic Howl', ['Diabolos']='Night Terror', ['Cait Sith']='Reraise II',
['Shiva']='Frost Armor', ['Ifrit']='Inferno Howl',['Leviathan']='Slowga'}
pacts.debuff = {['Shiva']='Diamond Storm', ['Ramuh']='Shock Squall', ['Leviathan']='Tidal Roar', ['Fenrir']='Lunar Cry',
['Diabolos']='Pavor Nocturnus', ['Cait Sith']='Eerie Eye', ['Carbuncle']='Soothing Ruby', ['Titan']='Crag Throw',
['Ifrit']='Conflag Strike', ['Garuda']='Fleet Wind'}
pacts.sleep = {['Shiva']='Sleepga', ['Diabolos']='Nightmare', ['Cait Sith']='Mewing Lullaby', ['Fenrir']='Lunar Roar'}
pacts.nuke = {['Carbuncle']='Holy Mist',['Ifrit']='Meteor Strike', ['Shiva']='Heavenly Strike', ['Garuda']='Wind Blade', ['Titan']='Geocrush',
['Ramuh']='Thunderstorm', ['Cait Sith']='Level ? Holy', ['Leviathan']='Grand Fall', ['Diabolos']='Nether Blast', ['Fenrir']='Impact'}
pacts.atk = {['Ifrit']='Flaming Crush', ['Shiva']='Rush', ['Garuda']='Predator Claws', ['Titan']='Mountain Buster',
['Ramuh']='Volt Strike', ['Leviathan']='Spinning Dive', ['Carbuncle']='Poison Nails', ['Fenrir']='Eclipse Bite',
['Diabolos']='Blindside',['Cait Sith']='Regal Scratch'}
pacts.astralflow = {['Ifrit']='Inferno', ['Shiva']='Diamond Dust', ['Garuda']='Aerial Blast', ['Titan']='Earthen Fury',
['Ramuh']='Judgment Bolt', ['Leviathan']='Tidal Wave', ['Carbuncle']='Searing Light', ['Fenrir']='Howling Moon',
['Diabolos']='Ruinous Omen', ['Cait Sith']="Altana's Favor"}
-- Wards table for creating custom timers
wards = {}
-- Base duration for ward pacts.
wards.durations = {
['Crimson Howl'] = 60, ['Earthen Armor'] = 60, ['Inferno Howl'] = 60, ['Heavenward Howl'] = 60,
['Rolling Thunder'] = 120, ['Fleet Wind'] = 120,
['Shining Ruby'] = 180, ['Frost Armor'] = 180, ['Lightning Armor'] = 180, ['Ecliptic Growl'] = 180,
['Glittering Ruby'] = 180, ['Hastega II'] = 180, ['Noctoshield'] = 180, ['Ecliptic Howl'] = 180,
['Dream Shroud'] = 180, ['Curing Conduit'] = 180, ['Soothing Current'] = 180, ['Crystal Blessing'] = 180,
-- ['Reraise II'] = 3600
}
-- Icons to use when creating the custom timer.
wards.icons = {
['Earthen Armor'] = 'spells/00299.png', -- 00299 for Titan
['Shining Ruby'] = 'spells/00043.png', -- 00043 for Protect
['Dream Shroud'] = 'spells/00304.png', -- 00304 for Diabolos
['Noctoshield'] = 'spells/00106.png', -- 00106 for Phalanx
['Inferno Howl'] = 'spells/00298.png', -- 00298 for Ifrit
['Hastega'] = 'spells/00358.png', -- 00358 for Hastega
['Rolling Thunder'] = 'spells/00104.png', -- 00358 for Enthunder
['Frost Armor'] = 'spells/00250.png', -- 00250 for Ice Spikes
['Lightning Armor'] = 'spells/00251.png', -- 00251 for Shock Spikes
-- ['Reraise II'] = 'spells/00135.png', -- 00135 for Reraise
['Fleet Wind'] = 'abilities/00074.png', --
}
-- Flags for code to get around the issue of slow skill updates.
wards.flag = false
wards.spell = ''
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('None', 'Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT')
gear.perp_staff = {name="Nirvana"}
select_default_macro_book()
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Precast Sets
--------------------------------------
-- Precast sets to enhance JAs
sets.precast.JA['Astral Flow'] = {head="Glyphic Horn +1"}
sets.precast.JA['Astral Conduit'] = {head="Glyphic Horn +1"}
sets.precast.JA['Elemental Siphon'] = {main="Nirvana",ammo="Esper Stone +1",
head="Con. Horn +1",neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
body="Beck. Doublet +1",hands="Lamassu Mitts +1",ring1="Evoker's Ring",ring2="Fervor Ring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Beck. Spats +1",feet="Beck. Pigaches +1"}
sets.precast.JA['Mana Cede'] = {hands="Beck. Bracers +1"}
-- Pact delay reduction gear
sets.precast.BloodPactWard = {ammo="Seraphicaller",
head="Con. Horn +1",
neck="Empath Necklace", ear1="Gelos Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Fervor Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Incarnation Sash", legs="Enticer's Pants", feet="Helios Boots"}
sets.precast.BloodPactRage = sets.precast.BloodPactWard
-- Fast cast sets for spells
sets.precast.FC = {
head="Nahtirah Hat", neck="Orunmila's Torque",ear2="Loquacious Earring",
body="Marduk's Jubbah +1",hands="Telchine Gloves",ring1="Prolix Ring", ring2="Lebeche Ring",
back="Ogapepo Cape",waist="Witful Belt",legs="Lengo Pants",feet="Chelona Boots +1"}
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {ammo="Seraphicaller",
head="Nahtirah Hat",neck="Fotia Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Count's Garb",hands="Yaoyotl Gloves",ring1="Globidonta Ring",ring2="Strendu Ring",
back="Izdubar Mantle",waist="Fotia Belt",legs="Beck. Spats +1",feet="Umbani BOots"}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Myrkr'] = {ammo="Seraphicaller",
head="Beckoner's Horn +1",neck="Orunmila's Torque",ear1="Loquacious Earring", ear2="Andoaa Earring",
body="Beck. Doublet +1",hands="Beck. Bracers +1",ring1="Evoker's Ring",ring2="Prolix Ring",
back="Conveyance Cape",waist="Mujin Obi",legs="Beck. Spats +1",feet="Beck. Pigaches +1"}
sets.precast.WS['Garland of Bliss'] = {ammo="Seraphicaller",
head="Nahtirah Hat",neck="Fotia Gorget",ear1="Novio Earring",ear2="Friomisi Earring",
body="Count's Garb",hands="Yaoyotl Gloves",ring1="Globidonta Ring",ring2="Strendu Ring",
back="Izdubar Mantle",waist="Fotia Belt",legs="Lengo Pants",feet="Umbani Boots"}
sets.precast.WS[''] = {}
--------------------------------------
-- Midcast sets
--------------------------------------
sets.midcast.FastRecast = {main="Nirvana",ammo="Seraphicaller",
head="Nahtirah Hat", neck="Orunmila's Torque",ear2="Loquacious Earring",
body="Marduk's Jubbah +1",hands="Telchine Gloves",ring1="Prolix Ring",ring2="Lebeche Ring",
back="Ogapepo Cape",waist="Witful Belt",legs="Lengo Pants",feet="Chelona Boots +1"}
sets.midcast.Cure = {ammo="Seraphicaller",
head="Nahtirah Hat", neck="Phalaina Locket", ear2="Roundel Earring",
body="Heka's Kalasiris", hands="Telchine Gloves", ring2="Lebeche Ring",
back="Oretania's Cape", waist="Witful Belt", legs="Nares Trews", feet="Medium's Sabots"}
sets.midcast.Stoneskin = {neck="Stone Gorget",waist="Siegel Sash"}
sets.midcast['Enfeebling Magic'] = {waist="Tarutaru Sash"}
sets.midcast['Elemental Magic'] = {main="Nirvana",sub="Wizzan Grip",
head="Helios Band",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="Count's Garb",hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Acumen Ring",
back="Izdubar Mantle",waist="Eschan Stone",legs="Lengo Pants",feet="Umbani Boots"}
sets.midcast['Dark Magic'] = {main="Nirvana",sub="Wizzan Grip",
head="Nahtirah Hat",neck="Aesir Torque",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Excelsis Ring",ring2="Sangoma Ring",
waist="Fuchi-no-Obi",legs="Bokwus Slops",feet="Bokwus Boots"}
-- Avatar pact sets. All pacts are Ability type.
sets.midcast.Pet.BloodPactWard = {main="Nirvana",ammo="Seraphicaller",
head="Con. Horn +1",neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
body="Beck. Doublet +1",hands="Lamassu Mitts +1",ring1="Evoker's Ring",ring2="Globidonta Ring",
back="Conveyance Cape", waist="Lucidity Sash",legs="Beck. Spats +1", feet="Apogee Pumps"}
sets.midcast.Pet.DebuffBloodPactWard = {main="Nirvana",ammo="Seraphicaller",
head="Con. Horn +1",neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
body="Beck. Doublet +1",hands="Lamassu Mitts +1",ring1="Evoker's Ring",ring2="Globidonta Ring",
back="Conveyance Cape", waist="Lucidity Sash",legs="Beck. Spats +1", feet="Apogee Pumps"}
sets.midcast.Pet.DebuffBloodPactWard.Acc = sets.midcast.Pet.DebuffBloodPactWard
sets.midcast.Pet.PhysicalBloodPactRage = {main="Nirvana",ammo="Seraphicaller",
head="Helios Band", neck="Empath Necklace", ear1="Gelos Earring", ear2="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Fervor Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Incarnation Sash", legs="Apogee Slacks", feet="Helios Boots"}
sets.midcast.Pet.PhysicalBloodPactRage.Acc = sets.midcast.Pet.PhysicalBloodPactRage
sets.midcast.Pet.MagicalBloodPactRage = {main="Espiritus",ammo="Seraphicaller",
head="Helios Band", neck="Eidolon Pendant +1", ear1="Gelos Earring", ear2="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Evoker's Ring", ring2="Fervor Ring",
back="Conveyance Cape", waist="Caller's Sash", legs="Enticer's Pants", feet="Helios Boots"}
sets.midcast.Pet.MagicalBloodPactRage.Acc = sets.midcast.Pet.MagicalBloodPactRage
-- Spirits cast magic spells, which can be identified in standard ways.
sets.midcast.Pet.WhiteMagic = {legs="Beck. Spats +1"}
sets.midcast.Pet['Elemental Magic'] = set_combine(sets.midcast.Pet.BloodPactRage, {legs="Beck. Spats +1"})
sets.midcast.Pet['Elemental Magic'].Resistant = {}
sets.midcast.Pet['Flaming Crush'] = set_combine(sets.midcast.Pet.BloodPactRage, {main="Nirvana",ammo="Seraphicaller",
head="Helios Band", neck="Eidolon Pendant +1", ear2="Gelos Earring", ear1="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Fervor Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Incarnation Sash", legs="Apogee Slacks", feet="Helios Boots"})
sets.midcast.Pet['Nether Blast'] = set_combine(sets.midcast.Pet.BloodPactRage, {main="Espiritus",ammo="Seraphicaller",
head="Helios Band", neck="Eidolon Pendant +1", ear2="Gelos Earring", ear1="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Evoker's Ring", ring2="Globidonta Ring",
back="Conveyance Cape", waist="Caller's Sash", legs="Helios Spats", feet="Helios Boots"})
sets.midcast.Pet['Thunderspark'] = set_combine(sets.midcast.Pet.BloodPactRage, {main="Espiritus",ammo="Seraphicaller",
head="Helios Band", neck="Eidolon Pendant +1", ear2="Gelos Earring", ear1="Esper Earring",
body="Con. Doublet +1", hands="Helios Gloves", ring1="Evoker's Ring", ring2="Globidonta Ring",
back="Conveyance Cape", waist="Caller's Sash", legs="Helios Spats", feet="Helios Boots"})
--------------------------------------
-- Idle/resting/defense/etc sets
--------------------------------------
-- Resting sets
sets.resting = {main="Chatoyant Staff",ammo="Mana Ampulla",
head="Beckoner's Horn +1", neck="Eidolon Pendant +1", ear1="Relaxing Earring", ear2="Locuaq. Earring",
body="Shomonjijoe +1",hands="Asteria Mitts +1", ring1="Dark Ring", ring2="Defending Ring",
back="Felicitas Cape +1", waist="Austerity Belt", legs="Assid. Pants +1", feet="Chelona Boots +1"}
-- Idle sets
sets.idle = {main="Nirvana",ammo="Seraphicaller",
head="Beckoner's Horn +1",neck="Twilight Torque",ear1="Colossus's Earring",ear2="Evans Earring",
body="Shomonjijoe +1",hands="Asteria Mitts +1",ring1="Dark Ring",ring2="Defending Ring",
back="Umbra Cape",waist="Fucho-no-Obi",legs="Assid. Pants +1",feet="Herald's Gaiters"}
sets.idle.PDT = {main="Terra's Staff",ammo="Seraphicaller",
neck="Twilight Torque", ear1="Colosuss's Earring",
hands="Spurrina Gages", ring1="Dark Ring", ring2="Defending Ring",
back="Umbra Cape", feet="Plumb Boots"}
-- perp costs:
-- spirits: 7
-- carby: 11 (5 with mitts)
-- fenrir: 13
-- others: 15
-- avatar's favor: -4/tick
-- Max useful -perp gear is 1 less than the perp cost (can't be reduced below 1)
-- Aim for -14 perp, and refresh in other slots.
-- -perp gear:
-- Gridarvor: -5
-- Glyphic Horn +1: -4
-- Beck. Doublet +1/Glyphic Doublet +1: -4
-- Evoker's Ring: -1
-- Convoker's Pigaches: -4
-- total: -18
-- Can make due without either the head or the body, and use +refresh items in those slots.
sets.idle.Avatar = {main="Nirvana", sub="Oneiros Grip",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Rimeice Earring", ear2="Andoaa Earring",
body="Shomonjijoe +1", hands="Asteria Mitts +1", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Assid. Pants +1", feet="Herald's Gaiters"}
sets.idle.PDT.Avatar = {main="Nirvana", sub="Oneiros Grip",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Rimeice Earring", ear2="Andoaa Earring",
body="Shomonjijoe +1", hands="Adhara Gages", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Moepapa Stone", legs="Assid. Pants +1", feet="Con. Pigaches +1"}
sets.idle.Spirit = {main="Nirvana",sub="Vox",ammo="Seraphicaller",
body="Beck. Doublet +1", hands="Lamassu Mitts +1", ring1="Evoker's Ring", ring2="Globidonta Ring",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Glyphic Spats", feet="Apogee Pumps"}
sets.idle.Town = {main="Nirvana", sub="Oneiros Grip",
head="Beckoner's Horn +1", neck="Twilight Torque", ear1="Rimeice Earring", ear2="Colossus's Earring",
body="Shomonjijoe +1", hands="Asteria Mitts +1", ring1="Dark Ring", ring2="Defending Ring",
back="Umbra Cape", waist="Lucidity Sash", legs="Assid. Pants +1", feet="Herald's Gaiters"}
-- Favor uses Caller's Horn instead of Con. Horn +1 for refresh
sets.idle.Avatar.Favor = {main="Nirvana",ammo="Seraphicaller",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Rimeice Earring", ear2="Andoaa Earring",
body="Shomonjijoe +1", hands="Asteria Mitts +1", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Assid. Pants +1",feet="Herald's Gaiters"}
sets.idle.Avatar.Melee = {neck="Empath Necklace",hands="Regimen Mittens",waist="Moepapa Stone",legs="Enticer's Pants",feet="Telchine Pigaches", ear2="Evans Earring", back="Penetrating Cape"}
sets.perp = {main="Nirvana",ammo="Seraphicaller",
head="Beckoner's Horn +1", neck="Caller's Pendant", ear1="Rimeice Earring", ear2="Andoaa Earring",
body="Shomonjijoe +1", hands="Regimen Mittens", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Assid. Pants +1", feet="Con. Pigaches +1"}
-- Caller's Bracer's halve the perp cost after other costs are accounted for.
-- Using -10 (Gridavor, ring, Conv.feet), standard avatars would then cost 5, halved to 2.
-- We can then use Hagondes Coat and end up with the same net MP cost, but significantly better defense.
-- Weather is the same, but we can also use the latent on the pendant to negate the last point lost.
-- sets.perp.Day = {hands="Beck. Bracers +1"}
--sets.perp.Weather = {neck="Caller's Pendant",hands="Beck. Bracers +1"}
-- Carby: Mitts+Conv.feet = 1/tick perp. Everything else should be +refresh
sets.perp.Carbuncle = {main="Nirvana", hands="Asteria Mitts +1"}
sets.perp.CaitSith = {main="Nirvana", hands="Lamassu Mitts +1"}
-- Diabolos's Rope doesn't gain us anything at this time
--sets.perp.Diabolos = {waist="Diabolos's Rope"}
sets.perp.Alexander = {
body="Beck. Doublet +1", hands="Regimen Mittens", ring1="Evoker's Ring", ring2="Fervor Ring",
head="Con. Horn +1", neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Beck. Spats +1", feet="Apogee Pumps"}
sets.perp.Odin = {
body="Beck. Doublet +1", hands="Regimen Mittens", ring1="Evoker's Ring", ring2="Fervor Ring",
head="Con. Horn +1", neck="Caller's Pendant", ear1="Smn. Earring", ear2="Andoaa Earring",
back="Conveyance Cape", waist="Lucidity Sash", legs="Beck. Spats +1", feet="Apogee Pumps"}
sets.perp.staff_and_grip = {main=gear.perp_staff,sub="Achaq Grip"}
-- Defense sets
sets.defense.PDT = {main="Terra's Staff",
head="Hike Khat",neck="Twilight Torque", ear1="Colosus's Earring",
body="Vrikodara Jupon",hands="Spurrina Gages", ring1="Dark Ring", ring2="Defending Ring",
back="Umbra Cape",legs="Miasmic Pants", feet="Plumb Boots"}
sets.defense.MDT = {
head="Hagondes Hat",neck="Twilight Torque",ear1="Gifted Earring",ear2="Loquacious Earring",
body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Shadow Ring",
back="Umbra Cape",waist="Fucho-no-Obi",legs="Bokwus Slops",feet="Hagondes Sabots"}
sets.Kiting = {feet="Herald's Gaiters"}
sets.latent_refresh = {waist="Fucho-no-obi"}
--------------------------------------
-- Engaged sets
--------------------------------------
-- Normal melee group
sets.engaged = {ammo="Seraphicaller",
head="Beckoner's Horn +1", neck="Empath Necklace", ear1="Bladeborn Earring", ear2="Steelflash Earring",
body="Shomonjijoe +1", hands="Regimen Mittens", ring1="Evoker's Ring", ring2="Thurandaut Ring",
back="Conveyance Cape", waist="Moepapa Stone", legs="Enticer's Pants", feet="Telchine Pigaches"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- 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 state.Buff['Astral Conduit'] and pet_midaction() then
eventArgs.handled = true
end
end
function job_midcast(spell, action, spellMap, eventArgs)
if state.Buff['Astral Conduit'] and pet_midaction() then
eventArgs.handled = true
end
end
-- Runs when pet completes an action.
function job_pet_aftercast(spell, action, spellMap, eventArgs)
if not spell.interrupted and spell.type == 'BloodPactWard' and spellMap ~= 'DebuffBloodPactWard' then
wards.flag = true
wards.spell = spell.english
send_command('wait 5; gs c reset_ward_flag')
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 state.Buff[buff] ~= nil then
handle_equipping_gear(player.status)
elseif storms:contains(buff) then
handle_equipping_gear(player.status)
end
end
-- Called when the player's pet's status changes.
-- This is also called after pet_change after a pet is released. Check for pet validity.
function job_pet_status_change(newStatus, oldStatus, eventArgs)
if pet.isvalid and not midaction() and not pet_midaction() and (newStatus == 'Engaged' or oldStatus == 'Engaged') then
handle_equipping_gear(player.status, newStatus)
end
end
-- Called when a player gains or loses a pet.
-- pet == pet structure
-- gain == true if the pet was gained, false if it was lost.
function job_pet_change(petparam, gain)
classes.CustomIdleGroups:clear()
if gain then
if avatars:contains(pet.name) then
classes.CustomIdleGroups:append('Avatar')
elseif spirits:contains(pet.name) then
classes.CustomIdleGroups:append('Spirit')
end
else
--select_default_macro_book('reset')
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Custom spell mapping.
function job_get_spell_map(spell)
if spell.type == 'BloodPactRage' then
if magicalRagePacts:contains(spell.english) then
return 'MagicalBloodPactRage'
else
return 'PhysicalBloodPactRage'
end
elseif spell.type == 'BloodPactWard' and spell.target.type == 'MONSTER' then
return 'DebuffBloodPactWard'
end
end
-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
if pet.isvalid then
if pet.element == world.day_element then
idleSet = set_combine(idleSet, sets.perp.Day)
end
if pet.element == world.weather_element then
idleSet = set_combine(idleSet, sets.perp.Weather)
end
if sets.perp[pet.name] then
idleSet = set_combine(idleSet, sets.perp[pet.name])
end
gear.perp_staff.name = elements.perpetuance_staff_of[pet.element]
if gear.perp_staff.name and (player.inventory[gear.perp_staff.name] or player.wardrobe[gear.perp_staff.name]) then
idleSet = set_combine(idleSet, sets.perp.staff_and_grip)
end
if state.Buff["Avatar's Favor"] and avatars:contains(pet.name) then
idleSet = set_combine(idleSet, sets.idle.Avatar.Favor)
end
if pet.status == 'Engaged' then
idleSet = set_combine(idleSet, sets.idle.Avatar.Melee)
end
end
if player.mpp < 51 then
idleSet = set_combine(idleSet, sets.latent_refresh)
end
return idleSet
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)
classes.CustomIdleGroups:clear()
if pet.isvalid then
if avatars:contains(pet.name) then
classes.CustomIdleGroups:append('Avatar')
elseif spirits:contains(pet.name) then
classes.CustomIdleGroups:append('Spirit')
end
end
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
end
-------------------------------------------------------------------------------------------------------------------
-- User self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called for custom player commands.
function job_self_command(cmdParams, eventArgs)
if cmdParams[1]:lower() == 'petweather' then
handle_petweather()
eventArgs.handled = true
elseif cmdParams[1]:lower() == 'siphon' then
handle_siphoning()
eventArgs.handled = true
elseif cmdParams[1]:lower() == 'pact' then
handle_pacts(cmdParams)
eventArgs.handled = true
elseif cmdParams[1] == 'reset_ward_flag' then
wards.flag = false
wards.spell = ''
eventArgs.handled = true
end
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
-- Cast the appopriate storm for the currently summoned avatar, if possible.
function handle_petweather()
if player.sub_job ~= 'SCH' then
add_to_chat(122, "You can not cast storm spells")
return
end
if not pet.isvalid then
add_to_chat(122, "You do not have an active avatar.")
return
end
local element = pet.element
if element == 'Thunder' then
element = 'Lightning'
end
if S{'Light','Dark','Lightning'}:contains(element) then
add_to_chat(122, 'You do not have access to '..elements.storm_of[element]..'.')
return
end
local storm = elements.storm_of[element]
if storm then
send_command('@input /ma "'..elements.storm_of[element]..'" <me>')
else
add_to_chat(123, 'Error: Unknown element ('..tostring(element)..')')
end
end
-- Custom uber-handling of Elemental Siphon
function handle_siphoning()
if areas.Cities:contains(world.area) then
add_to_chat(122, 'Cannot use Elemental Siphon in a city area.')
return
end
local siphonElement
local stormElementToUse
local releasedAvatar
local dontRelease
-- If we already have a spirit out, just use that.
if pet.isvalid and spirits:contains(pet.name) then
siphonElement = pet.element
dontRelease = true
-- If current weather doesn't match the spirit, but the spirit matches the day, try to cast the storm.
if player.sub_job == 'SCH' and pet.element == world.day_element and pet.element ~= world.weather_element then
if not S{'Light','Dark','Lightning'}:contains(pet.element) then
stormElementToUse = pet.element
end
end
-- If we're subbing /sch, there are some conditions where we want to make sure specific weather is up.
-- If current (single) weather is opposed by the current day, we want to change the weather to match
-- the current day, if possible.
elseif player.sub_job == 'SCH' and world.weather_element ~= 'None' then
-- We can override single-intensity weather; leave double weather alone, since even if
-- it's partially countered by the day, it's not worth changing.
if get_weather_intensity() == 1 then
-- If current weather is weak to the current day, it cancels the benefits for
-- siphon. Change it to the day's weather if possible (+0 to +20%), or any non-weak
-- weather if not.
-- If the current weather matches the current avatar's element (being used to reduce
-- perpetuation), don't change it; just accept the penalty on Siphon.
if world.weather_element == elements.weak_to[world.day_element] and
(not pet.isvalid or world.weather_element ~= pet.element) then
-- We can't cast lightning/dark/light weather, so use a neutral element
if S{'Light','Dark','Lightning'}:contains(world.day_element) then
stormElementToUse = 'Wind'
else
stormElementToUse = world.day_element
end
end
end
end
-- If we decided to use a storm, set that as the spirit element to cast.
if stormElementToUse then
siphonElement = stormElementToUse
elseif world.weather_element ~= 'None' and (get_weather_intensity() == 2 or world.weather_element ~= elements.weak_to[world.day_element]) then
siphonElement = world.weather_element
else
siphonElement = world.day_element
end
local command = ''
local releaseWait = 0
if pet.isvalid and avatars:contains(pet.name) then
command = command..'input /pet "Release" <me>;wait 1.1;'
releasedAvatar = pet.name
releaseWait = 10
end
if stormElementToUse then
command = command..'input /ma "'..elements.storm_of[stormElementToUse]..'" <me>;wait 4;'
releaseWait = releaseWait - 4
end
if not (pet.isvalid and spirits:contains(pet.name)) then
command = command..'input /ma "'..elements.spirit_of[siphonElement]..'" <me>;wait 4;'
releaseWait = releaseWait - 4
end
command = command..'input /ja "Elemental Siphon" <me>;'
releaseWait = releaseWait - 1
releaseWait = releaseWait + 0.1
if not dontRelease then
if releaseWait > 0 then
command = command..'wait '..tostring(releaseWait)..';'
else
command = command..'wait 1.1;'
end
command = command..'input /pet "Release" <me>;'
end
if releasedAvatar then
command = command..'wait 1.1;input /ma "'..releasedAvatar..'" <me>'
end
send_command(command)
end
-- Handles executing blood pacts in a generic, avatar-agnostic way.
-- cmdParams is the split of the self-command.
-- gs c [pact] [pacttype]
function handle_pacts(cmdParams)
if areas.Cities:contains(world.area) then
add_to_chat(122, 'You cannot use pacts in town.')
return
end
if not pet.isvalid then
add_to_chat(122,'No avatar currently available. Returning to default macro set.')
select_default_macro_book('reset')
return
end
if spirits:contains(pet.name) then
add_to_chat(122,'Cannot use pacts with spirits.')
return
end
if not cmdParams[2] then
add_to_chat(123,'No pact type given.')
return
end
local pact = cmdParams[2]:lower()
if not pacts[pact] then
add_to_chat(123,'Unknown pact type: '..tostring(pact))
return
end
if pacts[pact][pet.name] then
if pact == 'astralflow' and not buffactive['astral flow'] then
add_to_chat(122,'Cannot use Astral Flow pacts at this time.')
return
end
-- Leave out target; let Shortcuts auto-determine it.
send_command('@input /pet "'..pacts[pact][pet.name]..'"')
else
add_to_chat(122,pet.name..' does not have a pact of type ['..pact..'].')
end
end
-- Event handler for updates to player skill, since we can't rely on skill being
-- correct at pet_aftercast for the creation of custom timers.
windower.raw_register_event('incoming chunk',
function (id)
if id == 0x62 then
if wards.flag then
create_pact_timer(wards.spell)
wards.flag = false
wards.spell = ''
end
end
end)
-- Function to create custom timers using the Timers addon. Calculates ward duration
-- based on player skill and base pact duration (defined in job_setup).
function create_pact_timer(spell_name)
-- Create custom timers for ward pacts.
if wards.durations[spell_name] then
local ward_duration = wards.durations[spell_name]
if ward_duration < 181 then
local skill = player.skills.summoning_magic
if skill > 300 then
skill = skill - 300
--if skill > 200 then skill = 300 end
ward_duration = ward_duration + skill
end
end
local timer_cmd = 'timers c "'..spell_name..'" '..tostring(ward_duration)..' down'
if wards.icons[spell_name] then
timer_cmd = timer_cmd..' '..wards.icons[spell_name]
end
send_command(timer_cmd)
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book(reset)
if reset == 'reset' then
-- lost pet, or tried to use pact when pet is gone
end
-- Default macro set/book
set_macro_page(2, 1)
end
Gearswap shouldn't be affected by any instanced battle and I don't see any instanced specific rules in your set (It's motes style gearswap which he isn't maintaining anymore so expect errors at some point).
It's more likely a localized issue with your PC/Internet. Lua data is incredibly low stress for your machine and shouldn't be "lagging" it's can't lag, all that can lag is your PC or net. Consider this, gearswap is able to change your gearfast enough to compensate for instant cast procs and my gearswap lua is considerably more complicated than your SMN one and has 0 lag/latency errors, that and the coding on your set looks perfectly normal.
I would try the following steps -
Step 1:
Try a different gearswap thats simpler and isn't Motes, and uses Non of his includes.
if this fixes it, then you have your answer, it's due to a depreciated set of rules.
Step 2:
Check non of your ports are being blocked/hoged.
Step 3:
re-install gearswap in case there's some corrupted data.
Step 4:
Pray to Jesus.
Shiva.Paulu
Serveur: Shiva
Game: FFXI
Posts: 776
By Shiva.Paulu 2015-09-19 07:30:52
I would like to test a very dumbed down Lua that just handles BP delay on precast > BP dmg+ for midcast > then idle gear for after cast. Could anyone help show me how to make that code? I tried to breakdown motes files but I don't understand it yet. I miss spellcast.
Bismarck.Inference
Serveur: Bismarck
Game: FFXI
Posts: 417
By Bismarck.Inference 2015-09-19 08:52:37
I think lag may be related to pet_aftercast...I was screwing around on my friends BST and all it did was check a 2D data structure (petname => table of possible ready moves) and I'd get huge lag after every Ready until I removed the function from the script.
Shiva.Paulu
Serveur: Shiva
Game: FFXI
Posts: 776
By Shiva.Paulu 2015-09-19 17:01:34
Is there a way I can delay the execution of pet_aftercast without turning it completely off?
Shiva.Paulu
Serveur: Shiva
Game: FFXI
Posts: 776
By Shiva.Paulu 2015-09-20 14:01:11
Bumping
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-09-20 14:52:37
You could try this one, doesn't work of Motes, however has some out date gear, you could certainly use it, see if it works and go nuts.
https://github.com/svanheulen/ffxi-gearswap/blob/master/Acacia_SMN.lua
Right. Decided to come back (Once again!) and I've found that spellcast isn't a thing anymore. While painfully trying to navigate a whole new scripting language, I finally went through and edited my own outta one of Mote's. However, this:
Code sets.midcast['Blue Magic'].SkillBasedBuff = {ammo="Mavi Tathlum",
head="Mirage Keffiyeh +1",neck="Mavi Scarf"
body="",hands="",ring1"",ring2"",
back="",legs="Mavi Tayt +2",feet=""}
Gives back
" '}' expected (to close '{' at line 360) near 'body'."
The error seems to be on line 362. I've no idea what could be causing it.
The entire file, if it might help. Pastebin
I apologize if this isn't the right place to post this, but I've been outta the FFXI loop for quite awhile.
|
|