Gearswap Support Thread

Language: JP EN DE FR
New Items
2023-11-19
users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 181 182 183
 Phoenix.Akago
Offline
Server: Phoenix
Game: FFXI
Posts: 1
By Phoenix.Akago 2024-03-25 13:26:25
Link | Quote | Reply
 
Asura.Kurdtray said: »
Ok how would I go about coding my lua so that while on drk if I use scarlet delirium it will equip a certain set until I take the first hit?

If the buff for Scarlet Delirium is removed when you are hit (don't DRK personally), you could use a buff state gain check to
force you into your SD set while you have the buff, then a buff state loss to remove the forced SD set when you lose it.

I'm not sure best implementation for you personally, as it would depend if you want it to override all your sets (casting, WS, whatever), or just your idle/engaged set.
Offline
Server: Asura
Game: FFXI
user: Raytheon
Posts: 428
By Asura.Clintbeastwood 2024-03-25 14:05:07
Link | Quote | Reply
 
I have what he's asking for my in DRK lua. It's gotten me killed a few times so I've throttled back the Ratri but it stays applied until I take the hit. Once the buffactive scarlet delirium is gone, it swaps back to whatever the current gear state is.

Kurd, I'll send it to you in discord.
 Asura.Kurdtray
Offline
Server: Asura
Game: FFXI
user: Kurdtray
Posts: 22
By Asura.Kurdtray 2024-03-28 20:23:50
Link | Quote | Reply
 
the problem is you get a buff and then when hit the buff icon changes but it is still called scarlet delirium. I know sublimation does something similar but each part of it has a slightly unique name, but I can't figure out how to tell between the two buffs for scarlet.
 Carbuncle.Nynja
Offline
Server: Carbuncle
Game: FFXI
user: NynJa
Posts: 2372
By Carbuncle.Nynja 2024-03-28 20:32:46
Link | Quote | Reply
 
Theres two buffs in the resources file showing Scarlet Delirium (479 and 480). Is there a way in GS to use buff ID instead of name?
 Asura.Kurdtray
Offline
Server: Asura
Game: FFXI
user: Kurdtray
Posts: 22
By Asura.Kurdtray 2024-03-28 21:17:31
Link | Quote | Reply
 
Yes i just found that and have got it figured out. the code works as follows for anyone else wanting to do this

if buffactive[479] then

this will register only the first code of it not its follow up which is 480. Thanks everyone for your suggestions
[+]
 Asura.Exxcalibur
Offline
Server: Asura
Game: FFXI
Posts: 3
By Asura.Exxcalibur 2024-04-04 09:21:05
Link | Quote | Reply
 
Im having an issue where I'm stuck in my idle gear, even when I change it manually. If I equip a warp ring, it instantly switches back to my idle rings. blu.lua I made multiple attempts to play with Aftercast, Idlestates, and commands but I'm pulling my hair out here now.
 Asura.Yottaxa
Offline
Server: Asura
Game: FFXI
user: Yottaxa
Posts: 140
By Asura.Yottaxa 2024-04-04 11:46:20
Link | Quote | Reply
 
Asura.Exxcalibur said: »
Im having an issue where I'm stuck in my idle gear, even when I change it manually. If I equip a warp ring, it instantly switches back to my idle rings. blu.lua I made multiple attempts to play with Aftercast, Idlestates, and commands but I'm pulling my hair out here now.

I am not seeing anything glaring and even ran a quick test or two and not sure. You could try using //gs debugmode (Its a toggle on / off command) and watching it happen to catch where the issue is. If I find something I'll let you know.
 Asura.Exxcalibur
Offline
Server: Asura
Game: FFXI
Posts: 3
By Asura.Exxcalibur 2024-04-04 12:39:46
Link | Quote | Reply
 
I've tried that lua and I tried Arislan's for blue as well and both are getting spammed "Entering self_command" when I enter debug mode.
 Asura.Yottaxa
Offline
Server: Asura
Game: FFXI
user: Yottaxa
Posts: 140
By Asura.Yottaxa 2024-04-04 15:00:37
Link | Quote | Reply
 
Asura.Exxcalibur said: »
I've tried that lua and I tried Arislan's for blue as well and both are getting spammed "Entering self_command" when I enter debug mode.

It looks like the logic on lines 1191-1199 could be doing that - I'm not sure that the engaged / idle function belongs in self command like that. (Should be handled in status_change afaik) Test commenting that section? (Not familiar with that lua so it could break stuff but would rule things out)
Offline
Posts: 882
By Dodik 2024-04-05 08:59:07
Link | Quote | Reply
 
That sounds like Selindrile's based luas and it is a feature.

Idle set gets put back on if you change it manually and gearswap updates character state.

Updates happen on

a) Character moving
b) Something being cast on character, or ability used that affects character (ie, a buff).
c) Character doing something, ja, spell, item, w/e

If you want to use a warp ring change it manually and do not move or do anything with the character until you can use it.

Or disable that slot with 'gs disable right_ring' or similar temporarily.

Some addons like myhome do this, disabling the slot while using an item, automatically.
Offline
Posts: 399
By drakefs 2024-04-05 16:50:03
Link | Quote | Reply
 
Asura.Exxcalibur said: »
Im having an issue where I'm stuck in my idle gear, even when I change it manually. If I equip a warp ring, it instantly switches back to my idle rings. blu.lua I made multiple attempts to play with Aftercast, Idlestates, and commands but I'm pulling my hair out here now.

I would not recommend that lua unless you are the one who created\maintains it. There is a lot going on and it produces some weird debug messages (such as using alt-e).

That being said, I could not replicate the issue you described. There may be some requirement that I do not have setup for the lua. If I equip a warp ring and use it, from the menu, the lua does not swap any gear and the ring warps me. I tested in non-city zone.
 Carbuncle.Nynja
Offline
Server: Carbuncle
Game: FFXI
user: NynJa
Posts: 2372
By Carbuncle.Nynja 2024-04-05 17:39:43
Link | Quote | Reply
 
Dodik said: »
Updates happen on

a) Character moving
People with ***like this wonder why the games so *** laggy.
 Asura.Exxcalibur
Offline
Server: Asura
Game: FFXI
Posts: 3
By Asura.Exxcalibur 2024-04-05 21:25:04
Link | Quote | Reply
 
I appreciate you guys checking it out. I'll try starting again with some fresh Luas. I'm still relearning all of this so it's probably my fault somewhere.
Offline
Posts: 399
By drakefs 2024-04-05 21:48:01
Link | Quote | Reply
 
Carbuncle.Nynja said: »
People with ***like this wonder why the games so *** laggy.

The game is "so *** laggy" because the servers are across the world and the network stack is 20+ years old.

It is so simple to check, jut play vanilla. Does it still lag? Yup.
[+]
Offline
Posts: 483
By Hopalong 2024-04-05 21:55:40
Link | Quote | Reply
 
You can try this one. I decided that warp rings need a toggle. I toggle off right as animation wears.

No guarantee it works cause I haven't played in awhile but with a little polish and personalization Arislan's luas are adaptable.

There's no auto change according to haste levels etc because I found that put too much load on the game and I felt too sweaty try-hard to justify it. I cut all that out.

Code
-- Original: Motenten / Modified: Arislan / Modified: Hopalong

function get_sets()
    mote_include_version = 2
    include('Mote-Include.lua')
end

