Add files via upload

This commit is contained in:
Dinkledork
2023-03-06 05:52:04 -07:00
committed by GitHub
parent 22eed3ecf2
commit 9997b2b1ea
10 changed files with 168 additions and 66 deletions

29
AllianceWarHerald.lua Normal file
View File

@@ -0,0 +1,29 @@
local NPC_ID = 35200 -- replace with the NPC's ID
local BLESSING_SPELL_ID = 100003 -- replace with the first spell ID
local SOULSTONE_SPELL_ID = 20707 -- replace with the second spell ID
local function OnGossipHello(event, player, creature)
player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_ReviveChampion:50:50:-43:0|tReceive the King's blessing", 0, 1, false, "", 0)
player:GossipMenuAddItem(9, "|TInterface\\Icons\\inv_misc_orb_04:50:50:-43:0|tReceive a Soulstone", 0, 2, false, "", 0)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code, menuid)
if intid == 1 then
player:CastSpell(player, BLESSING_SPELL_ID, true)
elseif intid == 2 then
player:CastSpell(player, SOULSTONE_SPELL_ID, true)
end
player:GossipComplete()
end
local function YellDialogue(event, creature)
creature:SendUnitYell("Adventurers, do not go unprepared! Come speak with me and I will grant you a blessing!", 0)
end
RegisterCreatureGossipEvent(NPC_ID, 1, OnGossipHello)
RegisterCreatureGossipEvent(NPC_ID, 2, OnGossipSelect)
-- triggers the yell function on spawn
RegisterCreatureEvent(NPC_ID, 5, function(event, creature) YellDialogue(event, creature) end)

View File

@@ -1,37 +1,26 @@
local BoneSentinel = {}; local BoneSentinel = {};
BoneSentinel.npcId = 400036
local function CastShadowCleave(eventId, delay, calls, creature) local function CastShadowCleave(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 38226, true) creature:CastSpell(creature:GetVictim(), 38226, true)
end end
local function CastEarthQuake(eventId, delay, calls, creature) local function CastEarthquake(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 33919, true) creature:CastSpell(creature:GetVictim(), 33919, true)
end end
local function CastBoneBarrier(eventId, delay, calls, creature) local function OnEnterCombat(event, creature, target)
creature:CastSpell(creature, 49222, true) creature:RegisterEvent(CastShadowCleave, 5000, 0)
creature:RegisterEvent(CastEarthquake, 12000, 0)
end end
function BoneSentinel:OnSpawn(event, creature) local function OnLeaveCombat(event, creature)
creature:CastSpell(creature, 49222, true) creature:RemoveEvents()
creature:RegisterEvent(CastBoneBarrier, 35000, 0)
end end
function BoneSentinel:OnEnterCombat(event, creature, target) local function OnDied(event, creature, killer)
creature:RegisterEvent(CastShadowCleave, 7750, 0) creature:RemoveEvents()
creature:RegisterEvent(CastEarthQuake, 35000, 0)
end end
function BoneSentinel:OnLeaveCombat(event, creature) RegisterCreatureEvent(400036, 1, OnEnterCombat)
-- Do not remove events RegisterCreatureEvent(400036, 2, OnLeaveCombat)
end RegisterCreatureEvent(400036, 4, OnDied)
function BoneSentinel:OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(BoneSentinel.npcId, 5, function(event, creature) BoneSentinel:OnSpawn(event, creature) end)
RegisterCreatureEvent(BoneSentinel.npcId, 1, function(event, creature) BoneSentinel:OnEnterCombat(event, creature) end)
RegisterCreatureEvent(BoneSentinel.npcId, 2, function(event, creature) BoneSentinel:OnLeaveCombat(event, creature) end)
RegisterCreatureEvent(BoneSentinel.npcId, 4, function(event, creature) BoneSentinel:OnDied(event, creature) end)

View File

