Skip to content

Commit

Permalink
Wrath of the Emperor Quest
Browse files Browse the repository at this point in the history
This quest was one of the most complex.
  • Loading branch information
htc16 committed Aug 9, 2024
1 parent b3cf001 commit 6232e78
Show file tree
Hide file tree
Showing 43 changed files with 453 additions and 275 deletions.
32 changes: 16 additions & 16 deletions data-otservbr-global/lib/core/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4988,12 +4988,12 @@ if not Quests then
},
[34] = {
name = "Wrath of the Emperor",
startStorageId = Storage.WrathoftheEmperor.Questline,
startStorageId = Storage.Quest.U8_6.WrathOfTheEmperor.Questline,
startStorageValue = 1,
missions = {
[1] = {
name = "Mission 01: Catering the Lions Den",
storageId = Storage.WrathoftheEmperor.Mission01,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission01,
missionId = 10348,
startValue = 1,
endValue = 3,
Expand All @@ -5007,7 +5007,7 @@ if not Quests then
},
[2] = {
name = "Mission 02: First Contact",
storageId = Storage.WrathoftheEmperor.Mission02,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission02,
missionId = 10349,
startValue = 1,
endValue = 3,
Expand All @@ -5022,7 +5022,7 @@ if not Quests then
},
[3] = {
name = "Mission 03: The Keeper",
storageId = Storage.WrathoftheEmperor.Mission03,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission03,
missionId = 10350,
startValue = 1,
endValue = 3,
Expand All @@ -5035,7 +5035,7 @@ if not Quests then
},
[4] = {
name = "Mission 04: Sacrament of the Snake",
storageId = Storage.WrathoftheEmperor.Mission04,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission04,
missionId = 10351,
startValue = 1,
endValue = 3,
Expand All @@ -5051,7 +5051,7 @@ if not Quests then
},
[5] = {
name = "Mission 05: New in Town",
storageId = Storage.WrathoftheEmperor.Mission05,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission05,
missionId = 10352,
startValue = 1,
endValue = 3,
Expand All @@ -5063,27 +5063,27 @@ if not Quests then
},
[6] = {
name = "Mission 06: The Office Job",
storageId = Storage.WrathoftheEmperor.Mission06,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission06,
missionId = 10353,
startValue = 0,
endValue = 4,
endValue = 5,
description = function(player)
return string.format("Kill four Magistrati in the office building. Then report back to Zlak. You have killed %d magistrati so far.", (math.max(player:getStorageValue(Storage.WrathoftheEmperor.Mission06), 0)))
return string.format("Kill four Magistrati in the office building. Then report back to Zlak. You have killed %d magistrati so far.", (math.max(player:getStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.Mission06), 1)))
end,
},
[7] = {
name = "Mission 07: A Noble Cause",
storageId = Storage.WrathoftheEmperor.Mission07,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission07,
missionId = 10354,
startValue = 0,
endValue = 6,
description = function(player)
return string.format("Kill six nobles in the city and report back to Zlak. You have killed %d nobles so far.", (math.max(player:getStorageValue(Storage.WrathoftheEmperor.Mission07), 0)))
return string.format("Kill six nobles in the city and report back to Zlak. You have killed %d nobles so far.", (math.max(player:getStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.Mission07), 0)))
end,
},
[8] = {
name = "Mission 08: Uninvited Guests",
storageId = Storage.WrathoftheEmperor.Mission08,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission08,
missionId = 10355,
startValue = 1,
endValue = 2,
Expand All @@ -5094,7 +5094,7 @@ if not Quests then
},
[9] = {
name = "Mission 09: The Sleeping Dragon",
storageId = Storage.WrathoftheEmperor.Mission09,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission09,
missionId = 10356,
startValue = 1,
endValue = 2,
Expand All @@ -5106,7 +5106,7 @@ if not Quests then
},
[10] = {
name = "Mission 10: A Message of Freedom",
storageId = Storage.WrathoftheEmperor.Mission10,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission10,
missionId = 10357,
startValue = 1,
endValue = 6,
Expand All @@ -5128,7 +5128,7 @@ if not Quests then
},
[11] = {
name = "Mission 11: Payback Time",
storageId = Storage.WrathoftheEmperor.Mission11,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission11,
missionId = 10358,
startValue = 1,
endValue = 2,
Expand All @@ -5140,7 +5140,7 @@ if not Quests then
},
[12] = {
name = "Mission 12: Just Rewards",
storageId = Storage.WrathoftheEmperor.Mission12,
storageId = Storage.Quest.U8_6.WrathOfTheEmperor.Mission12,
missionId = 10359,
startValue = 0,
endValue = 1,
Expand Down
80 changes: 40 additions & 40 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -720,44 +720,6 @@ Storage = {
DeeplingAnchor = 51023,
RoyalCostumeOutfit = 51026,
},
WrathoftheEmperor = {
-- Reserved storage from 51300 - 51339
Questline = 51300,
Mission01 = 51301,
Mission02 = 51302,
Mission03 = 51303,
Mission04 = 51304,
Mission05 = 51305,
Mission06 = 51306,
Mission07 = 51307,
Mission08 = 51308,
Mission09 = 51309,
Mission10 = 51310,
Mission11 = 51311,
Mission12 = 51312,
Message = 51313, --1068
GuardcaughtYou = 51314, --1062
ZumtahStatus = 51315, --1066
PrisonReleaseStatus = 51316, --1067
GhostOfAPriest01 = 51317, --1070
GhostOfAPriest02 = 51318, --1071
GhostOfAPriest03 = 51319, --1072
InterdimensionalPotion = 51320, --1084
BossStatus = 51321, --1090
-- unused platinumReward = 51322,
-- unused backpackReward = 51323,
MainReward = 51324,
TeleportAccess = {
Rebel = 51325,
Zlak = 51326,
Zizzle = 51327,
SleepingDragon = 51328,
InnerSanctum = 51329,
AwarnessEmperor = 51330,
Wote10 = 51331,
BossRoom = 51332,
},
},
Postman = {
-- Reserved storage from 51360 - 51389
Mission01 = 51360,
Expand Down Expand Up @@ -2308,10 +2270,48 @@ Storage = {
},
U8_6 = { -- update 8.6 - Reserved Storages 42951 - 43200
AFathersBurden = {},
AnInterestInBotany = {},
TheSpiritWillGetYou = {},
WayfarerOutfits = {},
WrathOfTheEmperor = {},
WrathOfTheEmperor = {
Questline = 43000,
Mission01 = 43001,
Mission02 = 43002,
Mission03 = 43003,
Mission04 = 43004,
Mission05 = 43005,
Mission06 = 43006,
Mission07 = 43007,
Mission08 = 43008,
Mission09 = 43009,
Mission10 = 43010,
Mission11 = 43011,
Mission12 = 43012,
Message = 43013, --1068
GuardcaughtYou = 43014, --1062
ZumtahStatus = 43015, --1066
PrisonReleaseStatus = 43017, --1067
GhostOfAPriest01 = 43018, --1070
GhostOfAPriest02 = 43019, --1071
GhostOfAPriest03 = 43020, --1072
InterdimensionalPotion = 43021, --1084
BossStatus = 43022, --1090
-- unused platinumReward = 43023,
-- unused backpackReward = 43024,
MainReward = 43025,
TeleportAccess = {
Rebel = 43026,
Zlak = 43027,
Zizzle = 43028,
SleepingDragon = 43029,
InnerSanctum = 43030,
AwarnessEmperor = 43031,
Wote10 = 43032,
BossRoom = 43033,
},
Chest100PlatinumCoins = 43034,
ChestBag = 43035,
ChestItems = 43036,
},
},
U8_61 = { -- update 8.61 - Reserved Storages 43201 - 43230
RiseOfDevovorga = {},
Expand Down
67 changes: 30 additions & 37 deletions data-otservbr-global/npc/a_sleeping_dragon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ end

local function greetCallback(npc, creature)
local playerId = creature:getId()
if Player(creature):getStorageValue(Storage.WrathoftheEmperor.Questline) == 27 then
if Player(creature):getStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.Questline) == 27 then
npcHandler:setMessage(MESSAGE_GREET, "ZzzzZzzZz...chrrr...")
else
npcHandler:setMessage(MESSAGE_GREET, "Greetings, {wayfarer}.")
Expand All @@ -63,8 +63,8 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end

if player:getStorageValue(Storage.WrathoftheEmperor.Questline) == 27 then
if (message == "SOLOSARASATIQUARIUM") and player:getStorageValue(Storage.WrathoftheEmperor.InterdimensionalPotion) == 1 then
if player:getStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.Questline) == 27 then
if (message == "SOLOSARASATIQUARIUM") and player:getStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.InterdimensionalPotion) == 1 then
npcHandler:say({
"Dragon dreams are golden. ...",
"A broad darkness surrounds you as if a heavy curtain is closing before your eyes. After what seems like minutes of floating through emptiness, you get the feeling as if a hole opens in the dark before you. ...",
Expand Down Expand Up @@ -123,25 +123,21 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("You head north passing countless stones in the crimson sea of stones beneath your feet.", npc, creature)
npcHandler:setTopic(playerId, 14)
elseif message:lower() == "use attachment" and npcHandler:getTopic(playerId) == 14 then
npcHandler:say("Avoiding the bright light, you carefully put the attachment on top of the strange socket. ...", npc, creature)
npcHandler:setTopic(playerId, 15)
elseif message:lower() == "take mirror" and npcHandler:getTopic(playerId) == 15 then
npcHandler:say({
"Avoiding the bright light, you carefully put the attachment on top of the strange socket. ...",
"As your eyes adjust to the sudden reduction of brightness, you see the giant wings of the gate before you move to the side. You can also make out something shiny on the ground.",
"You pick the mirror from the ground.",
}, npc, creature)
npcHandler:setTopic(playerId, 15)
elseif message:lower() == "take mirror" and npcHandler:getTopic(playerId) == 15 then
npcHandler:say("You pick the mirror from the ground.", npc, creature)
npcHandler:setTopic(playerId, 16)
elseif message:lower() == "north" and npcHandler:getTopic(playerId) == 16 then
npcHandler:say({
"Your path to the north is open. You pass the gigantic gate wings to your left and right as you advance. After about an hour of travel you hear a slight rustling in the distance. You head further into that direction. ...",
"The rustling gets louder until you come to a small dune. Behind it you find the source of the noise.",
}, npc, creature)
npcHandler:say("Your path to the north is open. You pass the gigantic gate wings to your left and right as you advance. After about an hour of travel you hear a slight rustling in the distance. You head further into that direction. ...", npc, creature)
npcHandler:setTopic(playerId, 17)
elseif message:lower() == "use model" and npcHandler:getTopic(playerId) == 17 then
npcHandler:say({
"You lunge out and throw the model far into the water. As nothing happens, you turn your back to the ocean. ...",
"The very moment you walk down the dune to head back south, rays of light burst over your head in a shock wave that makes you tumble down the rest of the hill. ...",
"You can also hear a deep loud scraping for several minutes somewhere far in the west.",
}, npc, creature)
npcHandler:setTopic(playerId, 18)
elseif message:lower() == "south" and npcHandler:getTopic(playerId) == 18 then
Expand All @@ -162,34 +158,31 @@ local function creatureSayCallback(npc, creature, type, message)
elseif message:lower() == "west" and npcHandler:getTopic(playerId) == 23 then
npcHandler:say("You leave the massive open gate behind you and go to the west. ", npc, creature)
npcHandler:setTopic(playerId, 24)
elseif message:lower() == "bastesh" and npcHandler:getTopic(playerId) == 24 then
npcHandler:say("This huge statue of Bastesh is made from onyx, and thrones on a large plateau which can be reached by a sprawling stairway. She holds a large {sapphire} in her hands. ", npc, creature)
elseif message:lower() == "take sapphire" and npcHandler:getTopic(playerId) == 24 then
npcHandler:say("You carefully remove the sapphire from Bastesh's grasp.", npc, creature)
npcHandler:setTopic(playerId, 25)
elseif message:lower() == "take sapphire" and npcHandler:getTopic(playerId) == 25 then
npcHandler:say("You carefully remove the sapphire from Bastesh's grasp. ", npc, creature)
elseif message:lower() == "east" and npcHandler:getTopic(playerId) == 25 then
npcHandler:say("You head back to the east and to the plateau.", npc, creature)
npcHandler:setTopic(playerId, 26)
elseif message:lower() == "east" and npcHandler:getTopic(playerId) == 26 then
npcHandler:say("You head back to the east and to the plateau. ", npc, creature)
elseif message:lower() == "south" and npcHandler:getTopic(playerId) == 26 then
npcHandler:say("You head back south to the site with the onyx lookout.", npc, creature)
npcHandler:setTopic(playerId, 27)
elseif message:lower() == "south" and npcHandler:getTopic(playerId) == 27 then
npcHandler:say("You head back south to the site with the onyx lookout. ", npc, creature)
elseif message:lower() == "east" and npcHandler:getTopic(playerId) == 27 then
npcHandler:say("You return to the plateau in the east.", npc, creature)
npcHandler:setTopic(playerId, 28)
elseif message:lower() == "east" and npcHandler:getTopic(playerId) == 28 then
npcHandler:say("You return to the plateau in the east. ", npc, creature)
elseif message:lower() == "use stand" and npcHandler:getTopic(playerId) == 28 then
npcHandler:say("You put the stand into a small recess you find near the middle of the plateau.", npc, creature)
npcHandler:setTopic(playerId, 29)
elseif message:lower() == "use stand" and npcHandler:getTopic(playerId) == 29 then
npcHandler:say("You put the stand into a small recess you find near the middle of the plateau. ", npc, creature)
elseif message:lower() == "use ruby" and npcHandler:getTopic(playerId) == 29 then
npcHandler:say("As the ruby slips into the notch, the strong red of the stone intensifies a thousandfold. You fear to hurt your eyes and turn away immediately. The ray seems to be directed to the centre of the plateau with astounding precision.", npc, creature)
npcHandler:setTopic(playerId, 30)
elseif message:lower() == "use ruby" and npcHandler:getTopic(playerId) == 30 then
npcHandler:say("As the ruby slips into the notch, the strong red of the stone intensifies a thousandfold. You fear to hurt your eyes and turn away immediately. The ray seems to be directed to the centre of the plateau with astounding precision. ", npc, creature)
elseif message:lower() == "use sapphire" and npcHandler:getTopic(playerId) == 30 then
npcHandler:say("As the sapphire slips into the notch, the deep blue of the stone intensifies a thousandfold. You fear to hurt your eyes and turn away immediately. The ray seems to be directed to the centre of the plateau with astounding precision.", npc, creature)
npcHandler:setTopic(playerId, 31)
elseif message:lower() == "use sapphire" and npcHandler:getTopic(playerId) == 31 then
npcHandler:say("As the sapphire slips into the notch, the deep blue of the stone intensifies a thousandfold. You fear to hurt your eyes and turn away immediately. The ray seems to be directed to the centre of the plateau with astounding precision. ", npc, creature)
elseif message:lower() == "use emerald" and npcHandler:getTopic(playerId) == 31 then
npcHandler:say("As the emerald slips into the notch, the vibrant green of the stone intensifies a thousandfold. You fear to hurt your eyes and turn away immediately. The ray seems to be directed to the centre of the plateau with astounding precision.", npc, creature)
npcHandler:setTopic(playerId, 32)
elseif message:lower() == "use emerald" and npcHandler:getTopic(playerId) == 32 then
npcHandler:say("As the emerald slips into the notch, the vibrant green of the stone intensifies a thousandfold. You fear to hurt your eyes and turn away immediately. The ray seems to be directed to the centre of the plateau with astounding precision. ", npc, creature)
npcHandler:setTopic(playerId, 33)
elseif message:lower() == "use mirror" and npcHandler:getTopic(playerId) == 33 then
elseif message:lower() == "use mirror" and npcHandler:getTopic(playerId) == 32 then
npcHandler:say({
"With your eyes covered and avoiding direct sight of the rays, you put the mirror into the stand. ...",
"Instinctively you run to a larger emerald bluff near the raise to find cover. Mere seconds after you claimed the sturdy shelter, a deep dark humming starts to swirl through the air. ...",
Expand All @@ -200,11 +193,11 @@ local function creatureSayCallback(npc, creature, type, message)
"The growl transforms into a scream, everything around you seems to compress. As you press yourself tightly against the bluff, everything falls silent and in a split second, the dark being dissolves into bursts of blackness. You wake.",
}, npc, creature)
player:addAchievement("Wayfarer")
player:setStorageValue(Storage.WrathoftheEmperor.Questline, 28)
player:setStorageValue(Storage.WrathoftheEmperor.Mission09, 2) --Questlog, Wrath of the Emperor "Mission 09: The Sleeping Dragon"
player:setStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.Questline, 28)
player:setStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.Mission09, 2) --Questlog, Wrath of the Emperor "Mission 09: The Sleeping Dragon"
npcHandler:setTopic(playerId, 0)
end
elseif player:getStorageValue(Storage.WrathoftheEmperor.Questline) == 28 then
elseif player:getStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.Questline) == 28 then
if MsgContains(message, "wayfarer") then
npcHandler:say("I call you the wayfarer. You travelled through my dreams. You ultimately freed my mind. My mind accepted you and so will I.", npc, creature)
elseif MsgContains(message, "mission") then
Expand All @@ -223,8 +216,8 @@ local function creatureSayCallback(npc, creature, type, message)
"The transfer was successful. ...",
"You are now prepared to enter the realm of the evildoer. I am grateful for your help, wayfarer. Should you seek my council, use this charm I cede to you. For my spirit will guide you wherever you are. May you enjoy a sheltered future, you shall prevail.",
}, npc, creature)
player:setStorageValue(Storage.WrathoftheEmperor.Questline, 29)
player:setStorageValue(Storage.WrathoftheEmperor.Mission10, 1) --Questlog, Wrath of the Emperor "Mission 10: A Message of Freedom"
player:setStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.Questline, 29)
player:setStorageValue(Storage.Quest.U8_6.WrathOfTheEmperor.Mission10, 1) --Questlog, Wrath of the Emperor "Mission 10: A Message of Freedom"
player:addItem(10343, 1)
npcHandler:setTopic(playerId, 0)
end
Expand Down
Loading

0 comments on commit 6232e78

Please sign in to comment.