Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: The Lost Brother Quest #2454

Merged
merged 8 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion data-otservbr-global/lib/core/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5592,7 +5592,7 @@ if not Quests then
},
[41] = {
name = "Adventurers Guild",
startStorageId = Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton,
startStorageId = Storage.AdventurersGuild.QuestLine,
startStorageValue = 1,
missions = {
[1] = {
Expand All @@ -5606,6 +5606,18 @@ if not Quests then
But the dragon hoards might justify the risks. You killed %d/50 dragons and dragon lords."):format(math.max(player:getStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter), 0))
end,
},
[2] = {
name = "The Lost Brother",
storageId = Storage.AdventurersGuild.TheLostBrother,
missionId = 11000,
startValue = 1,
endValue = 3,
states = {
[1] = "At the Kha'zeel Mountains you met the merchant Tarun. His brother has gone missing and was last seen following a beautiful woman into a palace. Tarun fears this woman might have been a demon.",
[2] = "You found the remains of Tarun's brother containing a message. Go back to Tarun and report his brother's last words.",
[3] = "You told Tarun about his brother's sad fate. He was very downhearted but gave you his sincere thanks. The beautiful asuri have taken a young man's life and the happiness of another one.",
},
}
},
},
[42] = {
Expand Down
3 changes: 2 additions & 1 deletion data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,8 @@ Storage = {
WarriorSkeleton = 52146,
DragonCounter = 52147,
},
QuestLine = 52148,
elsongabriel marked this conversation as resolved.
Show resolved Hide resolved
TheLostBrother = 52149
},
DreamersChallenge = {
-- Reserved storage from 52160 - 52199
Expand Down Expand Up @@ -2537,7 +2539,6 @@ Storage = {
NightmareTeddy = {},
PoacherCavesMiniWorldChange = {},
TheGreatDragonHunt = {},
TheLostBrother = {},
TheTaintedSouls = {},
},
U10_90 = { -- update 10.90 - Reserved Storages 45201 - 45350
Expand Down
65 changes: 65 additions & 0 deletions data-otservbr-global/npc/tarun.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,71 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
CarlosE-Dev marked this conversation as resolved.
Show resolved Hide resolved
local playerId = player:getId()

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

if MsgContains(message, "mission") then
if player:getStorageValue(Storage.AdventurersGuild.TheLostBrother) < 1 then
npcHandler:setTopic(playerId, 1)
npcHandler:say(
{
"My brother is missing. I fear, he went to this evil palace north of here. A place of great beauty, certainly filled with riches and luxury. But in truth it is a threshold to hell and demonesses are after his blood. ...",
"He is my brother, and I am deeply ashamed to admit but I don't dare to go there. Perhaps your heart is more courageous than mine. Would you go to see this place and search for my brother?"
},
npc,
creature
)
elseif player:getStorageValue(Storage.AdventurersGuild.TheLostBrother) == 1 then
npcHandler:say("I hope you will find my brother.", npc, creature)
elseif player:getStorageValue(Storage.AdventurersGuild.TheLostBrother) == 2 then
CarlosE-Dev marked this conversation as resolved.
Show resolved Hide resolved
npcHandler:say({
"So, he is dead as I feared. I warned him not to go with this woman, but he gave in to temptation. My heart darkens and moans. But you have my sincere thanks. ...",
"Without your help I would have stayed in the dark about his fate. Please, take this as a little recompense."}, npc, creature)
player:addItem(3039, 1)
player:addExperience(3000, true)
player:setStorageValue(Storage.AdventurersGuild.TheLostBrother, 3)
end
elseif MsgContains(message, "yes") then
if npcHandler:getTopic(playerId) == 1 then
npcHandler:say("I thank you! This is more than I could hope!", npc, creature)
if player:getStorageValue(Storage.AdventurersGuild.QuestLine) < 1 then
player:setStorageValue(Storage.AdventurersGuild.QuestLine, 1)
end
player:setStorageValue(Storage.AdventurersGuild.TheLostBrother, 1)
npcHandler:setTopic(playerId, 0)
end
elseif MsgContains(message, "no") then
if npcHandler:getTopic(playerId) == 1 then
npcHandler:say("As you wish.", npc, creature)
npcHandler:setTopic(playerId, 0)
end
end

return true
end

local function onTradeRequest(npc, creature)
local player = Player(creature)
CarlosE-Dev marked this conversation as resolved.
Show resolved Hide resolved
local playerId = player:getId()

if player:getStorageValue(Storage.AdventurersGuild.TheLostBrother) ~= 3 then
return false
end

return true
end

npcHandler:setMessage(MESSAGE_GREET, "Greetings!")
npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell.")
npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, just have a look.")
npcHandler:setCallback(CALLBACK_ON_TRADE_REQUEST, onTradeRequest)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell.")
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

npcConfig.shop = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ function adventurersWarriorSkeleton.onUse(player, item, fromPosition, target, to
if player:getStorageValue(Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton) < 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have discovered a deceased warrior's skeleton. It seems he tried to hunt the dragons around here - and failed.")
player:addItem(5882, 1) -- red dragon scale

if player:getStorageValue(Storage.AdventurersGuild.QuestLine) < 1 then
player:setStorageValue(Storage.AdventurersGuild.QuestLine, 1)
end

player:setStorageValue(Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton, 1)
player:setStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter, 0)
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ local questTable = {
{ storage = Storage.Quest.U11_40.ThreatenedDreams.QuestLine, storageValue = 1 },
{ storage = Storage.Quest.U11_40.ThreatenedDreams.Mission01[1], storageValue = 16 },
{ storage = Storage.Quest.U11_40.ThreatenedDreams.Mission02.KroazurAccess, storageValue = 1 },
{ storage = Storage.AdventurersGuild.QuestLine, storageValue = 1 },
{ storage = Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton, storageValue = 1 },
{ storage = Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton, storageValue = 2 },
{ storage = Storage.AdventurersGuild.TheLostBrother, storageValue = 3 },
{ storage = Storage.Quest.U10_55.Dawnport.Questline, storageValue = 1 },
{ storage = Storage.Quest.U10_55.Dawnport.GoMain, storageValue = 1 },
{ storage = Storage.ForgottenKnowledge.AccessDeath, storageValue = 1 },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local findRemains = MoveEvent()

function findRemains.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end

if player:getStorageValue(Storage.AdventurersGuild.TheLostBrother) == 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You stumble over some old bones. Something is carved into the stone wall here: 'Tarun, my brother, you were right. She's evil.'")
player:setStorageValue(Storage.AdventurersGuild.TheLostBrother, 2)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
end

return true
end

findRemains:position(Position(32959, 32674, 4))
findRemains:register()
Loading