@@ -1,4 +1,4 @@
local WolfRider = {}; local WolfRider = {};
local dialogues = { local dialogues = {
"For the Horde!", "For the Horde!",
@@ -17,7 +17,7 @@ local dialogues = {
} }
local function OnSpawn(event, creature) local function OnSpawn(event, creature)
local randomDialogue = dialogues[math.random(26)] -- Selects a random dialogue from the "dialogues" table local randomDialogue = dialogues[math.random(#dialogues)] -- Selects a random dialogue from the "dialogues" table
creature:SendUnitYell(randomDialogue,0) -- Makes the creature yell the selected dialogue creature:SendUnitYell(randomDialogue,0) -- Makes the creature yell the selected dialogue
end end

26
HordeWarHerald.lua Normal file
View File

@@ -0,0 +1,26 @@
local BLESSING_SPELL_ID = 100168 -- replace with the first spell ID
local SOULSTONE_SPELL_ID = 20707 -- replace with the second spell ID
local function OnGossipHello(event, player, creature)
player:GossipMenuAddItem(9, "|TInterface\\Icons\\achievement_leader_ thrall:50:50:-23:0|tReceive the Warchief's Rage", 0, 1, false, "", 0)
player:GossipMenuAddItem(9, "|TInterface\\Icons\\inv_misc_orb_04:50:50:-23:0|tReceive a Soulstone", 0, 2, false, "", 0)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code, menuid)
if intid == 1 then
player:CastSpell(player, BLESSING_SPELL_ID, true)
elseif intid == 2 then
player:CastSpell(player, SOULSTONE_SPELL_ID, true)
end
player:GossipComplete()
end
local function YellDialogue(event, creature)
creature:SendUnitYell("Adventurers, do not go unprepared! Come speak with me and I will grant you the strength you need!", 0)
end
RegisterCreatureGossipEvent(400065, 1, OnGossipHello)
RegisterCreatureGossipEvent(400065, 2, OnGossipSelect)
RegisterCreatureEvent(400065, 5, function(event, creature) YellDialogue(event, creature) end)

View File

@@ -2,14 +2,14 @@ local Necrofiend = {}
function Necrofiend.OnEnterCombat(event, creature, target) function Necrofiend.OnEnterCombat(event, creature, target)
creature:RegisterEvent(Necrofiend.WebSpray, 15000, 0) creature:RegisterEvent(Necrofiend.WebSpray, 15000, 0)
creature:RegisterEvent(CastBanefulPoison, 7000, 0) creature:RegisterEvent(Necrofiend.CastBanefulPoison, 7000, 0)
end end
function Necrofiend.WebSpray(eventId, delay, calls, creature) function Necrofiend.WebSpray(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 55508, true) creature:CastSpell(creature:GetVictim(), 55508, true)
end end
local function CastBanefulPoison(eventId, delay, calls, creature) function Necrofiend.CastBanefulPoison(event, delay, calls, creature)
local targets = creature:GetAITargets(10) local targets = creature:GetAITargets(10)
local target = targets[math.random(#targets)] local target = targets[math.random(#targets)]
creature:CastSpell(target, 15475, true) creature:CastSpell(target, 15475, true)

View File

@@ -4,15 +4,15 @@ local function AcidSpit(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 61597, true) creature:CastSpell(creature:GetVictim(), 61597, true)
end end
function CastPoisonCloud(eventId, delay, calls, creature) function CastBludgeoningStrike(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10) local targets = creature:GetAITargets(10)
local target = targets[math.random(#targets)] local target = targets[math.random(#targets)]
creature:CastSpell(target, 12766, true) creature:CastSpell(target, 60870, true)
end end
local function OnEnterCombat(event, creature, target) local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(AcidSpit, 5000, 0) creature:RegisterEvent(AcidSpit, 7000, 0)
creature:RegisterEvent(CastPoisonCloud, 7000, 0) creature:RegisterEvent(CastBludgeoningStrike, 14000, 0)
end end
local function OnLeaveCombat(event, creature) local function OnLeaveCombat(event, creature)
@@ -23,7 +23,7 @@ local function OnDied(event, creature, killer)
creature:RemoveEvents() creature:RemoveEvents()
end end
RegisterCreatureEvent(400050, 1, OnEnterCombat) RegisterCreatureEvent(400054, 1, OnEnterCombat)
RegisterCreatureEvent(400050, 2, OnLeaveCombat) RegisterCreatureEvent(400054, 2, OnLeaveCombat)
RegisterCreatureEvent(400050, 4, OnDied) RegisterCreatureEvent(400054, 4, OnDied)

View File

@@ -1,7 +1,7 @@
local undeadDragon = {} local undeadDragon = {}
function undeadDragon.OnSpawn(event, creature) function undeadDragon.OnSpawn(event, creature)
creature:SetMaxHealth(4554119) creature:SetMaxHealth(5554119)
creature:CanFly(true) creature:CanFly(true)
creature:SetDisableGravity(true) creature:SetDisableGravity(true)
creature:SetReactState(0) creature:SetReactState(0)
@@ -11,13 +11,13 @@ creature:PlayDirectSound(20429)
creature:CastSpell(creature, 100151, true) creature:CastSpell(creature, 100151, true)
creature:CastSpell(creature, 17683, true) creature:CastSpell(creature, 17683, true)
creature:RegisterEvent(undeadDragon.CastSpell2, 15000, 0)
creature:RegisterEvent(undeadDragon.CastSpell2, 20000, 0)
creature:RegisterEvent(undeadDragon.CastSpell3, 3500, 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.CastSpell5, 23000, 0)
creature:RegisterEvent(undeadDragon.CastSpell6, 45000, 0) creature:RegisterEvent(undeadDragon.CastSpell6, 35000, 0)
creature:RegisterEvent(undeadDragon.CastBlizzard, 4000, 0) creature:RegisterEvent(undeadDragon.CastBlizzard, 4000, 0)
creature:RegisterEvent(undeadDragon.CastFlameBreath, 19000, 0) -- added event to cast Flame Breath every 19 seconds
end end
function undeadDragon.OnLeaveCombat(event, creature) function undeadDragon.OnLeaveCombat(event, creature)
@@ -25,46 +25,76 @@ creature:SetRegeneratingHealth(false)
end end
function undeadDragon.CastSpell2(event, delay, pCall, creature) function undeadDragon.CastSpell2(event, delay, pCall, creature)
creature:CastSpell(creature:GetVictim(), 36741, true) --Frostbolt Volley creature:CastSpell(creature:GetVictim(), 58532, true) -- Frostbolt Volley
end end
function undeadDragon.CastSpell3(event, delay, pCall, creature) 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 end
function undeadDragon.CastSpell4(event, delay, pCall, creature) function undeadDragon.CastSpell4(event, delay, pCall, creature)
local targets = creature:GetAITargets() -- Get all creatures with NPC ID 400058 within 100 yards of the undead dragon
local targetCount = #targets local targets = creature:GetCreaturesInRange(100, 400058)
for i = 1, math.min(2, targetCount) do if targets ~= nil then
local target = targets[i] -- Pick 4 random targets from the list of creatures
creature:CastSpell(target, 71285, true) --Frozen Orb 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
end end
function undeadDragon.CastSpell5(event, delay, pCall, creature) function undeadDragon.CastSpell5(event, delay, pCall, creature)
local targets = creature:GetAITargets() -- Get all creatures with NPC ID 400058 within 100 yards of the undead dragon
local targetCount = #targets local targets = creature:GetCreaturesInRange(100, 400058)
for i = 1, math.min(3, targetCount) do if targets ~= nil then
local target = targets[i] -- Pick 4 random targets from the list of creatures
creature:CastSpell(target, 50635, true) --Freeze 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
end end
function undeadDragon.CastSpell6(event, delay, pCall, creature) function undeadDragon.CastSpell6(event, delay, pCall, creature)
creature:CastSpell(creature:GetVictim(), 364730, true) --Whelps creature:CastSpell(creature:GetVictim(), 364730, true) -- Whelps
end end
function undeadDragon.CastBlizzard(event, delay, pCall, creature) function undeadDragon.CastBlizzard(event, delay, pCall, creature)
-- Get all creatures with NPC ID 400058 within 100 yards of the undead dragon -- Get all creatures with NPC ID 400058 within 100 yards of the undead dragon
local targets = creature:GetCreaturesInRange(100, 400058) local targets = creature:GetCreaturesInRange(100, 400058)
if targets ~= nil then if targets ~= nil then
-- Pick 3 random targets from the list of creatures -- Pick 3 random targets from the list of creatures
for i = 1, math.min(3, #targets) do for i = 1, math.min(3, #targets) do
local target = targets[math.random(1, #targets)] local target = targets[math.random(1, #targets)]
-- Cast Blizzard on the random target -- Cast Blizzard on the random target
creature:CastSpell(target, 33634, true) creature:CastSpell(target, 33634, true)
end end
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 end
function undeadDragon.OnDeath(event, creature, killer) function undeadDragon.OnDeath(event, creature, killer)

View File

@@ -3,7 +3,7 @@ local ALLOWED_MAPS = {
1, 1,
} }
local ALLOWED_SPELLS = {100150, 100160} local ALLOWED_SPELLS = {100150, 100160, 10061}
function table.indexOf(t, value) function table.indexOf(t, value)
for k, v in ipairs(t) do for k, v in ipairs(t) do

View File

@@ -9,7 +9,7 @@ function SpectralAttendant.OnEnterCombat(event, creature, target)
creature:RegisterEvent(SpectralAttendant.Immolate, 6000, 0) creature:RegisterEvent(SpectralAttendant.Immolate, 6000, 0)
creature:RegisterEvent(SpectralAttendant.Incinerate, 12000, 0) creature:RegisterEvent(SpectralAttendant.Incinerate, 12000, 0)
creature:RegisterEvent(SpectralAttendant.AOEFear, 30000, 0) creature:RegisterEvent(SpectralAttendant.AOEFear, 30000, 0)
reature:RegisterEvent(SpectralAttendant.Teleport, math.random(12000,16000), 0) creature:RegisterEvent(SpectralAttendant.Teleport, math.random(12000,16000), 0)
end end
function SpectralAttendant.Immolate(eventId, delay, calls, creature) function SpectralAttendant.Immolate(eventId, delay, calls, creature)

28
StoneSkinGargoyle.lua Normal file
View File

@@ -0,0 +1,28 @@
local StoneskinGargoyle = {}
local function GustOfWind(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 61663, true)
end
local function StoneStomp(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
local target = targets[math.random(#targets)]
creature:CastSpell(target, 49675, true)
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(GustOfWind, 15000, 0)
creature:RegisterEvent(StoneStomp, 8000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(400053, 1, OnEnterCombat)
RegisterCreatureEvent(400053, 2, OnLeaveCombat)
RegisterCreatureEvent(400053, 4, OnDied)