Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Fix Warzones I, II & III #780

Merged
merged 17 commits into from
Sep 5, 2022
Merged
3 changes: 2 additions & 1 deletion data/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,8 @@ Storage = {
DoorGoldenFruits = 50706,
BossWarzone1 = 50707,
BossWarzone2 = 50708,
BossWarzone3 = 50709
BossWarzone3 = 50709,
GnomedixMsg = 50710
},
TheirMastersVoice = {
-- Reserved storage from 50720 - 50739
Expand Down
19 changes: 10 additions & 9 deletions data/npc/commander_stone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ local function creatureSayCallback(npc, creature, type, message)
end


if(MsgContains(message, "mission")) then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 25 then
if(MsgContains(message, "mission") and player:getStorageValue(Storage.BigfootBurden.QuestLineComplete) >= 2) then
if player:getStorageValue(Storage.BigfootBurden.Rank) < 30 then
npcHandler:say({"Two missions are available for your {rank}: crystal {keeper} and {spark} hunting. You can undertake each mission but you can turn in a specific mission only once each 20 hours. ...",
"If you lose a mission item you can probably buy it from Gnomally."}, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 26 then
elseif player:getStorageValue(Storage.BigfootBurden.Rank) >= 30 then
npcHandler:say({"For your {rank} there are four missions avaliable: crystal {keeper}, {spark} hunting, monster {extermination} and mushroom {digging}. By the way, you {rank} now allows you to take aditional missions from {Gnomeral} in {Gnomebase Alpha}. ... ", "If you lose a mission item you can probably buy it from Gnomally."}, npc, creature)
npcHandler:setTopic(playerId, 0)
end

-- Crystal Kepper
elseif MsgContains(message, "keeper") then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 25 then
if player:getStorageValue(Storage.BigfootBurden.Rank) < 30 then
if player:getStorageValue(Storage.BigfootBurden.MissionCrystalKeeper) < 1 and player:getStorageValue(Storage.BigfootBurden.CrystalKeeperTimout) < os.time() then
npcHandler:say("You will have to repair some damaged crystals. Go into the Crystal grounds and repair them, using this harmonic crystal. Repair five of them and return to me. ", npc, creature)
player:setStorageValue(Storage.BigfootBurden.MissionCrystalKeeper, 1)
Expand Down Expand Up @@ -108,7 +108,7 @@ local function creatureSayCallback(npc, creature, type, message)

-- Raiders of the Lost Spark
elseif MsgContains(message, "spark") then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 25 then
if player:getStorageValue(Storage.BigfootBurden.Rank) < 30 then
if player:getStorageValue(Storage.BigfootBurden.MissionRaidersOfTheLostSpark) < 1 and player:getStorageValue(Storage.BigfootBurden.RaidersOfTheLostSparkTimeout) < os.time() then
npcHandler:say({"Take this extractor and drive it into a body of a slain crystal crusher. This will charge your own body with energy sparks. Charge it with seven sparks and return to me. ...",
"Don't worry. The gnomes assured me you'd be save. That is if nothing strange or unusual occurs! "}, npc, creature)
Expand Down Expand Up @@ -146,7 +146,7 @@ local function creatureSayCallback(npc, creature, type, message)

-- Exterminators
elseif MsgContains(message, "extermination") then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 26 then
if player:getStorageValue(Storage.BigfootBurden.Rank) >= 30 then
if player:getStorageValue(Storage.BigfootBurden.MissionExterminators) < 1 and player:getStorageValue(Storage.BigfootBurden.ExterminatorsTimeout) < os.time() then
npcHandler:say("The wigglers have become a pest that threaten our resources and supplies. Kill 10 wigglers in the caves like the mushroon gardens or the truffles ground. {Report} back to me when you are done. ", npc, creature)
player:setStorageValue(Storage.BigfootBurden.MissionExterminators, 1)
Expand Down Expand Up @@ -181,7 +181,7 @@ local function creatureSayCallback(npc, creature, type, message)

-- Mushroom Digger
elseif MsgContains(message, "digging") then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 26 then
if player:getStorageValue(Storage.BigfootBurden.Rank) >= 30 then
if player:getStorageValue(Storage.BigfootBurden.MissionMushroomDigger) < 1 and player:getStorageValue(Storage.BigfootBurden.MushroomDiggerTimeout) < os.time() then
npcHandler:say({
"Take this little piggy here. It will one day become a great mushroom hunter for sure. For now it is depended on you and other pigs. ...",
Expand Down Expand Up @@ -222,17 +222,18 @@ local function creatureSayCallback(npc, creature, type, message)
-- Mushroom Digger

elseif(MsgContains(message, "report")) then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 25 then
if player:getStorageValue(Storage.BigfootBurden.Rank) < 30 then
npcHandler:say("Which mission do you want to report: crystal {keeper}, {spark} hunting?", npc, creature)
npcHandler:setTopic(playerId, 1)
elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 26 then
elseif player:getStorageValue(Storage.BigfootBurden.Rank) >= 30 then
npcHandler:say("Which mission do you want to report: crystal {keeper}, {spark} hunting, monster {extermination} or mushroom {digging}?", npc, creature)
npcHandler:setTopic(playerId, 2)
end
end
return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hello recruit.')
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

Expand Down
42 changes: 42 additions & 0 deletions data/npc/gnomad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,48 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()

if not npcHandler:checkInteraction(npc, creature) then
return false
end

if (MsgContains(message, "tactical")) then
npcHandler:say(
{"You will encounter quite a lot of beasties in the area ahead of us. The end of the cave-system is where the trouble begins though. The monsters here all serve some massive creature only known as Deathstrike. ...",
"The creature is hidden in a well protected chamber. The good news is, we've managed to erect a crystal structure close to the cave that is able to breach its defence and teleport someone into the chamber. ...",
"The bad new is that the crystals need a specific charge before they can work. As soon as the crystals begin to charge up, Deathstrikes' minions will frenzy and spawn in waves to crush all opposition. ...",
"You will have to kill them quite fast, to not be overwhelmed by their numbers! Our own tries to breach the defence has proven that you'll have to endure six waves until the teleporter to Deathtstrikes' cave opens for a short 30 seconds. ...",
"Use the GREEN command crystal in the cave to begin the charging of the teleport! Good luck."}, npc,
creature)
npcHandler:setTopic(playerId, 0)
elseif (MsgContains(message, "job")) then
npcHandler:say("I'm the gnomish tactical advisor for this area!", npc, creature)
npcHandler:setTopic(playerId, 0)
elseif (MsgContains(message, "crystals")) then
npcHandler:say(
"Ah you are amazed by our crystals, aren't you? Well, you have only seen a tiny fraction of what they are able to do.",
npc, creature)
npcHandler:setTopic(playerId, 0)
elseif (MsgContains(message, "mushrooms")) then
npcHandler:say(
"In the last century mushrooms have become more and more important for producing raw materials and tools and less important for sustenance.",
npc, creature)
npcHandler:setTopic(playerId, 0)
elseif (MsgContains(message, "gnomes")) then
npcHandler:say(
"We gnomes are masters of growing and working crystals and we also mastered the raising of a variety of mushrooms for different purposes.",
npc, creature)
npcHandler:setTopic(playerId, 0)
end
return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hi there! I\'m ready to brief you with {tactical} advice.')
murilo09 marked this conversation as resolved.
Show resolved Hide resolved
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye and take care!")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
Expand Down
8 changes: 2 additions & 6 deletions data/npc/gnomaticus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,13 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end


if MsgContains(message, "again") then
player:setStorageValue(Storage.BigfootBurden.QuestLine, 19)
end

if MsgContains(message, "shooting") then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 11 then
npcHandler:say({
"To the left you see our shooting range. Grab a cannon and shoot at the targets. You need five hits to succeed. ...",
"Shoot at the villain targets that will pop up. DON'T shoot innocent civilians since this will reset your score and you have to start all over. Report to me afterwards."
}, npc, creature)
player:setStorageValue(Storage.BigfootBurden.QuestLine, 13) -- tirar do questlog
player:setStorageValue(Storage.BigfootBurden.QuestLine, 13)
player:setStorageValue(Storage.BigfootBurden.Shooting, 0)
elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 13 then
npcHandler:say("Shoot at the villain targets that will pop up. DON'T shoot innocent civilians since this will reset your score and you have to start all over. {Report} to me afterwards.", npc, creature)
Expand All @@ -88,6 +83,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hi there! Are you here for the {shooting} test or to {report} your success?')
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

Expand Down
5 changes: 3 additions & 2 deletions data/npc/gnomelvis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ local function creatureSayCallback(npc, creature, type, message)
player:setStorageValue(Storage.BigfootBurden.MelodyStatus, 1)
if player:getStorageValue(Storage.BigfootBurden.MelodyTone1) < 1 then
for i = 0, 6 do
player:setStorageValue(Storage.BigfootBurden.MelodyTone1 + i, math.random(3124, 3127))
player:setStorageValue(Storage.BigfootBurden.MelodyTone1 + i, math.random(1, 4))
end
end
elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 21 then
Expand All @@ -99,8 +99,9 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hello. Is it me you\'re {looking} for?')
murilo09 marked this conversation as resolved.
Show resolved Hide resolved
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
npcType:register(npcConfig)
28 changes: 17 additions & 11 deletions data/npc/gnomeral.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ npcConfig.walkInterval = 1000
npcConfig.walkRadius = 2

npcConfig.outfit = {
lookType = 493
lookType = 493,
lookHead = 78,
lookBody = 57,
lookLegs = 78,
lookFeet = 76,
lookAddons = 0
}

npcConfig.flags = {
Expand Down Expand Up @@ -57,18 +62,18 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end

if(MsgContains(message, "mission")) then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 27 then
if(MsgContains(message, "mission") and player:getStorageValue(Storage.BigfootBurden.QuestLineComplete) >= 2) then
if player:getStorageValue(Storage.BigfootBurden.Rank) >= 120 and player:getStorageValue(Storage.BigfootBurden.Rank) < 480 then
npcHandler:say("For your rank there are two missions available: {matchmaker} and golem {repair}. You can undertake each mission, but you can turn in a specific mission only once every 20 hours. ", npc, creature)
npcHandler:setTopic(playerId, 0)
elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 28 then
elseif player:getStorageValue(Storage.BigfootBurden.Rank) >= 480 then
npcHandler:say("For your rank there are four missions available: {matchmaker}, golem {repair}, {spore} gathering and {grindstone} hunt. You can undertake each mission, but you can turn in a specific mission only once every 20 hours.", npc, creature)
npcHandler:setTopic(playerId, 0)
end

-- Matchmaker
elseif MsgContains(message, "matchmaker") then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 27 then
if player:getStorageValue(Storage.BigfootBurden.Rank) >= 120 then
if player:getStorageValue(Storage.BigfootBurden.MissionMatchmaker) < 1 and player:getStorageValue(Storage.BigfootBurden.MatchmakerTimeout) < os.time() then
npcHandler:say({
"You will have to find a lonely crystal a perfect match. I don't understand the specifics but the gnomes told me that even crystals need a mate to produce offspring. ...",
Expand All @@ -77,7 +82,7 @@ local function creatureSayCallback(npc, creature, type, message)
}, npc, creature)
player:setStorageValue(Storage.BigfootBurden.MissionMatchmaker, 1)
player:setStorageValue(Storage.BigfootBurden.MatchmakerStatus, 0)
player:setStorageValue(Storage.BigfootBurden.MatchmakerIdNeeded, math.random(18320, 18326))
player:setStorageValue(Storage.BigfootBurden.MatchmakerIdNeeded, math.random(15809, 15815))
murilo09 marked this conversation as resolved.
Show resolved Hide resolved
player:addItem(15802, 1) --- taking missions
elseif player:getStorageValue(Storage.BigfootBurden.MatchmakerTimeout) > os.time() then -- trying to take mission while in cooldown
npcHandler:say("Sorry, you will have to wait before you can undertake this mission again.", npc, creature)
Expand Down Expand Up @@ -110,7 +115,7 @@ local function creatureSayCallback(npc, creature, type, message)

-- Golem Repair
elseif MsgContains(message, "repair") then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 27 then
if player:getStorageValue(Storage.BigfootBurden.Rank) >= 120 then
if player:getStorageValue(Storage.BigfootBurden.MissionTinkersBell) < 1 and player:getStorageValue(Storage.BigfootBurden.TinkerBellTimeout) < os.time() then
npcHandler:say("Our gnomish crystal golems sometimes go nuts. A recent earthquake has disrupted the entire production of a golem factory. ... ", npc, creature)
npcHandler:say({
Expand Down Expand Up @@ -152,7 +157,7 @@ local function creatureSayCallback(npc, creature, type, message)

-- Spore Gathering
elseif MsgContains(message, "spore") then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 28 then
if player:getStorageValue(Storage.BigfootBurden.Rank) >= 480 then
if player:getStorageValue(Storage.BigfootBurden.MissionSporeGathering) < 1 and player:getStorageValue(Storage.BigfootBurden.SporeGatheringTimeout) < os.time() then
npcHandler:say({
"We gnomes want you to gather a special collection of spores. All you have to do is use a puffball mushroom and use the spore gathering kit I gave you to gather the spores. ...",
Expand Down Expand Up @@ -194,7 +199,7 @@ local function creatureSayCallback(npc, creature, type, message)

-- Grindstone Hunt
elseif MsgContains(message, "grindstone") then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 28 then
if player:getStorageValue(Storage.BigfootBurden.Rank) >= 480 then
if player:getStorageValue(Storage.BigfootBurden.MissionGrindstoneHunt) < 1 and player:getStorageValue(Storage.BigfootBurden.GrindstoneTimeout) < os.time() then
npcHandler:say({
"We gnomes need some special grindstones to cut and polish specific crystals. The thing is, they can only be found in a quite dangerous lava cave full of vile monsters. You'll reach it via the hot spot teleporter. ...",
Expand Down Expand Up @@ -233,17 +238,18 @@ local function creatureSayCallback(npc, creature, type, message)
-- Grindstone Hunt

elseif(MsgContains(message, "report")) then
if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 27 then
if player:getStorageValue(Storage.BigfootBurden.Rank) >= 120 and player:getStorageValue(Storage.BigfootBurden.Rank) < 480 then
npcHandler:say("Which mission do you want to report: {matchmaker}, golem {repair}?", npc, creature)
npcHandler:setTopic(playerId, 1)
elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 28 then
elseif player:getStorageValue(Storage.BigfootBurden.Rank) >= 480 then
npcHandler:say("Which mission do you want to report: {matchmaker}, golem {repair}, {spore} gathering or {grindstone} hunt?", npc, creature)
npcHandler:setTopic(playerId, 2)
end
end
return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hello there recruit!')
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

Expand Down
28 changes: 28 additions & 0 deletions data/npc/gnomercy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,34 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()

if not npcHandler:checkInteraction(npc, creature) then
return false
end

if (MsgContains(message, "tactical")) then
npcHandler:say(
{"With your help and efforts we finally cornered what we think is one of 'those below'! For all you have done and endured you are granted the privilege to be one of the first to fight the true enemy. ...",
"For all we know your successes have brought some unrest to our enemies and they sent one of their observers to punish their slaves and force them to more fierce attacks. ...",
"This is our chance to deal the enemy the first blow in this conflict. With reinforcements from Gnomehome we are attacking the troops of the enemy and binding a great deal of their forces in battle. ...",
"Now it is up to you to fight your way to the heart of the enemy's defences and kill the observer. ...",
"Our first tries were met with no success though. The observer has brought with him one of his creatures or lieutenants, the lost call the thing Versperoth. I am not sure if it is a name or a race. ...",
"However Versperoth itself is protected by hoards of minions. Sometimes this thing will withdraw into the ground and let all hell loose in form of its' slaves. ...",
"You'd better be finished with them before Versperoth re-emerges. ...",
"Only when you manage to kill Versperoth, will you be able to enter the portal behind him and face the true evil of the observer. ...",
"Use the GREEN command crystal in the cave to begin the charging of the teleport! Good luck."}, npc,
creature)
npcHandler:setTopic(playerId, 0)
end
return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hi there! I\'m ready to brief you with {tactical} advice.')
murilo09 marked this conversation as resolved.
Show resolved Hide resolved
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye and take care!")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
Expand Down
1 change: 1 addition & 0 deletions data/npc/gnomerik.lua
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hello and welcome in the gnomish {recruitment} office.')
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

Expand Down
1 change: 1 addition & 0 deletions data/npc/gnomespector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hello fearless {recruit}.')
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

Expand Down
1 change: 1 addition & 0 deletions data/npc/gnomewart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Oh! Hi there! I guess you are here for the {endurance} test!')
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

Expand Down
Loading