Skip to content

Commit

Permalink
The Great Dragon Hunt Quest
Browse files Browse the repository at this point in the history
  • Loading branch information
htc16 committed Sep 16, 2024
1 parent d4c7e89 commit 37e2cae
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 96 deletions.
40 changes: 11 additions & 29 deletions data-otservbr-global/lib/core/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5597,38 +5597,20 @@ if not Quests then
},
},
},
[40] = { -- FREE SLOT FOR A SIMPLE QUEST
name = "XXXXXXXXXXXX",
startStorageId = Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton,
startStorageValue = 1,
missions = {
[1] = {
name = "XXXXXXXXXXXX",
storageId = Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton,
missionId = 10387,
startValue = 1,
endValue = 2,
states = {
[1] = "XXXXXXXXXXXX",
[2] = "XXXXXXXXXXXX",
},
},
},
},
[41] = {
[40] = {
name = "Adventurers Guild",
startStorageId = Storage.AdventurersGuild.QuestLine,
startStorageValue = 1,
missions = {
[1] = {
name = "The Great Dragon Hunt",
storageId = Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton,
storageId = Storage.Quest.U10_80.TheGreatDragonHunt.WarriorSkeleton,
missionId = 10388,
startValue = 0,
endValue = 2,
description = function(player)
return ("You are exploring the Kha'zeel Dragon Lairs. Others obviously found a terrible end here. \z
But the dragon hoards might justify the risks. You killed %d/50 dragons and dragon lords."):format(math.max(player:getStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter), 0))
But the dragon hoards might justify the risks. You killed %d/50 dragons and dragon lords."):format(math.max(player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter), 0))
end,
},
[2] = {
Expand All @@ -5645,7 +5627,7 @@ if not Quests then
},
},
},
[42] = {
[41] = {
name = "Dawnport",
startStorageId = Storage.Quest.U10_55.Dawnport.Questline,
startStorageValue = 1,
Expand Down Expand Up @@ -5740,7 +5722,7 @@ if not Quests then
},
},
},
[43] = {
[42] = {
name = "The Rookie Guard",
startStorageId = Storage.Quest.U9_1.TheRookieGuard.Questline,
startStorageValue = 1,
Expand Down Expand Up @@ -5922,7 +5904,7 @@ if not Quests then
},
},
},
[44] = {
[43] = {
name = "The New Frontier",
startStorageId = Storage.Quest.U8_54.TheNewFrontier.Questline,
startStorageValue = 1,
Expand Down Expand Up @@ -6171,7 +6153,7 @@ if not Quests then
},
},
},
[45] = {
[44] = {
name = "Spirithunters Quest",
startStorageId = Storage.Quest.U8_7.SpiritHunters.Mission01,
startStorageValue = 1,
Expand Down Expand Up @@ -6211,7 +6193,7 @@ if not Quests then
},
},
},
[46] = {
[45] = {
name = "Threatened Dreams",
startStorageId = Storage.Quest.U11_40.ThreatenedDreams.QuestLine,
startStorageValue = 1,
Expand Down Expand Up @@ -6306,7 +6288,7 @@ if not Quests then
},
},
},
[47] = {
[46] = {
name = "Blood Brothers",
startStorageId = Storage.Quest.U8_4.BloodBrothers.QuestLine,
startStorageValue = 1,
Expand Down Expand Up @@ -6359,7 +6341,7 @@ if not Quests then
},
},
},
[48] = {
[47] = {
name = "Grave Danger",
startStorageId = Storage.Quest.U12_20.GraveDanger.QuestLine,
startStorageValue = 1,
Expand Down Expand Up @@ -6536,7 +6518,7 @@ if not Quests then
},
},
},
[49] = {
[48] = {
name = "The Outlaw Camp",
startStorageId = Storage.Quest.U6_4.OutlawCampQuest,
startStorageValue = 1,
Expand Down
18 changes: 9 additions & 9 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,6 @@ Storage = {
Yberius = 52144,
Rahkem = 52145,
},
GreatDragonHunt = {
WarriorSkeleton = 52146,
DragonCounter = 52147,
},
QuestLine = 52148,
TheLostBrother = 52149,
},
Expand Down Expand Up @@ -2459,16 +2455,20 @@ Storage = {
ChakoyaIcebergMiniWorldChange = {},
GrimvaleMineWorldChange = {},
GrimvaleQuest = {
AncientFeudDoors = 44956,
AncientFeudShortcut = 44957,
SilverVein = 50380,
WereHelmetEnchant = 50381,
AncientFeudDoors = 45150,
AncientFeudShortcut = 45151,
SilverVein = 45152,
WereHelmetEnchant = 45153,
},
HiveOutpostMiniWorldChange = {},
JungleCampMiniWorldChange = {},
NightmareIslesMiniWorldChange = {},
PoacherCavesMiniWorldChange = {},
TheGreatDragonHunt = {},
TheGreatDragonHunt = {
WarriorSkeleton = 45180,
DragonCounter = 45181,
Achievement = 45182,
},
TheTaintedSouls = {},
},
U10_90 = { -- update 10.90 - Reserved Storages 45201 - 45350
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ local questTable = {
{ storage = Storage.Quest.U11_40.ThreatenedDreams.Mission01[1], storageValue = 16 },
{ storage = Storage.Quest.U11_40.ThreatenedDreams.Mission02.KroazurAccess, storageValue = 1 },
{ storage = Storage.AdventurersGuild.QuestLine, storageValue = 1 },
{ storage = Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton, storageValue = 1 },
{ storage = Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton, storageValue = 2 },
{ storage = Storage.Quest.U10_80.TheGreatDragonHunt.WarriorSkeleton, storageValue = 1 },
{ storage = Storage.Quest.U10_80.TheGreatDragonHunt.WarriorSkeleton, storageValue = 2 },
{ storage = Storage.AdventurersGuild.TheLostBrother, storageValue = 3 },
{ storage = Storage.Quest.U10_55.Dawnport.Questline, storageValue = 1 },
{ storage = Storage.Quest.U10_55.Dawnport.GoMain, storageValue = 1 },
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
local items = {
{ description = "a platinum coins", items = { { id = ITEM_PLATINUM_COIN, count = 5 } } },
{
description = "some gems",
items = {
{ id = 3029, count = 1 },
{ id = 3032, count = 1 },
{ id = 3030, count = 1 },
},
},
{ description = "a life ring", items = { { id = 3089, count = 1 } } },
{ description = "a red gem", items = { { id = 3039, count = 1 } } },
{ description = "a mana potion", items = { { id = 237, count = 10 } } },
{ description = "a health potion", items = { { id = 236, count = 8 } } },
}

local adventurersTreasure = Action()

function adventurersTreasure.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter) >= 50 then
local treasure = items[math.random(#items)]
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is impossible to take along all of the treasures here. But you pick out " .. treasure.description)
for _, item in ipairs(treasure.items) do
player:addItem(item.id, item.count)
end

player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter, 0)

local times = player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.Achievement)
if times < 0 then
times = 0
end
times = times + 1
player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.Achievement, times)

if times == 10 then
player:addAchievement("Hoard of the Dragon")
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to pick a treasure, but you hear further dragons approaching. You should kill some more before picking out something.")
end

return true
end

adventurersTreasure:aid(50808)
adventurersTreasure:register()
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
local adventurersWarriorSkeleton = Action()

function adventurersWarriorSkeleton.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton) < 1 then
if player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.WarriorSkeleton) < 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have discovered a deceased warrior's skeleton. It seems he tried to hunt the dragons around here - and failed.")
player:addItem(5882, 1) -- red dragon scale
player:addItem(5882, 1)

