Working in XML and cannot get this to work. I have tried both lua script and C#code and still not working.
First the lua script
<FightClassSpell>
<FightClassConditions>
<FightClassCondition>
<ContionType>LuaScript</ContionType>
<Param xsi:type="FightClassConditionLua">
<LuaScript>anyCurse = false;
for i=1,40 do
local name, rank, icon, count, debuffAuraType = UnitAura("player", i);
if debuffAuraType == "Magic" then
anyCurse = true;
return;
end
end</LuaScript>
<VarRet>anyCurse</VarRet>
<ValueRet>true</ValueRet>
</Param>
</FightClassCondition>
</FightClassConditions>
<SpellName>CastSpellByID(100503);</SpellName>
<Priority>13</Priority>
<CombatOnly>false</CombatOnly>
<CheckIfKnow>false</CheckIfKnow>
<CheckIfSpellUsable>false</CheckIfSpellUsable>
<CheckSpellDistance>false</CheckSpellDistance>
<CheckIfView>false</CheckIfView>
<NotSpellIsLuaScript>true</NotSpellIsLuaScript>
<Debug>true</Debug>
<WaitDuringCasting>false</WaitDuringCasting>
</FightClassSpell>
Ive also tried this
<FightClassConditions>
<FightClassCondition>
<ContionType>LuaScript</ContionType>
<Param xsi:type="FightClassConditionLua">
<LuaScript>anyCurse = false;
for i=1,40 do
local name, rank, icon, count, debuffAuraType = UnitAura("player", i);
if name and debuffAuraType and debuffAuraType == "Magic" then
anyCurse = true;
return;
end
end</LuaScript>
<VarRet>anyCurse</VarRet>
<ValueRet>true</ValueRet>
</Param>
</FightClassCondition>
</FightClassConditions>
<SpellName>CastSpellByID(100503);</SpellName>
<Priority>13</Priority>
<CombatOnly>false</CombatOnly>
<CheckIfKnow>false</CheckIfKnow>
<CheckIfSpellUsable>false</CheckIfSpellUsable>
<CheckSpellDistance>false</CheckSpellDistance>
<CheckIfView>false</CheckIfView>
<NotSpellIsLuaScript>true</NotSpellIsLuaScript>
<Debug>true</Debug>
<WaitDuringCasting>false</WaitDuringCasting>
</FightClassSpell>