Add files via upload

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

View File

@@ -0,0 +1,49 @@
local NPC_UNDEAD_ROGUE = 400114
local NPC_TARGET = 3338
local SPELL_SINISTER_STRIKE = 1752
local SPELL_EVASION = 5277
local SPELL_GOUGE = 12540
local SPELL_CAST_DEATH = 5
local function CastSinisterStrike(creature)
creature:CastSpell(creature:GetVictim(), SPELL_SINISTER_STRIKE, false)
end
local function CastGouge(creature)
creature:CastSpell(creature:GetVictim(), SPELL_GOUGE, false)
end
local function CastSpellOnTarget(creature, targetNPC)
creature:CastSpell(targetNPC, SPELL_CAST_DEATH, true)
end
local function UndeadRogue_OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastSinisterStrike, math.random(4000, 6000), 0)
creature:RegisterEvent(CastGouge, math.random(14000, 18000), 0)
local targetNPC = creature:GetNearestCreature(50, NPC_TARGET)
if targetNPC then
CastSpellOnTarget(creature, targetNPC)
end
end
local function UndeadRogue_OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function UndeadRogue_OnDamageTaken(event, creature, attacker, damage)
local healthPct = creature:GetHealthPct()
if healthPct <= 30 and not creature:HasAura(SPELL_EVASION) then
creature:CastSpell(creature, SPELL_EVASION, true)
end
end
local function UndeadRogue_OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(NPC_UNDEAD_ROGUE, 1, UndeadRogue_OnEnterCombat)
RegisterCreatureEvent(NPC_UNDEAD_ROGUE, 2, UndeadRogue_OnLeaveCombat)
RegisterCreatureEvent(NPC_UNDEAD_ROGUE, 4, UndeadRogue_OnDied)
RegisterCreatureEvent(NPC_UNDEAD_ROGUE, 9, UndeadRogue_OnDamageTaken)

View File

@@ -0,0 +1,40 @@
local NPC_BANSHEE = 400112
local NPC_TARGET = 3338
local SPELL_BANSHEE_SCREAM = 41150
local SPELL_SHADOW_BOLT = 9613
local SPELL_CAST_DEATH = 5
local function CastShadowBolt(creature)
creature:CastSpell(creature:GetVictim(), SPELL_SHADOW_BOLT, true)
end
local function CastBansheeScream(creature)
creature:CastSpell(creature:GetVictim(), SPELL_BANSHEE_SCREAM, true)
end
local function CastSpellOnTarget(creature, targetNPC)
creature:CastSpell(targetNPC, SPELL_CAST_DEATH, true)
end
local function Banshee_OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastShadowBolt, math.random(4000, 8000), 0)
creature:RegisterEvent(CastBansheeScream, math.random(9000, 18000), 1)
local targetNPC = creature:GetNearestCreature(50, NPC_TARGET)
if targetNPC then
CastSpellOnTarget(creature, targetNPC)
end
end
local function Banshee_OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
local function Banshee_OnDied(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(NPC_BANSHEE, 1, Banshee_OnEnterCombat)
RegisterCreatureEvent(NPC_BANSHEE, 2, Banshee_OnLeaveCombat)
RegisterCreatureEvent(NPC_BANSHEE, 4, Banshee_OnDied)

View File

@@ -0,0 +1,26 @@
local NPC_HORDE_GUARD = 400105
local SPELL_REND = 6547
local function CastRend(creature)
creature:CastSpell(creature:GetVictim(), SPELL_REND, true)
end
local function HordeGuard_OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastRend, 100, 1)
creature:RegisterEvent(CastRend, math.random(8000, 15000), 0)
end
local function HordeGuard_OnLeaveCombat(event, creature)
creature:RemoveEvents() -- Remove events when leaving combat
creature:EmoteState(375)
end
local function HordeGuard_OnSpawn(event, creature)
creature:EmoteState(375)
creature:SetEquipmentSlots(6905, 0, 0)
end
RegisterCreatureEvent(NPC_HORDE_GUARD, 1, HordeGuard_OnEnterCombat)
RegisterCreatureEvent(NPC_HORDE_GUARD, 2, HordeGuard_OnLeaveCombat)
RegisterCreatureEvent(NPC_HORDE_GUARD, 5, HordeGuard_OnSpawn)

View File

