Add files via upload

This commit is contained in:
Dinkledork
2023-03-10 17:22:11 -07:00
committed by GitHub
parent 1733798d60
commit bfc1221109
11 changed files with 231 additions and 32 deletions

13
DinkleRez.lua Normal file
View File

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

View File

@@ -1,32 +1,15 @@
local OrgArcher = {}
local function CastShoot(eventId, delay, calls, creature)
local range = 200 -- set range to 200 yards
local target = creature:GetNearestCreature(range, 400035) -- find nearest target within range
if target ~= nil then
creature:CastSpell(target, 37770, true) -- cast shoot on target
end
end
local function CastSerpentSting(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 36984, true)
creature:CastSpell(target, 37770, true)
end
local function CastMultiShot(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 30990, true)
end
local function CastShootOnSpawn(event, creature)
local range = 200 -- set range to 200 yards
local target = creature:GetNearestCreature(range, 400035) -- find nearest target within range
if target ~= nil then
creature:CastSpell(target, 37770, true) -- cast shoot on target
end
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastShoot, 750, 0)
creature:RegisterEvent(CastSerpentSting, 15000, 0)
creature:RegisterEvent(CastShoot, 850, 0)
creature:RegisterEvent(CastMultiShot, 5000, 0)
end
@@ -42,4 +25,3 @@ RegisterCreatureEvent(400041, 1, OnEnterCombat)
RegisterCreatureEvent(400041, 2, OnLeaveCombat)
RegisterCreatureEvent(400041, 4, OnDied)
RegisterCreatureEvent(400035, 5, CastShootOnSpawn)

View File

@@ -17,6 +17,10 @@ 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
@@ -24,7 +28,14 @@ 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, 4, OnDied)
RegisterCreatureEvent(400045, 5, OnSpawn)
RegisterCreatureEvent(14720, 1, OnEnterCombat)
RegisterCreatureEvent(14720, 2, OnLeaveCombat)
RegisterCreatureEvent(14720, 4, OnDied)
RegisterCreatureEvent(14720, 5, OnSpawn)

41
OrgGuardKillCred.lua Normal file
View File

@@ -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
if not isValidTarget then
-- Send a broadcast message to the player
caster:SendBroadcastMessage("Invalid target.")
-- 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)

37
OrgrimmarVillager.lua Normal file
View File

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

View File

@@ -4,15 +4,31 @@ local function AcidSpit(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 61597, true)
end
function CastBludgeoningStrike(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
local target = targets[math.random(#targets)]
creature:CastSpell(target, 60870, true)
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, 14000, 0)
creature:RegisterEvent(CastSpecialSpell, 1000, 0)
end
local function OnLeaveCombat(event, creature)
@@ -20,7 +36,7 @@ local function OnLeaveCombat(event, creature)
end
local function OnDied(event, creature, killer)
creature:RemoveCorpse()
creature:DespawnOrUnsummon(5000)
creature:RemoveEvents()
end

57
PrinceTenris.lua Normal file
View File

@@ -0,0 +1,57 @@
local PRINCE_TENRIS_MIRKBLOOD = 28194 -- The id of Prince Tenris Mirkblood
local BLOOD_MIRROR = 70838
local SUMMON_SANGUINE_SPIRIT = 51280
local SANGUINE_STRIKE = 51285
local BLOOD_SWOOP = 50923
local function CastBloodMirror(eventId, delay, calls, creature)
local raidMembers = creature:GetAITargets(10) -- Get up to 10 raid members
if #raidMembers > 0 then
local targetIndex = math.random(1, #raidMembers)
local randomTarget = raidMembers[targetIndex]
if randomTarget then
creature:CastSpell(randomTarget, BLOOD_MIRROR)
end
end
end
local function CastSanguineSpirit(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SUMMON_SANGUINE_SPIRIT, true)
end
local function CastSanguineStrike(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), SANGUINE_STRIKE)
end
local function CastBloodSwoop(eventId, delay, calls, creature)
local raidMembers = creature:GetAITargets(10) -- Get up to 10 raid members
if #raidMembers > 0 then
local targetIndex = math.random(1, #raidMembers)
local randomTarget = raidMembers[targetIndex]
if randomTarget then
creature:CastSpell(randomTarget, BLOOD_SWOOP)
end
end
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastBloodMirror, math.random(26000, 42000), 0)
creature:RegisterEvent(CastSanguineSpirit, math.random(3000, 6000), 0)
creature:RegisterEvent(CastSanguineStrike, math.random(11000, 19000), 0)
creature:RegisterEvent(CastBloodSwoop, 23000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(PRINCE_TENRIS_MIRKBLOOD, 1, OnEnterCombat)
RegisterCreatureEvent(PRINCE_TENRIS_MIRKBLOOD, 2, OnLeaveCombat)
RegisterCreatureEvent(PRINCE_TENRIS_MIRKBLOOD, 4, OnDied)

View File

@@ -1,11 +1,12 @@
local RShredder = {};
function RShredder.OnSpawn(event, creature)
creature:CastSpell(creature, 17683, true)
creature:CastSpell(creature, 100169, true)
creature:SetReactState(0)
end
function RShredder.OnDied(event, creature)
creature:RemoveCorpse()
creature:DespawnOrUnsummon(5000)
creature:RemoveEvents()
end

41
RunokWildmane.lua Normal file
View File

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

View File

@@ -13,10 +13,10 @@ creature:CastSpell(creature, 17683, true)
creature:RegisterEvent(undeadDragon.CastSpell2, 15000, 0)
creature:RegisterEvent(undeadDragon.CastSpell3, 3500, 0)
creature:RegisterEvent(undeadDragon.CastSpell4, 6000, 0)
creature:RegisterEvent(undeadDragon.CastSpell4, 7000, 0)
creature:RegisterEvent(undeadDragon.CastSpell5, 23000, 0)
creature:RegisterEvent(undeadDragon.CastSpell6, 35000, 0)
creature:RegisterEvent(undeadDragon.CastBlizzard, 4000, 0)
creature:RegisterEvent(undeadDragon.CastBlizzard, 5000, 0)
end
function undeadDragon.OnLeaveCombat(event, creature)
@@ -50,7 +50,7 @@ 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 4 random targets from the list of creatures
-- 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

View File

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