diff --git a/Orgrimmar/ArcherusDK.lua b/Orgrimmar/ArcherusDK.lua new file mode 100644 index 0000000..011cd38 --- /dev/null +++ b/Orgrimmar/ArcherusDK.lua @@ -0,0 +1,83 @@ +local ArcherusDK = {}; +local hasCastIceboundFortitude = false; + +local function CastIcyTouch(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 49896, true) +end + +local function CastPlagueStrike(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 49917, true) +end + +local function CastBloodBoil(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 48721, true) +end + +local function CastDnD(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 43265, true) +end + +local function CastDeathstrike(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 49999, true) +end + + +local function CastAntiMagicShield(eventId, delay, calls, creature) +creature:CastSpell(creature, 24021, true) +end + +local function CastAntiMagicZone(eventId, delay, calls, creature) +creature:CastSpell(creature, 51052, 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(CastIcyTouch, 5000, 0) +creature:RegisterEvent(CastPlagueStrike, 6000, 0) +creature:RegisterEvent(CastDeathstrike, 25000, 0) +creature:RegisterEvent(CastBloodBoil, math.random(12000, 18000), 0) +creature:RegisterEvent(CastDnD, 100, 1) +creature:RegisterEvent(CastSpecialSpell, 1000, 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +creature:RegisterEvent(CastAntiMagicShield, 18000, 0) +creature:RegisterEvent(CastAntiMagicZone, 18000, 0) +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:RegisterEvent(CastAntiMagicShield, 18000, 0) +creature:RegisterEvent(CastAntiMagicZone, 36000, 0) +end + +local function CastBloodBoil(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 48721, true) +end + +local function OnHealthCheck(event, creature, victim, health) +if (creature:GetHealthPct() <= 20 and not hasCastIceboundFortitude) then +creature:CastSpell(creature, 48792, true) +hasCastIceboundFortitude = true +end +end + +RegisterCreatureEvent(400046, 1, OnEnterCombat) +RegisterCreatureEvent(400046, 2, OnLeaveCombat) +RegisterCreatureEvent(400046, 4, OnDied) +RegisterCreatureEvent(400046, 5, OnSpawn) +RegisterCreatureEvent(400046, 9, OnHealthCheck) \ No newline at end of file diff --git a/Orgrimmar/BoneSentinel.lua b/Orgrimmar/BoneSentinel.lua new file mode 100644 index 0000000..f3abdf9 --- /dev/null +++ b/Orgrimmar/BoneSentinel.lua @@ -0,0 +1,37 @@ +local BoneSentinel = {}; + +local function CastShadowCleave(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 38226, true) +end + +local function CastEarthquake(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 33919, 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(CastShadowCleave, 5000, 0) + creature:RegisterEvent(CastEarthquake, 12000, 0) + creature:RegisterEvent(CastSpecialSpell, 1000, 0) +end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:RemoveEvents() +end + +RegisterCreatureEvent(400036, 1, OnEnterCombat) +RegisterCreatureEvent(400036, 2, OnLeaveCombat) +RegisterCreatureEvent(400036, 4, OnDied) diff --git a/Orgrimmar/DarkRanger.lua b/Orgrimmar/DarkRanger.lua new file mode 100644 index 0000000..d6f7af9 --- /dev/null +++ b/Orgrimmar/DarkRanger.lua @@ -0,0 +1,42 @@ +local DarkRanger = {} + +local function CastShoot(eventId, delay, calls, creature) +creature:CastSpell(target, 37770, true) -- cast shoot on target +end + + +local function CastBlackArrow(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 63671, true) +end + +local function CastExplodingShot(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 33792, true) +end + +local function CastBarrage(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 10188, true) +end + +local function OnEnterCombat(event, creature, target) + creature:RegisterEvent(CastShoot, 750, 0) + creature:RegisterEvent(CastBlackArrow, 16000, 0) + creature:RegisterEvent(CastBarrage, 10000, 0) + creature:RegisterEvent(CastExplodingShot, 7000, 0) +end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:RemoveEvents() +end + +RegisterCreatureEvent(400072, 1, OnEnterCombat) +RegisterCreatureEvent(400072, 2, OnLeaveCombat) +RegisterCreatureEvent(400072, 4, OnDied) + +RegisterCreatureEvent(400073, 1, OnEnterCombat) +RegisterCreatureEvent(400073, 2, OnLeaveCombat) +RegisterCreatureEvent(400073, 4, OnDied) + diff --git a/Orgrimmar/DarkValk.lua b/Orgrimmar/DarkValk.lua new file mode 100644 index 0000000..5e36780 --- /dev/null +++ b/Orgrimmar/DarkValk.lua @@ -0,0 +1,73 @@ +local DarkValk = {}; +DarkValk.npcId = 400049 + +local function CastShadowBolt(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 21077, 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 CastShadowBoltVolley(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 33841, true) +end + +local function CastRainOfFire(eventId, delay, calls, creature) +local targets = creature:GetAITargets(10) +if #targets > 0 then +local target = targets[math.random(#targets)] +creature:CastSpell(target, 24669, true) +end +end + +local function CastCurseOfPain(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 38048, true) +end + +local function CastShadowMend(eventId, delay, calls, creature) +creature:CastSpell(creature, 33325, true) +end + +local function CastShadowStrike(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 50581, true) +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastShadowBolt, math.random(8000, 12000), 0) +creature:RegisterEvent(CastShadowBoltVolley, math.random(11000, 18000), 0) +creature:RegisterEvent(CastRainOfFire, math.random(12000, 31000), 0) +creature:RegisterEvent(CastCurseOfPain, math.random(13000, 18000), 0) +creature:RegisterEvent(CastShadowMend, math.random(11000, 20000), 0) +creature:RegisterEvent(CastShadowStrike, math.random(2000, 5000), 0) +creature:RegisterEvent(CastSpecialSpell, 1000, 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:SendUnitYell("You will submit to the power of the Lich King.", 0) +creature:SetMaxHealth(1812760) +creature:CastSpell(creature, 17683, true) +end + +RegisterCreatureEvent(DarkValk.npcId, 1, OnEnterCombat) +RegisterCreatureEvent(DarkValk.npcId, 2, OnLeaveCombat) +RegisterCreatureEvent(DarkValk.npcId, 4, OnDied) +RegisterCreatureEvent(DarkValk.npcId, 5, OnSpawn) + + + diff --git a/Orgrimmar/DecayingColossus.lua b/Orgrimmar/DecayingColossus.lua new file mode 100644 index 0000000..4459421 --- /dev/null +++ b/Orgrimmar/DecayingColossus.lua @@ -0,0 +1,50 @@ +local DecayingColossus = {}; +DecayingColossus.npcId = 400048 + +local function CastMightyBlow(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 14099, true) +end + +local function CastDisarm(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 6713, true) +end + +local function CastStomp(eventId, delay, calls, creature) +local targets = creature:GetAITargets(10) +local target = targets[math.random(#targets)] +creature:CastSpell(target, 55196, true) +end + +local function CastThunderclap(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 55635, true) +end + +local function CastEnrage(eventId, delay, calls, creature) +creature:CastSpell(creature, 8599, true) +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastMightyBlow, math.random(4000, 7000), 0) +creature:RegisterEvent(CastDisarm, math.random(15000, 19000), 0) +creature:RegisterEvent(CastStomp, math.random(12000, 25000), 0) +creature:RegisterEvent(CastThunderclap, math.random(13000, 18000), 0) +creature:RegisterEvent(CastEnrage, math.random(45000, 60000), 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:SetMaxHealth(517720) +creature:CastSpell(creature, 17683, true) +end + +RegisterCreatureEvent(DecayingColossus.npcId, 1, OnEnterCombat) +RegisterCreatureEvent(DecayingColossus.npcId, 2, OnLeaveCombat) +RegisterCreatureEvent(DecayingColossus.npcId, 4, OnDied) +RegisterCreatureEvent(DecayingColossus.npcId, 5, OnSpawn) \ No newline at end of file diff --git a/Orgrimmar/Draven.lua b/Orgrimmar/Draven.lua new file mode 100644 index 0000000..4c582c0 --- /dev/null +++ b/Orgrimmar/Draven.lua @@ -0,0 +1,37 @@ +local Draven = {}; + +function Draven.OnEnterCombat(event, creature, target) + creature:RegisterEvent(Draven.CastFanOfKnives, 10000, 0) + creature:RegisterEvent(Draven.CastSaroniteBomb, 7000, 0) + creature:RegisterEvent(Draven.CastCloakOfShadows, 11500, 0) + creature:RegisterEvent(Draven.CastBladeFlurry, 13000, 0) +end + +function Draven.OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +function Draven.OnDied(event, creature, killer) + creature:RemoveEvents() +end + +function Draven.CastFanOfKnives(event, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 51723, true) +end + +function Draven.CastSaroniteBomb(event, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 56350, true) +end + +function Draven.CastCloakOfShadows(event, delay, calls, creature) + creature:CastSpell(creature, 31224, true) +end + +function Draven.CastBladeFlurry(event, delay, calls, creature) + creature:CastSpell(creature, 13877, true) +end + +RegisterCreatureEvent(400069, 1, Draven.OnEnterCombat) +RegisterCreatureEvent(400069, 2, Draven.OnLeaveCombat) +RegisterCreatureEvent(400069, 4, Draven.OnDied) + diff --git a/Orgrimmar/FrostbroodWhelp.lua b/Orgrimmar/FrostbroodWhelp.lua new file mode 100644 index 0000000..5268df3 --- /dev/null +++ b/Orgrimmar/FrostbroodWhelp.lua @@ -0,0 +1,10 @@ +local frostbroodWhelps = {}; + +function frostbroodWhelps.OnSpawn(event, creature) +creature:CanFly(true) +creature:SetDisableGravity(true) +end + +RegisterCreatureEvent(400057, 5, frostbroodWhelps.OnSpawn) + +RegisterCreatureEvent(16531, 5, frostbroodWhelps.OnSpawn) \ No newline at end of file diff --git a/Orgrimmar/HordeShout.lua b/Orgrimmar/HordeShout.lua new file mode 100644 index 0000000..ea96ec1 --- /dev/null +++ b/Orgrimmar/HordeShout.lua @@ -0,0 +1,24 @@ +local WolfRider = {}; + +local dialogues = { +"For the Horde!", +"Victory for the Horde!", +"Our enemies will tremble before the might of the Horde!", +"Lok'tar ogar!", +"Let the winds of war carry us to glory!", +"The Horde will claim what is rightfully ours!", +"We will show the Lich King the power of the Horde!", +"For the glory of the Warchief!", +"None shall stand against the Horde!", +"Our enemies will rue the day they crossed the Horde!", +"With the strength of the Horde, we will triumph!", +"Let us show the Scourge the might of the Horde!", +"We will prove the might of the Horde!", +} + +local function OnSpawn(event, creature) +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 +end + +RegisterCreatureEvent(400045, 5, OnSpawn) -- Registers the "OnSpawn" function as a spawn event for the creature with ID 400014 \ No newline at end of file diff --git a/Orgrimmar/HordeWarHerald.lua b/Orgrimmar/HordeWarHerald.lua new file mode 100644 index 0000000..54dc6c6 --- /dev/null +++ b/Orgrimmar/HordeWarHerald.lua @@ -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) + diff --git a/Orgrimmar/OrgArcher.lua b/Orgrimmar/OrgArcher.lua new file mode 100644 index 0000000..10d0eb7 --- /dev/null +++ b/Orgrimmar/OrgArcher.lua @@ -0,0 +1,27 @@ +local OrgArcher = {} + +local function CastShoot(eventId, delay, calls, creature) +creature:CastSpell(target, 37770, true) +end + +local function CastMultiShot(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 30990, true) +end + +local function OnEnterCombat(event, creature, target) + creature:RegisterEvent(CastShoot, 850, 0) + creature:RegisterEvent(CastMultiShot, 5000, 0) +end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:RemoveEvents() +end + +RegisterCreatureEvent(400041, 1, OnEnterCombat) +RegisterCreatureEvent(400041, 2, OnLeaveCombat) +RegisterCreatureEvent(400041, 4, OnDied) + diff --git a/Orgrimmar/OrgBerserker.lua b/Orgrimmar/OrgBerserker.lua new file mode 100644 index 0000000..403da35 --- /dev/null +++ b/Orgrimmar/OrgBerserker.lua @@ -0,0 +1,41 @@ +local OrgBerserker = {}; + +local function CastWhirlWind(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 53361, true) +end + +local function CastEnrage(eventId, delay, calls, creature) +creature:CastSpell(creature, 12880, true) +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastWhirlWind, 7000, 0) +creature:RegisterEvent(CastEnrage, 10000, 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:CastSpell(creature, 17683, true) +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(400040, 1, OnEnterCombat) +RegisterCreatureEvent(400040, 2, OnLeaveCombat) +RegisterCreatureEvent(400040, 4, OnDied) +RegisterCreatureEvent(400040, 5, OnSpawn) + +RegisterCreatureEvent(400045, 1, OnEnterCombat) +RegisterCreatureEvent(400045, 2, OnLeaveCombat) +RegisterCreatureEvent(400045, 4, OnDied) +RegisterCreatureEvent(400045, 5, OnSpawn) + +RegisterCreatureEvent(14720, 1, OnEnterCombat) +RegisterCreatureEvent(14720, 2, OnLeaveCombat) +RegisterCreatureEvent(14720, 4, OnDied) +RegisterCreatureEvent(14720, 5, OnSpawn) \ No newline at end of file diff --git a/Orgrimmar/OrgDefQuest.lua b/Orgrimmar/OrgDefQuest.lua new file mode 100644 index 0000000..a45aa23 --- /dev/null +++ b/Orgrimmar/OrgDefQuest.lua @@ -0,0 +1,27 @@ +local ORG_ID = {3296, 400039, 400040, 400041, 400045, 400059, 400060, 400061, 400070, 400071} +local SPELL_ID = 100193 + +function OnSpellCast(event, caster, spell) +local target = spell:GetTarget() +if target and spell:GetEntry() == SPELL_ID then +local isValidTarget = false +for _, orgID in ipairs(ORG_ID) do +if target:GetEntry() == orgID then +isValidTarget = true +break +end +end +if not isValidTarget then +caster:SendBroadcastMessage("That target is not valid.") +spell:Cancel() +elseif target:HasAura(SPELL_ID) then +caster:SendBroadcastMessage("You've already used the Shadow-Drenched Cloth on that defender!") +spell:Cancel() +else +-- give kill credit to NPC ID 3296 +caster:KilledMonsterCredit(3296) +end +end +end + +RegisterPlayerEvent(5, OnSpellCast) \ No newline at end of file diff --git a/Orgrimmar/OrgGuardKillCred.lua b/Orgrimmar/OrgGuardKillCred.lua new file mode 100644 index 0000000..4ba796b --- /dev/null +++ b/Orgrimmar/OrgGuardKillCred.lua @@ -0,0 +1,41 @@ +-- A table of NPC IDs to be considered as valid targets +local OG_ID = {400059, 400060, 400061, 400014, 400041, 400040, 400039, 3296} +-- The ID of the spell that is used to interact with the NPCs +local SPELL_ID = 100183 + +-- A function that is triggered whenever a player casts a spell +function OnSpellCast(event, caster, spell) + -- Get the target of the spell being cast + local target = spell:GetTarget() + + -- If the target exists and the spell being cast is the specified spell + if target and spell:GetEntry() == SPELL_ID then + -- A flag to determine if the target is a valid NPC + local isValidTarget = false + + -- Iterate through the table of valid NPC IDs + for _, OGID in ipairs(OG_ID) do + -- If the target's NPC ID matches one of the valid IDs + if target:GetEntry() == OGID then + -- Set the flag to true + isValidTarget = true + -- Break out of the loop + break + end + end + + -- If the target is not a valid NPC or if the target's health is greater than 90% + if not isValidTarget or target:GetHealthPct() > 90 then + -- Send a broadcast message to the player + caster:SendBroadcastMessage("That defender is doing fine. Find one that needs more help!") + -- Cancel the spell + spell:Cancel() + else + -- Give kill credit to NPC ID 400039 + caster:KilledMonsterCredit(400039) + end + end +end + +-- Register the function to be triggered whenever a player casts a spell (event 5) +RegisterPlayerEvent(5, OnSpellCast) diff --git a/Orgrimmar/OrgrimmarVillager.lua b/Orgrimmar/OrgrimmarVillager.lua new file mode 100644 index 0000000..b166042 --- /dev/null +++ b/Orgrimmar/OrgrimmarVillager.lua @@ -0,0 +1,37 @@ +local npcs = {400068, 400067} +local gossipText = "It's not safe here. I can teleport you to safety." +local itemId = 65002 -- Teleporter +local spellId = 100182 + +local function OnGossipHello(event, player, creature) +if (player:HasItem(itemId)) then +player:GossipMenuAddItem(0, gossipText, 0, 1) +player:GossipSendMenu(1, creature) +else +player:SendBroadcastMessage("You should go speak to Putress for help in the Grommash Hold.") +creature:MoveWaypoint() +end +end + +local function OnGossipSelect(event, player, creature, sender, intid, code) +if (intid == 1) then +creature:RemoveAllAuras() +player:CastSpell(creature, spellId, false) +local randomDialogue = math.random(1, 3) +if randomDialogue == 1 then +creature:SendUnitSay("Thank you for helping me adventurer. Your kindness will not be forgotten.", 0) +elseif randomDialogue == 2 then +creature:SendUnitSay("Very well then...Thank you for your help.", 0) +else +creature:SendUnitSay("Anywhere is better than here right now...please go ahead.", 0) +end +player:GossipComplete() +player:KilledMonsterCredit(400067) +creature:DespawnOrUnsummon(4650) +end +end + +for i, npcid in ipairs(npcs) do +RegisterCreatureGossipEvent(npcid, 1, OnGossipHello) +RegisterCreatureGossipEvent(npcid, 2, OnGossipSelect) +end diff --git a/Orgrimmar/RunokWildmane.lua b/Orgrimmar/RunokWildmane.lua new file mode 100644 index 0000000..99eed65 --- /dev/null +++ b/Orgrimmar/RunokWildmane.lua @@ -0,0 +1,41 @@ +local function CastFlameShock(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 8050, true) +end + +local function CastLightningBolt(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 403, false) +end + +local function CastLavaBurst(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 51505, false) +end + +local function CastChainLightning(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 421, true) +end + +local function OnEnterCombat(event, creature, target) +if not creature:IsCasting() then +creature:RegisterEvent(CastFlameShock, 5000, 0) +creature:RegisterEvent(CastLightningBolt, 6500, 0) +creature:RegisterEvent(CastLavaBurst, 9000, 0) +creature:RegisterEvent(CastChainLightning, 11700, 0) +end +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:CastSpell(creature, 17683, true) +end + +RegisterCreatureEvent(400070, 1, OnEnterCombat) +RegisterCreatureEvent(400070, 2, OnLeaveCombat) +RegisterCreatureEvent(400070, 4, OnDied) +RegisterCreatureEvent(400070, 5, OnSpawn) \ No newline at end of file diff --git a/Orgrimmar/Skalathrax.lua b/Orgrimmar/Skalathrax.lua new file mode 100644 index 0000000..e166ae8 --- /dev/null +++ b/Orgrimmar/Skalathrax.lua @@ -0,0 +1,99 @@ +local undeadDragon = {} + +function undeadDragon.OnSpawn(event, creature) +creature:SetMaxHealth(8554119) +creature:CanFly(true) +creature:SetDisableGravity(true) +creature:SetReactState(0) +creature:SetRegeneratingHealth(false) +creature:SendUnitYell("Your warm flesh will freeze under the shadow of my wings!", 0) +creature:PlayDirectSound(20429) +creature:CastSpell(creature, 100151, true) +creature:CastSpell(creature, 17683, true) + +creature:RegisterEvent(undeadDragon.CastSpell2, 15000, 0) +creature:RegisterEvent(undeadDragon.CastSpell3, 3500, 0) +creature:RegisterEvent(undeadDragon.CastSpell4, 7000, 0) +creature:RegisterEvent(undeadDragon.CastSpell5, 23000, 0) +creature:RegisterEvent(undeadDragon.CastSpell6, 35000, 0) +creature:RegisterEvent(undeadDragon.CastBlizzard, 5000, 0) +end + +function undeadDragon.OnLeaveCombat(event, creature) +creature:SetRegeneratingHealth(false) +end + +function undeadDragon.CastSpell2(event, delay, pCall, creature) +creature:CastSpell(creature:GetVictim(), 58532, true) -- Frostbolt Volley +end + +function undeadDragon.CastSpell3(event, delay, pCall, creature) +-- 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) +-- 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 Frozen Orb on the random target +creature:CastSpell(target, 71285, true) +end +end +end + +function undeadDragon.CastSpell5(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 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 +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 +end + + +function undeadDragon.OnDeath(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(400035, 5, undeadDragon.OnSpawn) +RegisterCreatureEvent(400035, 2, undeadDragon.OnLeaveCombat) +RegisterCreatureEvent(400035, 4, undeadDragon.OnDeath) \ No newline at end of file diff --git a/Orgrimmar/StealthPot.lua b/Orgrimmar/StealthPot.lua new file mode 100644 index 0000000..de9ff01 --- /dev/null +++ b/Orgrimmar/StealthPot.lua @@ -0,0 +1,36 @@ +Draven = {} + +-- Create the item you want to give to the player +Draven.ITEM_ID = 60114 -- replace with the ID of the item you want to give + +-- Register the gossip event for the NPC +function Draven.OnGossipHello(event, player, creature) +player:GossipMenuAddItem(0, "|TInterface\\Icons\\ability_stealth:50:50:-23:0|tPurchase 3 Stealth Potions for 75 Silver.|r", 0, 1) +player:GossipSendMenu(1, creature) +end + +-- Handle the player's selection in the gossip menu +function Draven.OnGossipSelect(event, player, creature, sender, action) +if action == 1 then +if player:GetCoinage() < 7500 then +player:SendBroadcastMessage("You do not have enough coins.") +player:GossipComplete() +else +player:SetCoinage(player:GetCoinage() - 7500) +player:AddItem(Draven.ITEM_ID, 3) +player:SendBroadcastMessage("You have received 3 Stealth Potions.") +player:GossipComplete() +end +end +end + +-- Send a unit yell when the NPC spawns +function Draven.OnSpawn(event, creature) +creature:SendUnitYell("", 0) +creature:CastSpell(creature, 17683, true) +end + +-- Register the gossip events with the NPC +RegisterCreatureGossipEvent(400069, 1, Draven.OnGossipHello) +RegisterCreatureGossipEvent(400069, 2, Draven.OnGossipSelect) +RegisterCreatureEvent(400069, 5, Draven.OnSpawn) \ No newline at end of file diff --git a/Orgrimmar/Sylvanas.lua b/Orgrimmar/Sylvanas.lua new file mode 100644 index 0000000..2452000 --- /dev/null +++ b/Orgrimmar/Sylvanas.lua @@ -0,0 +1,76 @@ +local Sylvanas = {}; + +function Sylvanas.OnEnterCombat(event, creature, target) + creature:RegisterEvent(Sylvanas.CastRapidShot, 7100, 0) + creature:RegisterEvent(Sylvanas.CastMultiShot, 6100, 0) + creature:RegisterEvent(Sylvanas.CastExplosiveShot, 6600, 0) + creature:RegisterEvent(Sylvanas.CastBlackArrow, 15300, 0) + creature:RegisterEvent(Sylvanas.CastShoot, 499, 0) +end + +function Sylvanas.OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +function Sylvanas.OnDied(event, creature, killer) + creature:RemoveEvents() +end + +function Sylvanas.CastRapidShot(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or creature:IsCasting(71251) then + creature:CastSpell(victim, 71251, true) + end +end + +function Sylvanas.CastShoot(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or not creature:IsCasting(71251) then + creature:CastSpell(victim, 39079, true) + end +end + +function Sylvanas.CastMultiShot(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or not creature:IsCasting(71251) then + creature:CastSpell(victim, 59713, true) + end +end + +function Sylvanas.CastExplosiveShot(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or not creature:IsCasting(71251) then + creature:CastSpell(victim, 60053, true) + end +end + +function Sylvanas.CastBlackArrow(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or not creature:IsCasting(71251) then + creature:CastSpell(victim, 63672, true) + end +end + +function Sylvanas.OnSpawn(event, creature) +creature:SendUnitSay("Hello Thrall. You didn't think I'd let you have all the fun, did you?", 0) +creature:CastSpell(creature, 51908, true) +end + +function Sylvanas.OnHealthCheck(event, creature, attacker, damage) +if (creature:GetHealth() - damage) <= 15 then +creature:RegisterEvent(Sylvanas.Shadowstep, 4800, 1) +end +end + +function Sylvanas.Shadowstep(event, delay, calls, creature) +creature:CastSpell(creature, 51908, true) +creature:CastSpell(creature, 58984, true) +creature:SendUnitYell("Thrall...I must be going. Hopefully I thinned enough of the scourge forces for you...now you can handle the rest.", 0) +creature:DespawnOrUnsummon(5000) +end + +RegisterCreatureEvent(400071, 9, Sylvanas.OnHealthCheck) +RegisterCreatureEvent(400071, 5, Sylvanas.OnSpawn) +RegisterCreatureEvent(400071, 1, Sylvanas.OnEnterCombat) +RegisterCreatureEvent(400071, 2, Sylvanas.OnLeaveCombat) +RegisterCreatureEvent(400071, 4, Sylvanas.OnDied) diff --git a/Orgrimmar/TempMount.lua b/Orgrimmar/TempMount.lua new file mode 100644 index 0000000..3fa45e5 --- /dev/null +++ b/Orgrimmar/TempMount.lua @@ -0,0 +1,36 @@ +Thunderhoof = {} + +-- Create the item you want to give to the player +Thunderhoof.ITEM_ID = 60111 -- replace with the ID of the item you want to give + +-- Register the gossip event for the NPC +function Thunderhoof.OnGossipHello(event, player, creature) +player:GossipMenuAddItem(0, "|TInterface\\Icons\\ability_mount_tawnywindrider:50:50:-13:0|tLoan me a Wind Rider for 25 silver.", 0, 1) +player:GossipSendMenu(1, creature) +end + +-- Handle the player's selection in the gossip menu +function Thunderhoof.OnGossipSelect(event, player, creature, sender, action) +if action == 1 then +if player:GetCoinage() < 2500 then +player:SendBroadcastMessage("You do not have enough silver.") +player:GossipComplete() +else +player:SetCoinage(player:GetCoinage() - 2500) +player:AddItem(Thunderhoof.ITEM_ID, 1) +player:SendBroadcastMessage("You have received a Wind Rider.") +player:GossipComplete() +end +end +end + +-- Send a unit yell when the NPC spawns +function Thunderhoof.OnSpawn(event, creature) +creature:SendUnitYell("Lend yourself a Wind Rider for 25 silver! You won't want to fight the Scourge without one!", 0) +creature:CastSpell(creature, 20374) +end + +-- Register the gossip events with the NPC +RegisterCreatureGossipEvent(400042, 1, Thunderhoof.OnGossipHello) +RegisterCreatureGossipEvent(400042, 2, Thunderhoof.OnGossipSelect) +RegisterCreatureEvent(400042, 5, Thunderhoof.OnSpawn) \ No newline at end of file diff --git a/Orgrimmar/TurretKillCred.lua b/Orgrimmar/TurretKillCred.lua new file mode 100644 index 0000000..881ec5d --- /dev/null +++ b/Orgrimmar/TurretKillCred.lua @@ -0,0 +1,32 @@ +local TUR_ID = {400038, 400037} +local SPELL_ID = 100181 + +function OnSpellCast(event, caster, spell) +local target = spell:GetTarget() +if target and spell:GetEntry() == SPELL_ID then +local isValidTarget = false +for _, TURID in ipairs(TUR_ID) do +if target:GetEntry() == TURID then +isValidTarget = true +break +end +end +if not isValidTarget then +caster:SendBroadcastMessage("Invalid target.") +spell:Cancel() +else +-- 33% chance for the respawn to fizzle +local chance = math.random(1, 3) +if chance == 1 then +caster:SendBroadcastMessage("Attempt to recharge the turret has fizzled.") +else +-- give kill credit +caster:KilledMonsterCredit(400037) +-- respawn the creature +target:Respawn() +end +end +end +end + +RegisterPlayerEvent(5, OnSpellCast) \ No newline at end of file diff --git a/Stormwind/Alleria1.lua b/Stormwind/Alleria1.lua new file mode 100644 index 0000000..0a02e8d --- /dev/null +++ b/Stormwind/Alleria1.lua @@ -0,0 +1,9 @@ +local npcid = 400019 + +function OnSpawn(event, creature) + creature:SetWalk(true) + creature:MoveWaypoint() + creature:SetReactState(0) +end + +RegisterCreatureEvent(npcid, 5, OnSpawn) \ No newline at end of file diff --git a/Stormwind/Alleria2.lua b/Stormwind/Alleria2.lua new file mode 100644 index 0000000..7a8f098 --- /dev/null +++ b/Stormwind/Alleria2.lua @@ -0,0 +1,84 @@ +local Alleria = {}; + +function Alleria.OnEnterCombat(event, creature, target) + creature:RegisterEvent(Alleria.CastFD, 1, 1) + creature:RegisterEvent(Alleria.CastRoot, 10300, 1) + creature:RegisterEvent(Alleria.CastDisengage, 10400, 1) + creature:RegisterEvent(Alleria.CastRapidShot, 7100, 0) + creature:RegisterEvent(Alleria.CastMultiShot, 6100, 0) + creature:RegisterEvent(Alleria.CastExplosiveShot, 6600, 0) + creature:RegisterEvent(Alleria.CastBlackArrow, 15300, 0) + creature:RegisterEvent(Alleria.CastShoot, 499, 0) + creature:RegisterEvent(Alleria.ForceDespawn, 90000, 1) +end + +function Alleria.OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +function Alleria.OnDied(event, creature, killer) + creature:RemoveEvents() +end + +function Alleria.CastRapidShot(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or creature:IsCastingSpell(71251) then + creature:CastSpell(victim, 71251, true) + end +end + +function Alleria.CastShoot(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or not creature:IsCastingSpell(71251) then + creature:CastSpell(victim, 39079, true) + end +end + +function Alleria.CastMultiShot(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or not creature:IsCastingSpell(71251) then + creature:CastSpell(victim, 59713, false) + end +end + +function Alleria.CastExplosiveShot(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or not creature:IsCastingSpell(71251) then + creature:CastSpell(victim, 60053, false) + end +end + +function Alleria.CastBlackArrow(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or not creature:IsCastingSpell(71251) then + creature:CastSpell(victim, 63672, false) + end +end + +function Alleria.CastDisengage(event, delay, calls, creature) + local victim = creature:GetVictim() + if not creature:IsCasting() or not creature:IsCastingSpell(71251) then + creature:CastSpell(victim, 57635, false) + end +end + +function Alleria.CastFD(event, delay, calls, creature) + if not creature:IsCasting() or not creature:IsCastingSpell(71251) then +creature:CastSpell(creature, 23604, false) +end +end + +function Alleria.CastRoot(event, delay, calls, creature) +local victim = creature:GetVictim() +if not creature:IsCasting() or not creature:IsCastingSpell(71251) then +creature:CastSpell(victim, 50762, false) +end +end + +function Alleria.ForceDespawn(event, delay, calls, creature) +creature:DespawnOrUnsummon(1) +end + +RegisterCreatureEvent(400021, 1, Alleria.OnEnterCombat) +RegisterCreatureEvent(400021, 2, Alleria.OnLeaveCombat) +RegisterCreatureEvent(400021, 4, Alleria.OnDied) \ No newline at end of file diff --git a/Stormwind/AllianceMage.lua b/Stormwind/AllianceMage.lua new file mode 100644 index 0000000..e78cd67 --- /dev/null +++ b/Stormwind/AllianceMage.lua @@ -0,0 +1,41 @@ +local mageNPC = 400027 +local conjuredCinnamonRolls = 22895 +local arcaneIntellect = 10157 + +local function OnGossipHello(event, player, creature) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\inv_misc_food_73cinnamonroll:50:50:-13:0|tTake some Conjured Cinnamon Rolls", 0, 1, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_Magicalsentry:50:50:-13:0|tCast Arcane Intellect", 0, 2, false, "", 0) +player:GossipSendMenu(1, creature) +end + +local function OnGossipSelect(event, player, creature, sender, intid, code, menuid) +if intid == 1 then +player:AddItem(conjuredCinnamonRolls, 5) +player:SendBroadcastMessage("Enjoy the sweet taste of magic! Here are 5 Conjured Cinnamon Rolls.") +elseif intid == 2 then +player:CastSpell(player, arcaneIntellect, true) +player:SendBroadcastMessage("You feel your mind become more focused as Arcane Intellect takes hold.") +end +player:GossipComplete() +end + +local function YellDialogue(event, creature) +-- List of unit say options +local unitSayOptions = { +"Greetings, adventurer! Would you like some refreshment?", +"Welcome traveler! Are you in need of some sustenance?", +"Let me offer you some conjured treats and a bit of intellectual enhancement.", +"You look like you could use a boost. How about some Conjured Cinnamon Rolls and Arcane Intellect?", +"Good day! I have some delectable Conjured Cinnamon Rolls and the power of Arcane Intellect for you.", +"Step right up! I have some of the finest Conjured Cinnamon Rolls and a touch of Arcane Intellect for you." +} +-- Choose a random unit say option +local randomOption = unitSayOptions[math.random(#unitSayOptions)] +creature:SendUnitSay(randomOption, 0) +end + +RegisterCreatureGossipEvent(mageNPC, 1, OnGossipHello) +RegisterCreatureGossipEvent(mageNPC, 2, OnGossipSelect) + +-- triggers the yell function on spawn +RegisterCreatureEvent(mageNPC, 5, function(event, creature) YellDialogue(event, creature) end) \ No newline at end of file diff --git a/Stormwind/AllianceMage2.lua b/Stormwind/AllianceMage2.lua new file mode 100644 index 0000000..130b5dc --- /dev/null +++ b/Stormwind/AllianceMage2.lua @@ -0,0 +1,36 @@ +local AMage = {} + +local function CastFireball(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 38692, true) +end + +local function CastFrostbolt(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 27071, true) +end + +local function CastBlizzard(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 42213, true) +end + +local function CastArcaneExplosion(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 19712, true) +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastFireball, 3600, 0) +creature:RegisterEvent(CastFrostbolt, 7200, 0) +creature:RegisterEvent(CastBlizzard, 9000, 0) +creature:RegisterEvent(CastArcaneExplosion, 10800, 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(400027, 1, OnEnterCombat) +RegisterCreatureEvent(400027, 2, OnLeaveCombat) +RegisterCreatureEvent(400027, 4, OnDied) \ No newline at end of file diff --git a/Stormwind/AlliancePaladin.lua b/Stormwind/AlliancePaladin.lua new file mode 100644 index 0000000..268bf4e --- /dev/null +++ b/Stormwind/AlliancePaladin.lua @@ -0,0 +1,30 @@ +local AlliancePaladin = 400030 +local kingsSpell = 25898 +local wisdomSpell = 25918 +local mightSpell = 25916 + +local function OnSpawn(event, creature) +creature:CastSpell(creature, kingsSpell, true) +end + +local function OnGossipHello(event, player, creature) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_magic_magearmor:50:50:-13:0|tGrant me a Blessing of Kings", 0, 1, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_holy_sealofwisdom:50:50:-13:0|tGrant me a Blessing of Wisdom", 0, 2, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_holy_fistofjustice:50:50:-13:0|tGrant me a Blessing of Might", 0, 3, false, "", 0) +player:GossipSendMenu(1, creature) +end + +local function OnGossipSelect(event, player, creature, sender, intid, code, menuid) +if intid == 1 then +player:CastSpell(player, kingsSpell, true) +elseif intid == 2 then +player:CastSpell(player, wisdomSpell, true) +elseif intid == 3 then +player:CastSpell(player, mightSpell, true) +end +player:GossipComplete() +end + +RegisterCreatureEvent(AlliancePaladin, 5, OnSpawn) +RegisterCreatureGossipEvent(AlliancePaladin, 1, OnGossipHello) +RegisterCreatureGossipEvent(AlliancePaladin, 2, OnGossipSelect) \ No newline at end of file diff --git a/Stormwind/AlliancePaladin2.lua b/Stormwind/AlliancePaladin2.lua new file mode 100644 index 0000000..84a4a2f --- /dev/null +++ b/Stormwind/AlliancePaladin2.lua @@ -0,0 +1,50 @@ +local AlliancePaladin = {} + +local function CastCS(eventId, delay, calls, creature) +creature:CastSpell(creature, 35395, true) +end + +local function CastCons(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 20924, true) +end + +local function CastDS(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 53385, true) +end + +local function CastJOL(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 20271, true) +end + +local function CastAvengingWrath(event, creature) +creature:CastSpell(creature, 31884, true) +end + +local function CastKings(event, creature) +creature:CastSpell(creature, 20217, true) +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastCS, 6000, 0) +creature:RegisterEvent(CastCons, 8000, 0) +creature:RegisterEvent(CastDS, 10000, 0) +creature:RegisterEvent(CastJOL, 11000, 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:CastSpell(creature, 20217, true) +end + +RegisterCreatureEvent(400030, 1, OnEnterCombat) +RegisterCreatureEvent(400030, 2, OnLeaveCombat) +RegisterCreatureEvent(400030, 4, OnDied) +RegisterCreatureEvent(400030, 5, OnSpawn) + diff --git a/Stormwind/AlliancePriest.lua b/Stormwind/AlliancePriest.lua new file mode 100644 index 0000000..38ed3a4 --- /dev/null +++ b/Stormwind/AlliancePriest.lua @@ -0,0 +1,48 @@ +local lightwellNPC = 400026 +local lightwellSpell = 27870 +local fortitudeSpell = 10938 +local divineSpiritSpell = 27841 + +local function OnSpawn(event, creature) +creature:CastSpell(creature, lightwellSpell, true) +end + +local function OnGossipHello(event, player, creature) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_SummonLightwell:50:50:-13:0|tCast Lightwell", 0, 1, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_WordFortitude:50:50:-13:0|tCast Power Word: Fortitude", 0, 2, false, "", 0) +player:GossipMenuAddItem(9, "|TInterface\\Icons\\Spell_Holy_DivineSpirit:50:50:-13:0|tCast Divine Spirit", 0, 3, false, "", 0) +player:GossipSendMenu(1, creature) +end + +local function OnGossipSelect(event, player, creature, sender, intid, code, menuid) +if intid == 1 then +player:CastSpell(player, lightwellSpell, true) +elseif intid == 2 then +player:CastSpell(player, fortitudeSpell, true) +elseif intid == 3 then +player:CastSpell(player, divineSpiritSpell, true) +end +player:GossipComplete() +end + +local function YellDialogue(event, creature) +-- List of unit say options +local unitSayOptions = { +"May the light guide your paths.", +"Blessings upon you, traveler.", +"The light is always with you. Come, let me grant you a blessing.", +"May the light guide you on your journey.", +"The power of the light is yours for the asking.", +"Let me bring the light to your path." +} +-- Choose a random unit say option +local randomOption = unitSayOptions[math.random(#unitSayOptions)] +creature:SendUnitSay(randomOption, 0) +end + +RegisterCreatureEvent(lightwellNPC, 5, OnSpawn) +RegisterCreatureGossipEvent(lightwellNPC, 1, OnGossipHello) +RegisterCreatureGossipEvent(lightwellNPC, 2, OnGossipSelect) + +-- triggers the yell function on spawn +RegisterCreatureEvent(lightwellNPC, 5, function(event, creature) YellDialogue(event, creature) end) \ No newline at end of file diff --git a/Stormwind/AlliancePriest2.lua b/Stormwind/AlliancePriest2.lua new file mode 100644 index 0000000..cd4b015 --- /dev/null +++ b/Stormwind/AlliancePriest2.lua @@ -0,0 +1,31 @@ +local APriest = {}; + +local function CastSmite(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 48122, true) +end + +local function CastHolyFire(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 48134, true) +end + +local function CastSWP(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 27605, true) +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastSmite, 2600, 0) +creature:RegisterEvent(CastHolyFire, 5000, 0) +creature:RegisterEvent(CastSWP, 15000, 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(400026, 1, OnEnterCombat) +RegisterCreatureEvent(400026, 2, OnLeaveCombat) +RegisterCreatureEvent(400026, 4, OnDied) \ No newline at end of file diff --git a/Stormwind/AllianceWarHerald.lua b/Stormwind/AllianceWarHerald.lua new file mode 100644 index 0000000..e4f3622 --- /dev/null +++ b/Stormwind/AllianceWarHerald.lua @@ -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) + diff --git a/Stormwind/ArchBishopBen.lua b/Stormwind/ArchBishopBen.lua new file mode 100644 index 0000000..af24014 --- /dev/null +++ b/Stormwind/ArchBishopBen.lua @@ -0,0 +1,57 @@ +local ABishop = {} + +local function CastHolyB(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature:GetVictim(), 59700, false) +end +end + +local function CastHolyFire(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature:GetVictim(), 48134, false) +end +end + +local function CastSWP(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature:GetVictim(), 27605, false) +end +end + +local function CastHV(eventId, delay, calls, creature) +if not creature:IsCasting() then +creature:CastSpell(creature:GetVictim(), 37959, false) +end +end + +local function OnEnterCombat(event, creature, target) +creature:PlayDirectSound(20417) +creature:RegisterEvent(CastHolyB, 4600, 0) +creature:RegisterEvent(CastHolyFire, 1500, 0) +creature:RegisterEvent(CastSWP, 15000, 0) +creature:RegisterEvent(CastHV, 25000, 0) + +local yellOptions = { "I am the Light's instrument of justice!", "I shall smite the unholy!", "The Light will purify you!", "For the glory of the holy Light!", "In the name of the Light, I will crush you!", "The Light shall guide my every strike!", "You stand no chance against the holy power within me!", "I am the Light's chosen champion!" } +local randomIndex = math.random(1, 8) +local selectedYell = yellOptions[randomIndex] +creature:SendUnitYell(selectedYell, 0) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +function OnSpawn(event, creature) +creature:SetMaxHealth(1321000) +creature:SetMaxPower(0, 13400000) + +end + +RegisterCreatureEvent(1284, 1, OnEnterCombat) +RegisterCreatureEvent(1284, 2, OnLeaveCombat) +RegisterCreatureEvent(1284, 4, OnDied) +RegisterCreatureEvent(1284, 5, OnSpawn) \ No newline at end of file diff --git a/Stormwind/Bolvar.lua b/Stormwind/Bolvar.lua new file mode 100644 index 0000000..7359441 --- /dev/null +++ b/Stormwind/Bolvar.lua @@ -0,0 +1,46 @@ +local Bolvar = {} + +local function CastAS(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 32699, true) +end + +local function CastHOR(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 53595, true) +end + +local function CastSunder(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 58461, true) +end + +local function CastAvengingWrath(event, creature) +creature:CastSpell(creature, 31884, true) +end + +local function CastKings(event, creature) +creature:CastSpell(creature, 20217, true) +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastAS, 12600, 0) +creature:RegisterEvent(CastHOR, 5000, 0) +creature:RegisterEvent(CastSunder, 10000, 0) +creature:RegisterEvent(CastAvengingWrath, 1, 1) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:CastSpell(creature, 20217, true) +end + +RegisterCreatureEvent(1748, 1, OnEnterCombat) +RegisterCreatureEvent(1748, 2, OnLeaveCombat) +RegisterCreatureEvent(1748, 4, OnDied) +RegisterCreatureEvent(1748, 5, OnSpawn) + diff --git a/Stormwind/Bolvar2.lua b/Stormwind/Bolvar2.lua new file mode 100644 index 0000000..08ae486 --- /dev/null +++ b/Stormwind/Bolvar2.lua @@ -0,0 +1,49 @@ +local Bolvar = 1748 +local kingsSpell = 25898 +local wisdomSpell = 25918 +local mightSpell = 25916 + +-- Sound ID for the blessing of kings +local KINGS_SOUND_ID = 20423 + +-- Emote ID for the blessing of kings +local KINGS_EMOTE_ID = 113 + +-- Sound ID for the blessing of wisdom +local WISDOM_SOUND_ID = 20424 + +-- Emote ID for the blessing of wisdom +local WISDOM_EMOTE_ID = 153 + +local MIGHT_SOUND_ID = 20425 + +local function OnSpawn(event, creature) + creature:CastSpell(creature, kingsSpell, true) +end + +local function OnGossipHello(event, player, creature) + player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_magic_magearmor:50:50:-23:0|tGrant me a Blessing of Kings", 0, 1, false, "", 0) + player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_holy_sealofwisdom:50:50:-23:0|tGrant me a Blessing of Wisdom", 0, 2, false, "", 0) + player:GossipMenuAddItem(9, "|TInterface\\Icons\\spell_holy_fistofjustice:50:50:-23:0|tGrant me a Blessing of Might", 0, 3, false, "", 0) + player:GossipSendMenu(1, creature) +end + +local function OnGossipSelect(event, player, creature, sender, intid, code, menuid) + if intid == 1 then + player:CastSpell(player, kingsSpell, true) + creature:PlayDistanceSound(KINGS_SOUND_ID) + creature:PerformEmote(KINGS_EMOTE_ID) + elseif intid == 2 then + player:CastSpell(player, wisdomSpell, true) + creature:PlayDistanceSound(WISDOM_SOUND_ID) + creature:PerformEmote(WISDOM_EMOTE_ID) + elseif intid == 3 then + player:CastSpell(player, mightSpell, true) + creature:PlayDistanceSound(MIGHT_SOUND_ID) + end + player:GossipComplete() +end + +RegisterCreatureEvent(Bolvar, 5, OnSpawn) +RegisterCreatureGossipEvent(Bolvar, 1, OnGossipHello) +RegisterCreatureGossipEvent(Bolvar, 2, OnGossipSelect) diff --git a/Stormwind/Duthorian.lua b/Stormwind/Duthorian.lua new file mode 100644 index 0000000..33f709d --- /dev/null +++ b/Stormwind/Duthorian.lua @@ -0,0 +1,21 @@ +local DuthorianRall = {}; + +local function CastJoL(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 20185, true) +end + +local function OnEnterCombat(event, creature, target) + creature:RegisterEvent(CastJoL, 5000, 0) + end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:RemoveEvents() +end + +RegisterCreatureEvent(6171, 1, OnEnterCombat) +RegisterCreatureEvent(6171, 2, OnLeaveCombat) +RegisterCreatureEvent(6171, 4, OnDied) \ No newline at end of file diff --git a/Stormwind/Laurena.lua b/Stormwind/Laurena.lua new file mode 100644 index 0000000..81bafc5 --- /dev/null +++ b/Stormwind/Laurena.lua @@ -0,0 +1,21 @@ +local Laurena = {}; + +local function CastSmite(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 10934, true) +end + +local function OnEnterCombat(event, creature, target) + creature:RegisterEvent(CastSmite, 3000, 0) + end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:RemoveEvents() +end + +RegisterCreatureEvent(376, 1, OnEnterCombat) +RegisterCreatureEvent(376, 2, OnLeaveCombat) +RegisterCreatureEvent(376, 4, OnDied) \ No newline at end of file diff --git a/Stormwind/Patchqwerk.lua b/Stormwind/Patchqwerk.lua new file mode 100644 index 0000000..3635ce7 --- /dev/null +++ b/Stormwind/Patchqwerk.lua @@ -0,0 +1,68 @@ +local Patchqwerk = {}; + +function Patchqwerk.OnSpawn(event, creature) +creature:SendUnitYell("Patchqwerk make Lich King proud! You die now!",0) +creature:CastSpell(creature, 46587, true) +end + +function Patchqwerk.PoisonBoltVolley(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 40095, true) +end + +function Patchqwerk.SummonOozeling(eventId, delay, calls, creature) +creature:CastSpell(creature, 12250, true) +end + +function Patchqwerk.CastHatefulStrike(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 28308, true) +end + +function Patchqwerk.CastGore(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 48130, true) +end + +function Patchqwerk.OnEnterCombat(event, creature, target) +if (math.random(1, 100) <= 25) then +local yellOptions = { "Patchqwerk huuuuungry!", "Time for a snack!", "You're mine now!", "You look delicious. Patchqwerk eat you now!", "I not eat in days, time to feast!", "Me smash and eat you now!", "Me so hungry, me eat anything... even you!" } +local randomIndex = math.random(1, 7) +local selectedYell = yellOptions[randomIndex] +creature:SendUnitYell(selectedYell, 0) +end +creature:RegisterEvent(Patchqwerk.PoisonBoltVolley, 7000, 0) +creature:RegisterEvent(Patchqwerk.CastHatefulStrike, 15000, 0) +creature:RegisterEvent(Patchqwerk.CastGore, 20000, 0) +creature:RegisterEvent(Patchqwerk.SummonOozeling, 10000, 0) +end + +function Patchqwerk.OnLeaveCombat(event, creature) +if (math.random(1, 100) <= 25) then +local yellOptions = { "You not so tasty afterall...", "I be back for seconds!", "No more play? Too bad...", "Maybe next time you taste better!","Me still hungry, come back later!","You not enough food, me go find more!", "Aww...You no stay for dinner? You make Patchqwerk sad." } +local randomIndex = math.random(1, 7) +local selectedYell = yellOptions[randomIndex] +creature:SendUnitYell(selectedYell, 0) +end +creature:RemoveEvents() +end + +function Patchqwerk.OnDied(event, creature, killer) +creature:SendUnitYell("Patchqwerk forget to chew...", 0) +if(killer:GetObjectType() == "Player") then +killer:SendBroadcastMessage("You killed " ..creature:GetName().."!") +end +creature:RemoveEvents() +end + +function Patchqwerk.CheckHealth(event, creature) +if (creature:HealthBelowPct(20)) then +creature:SendUnitYell("Patchqwerk go berserk!", 0) +creature:CastSpell(creature, 41305, true) +elseif (creature:HealthAbovePct(95)) then +creature:CastSpell(creature, 46587, true) +end +end + +RegisterCreatureEvent(400012, 1, Patchqwerk.OnEnterCombat) +RegisterCreatureEvent(400012, 2, Patchqwerk.OnLeaveCombat) +RegisterCreatureEvent(400012, 4, Patchqwerk.OnDied) +RegisterCreatureEvent(400012, 5, Patchqwerk.OnSpawn) +RegisterCreatureEvent(400012, 6, Patchqwerk.CheckHealth) \ No newline at end of file diff --git a/Stormwind/PatchwerkHorror.lua b/Stormwind/PatchwerkHorror.lua new file mode 100644 index 0000000..33ce3b1 --- /dev/null +++ b/Stormwind/PatchwerkHorror.lua @@ -0,0 +1,46 @@ +local PatchWorkHorror = {}; + +local function AcidSpit(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 61597, 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 + + +function CastBludgeoningStrike(eventId, delay, calls, creature) + local targets = creature:GetAITargets(10) + if #targets == 0 then + return + end + local target = targets[math.random(#targets)] + creature:CastSpell(target, 60870, true) +end + + +local function OnEnterCombat(event, creature, target) + creature:RegisterEvent(AcidSpit, 7000, 0) + creature:RegisterEvent(CastBludgeoningStrike, 13000, 0) + creature:RegisterEvent(CastSpecialSpell, 1000, 0) + end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:DespawnOrUnsummon(5000) + creature:RemoveEvents() +end + +RegisterCreatureEvent(400054, 1, OnEnterCombat) +RegisterCreatureEvent(400054, 2, OnLeaveCombat) +RegisterCreatureEvent(400054, 4, OnDied) + diff --git a/Stormwind/PatchworkHorror2.lua b/Stormwind/PatchworkHorror2.lua new file mode 100644 index 0000000..5607228 --- /dev/null +++ b/Stormwind/PatchworkHorror2.lua @@ -0,0 +1,38 @@ +local PatchWorkHorror2 = {}; + +local function AcidSpit(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 61597, true) +end + +local function KnockAway(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 10101, true) +end + + +function CastBludgeoningStrike(eventId, delay, calls, creature) + local targets = creature:GetAITargets(10) + if #targets == 0 then + return + end + local target = targets[math.random(#targets)] + creature:CastSpell(target, 60870, true) +end + + +local function OnEnterCombat(event, creature, target) + creature:RegisterEvent(AcidSpit, 7000, 0) + creature:RegisterEvent(CastBludgeoningStrike, 13000, 0) + creature:RegisterEvent(KnockAway, 16000, 0) + end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:RemoveEvents() +end + +RegisterCreatureEvent(10414, 1, OnEnterCombat) +RegisterCreatureEvent(10414, 2, OnLeaveCombat) +RegisterCreatureEvent(10414, 4, OnDied) \ No newline at end of file diff --git a/Stormwind/SW-Archer.lua b/Stormwind/SW-Archer.lua new file mode 100644 index 0000000..56c1a94 --- /dev/null +++ b/Stormwind/SW-Archer.lua @@ -0,0 +1,31 @@ +local Archer = {}; + +local function CastShoot(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 37770, true) +end + +local function CastSerpentSting(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 36984, true) +end + +local function CastMultiShot(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 30990, true) +end + +local function OnEnterCombat(event, creature, target) + creature:RegisterEvent(CastShoot, 750, 0) + creature:RegisterEvent(CastShoot, 15000, 0) + creature:RegisterEvent(CastMultiShot, 5000, 0) + end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:RemoveEvents() +end + +RegisterCreatureEvent(400033, 1, OnEnterCombat) +RegisterCreatureEvent(400033, 2, OnLeaveCombat) +RegisterCreatureEvent(400033, 4, OnDied) \ No newline at end of file diff --git a/Stormwind/SW-Guard.lua b/Stormwind/SW-Guard.lua new file mode 100644 index 0000000..118ee2d --- /dev/null +++ b/Stormwind/SW-Guard.lua @@ -0,0 +1,40 @@ +--Made by Dinkledork. This script defines a table of 26 battle cries for a creature with ID 400014. When the creature spawns, it will randomly select one of the 26 dialogues and use it in a yell. + +local SwHorse = {}; --ID from creature_template + +local dialogues = { +"Defend our lands with all you've got!", +"Victory is ours, if we stand together!", +"We are the shield that protects our people!", +"Show no mercy to those who would harm us!", +"Justice for our fallen!", +"Stand firm, for the future of our kingdom!", +"Today, we fight for everything we hold dear!", +"Let our enemies know that we will not be broken!", +"With honor and bravery, we will triumph!", +"We will not bow down to tyranny!", +"Rise up and defend our way of life!", +"In the face of danger, we stand strong!", +"For our families, for our friends, we fight!", +"Our cause is just, our resolve unbreakable!", +"Glory awaits those who face the fray!", +"No quarter for the enemy!", +"Hold the line, for the sake of all!", +"Today, we make history with our bravery!", +"The battle is upon us!", +"We fight for the defense of our homeland!", +"Make them pay for every inch they gain!", +"For the Alliance!", +"Ready yourselves for battle!", +"Prepare yourselves for the oncoming assault!", +"Steady yourselves, men. A terrible enemy approaches!", +"Don't let the enemy make it to the castle!" +} + +local function OnSpawn(event, creature) + local randomDialogue = dialogues[math.random(26)] -- Selects a random dialogue from the "dialogues" table + creature:SendUnitYell(randomDialogue,0) -- Makes the creature yell the selected dialogue +end + +RegisterCreatureEvent(400014, 5, OnSpawn) -- Registers the "OnSpawn" function as a spawn event for the creature with ID 400014 + diff --git a/Stormwind/SW-GuardCleave.lua b/Stormwind/SW-GuardCleave.lua new file mode 100644 index 0000000..253bf2a --- /dev/null +++ b/Stormwind/SW-GuardCleave.lua @@ -0,0 +1,36 @@ +local Stormwind = {}; + +local function CastCleave(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 20677, true) +end + +local function CastSunderArmor(eventId, delay, calls, creature) + creature:CastSpell(creature:GetVictim(), 8380, true) +end + +local function OnEnterCombat(event, creature, target) + creature:RegisterEvent(CastCleave, 5000, 0) + creature:RegisterEvent(CastSunderArmor, 7000, 0) + end + +local function OnLeaveCombat(event, creature) + creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) + creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:CastSpell(creature, 17683, true) +end + +RegisterCreatureEvent(400013, 1, OnEnterCombat) +RegisterCreatureEvent(400013, 2, OnLeaveCombat) +RegisterCreatureEvent(400013, 4, OnDied) +RegisterCreatureEvent(400013, 5, OnSpawn) + +RegisterCreatureEvent(400039, 1, OnEnterCombat) +RegisterCreatureEvent(400039, 2, OnLeaveCombat) +RegisterCreatureEvent(400039, 4, OnDied) +RegisterCreatureEvent(400039, 5, OnSpawn) \ No newline at end of file diff --git a/Stormwind/SWDefenders.lua b/Stormwind/SWDefenders.lua new file mode 100644 index 0000000..214005a --- /dev/null +++ b/Stormwind/SWDefenders.lua @@ -0,0 +1,17 @@ +local NPC_ENTRY_ID_1 = 400022 +local NPC_ENTRY_ID_2 = 400023 +local NPC_ENTRY_ID_3 = 400024 +local NPC_ENTRY_ID_4 = 400025 + +function OnSpawn(event, creature) + local npcEntry = creature:GetEntry() + if npcEntry == NPC_ENTRY_ID_1 or npcEntry == NPC_ENTRY_ID_2 or npcEntry == NPC_ENTRY_ID_3 or npcEntry == NPC_ENTRY_ID_4 then + creature:SetWalk(false) -- Set movement type to run + creature:MoveWaypoint() + end +end + +RegisterCreatureEvent(NPC_ENTRY_ID_1, 5, OnSpawn) +RegisterCreatureEvent(NPC_ENTRY_ID_2, 5, OnSpawn) +RegisterCreatureEvent(NPC_ENTRY_ID_3, 5, OnSpawn) +RegisterCreatureEvent(NPC_ENTRY_ID_4, 5, OnSpawn) \ No newline at end of file diff --git a/Stormwind/SWGKillCred.lua b/Stormwind/SWGKillCred.lua new file mode 100644 index 0000000..ee9eacd --- /dev/null +++ b/Stormwind/SWGKillCred.lua @@ -0,0 +1,27 @@ +local SWG_ID = {68, 400013, 400033, 400014, 1976} +local SPELL_ID = 100141 + +function OnSpellCast(event, caster, spell) +local target = spell:GetTarget() +if target and spell:GetEntry() == SPELL_ID then +local isValidTarget = false +for _, swgID in ipairs(SWG_ID) do +if target:GetEntry() == swgID then +isValidTarget = true +break +end +end +if not isValidTarget then +caster:SendBroadcastMessage("That target is not valid.") +spell:Cancel() +elseif target:HasAura(SPELL_ID) then +caster:SendBroadcastMessage("Target has already been empowered.") +spell:Cancel() +else +-- give kill credit to NPC ID 68 +caster:KilledMonsterCredit(68) +end +end +end + +RegisterPlayerEvent(5, OnSpellCast) \ No newline at end of file diff --git a/Stormwind/SWVillager.lua b/Stormwind/SWVillager.lua new file mode 100644 index 0000000..85195cf --- /dev/null +++ b/Stormwind/SWVillager.lua @@ -0,0 +1,53 @@ +--Credits to Dinkledork. +--I created this script to be used in a quest to calm down some frantic stormwind citizens. + +local npcid = 400028 +local gossipText = "Get the Stormwind Citizen to calm down..." +local itemId = 60083 -- Soothing spices as a test, required to interact with the npc. Can set to a given quest item. +local spellId = 139 + +-- This function is called when the player first interacts with the NPC +local function OnGossipHello(event, player, creature) +-- Check if the player has the necessary item +if (player:HasItem(itemId)) then +-- Add the option to the gossip menu +player:GossipMenuAddItem(0, gossipText, 0, 1) +-- Send the gossip menu to the player +player:GossipSendMenu(1, creature) +else +-- Send an error message to the player if they don't have the necessary item +player:SendBroadcastMessage("They aren't responding to anything...Maybe you should go ask Arch Bishop Benedictus for help in the Cathedral of Light.") +end +end + +-- This function is called when the player selects an option from the gossip menu +local function OnGossipSelect(event, player, creature, sender, intid, code) +-- Check if the selected option is the one we added in OnGossipHello +if (intid == 1) then +-- Remove the item from the player's inventory +player:RemoveItem(itemId, 1) +-- Remove all auras from the NPC. Important since they have a fear aura. +creature:RemoveAllAuras() +-- Give credit to the player for killing the NPC. Important for quest credit. The NPC literally dies. +player:KilledMonsterCredit(npcid) +-- Cast the spell on the NPC for visual effect. +creature:CastSpell(creature, spellId, true) +-- Choose a random dialogue for the NPC to say after interacting +local randomDialogue = math.random(1, 3) +if randomDialogue == 1 then +creature:SendUnitSay("Oh, thank you for helping me come to my senses...I should be going now...", 0) +elseif randomDialogue == 2 then +creature:SendUnitSay("Thank you so much! I feel much better now...", 0) +else +creature:SendUnitSay("I can finally think clearly again, thank you!", 0) +end +-- Close the gossip menu +player:GossipComplete() +-- Despawn the NPC after a 5 second delay +creature:DespawnOrUnsummon(5000) +end +end + +-- Register the gossip events for the NPC +RegisterCreatureGossipEvent(npcid, 1, OnGossipHello) +RegisterCreatureGossipEvent(npcid, 2, OnGossipSelect) \ No newline at end of file diff --git a/Stormwind/Shailiea.lua b/Stormwind/Shailiea.lua new file mode 100644 index 0000000..6373bd6 --- /dev/null +++ b/Stormwind/Shailiea.lua @@ -0,0 +1,78 @@ +local Hunter = {}; + +local function CastRapidShot(eventId, delay, calls, creature) +local victim = creature:GetVictim() +creature:CastSpell(victim, 71251, true) +end + +local function CastSummonTamedBear(eventId, delay, calls, creature) +local victim = creature:GetVictim() +creature:CastSpell(victim, 7903, true) +end + +local function CastWhirlwind(eventId, delay, calls, creature) +local victim = creature:GetVictim() +creature:CastSpell(victim, 1680, false) +end + +local function CastExplosiveTrap(eventId, delay, calls, creature) +local victim = creature:GetVictim() +creature:CastSpell(victim, 49066, false) +end + +local function CastMortalStrike(eventId, delay, calls, creature) +local victim = creature:GetVictim() +creature:CastSpell(victim, 30330, false) +end + +local function CastDisengage(eventId, delay, calls, creature) +local victim = creature:GetVictim() +creature:CastSpell(victim, 57635, false) +end + +local function CastRoot(eventId, delay, calls, creature) +local victim = creature:GetVictim() +creature:CastSpell(victim, 50762, false) +end + +local function CastFD(eventId, delay, calls, creature) +creature:CastSpell(creature, 23604, false) +end + +local function OnEnterCombat(event, creature, target) +local sayings = { +"You dare enter my territory?", +"I'll make sure you never come back!", +"You won't make it out of here alive!", +"You're nothing but prey to me!" +} +local index = math.random(1, #sayings) +creature:SendUnitSay(sayings[index], 0) +creature:RegisterEvent(CastFD, 100, 1) +creature:RegisterEvent(CastRoot, 10300, 0) +creature:RegisterEvent(CastDisengage, 10400, 0) +creature:RegisterEvent(CastRapidShot, 11000, 0) +creature:RegisterEvent(CastWhirlwind, 6100, 0) +creature:RegisterEvent(CastExplosiveTrap, 12600, 0) +creature:RegisterEvent(CastMortalStrike, 5300, 0) +creature:RegisterEvent(CastSummonTamedBear, 5, 1) +end + +local function OnLeaveCombat(event, creature) +creature:SendUnitSay("You are not worth my time.", 0) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:SendUnitSay("You may have defeated me, but the hunt continues.", 0) +creature:RemoveEvents() +end + +local function OnSpawn(event, creature) +creature:SendUnitSay("The hunt begins.", 0) +end + +RegisterCreatureEvent(7295, 1, OnEnterCombat) +RegisterCreatureEvent(7295, 2, OnLeaveCombat) +RegisterCreatureEvent(7295, 4, OnDied) +RegisterCreatureEvent(7295, 5, OnSpawn) \ No newline at end of file diff --git a/Stormwind/TrapQuestA.lua b/Stormwind/TrapQuestA.lua new file mode 100644 index 0000000..3392199 --- /dev/null +++ b/Stormwind/TrapQuestA.lua @@ -0,0 +1,19 @@ +-- Quest ID for the quest that should trigger the sound +local QUEST_ID = 30004 + +-- Creature ID for the creature that gives the quest +local CREATURE_ID = 12480 + +-- Sound ID for the sound that should play when the quest is accepted +local SOUND_ID = 20426 + +-- Emote ID for the emote that should play when the quest is accepted +local EMOTE_ID = 113 + +-- Register the event for quest acceptance +RegisterCreatureEvent(CREATURE_ID, 31, function(event, player, creature, quest) + if quest:GetId() == QUEST_ID then + creature:PlayDistanceSound(SOUND_ID) + creature:PerformEmote(EMOTE_ID) + end +end) diff --git a/Stormwind/TrapQuestR.lua b/Stormwind/TrapQuestR.lua new file mode 100644 index 0000000..8acb15c --- /dev/null +++ b/Stormwind/TrapQuestR.lua @@ -0,0 +1,19 @@ +-- Quest ID for the quest that should trigger the sound +local QUEST_ID = 30004 + +-- Creature ID for the creature that gives the quest +local CREATURE_ID = 12480 + +-- Sound ID for the sound that should play when the quest is rewarded +local SOUND_ID = 20427 + +-- Emote ID for the emote that should play when the quest is rewarded +local EMOTE_ID = 113 + +-- Register the event for quest reward +RegisterCreatureEvent(CREATURE_ID, 34, function(event, player, creature, quest) + if quest:GetId() == QUEST_ID then + creature:PlayDistanceSound(SOUND_ID) + creature:PerformEmote(EMOTE_ID) + end +end) diff --git a/Stormwind/Turalyon1.lua b/Stormwind/Turalyon1.lua new file mode 100644 index 0000000..dc9c0ec --- /dev/null +++ b/Stormwind/Turalyon1.lua @@ -0,0 +1,31 @@ +local npcid = 400018 +local spellid1 = 100138 +local spellid2 = 69930 +local spellid3 = 52386 +local yelltext = { +"Defenders, forward! We end this beast here and now!", +"We fight the Scourge to protect our homes, our families...I only hope we are not too late.", +"", +"Alleria...perfect timing as always.", +} +local waypointIndex = 0 + +function OnReachWp(event, creature, waypoint) +if waypointIndex >= #yelltext then +return +end +creature:CastSpell(creature, spellid1, true) +creature:CastSpell(creature, spellid2, true) +creature:CastSpell(creature, spellid3, true) +creature:SendUnitSay(yelltext[waypointIndex + 1], 0) +waypointIndex = waypointIndex + 1 +end + +function OnSpawn(event, creature) +waypointIndex = 0 +creature:MoveWaypoint() +creature:SetReactState(0) +end + +RegisterCreatureEvent(npcid, 5, OnSpawn) +RegisterCreatureEvent(npcid, 6, OnReachWp) \ No newline at end of file diff --git a/Stormwind/Turalyon2.lua b/Stormwind/Turalyon2.lua new file mode 100644 index 0000000..6f6154e --- /dev/null +++ b/Stormwind/Turalyon2.lua @@ -0,0 +1,47 @@ +local Turalyon = {}; + +local function CastCharge(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 22911, true) +end + +local function CastCrusaderStrike(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 66003, true) +end + +local function CastDivineStorm(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 53385, true) +end + +local function CastConsecration(eventId, delay, calls, creature) +creature:CastSpell(creature, 69930, true) +end + +local function CastChallengingShout(eventId, delay, calls, creature) +creature:CastSpell(creature, 1161, true) +end + + +local function ForceDespawn(eventId, delay, calls, creature) +creature:DespawnOrUnsummon(1) +end + +local function OnEnterCombat(event, creature, target) +creature:RegisterEvent(CastCharge, 250, 1) +creature:RegisterEvent(CastCrusaderStrike, 5000, 0) +creature:RegisterEvent(CastDivineStorm, 10000, 0) +creature:RegisterEvent(CastConsecration, 15000, 0) +creature:RegisterEvent(CastChallengingShout, 6500, 0) +creature:RegisterEvent(ForceDespawn, 90000, 1) +end + +local function OnLeaveCombat(event, creature) +creature:RemoveEvents() +end + +local function OnDied(event, creature, killer) +creature:RemoveEvents() +end + +RegisterCreatureEvent(400020, 1, OnEnterCombat) +RegisterCreatureEvent(400020, 2, OnLeaveCombat) +RegisterCreatureEvent(400020, 4, OnDied) \ No newline at end of file diff --git a/Westfall/FOEREAPER.lua b/Westfall/FOEREAPER.lua new file mode 100644 index 0000000..284c32c --- /dev/null +++ b/Westfall/FOEREAPER.lua @@ -0,0 +1,36 @@ +local FoeReaper = {}; + +local function CastTrample(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 5568, true) +end + +local function CastKnockback(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 49398, true) +end + +function FoeReaper.OnEnterCombat(event, creature, target) +creature:SendUnitYell("You like me, you really like me!", 0) +creature:RegisterEvent(CastTrample, 5000, 0) +creature:RegisterEvent(CastKnockback, 15000, 0) +end + +function FoeReaper.OnLeaveCombat(event, creature) +creature:SendUnitYell("Haha, you lose!", 0) +creature:RemoveEvents() +end + +function FoeReaper.OnDied(event, creature, killer) +if(killer:GetObjectType() == "Player") then +killer:SendBroadcastMessage("You killed " ..creature:GetName().."!") +end +creature:RemoveEvents() +end + +function FoeReaper.OnSpawn(event, creature) + creature:SendUnitYell("I'm baaaaaaaaack!!!", 0) +end + +RegisterCreatureEvent(900003, 1, FoeReaper.OnEnterCombat) +RegisterCreatureEvent(900003, 2, FoeReaper.OnLeaveCombat) +RegisterCreatureEvent(900003, 4, FoeReaper.OnDied) +RegisterCreatureEvent(900003, 5, FoeReaper.OnSpawn) \ No newline at end of file diff --git a/Westfall/Lithe-Stalker.lua b/Westfall/Lithe-Stalker.lua new file mode 100644 index 0000000..e99bdd0 --- /dev/null +++ b/Westfall/Lithe-Stalker.lua @@ -0,0 +1,31 @@ +local LitheStalker = {}; + +local function CastWhirlingTip(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 24048, true) +end + +local function CastSweepingSlam(eventId, delay, calls, creature) +creature:CastSpell(creature:GetVictim(), 53399, true) +end + +function LitheStalker.OnEnterCombat(event, creature, target) +creature:SendUnitYell("The Master will have your guts!", 0) +creature:RegisterEvent(CastWhirlingTip, 5000, 0) +creature:RegisterEvent(CastSweepingSlam, 10000, 0) +end + +function LitheStalker.OnLeaveCombat(event, creature) +creature:SendUnitSay("Mmmm....", 0) +creature:RemoveEvents() +end + +function LitheStalker.OnDied(event, creature, killer) +if(killer:GetObjectType() == "Player") then +killer:SendBroadcastMessage("You killed " ..creature:GetName().."!") +end +creature:RemoveEvents() +end + +RegisterCreatureEvent(400015, 1, LitheStalker.OnEnterCombat) +RegisterCreatureEvent(400015, 2, LitheStalker.OnLeaveCombat) +RegisterCreatureEvent(400015, 4, LitheStalker.OnDied) \ No newline at end of file