Add files via upload

This commit is contained in:
Dinkledork
2023-03-10 03:23:34 -07:00
committed by GitHub
parent bb8d26da51
commit e6a5000f2c
12 changed files with 334 additions and 77 deletions

View File

@@ -1,70 +1,84 @@
local Alleria = {}; local Alleria = {};
function Alleria.OnEnterCombat(event, creature, target)
local function CastRapidShot(eventId, delay, calls, creature) creature:RegisterEvent(Alleria.CastFD, 1, 1)
local victim = creature:GetVictim() creature:RegisterEvent(Alleria.CastRoot, 10300, 1)
creature:CastSpell(victim, 71251, true) 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 end
local function CastShoot(eventId, delay, calls, creature) function Alleria.OnLeaveCombat(event, creature)
local victim = creature:GetVictim() creature:RemoveEvents()
creature:CastSpell(victim, 39079, true)
end end
local function CastMultiShot(eventId, delay, calls, creature) function Alleria.OnDied(event, creature, killer)
local victim = creature:GetVictim() creature:RemoveEvents()
creature:CastSpell(victim, 59713, false)
end end
local function CastExplosiveShot(eventId, delay, calls, creature) function Alleria.CastRapidShot(event, delay, calls, creature)
local victim = creature:GetVictim() local victim = creature:GetVictim()
creature:CastSpell(victim, 60053, false) if not creature:IsCasting() or creature:IsCastingSpell(71251) then
creature:CastSpell(victim, 71251, true)
end
end end
local function CastBlackArrow(eventId, delay, calls, creature) function Alleria.CastShoot(event, delay, calls, creature)
local victim = creature:GetVictim() local victim = creature:GetVictim()
creature:CastSpell(victim, 63672, false) if not creature:IsCasting() or not creature:IsCastingSpell(71251) then
creature:CastSpell(victim, 39079, true)
end
end end
local function CastDisengage(eventId, delay, calls, creature) function Alleria.CastMultiShot(event, delay, calls, creature)
local victim = creature:GetVictim() local victim = creature:GetVictim()
creature:CastSpell(victim, 57635, false) if not creature:IsCasting() or not creature:IsCastingSpell(71251) then
creature:CastSpell(victim, 59713, false)
end
end end
local function CastFD(eventId, delay, calls, creature) 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) creature:CastSpell(creature, 23604, false)
end end
local function CastRoot(eventId, delay, calls, creature)
local victim = creature:GetVictim()
creature:CastSpell(victim, 50762, false)
end end
local function ForceDespawn(eventId, delay, calls, creature) 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) creature:DespawnOrUnsummon(1)
end end
local function OnEnterCombat(event, creature, target) RegisterCreatureEvent(400021, 1, Alleria.OnEnterCombat)
RegisterCreatureEvent(400021, 2, Alleria.OnLeaveCombat)
creature:RegisterEvent(CastFD, 1, 1) RegisterCreatureEvent(400021, 4, Alleria.OnDied)
creature:RegisterEvent(CastRoot, 10300, 1)
creature:RegisterEvent(CastDisengage, 10400, 1)
creature:RegisterEvent(CastRapidShot, 7100, 0)
creature:RegisterEvent(CastMultiShot, 6100, 0)
creature:RegisterEvent(CastExplosiveShot, 6600, 0)
creature:RegisterEvent(CastBlackArrow, 15300, 0)
creature:RegisterEvent(CastShoot, 499, 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(400021, 1, OnEnterCombat)
RegisterCreatureEvent(400021, 2, OnLeaveCombat)
RegisterCreatureEvent(400021, 4, OnDied)

19
BoneWitch.lua Normal file
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)

42
DarkRanger.lua Normal file
View File

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

View File

