mirror of
https://github.com/araxiaonline/RandomScriptsforAzerothCore.git
synced 2026-06-13 02:22:19 -04:00
Add files via upload
This commit is contained in:
40
SpectralAttendant2.lua
Normal file
40
SpectralAttendant2.lua
Normal file
@@ -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)
|
||||
42
SpiritofThalgorath.lua
Normal file
42
SpiritofThalgorath.lua
Normal 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)
|
||||
Reference in New Issue
Block a user