forked from ornfelt/azerothcore_lua_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGolemagg.lua
More file actions
49 lines (41 loc) · 1.56 KB
/
Golemagg.lua
File metadata and controls
49 lines (41 loc) · 1.56 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
Golemagg = {}
Golemagg.enraged = {}
function Golemagg.CastPyroblast(eventId, delay, calls, creature)
local targets = creature:GetAITargets()
local target = targets[math.random(#targets)]
creature:CastSpell(target, 20228, true)
end
function Golemagg.CastEarthquake(eventId, delay, calls, creature)
creature:CastSpell(creature, 19798, false)
creature:RegisterEvent(Golemagg.CastEarthquake, 17000, 0)
end
function Golemagg.DamageTaken(event, creature, attacker, damage)
if not Golemagg.enraged[creature:GetGUID()] and creature:GetHealthPct() < 10 then
creature:CastSpell(creature, 20544, true)
creature:CastSpell(creature, 19798, true)
creature:RegisterEvent(Golemagg.CastEarthquake, 5300, 1)
Golemagg.enraged[creature:GetGUID()] = true
end
end
function Golemagg.OnEnterCombat(event, creature, target)
creature:RegisterEvent(Golemagg.CastPyroblast, math.random(3000, 7000), 0)
creature:CastSpell(creature, 13879, true)
creature:CastSpell(creature, 20556, true)
creature:CastSpell(creature, 18943, true)
end
function Golemagg.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function Golemagg.OnDied(event, creature, killer)
creature:RemoveEvents()
Golemagg.enraged[creature:GetGUID()] = nil
end
function Golemagg.OnSpawn(event, creature)
creature:SetMaxHealth(1652176)
Golemagg.enraged[creature:GetGUID()] = false
end
RegisterCreatureEvent(11988, 1, Golemagg.OnEnterCombat)
RegisterCreatureEvent(11988, 2, Golemagg.OnLeaveCombat)
RegisterCreatureEvent(11988, 4, Golemagg.OnDied)
RegisterCreatureEvent(11988, 5, Golemagg.OnSpawn)
RegisterCreatureEvent(11988, 9, Golemagg.DamageTaken)