forked from ornfelt/azerothcore_lua_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAUndeadWarlord.lua
More file actions
71 lines (59 loc) · 2.06 KB
/
AUndeadWarlord.lua
File metadata and controls
71 lines (59 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
local UndeadWarlord = {};
local function CastShadowStrike(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 33914, true)
end
local function CastFear(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 5782, true)
end
local enterCombatDialogue = {
"Your end has come. I will feast on your bones.",
"You are no match for me!",
"Your death will be swift.",
"You dare challenge me?"
}
local leaveCombatDialogue = {
"Coward!",
"You won't escape next time!",
"I'll be back for more!",
"You are lucky to leave this place alive."
}
local killTargetDialogue = {
"Another soul for the taking!",
"Your life is mine!",
"You were no match for me!",
"Your death was inevitable."
}
local deathDialogue = {
"You... How?",
"I'll be back!",
"This is not the end!",
"I'll haunt your dreams!"
}
function UndeadWarlord.OnEnterCombat(event, creature, target)
local randomDialogue = enterCombatDialogue[math.random(4)]
creature:SendUnitYell(randomDialogue, 0)
creature:RegisterEvent(CastShadowStrike, 5000, 0)
creature:RegisterEvent(CastFear, 7000, 0)
end
function UndeadWarlord.OnLeaveCombat(event, creature)
local randomDialogue = leaveCombatDialogue[math.random(4)]
creature:SendUnitYell(randomDialogue, 0)
creature:RemoveEvents()
end
function UndeadWarlord.OnKilledTarget(event, creature, victim)
local randomDialogue = killTargetDialogue[math.random(4)]
creature:SendUnitYell(randomDialogue, 0)
end
function UndeadWarlord.OnDied(event, creature, killer)
local randomDialogue = deathDialogue[math.random(4)]
creature:SendUnitYell(randomDialogue, 0)
creature:RemoveEvents()
end
function UndeadWarlord.OnSpawn(event, creature)
creature:SendUnitYell("Quickly servants! The Master expects swift results.", 0)
end
RegisterCreatureEvent(300018, 1, UndeadWarlord.OnEnterCombat)
RegisterCreatureEvent(300018, 2, UndeadWarlord.OnLeaveCombat)
RegisterCreatureEvent(300018, 3, UndeadWarlord.OnKilledTarget)
RegisterCreatureEvent(300018, 4, UndeadWarlord.OnDied)
RegisterCreatureEvent(300018, 5, UndeadWarlord.OnSpawn)