Gearswap Support Thread

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 102 103 104 ... 182 183 184
 Fenrir.Brimstonefox
Offline
Server: Fenrir
Game: FFXI
user: Brimstone
Posts: 183
By Fenrir.Brimstonefox 2016-06-13 23:07:35
Link | Quote | Reply
 
That won't work, I'm essentially trying to make sam (or /sam) operate efficiently (I have a similar one for war) I originally had this for just hasso because I would often forget to put it back up. The code below does work, however it often tries to fire off 3-4 ja at once, so only 1 thing goes. (its int job buff change, so it tends to get spammed, but I feel it could work cleaner).

(if you look at the commented out part I did used to have flag commands, but I think this works better watching the recast just trying to figure out how to make it work cleaner. So here it is w/o abstraction (command/debug stuff included):
Code
-- the id #s for each abil come from the index value in abils.xml
function handle_sam_ja() 
	if not areas.Cities:contains(world.area) and not (buffactive.Sneak or buffactive.Invisible) then
		local abil_recasts = windower.ffxi.get_ability_recasts()
		if state.Stance.value == 'Offensive' then
			if not buffactive.Hasso and player.status == "Engaged" and abil_recasts[138] == 0 then
				-- add_to_chat(122,'no hasso ')
				windower.send_command('@input /ja "Hasso" <me>')
				add_to_chat(1,'sleeping hasso ')
				-- coroutine.sleep(2)
				add_to_chat(3,'done sleeping hasso ')
			end
			if player.tp < 400 and abil_recasts[134] == 0 then
				-- add_to_chat(122,'low tp ')
				-- windower.send_command('@input /ja "Meditate" <me>; wait 180; gs c reset_med_flag')
				windower.send_command('@input /ja "Meditate" <me>')
				add_to_chat(1,'sleeping meditate')
				-- coroutine.sleep(2)
				add_to_chat:schedule(1,3,'done sleeping meditat')
			end
			if player.tp > 2000 and abil_recasts[140] == 0 and player.status == "Engaged" then
				-- add_to_chat(122,'high tp ')
				-- windower.send_command('@input /ja "Sekkanoki" <me>; wait 300; gs c reset_sekka_flag')
				windower.send_command('@input /ja "Sekkanoki" <me>')
				add_to_chat(1,'sleeping ')
				-- coroutine.sleep(2)
				add_to_chat:schedule(1,3,'done sleeping ')
			end
			if not buffactive.ThirdEye and abil_recasts[133] == 0 and player.status == "Engaged" then
				-- windower.send_command('@input /ja "Third Eye" <me>; wait 60; gs c reset_thirdeye_flag')
				windower.send_command('@input /ja "Third Eye" <me>')
				add_to_chat(1,'sleeping ')
				-- coroutine.sleep(2)
				add_to_chat:schedule(1,3,'done sleeping ')
			end
		end
		if state.Stance.value == 'Defensive' then
			if not buffactive.ThirdEye and abil_recasts[133] == 0 and abil_recasts[139] == 0 then
				windower.send_command('@input  /ja "Seigan" <me>; wait 1.5; input /ja "Third Eye" <me>')
			end
		end
	end
end

 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 660
By Ragnarok.Flippant 2016-06-14 01:04:12
Link | Quote | Reply
 
Personally, I'd print alerts for myself so that I could use those JAs when I feel is most convenient.

But if that's how you want to handle it, you should just be using elseif statements, and call this function in a place where it would be triggered after you do an action, like aftercast. The first time it reads through, it will use Hasso (if conditions are met); from Hasso's aftercast, it will use Meditate (if conditions are met), etc.

But you'd probably want to schedule the call to this function by one second, to satisfy the JA delay.
[+]
Offline
Posts: 429
By Selindrile 2016-06-14 09:31:10
Link | Quote | Reply
 
Sounds like the clock I suggested would work well for this, pardon me if this is hard to read, I basically copied this from one of my gearswaps and deleted a lot for brevity.
Code
function job_setup()
	ticktock = 'off'
	windower.send_command('@wait 15;gs c ticktock')
end

function job_self_command(commandArgs, eventArgs)

	if commandArgs[1] == 'ticktock' then
		if ticktock == 'off' then
			ticktock = 'on'
			windower.send_command('gs c tick')
		end
    elseif commandArgs[1] == 'tick' and ticktock == 'on' then
		tick()
		windower.send_command('@wait 3;gs c tick')
	end

end

function tick()
   if situationsishouldntbeautodoingstuff then return
   elseif checkseigan() then return
   elseif checkhasso() then return
   elseif checktp() then return
   end
end


Functions all check if the situation is appropriate to do an action, if it is, it sends the action command and returns true, else it returns false.
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-14 10:36:06
Link | Quote | Reply
 
Can anyone tell me how to append the name of a set in GS? I am using a modified Motes Lua.

example
Sets
Code
set.resting = {}
set.resting.death = {}


Function
Code
function custommode()
	sets.resting:clear()
	if state.customMode.value == 'Custom' then
	sets.resting:append('Death')
	end
end

Error if I leave written as is:
Code
Gearswap has detected an error in the user function get_sets:
...<snip>: attempt to call method 'clear' (a nil value)

Error if I remove sets.resting:clear():
Code
Gearswap has detected an error in the user function self_command:
...<snip>: attempt to call method 'append' (a nil value)


I am stuck is it possible to append a setname? I assume it is since I do it with the haste sets for combat which is covered by the classes.CustomMeleeGroups but how do I do it for sets that are not part of that group?

Thank you for the help!
Offline
Posts: 429
By Selindrile 2016-06-14 10:48:20
Link | Quote | Reply
 
Code
function job_setup()
	state.DeathMode = M(false, 'Death Mode')
end

function job_precast(spell, action, spellMap, eventArgs)
        if state.DeathMode.value then
            classes.CustomClass = 'Death'
        end
end


I -THINK- this is how you'd do it in Motes, but it's untested, I have my deathmode as some logic in customize_idle and precast/midcast.
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-14 11:22:26
Link | Quote | Reply
 
Selindrile said: »
[code]function job_setup()
I -THINK- this is how you'd do it in Motes, but it's untested, I have my deathmode as some logic in customize_idle and precast/midcast.

Damn no luck. It does not error anymore but no gear switches either.

If I write it like this

classes.CustomIdleGroups:append('Death')

it works but only for idle not pre mid and aspir or burst.
Offline
Posts: 429
By Selindrile 2016-06-14 11:28:11
Link | Quote | Reply
 
Well, all that would do is apply to precast.death and midcast.death, I think.

Wanna take a look at my Blm and see how I have it done?

Dropbox Link Here
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-14 11:36:35
Link | Quote | Reply
 
Well that certainly gives me an idea on something... I will let you know how it turns out.
Offline
Posts: 429
By Selindrile 2016-06-14 11:41:18
Link | Quote | Reply
 
The way I use this is toggle deathmode on, which sets me to higher mp idle, and changes my midcast aspir so that I have higher max mp, aspir to full, cast death, and it resets the mode, you could make it lock if you were just going to be spamming death over and over and don't want to reset the mode, but I prefer to micromanage a bit.
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-14 11:57:24
Link | Quote | Reply
 
Yeah it works for idle but no other sets will append. I will keep tinkering with it. Thanks for the replies maybe Byrth or Rooks can give me an idea here.
 Quetzalcoatl.Orestes
Offline
Server: Quetzalcoatl
Game: FFXI
user: Orestes78
Posts: 430
By Quetzalcoatl.Orestes 2016-06-14 12:35:28
Link | Quote | Reply
 
Phoenix.Keido said: »
Yeah it works for idle but no other sets will append. I will keep tinkering with it. Thanks for the replies maybe Byrth or Rooks can give me an idea here.

When you tested Selindrile's example, did you toggle state.DeathMode to TRUE? I think he assumes you're either toggling it with a hotkey, or dynamically within your code.

If you want to add custom sets in the context of precast + midcast, classes.CustomClass is a good tool for the job. Note that classes.CustomClass reset/clears itself automatically on aftercast, so you don't have to manage that yourself like you would with CombatForm, CombatWeapon, and CustomMeleeGroups.

Besides using CustomClass, you can override "spellMap" as an alternative means for creating custom sets.
Code
-- for example, this would enable sets.midcast.DeathAspir = {}
function job_get_spell_map(spell, default_spell_map)
    if state.DeathMode.value and default_spell_map == 'Aspir' then
        return 'DeathAspir'
    end
end


You'll have to //gs c toggle DeathMode, or call state.DeathMode:toggle() in your lua somewhere.

Mote uses his "Mode" class a lot within his files. i.e. state.MyMode = M{'Value1', 'Value2'} The comments in Modes.lua are pretty helpful. https://github.com/Kinematics/Mote-libs/blob/master/Modes.lua
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-14 12:51:05
Link | Quote | Reply
 
From top to bottom this is what I have
Code
function job_setup()
    state.Buff.Doom = 														buffactive.Doom or false
	state.Buff['Mana Wall'] = 												buffactive['Mana Wall'] or false
	----------------------------------------------------------------
	-- Toggle between elemental mage and death Mage
	----------------------------------------------------------------
	state.MageMode = 														M{['description']='Mage Mode', 'Elemental Mage', 'Death Mage'}
end


Next is
Code
function user_setup()
    state.OffenseMode:options('Normal')
    state.CastingMode:options('Normal', 'Resistant')
    state.IdleMode:options('Normal')
	state.MagicBurst = M(false, 'Magic Burst')
	----------------------------------------------------------------
	-- Custom magic tiers
	----------------------------------------------------------------	
	lowTierNukes = S{'Stone', 'Water', 'Aero', 'Fire', 'Blizzard', 'Thunder',
					'Stone II', 'Water II', 'Aero II', 'Fire II', 'Blizzard II', 'Thunder II',
					'Stone III', 'Water III', 'Aero III', 'Fire III', 'Blizzard III', 'Thunder III',
					'Stonega', 'Waterga', 'Aeroga', 'Firaga', 'Blizzaga', 'Thundaga',
					'Stonega II', 'Waterga II', 'Aeroga II', 'Firaga II', 'Blizzaga II', 'Thundaga II'}
 	AncientMagic = S{'Quake II','Tornado II','Freeze II','Flare II','Flood II','Burst II',}   
	----------------------------------------------------------------
	-- Additional local binds
	----------------------------------------------------------------
    send_command('bind ^` input /ma Stun <t>;input /echo Target <t> Stunned')
    send_command('bind ^z gs c toggle MagicBurst')
	send_command('bind ^x gs c cycle MageMode')
	----------------------------------------------------------------
	-- Select Mage Mode for Spells
	----------------------------------------------------------------    
	magemode()
	----------------------------------------------------------------
	-- Select macro book
	----------------------------------------------------------------
    select_default_macro_book()
end


Then in
Code
function init_gear_sets()
sets.idle.Death
sets.precast.FC.Death
sets.midcast.Aspir.Death
sets.midcast.Death
sets.magic_burst.death
end


And finally
Code
----------------------------------------------------------------------------
-- Called by the default 'update' self-command.
----------------------------------------------------------------------------
function display_current_job_state(eventArgs)
    display_current_caster_state()
    eventArgs.handled = true
end
function job_update(cmdParams, eventArgs)
	magemode()
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function magemode()
	classes.CustomIdleGroups:clear()
	if state.MageMode.value == 'Death Mage' then
		add_to_chat(8, '-------------Death Mage Mode Enabled--------------')
		classes.CustomIdleGroups:append('Death')
	end
end


Now when I hit CTRL+X my idle mode switches instantly but the others do not append to the .Death

Is that more or less clear than the original post. Also if anyone wants to see the GS I will gladly post it.
 Quetzalcoatl.Orestes
Offline
Server: Quetzalcoatl
Game: FFXI
user: Orestes78
Posts: 430
By Quetzalcoatl.Orestes 2016-06-14 13:06:50
Link | Quote | Reply
 
Ok, add the following to job_precast()
Code
function job_precast(spell, action, spellMap, eventArgs)
    if state.MageMode.value == 'Death Mage' then
       classes.CustomClass = 'Death'
    end
end


CustomClass's generally have to be applied this way "as you're casting the spell" because they do not persist beyond aftercast.
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-14 13:17:59
Link | Quote | Reply
 
Bah so I just misunderstood Selindrile's solution. Now Debug shows I am getting in the correct sets for Precast. Do I need to add that line to any others or is it good through out the life of the spell?
 Quetzalcoatl.Orestes
Offline
Server: Quetzalcoatl
Game: FFXI
user: Orestes78
Posts: 430
By Quetzalcoatl.Orestes 2016-06-14 15:00:05
Link | Quote | Reply
 
Phoenix.Keido said: »
Bah so I just misunderstood Selindrile's solution. Now Debug shows I am getting in the correct sets for Precast. Do I need to add that line to any others or is it good through out the life of the spell?

It's good for the life of the spell. When aftercast() is complete, classes.CustomClass is empty. The next time you cast, it's set, etc.
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-14 15:27:43
Link | Quote | Reply
 
Thank you both Orestes and Selindrile everything is working as I hoped it would. Really appreciate it!
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-17 18:28:32
Link | Quote | Reply
 
While toggled to in "Death Mage" Mode when I cast Aspir 1 2 or 3 it will not use the midcast.Aspir.Death set it just uses midcast.Death.

I thought it would transform to midcast.Aspir.Death with the classes.CustomClass = 'Death' set in the precast.

How can I force it to use the correct set? I have tried everything I can think of and am not getting anywhere. Again thank you for the help!

BLM.LUA
Code
--------------------------------------------------------------------------------------------------------------------	
-- SETUP FUNCTIONS FOR THIS JOB.
--------------------------------------------------------------------------------------------------------------------	
----------------------------------------------------------------------------
-- Initialization function for this job file.
----------------------------------------------------------------------------
function get_sets()
    mote_include_version = 2
    ----------------------------------------------------------------
    -- Load and initialize the include file.
	----------------------------------------------------------------
    include('Mote-Include.lua')
	----------------------------------------------------------------
	-- Load organizer add on to grab all gear associated with lua.
	----------------------------------------------------------------
	include('organizer-lib')
end
----------------------------------------------------------------------------
-- Setup vars that are user-independent.
----------------------------------------------------------------------------
function job_setup()
    state.Buff.Doom = 														buffactive.Doom or false
	state.Buff['Mana Wall'] = 												buffactive['Mana Wall'] or false
	----------------------------------------------------------------
	-- Toggle between elemental mage and death Mage
	----------------------------------------------------------------
	state.MageMode = 														M{['description']='Mage Mode', 'Elemental Mage', 'Death Mage'}
end
--------------------------------------------------------------------------------------------------------------------
-- USER SETUP FUNCTIONS FOR THIS JOB FILE.  
--------------------------------------------------------------------------------------------------------------------
function user_setup()
    state.OffenseMode:options('Normal')
    state.CastingMode:options('Normal', 'Resistant')
    state.IdleMode:options('Normal','Low_HP')
	state.MagicBurst = M(false, 'Magic Burst')
	----------------------------------------------------------------
	-- Custom magic tiers
	----------------------------------------------------------------	
	lowTierNukes = 															S{'Stone', 'Water', 'Aero', 'Fire', 'Blizzard', 'Thunder',
																			'Stone II', 'Water II', 'Aero II', 'Fire II', 'Blizzard II', 'Thunder II',
																			'Stone III', 'Water III', 'Aero III', 'Fire III', 'Blizzard III', 'Thunder III',
																			'Stonega', 'Waterga', 'Aeroga', 'Firaga', 'Blizzaga', 'Thundaga',
																			'Stonega II', 'Waterga II', 'Aeroga II', 'Firaga II', 'Blizzaga II', 'Thundaga II'}
 	AncientMagic = 															S{'Quake II','Tornado II','Freeze II','Flare II','Flood II','Burst II',}   
	----------------------------------------------------------------
	-- Sorcerer's ring 
	----------------------------------------------------------------
	gear.Ring =		 														{name="Shiva Ring"}
    gear.SorcersRing = 														"Sorcerer's Ring"
    gear.NormalNukeRing = 													"Shiva ring"
	----------------------------------------------------------------
	-- Additional local binds
	----------------------------------------------------------------
    send_command('bind ^` input /ma Stun <t>;input /echo Target <t> Stunned')
    send_command('bind ^z gs c toggle MagicBurst')
	send_command('bind ^x gs c cycle MageMode')
	----------------------------------------------------------------
	-- Select Mage Mode for Spells
	----------------------------------------------------------------    
	magemode()
	----------------------------------------------------------------
	-- Select Sorcer's Ring for Spells
	---------------------------------------------------------------- 	
	sorcer_ring()
	----------------------------------------------------------------
	-- Select macro book
	----------------------------------------------------------------
    select_default_macro_book()
end
----------------------------------------------------------------------------
-- Called when this job file is unloaded (eg: job change)
----------------------------------------------------------------------------
function user_unload()
    send_command('unbind ^`')
    send_command('unbind ^z')
	send_command('unbind ^x')
end
--------------------------------------------------------------------------------------------------------------------
-- DEFINE SETS AND VARS USED BY THIS JOB FILE
--------------------------------------------------------------------------------------------------------------------
function init_gear_sets()
----------------------------------------------------------------------------
-- Organizer Items
----------------------------------------------------------------------------
	organizer_items = {													    food1="Pear Crepe",
																			food2="Cehuetzi snow cone",
																			echodrops="Echo Drops",
																			holywater="Holy Water",
																			remedy="Remedy",
																			eyedrops="Eye Drops",
																			hallowedwater="Hallowed Water",
																			antidote="Antidote",
																			ring="Dim. Ring (Dem)"}

----------------------------------------------------------------------------
-- RESTING/IDLE/DEFENSE/TOWN/ETC Sets
----------------------------------------------------------------------------
    ----------------------------------------------------------------
	-- Resting set
	----------------------------------------------------------------
	sets.resting = 															{head="Befouled Crown",
																			neck="Bathy Choker +1",
																			body={ name="Witching Robe", augments={'MP+50','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Refresh"+1',}},
																			hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -3%',}},
																			left_ear="Infused Earring",
																			right_ear="Hibern. Earring",
																			left_ring="Sheltered Ring",
																			right_ring="Paguroidea Ring",
																			back="Kumbira cape",
																			waist="Fucho-no-obi",
																			legs="Assiduity pants +1",
																			feet="Coalrake sabots"}
    ----------------------------------------------------------------
	-- Idle set(s)
	----------------------------------------------------------------
    sets.idle = 															set_combine(sets.resting,{
																			feet="Herald's gaiters"})
    ----------------------------------------------------------------
	-- Death idle set MP 1931
	----------------------------------------------------------------	
	sets.idle.Death =														{main={ name="Lathi", augments={'INT+15','"Mag.Atk.Bns."+15','Mag. Acc.+15',}},
																			sub="Niobid Strap",
																			ammo="Psilomene",
																			head={ name="Merlinic Hood", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Magic Damage +13','DEX+6','Mag. Acc.+15',}},
																			body={ name="Witching Robe", augments={'MP+50','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Refresh"+1',}},
																			hands={ name="Otomi Gloves", augments={'Haste+2','"Snapshot"+2','"Fast Cast"+3',}},
																			legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
																			feet={ name="Psycloth Boots", augments={'MP+50','INT+7','"Conserve MP"+6',}},
																			neck="Loricate Torque",
																			waist="Fucho-no-Obi",
																			left_ear="Etiolation Earring",
																			right_ear="Barkaro. Earring",
																			left_ring="Gelatinous Ring +1",
																			right_ring="Patricius Ring",
																			back={ name="Bane Cape", augments={'Elem. magic skill +4','Dark magic skill +6','"Mag.Atk.Bns."+3','"Fast Cast"+5',}},}
    ----------------------------------------------------------------
    -- Lower HP for sorcer's ring set
	----------------------------------------------------------------	
	sets.idle.Low_HP =														{neck="Phrenic Torque",
																			right_ear="Influx Earring",
																			left_ring="Mephitas's Ring +1",
																			right_ring="Bifrost Ring",
																			back="Vates Cape +1",}																			
    ----------------------------------------------------------------
	-- Physical Defense set(s)
	----------------------------------------------------------------
	sets.defense.PDT =  		   											set_combine(sets.resting,{
																			head={ name="Hagondes Hat +1", augments={'Phys. dmg. taken -3%','Enmity-5',}},
																			body="Vrikodara Jupon",
																			hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -3%',}},
																			legs={ name="Hagondes Pants +1", augments={'Phys. dmg. taken -3%','Mag. Acc.+22',}},
																			feet="Battlecast gaiters",
																			neck="Loricate torque",
																			left_ear="Genmei Earring",
																			right_ear="Hibern. earring",
																			left_ring="Gelatinous ring +1",
																			right_ring="Patricius ring"})

    ----------------------------------------------------------------
	-- Magical Defense set(s)
	----------------------------------------------------------------
    sets.defense.MDT = 	    												set_combine(sets.resting,{
																			ammo="Sihirik",
																			head={ name="Vanya Hood", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
																			hands={ name="Vanya Cuffs", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
																			legs="Gyve trousers",
																			neck="Loricate torque",
																			waist="Slipor Sash",
																			left_ear="Merman's earring",
																			right_ear="Etiolation earring",
																			left_ring="Yacuruna ring",
																			right_ring="Fortified ring",})	
	----------------------------------------------------------------
	-- Town set
	----------------------------------------------------------------
    sets.idle.Town = 														set_combine(sets.resting,{
																			main={ name="Lathi", augments={'INT+15','"Mag.Atk.Bns."+15','Mag. Acc.+15',}},
																			sub="Niobid Strap", 
																			head="Pixie hairpin +1",
																			body="Wicce Coat +1",
																			hands="Wicce Gloves +1",
																			legs="Wicce Chausses +1",
																			feet="Wicce Sabots +1"})
    ----------------------------------------------------------------
	-- Kiting set(s)
	----------------------------------------------------------------    
	sets.Kiting = 															{feet="Herald's gaiters"}
    ----------------------------------------------------------------
	-- Latent Refresh set(s)
	----------------------------------------------------------------    
    sets.latent_refresh = 													{waist="Fucho-no-obi"}
----------------------------------------------------------------------------
-- PRECAST SETS
----------------------------------------------------------------------------
    ----------------------------------------------------------------
	-- Catch All Precast set
	----------------------------------------------------------------
	sets.precast = 															{}
    ----------------------------------------------------------------
	-- Job Ability Precast set(s)
	----------------------------------------------------------------
	sets.precast.JA = 														{}
    sets.precast.JA['Mana Wall'] = 											{feet="Wicce sabots +1",
																			back={ name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Mag.Atk.Bns."+10',}},}
	sets.precast.JA['Manafont'] = 											{body="Archmage's Coat +1"}
    ----------------------------------------------------------------
	-- Weaponskill Precast set(s)
	----------------------------------------------------------------
	sets.precast.WS = 														{head="Befouled Crown",
																			body="Arch. Coat +1",
																			hands="Wicce Gloves +1",
																			back="Toro Cape",
																			legs="Psycloth Lappas",
																			feet="Wicce Sabots +1",
																			neck="Fotia gorget",
																			waist="Fotia belt",
																			left_ear="Barkaro. Earring",
																			right_ear="Ishvara Earring",
																			left_ring="Fenrir Ring +1",
																			right_ring="Fenrir Ring +1"}
	sets.precast.WS['Myrkr'] = 												{ammo="Psilomene",
																			head="Pixie Hairpin +1",
																			body={ name="Witching Robe", augments={'MP+50','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Refresh"+1',}},
																			hands={ name="Otomi Gloves", augments={'Haste+2','"Snapshot"+2','"Fast Cast"+3',}},
																			legs="Adapa's Slacks +1",
																			feet={ name="Psycloth Boots", augments={'MP+50','INT+7','"Conserve MP"+6',}},
																			neck="Dualism Collar",
																			waist="Mujin Obi",
																			left_ear="Etiolation Earring",
																			right_ear="Evans Earring",
																			left_ring="Mephitas's Ring +1",
																			right_ring="Metamorph Ring",
																			back={ name="Bane Cape", augments={'Elem. magic skill +4','Dark magic skill +6','"Mag.Atk.Bns."+3','"Fast Cast"+5',}},}
	----------------------------------------------------------------
    -- Spell Catch All Precast set
	----------------------------------------------------------------
    sets.precast.FC = 														{ammo="Sapience Orb",
																			head={ name="Psycloth Tiara", augments={'Mag. Acc.+20','"Fast Cast"+10','INT+7',}},
																			neck="Voltsurge torque",
																			left_ear="Enchanter earring +1",
																			right_ear="Loquac. Earring",
																			body="Vrikodara Jupon",
																			hands={ name="Otomi Gloves", augments={'Haste+2','"Snapshot"+2','"Fast Cast"+3',}},
																			left_ring="Prolix Ring",
																			right_ring="Weatherspoon ring",
																			back="Bane cape",
																			waist="Witful Belt",
																			legs="Psycloth Lappas",
																			feet="Regal Pumps +1"}
	----------------------------------------------------------------
	-- Stoneskin Precast set
	----------------------------------------------------------------
	sets.precast.FC.Stoneskin = 											set_combine(sets.precast.FC,{
																			head="Umuthi Hat",
																			waist="Siegel Sash",
																			legs="Doyen Pants",
																			hands="Carapacho cuffs"})
	----------------------------------------------------------------
	-- Cure Magic Precast set
	----------------------------------------------------------------
	sets.precast.FC.Cure = 													set_combine(sets.precast.FC,{
																			head="Vanya hood",
																			hands="Vanya cuffs",
																			legs="Doyen pants",
																			right_ear="Mendicant's earring",
																			back="Pahtli cape"})
	----------------------------------------------------------------
	-- Enhancing Magic Precast set
	----------------------------------------------------------------																			
	sets.precast.FC['Enhancing Magic'] = 									set_combine(sets.precast.FC, {
																			head="Umuthi Hat",
																			waist="Siegel Sash"})
	----------------------------------------------------------------
	-- Elemental Magic Precast set
	----------------------------------------------------------------
    sets.precast.FC['Elemental Magic'] = 									set_combine(sets.precast.FC,{
																			head="Wicce Petasos +1",
																			neck="Stoicheion Medal",
																			right_ear="Barkarole earring",
																			feet="Spaekona's Sabots +1"})
	----------------------------------------------------------------
	-- Death precast set MP 1946
	----------------------------------------------------------------
	sets.precast.FC.Death =													{main={ name="Lathi", augments={'INT+15','"Mag.Atk.Bns."+15','Mag. Acc.+15',}},
																			sub="Niobid Strap",
																			ammo="Psilomene",
																			head={ name="Merlinic Hood", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Magic Damage +13','DEX+6','Mag. Acc.+15',}},
																			body={ name="Witching Robe", augments={'MP+50','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Refresh"+1',}},
																			hands={ name="Otomi Gloves", augments={'Haste+2','"Snapshot"+2','"Fast Cast"+3',}},
																			legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
																			feet={ name="Psycloth Boots", augments={'MP+50','INT+7','"Conserve MP"+6',}},
																			neck="Voltsurge Torque",
																			waist="Witful Belt",
																			left_ear="Etiolation Earring",
																			right_ear="Loquac. Earring",
																			left_ring="Weather. Ring",
																			right_ring="Prolix Ring",
																			back={ name="Bane Cape", augments={'Elem. magic skill +4','Dark magic skill +6','"Mag.Atk.Bns."+3','"Fast Cast"+5',}},}
	----------------------------------------------------------------
	-- Stun Precast Set
	----------------------------------------------------------------
	sets.precast.FC.Stun =													{}
	----------------------------------------------------------------
	-- Ancient Magic Precast Set
	----------------------------------------------------------------
	sets.precast.FC.AncientMagic = 											set_combine(sets.precast.FC['Elemental Magic'],{
																			head="Archmage's Petasos +1",
																			legs="Archmage's Tonban +1",
																			feet="Archmage's Sabots +1",
																			hands="Archmage's Gloves +1"})
----------------------------------------------------------------------------
-- MIDCAST SETS
----------------------------------------------------------------------------
	----------------------------------------------------------------
	-- Catch All Midcast set
	----------------------------------------------------------------
	sets.midcast = 															{}
	----------------------------------------------------------------
	-- Day Weather Bonus
	----------------------------------------------------------------
	sets.midcast.Bonus = 													{waist="Hachirin-no-Obi"}
	----------------------------------------------------------------
	-- Fast Recast Midcast set
	----------------------------------------------------------------
	sets.midcast.FastRecast = 												{ammo="Sapience Orb",
																			head={ name="Psycloth Tiara", augments={'Mag. Acc.+20','"Fast Cast"+10','INT+7',}},
																			neck="Voltsurge torque",
																			left_ear="Enchanter earring +1",
																			right_ear="Loquac. Earring",
																			body="Vrikodara Jupon",
																			hands={ name="Otomi Gloves", augments={'Haste+2','"Snapshot"+2','"Fast Cast"+3',}},
																			left_ring="Prolix Ring",
																			right_ring="Weatherspoon ring",
																			back="Bane cape",
																			waist="Witful Belt",
																			legs="Psycloth Lappas",
																			feet="Regal Pumps +1"}
	----------------------------------------------------------------
	-- Midcast Healing Magic set(s)
	----------------------------------------------------------------
	sets.midcast.Cure =														set_combine(sets.midcast.FastRecast,{
																			left_ear="Mendicant's earring",
																			body="Vrikodara Jupon",
																			head="Vanya hood",
																			hands="Vanya cuffs",
																			left_ring="Lebeche Ring",
																			right_ring="Globidonta ring",
																			back="Pahtli Cape",
																			waist="Gishdubar sash",
																			legs="Gyve trousers"})
	sets.midcast.Curaga = 													sets.midcast.Cure
	----------------------------------------------------------------
	-- Midcast Enhancing Magic set(s)
	----------------------------------------------------------------																			
	sets.midcast['Enhancing Magic'] = 										set_combine(sets.midcast.FastRecast,{
																			head="Befouled Crown",
																			neck="Colossus's Torque",
																			left_ear="Andoaa Earring",
																			body="Telchine Chas.",
																			waist="Cascade belt",
																			legs="Shedir Seraweels",
																			feet="Regal Pumps +1"})
	sets.midcast.Stoneskin =					 							set_combine(sets.midcast['Enhancing Magic'],{
																			neck="Nodens gorget",
																			right_ear="Earthcry earring",
																			waist="Siegel Sash"})
	sets.midcast.Aquaveil = 												set_combine(sets.midcast['Enhancing Magic'],{
																			waist="Emphatikos Rope"})
	sets.midcast.Refresh = 													set_combine(sets.midcast['Enhancing Magic'],{
																			waist="Gishdubar sash",
																			feet="Inspirited boots",
																			back="Grapevine cape"})
	----------------------------------------------------------------
	-- Midcast Enfeebling Magic set(s)
	----------------------------------------------------------------
    sets.midcast['Enfeebling Magic'] = 										set_combine(sets.midcast.FastRecast,{
																			ammo="Ghastly tathlum +1",
																			left_ear="Barkarole earring",
																			right_ear="Digni. Earring",
																			left_ring="Globidonta Ring",
																			right_ring="Irrwisch ring",
																			back="Toro Cape",
																			head="Befouled Crown",
																			hands="Lurid mitts",
																			waist="Rumination sash",
																			legs="Psycloth Lappas",
																			feet="Medium's sabots",
																			neck="Incanter's torque"})
    sets.midcast['Enfeebling Magic'].Mnd = 									set_combine(sets.midcast['Enfeebling Magic'],{
																			ammo="Hydrocera",
																			left_ring="Weatherspoon ring",
																			back="Pahtli Cape"})
	----------------------------------------------------------------
	-- Midcast Dark Magic set(s)
	----------------------------------------------------------------
    sets.midcast['Dark Magic'] = 											set_combine(sets.midcast.FastRecast,{
																			head="Pixie hairpin +1",
																			neck="Incanter's torque",
																			body="Psycloth vest",
																			hands={ name="Arch. Gloves +1", augments={'Reduces Ancient Magic II casting time',}},
																			legs="Portent pants",
																			feet="Amalric nails",
																			waist="Casso sash",
																			left_ring="Evanescence ring",
																			right_ring="Archon Ring"})
	sets.midcast.Drain =													set_combine(sets.midcast['Dark Magic'],{
																			body={ name="Merlinic Jubbah", augments={'Mag. Acc.+27','"Drain" and "Aspir" potency +9','"Mag.Atk.Bns."+14',}},
																			hands={ name="Merlinic Dastanas", augments={'Mag. Acc.+13 "Mag.Atk.Bns."+13','"Drain" and "Aspir" potency +9','Mag. Acc.+4',}},
																			legs={ name="Merlinic Shalwar", augments={'Mag. Acc.+27','"Drain" and "Aspir" potency +9','"Mag.Atk.Bns."+15',}},
																			feet={ name="Merlinic Crackows", augments={'"Drain" and "Aspir" potency +11','MND+4','Mag. Acc.+3','"Mag.Atk.Bns."+6',}},
																			waist="Fucho-no-Obi"})
	sets.midcast.Aspir =													sets.midcast.Drain
	----------------------------------------------------------------
	-- Death aspir set MP 1931
	----------------------------------------------------------------	
	sets.midcast.Aspir.Death =												{main={ name="Lathi", augments={'INT+15','"Mag.Atk.Bns."+15','Mag. Acc.+15',}},
																			sub="Niobid Strap",
																			ammo="Psilomene",
																			head="Pixie Hairpin +1",
																			body={ name="Merlinic Jubbah", augments={'Mag. Acc.+27','"Drain" and "Aspir" potency +9','"Mag.Atk.Bns."+14',}},
																			hands={ name="Otomi Gloves", augments={'Haste+2','"Snapshot"+2','"Fast Cast"+3',}},
																			legs={ name="Merlinic Shalwar", augments={'Mag. Acc.+27','"Drain" and "Aspir" potency +9','"Mag.Atk.Bns."+15',}},
																			feet={ name="Merlinic Crackows", augments={'"Drain" and "Aspir" potency +11','MND+4','Mag. Acc.+3','"Mag.Atk.Bns."+6',}},
																			neck="Voltsurge Torque",
																			waist="Fucho-no-Obi",
																			right_ear="Evans Earring",
																			right_ring="Mephitas's Ring +1",
																			back={ name="Bane Cape", augments={'Elem. magic skill +4','Dark magic skill +6','"Mag.Atk.Bns."+3','"Fast Cast"+5',}},}
    sets.midcast.Stun = 													set_combine(sets.midcast['Dark Magic'],{
																			ammo="Hasty Pinion +1",
																			head={ name="Psycloth Tiara", augments={'Mag. Acc.+20','"Fast Cast"+10','INT+7',}},
																			neck="Voltsurge torque",
																			left_ear="Enchanter earring +1",
																			right_ear="Loquac. Earring",
																			left_ring="Sangoma Ring",
																			right_ring="Weatherspoon Ring",
																			back="Bane cape",
																			waist="Witful Belt",
																			legs="Hagondes Pants +1",
																			feet="Battlecast Gaiters"})
	----------------------------------------------------------------
	-- Death set MP 1851 Missing Amalric Body, Legs, and Grioavolr
	----------------------------------------------------------------	
	sets.midcast.Death =													{main={ name="Lathi", augments={'INT+15','"Mag.Atk.Bns."+15','Mag. Acc.+15',}},
																			sub="Niobid Strap",
																			ammo="Psilomene",
																			head="Pixie Hairpin +1",
																			body={ name="Witching Robe", augments={'MP+50','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Refresh"+1',}},
																			hands={ name="Amalric Gages", augments={'INT+10','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
																			legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
																			feet={ name="Amalric Nails", augments={'MP+60','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
																			neck="Mizu. Kubikazari",
																			waist="Hachirin-no-Obi",
																			left_ear="Static Earring",
																			right_ear="Barkaro. Earring",
																			left_ring="Archon Ring",
																			right_ring="Mephitas's Ring +1",
																			back={ name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Mag.Atk.Bns."+10',}},}
	----------------------------------------------------------------
	-- Midcast Elemental Magic set(s)
	----------------------------------------------------------------
	sets.midcast.LowTierNuke =					 							{main={ name="Lathi", augments={'INT+15','"Mag.Atk.Bns."+15','Mag. Acc.+15',}},
																			sub="Niobid Strap",
																			ammo="Ghastly Tathlum +1",
																			head={ name="Merlinic Hood", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Magic Damage +13','DEX+6','Mag. Acc.+15',}},
																			body={ name="Witching Robe", augments={'MP+50','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Refresh"+1',}},
																			hands={ name="Amalric Gages", augments={'INT+10','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
																			legs={ name="Merlinic Shalwar", augments={'Mag. Acc.+21 "Mag.Atk.Bns."+21','Damage taken-2%','INT+9','"Mag.Atk.Bns."+15',}},
																			feet={ name="Amalric Nails", augments={'MP+60','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
																			neck="Eddy Necklace",
																			waist="Sekhmet Corset",
																			left_ear="Barkaro. Earring",
																			right_ear="Crematio Earring",
																			left_ring=gear.Ring,
																			right_ring="Shiva ring",
																			back={ name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Mag.Atk.Bns."+10',}},}
    sets.midcast.LowTierNuke.Resistant =					 				set_combine(sets.midcast.LowTierNuke,{
																			ammo="Hydrocera",
																			hands={ name="Psycloth Manillas", augments={'Mag. Acc.+10','Spell interruption rate down +15%','MND+7',}},
																			feet="Medium's sabots",
																			neck="Voltsurge Torque",
																			waist="Refoccilation Stone",
																			right_ear="Hermetic Earring",
																			left_ring="Weatherspoon Ring",
																			right_ring="Sangoma Ring",
																			back={ name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Mag.Atk.Bns."+10',}},})
	sets.midcast.HighTierNuke = 											set_combine(sets.midcast.LowTierNuke,{
																			main={ name="Lathi", augments={'INT+15','"Mag.Atk.Bns."+15','Mag. Acc.+15',}},
																			sub="Niobid Strap",
																			ammo="Pemphredo tathlum",
																			right_ear="Friomisi Earring",
																			head={ name="Merlinic Hood", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Magic Damage +13','DEX+6','Mag. Acc.+15',}},
																			body={ name="Merlinic Jubbah", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Occult Acumen"+2','INT+7','"Mag.Atk.Bns."+12',}},
																			hands={ name="Amalric Gages", augments={'INT+10','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
																			legs={ name="Merlinic Shalwar", augments={'Mag. Acc.+21 "Mag.Atk.Bns."+21','Damage taken-2%','INT+9','"Mag.Atk.Bns."+15',}},
																			feet={ name="Merlinic Crackows", augments={'Mag. Acc.+16 "Mag.Atk.Bns."+16','INT+10','"Mag.Atk.Bns."+15',}},
																			neck="Saevus pendant +1",
																			waist="Refoccilation Stone"})
    sets.midcast.HighTierNuke.Resistant = 									set_combine(sets.midcast.HighTierNuke,{
																			neck="Eddy Necklace",
																			waist="Eschan stone"})
	sets.midcast.ElementalEnfeeble = 										sets.midcast.HighTierNuke.Resistant
----------------------------------------------------------------------------
-- ENGAGED SETS
----------------------------------------------------------------------------
    sets.engaged = 															{}
    ----------------------------------------------------------------
    -- Death engaged set should be the same as your idle set above
	----------------------------------------------------------------	
	sets.engaged.Death = 													{main={ name="Lathi", augments={'INT+15','"Mag.Atk.Bns."+15','Mag. Acc.+15',}},
																			sub="Niobid Strap",
																			ammo="Psilomene",
																			head={ name="Merlinic Hood", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Magic Damage +13','DEX+6','Mag. Acc.+15',}},
																			body={ name="Witching Robe", augments={'MP+50','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Refresh"+1',}},
																			hands={ name="Otomi Gloves", augments={'Haste+2','"Snapshot"+2','"Fast Cast"+3',}},
																			legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
																			feet={ name="Psycloth Boots", augments={'MP+50','INT+7','"Conserve MP"+6',}},
																			neck="Loricate Torque",
																			waist="Fucho-no-Obi",
																			left_ear="Etiolation Earring",
																			right_ear="Barkaro. Earring",
																			left_ring="Gelatinous Ring +1",
																			right_ring="Patricius Ring",
																			back={ name="Bane Cape", augments={'Elem. magic skill +4','Dark magic skill +6','"Mag.Atk.Bns."+3','"Fast Cast"+5',}},}
----------------------------------------------------------------------------
-- CUSTOM SETS NOT COVERED ANYWHERE ELSE
----------------------------------------------------------------------------
    sets.buff['Mana Wall'] = 												{feet="Wicce sabots +1",
																			back={ name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Mag.Atk.Bns."+10',}},}
	sets.buff.Doom = 														{neck="Malison medallion",
																			waist="Gishdubar sash",
																			left_ring="Eshmun's ring",
																			right_ring="Purity ring"}
    ----------------------------------------------------------------
    -- Magic burst set
	----------------------------------------------------------------
	sets.magic_burst = 														{body={ name="Merlinic Jubbah", augments={'Mag. Acc.+16 "Mag.Atk.Bns."+16','Magic burst mdg.+11%','CHR+9','Mag. Acc.+7','"Mag.Atk.Bns."+13',}},
																			hands={ name="Amalric Gages", augments={'INT+10','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
																			feet={ name="Merlinic Crackows", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','Magic burst mdg.+11%','INT+6','Mag. Acc.+13','"Mag.Atk.Bns."+2',}},
																			neck="Mizu. Kubikazari",
																			right_ear="Static Earring",
																			right_ring="Mujin Band",
																			back={ name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Mag.Atk.Bns."+10',}},}
end
--------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
--------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------
-- PRECAST FUNCTIONS
----------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
	if state.MageMode.value == 'Death Mage' then
       classes.CustomClass = 'Death'
	elseif spell.type == "WeaponSkill" then
		if player.status == 'Engaged' then
			if player.tp >= 1000 then
				if spell.target.distance <= 5 then
					if sets.precast.WS[spell.name] then
						equip(sets.precast.WS[spell.name])
					else
						equip(sets.precast.WS)
					end
				else
					cancel_spell()
					windower.add_to_chat(121, 'Canceled '..spell.name..'.'..spell.target.name..' is Too Far')
				end
			else 
				cancel_spell()
				windower.add_to_chat(121, ''..player.tp..'TP is not enough to WS')
			end
		else
			cancel_spell()
			windower.add_to_chat(121, 'You must be Engaged to WS')
		end
	elseif spell.action_type == 'Magic' then
		if spell.skill == 'Healing Magic' then
			if spell.english:startswith('Cure') or spell.english:startswith("Curaga") then
				equip(sets.precast.FC.Cure)
			end
		elseif spell.skill == 'Enhancing Magic' then
			if spell.english:startswith('Stoneskin') then
				equip(sets.precast.FC.Stoneskin)
			else
				equip(sets.precast.FC['Enhancing Magic'])
			end
		elseif spell.skill == 'Dark Magic' then
		
			if spell.english:startswith('Stun') then
				equip(sets.precast.FC.Stun)
			end
		elseif spell.skill == 'Elemental Magic' then
			if AncientMagic[spell.english] then
				equip(sets.precast.FC.AncientMagic)
			else
				equip(sets.precast.FC['Elemental Magic'])
			end
		end
	elseif spell.type == 'JobAbility' then
		if sets.precast.JA[spell.name] then
			equip(sets.precast.JA[spell.name])
		end
	end
end
----------------------------------------------------------------------------
-- MIDCAST FUNCTIONS
----------------------------------------------------------------------------
function job_midcast(spell, action, spellMap, eventArgs)
	if spell.action_type == 'Magic' then
		if spell.skill == 'Healing Magic' then
			if spell.element == world.day_element or spell.element == world.weather_element then
				equip(sets.midcast.Cure,{waist="Hachirin-no-Obi"})
			else
				equip(sets.midcast.Cure)
			end
		elseif spell.skill == 'Enhancing Magic' then
			if spell.english:startswith('Stoneskin') then
				equip(sets.midcast.Stoneskin)
			elseif spell.english:startswith('Aquaveil') then
				equip(sets.midcast.Aquaveil)
			elseif spell.english:startswith('Refresh') then
				equip(sets.midcast.Refresh)
			else
				equip(sets.midcast['Enhancing Magic'])
			end
		elseif spell.skill == 'Dark Magic' then
			if spell.english:startswith('Stun') then
				equip(sets.midcast.Stun)
			elseif spell.english:startswith('Drain') then
				equip(sets.midcast.Drain)
			elseif spell.english:startswith('Aspir') then
				equip(sets.midcast.Aspir)
			elseif spell.english:startswith('Bio') then
				equip(sets.midcast['Dark Magic'])
			elseif spell.english:startswith('Klimaform') then
				equip(sets.midcast['Dark Magic'])
			else
				equip(sets.midcast['Dark Magic'])
			end
		elseif spell.skill == 'Enfeebling Magic' then
			if spell.english:startswith('Paralyze*|Slow*|Silence') then
				equip(sets.midcast['Enfeebling Magic'].Mnd)
			else
				equip(sets.midcast['Enfeebling Magic'])
			end
		elseif spell.skill == 'Elemental Magic' then
			if spell.english:startswith('Burn|Frost|Choke|Rasp|Shock|Drown') then
				equip(sets.midcast.ElementalEnfeeble)
			elseif spell.element == world.day_element or spell.element == world.weather_element then
				equip(sets.midcast.Bonus)
			end
		end
	end
end
----------------------------------------------------------------------------
-- POST MIDCAST FUNCTIONS
----------------------------------------------------------------------------
function job_post_midcast(spell, action, spellMap, eventArgs)
	if state.Buff.Doom then
		equip(sets.buff.Doom)
	end
	if state.Buff['Mana Wall'] then
		equip(sets.buff['Mana Wall'])
	end
    if state.MagicBurst.value then
		equip(sets.magic_burst)
	end
end
----------------------------------------------------------------------------
-- AFTERCAST FUNCTIONS
----------------------------------------------------------------------------
function job_aftercast(spell, action, spellMap, eventArgs)
    if player.tp < 1000 then
        enable('main','sub')
	elseif not spell.interrupted then
        if spell.english == 'Mana Wall' then
            enable('feet','back')
            equip(sets.buff['Mana Wall'])
            disable('feet','back')
		elseif spell.english == 'Sleep' or spell.english == 'Sleepga' then
			send_command('@wait 55;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
		elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
			send_command('@wait 85;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
		elseif spell.english == 'Break' or spell.english == 'Breakga' then
			send_command('@wait 25;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
		end
    end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------
-- Called when a player gains or loses a buff
----------------------------------------------------------------------------
function job_buff_change(buff, gain)
    if buff == "Mana Wall" and not gain then
        enable('feet','back')
        handle_equipping_gear(player.status)
    end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------
-- Get custom spell maps
----------------------------------------------------------------------------
function job_get_spell_map(spell, default_spell_map)
    if spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble' then
        if lowTierNukes:contains(spell.english) then
            return 'LowTierNuke'
        elseif AncientMagic:contains(spell.english) then
			return 'AncientMagic'
		else
		    return 'HighTierNuke'
        end
	end
end
----------------------------------------------------------------------------
-- Modify the default idle set after it was constructed.
----------------------------------------------------------------------------
function customize_idle_set(idleSet)
    if player.mpp < 51 then
        idleSet = set_combine(idleSet, sets.latent_refresh)
    end
    if state.Buff.Doom then
		idleSet = set_combine(idleSet, sets.buff.Doom)
	end
	if state.Buff['Mana Wall'] then
		idleSet = set_combine(idleSet, sets.buff['Mana Wall'])
	end
    return idleSet
end
----------------------------------------------------------------------------
-- Called by the default 'update' self-command.
----------------------------------------------------------------------------
function display_current_job_state(eventArgs)
    display_current_caster_state()
    eventArgs.handled = true
end
function job_update(cmdParams, eventArgs)
	magemode()
	sorcer_ring()
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function magemode()
	classes.CustomIdleGroups:clear()
	classes.CustomMeleeGroups:clear()
	if state.MageMode.value == 'Death Mage' then
		classes.CustomIdleGroups:append('Death')
		classes.CustomMeleeGroups:append('Death')
	end
end
function sorcer_ring()
	if (player.hpp < 76 and player.tp < 1000) then
		gear.Ring.name = gear.SorcersRing
	else
		gear.Ring.name = gear.NormalNukeRing
	end
end
----------------------------------------------------------------------------
-- SUBJOB AND MACRO BOOK SELECTION
----------------------------------------------------------------------------
function select_default_macro_book()
    set_macro_page(1, 15)
end
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 660
By Ragnarok.Flippant 2016-06-17 18:47:43
Link | Quote | Reply
 
Mote's documentation says classes.CustomClass comes before anything else. You'd need sets.Death.whatever to make it work, and anything without a set would use sets.Death. Which is a little strange, but could actually work fine since it might catch unintended consequences of something.

Otherwise, maybe use classes.CustomIdleGroups, which documentation says is checked at all times, near the very end of the tree. Also, it'd give you an idle MP set since classes.CustomClass is only checked during an action.

Also, it's a little strange that you have so many rules in job_midcast. Not only would it be difficult for you to tell that something is not working properly (and would therefore use Mote's automation), but if it did work, then they would get overwritten anyway. Mote's is really not the type of Gearswap that you should be using that structure in—let him handle everything that isn't an exceptional case.
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-17 18:57:12
Link | Quote | Reply
 
I have tried renaming the set to sets.midcast.Death.Aspir and I get a load error when I do.

All of the midcast rules work as intended accept the Aspir when in Death Mode. I have even tried forcing it by not using the classes.CustomClass and instead putting this in but it just will not use the set.
Code
if state.MageMode.value == 'Death Mage' then
     if spell.english:startswith('Aspir') then
          equip(sets.midcast.Death.Aspir)
     end
end


Also I dont understand why when using the classes.CustomClass it will properly append sets.precast.FC with Death but not the midcasts.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 660
By Ragnarok.Flippant 2016-06-17 19:48:55
Link | Quote | Reply
 
sets.precast.FC is hardcoded, it's no different than saying 'sets.midcast'. It doesn't go through the rules until after that part of the breadcrumbs is defined.

As for the error, you're going to actually have to tell me what the error says. Since you say it's on load, I'll take a guess that it's an index error because you didn't define sets.midcast.Death before you added sets.midcast.Death.Aspir, but I can't tell you for sure.

As for the midcast rules--again,
Quote:
Also, it's a little strange that you have so many rules in job_midcast. Not only would it be difficult for you to tell that something is not working properly (and would therefore use Mote's automation), but if it did work, then they would get overwritten anyway. Mote's is really not the type of Gearswap that you should be using that structure in—let him handle everything that isn't an exceptional case.

Mote's GS is built to automatically handle 90% of your sets. He's going to still go through his rules and send the equip commands he normally sends, unless you explicitly tell him not to (which you shouldn't do most of the time, you should let him handle it the correct way).
[+]
 Odin.Speedyjim
Offline
Server: Odin
Game: FFXI
user: speedyjim
Posts: 177
By Odin.Speedyjim 2016-06-17 20:07:31
Link | Quote | Reply
 
You should listen to Flippant's advice, he's got a cool avatar.
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-17 21:23:59
Link | Quote | Reply
 
Ragnarok.Flippant said: »
As for the error, you're going to actually have to tell me what the error says. Since you say it's on load, I'll take a guess that it's an index error because you didn't define sets.midcast.Death before you added sets.midcast.Death.Aspir, but I can't tell you for sure.

You were correct. It still does not cast aspir in the midcast.Death.Aspir set however. This is driving me nuts.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 660
By Ragnarok.Flippant 2016-06-17 21:49:35
Link | Quote | Reply
 
Try using Aspir II and tell me what it uses. If only Aspir III doesn't work, could be because your maps aren't updated.

Also, you may want to look closely at your MB rules. It will put your MB set on for every spell, JA, WS, etc. if MB is set to true.
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-17 21:53:38
Link | Quote | Reply
 


Same thing even with Aspir 1

I have updated the mappings file as such a long time ago. Is this correct?
Code
['Aspir']='Aspir',['Aspir II']='Aspir',['Aspir III']='Aspir',


It does the precast correctly just not the mid. Mana burst is off.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 660
By Ragnarok.Flippant 2016-06-17 22:11:22
Link | Quote | Reply
 
Okay, actually looking at Mote's code, he doesn't actually stack customClass, it's only that OR spell.english OR spellMap, etc. Seems strange. I could change it to a breadcrumb setup instead, as I don't see any reason for it not to be, but only if there is a larger interest in that.

Further, I looked up the custom idle thing as well, and that doesn't pan out either. His documentation is a little ambiguous, but it looks like CastingMode is the only variable for spells.

If you don't want to use that, then:
Code
if state.MageMode.value == 'Death Mage' and spellMap=='Aspir' then
     classes.CustomClass = 'DeathAspir'
end

and use sets.midcast.DeathAspir
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-17 22:22:53
Link | Quote | Reply
 
Code
	if state.MageMode.value == 'Death Mage' then
		if spellMap=='Aspir' then
			classes.CustomClass = 'DeathAspir'
		else
			classes.CustomClass = 'Death'
		end



That is what I did and it is now working properly for all 3 Aspir!! I assume I can do the same thing for Myrkr? That is the absolute last hurdle to overcome. Thank you very very much for the help and patience.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 660
By Ragnarok.Flippant 2016-06-17 23:03:57
Link | Quote | Reply
 
Yes. But be aware that your precast will now look for sets.precast.FC.DeathAspir, not Death. You might want to separate the two sections, one in your precast function and one in your midcast.

You could also do something like
Code
if state.MageMode.value == 'Death Mage' then
    if sets.midcast['Death'..spellMap] then
        classes.CustomClass = 'Death'..spellMap
	elseif sets.midcast['Death'..spell.english] then
        classes.CustomClass = 'Death'..spell.english
    else
        classes.CustomClass = 'Death'
    end
end


So if DeathDrain doesn't exist, for example, it will just stick with Death. That way you don't have to write a bunch of rules for various spells/spellmaps.
[+]
Offline
Posts: 429
By Selindrile 2016-06-17 23:51:55
Link | Quote | Reply
 
I posted a link to mine which is done in Mote's a long time ago, there's really no need to fiddle with customclass here, as it's just really idle and midcast aspirs that needs to change, it's not like you need to change every spell you cast or anything.
[+]
 Phoenix.Keido
Offline
Server: Phoenix
Game: FFXI
user: Keido
Posts: 122
By Phoenix.Keido 2016-06-18 07:33:22
Link | Quote | Reply
 
Selindrile said: »
I posted a link to mine which is done in Mote's a long time ago, there's really no need to fiddle with customclass here, as it's just really idle and midcast aspirs that needs to change, it's not like you need to change every spell you cast or anything.

Believe me I keep looking at it but I don't see how your MP isn't all over the place. I am trying to maximize the pool to make sure its at a constant 1931-1946 MP for the gear that I currently have. How are you staying consistent through Idle precast midcast to back to Idle?
setup
Code
	state.DeathMode = M(false, 'Death Mode')


pre
Code
	elseif spell.action_type == 'Magic' then
		if spellMap == 'Cure' or spellMap == 'Curaga' then
			gear.default.obi_back = gear.obi_cure_back
			gear.default.obi_waist = gear.obi_cure_waist
		elseif spell.english == 'Death' or (spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble') then
			if LowTierNukes:contains(spell.english) then
				gear.default.obi_back = gear.obi_low_nuke_back
				gear.default.obi_waist = gear.obi_low_nuke_waist
			else
				gear.default.obi_back = gear.obi_high_nuke_back
				gear.default.obi_waist = gear.obi_high_nuke_waist
			end
		end


Mid
Code
	if state.DeathMode.value and spell.english:startswith('Aspir') then
		equip(sets.midcast.DeathAspir)


function
Code
	if state.DeathMode.value then
        idleSet = set_combine(idleSet, sets.idle.Death)
    end


What am I missing? To me I dont see how you cast anything in a Death set except the mid for Aspir. Is there another file that goes along with this maybe a custom library?
Offline
Posts: 429
By Selindrile 2016-06-18 10:41:42
Link | Quote | Reply
 
That's correct, as I said a bit ago, I only modify midcast aspir and idle sets because that's all that really matters.

I only only cast aspir and death when in death mode, and after using death, it automatically resets deathmode, no sense in making all those other spells and my idle set inefficient in the meantime, I simply have a macro to enable deathmode (you can couple this wiith an aspir macro if you like), that I hit as I approach max mp, do my aspir to cap, then cast death, repeat.

You don't need to cast everything in a specialized death set, if so, you may as well just use a macro to put your death set on and gs disable all.

Do you really want to make a second death version of every spell you cast and keep it updated with slightly less efficient gear to use in deathmode? That seems way less efficient than just toggling it when you're high on mp, or you could do something like this if you like in post_precast if you don't like to micromanage.
Code
if state.DeathMode.value and player.mpp > 85 then
	equip(sets.midcast.DeathPrecast)
end


and in this case you'd probably want to modify idle too, so you could stay in this mode without losing all your refresh after casting death, something like:
Code
if state.DeathMode.value and player.mpp > 85 then
    idleSet = set_combine(idleSet, sets.idle.Death)
end
First Page 2 3 ... 102 103 104 ... 182 183 184
Log in to post.