local pet = 91337
function Intro(Unit, Event)
if pet:IsCreature() == true then
pet:RegisterEvent("Follow", 100, 0)
else
end
end
function Follow(Unit, Event)
local plr = pet:GetClosestPlayer()
x = plr:GetX()
y = plr:GetY()
z = plr:GetZ()
o = plr:GetO()
x = x - 5
pet:MoveTo(x,y,z,o)
RegisterUnitEvent(Follow2, 1000, 0)
end
function Follow2(Unit, Event)
local plr = pet:GetClosestPlayer()
x = plr:GetX()
y = plr:GetY()
z = plr:GetZ()
o = plr:GetO()
x = x - 5
pet:MoveTo(x,y,z,o)
RegisterUnitEvent(Follow, 1000, 0)
end
RegisterUnitEvent(1, "PetCombat")
function PetCombat(pUnit, Event)
if pet:GetHealthPct() >99 then
pet:SendChatMessage(14, 0, "Finally some action!")
Choice=math.random(1, 3)
if Choice==1 then
pet:FullCastSpellOnTarget(42917, pUnit:GetNearestPlayer())
end
if Choice==2 then
pet:FullCastSpellOnTarget(6215, pUnit:GetNearestPlayer())
end
end
end
end
function pet_onleavecombat(Unit, Event)
pet = Unit
pet:RemoveEvents()
pet:RegisterEvent("Follow", 100, 0)
end