From 0caf1270ee22d18c57f991fdf1d22a657b3aae64 Mon Sep 17 00:00:00 2001 From: Dinkledork <118951051+Day36512@users.noreply.github.com> Date: Sat, 18 Mar 2023 03:06:10 -0600 Subject: [PATCH] Add files via upload --- SpectralAttendant2.lua | 40 ++++++++++++++++++++++++++++++++++++++++ SpiritofThalgorath.lua | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 SpectralAttendant2.lua create mode 100644 SpiritofThalgorath.lua diff --git a/SpectralAttendant2.lua b/SpectralAttendant2.lua new file mode 100644 index 0000000..357d25a --- /dev/null +++ b/SpectralAttendant2.lua @@ -0,0 +1,40 @@ +local SpectralAttendant = {} + +function SpectralAttendant.OnEnterCombat(event, creature, target) +creature:RegisterEvent(SpectralAttendant.Cripple, 6000, 0) +creature:RegisterEvent(SpectralAttendant.AOEFear, 13000, 0) +creature:RegisterEvent(SpectralAttendant.Teleport, math.random(14000,16000), 0) +end + + +function SpectralAttendant.Cripple(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 11443, true) +end + +function SpectralAttendant.AOEFear(eventId, delay, calls, creature) +creature:CastSpell(creature, 8122) +end + +function SpectralAttendant.OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +function SpectralAttendant.OnDied(event, creature, killer) +creature:RemoveEvents() +end + +function SpectralAttendant.Teleport(eventId, delay, calls, creature) +local targets = creature:GetAITargets(10) +if #targets == 0 then + return +end +local target = targets[math.random(#targets)] +creature:CastSpell(target, 69904) +creature:ClearThreatList() +end + + + +RegisterCreatureEvent(11873, 1, SpectralAttendant.OnEnterCombat) +RegisterCreatureEvent(11873, 2, SpectralAttendant.OnLeaveCombat) +RegisterCreatureEvent(11873, 4, SpectralAttendant.OnDied) \ No newline at end of file diff --git a/SpiritofThalgorath.lua b/SpiritofThalgorath.lua new file mode 100644 index 0000000..8edb95b --- /dev/null +++ b/SpiritofThalgorath.lua @@ -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)