Add files via upload

This commit is contained in:
Dinkledork
2023-03-12 08:55:05 -06:00
committed by GitHub
parent 42dfad0ec5
commit 5f808c0589
17 changed files with 490 additions and 29 deletions

View File

@@ -33,4 +33,3 @@ RegisterCreatureEvent(400051, 4, BlightedZombie.OnDeath)
RegisterCreatureEvent(400051, 5, BlightedZombie.OnSpawn)

29
BlightedZombie2.lua Normal file
View File

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

37
FleshFlayer.lua Normal file
View File

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

27
GibberingGhoul.lua Normal file
View File

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

35
HateShrieker.lua Normal file
View File

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

36
Necrofiend2.lua Normal file
View File

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

27
OrgDefQuest.lua Normal file
View File

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

View File

@@ -27,7 +27,7 @@ end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(AcidSpit, 7000, 0)
creature:RegisterEvent(CastBludgeoningStrike, 14000, 0)
creature:RegisterEvent(CastBludgeoningStrike, 13000, 0)
creature:RegisterEvent(CastSpecialSpell, 1000, 0)
end

38
PatchworkHorror2.lua Normal file
View File

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

64
Rattlegore.lua Normal file
View File

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

53
RisenConstruct.lua Normal file
View File

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

33
RisenGuard.lua Normal file
View File

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

View File

@@ -1,24 +1,27 @@
local SWG_IDS = {68, 400013, 400033, 400014, 1976}
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_IDS) do
if target:GetEntry() == swgID then
isValidTarget = true
break
end
end
if not isValidTarget then
caster:SendBroadcastMessage("")
spell:Cancel()
else
-- give kill credit to NPC ID 68
caster:KilledMonsterCredit(68)
end
end
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)
RegisterPlayerEvent(5, OnSpellCast)

View File

@@ -1,11 +1,6 @@
local SkeletalWarlord = {}
SkeletalWarlord.minChargeRange = 10
function SkeletalWarlord.OnSpawn(event, creature)
creature:SetMaxHealth(54353)
creature:CastSpell(creature, 17683, true)
end
function SkeletalWarlord.OnEnterCombat(event, creature, target)
creature:RegisterEvent(SkeletalWarlord.Whirlwind, 15000, 0)
creature:RegisterEvent(SkeletalWarlord.MortalStrike, 7000, 0)
@@ -25,7 +20,7 @@ creature:RemoveEvents()
end
function SkeletalWarlord.OnDied(event, creature, killer)
creature:DespawnOrUnsummon(5000)
creature:DespawnOrUnsummon(15000)
creature:RemoveEvents()
end
@@ -39,10 +34,15 @@ function SkeletalWarlord.Charge(eventId, delay, calls, creature)
end
RegisterCreatureEvent(400056, 5, SkeletalWarlord.OnSpawn)
RegisterCreatureEvent(400056, 1, SkeletalWarlord.OnEnterCombat)
RegisterCreatureEvent(400056, 2, SkeletalWarlord.OnLeaveCombat)
RegisterCreatureEvent(400056, 4, SkeletalWarlord.OnDied)
RegisterCreatureEvent(1788, 1, SkeletalWarlord.OnEnterCombat)
RegisterCreatureEvent(1788, 2, SkeletalWarlord.OnLeaveCombat)
RegisterCreatureEvent(1788, 4, SkeletalWarlord.OnDied)

40
SpectralAttendant (2).lua Normal file
View File

@@ -0,0 +1,40 @@
local SpectralAttendant = {}
function SpectralAttendant.OnEnterCombat(event, creature, target)
creature:RegisterEvent(SpectralAttendant.Cripple, 6000, 0)
creature:RegisterEvent(SpectralAttendant.AOEFear, 13000, 0)
creature:RegisterEvent(SpectralAttendant.Teleport, math.random(14000,16000), 0)
end
function SpectralAttendant.Cripple(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 11443, true)
end
function SpectralAttendant.AOEFear(eventId, delay, calls, creature)
creature:CastSpell(creature, 8122)
end
function SpectralAttendant.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function SpectralAttendant.OnDied(event, creature, killer)
creature:RemoveEvents()
end
function SpectralAttendant.Teleport(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 69904)
creature:ClearThreatList()
end
RegisterCreatureEvent(11873, 1, SpectralAttendant.OnEnterCombat)
RegisterCreatureEvent(11873, 2, SpectralAttendant.OnLeaveCombat)
RegisterCreatureEvent(11873, 4, SpectralAttendant.OnDied)

View File

@@ -4,6 +4,8 @@ local NPC_ID = 400034 -- The ID of the NPC you want players to get kill credit f
local ALLOWED_ZONES = {
1519, -- SW City
12,
14,
1637
}
-- List of allowed spell IDs
@@ -32,7 +34,7 @@ function OnPlayerCastSpell(event, player, spell)
if table.indexOf(ALLOWED_SPELLS, spellId) ~= -1 then
if table.indexOf(ALLOWED_ZONES, zoneId) == -1 then
spell:Cancel()
player:SendBroadcastMessage("You cannot cast this spell in this area.")
player:SendBroadcastMessage("You cannot use that here.")
else
player:KilledMonsterCredit(NPC_ID)
player:SendBroadcastMessage("You have successfuly placed a trap!")

38
VenomBelcher.lua Normal file
View File

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