-----------------------------------------------------------
function job_setup()
	include('Mote-TreasureHunter')
	update_melee_groups()
	
	-- Elemental Weaponskill	
	elemental_ws = S{"Aeolian Edge", "Flash Nova", 'Seraph Strike', 'Shining Strike', 'Sanguine Blade', 'Seraph Blade', 'Shining Blade',}

	-- Moonshade Earring
	moonshade_WS = S{'Savage Blade', 'Aeolian Edge', 'Chant du Cygne', 'Sanguine Blade', 'Seraph Blade', 'Shining Blade', 'Flat Blade', 'Red Lotus Blade', 'Burning Blade', 'Vorpal Blade', 'Circle Blade', 'Judgement', 'Skullbreaker', 'Moonlight', 'Starlight', 'Brainshaker', 'Seraph Strike', 'Shining Strike', 'Black Halo'}

	-- Rune Enchantments	
	rune_enchantments = S{'Ignis', 'Gelus', 'Flabra', 'Tellus', 'Sulpor', 'Unda', 'Lux','Tenebrae'}

	-- Blue Magic Mapping
    blue_magic_maps = {}

    -- Physical spells with no particular (or known) stat mods
    blue_magic_maps.Physical = S{'Bilgestorm'}

    -- Spells with heavy accuracy penalties, that need to prioritize accuracy first.
    blue_magic_maps.PhysicalAcc = S{'Heavy Strike'}

    -- Physical spells with Str stat mod
    blue_magic_maps.PhysicalStr = S{'Battle Dance','Bloodrake','Death Scissors','Dimensional Death',
        'Empty Thrash','Quadrastrike','Saurian Slide','Sinker Drill','Spinal Cleave','Sweeping Gouge',
        'Uppercut','Vertical Cleave'}

    -- Physical spells with Dex stat mod
    blue_magic_maps.PhysicalDex = S{'Amorphic Spikes','Asuran Claws','Barbed Crescent','Claw Cyclone',
        'Disseverment','Foot Kick','Frenetic Rip','Goblin Rush','Hysteric Barrage','Paralyzing Triad',
        'Seedspray','Sickle Slash','Smite of Rage','Terror Touch','Thrashing Assault','Vanity Dive'}

    -- Physical spells with Vit stat mod
    blue_magic_maps.PhysicalVit = S{'Body Slam','Cannonball','Delta Thrust','Glutinous Dart','Grand Slam',
        'Power Attack','Quad. Continuum','Sprout Smack','Sub-zero Smash'}

    -- Physical spells with Agi stat mod
    blue_magic_maps.PhysicalAgi = S{'Benthic Typhoon','Feather Storm','Helldive','Hydro Shot','Jet Stream',
        'Pinecone Bomb','Spiral Spin','Wild Oats'}

    -- Physical spells with Int stat mod
    blue_magic_maps.PhysicalInt = S{'Mandibular Bite','Queasyshroom'}

    -- Physical spells with Mnd stat mod
    blue_magic_maps.PhysicalMnd = S{'Ram Charge','Screwdriver','Tourbillion'}

    -- Physical spells with Chr stat mod
    blue_magic_maps.PhysicalChr = S{'Bludgeon'}

    -- Physical spells with HP stat mod
    blue_magic_maps.PhysicalHP = S{'Final Sting'}

    -- Magical spells with the typical Int mod
    blue_magic_maps.Magical = S{'Anvil Lightning','Blastbomb','Blazing Bound','Bomb Toss','Cursed Sphere',
        'Droning Whirlwind','Embalming Earth','Entomb','Firespit','Foul Waters','Ice Break','Leafstorm',
        'Maelstrom','Molting Plumage','Nectarous Deluge','Regurgitation','Rending Deluge','Scouring Spate',
        'Silent Storm','Spectral Floe','Subduction','Tem. Upheaval','Water Bomb'}
	
	-- Magical spells Dark affinity
    blue_magic_maps.MagicalDark = S{'Dark Orb','Death Ray','Eyes On Me','Evryone. Grudge','Palling Salvo',
        'Tenebral Crush'}
	
	-- Magical spells Light affinity
    blue_magic_maps.MagicalLight = S{'Blinding Fulgor','Diffusion Ray','Radiant Breath','Rail Cannon',
        'Retinal Glare'}

    -- Magical spells with a primary Mnd mod
    blue_magic_maps.MagicalMnd = S{'Acrid Stream','Magic Hammer','Mind Blast'}

    -- Magical spells with a primary Chr mod
    blue_magic_maps.MagicalChr = S{'Mysterious Light'}

    -- Magical spells with a Vit stat mod (on top of Int)
    blue_magic_maps.MagicalVit = S{'Thermal Pulse'}

    -- Magical spells with a Dex stat mod (on top of Int)
    blue_magic_maps.MagicalDex = S{'Charged Whisker','Gates of Hades'}

    -- Magical spells (generally debuffs) that we want to focus on magic accuracy over damage.
    -- Add Int for damage where available, though.
    blue_magic_maps.MagicAccuracy = S{'1000 Needles','Absolute Terror','Actinic Burst','Atra. Libations',
        'Auroral Drape','Awful Eye', 'Blank Gaze','Blistering Roar','Blood Saber','Chaotic Eye',
        'Cimicine Discharge','Cold Wave','Corrosive Ooze','Demoralizing Roar','Digest','Dream Flower',
        'Enervation','Feather Tickle','Filamented Hold','Frightful Roar','Geist Wall','Hecatomb Wave',
        'Infrasonics','Jettatura','Light of Penance','Lowing','Mind Blast','Mortal Ray','MP Drainkiss',
        'Osmosis','Reaving Wind','Sandspin','Sandspray','Sheep Song','Soporific','Sound Blast',
        'Stinking Gas','Sub-zero Smash','Venom Shell','Voracious Trunk','Yawn'}

    -- Breath-based spells
    blue_magic_maps.Breath = S{'Bad Breath','Flying Hip Press','Frost Breath','Heat Breath','Hecatomb Wave',
        'Magnetite Cloud','Poison Breath','Self-Destruct','Thunder Breath','Vapor Spray','Wind Breath'}

    -- Stun spells
    blue_magic_maps.StunPhysical = S{'Frypan','Head Butt','Sudden Lunge','Tail slap','Whirl of Rage'}
    blue_magic_maps.StunMagical = S{'Blitzstrahl','Temporal Shift','Thunderbolt'}

    -- Healing spells
    blue_magic_maps.Healing = S{'Healing Breeze','Magic Fruit','Plenilune Embrace','Pollen','Restoral',
        'Wild Carrot'}

    -- Buffs that depend on blue magic skill
    blue_magic_maps.SkillBasedBuff = S{'Barrier Tusk','Diamondhide','Magic Barrier','Metallic Body',
        'Plasma Charge','Pyric Bulwark','Reactor Cool','Occultation'}

    -- Other general buffs
    blue_magic_maps.Buff = S{'Amplification','Animating Wail','Carcharian Verve','Cocoon',
        'Erratic Flutter','Exuviation','Fantod','Feather Barrier','Harden Shell','Memento Mori',
        'Nat. Meditation','Orcish Counterstance','Refueling','Regeneration','Saline Coat','Triumphant Roar',
        'Warm-Up','Winds of Promyvion','Zephyr Mantle'}

    blue_magic_maps.Refresh = S{'Battery Charge'}

    -- Spells that require Unbridled Learning to cast.
    unbridled_spells = S{'Absolute Terror','Bilgestorm','Blistering Roar','Bloodrake','Carcharian Verve','Cesspool',
        'Crashing Thunder','Cruel Joke','Droning Whirlwind','Gates of Hades','Harden Shell','Mighty Guard',
        'Polar Roar','Pyric Bulwark','Tearing Gust','Thunderbolt','Tourbillion','Uproot'}
end

-----------------------------------------------------------
function user_setup()
	
    -- Blue Mage Modes	
	state.IdleMode:options('Normal', 'DT', 'Evasion')
	state.OffenseMode:options('Normal', 'HasteII', 'HighHP')
    state.HybridMode:options('Normal', 'Armored', 'Evasion')
    state.WeaponskillMode:options('Normal', 'WSHP')

	-- Defense Modes.
	state.PhysicalDefenseMode:options('PDT')
    state.MagicalDefenseMode:options('MDT')

	-- Extra Defense Modes	
	state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MaxHP'}

	-- Weapon Set	
    state.WeaponSet = M{['description']='Weapon Set', 'Naegling', 'Tanmogayi', 'Rounsey'}
	
	-- Sub Set
	state.SubSet = M{['description']='SubSet', 'Zantetsuken', 'Genbu'}	
	
	-- Ranged Set
	state.RangedSet = M{['description']='Ranged Set', 'None', 'Trollbane'}
	
	-- Main/Sub Weapon Lock
	state.WeaponLock = M(false, 'Weapon Lock')
	
	-- Ranged Weapon Lock
	state.RangedLock = M(false, 'Ranged Lock')

	-- Runes	
	state.Runes = M{['description']='Runes', 'Ignis', 'Gelus', 'Flabra', 'Tellus', 'Sulpor', 'Unda', 'Lux', 'Tenebrae'}

	-- Job Abilities
	state.Buff['Burst Affinity'] = buffactive['Burst Affinity'] or false
    state.Buff['Chain Affinity'] = buffactive['Chain Affinity'] or false
    state.Buff.Convergence = buffactive.Convergence or false
    state.Buff.Diffusion = buffactive.Diffusion or false
    state.Buff.Efflux = buffactive.Efflux or false
    state.Buff['Unbridled Learning'] = buffactive['Unbridled Learning'] or false

	-- Doom
    state.Buff.Doom = buffactive.doom or false
	
	-- Magic Burst
	state.MagicBurst = M(false, 'Magic Burst')
	
	-- Kiting
	state.Kiting = M(false, 'Kiting')
	
	-- Knockback
	state.Knockback = M(false, 'Knockback')
	
	-- WarpRings
	state.WarpRings = M(false, "WarpRings")
	
	-- Target Distance
	target_distance = 5.5

--[[		
--		[ F9 ]              Cycle Offense Modes
--      [ CTRL+F9 ]         Cycle Attack Mode
--		[ ALT+F9 ]          Cycle Weapon Skill Modes

--		[ F10 ]         	Cycle Hybrid Mode
--		[ CTRL+F10 ]        Toggle Kiting
--		[ ALT+F10 ]         Toggle Knockback

--		[ F11 ]         	Cycle Defense Modes
--		[ CTRL+F11 ]        Reset Defense Mode
--		[ ALT+F11 ]         Cycle ExtraDefenseMode         

--		[ F12 ]             Update/Report Current Gear
--      [ CTRL+F12 ]        Cycle Idle Modes
--		[ ALT+F12 ]			

--      [ WIN+F12 ]         Toggle WarpRings

--      [ WIN+Q ]         	Main Weapon Change
--      [ WIN+W ]         	Weapons Lock
--      [ WIN+E ]         	Sub Weapon Change
--      [ WIN+R ] 			Ranged Set
--      [ WIN+T ]         	Ranged Lock

--      [ Delete ]          Ranged Attack
--      [ ALT+J ]           Super Jump
--      [ ALT+H ]           Haste Samba
--      [ ALT+G ]           Curing Waltz III

--		[ CTRL+= ]			Treasure Mode

--		[ END ]				
--		[ PAGEDOWN ]		
--		[ PAGEUP ]			
--		[ NUMLOCK ]			
--]]  

-- F9-F12:
	send_command('bind f9 gs c cycle OffenseMode')
	send_command('bind ^f9 gs c cycle AttackMode')
	send_command('bind !f9 gs c WeaponskillMode')
	
	send_command('bind f10 gs c cycle HybridMode')
	send_command('bind ^f10 gs c cycle Kiting')
	send_command('bind !f10 gs c cycle Knockback')
	
	send_command('bind f11 gs c cycle DefenseMode')
	send_command('bind ^f11 gs c reset DefenseMode')
	send_command('bind !f11 gs c cycle ExtraDefenseMode')
	
	send_command('bind f12 gs c update user')
	send_command('bind ^f12 gs c cycle IdleMode')
	send_command('bind !f12 gs c ')

	-- Weapon Set:	[ WIN+Q ]
	send_command('bind @q gs c cycle WeaponSet')
	
	-- Sub Set: [ WIN+E ]
	send_command('bind @e gs c cycle SubSet')

	-- Weapon Lock:  [ WIN+W ]
	send_command('bind @w gs c toggle WeaponLock')

	-- Ranged Set:	[ WIN+R ]
	send_command('bind @r gs c cycle RangedSet')
	
	-- Ranged Lock:  [ WIN+T ]
	send_command('bind @t gs c toggle RangedLock')
	
	-- Ranged Attack:  [ DELETE ]	
	send_command('bind delete input /ra <t>')

	-- Cycle Runes:  [ CTRL+Delete ] 
	send_command('bind ^delete gs c cycle Runes')

	-- Use Runes:  [ ALT+Delete ]
	send_command('bind !Delete input //gs c rune')

	-- Super Jump:  [ ALT+J ]
	send_command('bind !j input /ja "Super Jump" <t>')

	-- Haste Samba:  [ ALT+H ]
	send_command('bind !h input /ja "Haste Samba" <me>')

	-- Curing Waltz III:  [ ALT+G ]
	send_command('bind !g input /ja "Curing Waltz III" <me>')	
	
	-- Treasure Mode:	[ CTRL+= ]
	send_command('bind ^= gs c cycle treasuremode')
	
	-- WarpRings	[ WIN+F12 ]
	send_command('bind @f12 gs c toggle WarpRings')

	-- Occultation	[ [ ] [ ] ]
    send_command('bind %[ input /ma "Occultation" <me>')
    
	-- Utsusemi: Ni	[ ] ]
	send_command('bind %] input /ma "Utsusemi: Ni" <me>')

	-- xxx	[ END ]

	
	-- xxx [ PAGEDOWN ]	

	
	-- xxx	[ PAGEUP ]	

	-- Enable all:	
	send_command('gs enable all')

	-- Azuresets
	send_command('lua l azureSets')

