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:
@@ -1,7 +1,7 @@
|
||||
local undeadDragon = {}
|
||||
|
||||
function undeadDragon.OnSpawn(event, creature)
|
||||
creature:SetMaxHealth(4554119)
|
||||
creature:SetMaxHealth(5554119)
|
||||
creature:CanFly(true)
|
||||
creature:SetDisableGravity(true)
|
||||
creature:SetReactState(0)
|
||||
@@ -11,13 +11,13 @@ creature:PlayDirectSound(20429)
|
||||
creature:CastSpell(creature, 100151, true)
|
||||
creature:CastSpell(creature, 17683, true)
|
||||
|
||||
|
||||
creature:RegisterEvent(undeadDragon.CastSpell2, 20000, 0)
|
||||
creature:RegisterEvent(undeadDragon.CastSpell2, 15000, 0)
|
||||
creature:RegisterEvent(undeadDragon.CastSpell3, 3500, 0)
|
||||
creature:RegisterEvent(undeadDragon.CastSpell4, 10000, 0)
|
||||
creature:RegisterEvent(undeadDragon.CastSpell4, 6000, 0)
|
||||
creature:RegisterEvent(undeadDragon.CastSpell5, 23000, 0)
|
||||
creature:RegisterEvent(undeadDragon.CastSpell6, 45000, 0)
|
||||
creature:RegisterEvent(undeadDragon.CastSpell6, 35000, 0)
|
||||
creature:RegisterEvent(undeadDragon.CastBlizzard, 4000, 0)
|
||||
creature:RegisterEvent(undeadDragon.CastFlameBreath, 19000, 0) -- added event to cast Flame Breath every 19 seconds
|
||||
end
|
||||
|
||||
function undeadDragon.OnLeaveCombat(event, creature)
|
||||
@@ -25,46 +25,76 @@ creature:SetRegeneratingHealth(false)
|
||||
end
|
||||
|
||||
function undeadDragon.CastSpell2(event, delay, pCall, creature)
|
||||
creature:CastSpell(creature:GetVictim(), 36741, true) --Frostbolt Volley
|
||||
creature:CastSpell(creature:GetVictim(), 58532, true) -- Frostbolt Volley
|
||||
end
|
||||
|
||||
function undeadDragon.CastSpell3(event, delay, pCall, creature)
|
||||
creature:CastSpell(creature:GetVictim(), 44614, true) --Frostfire. Make Custom
|
||||
-- Get all creatures within 100 yards of the undead dragon
|
||||
local targets = creature:GetAITargets()
|
||||
|
||||
-- Filter out creatures with NPC ID 400058
|
||||
local validTargets = {}
|
||||
for i, target in pairs(targets) do
|
||||
if target:GetEntry() ~= 400058 then
|
||||
table.insert(validTargets, target)
|
||||
end
|
||||
end
|
||||
|
||||
-- If there are any valid targets, select a random one and cast Frostfire on it
|
||||
if #validTargets > 0 then
|
||||
local target = validTargets[math.random(1, #validTargets)]
|
||||
creature:CastSpell(target, 47610, true)
|
||||
end
|
||||
end
|
||||
|
||||
function undeadDragon.CastSpell4(event, delay, pCall, creature)
|
||||
local targets = creature:GetAITargets()
|
||||
local targetCount = #targets
|
||||
for i = 1, math.min(2, targetCount) do
|
||||
local target = targets[i]
|
||||
creature:CastSpell(target, 71285, true) --Frozen Orb
|
||||
-- Get all creatures with NPC ID 400058 within 100 yards of the undead dragon
|
||||
local targets = creature:GetCreaturesInRange(100, 400058)
|
||||
if targets ~= nil then
|
||||
-- Pick 4 random targets from the list of creatures
|
||||
for i = 1, math.min(3, #targets) do
|
||||
local target = targets[math.random(1, #targets)]
|
||||
-- Cast Frozen Orb on the random target
|
||||
creature:CastSpell(target, 71285, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function undeadDragon.CastSpell5(event, delay, pCall, creature)
|
||||
local targets = creature:GetAITargets()
|
||||
local targetCount = #targets
|
||||
for i = 1, math.min(3, targetCount) do
|
||||
local target = targets[i]
|
||||
creature:CastSpell(target, 50635, true) --Freeze
|
||||
-- Get all creatures with NPC ID 400058 within 100 yards of the undead dragon
|
||||
local targets = creature:GetCreaturesInRange(100, 400058)
|
||||
if targets ~= nil then
|
||||
-- Pick 4 random targets from the list of creatures
|
||||
for i = 1, math.min(3, #targets) do
|
||||
local target = targets[math.random(1, #targets)]
|
||||
-- Cast Freeze on the random target
|
||||
creature:CastSpell(target, 50635, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function undeadDragon.CastSpell6(event, delay, pCall, creature)
|
||||
creature:CastSpell(creature:GetVictim(), 364730, true) --Whelps
|
||||
creature:CastSpell(creature:GetVictim(), 364730, true) -- Whelps
|
||||
end
|
||||
|
||||
function undeadDragon.CastBlizzard(event, delay, pCall, creature)
|
||||
-- Get all creatures with NPC ID 400058 within 100 yards of the undead dragon
|
||||
local targets = creature:GetCreaturesInRange(100, 400058)
|
||||
if targets ~= nil then
|
||||
-- Pick 3 random targets from the list of creatures
|
||||
for i = 1, math.min(3, #targets) do
|
||||
local target = targets[math.random(1, #targets)]
|
||||
-- Cast Blizzard on the random target
|
||||
creature:CastSpell(target, 33634, true)
|
||||
end
|
||||
end
|
||||
-- Get all creatures with NPC ID 400058 within 100 yards of the undead dragon
|
||||
local targets = creature:GetCreaturesInRange(100, 400058)
|
||||
if targets ~= nil then
|
||||
-- Pick 3 random targets from the list of creatures
|
||||
for i = 1, math.min(3, #targets) do
|
||||
local target = targets[math.random(1, #targets)]
|
||||
-- Cast Blizzard on the random target
|
||||
creature:CastSpell(target, 33634, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function undeadDragon.CastFlameBreath(event, delay, pCall, creature)
|
||||
local enemies = creature:GetUnfriendlyUnitsInRange(30)
|
||||
if not creature:IsCasting() and #enemies > 0 then
|
||||
creature:CastSpell(creature:GetVictim(), 100172, false) -- Frost Breath
|
||||
end
|
||||
end
|
||||
|
||||
function undeadDragon.OnDeath(event, creature, killer)
|
||||
|
||||
Reference in New Issue
Block a user