Code:
function morrowgar(pUnit, Event)
pUnit:SetFaction(35) -- Friendly, since if he has been attacked before and goes hostile, it saves hostile...
pUnit:RegisterEvent("wait_a_sec", 1000, 0)
end
function wait_a_sec(pUnit)
local plr = pUnit:GetClosestPlayer()
if plr ~= nil -- if there is a result
pUnit:RemoveEvents() -- Stops it checking by removing previous register
pUnit:AttackReaction(plr,1,0) -- Applys aggro on creature from player
pUnit:SetFaction(21) -- Makes the creature hostile
end
end
RegisterUnitEvent(npcid, 18, "morrowgar") -- 18 being on spawn