Skip to content

Commit

Permalink
Blood Brothers Quest
Browse files Browse the repository at this point in the history
This quest needs to be completed from mission 04.
  • Loading branch information
htc16 committed Aug 3, 2024
1 parent b511566 commit 3ee2d9b
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 62 deletions.
16 changes: 6 additions & 10 deletions data-otservbr-global/npc/armenius.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()
if message == "cookie" then
if player:getStorageValue(BloodBrothers.Mission02) == 1 and player:getItemCount(8199) > 0 and player:getStorageValue(BloodBrothers.Cookies.Armenius) < 0 then
if player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission02) == 1 and player:getItemCount(8199) > 0 and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Armenius) < 0 then
npcHandler:say("What kind of strange offer is this? You're actually offering me a cookie?", npc, creature)
npcHandler:setTopic(playerId, 1)
else
Expand All @@ -65,22 +65,18 @@ local function creatureSayCallback(npc, creature, type, message)
elseif message == "yes" then
if npcHandler:getTopic(playerId) == 1 and player:removeItem(8199, 1) then -- garlic cookie
npcHandler:say("Errrkss - coughcough - what the - heck did you put in there? Get out of my sight!", npc, creature)
player:setStorageValue(BloodBrothers.Cookies.Armenius, 1)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Armenius, 1)
npcHandler:setTopic(playerId, 0)
end
elseif message:lower() == "alori mort" and player:getStorageValue(BloodBrothers.Mission03) == 1 then
elseif message:lower() == "alori mort" and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission03) == 1 then
if npcHandler:getTopic(playerId) == 2 then
local rand = math.random(2)
local randMessage = { "Oh, the nerve. Go to the rats which raised you.", "Oh, the nerve. Sod off." }
npcHandler:setMessage(MESSAGE_WALKAWAY, randMessage[rand])
npcHandler:setMessage(MESSAGE_WALKAWAY, "Oh, the nerve. Go to the rats which raised you.")
player:teleportTo(Position(32759, 31241, 9))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:setStorageValue(BloodBrothers.Mission03, 2)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission03, 2)
else
npcHandler:say({
"...... ...... ....",
"HAHAHAHAHA! What the... HAHAHAHA! Come on, say it again, just because it's so funny - and then I'll get rid of you, little mouse!",
}, npc, creature)
npcHandler:say("Oh, the nerve. Sod off.", npc, creature)
npcHandler:setTopic(playerId, 2)
end
end
Expand Down
4 changes: 2 additions & 2 deletions data-otservbr-global/npc/harlow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ local function creatureSayCallback(npc, creature, type, message)
end
--Travel
local travelNode = keywordHandler:addKeyword({ "vengoth" }, StdModule.say, { npcHandler = npcHandler, text = "So you are saying you're looking for someone to take you to Vengoth?" }, function(player)
return player:getStorageValue(BloodBrothers.VengothAccess) == 1
return player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.VengothAccess) == 1
end)
travelNode:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, reset = true, text = "Oh well." })
local travelNodeYes = travelNode:addChildKeyword({ "yes" }, StdModule.say, { npcHandler = npcHandler, text = "I could do that, it's not far from here. I don't run a charity organisation, though. Tell you what. Give me 100 gold pieces, and me and my boat are yours for the trip. Okay?" })
travelNodeYes:addChildKeyword({ "yes" }, StdModule.travel, { npcHandler = npcHandler, text = "Okay. Enjoy.", premium = false, cost = 100, destination = Position(32858, 31549, 7) })
travelNodeYes:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, reset = true, text = "Oh well." })
travelNode = keywordHandler:addKeyword({ "transportation" }, StdModule.say, { npcHandler = npcHandler, text = "Want me to bring you to Vengoth again for 100 gold?" }, function(player)
return player:getStorageValue(BloodBrothers.VengothAccess) == 1
return player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.VengothAccess) == 1
end)
travelNode:addChildKeyword({ "yes" }, StdModule.travel, { npcHandler = npcHandler, text = "Okay. Enjoy.", premium = false, cost = 100, destination = Position(32858, 31549, 7) })
travelNode:addChildKeyword({ "no" }, StdModule.say, { npcHandler = npcHandler, reset = true, text = "Oh well." })
Expand Down
77 changes: 39 additions & 38 deletions data-otservbr-global/npc/julius.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ local BloodBrothers = Storage.Quest.U8_4.BloodBrothers
local function greetCallback(npc, creature)
local player = Player(creature)

