
Originally Posted by
Landsoul
Trying to make a precast cure set for WHm, but it's only swapping to midcast.
Code:
function job_precast(spell, action, spellMap, eventArgs)
if spell.action_type == 'Magic' then
equip(sets.precast.FC)
elseif spellMap == 'Cure' or spellMap == 'Curaga' then
equip(sets.precast.CureFC)
end
end
I'm using Mote includes, am i doing something wrong?
the pronble is the above code it will never equip the CureFC gear
Code:
if spell.action_type == 'Magic' then --this is part 1 of the issue
equip(sets.precast.FC)
elseif spellMap == 'Cure' or spellMap == 'Curaga' then -- this is part 2 of the issue
equip(sets.precast.CureFC)
end
the reason your gear wont change is because cure is still a action_type == 'Magic' and lua uses a if/elseif/else/end cycle
so if any if the if/elseif are true in the cycle it will skip all the rest of the elseif/else portions of that cycle an go to the next if/elseif/else/end cycle
try this code
Code:
if spell.action_type == 'Magic' then
equip(sets.precast.FC)
if spellMap == 'Cure' or spellMap == 'Curaga' then
equip(sets.precast.CureFC)
end
end
or
Code:
if spellMap == 'Cure' or spellMap == 'Curaga' then
equip(sets.precast.CureFC)
elseif spell.action_type == 'Magic' then
equip(sets.precast.FC)
end
mind you i have no idea how to use motes include this is just conjecture (as long as the rules are correct) on my part