-- Numpad:	
	send_command('bind numlock ')
	send_command('bind ^numpad/ input ')
    send_command('bind ^numpad* input ')
    send_command('bind ^numpad+ input ')
	send_command('bind ^numpad- input ')
    send_command('bind ^numpad0 input ')
	
--       [ Numpad7 ]    Savage Blade
--       [ Numpad8 ]    Chant du Cygne
--       [ Numpad9 ]    Sanguine Blade
--		 [ Numpad4 ]    xxx
--       [ Numpad5 ]    xxx
--       [ Numpad6 ]    Aeolian Edge
--       [ Numpad1 ]    xxx
--       [ Numpad2 ]    xxx
--       [ Numpad3 ]    xxx
	
	send_command('bind numpad7 input /ws "Savage Blade" <t>')
    send_command('bind numpad8 input /ws "Chant du Cygne" <t>')
    
	send_command('bind numpad9 input /ws "Sanguine Blade" <t>')
	
	--send_command('bind numpad4 input /ws "xxx" <t>')
	--send_command('bind numpad5 input /ws "xxx" <t>')
    send_command('bind numpad6 input /ws "Aeolian Edge" <t>')
    
	--send_command('bind numpad1 input /ws "xxx" <t>')
    --send_command('bind numpad2 input /ws "xxx" <t>')
	--send_command('bind numpad3 input /ws "xxx" <t>')		
end

-----------------------------------------------------------
function user_unload()
	send_command('unbind ^f9')
	send_command('unbind ^f10')
	send_command('unbind ^f11')
	send_command('unbind ^f12')
    send_command('unbind !f9')
	send_command('unbind !f10')
	send_command('unbind !f11')
	send_command('unbind !f12')
	send_command('unbind @f9')
    send_command('unbind @f10')
	send_command('unbind @f11')
    send_command('unbind @f12')
	send_command('unbind @a')
	send_command('unbind @w')
	send_command('unbind @e')
	send_command('unbind @q')
	send_command('unbind @c')
	send_command('unbind @p')
	send_command('unbind @d')
	send_command('unbind @h')
	send_command('unbind Delete')
	send_command('unbind !j')
	send_command('unbind !h')
    send_command('unbind ^`')
	send_command('unbind ^=')	
	send_command('unbind end')
	send_command('unbind pagedown')
	send_command('unbind pageup')
	send_command('unbind numlock')
	send_command('unbind ^numpad/')
    send_command('unbind ^numpad*')
    send_command('unbind ^numpad-')
	send_command('unbind ^numpad+')
    send_command('unbind ^numpad0')
	send_command('unbind numpad7')
	send_command('unbind numpad8')
    send_command('unbind numpad9')
    send_command('unbind numpad4')
	send_command('unbind numpad5')
    send_command('unbind numpad6')
    send_command('unbind numpad1')
    send_command('unbind numpad2')
	send_command('unbind numpad3')
	send_command('unbind %[')
	send_command('unbind %]')	
	send_command('lua u azureSets')
	send_command('lua u DressUp')

end 

------------------------------------------------------------
function init_gear_sets()

------------------------  Precast Sets  --------------------

-- Treasure Hunter Sets (need +5 in gear)
    sets.TreasureHunter = {    
		    --ammo="Perfect Lucky Egg",
			waist="Chaac Belt",
			legs={ name="Herculean Trousers", augments={'Phys. dmg. taken -2%','Mag. Acc.+16','"Treasure Hunter"+2','Mag. Acc.+20 "Mag.Atk.Bns."+20',}},
			feet={ name="Herculean Boots", augments={'MND+6','Pet: "Regen"+1','"Treasure Hunter"+2','Accuracy+6 Attack+6','Mag. Acc.+15 "Mag.Atk.Bns."+15',}},}

------------------------------------------------------------
---------------------- Precast Sets ------------------------
------------------------------------------------------------

	-- Job Abilities 
    --sets.precast.JA['Provoke'] = sets.Enmity

    sets.buff['Burst Affinity'] = {legs="Assim. Shalwar +3", feet="Hashi. Basmak +3"}
    sets.buff['Diffusion'] = {feet="Luhlaza Charuqs +1"}
    sets.buff['Efflux'] = {legs="Hashishin Tayt +2"}

    sets.precast.JA['Azure Lore'] = {hands="Luh. Bazubands +1"}
    sets.precast.JA['Chain Affinity'] = {feet="Assim. Charuqs +1"}
    sets.precast.JA['Convergence'] = {head="Luh. Keffiyeh +3"}
    sets.precast.JA['Enchainment'] = {body="Luhlaza Jubbah +3"}
    
	sets.precast.JA['Sneak Attack'] = sets.buff['Sneak Attack']
    sets.precast.JA['Trick Attack'] = sets.buff['Trick Attack']

	-- Waltz
	sets.precast.Waltz = {
		legs="Dashing Subligar",}

	-- Healing Waltz
	sets.precast.Waltz['Curing Waltz III'] = {
        ammo="Brigantia Pebble",
		head="Nyame Helm",
		body="Passion Jacket",
		hands={ name="Taeon Gloves", augments={'Mag. Evasion+20','"Waltz" potency +5%','"Regen" potency+3',}},
		legs="Dashing Subligar",
		feet={ name="Taeon Boots", augments={'Mag. Evasion+20','"Waltz" potency +5%','"Regen" potency+3',}},
		neck={ name="Loricate Torque +1", augments={'Path: A',}},
		waist="Eschan Stone",
		left_ear="Ethereal Earring",
		right_ear="Eabani Earring",
		left_ring="Defending Ring",
		right_ring="Shadow Ring",
		back="Moonbeam Cape",}

