<onSkillCast>
player:updateBuffs()
if player.Debuffs["Stun"] then
cast("SHIELD_OF_TRUTH")
elseif player.Debuffs["Fear"] then
cast("FEARLESS")
end
</onSkillCast>
And on this one... character is trying to cast Threaten and Mana Return regardless of holy seals on target:
<onPreSkillCast>
if player:haveTarget() then
local deBuffs = {};
for i = 1,#deBuffs,2 do
deBuffs[i] = RoMScript("UnitDebuff('target', "..i..")");
if deBuffs[i] == "Holy Seals (3)" then
RoMScript("CastSpellByName('Threaten')");
break;
elseif deBuffs[i] == "Holy Seals (1)" then
RoMScript("CastSpellByName('Mana Return')");
break;
end
end
end
</onPreSkillCast>
Need at least one Holy Seal on target to cast Mana Return, and need 3 to cast Threaten.
<onSkillCast>
player:updateBuffs()
if player.Debuffs["Stun"] then
cast("SHIELD_OF_TRUTH") --also tried "KNIGHT_SHIELD_OF_TRUTH", and "Shield of Truth"--
end
end
</onSkillCast>
And I get an error that the skill is undefined. However it IS in skills AND local skills. What would cause an undefined skill error for a skill that IS showing to be defined?
Also, preSkillCast works if there is only one event like this;
<onPreSkillCast>
if player:haveTarget() then
local deBuffs = {};
for i = 1,#deBuffs,2 do
deBuffs[i] = RoMScript("UnitDebuff('target', "..i..")");
if deBuffs[i] == "Holy Seals (3)" then
RoMScript("CastSpellByName('Threaten')");
break;
elseif deBuffs[i] == "Holy Seal (1)" then
RoMScript("CastSpellByName('Mana Return')");
break;
end
end
end
</onPreSkillCast>
The wiki seems to be grossly outdated and very little of the code there has worked for me, so any help or direction is appreciated.