Add files via upload

This commit is contained in:
Dinkledork
2023-03-21 02:26:13 -06:00
committed by GitHub
parent 700c67a93f
commit 2b50ae9df0
57 changed files with 2884 additions and 0 deletions

10
Faction_Shared/Auto91.lua Normal file
View File

@@ -0,0 +1,10 @@
--Custom Content Auto-loader. If you don't see custom content in Azeroth or unscripted creatures, it's because it's December 31st. Just .event stop 91 and .event start 91 again.
--DO NOT TOUCH! THIS IS TO FIX AN EXTREMELY ANNOYING BUG!
local eventId = 91
function OnStartup()
StartGameEvent(eventId, true)
end
RegisterServerEvent(14, OnStartup)

View File

@@ -0,0 +1,22 @@
local npcId = 400092
local spellId1 = 100199
local spellId2 = 100206
local range = 8
local killCreditNpcId = 400095
function OnSpellCast(event, player, spell)
local spellEntry = spell:GetEntry()
if spellEntry == spellId1 or spellEntry == spellId2 then
nearestCreature = player:GetNearestCreature(range, npcId)
if nearestCreature == nil then
player:SendBroadcastMessage("You need to place the barrier in a more strategic location.")
spell:Cancel()
else
player:KilledMonsterCredit(killCreditNpcId)
player:SendBroadcastMessage("You have successfully built a barrier!")
end
end
end
RegisterPlayerEvent(5, OnSpellCast)

View File

@@ -0,0 +1,35 @@
local BlightedZombie = {}
function BlightedZombie.OnSpawn(event, creature)
creature:SetMaxHealth(17720)
creature:CastSpell(creature:GetVictim(), 17683, true)
end
function BlightedZombie.OnCombat(event, creature, target)
creature:RegisterEvent(BlightedZombie.Ability1, 7000, 0)
creature:RegisterEvent(BlightedZombie.Ability2, 14000, 0)
end
function BlightedZombie.Ability1(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 52476, true)
end
function BlightedZombie.Ability2(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 37597, true)
end
function BlightedZombie.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function BlightedZombie.OnDeath(event, creature, killer)
creature:DespawnOrUnsummon(5000)
creature:RemoveEvents()
end
RegisterCreatureEvent(400051, 1, BlightedZombie.OnCombat)
RegisterCreatureEvent(400051, 2, BlightedZombie.OnLeaveCombat)
RegisterCreatureEvent(400051, 4, BlightedZombie.OnDeath)
RegisterCreatureEvent(400051, 5, BlightedZombie.OnSpawn)

View File