if player:getStorageValue(BloodBrothers.QuestLine) < 0 then
if player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.QuestLine) < 0 then
npcHandler:setMessage(MESSAGE_GREET, "Be greeted, adventurer |PLAYERNAME|. I assume you have read the {note} about the {vampire} threat in this city.")
elseif player:getStorageValue(BloodBrothers.QuestLine) == 1 then
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.QuestLine) == 1 then
npcHandler:setMessage(MESSAGE_GREET, "Be greeted, adventurer |PLAYERNAME|. Please excuse me if I appear {distracted}!")
end
return true
Expand All @@ -65,41 +65,42 @@ end
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()

if table.contains({ "mission", "note", "vampire" }, message:lower()) then
if player:getStorageValue(BloodBrothers.QuestLine) < 0 then
if player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.QuestLine) < 0 then
npcHandler:say("Our nightly blood-sucking visitors put the inhabitants of Yalahar in constant danger. The worst thing is that anyone in this city could be a vampire. Maybe an outsider like you could help us. Would you try?", npc, creature)
npcHandler:setTopic(playerId, 1)
elseif player:getStorageValue(BloodBrothers.Mission01) == 1 then
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission01) == 1 then
if player:getSlotItem(CONST_SLOT_NECKLACE) then
if player:getSlotItem(CONST_SLOT_NECKLACE).itemid == 3083 then
npcHandler:say("Hmm, I see, I see. That necklace is only a small indication though... I think I need another proof, just to make sure. Say... have you ever baked {garlic bread}?", npc, creature)
player:setStorageValue(BloodBrothers.Mission01, 2)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission01, 2)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say("I fear that will not do. Sorry.", npc, creature)
end
else
npcHandler:say("I fear that will not do. Sorry.", npc, creature)
end
elseif player:getStorageValue(BloodBrothers.Mission01) == 3 then
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission01) == 3 then
npcHandler:say("Let me check - yes indeed, there's garlic in it. Now eat one, in front of my eyes. Right now! Say '{aaah}' when you've chewed it all down so that I can see you're not hiding it!", npc, creature)
npcHandler:setTopic(playerId, 4)
elseif player:getStorageValue(BloodBrothers.Mission01) == 4 and player:getStorageValue(BloodBrothers.Mission02) < 0 then
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission01) == 4 and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission02) < 0 then
npcHandler:say("So, are you ready for your first real task?", npc, creature)
npcHandler:setTopic(playerId, 5)
elseif player:getStorageValue(BloodBrothers.Mission02) == 1 then
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission02) == 1 then
npcHandler:say("Are you back with confirmed names of possible vampires?", npc, creature)
npcHandler:setTopic(playerId, 7)
elseif player:getStorageValue(BloodBrothers.Mission02) == 2 and player:getStorageValue(BloodBrothers.Mission03) < 0 then
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission02) == 2 and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission03) < 0 then
npcHandler:say({
"Listen, I thought of something. If we could somehow figure out who among those five is their leader and manage to defeat him,the others might give up too. ...",
"Without their leader they will at least be much weaker. Before I explain my plan, do you think you could do that?",
}, npc, creature)
npcHandler:setTopic(playerId, 9)
elseif player:getStorageValue(BloodBrothers.Mission03) == 2 then
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission03) == 2 then
npcHandler:say("Oh! You look horrible - I mean, rather weary. What happened? Who is the master vampire?", npc, creature)
npcHandler:setTopic(playerId, 11)
elseif player:getStorageValue(BloodBrothers.Mission03) == 3 and player:getStorageValue(BloodBrothers.Mission04) < 0 then
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission03) == 3 and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission04) < 0 then
npcHandler:say({
"You know, I came to think that the spell didn't work because there is another, greater power behind all of this. I fear that if we don't find the source of the vampire threat we can't defeat them. ...",
"I heard that there is an island not far from here. Unholy and fearsome things are said to happen there, and maybe that means vampires are not far away. ...",
Expand All @@ -111,13 +112,13 @@ local function creatureSayCallback(npc, creature, type, message)
elseif message == "yes" then
if npcHandler:getTopic(playerId) == 1 then
npcHandler:say("Well, there's one problem. How would I know I can trust you? You might be one of them... hm. Can you think of something really unlikely for a vampire? If you know a way to prove it to me, ask me about your {mission}.", npc, creature)
player:setStorageValue(BloodBrothers.QuestLine, 1)
player:setStorageValue(BloodBrothers.Mission01, 1)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.QuestLine, 1)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission01, 1)
npcHandler:setTopic(playerId, 0)
elseif npcHandler:getTopic(playerId) == 3 then
npcHandler:say("Fine then. Talk to me again about your mission once you have the garlic bread. You can get holy water from a member of the inquisition.", npc, creature)
player:setStorageValue(BloodBrothers.Mission01, 3)
elseif npcHandler:getTopic(playerId) == 5 and player:getStorageValue(BloodBrothers.Mission01) == 4 then
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission01, 3)
elseif npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission01) == 4 then
npcHandler:say({
"As I already told you, anyone in this city could really be a vampire, even the most unsuspicious citizen. I want you to find that brood. ...",
"You can possibly identify the vampires by using a trick with hidden garlic, but better put it into something unsuspicious, like... cookies maybe! ...",
Expand All @@ -127,7 +128,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 6)
elseif npcHandler:getTopic(playerId) == 6 then
npcHandler:say("Fine. Good luck! Talk to me again about your mission once you have confirmed the names of five suspects.", npc, creature)
player:setStorageValue(BloodBrothers.Mission02, 1)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission02, 1)
elseif npcHandler:getTopic(playerId) == 7 then
npcHandler:say("Alright, wait a moment. Tell me one name at a time so I can note them down carefully. Who is a suspect?", npc, creature)
npcHandler:setTopic(playerId, 8)
Expand All @@ -144,18 +145,18 @@ local function creatureSayCallback(npc, creature, type, message)
"Also, they say there is a castle on this island. That mark HAS to be included, it's far too important to leave it out. Good luck!",
}, npc, creature)
player:addItem(8200)
player:setStorageValue(BloodBrothers.Mission04, 1)
player:setStorageValue(BloodBrothers.VengothAccess, 1)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission04, 1)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.VengothAccess, 1)
npcHandler:setTopic(playerId, 0)
end
elseif MsgContains(message, "garlic bread") or message == "no" then
if npcHandler:getTopic(playerId) == 2 then
npcHandler:say("Well, you need to mix flour with holy water and use that dough on garlic to create a special dough. Bake it like normal bread, but I guarantee that no vampire can eat that. Are you following me?", npc, creature)
npcHandler:setTopic(playerId, 3)
elseif npcHandler:getTopic(playerId) == 8 then
if player:getStorageValue(BloodBrothers.Cookies.Serafin) == 2 and player:getStorageValue(BloodBrothers.Cookies.Lisander) == 2 and player:getStorageValue(BloodBrothers.Cookies.Ortheus) == 2 and player:getStorageValue(BloodBrothers.Cookies.Maris) == 2 and player:getStorageValue(BloodBrothers.Cookies.Armenius) == 2 then
if player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Serafin) == 2 and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Lisander) == 2 and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Ortheus) == 2 and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Maris) == 2 and player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Armenius) == 2 then
npcHandler:say("I guess Armenius, Lisander, Maris, Ortheus and Serafin are all the names we can get for now. Let me think for a moment what we are going to do, talk to me about your mission again later.", npc, creature)
player:setStorageValue(BloodBrothers.Mission02, 2)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission02, 2)
npcHandler:setTopic(playerId, 0)
else
npcHandler:say("No, no, I was asking for one of the names.", npc, creature)
Expand All @@ -165,53 +166,53 @@ local function creatureSayCallback(npc, creature, type, message)
elseif MsgContains(message, "aaah") then
if npcHandler:getTopic(playerId) == 4 and player:removeItem(8194, 1) then
npcHandler:say("Very well. I think I can trust you now. Sorry that I had to put you through this embarassing procedure, but I'm sure you understand. So, are you ready for your first real task?", npc, creature)
player:setStorageValue(BloodBrothers.Mission01, 4)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission01, 4)
npcHandler:setTopic(playerId, 5)
else
npcHandler:say("No, no, you didn't eat it! Vampire Brood! Say '{aaah}' once you have eaten the bread or get out of her instantly!", npc, creature)
end
elseif table.contains({ "maris", "ortheus", "serafin", "lisander", "armenius" }, message:lower()) and npcHandler:getTopic(playerId) == 8 then
if MsgContains(message, "maris") then
if player:getStorageValue(BloodBrothers.Cookies.Maris) == 1 then
if player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Maris) == 1 then
npcHandler:say("He really doesn't look like the man of the sea he pretends to be, does he? Noted down! Any other name?", npc, creature)
player:setStorageValue(BloodBrothers.Cookies.Maris, 2)
elseif player:getStorageValue(BloodBrothers.Cookies.Maris) == 2 then
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Maris, 2)
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Maris) == 2 then
npcHandler:say("You already reported that name. Any new ones?", npc, creature)
else
npcHandler:say("Hm. You don't look so sure about that one. You should not report suspects that you did not confirm yourself! Any others?", npc, creature)
end
elseif MsgContains(message, "ortheus") then
if player:getStorageValue(BloodBrothers.Cookies.Ortheus) == 1 then
if player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Ortheus) == 1 then
npcHandler:say("I always thought that there is not really a poor beggar hidden under those ragged clothes. Noted down! Any other name?", npc, creature)
player:setStorageValue(BloodBrothers.Cookies.Ortheus, 2)
elseif player:getStorageValue(BloodBrothers.Cookies.Ortheus) == 2 then
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Ortheus, 2)
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Ortheus) == 2 then
npcHandler:say("You already reported that name. Any new ones?", npc, creature)
else
npcHandler:say("Hm. You don't look so sure about that one. You should not report suspects that you did not confirm yourself! Any others?", npc, creature)
end
elseif MsgContains(message, "serafin") then
if player:getStorageValue(BloodBrothers.Cookies.Serafin) == 1 then
if player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Serafin) == 1 then
npcHandler:say("Nice angelic name for a vampire. But he didn't escape your attention, well done. Noted down! Any other name?", npc, creature)
player:setStorageValue(BloodBrothers.Cookies.Serafin, 2)
elseif player:getStorageValue(BloodBrothers.Cookies.Serafin) == 2 then
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Serafin, 2)
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Serafin) == 2 then
npcHandler:say("You already reported that name. Any new ones?", npc, creature)
else
npcHandler:say("Hm. You don't look so sure about that one. You should not report suspects that you did not confirm yourself! Any others?", npc, creature)
end
elseif MsgContains(message, "lisander") then
if player:getStorageValue(BloodBrothers.Cookies.Lisander) == 1 then
if player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Lisander) == 1 then
npcHandler:say("Yes, that pale skin and those black eyes speak volumes. Noted down! Any other name?", npc, creature)
player:setStorageValue(BloodBrothers.Cookies.Lisander, 2)
elseif player:getStorageValue(BloodBrothers.Cookies.Lisander) == 2 then
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Lisander, 2)
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Lisander) == 2 then
npcHandler:say("You already reported that name. Any new ones?", npc, creature)
else
npcHandler:say("Hm. You don't look so sure about that one. You should not report suspects that you did not confirm yourself! Any others?", npc, creature)
end
elseif MsgContains(message, "armenius") then
if player:getStorageValue(BloodBrothers.Cookies.Armenius) == 1 then
if player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Armenius) == 1 then
npcHandler:say("Ahh, I always thought something was suspicious about him. Noted down! Any other name?", npc, creature)
player:setStorageValue(BloodBrothers.Cookies.Armenius, 2)
elseif player:getStorageValue(BloodBrothers.Cookies.Armenius) == 2 then
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Armenius, 2)
elseif player:getStorageValue(Storage.Quest.U8_4.BloodBrothers.Cookies.Armenius) == 2 then
npcHandler:say("You already reported that name. Any new ones?", npc, creature)
else
npcHandler:say("Hm. You don't look so sure about that one. You should not report suspects that you did not confirm yourself! Any others?", npc, creature)
Expand All @@ -224,11 +225,11 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("Hm. You don't look so sure about that one. You should not report suspects that you did not confirm yourself! Any others?", npc, creature)
elseif message:lower() == "alori mort" and npcHandler:getTopic(playerId) == 10 then
npcHandler:say("Good. Don't play around with the spell, only use it when standing in front of those vampires. Come back and report to me about your progress later.", npc, creature)
player:setStorageValue(BloodBrothers.Mission03, 1)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission03, 1)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "armenius") and npcHandler:getTopic(playerId) == 11 then
npcHandler:say("I see... so Armenius is the master, and the spell didn't even cause a scratch on him... Well, that went worse than expected. Let me think for a moment and then ask me about a mission again.", npc, creature)
player:setStorageValue(BloodBrothers.Mission03, 3)
player:setStorageValue(Storage.Quest.U8_4.BloodBrothers.Mission03, 3)
npcHandler:setTopic(playerId, 0)
else
npcHandler:say("Getting cold feet, eh?", npc, creature)
Expand Down
Loading

0 comments on commit 3ee2d9b

Please sign in to comment.