Originally Posted by
warlock2000
Hi, quick question for the knowledgeable guys. Here's a piece of code I've written for a Shadowburn function with Havoc up. It works perfectly for its designed function so far in raids.
The weird thing is, if I'm running around Shrine or in a raid instance and do not have a target, I get huge LUA error spam. The moment I target any player or Npc, the spam stops.
Code:
local Targethealth = 100*UnitHealth("target")/UnitHealthMax("target")
local Havoc,_,_,Havocstacks = UnitBuffID("player",80240)
local TargetID = tonumber(UnitGUID("target"):sub(6,10),16)
----------------------------------------------------------------------------
if UnitAffectingCombat("player")
and UnitExists("target") ~= nil then
if TargetID == 73195 -- Kor'kron Jailer
or TargetID == 71720 -- Ice Tomb
or TargetID == 71979 -- Kor'kron Warbringer
or TargetID == 71983 -- Farseer Wolf Rider
or TargetID == 72154 -- Desecrated Weapon
or TargetID == 72198 -- Empowered Desecrated Weapon
or TargetID == 72272 then -- Minion of Y'Shaarj
if IsPlayerSpell(17877) == true
and PQR_SpellAvailable(17877) == true
and IsSpellInRange(GetSpellInfo(17877),"target") == 1
and Havoc ~= nil and Havocstacks >= 1
and UnitPower("player",14) >= 1
and Targethealth <= 20 then
CastSpellByName(GetSpellInfo(17877),"target")
LASTCAST = "Shadowburn"
return true
end
end
end
Any ideas?!?