-- Fast Cast Sets
	
	-- Default Fast Cast `
    sets.precast.FC = {
		main="Iris",
		sub="Sakpata's Sword",
		head={ name="Carmine Mask", augments={'Accuracy+15','Mag. Acc.+10','"Fast Cast"+3',}},
		body="Dread Jupon",
		hands={ name="Leyline Gloves", augments={'Accuracy+14','Mag. Acc.+13','"Mag.Atk.Bns."+13','"Fast Cast"+2',}},
		legs="Enif Cosciales",
		feet={ name="Carmine Greaves +1", augments={'HP+80','MP+80','Phys. dmg. taken -4',}},
		neck="Voltsurge Torque",
		waist="Eschan Stone",
		left_ear="Loquac. Earring",
		right_ear="Mendi. Earring",
		left_ring="Kishar Ring",
		right_ring="Naji's Loop",
		back="Moonbeam Cape",}
		-- Fast Cast 78%
		-- HP 2368
		-- MP 1367
	
	sets.precast.FC.HP = set_combine(sets.precast.FC, {})
	
	-- Call Trust 
	sets.precast['Trust'] = set_combine(sets.precast.FC, {})
	
	-- Utsusemi 
    sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {body="Passion Jacket"})

	-- Fast Cast Blue Magic --
    sets.precast.FC['Blue Magic'] = set_combine(sets.precast.FC, {body="Hashishin Mintan +3"})
	sets.precast.FC['Blue Magic'].HP = set_combine(sets.precast.FC, {body="Hashishin Mintan +3"})

	-- Fast Cast Healing Magic Cures --
    sets.precast.FC.Cure = set_combine(sets.precast.FC, {ear2="Mendi. Earring", waist="Acerbic Sash +1", right_ring="Naji's Loop"})	
    sets.precast.FC.Cure.HP = set_combine(sets.precast.FC, {ear2="Mendi. Earring", waist="Acerbic Sash +1", right_ring="Naji's Loop"})

	--Ranged Midcast Treasure Hunter Pull --
	sets.midcast.RA = {}

	  
------------------------------------------------------------
---------------------- Weaponskill Sets --------------------
------------------------------------------------------------

	-- state.WeaponskillMode:options('Normal', 'HP')

	-- state.WeaponskillMode:options('Normal', 'WSHP')

	-- Default
    sets.precast.WS = {	
		ammo="Oshasha's Treatise",
		head="Hashishin Kavuk +3",
		body={ name="Herculean Vest", augments={'STR+3','AGI+8','Weapon skill damage +8%','Accuracy+12 Attack+12','Mag. Acc.+5 "Mag.Atk.Bns."+5',}},
		hands={ name="Herculean Gloves", augments={'Accuracy+10','Pet: DEX+5','Weapon skill damage +9%','Accuracy+6 Attack+6','Mag. Acc.+8 "Mag.Atk.Bns."+8',}},
		legs={ name="Augury Cuisses +1", augments={'Path: A',}},
		feet="Hashi. Basmak +3",
		neck="Fotia Gorget",
		waist="Fotia Belt",
		left_ear="Ishvara Earring",
		right_ear="Hashi. Earring +1",
		left_ring="Rufescent Ring",
		right_ring="Ilabrat Ring",
		back="Vespid Mantle",}
		-- HP = 2195
		-- STR = +175
		-- Dex = +168
		-- Accuracy = 1045 
		-- Attack = 1248

	-- HP Weaponskill
	sets.precast.WS.WSHP = set_combine(sets.precast.WS, {})

	-- Specific Weaponskills 
	-- sets.precast.WS
	-- sets.precast.WS.WSHP

	-- Chant du Cygne: 3hit, critical varies with TP, 80% Dex, 15%/25%/40%
    sets.precast.WS['Chant du Cygne'] = set_combine(sets.precast.WS, {ear1="Odr Earring",})
    sets.precast.WS['Chant du Cygne'].WSHP = set_combine(sets.precast.WS, {})	
	
	-- Vorpal Blade: 4hit, critical varies with TP, 60% Str, ?/?/?
    sets.precast.WS['Vorpal Blade'] = sets.precast.WS['Chant du Cygne']
    sets.precast.WS['Vorpal Blade'].WSHP = sets.precast.WS['Chant du Cygne'].WSHP
	
	-- Savage Blade: 2hit, Damage varies with TP, 50% Str, 50% Mnd, 4.0/10.25/13.75
    sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS, {neck="Rep. Plat. Medal", back="Phalangite Mantle", waist="Sailfi Belt +1"})
    sets.precast.WS['Savage Blade'].WSHP = set_combine(sets.precast.WS['Savage Blade'], {})
	
	-- True Strike: Critical damage, Accuracy varies with TP, 100% Str, -50/0/+50
	sets.precast.WS['True Strike'] = sets.precast.WS['Savage Blade']
    sets.precast.WS['True Strike'].WSHP = sets.precast.WS['True Strike'].WSHP
	
	-- Expiacion: 2hit, Damage varies with TP, 30% Str, Int, Dex, 3.8/9.4/12.2
	sets.precast.WS['Expiacion'] = sets.precast.WS['Savage Blade']
    sets.precast.WS['Expiacion'].WSHP = sets.precast.WS['Savage Blade'].WSHP
	
	-- Black Halo:  2hit, Damage varies with TP, 70% Mnd, 30% Str, 3.0/7.25/9.75
	sets.precast.WS['Black Halo'] = sets.precast.WS['Savage Blade']
    sets.precast.WS['Black Halo'].WSHP = sets.precast.WS['Savage Blade'].WSHP
	
	-- Requiescat: 5hit, nonelemental, Attack varies with TP, 85% Mnd, -20%/-10%/-0%
    sets.precast.WS['Requiescat'] = sets.precast.WS
    sets.precast.WS['Requiescat'].WSHP = set_combine(sets.precast.WS['Requiescat'], {})

	-- Realmrazer: 7hit, Accuracy varies with TP, 85% Mnd, ?/?/?
    sets.precast.WS['Realmrazer'] = sets.precast.WS['Requiescat']
    sets.precast.WS['Realmrazer'].WSHP = sets.precast.WS['Requiescat'].WSHP

	-- Sanguine Blade: Drains HP, Amount varies with TP, 50% Mnd, 30% Str, 50%, 100%, 160%
    sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.WS, {
		ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
		head="Hashishin Kavuk +3",
		body="Hashishin Mintan +3",
		hands="Jhakri Cuffs +2",
		legs={ name="Augury Cuisses +1", augments={'Path: A',}},
		feet="Hashi. Basmak +3",
		neck="Sibyl Scarf",
		waist="Sacro Cord",
		left_ear="Friomisi Earring",
		right_ear="Crematio Earring",
		left_ring="Mephitas's Ring",
		right_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
		back="Izdubar Mantle",})
    sets.precast.WS['Sanguine Blade'].WSHP = set_combine(sets.precast.WS, {})
    
	-- Flash Nova:  Light elemental damag, 50% Str, 50% Mnd, 

	sets.precast.WS['Flash Nova'] = sets.precast.WS['Sanguine Blade']
    sets.precast.WS['Flash Nova'].WSHP = sets.precast.WS['Sanguine Blade'].WSHP

	-- Aeolian Edge Set
    sets.precast.WS['Aeolian Edge'] = sets.precast.WS['Sanguine Blade']	
	sets.precast.WS['Aeolian Edge'].TH = set_combine(sets.precast.WS['Aeolian Edge'], sets.TreasureHunter)

	-- Evisceration	

	-- Earth Crusher
	sets.precast.WS['Earth Crusher'] = set_combine(sets.precast.WS['Sanguine Blade'], {neck="Quanpur Necklace"})
	sets.precast.WS['Earth Crusher'].WSHP = sets.precast.WS['Sanguine Blade'].WSHP

   
----------------------------------------------------------------------
----------------------------- Midcast Sets ---------------------------
----------------------------------------------------------------------
    sets.midcast.FastRecast = sets.precast.FC

    sets.midcast.SIRD = {
		--ammo="Staunch Tathlum",
		head="Nyame Helm",
		body="Nyame Mail",
		hands="Nyame Gauntlets",
		legs={ name="Carmine Cuisses +1", augments={'HP+80','STR+12','INT+12',}},
		feet={ name="Amalric Nails", augments={'Mag. Acc.+11','"Mag.Atk.Bns."+11','"Conserve MP"+5',}},
		neck={ name="Loricate Torque +1", augments={'Path: A',}},
		waist="Cornelia's Belt",
		left_ear="Eabani Earring",
		right_ear="Ethereal Earring",
		left_ring="Defending Ring",
		right_ring={ name="Gelatinous Ring +1", augments={'Path: A',}},
		back="Repulse Mantle",}
		-- HP =
		-- MP =
		-- DT =
		-- SIRD =

    sets.midcast.Utsusemi = sets.midcast.SIRD

    sets.midcast['Blue Magic'] = sets.midcast.SIRD

    -- Physical spells with Str stat mod
    sets.midcast['Blue Magic'].Physical = {}

    -- Spells with heavy accuracy penalties, that need to prioritize accuracy first.
    sets.midcast['Blue Magic'].PhysicalAcc = set_combine(sets.midcast['Blue Magic'].Physical, {})
    -- Physical spells with Str stat mod
    sets.midcast['Blue Magic'].PhysicalStr = sets.midcast['Blue Magic'].Physical

    -- Physical spells with Dex stat mod
    sets.midcast['Blue Magic'].PhysicalDex = set_combine(sets.midcast['Blue Magic'].Physical, {})

	-- Physical spells with Vit stat mod
    sets.midcast['Blue Magic'].PhysicalVit = sets.midcast['Blue Magic'].Physical

    -- Physical spells with Agi stat mod
    sets.midcast['Blue Magic'].PhysicalAgi = set_combine(sets.midcast['Blue Magic'].Physical, {})

    -- Physical spells with Int stat mod
    sets.midcast['Blue Magic'].PhysicalInt = set_combine(sets.midcast['Blue Magic'].Physical, { })

    -- Physical spells with Mnd stat mod
    sets.midcast['Blue Magic'].PhysicalMnd = set_combine(sets.midcast['Blue Magic'].Physical, { })

    -- Physical spells with Chr stat mod
    sets.midcast['Blue Magic'].PhysicalChr = set_combine(sets.midcast['Blue Magic'].Physical, {ear1="Regal Earring", ear2="Enchntr. Earring +1"})

    -- Magical spells with the typical Int mod     
	sets.midcast['Blue Magic'].Magical = {	
		main="Naegling",
		sub="Sakpata's Sword",
		ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
		head={ name="Herculean Helm", augments={'"Mag.Atk.Bns."+21','Pet: Attack+24 Pet: Rng.Atk.+24','STR+4 DEX+4','Accuracy+20 Attack+20','Mag. Acc.+15 "Mag.Atk.Bns."+15',}},
		body="Hashishin Mintan +3",
		hands="Jhakri Cuffs +2",
		legs={ name="Augury Cuisses +1", augments={'Path: A',}},
		feet={ name="Amalric Nails", augments={'Mag. Acc.+11','"Mag.Atk.Bns."+11','"Conserve MP"+5',}},
		neck="Sibyl Scarf",
		waist="Sacro Cord",
		left_ear="Friomisi Earring",
		right_ear="Crematio Earring",
		left_ring="Mephitas's Ring",
		right_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
		back="Izdubar Mantle",}

    sets.midcast['Blue Magic'].Magical.Resistant = set_combine(sets.midcast['Blue Magic'].Magical, {})

    sets.midcast['Blue Magic'].MagicalDark = set_combine(sets.midcast['Blue Magic'].Magical, {})

    sets.midcast['Blue Magic'].MagicalLight = set_combine(sets.midcast['Blue Magic'].Magical, {})

    -- Magical spells with a primary Mnd mod
    sets.midcast['Blue Magic'].MagicalMnd = set_combine(sets.midcast['Blue Magic'].Magical, {})

    -- Magical spells with a Dex stat mod (on top of Int)
    sets.midcast['Blue Magic'].MagicalDex = set_combine(sets.midcast['Blue Magic'].Magical, {})

    -- Magical spells with a Vit stat mod (on top of Int)
    sets.midcast['Blue Magic'].MagicalVit = set_combine(sets.midcast['Blue Magic'].Magical, {})

    -- Magical spells with a primary Chr mod
    sets.midcast['Blue Magic'].MagicalChr = set_combine(sets.midcast['Blue Magic'].Magical, {})

    -- Magical spells (generally debuffs) that we want to focus on magic accuracy over damage.
    -- Add Int for damage where available, though.
    sets.midcast['Blue Magic'].MagicAccuracy = {}

    -- Breath-based spells - HP --
    sets.midcast['Blue Magic'].Breath = set_combine(sets.midcast['Blue Magic'].Magical, {head="Luh. Keffiyeh +3"})

    -- Stun spells
    sets.midcast['Blue Magic'].StunPhysical = set_combine(sets.midcast['Blue Magic'].MagicAccuracy, {})

    sets.midcast['Blue Magic'].StunMagical = sets.midcast['Blue Magic'].MagicAccuracy

    -- Healing spells
    sets.midcast['Blue Magic'].Healing = {}

    sets.midcast['Blue Magic'].HealingSelf = set_combine(sets.midcast['Blue Magic'].Healing, {
        legs="Gyve Trousers", -- 10
        neck="Phalaina Locket", -- 4(4)
        ring2="Asklepian Ring", -- (3)
        back="Solemnity Cape", --7
        waist="Gishdubar Sash", -- (10)
        })
	
	-- White Wind
    sets.midcast['Blue Magic']['White Wind'] = set_combine(sets.midcast['Blue Magic'].Healing, {})

    -- Buffs that depend on blue magic skill
	sets.midcast['Blue Magic'].SkillBasedBuff = sets.midcast['Blue Magic']

    sets.midcast['Blue Magic']['Occultation'] = set_combine(sets.midcast['Blue Magic'], {}) -- 1 shadow per 50 skill

    -- Other general buffs
    sets.midcast['Blue Magic'].Buff = sets.midcast['Blue Magic']
    sets.midcast['Blue Magic'].Refresh = set_combine(sets.midcast['Blue Magic'], {})
    sets.midcast['Blue Magic']['Carcharian Verve'] = set_combine(sets.midcast['Blue Magic'].Buff, {})
  
    sets.midcast['Enhancing Magic'] = {}

    sets.midcast.EnhancingDuration = {
		ammo="Staunch Tathlum",
		head={ name="Telchine Cap", augments={'Pet: DEF+18','"Elemental Siphon"+35','Enh. Mag. eff. dur. +9',}},
		body={ name="Telchine Chas.", augments={'Enh. Mag. eff. dur. +10',}},
		hands={ name="Telchine Gloves", augments={'Enh. Mag. eff. dur. +10',}},
		legs={ name="Telchine Braconi", augments={'Spell interruption rate down -9%','Enh. Mag. eff. dur. +10',}},
		feet={ name="Telchine Pigaches", augments={'Enh. Mag. eff. dur. +9',}},
		neck={ name="Loricate Torque +1", augments={'Path: A',}},
		waist="Flume Belt",
		left_ear="Eabani Earring",
		right_ear="Ethereal Earring",
		left_ring="Defending Ring",
		right_ring="Meridian Ring",
		back="Repulse Mantle",}

    sets.midcast.Refresh = set_combine(sets.midcast.EnhancingDuration, {})
    sets.midcast.Stoneskin = set_combine(sets.midcast.EnhancingDuration, {waist="Siegel Sash"})

    sets.midcast.Phalanx = set_combine(sets.midcast.EnhancingDuration, {})

    sets.midcast.Aquaveil = set_combine(sets.midcast.EnhancingDuration, {})

    sets.midcast.Protect = set_combine(sets.midcast.EnhancingDuration, {ring1="Sheltered Ring"})
    sets.midcast.Protectra = sets.midcast.Protect
    sets.midcast.Shell = sets.midcast.Protect
    sets.midcast.Shellra = sets.midcast.Protect

    sets.midcast['Enfeebling Magic'] = set_combine(sets.midcast['Blue Magic'].MagicAccuracy, {})

    sets.midcast.Utsusemi = sets.midcast.SIRD

----------------------------------------------------------
------------------------- Idle Sets ---------------------- 
----------------------------------------------------------

	-- 	state.IdleMode:options('Normal', 'DT', 'Evasion')
	--  state.OffenseMode:options('Normal', 'HasteII', 'HighHP')
    --  state.HybridMode:options('Normal', 'Armored', 'Evasion')
    --  state.WeaponskillMode:options('Normal', 'WSHP')

	--  Defense Modes.
	--  state.PhysicalDefenseMode:options('PDT')
    --  state.MagicalDefenseMode:options('MDT')

	--  state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MaxHP'}

	-- Idle Normal 
    sets.idle = {
		ammo="Brigantia Pebble",
		head="Nyame Helm",
		body="Hashishin Mintan +3",
		hands="Nyame Gauntlets",
		legs="Nyame Flanchard",
		feet="Nyame Sollerets",
		neck="Sibyl Scarf",
		waist="Flume Belt",
		left_ear="Eabani Earring",
		right_ear="Ethereal Earring",
		left_ring="Defending Ring",
		right_ring="Shneddick Ring +1",
		back="Repulse Mantle",} 	
		

	-- Idle DT 
    sets.idle.DT = {
		ammo="Brigantia Pebble",
		head="Nyame Helm",
		body="Shamash Robe",
		hands="Nyame Gauntlets",
		legs="Nyame Flanchard",
		feet="Nyame Sollerets",
		neck="Sibyl Scarf",
		waist="Flume Belt",
		left_ear="Eabani Earring",
		right_ear="Ethereal Earring",
		left_ring="Defending Ring",
		right_ring="Shadow Ring",
		back="Repulse Mantle",} 

	
	-- Idle Evasion 
    sets.idle.Evasion = {
		ammo="Brigantia Pebble",
		head="Malignance Chapeau",
		body="Malignance Tabard",
		hands="Malignance Gloves",
		legs="Malignance Tights",
		feet="Malignance Boots",
		--neck={ name="Loricate Torque +1", augments={'Path: A',}},
		neck={ name="Unmoving Collar +1", augments={'Path: A',}},		
		waist="Svelt. Gouriz +1",
		left_ear="Eabani Earring",
		right_ear={ name="Odnowa Earring +1", augments={'Path: A',}},
		left_ring="Defending Ring",
		right_ring="Fortified Ring",
		back={ name="Toutatis's Cape", augments={'AGI+20','Eva.+20 /Mag. Eva.+20','AGI+10','Enmity+10','DEF+50',}},} 

----------------------------------------------------------------------
------------------------- Defense Sets ------------------------------- 
----------------------------------------------------------------------
	-- 	state.IdleMode:options('Normal', 'DT', 'Evasion')
	--  state.OffenseMode:options('Normal', 'HasteII', 'HighHP')
    --  state.HybridMode:options('Normal', 'Armored', 'Evasion')
    --  state.WeaponskillMode:options('Normal', 'WSHP')

	--  Defense Modes.
	--  state.PhysicalDefenseMode:options('PDT')
    --  state.MagicalDefenseMode:options('MDT')

	--  state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MaxHP'}
	
    sets.defense.PDT = set_combine(sets.engaged, {neck="Incanter's Torque", body="Assim. Jubbah +2", hands="Assim. Bazu. +2", feet="Luhlaza Charuqs +1"})
		
	
	sets.defense.MDT = sets.idle
		
	-- Apply over Defense Sets 
    sets.MaxHP = {
		ammo="Brigantia Pebble",
		head="Malignance Chapeau",
		body="Malignance Tabard",
		hands="Malignance Gloves",
		legs="Malignance Tights",
		feet="Malignance Boots",
		neck={ name="Unmoving Collar +1", augments={'Path: A',}},
		waist="Reiki Yotai",
		left_ear={ name="Odnowa Earring +1", augments={'Path: A',}},
		right_ear="Tuisto Earring",
		left_ring="Defending Ring",
		right_ring={ name="Gelatinous Ring +1", augments={'Path: A',}},
		back="Moonbeam Cape",}
		
	-- Apply over Defense Sets 	
	sets.defense.MaxHP = sets.MaxHP
		
----------------------------------------------------------------------
----------------------------- 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
	
	-- * Blu Dual Wield:  
    
	-- 	state.IdleMode:options('Normal', 'DT', 'Evasion')
	--  state.OffenseMode:options('Normal', 'HasteII', 'HighHP')
    --  state.HybridMode:options('Normal', 'Armored', 'Evasion')
    --  state.WeaponskillMode:options('Normal', 'WSHP')

	--  Defense Modes.
	--  state.PhysicalDefenseMode:options('PDT')
    --  state.MagicalDefenseMode:options('MDT')

	--  state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MaxHP'}
	
	-- Normal Engaged -- 45% Magic Haste (11% DW to cap) 
    sets.engaged = {
		ammo="Ginsen",
		head="Malignance Chapeau",
		body="Malignance Tabard",
		hands="Malignance Gloves",
		--hands="Assim. Bazu. +2",
		legs="Malignance Tights",
		feet="Malignance Boots",
		neck="Lissome Necklace",
		waist="Reiki Yotai",
		left_ear="Eabani Earring",
		right_ear={ name="Hashi. Earring +1", augments={'System: 1 ID: 1676 Val: 0','Accuracy+13','Mag. Acc.+13','"Dbl.Atk."+4',}},
		left_ring="Lehko's Ring",
		right_ring="Chirich Ring +1",
		back="Grounded Mantle",}
		-- Total 7 
	
	-- Haste II Engaged -- 30% Magic Haste (26% DW to cap)
	sets.engaged.HasteII = set_combine(sets.engaged, {
		body={ name="Adhemar Jacket", augments={'DEX+10','AGI+10','Accuracy+15',}}, --5
		feet={ name="Taeon Boots", augments={'Accuracy+20 Attack+20','"Dual Wield"+5','Crit. hit damage +3%',}}, --9
		right_ear="Suppanomimi"})--5
		-- Reiki Yotai -- 7
		-- Total 30

	-- Evasion Engaged
	sets.engaged.HighHP = {
		ammo="Brigantia Pebble",
		head="Malignance Chapeau",
		body="Malignance Tabard",
		hands="Malignance Gloves",
		legs="Malignance Tights",
		feet="Malignance Boots",
		--neck={ name="Loricate Torque +1", augments={'Path: A',}},
		neck={ name="Unmoving Collar +1", augments={'Path: A',}},		
		waist="Svelt. Gouriz +1",
		left_ear="Eabani Earring",
		right_ear={ name="Odnowa Earring +1", augments={'Path: A',}},
		left_ring="Defending Ring",
		right_ring="Fortified Ring",
		back={ name="Toutatis's Cape", augments={'AGI+20','Eva.+20 /Mag. Eva.+20','AGI+10','Enmity+10','DEF+50',}},}	

----------------------------------------------------------------------
------------------------------ Hybrid Sets --------------------------- 
----------------------------------------------------------------------
	
	-- 	state.IdleMode:options('Normal', 'DT', 'Evasion')
	--  state.OffenseMode:options('Normal', 'HasteII', 'HighHP')
    --  state.HybridMode:options('Normal', 'Armored', 'Evasion')
    --  state.WeaponskillMode:options('Normal', 'WSHP')

	--  Defense Modes.
	--  state.PhysicalDefenseMode:options('PDT')
    --  state.MagicalDefenseMode:options('MDT')

	--  state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MaxHP'}

-- Hybrid Armored	
	sets.engaged.Armored = {
		ammo="Staunch Tathlum",
		head="Malignance Chapeau",
		body="Malignance Tabard",
		hands="Malignance Gloves",
		legs="Malignance Tights",
		feet="Malignance Boots",
		neck={ name="Loricate Torque +1", augments={'Path: A',}},
		waist="Reiki Yotai",
		left_ear="Eabani Earring",
		right_ear="Tuisto Earring",
		left_ring="Defending Ring",
		right_ring="Chirich Ring +1",
		back="Repulse Mantle",} 
	
	sets.engaged.HasteII.Armored = set_combine(sets.engaged.HasteII, sets.engaged.Armored)
	sets.engaged.HighHP.Armored = set_combine(sets.engaged.HighHP, sets.engaged.Armored)
	
-- Hybrid Evasion
	sets.engaged.Evasion = {
		ammo="Brigantia Pebble",
		head="Malignance Chapeau",
		body="Malignance Tabard",
		hands="Malignance Gloves",
		legs="Malignance Tights",
		feet="Malignance Boots",
		--neck={ name="Loricate Torque +1", augments={'Path: A',}},
		neck={ name="Unmoving Collar +1", augments={'Path: A',}},		
		waist="Svelt. Gouriz +1",
		left_ear="Eabani Earring",
		right_ear={ name="Odnowa Earring +1", augments={'Path: A',}},
		left_ring="Defending Ring",
		right_ring="Fortified Ring",
		back={ name="Toutatis's Cape", augments={'AGI+20','Eva.+20 /Mag. Eva.+20','AGI+10','Enmity+10','DEF+50',}},} 
		
	sets.engaged.HasteII.Evasion = set_combine(sets.engaged.HasteII, sets.engaged.Evasion)
	sets.engaged.HighHP.Evasion = set_combine(sets.engaged.HighHP, sets.engaged.Evasion)	
	


----------------------------------------------------------------------
--------------------------- Weapons Sets -----------------------------
----------------------------------------------------------------------

	-- Weapon Sets	
    -- state.WeaponSet = M{['description']='Weapon Set', 'Naegling', 'Tanmogayi', 'Maxentius'}
	
	-- state.SubSet = M{['description']='SubSet', 'Zantetsuken', 'sTanmogayi'}	
	
	-- state.RangedSet = M{['description']='Ranged Set', 'None', 'Trollbane'}		

    sets.Naegling = {main="Naegling"}
    
	sets.Tanmogayi = {main={ name="Tanmogayi +1", augments={'Path: A',}}}	
	
	sets.Rounsey = {main="Rounsey Wand"}

	-- state.SubSet = M{['description']='SubSet', 'Zantetsuken', 'sTanmogayi', 'Genbu'}
	
	sets.Zantetsuken = {sub="Zantetsuken"}
	
	sets.sTanmogayi = {sub={ name="Tanmogayi +1", augments={'Path: A',}}}
	
	sets.Genbu = {sub="Genbu's Shield"}
	
	-- state.RangedSet = M{['description']='Ranged Set', 'None', 'Trollbane'}
	
	sets.Trollbane = {range="Trollbane", ammo="None"}
	
		

----------------------------------------------------------------------
-------------------------- Extra Sets --------------------------------
----------------------------------------------------------------------

	-- Magic Burst
    sets.magic_burst = set_combine(sets.midcast['Blue Magic'].Magical, {})

	-- Doom
    sets.buff.Doom = {
        --neck="Nicander's Necklace", --20
        ring1="Blenmot's Ring +1",
		ring2="Blenmot's Ring",--10
        --ring2={name="Eshmun's Ring", bag="wardrobe4"}, --20
        waist="Gishdubar Sash",} --10

	-- Town --
    sets.idle.Town = set_combine(sets.idle, {})
    
	-- Adoulin
	sets.Adoulin = set_combine(sets.idle.Town, {
		body="Councilor's Garb"})	

	-- Kiting	
	sets.Kiting = {left_ring="Shneddick Ring +1",}
	
	-- Knockback
	sets.Knockback = {back="Repulse Mantle"}
		
	-- Moonshade
    sets.Moonshade = {right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},}
	
	-- Obi
	sets.Obi = {waist="Hachirin-no-Obi"}

	-- Default Shield
	sets.DefaultShield = {}
    
	-- WarpRings
	sets.WarpRings = {
		left_ring="Dim. Ring (Mea)", 
		right_ring="Warp Ring",}	
end

----------------------------------------------------------
--------------------- Functions --------------------------
----------------------------------------------------------

function job_pretarget(spell, action, spellMap, eventArgs)

	-- Prevent Out of Range WeaponSkill --	
	if spell.type == "WeaponSkill" and player.status == 'Engaged' and spell.target.distance > target_distance then 
       eventArgs.cancel=true
       add_to_chat(123, spell.name..' Canceled: [Out of Range]')
       return
    end

	-- Spectral Jig Cancel --	
	if spell.name == 'Spectral Jig' and buffactive.sneak then
            -- If sneak is active when using, cancel before completion
            send_command('cancel 71')
    end

	-- Auto Echo Drop --
	if AutoEcho and spell.action_type == 'Magic' and buffactive['Silence'] then
		cancel_spell()
		send_command('input /item "Echo Drops" <me>')
	end
end

-----------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs) 

	-- Valiance/Vallation/Liement Cancel
	if spell.name == 'Valiance' or spell.name == 'Vallation' or spell.name == 'Liement' then
		if buffactive['Valiance']  then
			cast_delay(0.2)
			windower.ffxi.cancel_buff(535)
		elseif buffactive['Vallation']  then
			cast_delay(0.2)
			windower.ffxi.cancel_buff(531)
		elseif buffactive['Liement'] then
			cast_delay(0.2)
			windower.ffxi.cancel_buff(537)
		end
	end

	-- Rune Enchantments 
	if rune_enchantments:contains(spell.english) then
        eventArgs.handled = true
    end	

	-- Utsusemi Cancel --
	if spellMap == 'Utsusemi' then
        if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
            cancel_spell()
            add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
            eventArgs.handled = true
            return
        elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
            send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
        end
    end

	-- Activate Unbridled Learning --
		if unbridled_spells:contains(spell.english) and not state.Buff['Unbridled Learning'] then
			eventArgs.cancel = true
			windower.send_command('@input /ja "Unbridled Learning" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
		end
end

-----------------------------------------------------------
function job_post_precast(spell, action, spellMap, eventArgs)	

	-- Change to Moonshade Earring if TP is less than 2750  -- (Exclude Defense Modes)
	if spell.type=="WeaponSkill" then		
		if state.OffenseMode.value ~= 'HighHP' and state.ExtraDefenseMode.value ~= 'MaxHP' then
			if moonshade_WS:contains(spell.english) and player.tp<2750 then equip({ear2="Moonshade Earring"})
			end
		end
	end

	-- Set Weaponskill WSHP to Engaged HighHP Set
	if spell.type == 'WeaponSkill' and state.OffenseMode.current == 'HighHP' then
		currentSpell = spell.english
		eventArgs.handled = true
		if spell.type == 'WeaponSkill' then
				equip(sets.precast.WS.WSHP)
		end
    end

	-- Set MaxHP Weaponskill to ExtraDefenseMode 
	if spell.type == 'WeaponSkill' and state.DefenseMode.current ~= 'None' and state.ExtraDefenseMode.current == 'MaxHP' then
        currentSpell = spell.english
		eventArgs.handled = true
		if spell.type == 'WeaponSkill' then
				equip(sets.precast.WS.MaxHP)
		end
    end 

	-- Aeolian Edge Tag --
	if spell.english == 'Aeolian Edge' and state.TreasureMode.value ~= 'None' 	then equip(sets.TreasureHunter)
	end

--  Elemental Weaponskill Belt Swap  
	if elemental_ws:contains(spell.name) then
        -- Matching double weather (w/o day conflict).
        if spell.element == world.weather_element and (get_weather_intensity() == 2 and spell.element ~= elements.weak_to[world.day_element]) then
        equip({waist="Hachirin-no-Obi"})
        -- Target distance under 1.7 yalms.
        --elseif spell.target.distance < (1.7 + spell.target.model_size) then
            --equip({waist="Orpheus's Sash"})
			--equip({waist="Hachirin-no-Obi"})
        -- Matching day and weather.
        elseif spell.element == world.day_element and spell.element == world.weather_element then
            equip({waist="Hachirin-no-Obi"})
        -- Target distance under 8 yalms.
        --elseif spell.target.distance < (8 + spell.target.model_size) then
            --equip({waist="Orpheus's Sash"})
			--equip({waist="Hachirin-no-Obi"})
        -- Match day or weather.
        elseif spell.element == world.day_element or spell.element == world.weather_element then
             equip({waist="Hachirin-no-Obi"})
		elseif spell.element ~= world.day_element or spell.element ~= world.weather_element then
             equip({waist="Sacro Cord"})
        end
	end

    -- Auto Unbridled Learning
	if unbridled_spells:contains(spell.english) and not state.Buff['Unbridled Learning'] then
        eventArgs.cancel = true
        windower.send_command('@input /ja "Unbridled Learning" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
    end   
end

----------------------------------------------------------
function job_midcast(spell, action, spellMap, eventArgs)

	-- Lock Midcast during DefenseMode
    if state.DefenseMode.value ~= 'None' and spell.type ~= 'JobAbility' then
        handle_equipping_gear(player.status)
        eventArgs.handled = true
    end 
end

----------------------------------------------------------
function job_post_midcast(spell, action, spellMap, eventArgs)
    -- Add enhancement gear for Chain Affinity, etc.
    if spell.skill == 'Blue Magic' then
        for buff,active in pairs(state.Buff) do
            if active and sets.buff[buff] then
                equip(sets.buff[buff])
            end
        end
        if spellMap == 'Magical' then
            if spell.element == world.weather_element and (get_weather_intensity() == 2 and spell.element ~= elements.weak_to[world.day_element]) then
                equip({waist="Hachirin-no-Obi"})
            end
        end
        if spellMap == 'Healing' and spell.target.type == 'SELF' then
            equip(sets.midcast['Blue Magic'].HealingSelf)
        end
    end

    if spell.skill == 'Enhancing Magic' and classes.NoSkillSpells:contains(spell.english) then
        equip(sets.midcast.EnhancingDuration)
        if spellMap == 'Refresh' then
            equip(sets.midcast.Refresh)
        end
    end
end
----------------------------------------------------------
function job_aftercast(spell, action, spellMap, eventArgs)
	
	if state.Buff[spell.english] ~= nil then
		state.Buff[spell.english] = not spell.interrupted or buffactive[spell.english]
	end

	-- Lock to Weapon Selection during Idle --	
	if player.status ~= 'Idle' and state.WeaponLock.value == false then
    check_weaponset()
	end

	-- Lock to Weapon Selection during Engaged --	
	if player.status ~= 'Engaged' and state.WeaponLock.value == false
	then
    check_weaponset()
	end
	
	-- Blue Magic Timers
	if not spell.interrupted then
        if spell.english == "Dream Flower" then
            send_command('@timers c "Dream Flower ['..spell.target.name..']" 90 down spells/00098.png')
        elseif spell.english == "Soporific" then
            send_command('@timers c "Sleep ['..spell.target.name..']" 90 down spells/00259.png')
        elseif spell.english == "Sheep Song" then
            send_command('@timers c "Sheep Song ['..spell.target.name..']" 60 down spells/00098.png')
        elseif spell.english == "Yawn" then
            send_command('@timers c "Yawn ['..spell.target.name..']" 60 down spells/00098.png')
        elseif spell.english == "Entomb" then
            send_command('@timers c "Entomb ['..spell.target.name..']" 60 down spells/00547.png')
        end
    end		
end

----------------------------------------------------------
function job_post_aftercast(spell, action, spellMap, eventArgs)
end

-----------------------------------------------------------
function job_buff_change(buff, gain, eventArgs)
   
-- Doom  
   if buff == "doom" then
        if gain then
            equip(sets.buff.Doom)
            send_command('@input /echo Doomed.')
             disable('ring1','ring2','waist')
        else
            enable('ring1','ring2','waist')
            handle_equipping_gear(player.status)
        end
    end
	
	if state.Buff[buff] ~= nil then
    	state.Buff[buff] = gain
        handle_equipping_gear(player.status)
    end
    
    if not midaction() then
        handle_equipping_gear(player.status)
    end
end

----------------------------------------------------------
function job_state_change(statefield, new_value, old_value)
    classes.CustomDefenseGroups:clear()
    classes.CustomDefenseGroups:append(state.ExtraDefenseMode.current)
	
	classes.CustomMeleeGroups:clear()
    classes.CustomMeleeGroups:append(state.ExtraDefenseMode.current)

	-- Weapon Lock --
	if state.WeaponLock.value == true then
        disable('main', 'sub')
    else
        enable('main', 'sub')
    end
	
	-- Ranged Lock --
	if state.RangedLock.value == true then
        disable('ranged', 'ammo')
    else
        enable('ranged', 'ammo')
    end
	
	check_weaponset() 
end

----------------------------------------------------------
function job_handle_equipping_gear(playerStatus, eventArgs)
	check_gear()
end

----------------------------------------------------------
function job_update(cmdParams, eventArgs)
    handle_equipping_gear(player.status)
    th_update(cmdParams, eventArgs)
	update_melee_groups()
end


----------------------------------------------------------
function job_get_spell_map(spell, default_spell_map)
    if spell.skill == 'Blue Magic' then
        for category,spell_list in pairs(blue_magic_maps) do
            if spell_list:contains(spell.english) then
                return category
            end
        end
    end
end

----------------------------------------------------------
function customize_idle_set(idleSet)	

--  Weapon Sets in Idle --
	-- state.WeaponSet = M{['description']='Weapon Set', 'Naegling', 'Tanmogayi', 'Maxentius'}

	if state.WeaponSet.value == 'Naegling' then idleSet = set_combine(idleSet, sets.Naegling)
	end
	
	if state.WeaponSet.value == 'Tanmogayi' then idleSet = set_combine(idleSet, sets.Tanmogayi)
	end
	
	if state.WeaponSet.value == 'Rounsey' then idleSet = set_combine(idleSet, sets.Rounsey)
	end

	-- state.SubSet = M{['description']='SubSet', 'Zantetsuken', 'Tanmogayi'}	

	if state.SubSet.value == 'Zantetsuken' then idleSet = set_combine(idleSet, sets.Zantetsuken)
	end
	
	if state.SubSet.value == 'sTanmogayi' then idleSet = set_combine(idleSet, sets.sTanmogayi)
	end
	
	if state.SubSet.value == 'Genbu' then idleSet = set_combine(idleSet, sets.Genbu)
	end

	-- 	state.RangedSet = M{['description']='Ranged Set', 'None', 'Trollbane'}
	if state.RangedSet.value == 'Trollbane' then idleSet = set_combine(idleSet, sets.Trollbane)
	end

	-- Kiting 
	if state.Kiting.value == true then
       idleSet = set_combine(idleSet, sets.Kiting)
    end

	-- Knockback 
	if state.Knockback.value == true then
       idleSet = set_combine(idleSet, sets.Knockback)
    end
	 
	-- Adoulin Counsilor's Garb	
	local res = require('resources')
    local info = windower.ffxi.get_info()
    local zone = res.zones[info.zone].name
    if zone:match('Adoulin') then
        idleSet = set_combine(idleSet, sets.Adoulin)
    end	
	
	-- Auto sync 'idle.IdleHP' with OffensiveMode 'HighHP'
	if state.OffenseMode.value == 'HighHP' or state.DefenseMode.value ~= "None" or state.ExtraDefenseMode.value == 'MaxHP' then
        idleSet = set_combine(idleSet, sets.idle.IdleHP)
    end	
	
	-- WarpRings
    if state.WarpRings.current == 'on' then
        idleSet = {left_ring="Dim. Ring (Mea)",
		right_ring="Warp Ring",}
        state.Kiting:set(false)
    end 		
	
    return idleSet	
end

----------------------------------------------------------
function customize_melee_set(meleeSet)

	-- state.WeaponSet = M{['description']='Weapon Set', 'Naegling', 'Tanmogayi', 'Rounsey'}

	if state.ExtraDefenseMode.value == 'MaxHP' then meleeSet = set_combine(meleeSet, sets.defense.MaxHP)
	end	

	if state.WeaponSet.value == 'Naegling' then meleeSet = set_combine(meleeSet, sets.Naegling)
	end

	if state.WeaponSet.value == 'Tanmogayi' then meleeSet = set_combine(meleeSet, sets.Tanmogayi)
	end
	
	if state.WeaponSet.value == 'Rounsey' then meleeSet = set_combine(meleeSet, sets.Rounsey)
	end	

	-- state.SubSet = M{['description']='SubSet', 'Zantetsuken', 'sTanmogayi', 'Genbu"}

	if state.SubSet.value == 'Zantetsuken' then meleeSet = set_combine(meleeSet, sets.Zantetsuken)
	end

	if state.SubSet.value == 'sTanmogayi' then meleeSet = set_combine(meleeSet, sets.sTanmogayi)
	end
	
	if state.SubSet.value == 'Genbu' then meleeSet = set_combine(meleeSet, sets.Genbu)
	end

	-- state.RangedSet = M{['description']='Ranged Set', 'Trollbane'}

	if state.RangedSet.value == 'Trollbane' then meleeSet =set_combine(meleeSet, sets.Trollbane)
	end

-- Treasure Hunter --
	if state.TreasureMode.value == 'Fulltime' then
        meleeSet = set_combine(meleeSet, sets.TreasureHunter)
    end

-- Kiting -- 
	if state.Kiting.value == true then
       meleeSet = set_combine(meleeSet, sets.Kiting)
    end

-- Knockback --
	if state.Knockback.value == true then
       meleeSet = set_combine(meleeSet, sets.Knockback)
    end

-- WarpRings
    if state.WarpRings.current == 'on' then
        meleeSet = sets.WarpRings
        state.Kiting:set(false)
    end 

	check_weaponset()

    return meleeSet
end

----------------------------------------------------------
function customize_defense_set(defenseSet)
    if state.ExtraDefenseMode.value ~= 'None' then
        defenseSet = set_combine(defenseSet, sets[state.ExtraDefenseMode.value])
    end
     
    if state.Buff.Doom then
        defenseSet = set_combine(defenseSet, sets.buff.Doom)
    end
     
    return defenseSet
end

----------------------------------------------------------
function display_current_job_state(eventArgs)

    local r_msg = state.Runes.current
    local r_color = ''
    if state.Runes.current == 'Ignis' then r_color = 167
    elseif state.Runes.current == 'Gelus' then r_color = 210
    elseif state.Runes.current == 'Flabra' then r_color = 204
    elseif state.Runes.current == 'Tellus' then r_color = 050
    elseif state.Runes.current == 'Sulpor' then r_color = 215
    elseif state.Runes.current == 'Unda' then r_color = 207
    elseif state.Runes.current == 'Lux' then r_color = 001
    elseif state.Runes.current == 'Tenebrae' then r_color = 160 end

	-- Weapons Message
	local z_msg = state.WeaponSet.value .. '/' 
	local s_msg = state.SubSet.value
	
	-- Idle Message
	local i_msg = state.IdleMode.value

	-- Melee/Hybrid Message
    local m_msg = state.OffenseMode.value
    if state.HybridMode.value ~= 'Normal' then
        m_msg = m_msg .. '/' ..state.HybridMode.value
    end

	-- Treasure Mode Message
    local t_msg = ''
	if state.TreasureMode.value ~= 'None' then
		t_msg = t_msg .. ' TH:' .. state.TreasureMode.value
	end

    -- Knockback Message
	local k_msg = ''
	if state.Knockback.value then
        k_msg = k_msg .. ' Knockback:On'
    end

    -- Kiting  Message
	local kit_msg = ''
	if state.Kiting.value then
        kit_msg = kit_msg .. ' Kiting:On'
    end
	
	-- Defense Mode/Extra Defense Mode Message
	local d_msg = ''  
	if state.DefenseMode.value ~= 'None' then
        d_msg = d_msg .. ' ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
    end    

	-- Extra Defense Mode
	if state.ExtraDefenseMode.value ~= 'None' then
        d_msg = d_msg .. ' ' .. state.ExtraDefenseMode.value
    end
	
	-- Weaponskill Mode Message
    local ws_msg = ''
	if state.WeaponskillMode.value ~= 'Normal' then
		ws_msg = ws_msg .. ' WS:'.. state.WeaponskillMode.value
	end

	-- Melee/Hybrid > Idle > (Knockback) > (Kiting) > (Defense) > TH > (Magic Burst) > (WS) > 
    
	add_to_chat(002,  ' # '
	-- Dagger/Sub
	..string.char(31,122).. z_msg
	..string.char(31,122).. s_msg
	..string.char(31,002)..  ' #'

	-- Offense Mode/Melee
	..string.char(31,122).. ' Melee:'
	..string.char(31,122).. m_msg
	..string.char(31,002)..  ' #'

	-- TH Mode 
	..string.char(31,122).. t_msg
	..string.char(31,002)..  ' #'

	-- Idle
	..string.char(31,122).. ' Idle:' 
	..string.char(31,122)..i_msg
	..string.char(31,002)..  ' #'

	-- Knockback
	..string.char(31,004)..k_msg
	..string.char(31,002)..  ' #'

	-- Kiting 
	..string.char(31,004)..kit_msg 
	..string.char(31,002)..  ' #'	

	-- Defense Mode 
	..string.char(31,004)..d_msg
	..string.char(31,002)..  ' #'
	
	-- WS Mode only shows when has value.
	..string.char(31,207)..ws_msg
	..string.char(31,002)..  ' #'	
	)
	
    eventArgs.handled = true
end

----------------------------------------------------------
function job_get_spell_map(spell, default_spell_map)
    if spell.skill == 'Blue Magic' then
        for category,spell_list in pairs(blue_magic_maps) do
            if spell_list:contains(spell.english) then
                return category
            end
        end
    end
end

----------------------------------------------------------
function check_buff(buff_name, eventArgs)
    if state.Buff[buff_name] then
        equip(sets.buff[buff_name] or {})
        if state.TreasureMode.value == 'Fulltime' then
            equip(sets.TreasureHunter)
        end
        eventArgs.handled = true
    end
end


----------------------------------------------------------
function job_self_command(cmdParams, eventArgs)
    if cmdParams[1]:lower() == 'rune' then
        send_command('@input /ja '..state.Runes.value..' <me>')
    end
end

----------------------------------------------------------
function determine_idle_group()
    classes.CustomIdleGroups:clear()
    if areas.Adoulin:contains(world.area) then
    classes.CustomIdleGroups:append('Adoulin')
    end
end

----------------------------------------------------------
function update_active_abilities()
    state.Buff['Burst Affinity'] = buffactive['Burst Affinity'] or false
    state.Buff['Efflux'] = buffactive['Efflux'] or false
    state.Buff['Diffusion'] = buffactive['Diffusion'] or false
end

----------------------------------------------------------
-- State buff checks that will equip buff gear and mark the event as handled.
function apply_ability_bonuses(spell, action, spellMap)
    if state.Buff['Burst Affinity'] and (spellMap == 'Magical' or spellMap == 'MagicalLight' or spellMap == 'MagicalDark' or spellMap == 'Breath') then
        if state.MagicBurst.value then
            equip(sets.magic_burst)
        end
        equip(sets.buff['Burst Affinity'])
    end
    if state.Buff.Efflux and spellMap == 'Physical' then
        equip(sets.buff['Efflux'])
    end
    if state.Buff.Diffusion and (spellMap == 'Buffs' or spellMap == 'BlueSkill') then
        equip(sets.buff['Diffusion'])
    end

    if state.Buff['Burst Affinity'] then equip (sets.buff['Burst Affinity']) end
    if state.Buff['Efflux'] then equip (sets.buff['Efflux']) end
    if state.Buff['Diffusion'] then equip (sets.buff['Diffusion']) end
end

----------------------------------------------------------
function update_melee_groups()
    classes.CustomMeleeGroups:clear()
end

----------------------------------------------------------
function check_gear()
end

----------------------------------------------------------
function check_weaponset()
	equip(sets[state.WeaponSet.current])
end

----------------------------------------------------------
windower.register_event('zone change',
function()
end)
 Carbuncle.Nynja
Offline
Server: Carbuncle
Game: FFXI
user: NynJa
Posts: 2372
By Carbuncle.Nynja 2024-04-05 23:08:29
Link | Quote | Reply
 
drakefs said: »
Carbuncle.Nynja said: »
People with ***like this wonder why the games so *** laggy.

The game is "so *** laggy" because the servers are across the world and the network stack is 20+ years old.

It is so simple to check, jut play vanilla. Does it still lag? Yup.
TIL players on vanilla client are on their own server
Offline
Posts: 882
By Dodik 2024-04-06 07:48:10
Link | Quote | Reply
 
Makes no difference to lag whether you have ***like this in GS, GS loaded or not or even windower loaded or not.

But you keep banging that drum.
Offline
Posts: 399
By drakefs 2024-04-06 15:48:53
Link | Quote | Reply
 
Carbuncle.Nynja said: »
TIL players on vanilla client are on their own server

You believe what you want, it doesn't make it fact.

If players in Japan had the same lag as those in NA, your belief may have had some truth to it. But they don't, so it is very likely your belief is wrong.
VIP
Offline
Posts: 677
By Lili 2024-04-06 17:42:32
Link | Quote | Reply
 
Basic GS stuff doesn't make any difference regarding lag, but Selindrile's suite is infamous for doing way too much stuff twice per second and making the client stutter, depending on how beefy your PC if.

Lag and stutter are not the same thing, but too much crap in your gs file will affect performance.
[+]
Offline
Posts: 399
By drakefs 2024-04-06 20:09:57
Link | Quote | Reply
 
Lili said: »
Basic GS stuff doesn't make any difference regarding lag, but Selindrile's suite is infamous for doing way too much stuff twice per second and making the client stutter, depending on how beefy your PC if.

Lag and stutter are not the same thing, but too much crap in your gs file will affect performance.

I understand that but lets be clear here:

Carbuncle.Nynja said: »
drakefs said: »
Carbuncle.Nynja said: »
People with ***like this wonder why the games so *** laggy.

The game is "so *** laggy" because the servers are across the world and the network stack is 20+ years old.

It is so simple to check, jut play vanilla. Does it still lag? Yup.
TIL players on vanilla client are on their own server

implies that GS is causing the server to lag and therefore lag for other players.

GS does not cause 2500ms+ of latency or dropped packets (not even Selindrile's stuff). Nor does it cause lag for other players not even using GS.
Offline
Posts: 483
By Hopalong 2024-04-06 20:48:26
Link | Quote | Reply
 
I think its the way the program (gearswap) interfaces with the program (ffxi) while constantly having to update information through the internet. Lots of queries going on.

Everyone knows the more you automate, the more it breaks.
[+]
Offline
Posts: 882
By Dodik 2024-04-07 07:05:12
Link | Quote | Reply
 
Selindrile's stuff is not even the worst offender when it comes to stutter and client side performance, though yes, best to turn off most of the automation.

Some UI mods like xivparty will make the client very slow.

Neither of these things is related to game lag as in client<->server performance.
 Shiva.Thorny
Offline
Server: Shiva
Game: FFXI
user: Rairin
Posts: 2155
By Shiva.Thorny 2024-04-07 07:18:26
Link | Quote | Reply
 
Dodik said: »
Neither of these things is related to game lag as in client<->server performance.

They are, in a way. The server has to send a response for each piece of equipment you change, and the primary cause of poor server<>client performance in instances is because the server has a maximum packet size and an associated queue that gets too full. When you hit your macro with gearswap loaded, you might be sending 12-15 precast swaps, 12-15 midcast swaps, and an action packet. This means the server has to fit up to 30 equipment responses in, as well as queue appearance changes for everyone around you if you aren't using lockstyle. If you double tap the macro, because windower injects packets and doesn't rate limit, you could double that and require 60 equipment responses. That's almost half of your packet allotment just going to equipment changes. If your ability doesn't appear to be going off and you start mashing it, you compound those issues even more.

I'm not advocating against using gearswap or equipment swaps, but a group with minimal equipment changes is going to have much better instance performance than one where everyone is using gearswap+react.

Client side stutter is almost all caused by bad code. The amount of things displayed by xivparty, or the amount of calculation needed to do what Selindrile's does are not enough to cause lag on their own. You need poor optimization and bad design mixed in.
[+]
 Asura.Dexprozius
Offline
Server: Asura
Game: FFXI
Posts: 371
By Asura.Dexprozius 2024-04-12 06:35:52
Link | Quote | Reply
 
Does anyone have a patch to Singer to get it to recognize Aria of Passion?
Offline
Server: Asura
Game: FFXI
user: Raytheon
Posts: 428
By Asura.Clintbeastwood 2024-04-12 14:42:25
Link | Quote | Reply
 
Shiva.Thorny said: »
That's almost half of your packet allotment just going to equipment changes.

Honest curious question: Have you done packet captures to measure this? Do you know what the MTU is set to? Assuming it's default, does 60 equipment responses really eat ~750 bytes? Even if it exceeded whatever the MTU is set to, wouldn't it just fragment and result in another packet (which still shits up the network but)?
 Bismarck.Drakelth
Offline
Server: Bismarck
Game: FFXI
user: drakelth
Posts: 698
By Bismarck.Drakelth 2024-04-12 14:46:50
Link | Quote | Reply
 
Asura.Clintbeastwood said: »
Shiva.Thorny said: »
That's almost half of your packet allotment just going to equipment changes.

Honest curious question: Have you done packet captures to measure this? Do you know what the MTU is set to? Assuming it's default, does 60 equipment responses really eat ~750 bytes? Even if it exceeded whatever the MTU is set to, wouldn't it just fragment and result in another packet (which still shits up the network but)?

I'm curious too, I know a couple people who argue changing gear sets is bad on this basis
Offline
Posts: 36
By Pulptenks 2024-04-12 14:47:30
Link | Quote | Reply
 
ChatGPT helped me to solve my saber dancer cancel when i gotta rush waltz out. Why nobody could do that here?
Offline
Server: Asura
Game: FFXI
user: Raytheon
Posts: 428
By Asura.Clintbeastwood 2024-04-12 14:54:06
Link | Quote | Reply
 
Pulptenks said: »
ChatGPT helped me to solve my saber dancer cancel when i gotta rush waltz out. Why nobody could do that here?

Arislan's default DNC lua already does this. It also lets you reapply Haste Samba and auto-cancels Fan Dance.
 Bismarck.Drakelth
Offline
Server: Bismarck
Game: FFXI
user: drakelth
Posts: 698
By Bismarck.Drakelth 2024-04-12 14:59:09
Link | Quote | Reply
 
Asura.Clintbeastwood said: »
Pulptenks said: »
ChatGPT helped me to solve my saber dancer cancel when i gotta rush waltz out. Why nobody could do that here?

Arislan's default DNC lua already does this. It also lets you reapply Haste Samba and auto-cancels Fan Dance.

Mine must be outa date cause it only has that function for shadows lol. Seems the version on his git hub also lacks this function.
Offline
Server: Asura
Game: FFXI
user: Raytheon
Posts: 428
By Asura.Clintbeastwood 2024-04-12 15:02:23
Link | Quote | Reply
 
Bismarck.Drakelth said: »
Asura.Clintbeastwood said: »
Pulptenks said: »
ChatGPT helped me to solve my saber dancer cancel when i gotta rush waltz out. Why nobody could do that here?

Arislan's default DNC lua already does this. It also lets you reapply Haste Samba and auto-cancels Fan Dance.

Mine must be outa date cause it only has that function for shadows lol

I think the Cancel plugin is doing that for you. I don't believe my DNC lua is modified, but it also auto-Presto's before steps if it's up, and uses the most appropriate curing waltz based on the missing HP from the target being cured. I prefer more manual control over most of my other luas, but his DNC one feels really good for how I play DNC (lazily).

You have to macro-cast for it to work btw, can't do it from menu or you'll get blocked from performing the action due to whichever stance you're in.
First Page 2 3 ... 181 182 183
Log in to post.