@@ -1,3 +1,4 @@
--lightning
local npcIds1 = { local npcIds1 = {
8541, 8541,
10417, 10417,
@@ -15,18 +16,18 @@ local npcIds1 = {
400015, 400015,
400016, 400016,
300018, 300018,
400029,
400032,
16383, 16383,
16394, 16394,
16423, 16423,
16422, 16422,
400036, 400036,
400056, 400049,
400049 400048,
16437,
16438
} }
-- Table to store NPC IDs for group 2 -- Rez Visual
local npcIds2 = { local npcIds2 = {
400013, 400013,
400014, 400014,
@@ -37,7 +38,25 @@ local npcIds2 = {
400019, 400019,
400026, 400026,
400027, 400027,
400033 400033,
400070,
400065,
400042,
400043
}
-- Shadowstep
local npcIds3 = {
400053,
400069,
400055,
400052,
400047,
400056,
400032,
400029,
400073,
400072
} }
-- Function to be executed when an NPC from group 1 is spawned -- Function to be executed when an NPC from group 1 is spawned
@@ -62,22 +81,28 @@ local spellId = 100133
creature:CastSpell(creature, spellId, true) -- rez visual creature:CastSpell(creature, spellId, true) -- rez visual
end end
-- Function to be executed when an NPC from both groups leaves combat -- Function to be executed when an NPC from group 3 is spawned
local function CastSpellOnLeaveCombat(event, creature) local function CastSpellOnSpawnGroup3(event, creature)
if not creature then if not creature then
print("Error: creature was not set!") print("Error: creature was not set!")
return return
end end
local spellId = 51908
creature:CastSpell(creature, spellId, true) -- shadowstep cosmetic
end end
-- Register the event for NPCs in group 1 -- Register the event for NPCs in group 1
for _, npcId in ipairs(npcIds1) do for _, npcId in ipairs(npcIds1) do
RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup1) RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup1)
RegisterCreatureEvent(npcId, 21, CastSpellOnLeaveCombat)
end end
-- Register the event for NPCs in group 2 -- Register the event for NPCs in group 2
for _, npcId in ipairs(npcIds2) do for _, npcId in ipairs(npcIds2) do
RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup2) RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup2)
RegisterCreatureEvent(npcId, 21, CastSpellOnLeaveCombat) end
-- Register the event for NPCs in group 3
for _, npcId in ipairs(npcIds3) do
RegisterCreatureEvent(npcId, 5, CastSpellOnSpawnGroup3)
end end

View File

@@ -11,13 +11,15 @@ local function OnGossipSelect(event, player, item, sender, intid, code)
if (sender == 150) then if (sender == 150) then
-- Show Scourge Event menu -- Show Scourge Event menu
player:GossipMenuAddItem(0, "|TInterface\\icons\\spell_misc_emotionhappy:37:37:-23|t|cff007d45Start Event for Bonus Lich Runes|r", 100, 0) player:GossipMenuAddItem(0, "|TInterface\\icons\\spell_misc_emotionhappy:37:37:-23|t|cff007d45Start Event for Bonus Lich Runes|r", 100, 0)
player:GossipMenuAddItem(0, "|TInterface\\icons\\spell_misc_emotionsad:37:37:-23|t|cffC41F3BStop Event but Die and Suffer|r", 101, 0) player:GossipMenuAddItem(0, "|TInterface\\icons\\spell_misc_emotionsad:37:37:-23|t|cffC41F3BStop Event but Suffer|r", 101, 0)
player:GossipMenuAddItem(0, "Back", 0, 0) player:GossipMenuAddItem(0, "Back", 0, 0)
player:GossipSendMenu(1, item) player:GossipSendMenu(1, item)
return return
elseif (sender == 100) then elseif (sender == 100) then
-- Start the event -- Start the event
if not IsGameEventActive(17) then if IsGameEventActive(17) then
player:SendBroadcastMessage("The Scourge event is already active.")
else
player:AddItem(43949, 2) player:AddItem(43949, 2)
StartGameEvent(17, true) StartGameEvent(17, true)
player:PlayDirectSound(14797) player:PlayDirectSound(14797)
@@ -25,7 +27,9 @@ end
player:GossipComplete() player:GossipComplete()
elseif (sender == 101) then elseif (sender == 101) then
-- Stop the event -- Stop the event
if IsGameEventActive(17) then if not IsGameEventActive(17) then
player:SendBroadcastMessage("The Scourge event is not currently active.")
else
StopGameEvent(17, true) StopGameEvent(17, true)
player:CastSpell(player, 15007, true) player:CastSpell(player, 15007, true)
player:RemoveItem(43949, 2) player:RemoveItem(43949, 2)

