Add files via upload

This commit is contained in:
Dinkledork
2023-03-16 03:44:34 -06:00
committed by GitHub
parent 27aa9b7e61
commit b0a3c479e8
7 changed files with 319 additions and 96 deletions

View File

@@ -12,26 +12,25 @@ local function CastSummonSkeleton(eventId, delay, calls, creature)
creature:CastSpell(creature, 59711, true)
end
local enterCombatDialogue = {
"Your end has come. I will feast on your bones.",
"You are no match for me!",
"Your death will be swift.",
"You dare challenge me?"
"Your life is forfeit to the Lich King!",
"The Scourge will devour your soul!",
"You dare challenge the might of the Scourge?",
"Your pitiful existence ends here!"
}
local leaveCombatDialogue = {
"Coward!",
"You won't escape next time!",
"I'll be back for more!",
"You are lucky to leave this place alive."
"Your cowardice prolongs the inevitable!",
"The Lich King's grasp reaches far, mortal!",
"We will meet again, and you will fall!",
"Your luck will run out soon enough."
}
local killTargetDialogue = {
"Another soul for the taking!",
"Your life is mine!",
"You were no match for me!",
"Your death was inevitable."
"Your life serves the Scourge now!",
"You never stood a chance against the Scourge!",
"Your death only strengthens our ranks."
}
local deathDialogue = {
@@ -42,16 +41,21 @@ local deathDialogue = {
}
function UndeadWarlord.OnEnterCombat(event, creature, target)
if math.random(100) <= 40 then
local randomDialogue = enterCombatDialogue[math.random(4)]
creature:SendUnitYell(randomDialogue, 0)
creature:RegisterEvent(CastShadowStrike, 5000, 0)
creature:RegisterEvent(CastFear, 7000, 0)
creature:RegisterEvent(CastSummonSkeleton, 15000, 0)
end
creature:RegisterEvent(CastShadowStrike, math.random(7000, 9000), 0)
creature:RegisterEvent(CastFear, math.random(9500, 13000), 0)
creature:RegisterEvent(CastSummonSkeleton, math.random(13500, 17000), 0)
end
function UndeadWarlord.OnLeaveCombat(event, creature)
if math.random(100) <= 40 then
local randomDialogue = leaveCombatDialogue[math.random(4)]
creature:SendUnitYell(randomDialogue, 0)
end
creature:RemoveEvents()
end
@@ -60,12 +64,15 @@ function UndeadWarlord.OnKilledTarget(event, creature, victim)
creature:SendUnitYell(randomDialogue, 0)
end
function UndeadWarlord.OnDied(event, creature, killer)
local randomDialogue = deathDialogue[math.random(4)]
creature:SendUnitYell(randomDialogue, 0)
creature:CastSpell(creature, 100202, true)
creature:RemoveEvents()
end
function UndeadWarlord.OnSpawn(event, creature)
creature:SetMaxHealth(48420)
creature:CastSpell(creature:GetVictim(), 17683, true)
@@ -78,10 +85,11 @@ creature:RegisterEvent(function (eventId, delay, calls, creature)
end, 15000, 0)
end
RegisterCreatureEvent(300018, 1, UndeadWarlord.OnEnterCombat)
RegisterCreatureEvent(300018, 2, UndeadWarlord.OnLeaveCombat)
RegisterCreatureEvent(300018, 3, UndeadWarlord.OnKilledTarget)
RegisterCreatureEvent(300018, 4, UndeadWarlord.OnDied)
RegisterCreatureEvent(300018, 5, UndeadWarlord.OnSpawn)

View File

@@ -11,7 +11,7 @@ player:SendBroadcastMessage("You need to place the barrier in a more strategic l
spell:Cancel()
else
player:KilledMonsterCredit(killCreditNpcId)
player:SendBroadcastMessage("You have successfully placed the barrier and received kill credit for NPC " .. killCreditNpcId .. ".")
player:SendBroadcastMessage("You have successfully built a barrier!")
end
end
end

38
DarionTur.lua Normal file
View File

@@ -0,0 +1,38 @@
local CustomCreature = {}
local NPC_ID = 400081
local MAX_HEALTH = 8432 -- Set the desired max health value
local ABILITY_1 = 16856
local ABILITY_2 = 676
function CustomCreature.OnSpawn(event, creature)
creature:SetMaxHealth(MAX_HEALTH)
creature:SetHealth(MAX_HEALTH)
end
function CustomCreature.OnCombat(event, creature, target)
creature:RegisterEvent(CustomCreature.Ability1, 7000, 0)
creature:RegisterEvent(CustomCreature.Ability2, 22000, 0)
end
function CustomCreature.Ability1(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), ABILITY_1, true)
end
function CustomCreature.Ability2(event, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), ABILITY_2, true)
end
function CustomCreature.OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
function CustomCreature.OnDeath(event, creature, killer)
creature:RemoveEvents()
end
RegisterCreatureEvent(NPC_ID, 5, CustomCreature.OnSpawn)
RegisterCreatureEvent(NPC_ID, 1, CustomCreature.OnCombat)
RegisterCreatureEvent(NPC_ID, 2, CustomCreature.OnLeaveCombat)
RegisterCreatureEvent(NPC_ID, 4, CustomCreature.OnDeath)

8
DarionTur2.lua Normal file
View File

@@ -0,0 +1,8 @@
local NPC_ID_DAMION_TUR = 400079
local SOUND_ID = 20436
local function OnDamionTurSpawn(event, creature)
creature:PlayDirectSound(SOUND_ID)
end
RegisterCreatureEvent(NPC_ID_DAMION_TUR, 5, OnDamionTurSpawn)

View File

