I was trying to write a skill sequence for rogue depending on the debuffs on the target, and I found that it was not working for me either. So I executed the following code whenever my target had bleed. See attached screen shot also.
It would always return false when the target clearly had the debuff. I also tried using hasBuff since I see it is the same thing. I also tried it with other deBuffs like, Blind and Grievous Wound. Still returned false.
Below is my onPreSkillCast that I'm trying to get working in my profile.
<onPreSkillCast>
player:update()
local target = player:getTarget()
if arg1 == "ROGUE_BLIND_STAB" and target:hasDebuff("Blind") then
return false
elseif arg1 == "ROGUE_SHADOWSTAB" and target:hasDebuff("Bleed") then
return false
elseif arg1 == "ROGUE_LOW_BLOW" and target:hasDebuff("Grievous Wound") then
return false
elseif arg1 == "ROGUE_WOUND_ATTACK" and not target:hasDebuff("Grievous Wound") then
return false
end
return true
</onPreSkillCast>
<onPreSkillCast><![CDATA[
if( arg1.Name == "WARRIOR_SURPRISE_ATTACK" ) then
local cooldown, remaining = RoMScript("GetSkillCooldown(4,7);")
if remaining > 3 then
return false
end
local target = player:getTarget()
if 60 > distance(player.X, player.Z, target.X, target.Z) then
return false -- doesn't use the skill
end
return true
end
]]></onPreSkillCast>
Remember no matter you do in life to always have a little fun while you are at it
I updated to 583 and changed to arg1.Name. It's still not working. I even verified that the debuff variable's name is correct when passing to hasBuff in hasDebuff function.
So I tried it at the command line and it's returning false with hasDebuff and hasBuff when my target has the debuffs.