forked from ornfelt/azerothcore_lua_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDarionTur.lua
More file actions
38 lines (29 loc) · 1.12 KB
/
DarionTur.lua
File metadata and controls
38 lines (29 loc) · 1.12 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
local CustomCreature = {}
local NPC_ID = 400081
local MAX_HEALTH = 8432 -- Set the desired max health value
local ABILITY_1 = 16856
local ABILITY_2 = 676
function CustomCreature.OnSpawn(event, creature)
creature:SetMaxHealth(MAX_HEALTH)
creature:SetHealth(MAX_HEALTH)
end
function CustomCreature.OnCombat(event, creature, target)
creature:RegisterEvent(CustomCreature.Ability1, 7000, 0)
creature:RegisterEvent(CustomCreature.Ability2, 22000, 0)
end
function CustomCreature.Ability1(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), ABILITY_1, true)
end
function CustomCreature.Ability2(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), ABILITY_2, true)
end
function CustomCreature.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function CustomCreature.OnDeath(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(NPC_ID, 5, CustomCreature.OnSpawn)
RegisterCreatureEvent(NPC_ID, 1, CustomCreature.OnCombat)
RegisterCreatureEvent(NPC_ID, 2, CustomCreature.OnLeaveCombat)
RegisterCreatureEvent(NPC_ID, 4, CustomCreature.OnDeath)