@@ -0,0 +1,47 @@
local NPC_SUTURES = 400113
local SPELL_CLEAVE = 15496
local SPELL_DISEASE_CLOUD = 30122
local SPELL_ABOMINATION_SLAM = 40546
local YELL_COMBAT_DIALOGUE = {
"Sutures smash!",
"Me make you hurt!",
"You not escape Sutures!",
"Why you bother Sutures?",
"Sutures crush you!"
}
local function CastCleave(creature)
creature:CastSpell(creature:GetVictim(), SPELL_CLEAVE, false)
end
local function CastDiseaseCloud(creature)
creature:CastSpell(creature:GetVictim(), SPELL_DISEASE_CLOUD, false)
end
local function CastAbominationSlam(creature)
creature:CastSpell(creature:GetVictim(), SPELL_ABOMINATION_SLAM, false)
end
local function Sutures_OnEnterCombat(event, creature, target)
if math.random(1, 100) <= 50 then -- 50% chance to yell upon entering combat
creature:SendUnitYell(YELL_COMBAT_DIALOGUE[math.random(1, #YELL_COMBAT_DIALOGUE)], 0)
end
creature:RegisterEvent(CastCleave, math.random(4000, 8000), 0)
creature:RegisterEvent(CastDiseaseCloud, math.random(10000, 15000), 0)
creature:RegisterEvent(CastAbominationSlam, math.random(8000, 12000), 0)
end
local function Sutures_OnLeaveCombat(event, creature)
creature:RemoveEvents() -- Remove events when leaving combat
end
local function Sutures_OnDied(event, creature, killer)
creature:RemoveEvents() -- Remove events when died
creature:SendUnitSay("Sutures...fall...", 0)
end
RegisterCreatureEvent(NPC_SUTURES, 1, Sutures_OnEnterCombat)
RegisterCreatureEvent(NPC_SUTURES, 2, Sutures_OnLeaveCombat)
RegisterCreatureEvent(NPC_SUTURES, 4, Sutures_OnDied)

View File

@@ -0,0 +1,186 @@
local NPC_IDS = {400104}
local ITEM_ID = 60124
local mainHandItems = {6905, 10756, 11087}
local destinations = {
{x = -482, y = -2710, z = 94.303, o = 4.2},
{x = -353, y = -2681, z = 95.88, o = 0.0929},
{x = -579, y = -2650, z = 95.633, o = 3.12},
{x = -348, y = -2507, z = 95.563, o = 1.49},
}
local messages = {
"For the Horde!",
"No mercy for our enemies!",
"Let's show these Scourge dogs what it means to mess with the Horde!",
"Victory or death, we fight for the Horde!",
"The blood of our enemies will water the fields of our glory!",
"This land is ours, and we will defend it with our lives!",
"We are the Horde, and we know no fear!",
}
local function OnGossipHello(event, player, creature)
if player:HasItem(ITEM_ID) then
player:GossipClearMenu()
player:GossipMenuAddItem(8, "|TInterface\\icons\\inv_sword_39:40:40:-35|t|cff610B0BGive Weapon|r", 1, 0)
player:GossipMenuAddItem(9, "2-Handed Axe", 1, 1001)
player:GossipMenuAddItem(9, "2-Handed Mace", 1, 1002)
player:GossipMenuAddItem(9, "2-Handed Sword", 1, 1003)
if creature:GetData("equipmentSet") then
player:GossipMenuAddItem(8, "|TInterface\\icons\\ability_hunter_markedfordeath:40:40:-35|t|cffC41F3BSend to Location|r", 2, 0)
player:GossipMenuAddItem(0, "Reinforce the East Entrance!", 2, 2001)
player:GossipMenuAddItem(0, "Reinforce the North Entrance!", 2, 2002)
player:GossipMenuAddItem(0, "Reinforce the South Entrance!", 2, 2003)
player:GossipMenuAddItem(0, "Reinforce the West Entrance!", 2, 2004)
player:GossipMenuAddItem(2, "|t|cff0101DFFollow me into battle!|r", 2, 2005)
end
player:GossipSendMenu(1, creature)
else
player:SendBroadcastMessage("You need Horde Armaments!")
end
end
--Define your abilities here
local function CastCleave(eventId, delay, calls, creature)
if creature:IsInCombat() then
creature:CastSpell(creature:GetVictim(), 845, true)
end
end
local function CastHeroicStrike(eventId, delay, calls, creature)
if creature:IsInCombat() then
creature:CastSpell(creature:GetVictim(), 78, true)
end
end
local function CastThunderClap(eventId, delay, calls, creature)
if creature:IsInCombat() then
creature:CastSpell(creature:GetVictim(), 8078, true)
end
end
local function CastEnrage(eventId, delay, calls, creature)
if creature:IsInCombat() then
creature:CastSpell(creature:GetVictim(), 3547, true)
end
end
local function CastRend(eventId, delay, calls, creature)
if creature:IsInCombat() then
creature:CastSpell(creature:GetVictim(), 8548, true)
end
end
local function CastCharge(eventId, delay, calls, creature)
if creature:IsInCombat() then
creature:CastSpell(creature:GetVictim(), 24193, true)
end
end
local function RegisterAbilities(creature, weaponType)
if creature:GetData("abilitiesRegistered") then
return
end
creature:SetData("abilitiesRegistered", true)
if weaponType == 1 then -- 2-Handed Axe Abilities
creature:RegisterEvent(CastCleave, math.random(8000, 12000), 0)
creature:RegisterEvent(CastHeroicStrike, math.random(5000, 9000), 0)
elseif weaponType == 2 then -- 2-Handed Mace Abilities
creature:RegisterEvent(CastThunderClap, math.random(9000, 14000), 0)
creature:RegisterEvent(CastEnrage, math.random(15000, 19000), 0)
elseif weaponType == 3 then -- 2-Handed Sword Abilities
creature:RegisterEvent(CastRend, math.random(11000, 15000), 0)
creature:RegisterEvent(CastCharge, 100, 1)
end
end
local function OnEnterCombat(event, creature, target)
local weaponType = creature:GetData("weaponType")
if weaponType and not creature:GetData("abilitiesRegistered") then
RegisterAbilities(creature, weaponType)
end
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
-- creature:EmoteState(375)
creature:SetData("abilitiesRegistered", false)
end
local function DespawnCreature(eventId, delay, calls, creature)
creature:SetEquipmentSlots(0, 0, 0)
creature:DespawnOrUnsummon()
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if intid == 0 then
OnGossipHello(event, player, creature)
elseif intid >= 1001 and intid <= 1003 then
local index = intid - 1000
local selectedMainHand = mainHandItems[index]
creature:SetEquipmentSlots(selectedMainHand, 0, 0)
creature:SetData("weaponType", index)
creature:SetData("equipmentSet", true)
creature:PerformEmote(66)
RegisterAbilities(creature, index) -- Add this line to register abilities
OnGossipHello(event, player, creature)
end
if intid >= 2001 and intid <= 2004 then
local index = intid - 2000
local destination = destinations[index]
local finalX = destination.x + math.random(-10, 10)
local finalY = destination.y + math.random(-10, 10)
local finalZ = destination.z
local finalO = destination.o
creature:MoveTo(0, finalX, finalY, finalZ, true)
local battlecryIndex = math.random(1, #messages)
creature:SendUnitYell(messages[battlecryIndex], 0)
creature:EmoteState(375)
creature:SetHomePosition(finalX, finalY, finalZ, finalO)
creature:SetNPCFlags(0)
player:RemoveItem(ITEM_ID, 1)
player:KilledMonsterCredit(creature:GetEntry())
player:GossipComplete()
creature:RegisterEvent(DespawnCreature, 180000)
end
if intid == 2005 then
local randomAngle = math.random() * 2 * math.pi
creature:MoveFollow(player, 5, randomAngle)
local battlecryIndex = math.random(1, #messages)
creature:SendUnitYell(messages[battlecryIndex], 0)
player:KilledMonsterCredit(400104)
creature:SetNPCFlags(0)
player:RemoveItem(ITEM_ID, 1)
player:GossipComplete()
creature:RegisterEvent(DespawnCreature, 180000)
end
end
local function OnCreatureDied(event, creature, killer)
creature:SetEquipmentSlots(0, 0, 0)
creature:SetData("equipmentSet", false)
creature:RemoveEvents()
creature:SetEquipmentSlots(0, 0, 0)
end
for _, npcId in ipairs(NPC_IDS) do
RegisterCreatureGossipEvent(npcId, 1, OnGossipHello)
RegisterCreatureGossipEvent(npcId, 2, OnGossipSelect)
RegisterCreatureEvent(npcId, 1, OnEnterCombat)
RegisterCreatureEvent(npcId, 2, OnLeaveCombat)
RegisterCreatureEvent(npcId, 4, OnCreatureDied)
end