@@ -0,0 +1,20 @@
local GAME_EVENT_ID = 17 -- Set the game event ID
local npcIds = {344, 12480, 1284, 400064, 234} -- Add your NPC entries here
local function DespawnAndRespawnNpcs(event, gameEventId)
if gameEventId == GAME_EVENT_ID then
local players = GetPlayersInWorld() -- Get all players in the world
for _, player in ipairs(players) do
for _, npcId in ipairs(npcIds) do
local npcs = player:GetCreaturesInRange(1000, npcId) -- Get creatures within a radius of 1000 units from the player
for _, npc in ipairs(npcs) do
npc:DespawnOrUnsummon()
npc:Respawn()
end
end
end
end
end
RegisterServerEvent(34, DespawnAndRespawnNpcs) -- Game Event Start
RegisterServerEvent(35, DespawnAndRespawnNpcs) -- Game Event End

View File

@@ -3,13 +3,18 @@ local REQUIRED_QUEST_ID = 30011
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
creature:MoveWaypoint()
@@ -53,13 +58,18 @@ local NPC_ENTRY2 = 400082
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
creature:MoveWaypoint()
@@ -102,13 +112,18 @@ local NPC_ENTRY3 = 400083
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
creature:MoveWaypoint()
@@ -151,13 +166,18 @@ local NPC_ENTRY4 = 400084
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
creature:MoveWaypoint()
@@ -200,13 +220,18 @@ local NPC_ENTRY5 = 400085
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
creature:MoveWaypoint()
@@ -249,13 +274,18 @@ local NPC_ENTRY6 = 400086
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
creature:MoveWaypoint()
@@ -298,13 +328,18 @@ local NPC_ENTRY7 = 400087
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
creature:MoveWaypoint()
@@ -347,13 +382,18 @@ local NPC_ENTRY8 = 400088
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
creature:MoveWaypoint()
@@ -396,13 +436,18 @@ local NPC_ENTRY9 = 400089
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
creature:MoveWaypoint()
@@ -438,3 +483,77 @@ RegisterCreatureGossipEvent(NPC_ENTRY9, 1, OnGossipHello)
RegisterCreatureGossipEvent(NPC_ENTRY9, 2, OnGossipSelect)
RegisterCreatureEvent(NPC_ENTRY9, 5, OnSpawn)
RegisterCreatureEvent(NPC_ENTRY9, 3, OnDeath)
local NPC_ENTRY10 = 849
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
player:GossipComplete()
player:KilledMonsterCredit(NPC_ENTRY1)
local random = math.random(0, 4)
if random == 0 then
creature:SendUnitSay("Mommmmy!!!!", 0)
elseif random == 1 then
creature:SendUnitSay("But I wanted to go play with Sally...", 0)
elseif random == 2 then
creature:SendUnitSay("Really? Stay indoors? How boring...", 0)
elseif random == 3 then
creature:SendUnitSay("Darn those yucky Scourge...", 0)
else
creature:SendUnitSay("Awww, no fun!", 0)
end
creature:DespawnOrUnsummon(1000) -- Despawn after 2 seconds (2000 milliseconds)
end
end
RegisterCreatureGossipEvent(NPC_ENTRY10, 1, OnGossipHello)
RegisterCreatureGossipEvent(NPC_ENTRY10, 2, OnGossipSelect)
local NPC_ENTRY11 = 848
local function OnGossipHello(event, player, creature)
if not player:HasQuest(REQUIRED_QUEST_ID) then
if player:HasQuestFailed(REQUIRED_QUEST_ID) then
player:SendBroadcastMessage("Your time ran out, and you have failed this quest...")
else
player:SendBroadcastMessage("You must be on a certain quest to interact with this person.")
end
return
end
player:GossipMenuAddItem(0, "The scourge are coming! Please head to the inn!", 0, 1)
player:GossipSendMenu(1, creature)
end
local function OnGossipSelect(event, player, creature, sender, intid, code)
if (intid == 1) then
player:GossipComplete()
player:KilledMonsterCredit(NPC_ENTRY1)
local random = math.random(0, 4)
if random == 0 then
creature:SendUnitSay("Mommmmy!!!!", 0)
elseif random == 1 then
creature:SendUnitSay("But I wanted to go play with Sally...", 0)
elseif random == 2 then
creature:SendUnitSay("Really? Stay indoors? How boring...", 0)
elseif random == 3 then
creature:SendUnitSay("Darn those yucky Scourge...", 0)
else
creature:SendUnitSay("Awww, no fun!", 0)
end
creature:DespawnOrUnsummon(1000) -- Despawn after 2 seconds (2000 milliseconds)
end
end
RegisterCreatureGossipEvent(NPC_ENTRY11, 1, OnGossipHello)
RegisterCreatureGossipEvent(NPC_ENTRY11, 2, OnGossipSelect)

30
LakeshireLoremaster1.lua Normal file
View File

@@ -0,0 +1,30 @@
-- Creature ID for the creature that gives the quests
local CREATURE_ID = 400096
-- Quest and sound IDs for the quests that should trigger the sounds
local QUEST_ACCEPT = {
[30015] = 20439,
[30016] = 20441
}
local QUEST_COMPLETE = {
[30014] = 20438,
[30015] = 20440,
[30016] = 20442
}
-- Register the event for quest accept
RegisterCreatureEvent(CREATURE_ID, 31, function(event, player, creature, quest)
local soundID = QUEST_ACCEPT[quest:GetId()]
if soundID then
player:PlayDistanceSound(soundID)
end
end)
-- Register the event for quest reward
RegisterCreatureEvent(CREATURE_ID, 34, function(event, player, creature, quest)
local soundID = QUEST_COMPLETE[quest:GetId()]
if soundID then
creature:PlayDistanceSound(soundID)
end
end)