forked from ornfelt/azerothcore_lua_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDingMask.lua
More file actions
110 lines (99 loc) · 1.68 KB
/
DingMask.lua
File metadata and controls
110 lines (99 loc) · 1.68 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
--lightning
local npcIds1 = {
8541,
10417,
4475,
11873,
8531,
11551,
10488,
10487,
1788,
10414,
10407,
400010,
400011,
400015,
400016,
300018,
16383,
16394,
16423,
16422,
400036,
400049,
400048,
16437,
16438
}
-- Rez Visual
local npcIds2 = {
400013,
400014,
68,
1976,
466,
400018,
400019,
400026,
400027,
400033,
400070,
400065,
400042,
400043
}
-- Shadowstep
local npcIds3 = {
400053,
400069,
400055,
400052,
400047,
400056,
400032,
400029,
400073,
400072,
400102,
400103
}
-- Function to be executed when an NPC from group 1 is spawned
local function CastSpellOnSpawnGroup1(event, creature)
if not creature then
print("Error: creature was not set!")
return
end
local spellId = 28234
creature:CastSpell(creature, spellId, true) -- minion visual
end
-- Function to be executed when an NPC from group 2 is spawned
local function CastSpellOnSpawnGroup2(event, creature)
if not creature then
print("Error: creature was not set!")
return
end
local spellId = 100133
creature:CastSpell(creature, spellId, true) -- rez visual
end
-- Function to be executed when an NPC from group 3 is spawned
local function CastSpellOnSpawnGroup3(event, creature)
if not creature then
print("Error: creature was not set!")
return
end
local spellId = 51908
creature:CastSpell(creature, spellId, true) -- shadowstep cosmetic
end
-- Register the event for NPCs in group 1
for _, npcId in ipairs(npcIds1) do
RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup1)
end
-- Register the event for NPCs in group 2
for _, npcId in ipairs(npcIds2) do
RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup2)
end
-- Register the event for NPCs in group 3
for _, npcId in ipairs(npcIds3) do
RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup3)
end