37
Draven.lua Normal file
View File

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

25
FlameShocker.lua Normal file
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

@@ -6,3 +6,5 @@ creature:SetDisableGravity(true)
end end
RegisterCreatureEvent(400057, 5, frostbroodWhelps.OnSpawn) RegisterCreatureEvent(400057, 5, frostbroodWhelps.OnSpawn)
RegisterCreatureEvent(16531, 5, frostbroodWhelps.OnSpawn)

View File

@@ -1,4 +1,4 @@
local BRAVE_IDS = {5412, 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} 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 = { local BRAVERY_DIALOGUE = {
"I fear no enemy!", "I fear no enemy!",
"I will fight to the bitter end!", "I will fight to the bitter end!",

View File

@@ -3,7 +3,7 @@ local ALLOWED_MAPS = {
1, 1,
} }
local ALLOWED_SPELLS = {100150, 100160, 100161, 100177} local ALLOWED_SPELLS = {100150, 100160, 100161, 100177, 100186}
function table.indexOf(t, value) function table.indexOf(t, value)
for k, v in ipairs(t) do for k, v in ipairs(t) do
@@ -19,15 +19,28 @@ local spellId = spell:GetEntry()
local mapId = player:GetMapId() local mapId = player:GetMapId()
if table.indexOf(ALLOWED_SPELLS, spellId) ~= -1 then if table.indexOf(ALLOWED_SPELLS, spellId) ~= -1 then
if table.indexOf(ALLOWED_MAPS, mapId) == -1 then if table.indexOf(ALLOWED_MAPS, mapId) == -1 then
spell:Cancel() spell:Cancel()
player:SendBroadcastMessage("You cannot use that here.") player:SendBroadcastMessage("You can't use that here.")
else else
if spellId == 100150 then if spellId == 100150 then
player:PlayDirectSound(20428) player:PlayDirectSound(20428)
end end
end end
end end
end end
function OnPlayerZoneChange(event, player, newZone, newArea)
local mapId = player:GetMapId()
if table.indexOf(ALLOWED_MAPS, mapId) == -1 then
for i, allowedSpell in ipairs(ALLOWED_SPELLS) do
local aura = player:GetAura(allowedSpell)
if aura then
player:RemoveAura(allowedSpell)
end
end
end
end
RegisterPlayerEvent(27, OnPlayerZoneChange)
RegisterPlayerEvent(5, OnPlayerCastSpell) RegisterPlayerEvent(5, OnPlayerCastSpell)

View File

@@ -5,7 +5,7 @@ Draven.ITEM_ID = 60114 -- replace with the ID of the item you want to give
-- Register the gossip event for the NPC -- Register the gossip event for the NPC
function Draven.OnGossipHello(event, player, creature) function Draven.OnGossipHello(event, player, creature)
player:GossipMenuAddItem(0, "|TInterface\\Icons\\ability_stealth:50:50:-23:0|tPurchase 3 Stealth Potions.|r", 0, 1) 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) player:GossipSendMenu(1, creature)
end end
@@ -27,10 +27,10 @@ end
-- Send a unit yell when the NPC spawns -- Send a unit yell when the NPC spawns
function Draven.OnSpawn(event, creature) function Draven.OnSpawn(event, creature)
creature:SendUnitYell("", 0) creature:SendUnitYell("", 0)
creature:CastSpell(creature, 20374) creature:CastSpell(creature, 17683, true)
end end
-- Register the gossip events with the NPC -- Register the gossip events with the NPC
RegisterCreatureGossipEvent(nil, 1, Draven.OnGossipHello) RegisterCreatureGossipEvent(400069, 1, Draven.OnGossipHello)
RegisterCreatureGossipEvent(nil, 2, Draven.OnGossipSelect) RegisterCreatureGossipEvent(400069, 2, Draven.OnGossipSelect)
RegisterCreatureEvent(nil, 5, Draven.OnSpawn) RegisterCreatureEvent(400069, 5, Draven.OnSpawn)

76
Sylvanas.lua Normal file
View File

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