From 4cd971c8c6fe97eea5917dd1b974e7c2f4fd1ab3 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 18 Apr 2024 17:37:22 -0300 Subject: [PATCH] resolve conversation --- data-canary/npc/king_canary.lua | 11 ++++++----- data-otservbr-global/npc/emperor_kruzak.lua | 11 ++++++----- data-otservbr-global/npc/king_tibianus.lua | 11 ++++++----- data-otservbr-global/npc/percybald.lua | 11 ++++++----- data-otservbr-global/npc/queen_eloise.lua | 11 ++++++----- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/data-canary/npc/king_canary.lua b/data-canary/npc/king_canary.lua index d1e872481ee..58d6dbe88d7 100644 --- a/data-canary/npc/king_canary.lua +++ b/data-canary/npc/king_canary.lua @@ -45,6 +45,8 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0 + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -68,7 +70,6 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("In that case, return to me once you made up your mind.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then - local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0 if goldenOutfitQuest < 1 then if player:removeMoneyBank(500000000) then local inbox = player:getStoreInbox() @@ -94,8 +95,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 4 then - if player:kv():get("golden-outfit-quest") == 1 then - if player:kv():get("golden-outfit-quest") < 2 then + if goldenOutfitQuest == 1 then + if goldenOutfitQuest < 2 then if player:removeMoneyBank(250000000) then npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1210, 1) @@ -117,8 +118,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 5 then - if player:kv():get("golden-outfit-quest") == 2 then - if player:kv():get("golden-outfit-quest") < 3 then + if goldenOutfitQuest == 2 then + if goldenOutfitQuest < 3 then if player:removeMoneyBank(250000000) then npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1210, 2) diff --git a/data-otservbr-global/npc/emperor_kruzak.lua b/data-otservbr-global/npc/emperor_kruzak.lua index a2ad657703b..ff5c29739b6 100644 --- a/data-otservbr-global/npc/emperor_kruzak.lua +++ b/data-otservbr-global/npc/emperor_kruzak.lua @@ -50,6 +50,8 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0 + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -73,7 +75,6 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("In that case, return to me once you made up your mind.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then - local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0 if goldenOutfitQuest < 1 then if player:removeMoneyBank(500000000) then local inbox = player:getStoreInbox() @@ -99,8 +100,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 4 then - if player:kv():get("golden-outfit-quest") == 1 then - if player:kv():get("golden-outfit-quest") < 2 then + if goldenOutfitQuest == 1 then + if goldenOutfitQuest < 2 then if player:removeMoneyBank(250000000) then npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1210, 1) @@ -122,8 +123,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 5 then - if player:kv():get("golden-outfit-quest") == 2 then - if player:kv():get("golden-outfit-quest") < 3 then + if goldenOutfitQuest == 2 then + if goldenOutfitQuest < 3 then if player:removeMoneyBank(250000000) then npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1210, 2) diff --git a/data-otservbr-global/npc/king_tibianus.lua b/data-otservbr-global/npc/king_tibianus.lua index d952c0f3b9e..9dbe2094ddb 100644 --- a/data-otservbr-global/npc/king_tibianus.lua +++ b/data-otservbr-global/npc/king_tibianus.lua @@ -46,6 +46,8 @@ npcType.onCloseChannel = function(npc, creature) end local TheNewFrontier = Storage.Quest.U8_54.TheNewFrontier +local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0 + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -78,7 +80,6 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("In that case, return to me once you made up your mind.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then - local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0 if goldenOutfitQuest < 1 then if player:removeMoneyBank(500000000) then local inbox = player:getStoreInbox() @@ -104,8 +105,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 4 then - if player:kv():get("golden-outfit-quest") == 1 then - if player:kv():get("golden-outfit-quest") < 2 then + if goldenOutfitQuest == 1 then + if goldenOutfitQuest < 2 then if player:removeMoneyBank(250000000) then npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1210, 2) @@ -127,8 +128,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 5 then - if player:kv():get("golden-outfit-quest") == 2 then - if player:kv():get("golden-outfit-quest") < 3 then + if goldenOutfitQuest == 2 then + if goldenOutfitQuest < 3 then if player:removeMoneyBank(250000000) then npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1210, 1) diff --git a/data-otservbr-global/npc/percybald.lua b/data-otservbr-global/npc/percybald.lua index 02e8adaf0ce..6f9af4e4933 100644 --- a/data-otservbr-global/npc/percybald.lua +++ b/data-otservbr-global/npc/percybald.lua @@ -50,6 +50,8 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local royalCostumeOutfitQuest = player:kv():get("royal-costume-outfit-quest") or 0 + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -153,7 +155,6 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("If you haven't made up your mind, please come back when you are ready.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 14 then - local royalCostumeOutfitQuest = player:kv():get("royal-costume-outfit-quest") or 0 if royalCostumeOutfitQuest < 1 then if player:removeItem(22516, 15000) and player:removeItem(22721, 12500) then npcHandler:say("Take this armor as a token of great gratitude. Let us forever remember this day, my friend!", npc, creature) @@ -169,8 +170,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 13) elseif npcHandler:getTopic(playerId) == 15 then - if player:kv():get("royal-costume-outfit-quest") == 1 then - if player:kv():get("royal-costume-outfit-quest") < 2 then + if royalCostumeOutfitQuest == 1 then + if royalCostumeOutfitQuest < 2 then if player:removeItem(22516, 7500) and player:removeItem(22721, 6250) then npcHandler:say("Take this sheild as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1457, 1) @@ -192,8 +193,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 13) elseif npcHandler:getTopic(playerId) == 16 then - if player:kv():get("royal-costume-outfit-quest") == 2 then - if player:kv():get("royal-costume-outfit-quest") < 3 then + if royalCostumeOutfitQuest == 2 then + if royalCostumeOutfitQuest < 3 then if player:removeItem(22516, 7500) and player:removeItem(22721, 6250) then npcHandler:say("Take this crown as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1457, 2) diff --git a/data-otservbr-global/npc/queen_eloise.lua b/data-otservbr-global/npc/queen_eloise.lua index 2038ecfd3c8..94cb7510c15 100644 --- a/data-otservbr-global/npc/queen_eloise.lua +++ b/data-otservbr-global/npc/queen_eloise.lua @@ -45,6 +45,8 @@ npcType.onCloseChannel = function(npc, creature) npcHandler:onCloseChannel(npc, creature) end +local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0 + local function creatureSayCallback(npc, creature, type, message) local player = Player(creature) local playerId = player:getId() @@ -68,7 +70,6 @@ local function creatureSayCallback(npc, creature, type, message) npcHandler:say("In that case, return to me once you made up your mind.", npc, creature) npcHandler:setTopic(playerId, 0) elseif npcHandler:getTopic(playerId) == 3 then - local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0 if goldenOutfitQuest < 1 then if player:removeMoneyBank(500000000) then local inbox = player:getStoreInbox() @@ -94,8 +95,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 4 then - if player:kv():get("golden-outfit-quest") == 1 then - if player:kv():get("golden-outfit-quest") < 2 then + if goldenOutfitQuest == 1 then + if goldenOutfitQuest < 2 then if player:removeMoneyBank(250000000) then npcHandler:say("Take this helmet as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1210, 1) @@ -117,8 +118,8 @@ local function creatureSayCallback(npc, creature, type, message) end npcHandler:setTopic(playerId, 2) elseif npcHandler:getTopic(playerId) == 5 then - if player:kv():get("golden-outfit-quest") == 2 then - if player:kv():get("golden-outfit-quest") < 3 then + if goldenOutfitQuest == 2 then + if goldenOutfitQuest < 3 then if player:removeMoneyBank(250000000) then npcHandler:say("Take this boots as a token of great gratitude. Let us forever remember this day, my friend. ", npc, creature) player:addOutfitAddon(1210, 2)