@@ -0,0 +1,26 @@
local BlightedZombie = {}
function BlightedZombie.OnCombat(event, creature, target)
creature:RegisterEvent(BlightedZombie.Ability1, 7000, 0)
creature:RegisterEvent(BlightedZombie.Ability2, 12000, 0)
end
function BlightedZombie.Ability1(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 52476, true)
end
function BlightedZombie.Ability2(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 37597, true)
end
function BlightedZombie.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function BlightedZombie.OnDeath(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(4475, 1, BlightedZombie.OnCombat)
RegisterCreatureEvent(4475, 2, BlightedZombie.OnLeaveCombat)
RegisterCreatureEvent(4475, 4, BlightedZombie.OnDeath)

View File

@@ -0,0 +1,44 @@
local BlisteringZombie = {};
local function CastArmyOfTheDead(eventId, delay, calls, creature)
creature:CastSpell(creature, 42650, true)
end
local function CastSpit(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 25262, true)
end
local function CastSpecialSpell(eventId, delay, calls, creature)
local victim = creature:GetVictim()
if not victim then
return
end
if victim:GetEntry() == 32666 or victim:GetEntry() == 32667 or victim:GetEntry() == 31144 or victim:GetEntry() == 31146 then
creature:CastSpell(victim, 5, true)
end
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastArmyOfTheDead, 25000, 0)
creature:RegisterEvent(CastSpit, 5000, 0)
creature:RegisterEvent(CastSpecialSpell, 1000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnSpawn(event, creature)
creature:RegisterEvent(CastArmyOfTheDead, 1000, 1)
end
local function OnDied(event, creature, killer)
creature:DespawnOrUnsummon(5000)
creature:RemoveEvents()
end
RegisterCreatureEvent(400029, 1, OnEnterCombat)
RegisterCreatureEvent(400029, 2, OnLeaveCombat)
RegisterCreatureEvent(400029, 4, OnDied)
RegisterCreatureEvent(400029, 5, OnSpawn)

View File

@@ -0,0 +1,28 @@
local BlisteringZombie = {};
function BlisteringZombie.OnSpawn(event, creature)
creature:SetMaxHealth(8224)
creature:CastSpell(creature:GetVictim(), 17683, true)
end
function BlisteringZombie.OnCombat(event, creature, target)
creature:RegisterEvent(BlisteringZombie.Ability1, 8000, 0)
end
function BlisteringZombie.Ability1(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 55604, true)
end
function BlisteringZombie.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function BlisteringZombie.OnDeath(event, creature, killer)
creature:DespawnOrUnsummon(10000)
creature:RemoveEvents()
end
RegisterCreatureEvent(400077, 1, BlisteringZombie.OnCombat)
RegisterCreatureEvent(400077, 2, BlisteringZombie.OnLeaveCombat)
RegisterCreatureEvent(400077, 4, BlisteringZombie.OnDeath)
RegisterCreatureEvent(400077, 5, BlisteringZombie.OnSpawn)

View File

@@ -0,0 +1,19 @@
local BoneWitch = {};
local function CastBoneShards(eventId, delay, calls, creature)
creature:CastSpell(creature, 17014, true)
end
local function OnSpawn(event, creature, target)
creature:RegisterEvent(CastBoneShards, 100, 1)
creature:RegisterEvent(CastBoneShards, 14000, 0)
end
local function OnDied(event, creature, killer)
creature:DespawnOrUnsummon(25000)
creature:RemoveEvents()
end
RegisterCreatureEvent(16380, 5, OnSpawn)
RegisterCreatureEvent(16380, 4, OnDied)

View File

@@ -0,0 +1,27 @@
local CreepStalker = {};
local function CastRake(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 9904, true)
end
local function CastStun(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 34510, true)
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastRake, 5000, 0)
creature:RegisterEvent(CastStun, 12000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDied(event, creature, killer)
creature:DespawnOrUnsummon(5000)
creature:RemoveEvents()
end
RegisterCreatureEvent(400032, 1, OnEnterCombat)
RegisterCreatureEvent(400032, 2, OnLeaveCombat)
RegisterCreatureEvent(400032, 4, OnDied)

View File

@@ -0,0 +1,61 @@
local GAME_EVENT_ID = 17 -- Set the game event ID
local npcIds = {344, 12480, 1284, 400064, 234, 3429} -- Add your NPC entries here
local BROADCAST_MESSAGE = "The Scourge are attacking the people of Azeroth. Quickly adventurers, prepare yourselves for battle!"
local SOUND_ID = 13363
local excludedZones = {44} -- Replace these with the zone IDs where you don't want the sound to play
local YELL_MESSAGES = {
"The Scourge have come!",
"Beware, the Scourge approaches!",
"Defend our home, the Scourge is upon us!",
"To arms, the Scourge is here!",
"All fighters ready the assault against the Scourge.",
"The Scourge invasion has begun!",
"The Lich Kings minions have come! Rally against the Scourge!",
"The Scourge dares to attack us!",
"Show the Scourge the might of the people of Azeroth!"
}
local function YellRandomMessage(npc)
local messageIndex = math.random(1, #YELL_MESSAGES)
npc:SendUnitYell(YELL_MESSAGES[messageIndex], 0)
end
local function valueExists(tbl, value)
for _, v in ipairs(tbl) do
if v == value then
return true
end
end
return false
end
local function DespawnAndRespawnNpcs(event, gameEventId)
if gameEventId == GAME_EVENT_ID then
local players = GetPlayersInWorld() -- Get all players in the world
if event == 34 then -- Game Event Start
SendWorldMessage(BROADCAST_MESSAGE, 2) -- Broadcast the message with chat type 2 (SYSTEM)
for _, player in ipairs(players) do
local playerZoneId = player:GetZoneId()
if not valueExists(excludedZones, playerZoneId) then
player:PlayDirectSound(SOUND_ID) -- Play the sound for each player
end
end
end
for _, player in ipairs(players) do
for _, npcId in ipairs(npcIds) do
local npcs = player:GetCreaturesInRange(1000, npcId) -- Get creatures within a radius of 1000 units from the player
for _, npc in ipairs(npcs) do
if event == 34 then -- Game Event Start
YellRandomMessage(npc)
end
npc:DespawnOrUnsummon()
npc:Respawn()
end
end
end
end
end
RegisterServerEvent(34, DespawnAndRespawnNpcs) -- Game Event Start
RegisterServerEvent(35, DespawnAndRespawnNpcs) -- Game Event End

110
Faction_Shared/DingMask.lua Normal file
View File

@@ -0,0 +1,110 @@
--lightning
local npcIds1 = {
8541,
10417,
4475,
11873,
8531,
11551,
10488,
10487,
1788,
10414,
10407,
400010,
400011,
400015,
400016,
300018,
16383,
16394,
16423,
16422,
400036,
400049,
400048,
16437,
16438
}
-- Rez Visual
local npcIds2 = {
400013,
400014,
68,
1976,
466,
400018,
400019,
400026,
400027,
400033,
400070,
400065,
400042,
400043
}
-- Shadowstep
local npcIds3 = {
400053,
400069,
400055,
400052,
400047,
400056,
400032,
400029,
400073,
400072,
400102,
400103
}
-- Function to be executed when an NPC from group 1 is spawned
local function CastSpellOnSpawnGroup1(event, creature)
if not creature then
print("Error: creature was not set!")
return
end
local spellId = 28234
creature:CastSpell(creature, spellId, true) -- minion visual
end
-- Function to be executed when an NPC from group 2 is spawned
local function CastSpellOnSpawnGroup2(event, creature)
if not creature then
print("Error: creature was not set!")
return
end
local spellId = 100133
creature:CastSpell(creature, spellId, true) -- rez visual
end
-- Function to be executed when an NPC from group 3 is spawned
local function CastSpellOnSpawnGroup3(event, creature)
if not creature then
print("Error: creature was not set!")
return
end
local spellId = 51908
creature:CastSpell(creature, spellId, true) -- shadowstep cosmetic
end
-- Register the event for NPCs in group 1
for _, npcId in ipairs(npcIds1) do
RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup1)
end
-- Register the event for NPCs in group 2
for _, npcId in ipairs(npcIds2) do
RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup2)
end
-- Register the event for NPCs in group 3
for _, npcId in ipairs(npcIds3) do
RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup3)
end

