View difference between Paste ID: ncad49Yy and isXDHZr4
SHOW: | | - or go back to the newest paste.
1
--When he's aggro'd
2
function Angrond_OnCombat(pUnit, Event)
3
	pUnit:SendChatMessage(14, 0, "Only fools seek death!")
4
	pUnit:RegisterEvent(Angrond_Phase_One, 1000, 0)
5
end
6
7
-- When he dies
8
function Angrond_OnDied(pUnit, Event)
9
	pUnit:SendChatMessage(14, 0, "I've got to run! NO! STAY AWAY FROM THE LIGHT!")
10
	pUnit:RemoveEvents()
11
end
12
13
-- When he kills a player
14
function Angrond_OnKilledTarget(pUnit, Event)
15
	pUnit:SendChatMessage(14, 0, "Fall to the shadows!")
16
	pUnit:CastSpell(40318)
17
end
18
19
-- When he leaves combat (either players run or entire group wipes
20
function Angrond_OnLeaveCombat(pUnit, Event)
21
	pUnit:SendChatMessage(14, 0, "The shadows have prevailed!")
22
	pUnit:RemoveEvents()
23
end
24
	
25
--Phase One
26
function Angrond_Phase_One(pUnit, Event)
27
	if (pUnit:GetHealthPct() <= 50) then
28-
	pUnit:SendChatMessage(14, 0, "You're really starting to piss me off!")
28+
		pUnit:RemoveEvents()
29-
	pUnit:RegisterEvent(Angrond_Phasetwo, 1000, 0)
29+
		pUnit:SendChatMessage(14, 0, "You're really starting to piss me off!")
30
		pUnit:RegisterEvent(Angrond_Final_Phase, 1000, 0)
31
		pUnit:CastSpell(40318)
32
		pUnit:CastSpell(40318)
33
		pUnit:CastSpell(40318)
34
	end
35
end
36-
function Anrond_Ground_Phase(pUnit, event)
36+
37-
if (pUnit:GetHealthPct() <= 30) then
37+
--3rd and final phase | no second phase exists?
38-
	pUnit:SendChatMessage(14, 0, "I can not fail! FELL THE SHADOWS!")
38+
39-
  pUnit:Root()       
39+
	if (pUnit:GetHealthPct() <= 30) then
40-
	pUnit:RegisterEvent(Angrond_Ground, 3000, 0) -- This will cast it once every three seconds, if he's a caster you'll want him to chain it so set it to 1100 miliseconds as the cast time is 1 sec.
40+
		pUnit:RemoveEvents()
41
		pUnit:SendChatMessage(14, 0, "I can not fail! FELL THE SHADOWS!")
42
		pUnit:Root()       
43
		pUnit:RegisterEvent(Angrond_Shadowbolt, 3000, 0) -- This will cast it once every three seconds, if he's a caster you'll want him to chain it so set it to 1100 miliseconds as the cast time is 1 sec.
44
	end
45-
	function Angrond_Shadowbolt(pUnit, event)
45+
46
47
--[[ What is this? Why is this defined twice?
48
function Angrond_Shadowbolt(pUnit, event)
49
	pUnit:CastSpell(101329)
50
	pUnit:RemoveEvents()
51
end
52-
--3d and final phase
52+
]]
53
	
54-
if (pUnit:GetHealthPct() <= 20) then
54+
function Angrond_Shadowbolt(pUnit, Event)
55-
	pUnit:SendChatMessage(14, 0, "I can not fail! FELL THE SHADOWS!")
55+
	pUnit:FullCastSpellOnTarget(39026, pUnit:GetRandomPlayer(0))
56-
  pUnit:Root()       
56+
57-
	pUnit:RegisterEvent(Angrond_Shadowbolt, 3000, 0) -- This will cast it once every three seconds, if he's a caster you'll want him to chain it so set it to 1100 miliseconds as the cast time is 1 sec.
57+
58
RegisterUnitEvent(88803, 1, Angrond_OnCombat)
59
RegisterUnitEvent(88803, 2, Angrond_OnLeaveCombat)
60
RegisterUnitEvent(88803, 3, Angrond_OnKilledTarget)
61
RegisterUnitEvent(88803, 4, Angrond_OnDied)