Add files via upload

This commit is contained in:
Dinkledork
2023-03-18 03:06:10 -06:00
committed by GitHub
parent 3d8464205f
commit 0caf1270ee
2 changed files with 82 additions and 0 deletions

42
SpiritofThalgorath.lua Normal file
View File

@@ -0,0 +1,42 @@
local SpiritofThalgorath = {}
function SpiritofThalgorath.OnSpawn(event, creature)
creature:SendUnitYell("You will not defeat me so easily!", 0)
end
function SpiritofThalgorath.OnEnterCombat(event, creature, target)
creature:RegisterEvent(SpiritofThalgorath.Charge, 1000, 1)
creature:RegisterEvent(SpiritofThalgorath.Charge, 8000, 0)
creature:RegisterEvent(SpiritofThalgorath.ShadowBolt, 2000, 1)
creature:RegisterEvent(SpiritofThalgorath.ShadowBolt, 6000, 0)
end
function SpiritofThalgorath.Charge(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, 100, true)
else
creature:CastSpell(creature:GetVictim(), 100, true)
end
end
function SpiritofThalgorath.ShadowBolt(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 9613, false)
end
function SpiritofThalgorath.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function SpiritofThalgorath.OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(400103, 5, SpiritofThalgorath.OnSpawn)
RegisterCreatureEvent(400103, 1, SpiritofThalgorath.OnEnterCombat)
RegisterCreatureEvent(400103, 2, SpiritofThalgorath.OnLeaveCombat)
RegisterCreatureEvent(400103, 4, SpiritofThalgorath.OnDied)