View File

@@ -0,0 +1,13 @@
local SPELL_ID = 100191
local AURA_1 = 100003
local AURA_2 = 100168
function OnKilledByCreature(event, killer, killed)
if (killed:HasAura(AURA_1) or killed:HasAura(AURA_2)) then
if not killed:HasSpellCooldown(SPELL_ID) then
killed:CastSpell(killed, SPELL_ID, false)
end
end
end
RegisterPlayerEvent(8, OnKilledByCreature)

60
Faction_Shared/Emote.lua Normal file
View File

@@ -0,0 +1,60 @@
local GAME_EVENT_ID = 17
local npcIds = {777, 790, 415, 956, 3356, 341, 793, 343, 342, 812, 1671, 10037, 859, 382, 1070, 931, 932, 903, 935, 68, 12480, 12481, 3479, 3483, 3477, 3486, 3478, 3431, 3481, 3482, 3464, 3489, 3432, 3480}
local secondNpcIds = {3088}
local thirdNpcIds = {3501, 3615}
local EMOTE_ID = 333 -- 1h ready
local SECOND_EMOTE_ID = 214 -- rifle ready
local THIRD_EMOTE_ID = 375 -- 2h ready
local function IsGameEventActive(eventId)
local activeEvents = GetActiveGameEvents()
for _, event in ipairs(activeEvents) do
if event == eventId then
return true
end
end
return false
end
local function ApplyEmoteToNpcs(players, npcIds, emoteId)
for _, player in ipairs(players) do
for _, npcId in ipairs(npcIds) do
local npcs = player:GetCreaturesInRange(1000, npcId)
for _, npc in ipairs(npcs) do
npc:EmoteState(emoteId)
end
end
end
end
local function SetNpcsEmoteState(event, gameEventId)
if gameEventId == GAME_EVENT_ID then
local players = GetPlayersInWorld()
ApplyEmoteToNpcs(players, npcIds, EMOTE_ID)
ApplyEmoteToNpcs(players, secondNpcIds, SECOND_EMOTE_ID)
ApplyEmoteToNpcs(players, thirdNpcIds, THIRD_EMOTE_ID)
end
end
local function ResetNpcsEmoteState(event, gameEventId)
if gameEventId == GAME_EVENT_ID then
local players = GetPlayersInWorld()
ApplyEmoteToNpcs(players, npcIds, 0)
ApplyEmoteToNpcs(players, secondNpcIds, 0)
ApplyEmoteToNpcs(players, thirdNpcIds, 0)
end
end
local function OnPlayerMapChange(event, player, newMap, newZone)
if IsGameEventActive(GAME_EVENT_ID) then
ApplyEmoteToNpcs({player}, npcIds, EMOTE_ID)
ApplyEmoteToNpcs({player}, secondNpcIds, SECOND_EMOTE_ID)
end
end
RegisterPlayerEvent(27, OnPlayerMapChange)
RegisterServerEvent(34, SetNpcsEmoteState)
RegisterServerEvent(35, ResetNpcsEmoteState)

View File

