forked from ornfelt/azerothcore_lua_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArcherusDK.lua
More file actions
83 lines (66 loc) · 2.49 KB
/
ArcherusDK.lua
File metadata and controls
83 lines (66 loc) · 2.49 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
local ArcherusDK = {};
local hasCastIceboundFortitude = false;
local function CastIcyTouch(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 49896, true)
end
local function CastPlagueStrike(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 49917, true)
end
local function CastBloodBoil(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 48721, true)
end
local function CastDnD(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 43265, true)
end
local function CastDeathstrike(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 49999, true)
end
local function CastAntiMagicShield(eventId, delay, calls, creature)
creature:CastSpell(creature, 24021, true)
end
local function CastAntiMagicZone(eventId, delay, calls, creature)
creature:CastSpell(creature, 51052, true)
end
local function CastSpecialSpell(eventId, delay, calls, creature)
local victim = creature:GetVictim()
if not victim then
return
end
if victim:GetEntry() == 32666 or victim:GetEntry() == 32667 or victim:GetEntry() == 31144 or victim:GetEntry() == 31146 then
creature:CastSpell(victim, 5, true)
end
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastIcyTouch, 5000, 0)
creature:RegisterEvent(CastPlagueStrike, 6000, 0)
creature:RegisterEvent(CastDeathstrike, 25000, 0)
creature:RegisterEvent(CastBloodBoil, math.random(12000, 18000), 0)
creature:RegisterEvent(CastDnD, 100, 1)
creature:RegisterEvent(CastSpecialSpell, 1000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
creature:RegisterEvent(CastAntiMagicShield, 18000, 0)
creature:RegisterEvent(CastAntiMagicZone, 18000, 0)
end
local function OnDied(event, creature, killer)
creature:RemoveEvents()
end
local function OnSpawn(event, creature)
creature:RegisterEvent(CastAntiMagicShield, 18000, 0)
creature:RegisterEvent(CastAntiMagicZone, 36000, 0)
end
local function CastBloodBoil(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 48721, true)
end
local function OnHealthCheck(event, creature, victim, health)
if (creature:GetHealthPct() <= 20 and not hasCastIceboundFortitude) then
creature:CastSpell(creature, 48792, true)
hasCastIceboundFortitude = true
end
end
RegisterCreatureEvent(400046, 1, OnEnterCombat)
RegisterCreatureEvent(400046, 2, OnLeaveCombat)
RegisterCreatureEvent(400046, 4, OnDied)
RegisterCreatureEvent(400046, 5, OnSpawn)
RegisterCreatureEvent(400046, 9, OnHealthCheck)