Add files via upload

This commit is contained in:
Dinkledork
2023-03-18 03:05:01 -06:00
committed by GitHub
parent 4ba87552c3
commit 3d8464205f
7 changed files with 82 additions and 97 deletions

31
DeathStalker.lua Normal file
View File

@@ -0,0 +1,31 @@
local DeathStalker = {}
function DeathStalker.OnEnterCombat(event, creature, target)
creature:RegisterEvent(DeathStalker.Cripple, 1000, 1)
creature:RegisterEvent(DeathStalker.Cripple, 8000, 0)
end
function DeathStalker.Cripple(eventId, delay, calls, creature)
local targetList = creature:GetAITargets(5)
local targetCount = #targetList
if targetCount > 0 then
local randomIndex = math.random(1, targetCount)
local randomTarget = targetList[randomIndex]
creature:CastSpell(randomTarget, 6217, true)
else
creature:CastSpell(creature:GetVictim(), 6217, true)
end
end
function DeathStalker.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function DeathStalker.OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(400102, 1, DeathStalker.OnEnterCombat)
RegisterCreatureEvent(400102, 2, DeathStalker.OnLeaveCombat)
RegisterCreatureEvent(400102, 4, DeathStalker.OnDied)