if player:getStorageValue(Storage.AdventurersGuild.QuestLine) < 1 then
player:setStorageValue(Storage.AdventurersGuild.QuestLine, 1)
end

player:setStorageValue(Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton, 1)
player:setStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter, 0)
player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.WarriorSkeleton, 1)
player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter, 0)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The dead explorer is empty.")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function adventurersGuildHunt.onDeath(creature, _corpse, _lastHitKiller, mostDam
return true
end
onDeathForParty(creature, mostDamageKiller, function(creature, player)
player:setStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter, math.max(0, player:getStorageValue(Storage.AdventurersGuild.GreatDragonHunt.DragonCounter)) + 1)
player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter, math.max(0, player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter)) + 1)
end)
return true
end
Expand Down
7 changes: 7 additions & 0 deletions data-otservbr-global/startup/tables/corpse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ CorpseAction = {
{ x = 32031, y = 32914, z = 8 },
},
},
-- The Great Dragon Hunt Quest
[50806] = {
itemId = 21412,
itemPos = {
{ x = 32991, y = 32642, z = 8 },
},
},
}

CorpseUnique = {
Expand Down
12 changes: 12 additions & 0 deletions data-otservbr-global/startup/tables/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,18 @@ ItemAction = {
{ x = 32788, y = 32227, z = 14 },
},
},
-- The Great Dragon Hunt Quest
[50808] = {
itemId = false,
itemPos = {
{ x = 33010, y = 32638, z = 5 },
{ x = 33039, y = 32652, z = 6 },
{ x = 33010, y = 32687, z = 7 },
{ x = 33037, y = 32662, z = 7 },
{ x = 33078, y = 32657, z = 6 },
{ x = 32994, y = 32625, z = 6 },
},
},
-- Roshamuul Quest
[55000] = {
itemId = false,
Expand Down

0 comments on commit 37e2cae

Please sign in to comment.