Code:
function The_Lich_King_OnEnterCombat(pUnit, Event)
pUnit:SendChatMessage(14, 7, "Who dares oppose The Lich King!") -- new line for event, also are you sure you want to use language 7? That's not something everyone can read...
pUnit:RegisterEvent("The_Lich_King_HeartStrike", 3000, 0)
PUnit:RegisterEvent("The_Lich_king_MoonFire", 2250,0)
end
Function The_Lich_King_HeartStrike(pUnit, Event) -- This should be done for the other function as well, it's to stop it returning an error if it doesn't find a player for some reason (which happens a lot)
local plr = pUnit:GetRandomPlayer(0) -- plr is a random player
if plr ~= nil then -- if our player is a person and not nothing
pUnit:FullCastSpell(55262, plr) -- cast it on the player
end -- end the iff
end
Function The_Lich_King_MoonFire(pUnit, Event) -- same as above
PUnit:FullCastSpell(48463, pUnit:GetRandomPlayer(0))
end -- end is not a capital E, I changed it to e
function The_Lich_King_Death(pUnit, Event)
pUnit:RemoveEvents()
pUnit:SendChatMessage(14, 0, "Someone must sit upon the throne.")
end
RegisterUnitEvent(99909, 1, "The_Lich_King_OnEnterCombat")
RegisterUnitEvent(99909, 4, "The_Lich_King_Death")
Fixed errors and commented.