Code:
local GluthX
local GluthY
local GluthZ
local GluthO
function Unit_OnCombat(Unit,event)
Unit:SendChatMessage(14,0,"1")
Unit:RegisterEvent("Gluth_Mortal_Wound",13000,0)
Unit:RegisterEvent("Gluth_Enrage",35000,0)
Unit:RegisterEvent("Zombie_Chow",30000,0)
Unit:RegisterEvent("Decimate",105000,0)
Unit:RegisterEvent("Gluth_Berserk",480000,1)
GluthX = Unit:GetX()
GluthY = Unit:GetY()
GluthZ = Unit:GetZ()
GluthO = Unit:GetO()
end
function Unit_OnLeaveCombat(Unit,event)
Unit:RemoveEvents()
end
function Unit_OnDeath(Unit,event)
Unit:RemoveEvents()
end
function Gluth_Mortal_Wound(Unit,event)
Unit:FullCastSpellOnTarget(54378,Unit:GetMainTank())
end
function Gluth_Enrage(Unit,event)
Unit:CastSpell(28371)
end
function Decimate(Unit,Event)
Unit:CastSpell(28374)
end
function Zombie_Chow (Unit, Event)
Unit:SpawnCreature(16360,3269.8266 ,-3172.2434,297.4225 ,0.00, 14, 150000);
Unit:MoveTo(GluthX, GluthY, GluthZ, GluthO)
Unit:RegisterEvent("Health",3000,0)
end
function Health(Unit,event)
if Unit:GetDistanceYards(Unit:GetClosestFriend()) <= 3 then
Unit:SendChatMessage(14,0,"Gluth spots a nearby Zombie to devour it!") -- This is a yell by gluth, are you sure you want this to happen?
Unit:SetHealthPct(Unit:GetHealthPct()+5)
Unit:GetClosestFriend():RemoveFromWorld()
else
return
end
end
function Gluth_Berserk(Unit,event)
Unit:CastSpell(26662)
end
RegisterUnitEvent(37, 1,"Unit_OnCombat")
RegisterUnitEvent(37, 2,"Unit_OnLeaveCombat")
RegisterUnitEvent(37, 4, "Unit_OnDeath")