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 3b781c8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions data-canary/npc/king_canary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ local function creatureSayCallback(npc, creature, type, message)
return false
end

local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0
if (MsgContains(message, "outfit")) or (MsgContains(message, "addon")) then
npcHandler:say("In exchange for a truly generous donation, I will offer a special outfit. Do you want to make a donation?", npc, creature)
npcHandler:setTopic(playerId, 1)
Expand All @@ -68,7 +69,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 +94,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 +117,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
10 changes: 5 additions & 5 deletions data-otservbr-global/npc/emperor_kruzak.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ end
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()
local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0

if not npcHandler:checkInteraction(npc, creature) then
return false
Expand All @@ -73,7 +74,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 +99,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 +122,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
10 changes: 5 additions & 5 deletions data-otservbr-global/npc/king_tibianus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ local TheNewFrontier = Storage.Quest.U8_54.TheNewFrontier
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()
local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0

if not npcHandler:checkInteraction(npc, creature) then
return false
Expand Down Expand Up @@ -78,7 +79,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 +104,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 +127,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
10 changes: 5 additions & 5 deletions data-otservbr-global/npc/percybald.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ end
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()
local royalCostumeOutfitQuest = player:kv():get("royal-costume-outfit-quest") or 0

if not npcHandler:checkInteraction(npc, creature) then
return false
Expand Down Expand Up @@ -153,7 +154,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 +169,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 +192,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
10 changes: 5 additions & 5 deletions data-otservbr-global/npc/queen_eloise.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ end
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()
local goldenOutfitQuest = player:kv():get("golden-outfit-quest") or 0

if not npcHandler:checkInteraction(npc, creature) then
return false
Expand All @@ -68,7 +69,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 +94,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 +117,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 3b781c8

Please sign in to comment.