Skip to content

Commit

Permalink
resolve conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Apr 22, 2024
1 parent bbe3701 commit 4cd971c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 25 deletions.
11 changes: 6 additions & 5 deletions data-canary/npc/king_canary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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)
Expand All @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions data-otservbr-global/npc/emperor_kruzak.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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)
Expand All @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions data-otservbr-global/npc/king_tibianus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions data-otservbr-global/npc/percybald.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions data-otservbr-global/npc/queen_eloise.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 4cd971c

Please sign in to comment.