Skip to content

Commit

Permalink
The Ape City - Quest
Browse files Browse the repository at this point in the history
Everything was excellent and the same, with the exception of the mission Mission 07: Destroying Casks where I couldn't put the script with the rules: floor reset (~3-5 minutes) for the casks and I couldn't even put it to use the crowbar in a of each cask, because currently if you hit only 1 in a total of 3 times you will get the storage, however this is outside the rule, perhaps someone more qualified can someday make this perfectly.
  • Loading branch information
htc16 committed Jul 4, 2024
1 parent 34c5ba6 commit 152b786
Show file tree
Hide file tree
Showing 19 changed files with 350 additions and 146 deletions.
4 changes: 2 additions & 2 deletions data-otservbr-global/lib/core/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2837,12 +2837,12 @@ if not Quests then
},
[17] = {
name = "The Ape City",
startStorageId = Storage.TheApeCity.Started,
startStorageId = Storage.Quest.U7_6.TheApeCity.Started,
startStorageValue = 1,
missions = {
[1] = {
name = "Hairycles' Missions",
storageId = Storage.TheApeCity.Questline,
storageId = Storage.Quest.U7_6.TheApeCity.Questline,
missionId = 10217,
startValue = 1,
endValue = 18,
Expand Down
35 changes: 19 additions & 16 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -863,21 +863,6 @@ Storage = {
SecondOrientalAddon = 51025,
RoyalCostumeOutfit = 51026,
},
TheApeCity = {
-- Reserved storage from 51060 - 51079
Started = 51060,
Questline = 51061,
DworcDoor = 51062,
ChorDoor = 51063,
ParchmentDecyphering = 51064,
FibulaDoor = 51065,
WitchesCapSpot = 51066,
CasksDoor = 51067,
Casks = 51068,
HolyApeHair = 51069,
SnakeDestroyer = 51070,
ShamanOufit = 51071,
},
TheInquisition = {
-- Reserved storage from 51110 - 51139
Questline = 51110,
Expand Down Expand Up @@ -2011,7 +1996,25 @@ Storage = {
},
U7_6 = { -- update 7.6 - Reserved Storages 40611 - 40760
HydraEggQuest = 40611,
TheApeCity = {},
TheApeCity = {
Started = 40612,
Questline = 40613,
DworcDoor = 40614,
ChorDoor = 40615,
ParchmentDecyphering = 40616,
FibulaDoor = 40617,
WitchesCapSpot = 40618,
CasksDoor = 40619,
Casks = 40620,
HolyApeHair = 40621,
SnakeDestroyer = 40622,
ShamanOufit = 40623,
TheLargeAmphoras1 = 40624,
TheLargeAmphoras2 = 40625,
TheLargeAmphoras3 = 40626,
TheLargeAmphoras4 = 40627,
TheLargeAmphorasCooldown = 40628,
},
TheExplorerSociety = {},
},
U7_8 = { -- update 7.8 - Reserved Storages 40761 - 41000
Expand Down
17 changes: 17 additions & 0 deletions data-otservbr-global/npc/brewster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ 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, "cough syrup") then
npcHandler:say("The only person who might have some cough syrup is this druid Ustan. You find him in the tavern. Hmmm the tavern ... <hicks>", npc, creature)
end

return true
end

-- Twist of Fate
local blessKeyword = keywordHandler:addKeyword({ "twist of fate" }, StdModule.say, {
npcHandler = npcHandler,
Expand Down Expand Up @@ -171,6 +186,8 @@ npcHandler:setMessage(MESSAGE_GREET, "Welcome, young |PLAYERNAME|! If you are he
npcHandler:setMessage(MESSAGE_WALKAWAY, "Remember: If you are heavily wounded or poisoned, I can heal you for free.")
npcHandler:setMessage(MESSAGE_FAREWELL, "May the gods bless you, |PLAYERNAME|!")

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
Expand Down
70 changes: 35 additions & 35 deletions data-otservbr-global/npc/hairycles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ end

local function greetCallback(npc, creature)
local playerId = creature:getId()
if Player(creature):getStorageValue(Storage.TheApeCity.Questline) < 12 then
npcHandler:setMessage(MESSAGE_GREET, "Oh! Hello! Hello! Did not notice! So {busy}.")
if Player(creature):getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) < 12 then
npcHandler:setMessage(MESSAGE_GREET, "Oh! Hello! Hello! Did not notice!")
else
npcHandler:setMessage(MESSAGE_GREET, "Be greeted, friend of the ape people. If you want to {trade}, just ask for my offers. If you are injured, ask for healing.")
end
Expand All @@ -77,7 +77,7 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end

local questProgress = player:getStorageValue(Storage.TheApeCity.Questline)
local questProgress = player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline)
if MsgContains(message, "mission") then
if questProgress < 1 then
npcHandler:say("These are dire times for our people. Problems plenty are in this times. But me people not grant trust easy. Are you willing to prove you friend of ape people?", npc, creature)
Expand All @@ -94,7 +94,7 @@ local function creatureSayCallback(npc, creature, type, message)
"Whisper moss strong is, but me need liquid that humans have to make it work ...",
"Our raiders brought it from human settlement, it's called cough syrup. Go ask healer there for it.",
}, npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 3)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 3)
elseif questProgress == 3 then
npcHandler:say("You brought me that cough syrup from human healer me asked for?", npc, creature)
npcHandler:setTopic(playerId, 4)
Expand All @@ -114,7 +114,7 @@ local function creatureSayCallback(npc, creature, type, message)
}, npc, creature)
npcHandler:setTopic(playerId, 8)
elseif questProgress == 7 then
if player:getStorageValue(Storage.TheApeCity.ParchmentDecyphering) == 1 then
if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.ParchmentDecyphering) == 1 then
npcHandler:say("Ah yes, you read the signs in tomb? Good! May me look into your mind to see what you saw?", npc, creature)
npcHandler:setTopic(playerId, 9)
else
Expand Down Expand Up @@ -147,9 +147,9 @@ local function creatureSayCallback(npc, creature, type, message)
}, npc, creature)
npcHandler:setTopic(playerId, 14)
elseif questProgress == 13 then
if player:getStorageValue(Storage.TheApeCity.Casks) == 3 then
if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.Casks) == 3 then
npcHandler:say("You do please Hairycles again, friend. Me hope madness will not spread further now. Perhaps you are ready for other mission.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 14)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 14)
else
npcHandler:say("Please destroy three casks in the complex beneath Banuta, so my people will come to senses again.", npc, creature)
end
Expand All @@ -165,7 +165,7 @@ local function creatureSayCallback(npc, creature, type, message)
}, npc, creature)
npcHandler:setTopic(playerId, 15)
elseif questProgress == 15 then
if player:getStorageValue(Storage.TheApeCity.HolyApeHair) == 1 then
if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.HolyApeHair) == 1 then
npcHandler:say("You brought hair of holy ape?", npc, creature)
npcHandler:setTopic(playerId, 16)
else
Expand All @@ -180,13 +180,13 @@ local function creatureSayCallback(npc, creature, type, message)
}, npc, creature)
npcHandler:setTopic(playerId, 17)
elseif questProgress == 17 then
if player:getStorageValue(Storage.TheApeCity.SnakeDestroyer) == 1 then
if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.SnakeDestroyer) == 1 then
npcHandler:say({
"Finally my people are safe! You have done incredible good for ape people and one day even me brethren will recognise that. ...",
"I wish I could speak for all when me call you true friend but my people need time to get accustomed to change. ...",
"Let us hope one day whole Banuta will greet you as a friend. Perhaps you want to check me offers for special friends... or shamanic powers.",
}, npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 18)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 18)
player:addAchievement("Friend of the Apes")
else
npcHandler:say("Me know its much me asked for but go into the deepest catacombs under Banuta and destroy the monument of the serpent god.", npc, creature)
Expand All @@ -206,7 +206,7 @@ local function creatureSayCallback(npc, creature, type, message)
end
elseif MsgContains(message, "outfit") or MsgContains(message, "shamanic") then
if questProgress == 18 then
if player:getStorageValue(Storage.TheApeCity.ShamanOutfit) ~= 1 then
if player:getStorageValue(Storage.Quest.U7_6.TheApeCity.ShamanOutfit) ~= 1 then
npcHandler:say("Me truly proud of you, friend. You learn many about plants, charms and ape people. Me want grant you shamanic power now. You ready?", npc, creature)
npcHandler:setTopic(playerId, 18)
else
Expand Down Expand Up @@ -249,9 +249,9 @@ local function creatureSayCallback(npc, creature, type, message)
"Me know they hoard some in their underground lair. My people raided dworcs often before humans came. So we know the moss is hidden in east of upper level of dworc lair ...",
"You go there and take good moss from evil dworcs. Talk with me about mission when having moss.",
}, npc, creature)
player:setStorageValue(Storage.TheApeCity.Started, 1)
player:setStorageValue(Storage.TheApeCity.Questline, 1)
player:setStorageValue(Storage.TheApeCity.DworcDoor, 1)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Started, 1)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 1)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.DworcDoor, 1)
elseif MsgContains(message, "no") then
npcHandler:say("Hairycles thought better of you.", npc, creature)
addEvent(function()
Expand All @@ -268,7 +268,7 @@ local function creatureSayCallback(npc, creature, type, message)
end

npcHandler:say("Ah yes! That's it. Thank you for bringing mighty whisper moss to Hairycles. It will help but still much is to be done. Just ask for other mission if you ready.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 2)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 2)
elseif MsgContains(message, "no") then
npcHandler:say("Strange being you are! Our people need help!", npc, creature)
end
Expand All @@ -281,7 +281,7 @@ local function creatureSayCallback(npc, creature, type, message)
end

npcHandler:say("You so good! Brought syrup to me! Thank you, will prepare cure now. Just ask for {mission} if you want help again.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 4)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 4)
elseif MsgContains(message, "no") then
npcHandler:say("Please hurry, urgent it is!", npc, creature)
end
Expand All @@ -304,8 +304,8 @@ local function creatureSayCallback(npc, creature, type, message)
elseif npcHandler:getTopic(playerId) == 6 then
if MsgContains(message, "yes") then
npcHandler:say("Good thing that is! Report about your mission when have scroll.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 5)
player:setStorageValue(Storage.TheApeCity.ChorDoor, 1)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 5)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.ChorDoor, 1)
elseif MsgContains(message, "no") then
npcHandler:say("Me sad. Me expected better from you!", npc, creature)
addEvent(function()
Expand All @@ -325,15 +325,15 @@ local function creatureSayCallback(npc, creature, type, message)
end

npcHandler:say("You brought scroll with lizard text? Good! I will see what text tells me! Come back when ready for other mission.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 6)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 6)
elseif MsgContains(message, "no") then
npcHandler:say("That's bad news. If you lost it, only way to get other is to kill holy serpents. But you can't go there so you must ask adventurers who can.", npc, creature)
end
npcHandler:setTopic(playerId, 0)
elseif npcHandler:getTopic(playerId) == 8 then
if MsgContains(message, "yes") then
npcHandler:say("Good thing that is! Report about mission when you have read those signs.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 7)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 7)
elseif MsgContains(message, "no") then
npcHandler:say("Me sad. Me expected better from you!", npc, creature)
addEvent(function()
Expand All @@ -344,7 +344,7 @@ local function creatureSayCallback(npc, creature, type, message)
elseif npcHandler:getTopic(playerId) == 9 then
if MsgContains(message, "yes") then
npcHandler:say("Oh, so clear is all now! Easy it will be to read the signs now! Soon we will know what to do! Thank you again! Ask for mission if you feel ready.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 8)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 8)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
elseif MsgContains(message, "no") then
npcHandler:say("Me need to see it in your mind, other there is no way to proceed.", npc, creature)
Expand All @@ -353,7 +353,7 @@ local function creatureSayCallback(npc, creature, type, message)
elseif npcHandler:getTopic(playerId) == 10 then
if MsgContains(message, "yes") then
npcHandler:say("You brave hairless ape! Get me hydra egg. If you lose egg, you probably have to fight many, many hydras to get another.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 9)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 9)
elseif MsgContains(message, "no") then
npcHandler:say("Me sad. Me expected better from you!", npc, creature)
addEvent(function()
Expand All @@ -369,16 +369,16 @@ local function creatureSayCallback(npc, creature, type, message)
end

npcHandler:say("Ah, the egg! Mighty warrior you be! Thank you. Hairycles will put it at safe place immediately.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 10)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 10)
elseif MsgContains(message, "no") then
npcHandler:say("Please hurry. Hairycles not knows when evil lizards strike again.", npc, creature)
end
npcHandler:setTopic(playerId, 0)
elseif npcHandler:getTopic(playerId) == 12 then
if MsgContains(message, "yes") then
npcHandler:say("Long journey it will take, good luck to you.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 11)
player:setStorageValue(Storage.TheApeCity.FibulaDoor, 1)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 11)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.FibulaDoor, 1)
elseif MsgContains(message, "no") then
npcHandler:say("Me sad. Me expected better from you!", npc, creature)
addEvent(function()
Expand All @@ -394,8 +394,8 @@ local function creatureSayCallback(npc, creature, type, message)
end

npcHandler:say("Incredible, you brought a witches' cap! Now me can prepare mighty charm of life. Yet still other {missions} will await you, friend.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 12)
player:setStorageValue(Storage.TheApeCity.FibulaDoor, -1)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 12)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.FibulaDoor, -1)
elseif MsgContains(message, "no") then
npcHandler:say("Please try to find me a witches' cap on Fibula.", npc, creature)
addEvent(function()
Expand All @@ -406,16 +406,16 @@ local function creatureSayCallback(npc, creature, type, message)
elseif npcHandler:getTopic(playerId) == 14 then
if MsgContains(message, "yes") then
npcHandler:say("Hairycles sure you will make it. Good luck, friend.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 13)
player:setStorageValue(Storage.TheApeCity.CasksDoor, 1)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 13)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.CasksDoor, 1)
elseif MsgContains(message, "no") then
npcHandler:say("Me sad. Please reconsider.", npc, creature)
end
npcHandler:setTopic(playerId, 0)
elseif npcHandler:getTopic(playerId) == 15 then
if MsgContains(message, "yes") then
npcHandler:say("Hairycles proud of you. Go and find holy hair. Good luck, friend.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 15)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 15)
elseif MsgContains(message, "no") then
npcHandler:say("Me sad. Please reconsider.", npc, creature)
end
Expand All @@ -424,20 +424,20 @@ local function creatureSayCallback(npc, creature, type, message)
if MsgContains(message, "yes") then
if not player:removeItem(4832, 1) then
npcHandler:say("You no have hair. You lost it? Go and look again.", npc, creature)
player:setStorageValue(Storage.TheApeCity.HolyApeHair, -1)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.HolyApeHair, -1)
return true
end

npcHandler:say("Incredible! You got a hair of holy Bong! This will raise the spirit of my people. You are truly a friend. But one last mission awaits you.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 16)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 16)
elseif MsgContains(message, "no") then
npcHandler:say("You no have hair. You lost it? Go and look again.", npc, creature)
end
npcHandler:setTopic(playerId, 0)
elseif npcHandler:getTopic(playerId) == 17 then
if MsgContains(message, "yes") then
npcHandler:say("Hairycles sure you will make it. Just use hammer on all that looks like snake or lizard. Tell Hairycles if you succeed with mission.", npc, creature)
player:setStorageValue(Storage.TheApeCity.Questline, 17)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.Questline, 17)
player:addItem(4835, 1)
elseif MsgContains(message, "no") then
npcHandler:say("Me sad. Please reconsider.", npc, creature)
Expand All @@ -448,7 +448,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("Friend of the ape people! Take my gift and become me apprentice! Here is shaman clothing for you!", npc, creature)
player:addOutfit(154)
player:addOutfit(158)
player:setStorageValue(Storage.TheApeCity.ShamanOutfit, 1)
player:setStorageValue(Storage.Quest.U7_6.TheApeCity.ShamanOutfit, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
elseif MsgContains(message, "no") then
npcHandler:say("Come back if change mind.", npc, creature)
Expand Down Expand Up @@ -490,7 +490,7 @@ keywordHandler:addKeyword({ "magic" }, StdModule.say, { npcHandler = npcHandler,
keywordHandler:addKeyword({ "jungle" }, StdModule.say, { npcHandler = npcHandler, text = "Jungle is dangerous. Jungle also provides us food. Take care when in jungle and safe you be." })

local function onTradeRequest(npc, creature)
if Player(creature):getStorageValue(Storage.TheApeCity.Questline) < 18 then
if Player(creature):getStorageValue(Storage.Quest.U7_6.TheApeCity.Questline) < 18 then
return false
end

Expand Down
Loading

0 comments on commit 152b786

Please sign in to comment.