Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: quests from version 11 revised #2938

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
12 changes: 6 additions & 6 deletions data-otservbr-global/lib/core/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5250,22 +5250,22 @@ if not Quests then
},
[37] = {
name = "The First Dragon",
startStorageId = Storage.FirstDragon.Questline,
startStorageId = Storage.Quest.U11_02.TheFirstDragon.Questline,
startStorageValue = 1,
missions = {
[1] = {
name = "Power",
storageId = Storage.FirstDragon.DragonCounter,
storageId = Storage.Quest.U11_02.TheFirstDragon.DragonCounter,
missionId = 10368,
startValue = 0,
endValue = 200,
description = function(player)
return ("You already hunted %d/200 dragons."):format(player:getStorageValue(Storage.FirstDragon.DragonCounter))
return ("You already hunted %d/200 dragons."):format(player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.DragonCounter))
end,
},
[2] = {
name = "Treasure",
storageId = Storage.FirstDragon.ChestCounter,
storageId = Storage.Quest.U11_02.TheFirstDragon.ChestCounter,
missionId = 10369,
startValue = 0,
endValue = 20,
Expand All @@ -5274,7 +5274,7 @@ if not Quests then
},
[3] = {
name = "Knowledge",
storageId = Storage.FirstDragon.GelidrazahAccess,
storageId = Storage.Quest.U11_02.TheFirstDragon.GelidrazahAccess,
missionId = 10370,
startValue = 0,
endValue = 1,
Expand All @@ -5283,7 +5283,7 @@ if not Quests then
},
[4] = {
name = "Life",
storageId = Storage.FirstDragon.SecretsCounter,
storageId = Storage.Quest.U11_02.TheFirstDragon.SecretsCounter,
missionId = 10371,
startValue = 0,
endValue = 3,
Expand Down
48 changes: 25 additions & 23 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -393,27 +393,6 @@ Storage = {
AccessDoor = 50263,
},
},
FirstDragon = {
-- Reserved storage from 50350 - 50379
Questline = 50350,
DragonCounter = 50351,
ChestCounter = 50352,
SecretsCounter = 50355,
GelidrazahAccess = 50356,
DesertTile = 50358,
StoneSculptureTile = 50359,
SuntowerTile = 50360,
Horn = 50362,
Scale = 50363,
Bones = 50364,
Tooth = 50365,
AccessCave = 50366,
SomewhatBeatable = 50367,
FirstDragonTimer = 50368,
RewardFeather = 50369,
RewardMask = 50370,
RewardBackpack = 50371,
},
HeroRathleton = {
-- Reserved storage from 50400 - 50419
QuestLine = 50400,
Expand Down Expand Up @@ -2522,8 +2501,31 @@ Storage = {
HeartOfDestruction = {},
},
U11_02 = { -- update 11.02 - Reserved Storages 45451 - 45650
FestiveOutfits = {},
FirstDragon = {},
FestiveOutfits = {
Addon1 = 45451,
Addon2 = 45452,
},
TheFirstDragon = {
Questline = 45453,
DragonCounter = 45454,
ChestCounter = 45455,
SecretsCounter = 45456,
GelidrazahAccess = 45457,
DesertTile = 45458,
StoneSculptureTile = 45459,
SuntowerTile = 45460,
Horn = 45461,
Scale = 45462,
Bones = 45463,
Tooth = 45464,
AccessCave = 45465,
SomewhatBeatable = 45466,
FirstDragonTimer = 45467,
RewardFeather = 45468,
RewardMask = 45469,
RewardBackpack = 45470,
Feathers = 45471,
},
ForgottenKnowledge = {},
},
U11_40 = { -- update 11.40 - Reserved Storages 45651 - 45850
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ monster.corpse = 2983
monster.speed = 55
monster.manaCost = 0

monster.events = {
"AngryPlantDeath",
}

monster.changeTarget = {
interval = 2000,
chance = 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ monster.corpse = 775
monster.speed = 150
monster.manaCost = 0

monster.events = {
"FallenDeath",
}

monster.changeTarget = {
interval = 5000,
chance = 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ monster.corpse = 0
monster.speed = 125
monster.manaCost = 0

monster.events = {
"DragonEssenceDeath",
}

monster.changeTarget = {
interval = 2000,
chance = 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ monster.flags = {
}

monster.events = {
"Somewhat Beatable Death",
"SomewhatBeatableDeath",
}

monster.light = {
Expand Down
8 changes: 4 additions & 4 deletions data-otservbr-global/npc/buddel_helheim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ addTravelKeyword("svargrond", "You know a town nicer than this? NICER DICER! Apr
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -90,7 +90,7 @@ addTravelKeyword("okolnir", "It's nice there. Except of the ice dragons which ar
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -101,7 +101,7 @@ addTravelKeyword("tyrsung", "*HICKS* Big, big island east of here. Venorian hunt
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -112,7 +112,7 @@ addTravelKeyword("camp", "Both of you look like you could defend yourself! If yo
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand Down
8 changes: 4 additions & 4 deletions data-otservbr-global/npc/buddel_okolnir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ addTravelKeyword("svargrond", "You know a town nicer than this? NICER DICER! Apr
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -93,7 +93,7 @@ addTravelKeyword("camp", "Both of you look like you could defend yourself! If yo
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -104,7 +104,7 @@ addTravelKeyword("helheim", "T'at is a small island to the east.", Position(3246
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -117,7 +117,7 @@ addTravelKeyword("tyrsung", "*HICKS* Big, big island east of here. Venorian hunt
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand Down
8 changes: 4 additions & 4 deletions data-otservbr-global/npc/buddel_raider_camp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ addTravelKeyword("svargrond", "You know a town nicer than this? NICER DICER! Apr
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -93,7 +93,7 @@ addTravelKeyword("okolnir", "It's nice there. Except of the ice dragons which ar
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -104,7 +104,7 @@ addTravelKeyword("helheim", "T'at is a small island to the east.", Position(3246
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -117,7 +117,7 @@ addTravelKeyword("tyrsung", "*HICKS* Big, big island east of here. Venorian hunt
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand Down
8 changes: 4 additions & 4 deletions data-otservbr-global/npc/buddel_tyrsung.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ addTravelKeyword("svargrond", "You know a town nicer than this? NICER DICER! Apr
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -93,7 +93,7 @@ addTravelKeyword("okolnir", "It's nice there. Except of the ice dragons which ar
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -104,7 +104,7 @@ addTravelKeyword("helheim", "T'at is a small island to the east.", Position(3246
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand All @@ -117,7 +117,7 @@ addTravelKeyword("camp", "Both of you look like you could defend yourself! If yo
end, function()
return math.random(5) > 1
end, function(player)
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) < 8
return player:getStorageValue(Storage.Quest.U8_0.BarbarianTest.Questline) == 8
end, function(player)
return player:getItemCount(3097) > 0
end, function(player)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/gelidrazahs_thirst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ local function creatureSayCallback(npc, creature, type, message)
elseif MsgContains(message, "Svir") and npcHandler:getTopic(playerId) == 4 then
npcHandler:say("That is correct. You satisfactorily answered all questions. You may pass and enter Gelidrazah's lair.", npc, creature)
npcHandler:setTopic(playerId, 0)
player:setStorageValue(Storage.FirstDragon.GelidrazahAccess, 1)
player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.GelidrazahAccess, 1)
else
npcHandler:say("I don't know what you are talking about.", npc, creature)
end
Expand Down
56 changes: 56 additions & 0 deletions data-otservbr-global/npc/kizar.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
local internalNpcName = "Kizar"
local npcType = Game.createNpcType(internalNpcName)
local npcConfig = {}

npcConfig.name = internalNpcName
npcConfig.description = internalNpcName

npcConfig.health = 100
npcConfig.maxHealth = npcConfig.health
npcConfig.walkInterval = 2000
npcConfig.walkRadius = 2

npcConfig.outfit = {
lookType = 132,
lookHead = 114,
lookBody = 68,
lookLegs = 19,
lookFeet = 115,
lookAddons = 0,
}

npcConfig.flags = {
floorchange = false,
}

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)

npcType.onThink = function(npc, interval)
npcHandler:onThink(npc, interval)
end

npcType.onAppear = function(npc, creature)
npcHandler:onAppear(npc, creature)
end

npcType.onDisappear = function(npc, creature)
npcHandler:onDisappear(npc, creature)
end

npcType.onMove = function(npc, creature, fromPosition, toPosition)
npcHandler:onMove(npc, creature, fromPosition, toPosition)
end

npcType.onSay = function(npc, creature, type, message)
npcHandler:onSay(npc, creature, type, message)
end

npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
Loading