Code:
function midcast(spell,action)
equipSet = {}
if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
equipSet = sets.Midcast
if string.find(spell.english,'Cure') and Enmity == 'ON' then
equipSet = equipSet.Cure.Enmity
elseif string.find(spell.english,'Cure') and Enmity == 'OFF' then
equipSet = equipSet.Cure
elseif string.find(spell.english,'Cura') then
equipSet = equipSet.Curaga
-- Duration and Potency for Regen --
elseif string.find(spell.english,'Regen') then
if buffactive["Composure"] then
if spell.target.type == 'SELF' then
equipSet = equipSet.Regen_Self
else
equipSet = equipSet.Regen_Others
end
elseif not buffactive["Composure"] then
equipSet = equipSet.Regen_Self
end
-- Duration for Buffs --
elseif string.find(spell.english,'Haste') or string.find(spell.english,'Flurry') or string.find(spell.english,'Sneak') or string.find(spell.english,'Invisible') or string.find(spell.english,'Deodorize') then
if buffactive.Composure then
if spell.target.type == 'SELF' then
equipSet = equipSet.Duration_Self
else
equipSet = equipSet.Duration_Others
end
elseif not buffactive.Composure then
equipSet = equipSet.Duration_Self
end
-- Duration for Refresh --
elseif string.find(spell.english,'Refresh') then
if buffactive.Composure then
if spell.target.type == 'SELF' then
equipSet = equipSet.Refresh_Self
else
equipSet = equipSet.Refresh_Others
end
elseif not buffactive.Composure then
equipSet = equipSet.Refresh_Self
end
elseif spell.english == "Stoneskin" then
if buffactive.Stoneskin then
send_command('@wait 2.8;cancel stoneskin')
end
equipSet = equipSet.Stoneskin
elseif spell.english == "Sneak" then
if spell.target.name == player.name and buffactive['Sneak'] then
send_command('cancel sneak')
end
equipSet = equipSet.Haste
elseif spell.skill == "Enfeebling Magic" then
if spell.type == "WhiteMagic" then
if AccIndex == 1 then
equipSet = equipSet.MND
elseif AccIndex == 2 then
equipSet = equipSet.MND_MidACC
elseif AccIndex == 3 then
equipSet = equipSet.MND_MidACC
end
else
if AccIndex == 1 then
equipSet = equipSet.INT
elseif AccIndex == 2 then
equipSet = equipSet.INT_MidACC
elseif AccIndex == 3 then
equipSet = equipSet.INT_MidACC
end
end
elseif spell.english == "Phalanx II" then -- Aug'd Dls. Gloves +2 For Phalanx II --
equipSet = set_combine(equipSet,{hands="Viti. Gloves +1"})
elseif spell.english == "Dia III" or spell.english == "Slow II" then -- Aug'd Dls. Chapeau +2 For Dia III or Slow II --
equipSet = set_combine(equipSet,{head="Viti. Chapeau +1"})
elseif spell.english == "Paralyze II" then -- Aug'd Dls. Boots +2 For Paralyze II --
equipSet = set_combine(equipSet,{feet="Vitivation Boots +1"})
elseif spell.english == "Blind II" or spell.english == "Bio III" then -- Aug'd Dls. Tights +2 For Blind II or Bio III --
equipSet = set_combine(equipSet,{legs="Viti. Tights +1"})
elseif spell.skill == "Enfeebling Magic" and buffactive.Saboteur then -- Wear Estoqueur's Gantherots +2 for Saboteur enfeebles --
equipSet = set_combine(equipSet,{hands="Estq. Ganthrt. +2"})
elseif string.find(spell.english,'Banish') then
equipSet = set_combine(equipSet.Haste,{ring1="Fenian Ring"})
elseif string.find(spell.english,'Utsusemi') then
if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
send_command('@wait 1.7; cancel Copy Image*')
end
equipSet = equipSet.Haste
elseif spell.english == 'Monomi: Ichi' then
if buffactive['Sneak'] then
send_command('@wait 1.7;cancel sneak')
end
equipSet = equipSet.Haste
else
if equipSet[spell.english] then
equipSet = equipSet[spell.english]
end
if equipSet[spell.skill] then
equipSet = equipSet[spell.skill]
end
if equipSet[AccArray[AccIndex]] then
equipSet = equipSet[AccArray[AccIndex]]
end
if equipSet[spell.type] then
equipSet = equipSet[spell.type]
end
-if (spell.skill == 'Elemental Magic' or string.find(spell.english,'Cur') or string.find(spell.english,'Bio') or string.find(spell.english,'Dia') or spell.english == 'Aspir' or spell.english == 'Drain') and not Non_Obi_Spells:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' and spell.english ~= "Cursna" then -- Use Obi Toggle To Equip Normal Waist Gear --
equipSet = set_combine(equipSet,sets.Obi[spell.element])
end
end
elseif equipSet[spell.english] then
equipSet = equipSet[spell.english]
end
equip(equipSet)
end
Above is midcast function for rdm. I am having an issue where only elemental magic will equip very quickly after precast and then immediately go into idle/aftercast gear. It's equipping the correct gear and every other type of magic is working just fine, but I thought Gearswap was supposed to always have the correct midcast time? I have bolded things that I have added to the midcast function. These sections are all working as intended, but I think I am overlooking something in regards to the elemental magic. Thanks for any help. For reference and if it helps, my aftercast function below
Code:
function aftercast(spell,action)
if not spell.interrupted then
if spell.english == "Sleep II" then -- Sleep II Countdown --
send_command('wait 60;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
send_command('wait 30;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
elseif spell.english == "Banish II" then -- Banish II Countdown --
send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
end
end
status_change(player.status)
end
link to the whole thing (modified Bokura lua): http://pastebin.com/sWPw5H89
edit: I fixed it for anyone that cares, thanks anyways though!
I literally just added the below to bypass the original handling for that set, and it works fine.
Code:
elseif spell.skill == "Elemental Magic" then
if AccIndex == 1 then
equipSet = equipSet['Elemental Magic']
elseif AccIndex == 2 then
equipSet = equipSet['Elemental Magic'].MidACC
elseif AccIndex == 3 then
equipSet = equipSet['Elemental Magic'].HighACC
end
If anyone has any input on a cleaner way of doing this, I'd greatly appreciate.