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

fix: quests from version 7.24 revised #2724

Merged
merged 9 commits into from
Jul 25, 2024
Merged
6 changes: 3 additions & 3 deletions data-otservbr-global/lib/core/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3560,16 +3560,16 @@ if not Quests then
storageId = Storage.Postman.Mission07,
missionId = 10258,
startValue = 1,
endValue = 8,
endValue = 9,
states = {
[1] = "Kevin wants you to bring him the measurements of Benjamin, Lokur, Dove, Liane, Chrystal and Olrik.",
[2] = "You have received the measurements from 1 of 6 post officers.",
[3] = "You have received the measurements from 2 of 6 post officers.",
[4] = "You have received the measurements from 3 of 6 post officers.",
[5] = "You have received the measurements from 4 of 6 post officers.",
[6] = "You have received the measurements from 5 of 6 post officers.",
[7] = "You have received all measurements, report back to Kevin!",
[8] = "You have reported back that you have completed the mission.",
[8] = "You have received all measurements, report back to Kevin!",
[9] = "You have reported back that you have completed the mission.",
majestyotbr marked this conversation as resolved.
Show resolved Hide resolved
},
},
[8] = {
Expand Down
22 changes: 21 additions & 1 deletion data-otservbr-global/migrations/46.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
logger.info("Updating database to version 46 (update Fix: The Postman Missions Quest - player_storage values)")

local storageKey = 51366
local oldValue = 8
local newValue = 9

local result = db.query("SELECT `player_id` FROM `player_storage` WHERE `key` = " .. storageKey .. " AND `value` = " .. oldValue)
if result:getID() ~= -1 then
repeat
local playerId = result:getDataInt("player_id")
if playerId then
db.query("UPDATE `player_storage` SET `value` = " .. newValue .. " WHERE `player_id` = " .. playerId .. " AND `key` = " .. storageKey)
logger.info("Updated player ID: " .. playerId)
end
until not result:next()
result:free()
else
logger.info("No player found with the specified value in player_storage.")
end

return true
end
3 changes: 3 additions & 0 deletions data-otservbr-global/migrations/47.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function onUpdateDatabase()
return false -- true = There are others migrations file | false = this is the last migration file
end
8 changes: 4 additions & 4 deletions data-otservbr-global/npc/kevin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ local function creatureSayCallback(npc, creature, type, message)
elseif player:getStorageValue(Storage.Postman.Mission05) == 3 then
npcHandler:say("Splendid, I knew we could trust you. I would like to ask for your help in another matter. Are you interested?", npc, creature)
npcHandler:setTopic(playerId, 16)
elseif player:getStorageValue(Storage.Postman.Mission07) == 7 then
elseif player:getStorageValue(Storage.Postman.Mission07) == 8 then
npcHandler:say("Once more you have impressed me! Are you willing to do another job?", npc, creature)
npcHandler:setTopic(playerId, 21)
elseif player:getStorageValue(Storage.Postman.Mission06) >= 1 and player:getStorageValue(Storage.Postman.Mission06) < 10 then
Expand Down Expand Up @@ -127,10 +127,10 @@ local function creatureSayCallback(npc, creature, type, message)
elseif player:getStorageValue(Storage.Postman.Rank) == 4 or player:getStorageValue(Storage.Postman.Rank) == 3 and player:getStorageValue(Storage.Postman.Mission09) == 0 then
npcHandler:say("So are you ready for another mission?", npc, creature)
npcHandler:setTopic(playerId, 25)
elseif player:getStorageValue(Storage.Postman.Mission06) == 13 and player:getStorageValue(Storage.Postman.Rank) == 3 then
elseif player:getStorageValue(Storage.Postman.Mission07) < 1 and player:getStorageValue(Storage.Postman.Mission06) == 13 and player:getStorageValue(Storage.Postman.Rank) == 3 then
npcHandler:say("Excellent! Another job well done! Would you accept another mission?", npc, creature)
npcHandler:setTopic(playerId, 19)
elseif player:getStorageValue(Storage.Postman.Mission06) == 13 and player:getStorageValue(Storage.Postman.Rank) == 2 then
elseif player:getStorageValue(Storage.Postman.Mission07) >= 1 and player:getStorageValue(Storage.Postman.Mission06) == 13 and player:getStorageValue(Storage.Postman.Rank) == 2 then
npcHandler:say("Excellent! Another job well done! Would you accept another mission?", npc, creature)
npcHandler:setTopic(playerId, 28)
elseif player:getStorageValue(Storage.Postman.Mission04) == 2 and player:getStorageValue(Storage.Postman.Rank) == 2 then
Expand Down Expand Up @@ -263,7 +263,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 22)
elseif npcHandler:getTopic(playerId) == 22 then
npcHandler:say("Find out about his whereabouts and retrieve him or at least his posthorn. He was looking for a new underground passage that is rumoured to be found underneath the troll-infested Mountain east of Thais.", npc, creature)
player:setStorageValue(Storage.Postman.Mission07, 8)
player:setStorageValue(Storage.Postman.Mission07, 9)
player:setStorageValue(Storage.Postman.Mission08, 1)
npcHandler:setTopic(playerId, 0)
elseif npcHandler:getTopic(playerId) == 23 then
Expand Down
4 changes: 2 additions & 2 deletions data-otservbr-global/npc/kroox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ local function creatureSayCallback(npc, creature, type, message)
player:setStorageValue(Storage.SamsOldBackpack, 2)
player:setStorageValue(Storage.SamsOldBackpackDoor, 1)
end
elseif MsgContains(message, "measurements") then
if player:getStorageValue(Storage.Postman.Mission07) >= 1 and player:getStorageValue(Storage.Postman.MeasurementsKroox) ~= 1 then
elseif MsgContains(message, "lokurs measurements") then
majestyotbr marked this conversation as resolved.
Show resolved Hide resolved
if player:getStorageValue(Storage.Postman.Mission07) >= 7 and player:getStorageValue(Storage.Postman.MeasurementsKroox) ~= 1 then
npcHandler:say("Hm, well I guess its ok to tell you ... <tells you about Lokurs measurements> ", npc, creature)
player:setStorageValue(Storage.Postman.Mission07, player:getStorageValue(Storage.Postman.Mission07) + 1)
player:setStorageValue(Storage.Postman.MeasurementsKroox, 1)
Expand Down
8 changes: 8 additions & 0 deletions data-otservbr-global/npc/lokur.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ local function creatureSayCallback(npc, creature, type, message)
elseif MsgContains(message, "no") and npcHandler:getTopic(playerId) > 0 then
npcHandler:say("No then.", npc, creature)
npcHandler:setTopic(playerId, 0)
elseif MsgContains(message, "measurements") then
if player:getStorageValue(Storage.Postman.Mission07) >= 6 and player:getStorageValue(Storage.Postman.MeasurementsKroox) ~= 1 then
npcHandler:say("Come on, I have no clue what they are. Better ask my armorer Kroox for such nonsense.Go and ask him for good ol' Lokurs measurements, he'll know.", npc, creature)
player:setStorageValue(Storage.Postman.Mission07, player:getStorageValue(Storage.Postman.Mission07) + 1)
else
npcHandler:say("...", npc, creature)
npcHandler:setTopic(playerId, 0)
end
end

