Skip to content

Commit

Permalink
Beggar Outfits Quest
Browse files Browse the repository at this point in the history
  • Loading branch information
htc16 committed Jul 5, 2024
1 parent 571c743 commit 82400e5
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 184 deletions.
6 changes: 4 additions & 2 deletions data-otservbr-global/lib/core/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2193,10 +2193,10 @@ if not Quests then
},
[5] = {
name = "Beggar Outfit: The Newest Fashion",
storageId = Storage.OutfitQuest.BeggarOutfit,
storageId = Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit,
missionId = 10172,
startValue = 1,
endValue = 6,
endValue = 8,
states = {
[1] = "Your current task is to bring Hugo 20 pieces of brown cloth, like the worn and ragged ghoul clothing.",
[2] = "Your current task is to bring 50 pieces of minotaur leather to Hugo. \z
Expand All @@ -2206,6 +2206,8 @@ if not Quests then
[5] = "You brought all items required for the "poor man's look" to Hugo. \z
He told you to come back to him after a whole day has passed, then the outfit should be finished.",
[6] = "You got the outfit!",
[7] = "Now you need to go after the items to get the first addon.",
[8] = "Congratulations, you delivered the items for the first addon.",
},
},
[6] = {
Expand Down
16 changes: 9 additions & 7 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -755,19 +755,14 @@ Storage = {
AddonBackpack = 50969,
AddonBackpackTimer = 50970,
},
-- Begger Outfit Quest
BeggarFirstAddonDoor = 50975, -- Staff quest
BeggarSecondAddon = 50976,

-- Druid-outfit Quest
DruidHatAddon = 50977,
DruidBodyAddon = 50978,
DruidAmuletDoor = 50979,
-- Barbarian-outfit Quest
BarbarianAddon = 50980,
BarbarianAddonWaitTimer = 50981,
-- Beggar
BeggarOutfit = 50982,
BeggarOutfitTimer = 50983,
-- Hunter-outfit Quest
HunterMusicSheet01 = 50984,
HunterMusicSheet02 = 50985,
Expand Down Expand Up @@ -1324,6 +1319,7 @@ Storage = {
DragahsSpellbook = 51768,
StealFromThieves = 51769,
WitchHouseQuest = 51770,
SimonTheBeggarsFavoriteStaff = 51771,
},
PitsOfInferno = {
-- Reserved storage from 52000 - 52019
Expand Down Expand Up @@ -2017,8 +2013,14 @@ Storage = {
AssassinFirstAddon = 40762,
AssassinSecondAddon = 40763,
},
BeggarOutfits = {
BeggarOutfit = 40764,
BeggarOutfitTimer = 40765,
BeggarFirstAddonDoor = 40766,
BeggarSecondAddon = 40767,
BeggarOutfitTimerAddon = 40768,
},
BarbarianOutfits = {},
BeggarOutfits = {},
CitizenOutfits = {},
CitizenOutfitsRook = {},
DruidOutfits = {},
Expand Down
22 changes: 11 additions & 11 deletions data-otservbr-global/npc/hugo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,28 +134,28 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

if player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) < 1 then
if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) < 1 then
npcHandler:say({
"I think I'm having an innovative vision! I feel that people are getting tired of attempting to look wealthy and of displaying their treasures. ...",
"A really new and innovative look would be - the 'poor man's look'! I can already see it in front of me... yes... a little ragged... but not too shabby! ...",
"I need material right now! Argh - the vision starts to fade... please hurry, can you bring me some stuff?",
}, npc, creature)
npcHandler:setTopic(playerId, 2)
elseif player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) > 0 and player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) < 5 then
elseif player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) > 0 and player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) < 5 then
npcHandler:say("I am so excited! This poor man's look will be an outfit like the world has never seen before.", npc, creature)
elseif player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) == 5 then
if player:getStorageValue(Storage.OutfitQuest.BeggarOutfitTimer) > os.time() then
elseif player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 5 then
if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimer) > os.time() then
npcHandler:say("Sorry, but I am not done with the outfit yet. Venore wasn't built in a day.", npc, creature)
elseif player:getStorageValue(Storage.OutfitQuest.BeggarOutfitTimer) > 0 and player:getStorageValue(Storage.OutfitQuest.BeggarOutfitTimer) < os.time() then
elseif player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimer) > 0 and player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimer) < os.time() then
npcHandler:say("Eureka! Alas, the poor man's outfit is finished, but... to be honest... it turned out much less appealing than I expected. However, you can have it if you want, okay?", npc, creature)
npcHandler:setTopic(playerId, 5)
end
elseif player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) == 6 then
elseif player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) == 6 then
npcHandler:say("I guess my vision wasn't that grand after all. I hope there are still people who enjoy it.", npc, creature)
end
elseif config[message:lower()] then
local targetMessage = config[message:lower()]
if player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) ~= targetMessage.value then
if player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) ~= targetMessage.value then
npcHandler:say(targetMessage.messages.done, npc, creature)
return true
end
Expand All @@ -175,7 +175,7 @@ local function creatureSayCallback(npc, creature, type, message)
if player:getStorageValue(Storage.OutfitQuest.DefaultStart) ~= 1 then
player:setStorageValue(Storage.OutfitQuest.DefaultStart, 1)
end
player:setStorageValue(Storage.OutfitQuest.BeggarOutfit, 1)
player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 1)
npcHandler:say("Terrific! What are you waiting for?! Start right away gathering 20 pieces of brown cloth and come back once you have them!", npc, creature)
npcHandler:setTopic(playerId, 0)
elseif npcHandler:getTopic(playerId) == 4 then
Expand All @@ -185,16 +185,16 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

player:setStorageValue(Storage.OutfitQuest.BeggarOutfit, player:getStorageValue(Storage.OutfitQuest.BeggarOutfit) + 1)
player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, player:getStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit) + 1)
if targetMessage.lastItem then
player:setStorageValue(Storage.OutfitQuest.BeggarOutfitTimer, os.time() + 86400)
player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfitTimer, os.time() + 86400)
end
npcHandler:say(targetMessage.messages.success, npc, creature)
npcHandler:setTopic(playerId, 0)
elseif npcHandler:getTopic(playerId) == 5 then
player:addOutfit(153)
player:addOutfit(157)
player:setStorageValue(Storage.OutfitQuest.BeggarOutfit, 6)
player:setStorageValue(Storage.Quest.U7_8.BeggarOutfits.BeggarOutfit, 6)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
npcHandler:say("Here you go. Maybe you enjoy if after all.", npc, creature)
npcHandler:setTopic(playerId, 0)
Expand Down
Loading

0 comments on commit 82400e5

Please sign in to comment.