hope im doing this right
trying to get a spell degrade for my run gearswap. copied this sorta from the pld.lua on ffxiah's pld guide. i cast Geist Wall, but spell does not change and gives me message of all spells on cooldown.
Code:
function job_post_precast(spell, action, spellMap, eventArgs)
refine_various_spells(spell, action, spellMap, eventArgs)
end
function refine_various_spells(spell, action, spellMap, eventArgs)
Enmity = S{'Soporific', 'Sheep Song', 'Stinking Gas', 'Geist Wall'}
if not Enmity:contains(spell.english) then
return
end
local newSpell = spell.english
local spell_recasts = windower.ffxi.get_spell_recasts()
local cancelling = 'All '..spell.english..' spells are on cooldown. Cancelling spell casting.'
if spell_recasts[spell.recast_id] > 0 then
if Enmity:contains(spell.english) then
if spell.english == 'Geist Wall' then
add_to_chat(122,cancelling)
eventArgs.cancel = true
return
elseif spell.english == 'Geist Wall' then
newSpell = 'Stinking Gas'
elseif spell.english == 'Stinking Gas' then
newSpell = 'Sheep Song'
elseif spell.english == 'Sheep Song' then
newSpell = 'Soporific'
end
end
end
if newSpell ~= spell.english then
send_command('@input /ma "'..newSpell..'" '..tostring(spell.target.raw))
eventArgs.cancel = true
return
end
end