return true
Expand Down
1 change: 1 addition & 0 deletions data-otservbr-global/npc/markwin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ local function greetCallback(npc, creature)
position:sendMagicEffect(CONST_ME_TELEPORT)
end
end
npcHandler:say("No! The hornless have reached my city! BODYGUARDS TO ME!", npc, creature)
return false
elseif player:getStorageValue(Storage.MarkwinGreeting) == 1 then
npcHandler:setMessage(MESSAGE_GREET, "Well ... you defeated my guards! Now everything is over! I guess I will have to answer your questions now.")
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/talphion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:say("CHESS? I DONT PLAY CHESS!", npc, creature)
npcHandler:setTopic(playerId, 3)
elseif npcHandler:getTopic(playerId) == 3 then
npcHandler:say("A PATTERN IN THIS MESS?? HEY DON'T INSULT MY MACHINEHALL!", npc, creature)
npcHandler:say("A PATTERN IN THIS MESS?? HEY DON'T INSULT MY MACHINE HALL!", npc, creature)
npcHandler:setTopic(playerId, 4)
elseif npcHandler:getTopic(playerId) == 4 then
npcHandler:say("AH YES! I WORKED ON THE DRESS PATTERN FOR THOSE UNIFORMS. STAINLESS TROUSERES, STEAM DRIVEN BOOTS! ANOTHERMARVEL TO BEHOLD! I'LL SENT A COPY TO KEVIN IMEDIATELY!", npc, creature)
Expand Down
Loading