@@ -0,0 +1,25 @@
local FlameShocker = {};
local function CastFlameShock(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 10448, true)
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastFlameShock, 100, 1)
creature:RegisterEvent(CastFlameShock, 8000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDied(event, creature, killer)
creature:CastSpell(killer, 28323, true)
creature:DespawnOrUnsummon(25000)
creature:RemoveEvents()
end
RegisterCreatureEvent(16383, 1, OnEnterCombat)
RegisterCreatureEvent(16383, 2, OnLeaveCombat)
RegisterCreatureEvent(16383, 4, OnDied)

View File

@@ -0,0 +1,37 @@
local FleshFlayer = {};
local function CastLeap(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 47482, true)
end
local function CastPlague(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 52230, true)
end
local function CastExplode(eventId, delay, calls, creature)
creature:CastSpell(creature, 47496, true)
end
local function CastRend(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 18106, true)
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastLeap, 100, 1)
creature:RegisterEvent(CastPlague, 500, 1)
creature:RegisterEvent(CastRend, 2000, 1)
creature:RegisterEvent(CastPlague, 20000, 0)
creature:RegisterEvent(CastExplode, 30000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(10407, 1, OnEnterCombat)
RegisterCreatureEvent(10407, 2, OnLeaveCombat)
RegisterCreatureEvent(10407, 4, OnDied)

33
Faction_Shared/Ghoul.lua Normal file
View File

@@ -0,0 +1,33 @@
local Ghoul = {};
local function CastLeap(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 47482, true)
end
local function CastPlague(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 52230, true)
end
local function CastExplode(eventId, delay, calls, creature)
creature:CastSpell(creature, 47496, true)
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastLeap, 100, 1)
creature:RegisterEvent(CastPlague, 100, 1)
creature:RegisterEvent(CastPlague, 20000, 0)
creature:RegisterEvent(CastExplode, 23000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDied(event, creature, killer)
creature:DespawnOrUnsummon(5000)
creature:RemoveEvents()
end
RegisterCreatureEvent(400047, 1, OnEnterCombat)
RegisterCreatureEvent(400047, 2, OnLeaveCombat)
RegisterCreatureEvent(400047, 4, OnDied)

View File

@@ -0,0 +1,27 @@
local GibberingGhoul = {}
function GibberingGhoul.OnCombat(event, creature, target)
creature:RegisterEvent(GibberingGhoul.Ability2, 100, 1)
creature:RegisterEvent(GibberingGhoul.Ability1, 7000, 0)
creature:RegisterEvent(GibberingGhoul.Ability2, 12000, 0)
end
function GibberingGhoul.Ability1(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 34113, true)
end
function GibberingGhoul.Ability2(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 12889, true)
end
function GibberingGhoul.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function GibberingGhoul.OnDeath(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(8531, 1, GibberingGhoul.OnCombat)
RegisterCreatureEvent(8531, 2, GibberingGhoul.OnLeaveCombat)
RegisterCreatureEvent(8531, 4, GibberingGhoul.OnDeath)

View File

@@ -0,0 +1,35 @@
local HateShrieker = {}
function HateShrieker.OnEnterCombat(event, creature, target)
creature:RegisterEvent(HateShrieker.Screech, 7000, 0)
creature:RegisterEvent(HateShrieker.ShadowWordPain, math.random(11000,16000), 0)
end
function HateShrieker.Screech(eventId, delay, calls, creature)
creature:CastSpell(creature, 3589)
end
function HateShrieker.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function HateShrieker.OnDied(event, creature, killer)
creature:RemoveEvents()
end
function HateShrieker.ShadowWordPain(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 10893)
creature:ClearThreatList()
end
RegisterCreatureEvent(8541, 1, HateShrieker.OnEnterCombat)
RegisterCreatureEvent(8541, 2, HateShrieker.OnLeaveCombat)
RegisterCreatureEvent(8541, 4, HateShrieker.OnDied)

View File

@@ -0,0 +1,23 @@
local BRAVE_IDS = {5412, 5614, 5511, 5512, 957, 7798, 11026, 5518, 5510, 5509, 1416, 5514, 29016, 29019, 3518, 1472, 31423, 3314, 3312, 3323, 5188, 3370, 3368, 3371, 3316, 3405, 11046, 3347, 3348, 6986, 31433}
local BRAVERY_DIALOGUE = {
"I fear no enemy!",
"I will fight to the bitter end!",
"This battle is mine!",
"This is MY city!",
"My courage will never falter!",
"I'll show you what true bravery is!",
"I am unbreakable!",
"This fight is mine to win!",
"I'll fight until my last breath!",
"Pfft, you think you can scare the likes of me!?"
}
local function OnCombat(event, creature, target)
if math.random() < 0.5 then -- 50% chance to trigger dialogue
creature:SendUnitSay(BRAVERY_DIALOGUE[math.random(#BRAVERY_DIALOGUE)], 0)
end
end
for i, id in ipairs(BRAVE_IDS) do
RegisterCreatureEvent(id, 1, OnCombat)
end

View File

@@ -0,0 +1,29 @@
local FREAKOUT_NPC = { 30217, 4981, 483, 5193, 1402, 70021, 1257, 1286, 1285, 3520, 3513, 1432, 1402, 1444, 7917, 1212, 6173, 5489, 4982, 5484, 14500, 14450, 14496, 14497, 6579, 5519, 6007, 29152, 9977, 1395, 2795, 1320, 1318, 1310, 3399, 7010, 5811, 3351, 400062, 400067 }
function OnEnterCombat(event, creature, target)
creature:CastSpell(creature, 31358, true) -- fear spell
local yellOptions = {
"Aaahhh! Somebody help!",
"I can't believe this is happening, why is this happening?!",
"I don't know what to do, I don't know what to do!",
"No! Stay away from me!",
"Please, please let this be a nightmare!",
"I can't handle this, I can't handle this!",
"No, no, no!",
"This can't be happening!",
"I'm not ready for this!",
"This is insane, how did we get here?!",
"Why is this happening to me?!",
"I don't want to die!",
"I'm not prepared for this, I'm not prepared for this at all!",
"Please, someone help me!",
"There's no way this is happening!"
}
local randomIndex = math.random(1, 15)
local selectedYell = yellOptions[randomIndex]
creature:SendUnitYell(selectedYell, 0)
end
for i, id in ipairs(FREAKOUT_NPC) do
RegisterCreatureEvent(id, 1, OnEnterCombat)
end

View File

@@ -0,0 +1,45 @@
local Necrofiend = {}
function Necrofiend.OnEnterCombat(event, creature, target)
creature:RegisterEvent(Necrofiend.WebSpray, 15000, 0, creature)
creature:RegisterEvent(Necrofiend.CastBanefulPoison, 7000, 0, creature)
creature:RegisterEvent(Necrofiend.SpecialSpell, 1000, 0, creature)
end
function Necrofiend.SpecialSpell(eventId, delay, calls, creature)
local victim = creature:GetVictim()
if not victim then
return
end
if victim:GetEntry() == 32666 or victim:GetEntry() == 32667 or victim:GetEntry() == 31144 or victim:GetEntry() == 31146 then
creature:CastSpell(victim, 5, true)
end
end
function Necrofiend.WebSpray(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 55508, true)
end
function Necrofiend.CastBanefulPoison(event, delay, calls, creature)
local targets = creature:GetAITargets(10)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 15475, true)
end
function Necrofiend.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function Necrofiend.OnDied(event, creature, killer)
creature:DespawnOrUnsummon(5000)
creature:RemoveEvents()
end
RegisterCreatureEvent(400055, 1, Necrofiend.OnEnterCombat)
RegisterCreatureEvent(400055, 2, Necrofiend.OnLeaveCombat)
RegisterCreatureEvent(400055, 4, Necrofiend.OnDied)

View File

@@ -0,0 +1,36 @@
local Necrofiend = {}
function Necrofiend.OnEnterCombat(event, creature, target)
creature:RegisterEvent(Necrofiend.WebSpray, 12000, 0, creature)
creature:RegisterEvent(Necrofiend.CastBanefulPoison, 7000, 0, creature)
creature:RegisterEvent(Necrofiend.DeadlyPoison, 10000, 0, creature)
end
function Necrofiend.WebSpray(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 55508, true)
end
function Necrofiend.DeadlyPoison(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 34616, true)
end
function Necrofiend.CastBanefulPoison(event, delay, calls, creature)
local targets = creature:GetAITargets(10)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 15475, true)
end
function Necrofiend.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function Necrofiend.OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(11551, 1, Necrofiend.OnEnterCombat)
RegisterCreatureEvent(11551, 2, Necrofiend.OnLeaveCombat)
RegisterCreatureEvent(11551, 4, Necrofiend.OnDied)

View File

@@ -0,0 +1,7 @@
local PallidHorror = {}
function PallidHorror.OnDied(event, creature, killer)
creature:CastSpell(creature, 28699, true)
end
RegisterCreatureEvent(16394, 4, PallidHorror.OnDied)

View File

@@ -0,0 +1,65 @@
local GAME_EVENT_ID = 17 -- Set the game event ID
local MAX_NPC_SPAWN = 3 -- Set the maximum number of NPCs to spawn simultaneously. Extremely high numbers will hurt performance
local ATTACK_CHANCE = 15 -- Set the likelihood of an attack here, in percent
local DAZE_SPELL_ID = 100201 -- Set the spell ID for daze
local creatureEntries = {
16423,
16422,
400011
} -- Add NPC entries above (CHANGE THESE OR IT WON'T WORK! I'M USING CUSTOM IDs)
local npcdialogue = {
"Grrrr...",
"Rrrrr...",
"Grraaargh...",
"Raaargh...",
"Hssss..."
} -- Add dialogue above
local function IsGameEventActive(eventId)
local activeEvents = GetActiveGameEvents()
for _, event in ipairs(activeEvents) do
if event == eventId then
return true
end
end
return false
end
local function SpawnAttacker(event, player)
if IsGameEventActive(GAME_EVENT_ID) then
local chance = math.random(100)
if chance <= ATTACK_CHANCE then
local mapId = player:GetMapId()
local x, y, z, o = player:GetLocation()
local level = player:GetLevel()
local health = player:GetHealth() * 1.65
local npcCount = math.random(1, MAX_NPC_SPAWN)
-- Check if the player is mounted and not flying
if player:IsMounted() and not player:IsFlying() then
player:Dismount()
player:CastSpell(player, DAZE_SPELL_ID, true)
player:SendBroadcastMessage("You have been knocked off your mount!")
end
for i = 1, npcCount do
local selectedCreature = creatureEntries[math.random(#creatureEntries)]
local randomX = x + math.random(-18, 18)
local randomY = y + math.random(-18, 18)
local spawnedCreature = player:SpawnCreature(selectedCreature, randomX, randomY, z, o, 7, 130000)
spawnedCreature:SetLevel(level)
spawnedCreature:SetMaxHealth(health)
spawnedCreature:SetHealth(health)
spawnedCreature:AttackStart(player)
local selectedDialogue = npcdialogue[math.random(#npcdialogue)]
spawnedCreature:SendUnitYell(selectedDialogue, 0)
end
end
end
end
RegisterPlayerEvent(27, SpawnAttacker)

View File

@@ -0,0 +1,64 @@
local Rattlegore = {};
local function Thunderclap(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 26554, true)
end
local function WhirlwindKnockback(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 34109, true)
end
local function Enrage(eventId, delay, calls, creature)
creature:CastSpell(creature, 15716, true)
end
local function BoneArmor(eventId, delay, calls, creature)
creature:CastSpell(creature, 38882, true)
end
local function Thrash(eventId, delay, calls, creature)
creature:CastSpell(creature, 3391, true)
end
local function SweepingStrikes(eventId, delay, calls, creature)
creature:CastSpell(creature, 18765, true)
end
function Stun(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 17308, true)
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(Thunderclap, 7000, 0)
creature:RegisterEvent(WhirlwindKnockback, 11000)
creature:RegisterEvent(Stun, 16000, 0)
creature:RegisterEvent(Thrash, 8500, 0)
creature:RegisterEvent(BoneArmor, 15000, 0)
creature:RegisterEvent(BoneArmor, 500, 1)
creature:RegisterEvent(SweepingStrikes, 100, 1)
end
local function OnHealthUpdate(event, creature, value)
if (creature:GetHealthPct() <= 20) then
creature:RemoveEvents()
creature:RegisterEvent(Enrage, 100, 1)
end
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(11622, 1, OnEnterCombat)
RegisterCreatureEvent(11622, 9, OnHealthUpdate)
RegisterCreatureEvent(11622, 2, OnLeaveCombat)
RegisterCreatureEvent(11622, 4, OnDied)

View File

@@ -0,0 +1,53 @@
local RisenConstruct = {};
local function ArcingSmash(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 1619, true)
end
local function Enrage(eventId, delay, calls, creature)
creature:CastSpell(creature, 15716, true)
end
local function Thrash(eventId, delay, calls, creature)
creature:CastSpell(creature, 3391, true)
end
local function SweepingStrikes(eventId, delay, calls, creature)
creature:CastSpell(creature, 18765, true)
end
function Stun(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 17308, true)
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(ArcingSmash, 7000, 0)
creature:RegisterEvent(Stun, 13000, 0)
creature:RegisterEvent(Thrash, 8500, 0)
creature:RegisterEvent(SweepingStrikes, 100, 1)
end
local function OnHealthUpdate(event, creature, value)
if (creature:GetHealthPct() <= 20) then
creature:RemoveEvents()
creature:RegisterEvent(Enrage, 100, 1)
end
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(10488, 1, OnEnterCombat)
RegisterCreatureEvent(10488, 9, OnHealthUpdate)
RegisterCreatureEvent(10488, 2, OnLeaveCombat)
RegisterCreatureEvent(10488, 4, OnDied)

View File

@@ -0,0 +1,33 @@
local RisenGuard = {}
function RisenGuard.OnCombat(event, creature, target)
creature:RegisterEvent(RisenGuard.Ability2, 100, 1)
creature:RegisterEvent(RisenGuard.Ability1, 7000, 0)
creature:RegisterEvent(RisenGuard.Ability2, 12000, 0)
creature:RegisterEvent(RisenGuard.Ability3, 10000, 0)
end
function RisenGuard.Ability1(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 34113, true)
end
function RisenGuard.Ability2(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 8380, true)
end
function RisenGuard.Ability3(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 5164, true)
end
function RisenGuard.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function RisenGuard.OnDeath(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(10489, 1, RisenGuard.OnCombat)
RegisterCreatureEvent(10489, 2, RisenGuard.OnLeaveCombat)
RegisterCreatureEvent(10489, 4, RisenGuard.OnDeath)

View File

@@ -0,0 +1,22 @@
local questIds = {9265, 9264, 9263, 9262, 9261, 9260}
local itemId = 22892
local itemCount = 3
local totalLooted = {}
local function OnLootItem(event, player, item, count)
if item:GetEntry() == itemId then
for _, questId in pairs(questIds) do
if player:HasQuest(questId) then
if not totalLooted[questId] then
totalLooted[questId] = 0
end
totalLooted[questId] = totalLooted[questId] + count
if totalLooted[questId] >= itemCount then
player:CompleteQuest(questId)
end
end
end
end
end
RegisterPlayerEvent(32, OnLootItem)

View File

@@ -0,0 +1,49 @@
Bonk = {}
-- Create the item you want to give to the player
Bonk.ITEM_ID = 60112 -- replace with the ID of the item you want to give
Bonk.ITEM_ID2 = 37500 -- replace with the ID of the new item you want to give
-- Register the gossip event for the NPC
function Bonk.OnGossipHello(event, player, creature)
player:GossipMenuAddItem(0, "|TInterface\\Icons\\ability_druid_flightform:50:50:-13:0|tMech Wings for 75 silver.", 0, 1)
player:GossipMenuAddItem(0, "|TInterface\\Icons\\inv_misc_key_14:50:50:-13:0|tKeys to a Shredder for 45 silver.", 0, 2)
player:GossipSendMenu(1, creature)
end
function Bonk.OnGossipSelect(event, player, creature, sender, intid, code)
if intid == 1 then
if player:GetCoinage() < 7500 then
player:SendBroadcastMessage("You don't have enough coins.")
player:GossipComplete()
else
player:SetCoinage(player:GetCoinage() - 7500)
player:AddItem(Bonk.ITEM_ID, 1)
player:SendBroadcastMessage("You have received Mech Wings.")
player:GossipComplete()
end
elseif intid == 2 then
if player:GetCoinage() < 4500 then
player:SendBroadcastMessage("You don't have enough coins.")
player:GossipComplete()
else
player:SetCoinage(player:GetCoinage() - 4500)
player:AddItem(Bonk.ITEM_ID2, 1)
player:SendBroadcastMessage("You have received keys to a Refurbished Shredder.")
player:GossipComplete()
end
end
end
-- Send a unit yell when the NPC spawns
function Bonk.OnSpawn(event, creature)
creature:SendUnitYell("Step right up! I've got Mech Wings and keys to Refurbished Shredders!", 0)
creature:CastSpell(creature, 20374)
end
-- Register the gossip events with the NPC
RegisterCreatureGossipEvent(400043, 1, Bonk.OnGossipHello)
RegisterCreatureGossipEvent(400043, 2, Bonk.OnGossipSelect)
RegisterCreatureEvent(400043, 5, Bonk.OnSpawn)

View File

@@ -0,0 +1,48 @@
local SkeletalWarlord = {}
SkeletalWarlord.minChargeRange = 10
function SkeletalWarlord.OnEnterCombat(event, creature, target)
creature:RegisterEvent(SkeletalWarlord.Whirlwind, 15000, 0)
creature:RegisterEvent(SkeletalWarlord.MortalStrike, 7000, 0)
creature:RegisterEvent(SkeletalWarlord.Charge, 10000, 0)
end
function SkeletalWarlord.Whirlwind(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 36982, true)
end
function SkeletalWarlord.MortalStrike(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 21553, true)
end
function SkeletalWarlord.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function SkeletalWarlord.OnDied(event, creature, killer)
creature:DespawnOrUnsummon(15000)
creature:RemoveEvents()
end
function SkeletalWarlord.Charge(eventId, delay, calls, creature)
local targets = creature:GetAITargets(SkeletalWarlord.minChargeRange)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 19471, true)
end
RegisterCreatureEvent(400056, 1, SkeletalWarlord.OnEnterCombat)
RegisterCreatureEvent(400056, 2, SkeletalWarlord.OnLeaveCombat)
RegisterCreatureEvent(400056, 4, SkeletalWarlord.OnDied)
RegisterCreatureEvent(1788, 1, SkeletalWarlord.OnEnterCombat)
RegisterCreatureEvent(1788, 2, SkeletalWarlord.OnLeaveCombat)
RegisterCreatureEvent(1788, 4, SkeletalWarlord.OnDied)

View File

@@ -0,0 +1,28 @@
local SkeletalWarrior = {}
function SkeletalWarrior.OnSpawn(event, creature)
creature:SetMaxHealth(7720)
creature:CastSpell(creature:GetVictim(), 17683, true)
end
function SkeletalWarrior.OnCombat(event, creature, target)
creature:RegisterEvent(SkeletalWarrior.Ability1, 10000, 0)
end
function SkeletalWarrior.Ability1(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 6547, true)
end
function SkeletalWarrior.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function SkeletalWarrior.OnDeath(event, creature, killer)
creature:DespawnOrUnsummon(10000)
creature:RemoveEvents()
end
RegisterCreatureEvent(400016, 1, SkeletalWarrior.OnCombat)
RegisterCreatureEvent(400016, 2, SkeletalWarrior.OnLeaveCombat)
RegisterCreatureEvent(400016, 4, SkeletalWarrior.OnDeath)
RegisterCreatureEvent(400016, 5, SkeletalWarrior.OnSpawn)

View File

@@ -0,0 +1,62 @@
local SpectralAttendant = {}
function SpectralAttendant.OnSpawn(event, creature)
creature:SetMaxHealth(43240)
creature:CastSpell(creature, 17683, true)
end
function SpectralAttendant.OnEnterCombat(event, creature, target)
creature:RegisterEvent(SpectralAttendant.Immolate, 6000, 0)
creature:RegisterEvent(SpectralAttendant.Incinerate, 12000, 0)
creature:RegisterEvent(SpectralAttendant.AOEFear, 30000, 0)
creature:RegisterEvent(SpectralAttendant.CastSpecialSpell, 1000, 0)
creature:RegisterEvent(SpectralAttendant.Teleport, math.random(12000,16000), 0)
end
function SpectralAttendant.CastSpecialSpell(eventId, delay, calls, creature)
local victim = creature:GetVictim()
if not victim then
return
end
if victim:GetEntry() == 32666 or victim:GetEntry() == 32667 or victim:GetEntry() == 31144 or victim:GetEntry() == 31146 then
creature:CastSpell(victim, 5, true)
end
end
function SpectralAttendant.Immolate(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 11668, true)
end
function SpectralAttendant.Incinerate(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 29722, 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:DespawnOrUnsummon(5000)
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(400052, 5, SpectralAttendant.OnSpawn)
RegisterCreatureEvent(400052, 1, SpectralAttendant.OnEnterCombat)
RegisterCreatureEvent(400052, 2, SpectralAttendant.OnLeaveCombat)
RegisterCreatureEvent(400052, 4, SpectralAttendant.OnDied)

View 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)

View File

@@ -0,0 +1,20 @@
--DO NOT DELETE ME! FIXES AN ANNOYING AF BUG
local holidayEventIds = {17, 91}
local function OnPlayerLogin(event, player)
if not player:IsInWorld() then
return
end
for _, eventId in ipairs(holidayEventIds) do
local isHolidayActive = IsGameEventActive(eventId)
if isHolidayActive then
StopGameEvent(eventId)
StartGameEvent(eventId)
end
end
end
RegisterPlayerEvent(3, OnPlayerLogin)

View File

@@ -0,0 +1,32 @@
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)
if #targets == 0 then
return
end
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:DespawnOrUnsummon(5000)
creature:RemoveEvents()
end
RegisterCreatureEvent(400053, 1, OnEnterCombat)
RegisterCreatureEvent(400053, 2, OnLeaveCombat)
RegisterCreatureEvent(400053, 4, OnDied)

View File

@@ -0,0 +1,45 @@
local NPC_ID = 400034 -- The ID of the NPC you want players to get kill credit for
-- List of allowed zones (use zone ID)
local ALLOWED_ZONES = {
1519, -- SW City
12,
14,
1637
}
-- List of allowed spell IDs
local ALLOWED_SPELLS = {
100144, -- Spell 1
100142,
100143,
100145,
-- Add more spells here as needed
}
-- Define the indexOf function for tables
function table.indexOf(t, value)
for k, v in ipairs(t) do
if v == value then
return k
end
end
return -1
end
function OnPlayerCastSpell(event, player, spell)
local spellId = spell:GetEntry()
local zoneId = player:GetZoneId()
if table.indexOf(ALLOWED_SPELLS, spellId) ~= -1 then
if table.indexOf(ALLOWED_ZONES, zoneId) == -1 then
spell:Cancel()
player:SendBroadcastMessage("You cannot use that here.")
else
player:KilledMonsterCredit(NPC_ID)
player:SendBroadcastMessage("You have successfuly placed a trap!")
end
end
end
RegisterPlayerEvent(5, OnPlayerCastSpell)

View File

@@ -0,0 +1,59 @@
local GOSSIP_OPTION_CUT_TREE = 1
local LOG_ITEM_ID = 60116
local BARRIERS_BUILT_QUEST_ID = 30012
local SECOND_PERMITTED_QUEST_ID = 30020
function OnCreatureSpawn(event, creature)
creature:SetReactState(0)
end
function OnGossipHello(event, player, creature)
if player:IsMounted() then
player:SendBroadcastMessage("You must dismount first!")
return
end
if not player:HasItem(1311) then
player:SendBroadcastMessage("You need the Wood Cutter Axe in order to chop down this tree!")
return
end
if not (player:HasQuest(BARRIERS_BUILT_QUEST_ID) or player:HasQuest(SECOND_PERMITTED_QUEST_ID)) then
player:SendBroadcastMessage("You must be on a certain quest before you can chop down this tree!")
return
end
if player:HasItem(LOG_ITEM_ID, 20) then
player:SendBroadcastMessage("You have the maximum amount of logs already!")
return
end
creature:SetReactState(0)
player:GossipMenuAddItem(8, "Cut down this tree", 1, GOSSIP_OPTION_CUT_TREE)
player:GossipSendMenu(8, creature)
end
function OnGossipSelect(event, player, creature, sender, intid)
if intid == GOSSIP_OPTION_CUT_TREE then
player:CastSpell(creature, 62990, false)
player:Kill(creature)
player:KilledMonsterCredit(400091)
player:GossipComplete()
end
end
function OnCreatureDeath(event, creature, killer)
creature:DespawnOrUnsummon(12000)
creature:RemoveEvents()
-- Give the player 1-3 logs upon death
if killer ~= nil and killer:IsPlayer() then
local logs = math.random(1, 3)
killer:AddItem(LOG_ITEM_ID, logs)
end
end
RegisterCreatureEvent(400091, 5, OnCreatureSpawn)
RegisterCreatureGossipEvent(400091, 1, OnGossipHello)
RegisterCreatureGossipEvent(400091, 2, OnGossipSelect)
RegisterCreatureEvent(400091, 4, OnCreatureDeath)

View File

@@ -0,0 +1,38 @@
local VenomBelcher = {};
local function VenomSpit(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 24011, true)
end
local function SlowingPoison(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 14897, true)
end
function CastRetchingPlague(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 30080, true)
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(VenomSpit, 7000, 0)
creature:RegisterEvent(CastRetchingPlague, 13000, 0)
creature:RegisterEvent(SlowingPoison, 16000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(10417, 1, OnEnterCombat)
RegisterCreatureEvent(10417, 2, OnLeaveCombat)
RegisterCreatureEvent(10417, 4, OnDied)