Skip to content

Commit

Permalink
Kilmaresh Quest - Fafnar's Wrath and Organization Storages
Browse files Browse the repository at this point in the history
  • Loading branch information
htc16 committed Nov 7, 2024
1 parent af405dc commit 3750cf7
Show file tree
Hide file tree
Showing 47 changed files with 561 additions and 551 deletions.
131 changes: 66 additions & 65 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,66 +127,6 @@ Storage = {
ThirdStage = 50003,
Crystal = 50004,
},
Kilmaresh = {
-- Reserved storage from 50015 - 50049
Questline = 50015,
First = {
Title = 50016,
},
Second = {
Investigating = 50017,
},
Third = {
Recovering = 50018,
},
Fourth = {
Moe = 50019,
MoeTimer = 50020,
},
Fifth = {
Memories = 50021,
MemoriesShards = 50022,
},
Sixth = {
Favor = 50023,
FourMasks = 50024,
BlessedStatues = 50025,
},
Set = {
Ritual = 50026,
},
Eighth = {
Yonan = 50027,
Narsai = 50028,
Shimun = 50029,
Tefrit = 50030,
},
Nine = {
Owl = 50031,
},
Tem = {
Bleeds = 50032,
},
Eleven = {
Basin = 50033,
},
Twelve = {
Boss = 50034,
Bragrumol = 50035,
Mozradek = 50036,
Xogixath = 50037,
},
Thirteen = {
Fafnar = 50038,
Lyre = 50039,
Presente = 50040,
},
Fourteen = {
Remains = 50041,
},
AccessDoor = 50043,
CatacombDoors = 55047,
},
DeeplingBosses = {
-- Reserved storage from 50075 - 50079
Jaul = 50075,
Expand Down Expand Up @@ -2858,15 +2798,76 @@ Storage = {
},
},
CobraBastion = {
Questline = 52311,
Questline = 46891,
},
},
HandOfTheInquisitionOutfits = {
Outfits = 52312,
Addon1 = 52313,
Addon2 = 52314,
Outfits = 46892,
Addon1 = 46893,
Addon2 = 46894,
},
KilmareshQuest = {
Questline = 46895,
First = {
Title = 46896,
},
Second = {
Investigating = 46897,
},
Third = {
Recovering = 46898,
},
Fourth = {
Moe = 46899,
MoeTimer = 46890,
},
Fifth = {
Memories = 46891,
MemoriesShards = 46892,
},
Sixth = {
Favor = 46893,
FourMasks = 46894,
BlessedStatues = 46895,
IvoryMask = 46896,
MirrorMask = 46897,
SilverMask = 46898,
GryphonMask = 46899,
},
Set = {
Ritual = 46900,
},
Eighth = {
Yonan = 46901,
Narsai = 46903,
Shimun = 46904,
Tefrit = 46905,
},
Nine = {
Owl = 46906,
},
Tem = {
Bleeds = 46907,
},
Eleven = {
Basin = 46908,
},
Twelve = {
Boss = 46909,
Bragrumol = 46910,
Mozradek = 46911,
Xogixath = 46912,
},
Thirteen = {
Fafnar = 46913,
Lyre = 46914,
Presente = 46915,
},
Fourteen = {
Remains = 46916,
},
AccessDoor = 46917,
},
Kilmaresh = {},
Orcsoberfest = {},
},
U12_30 = { -- update 12.30 - Reserved Storages 47001 - 47200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ monster.corpse = 0
monster.speed = 95
monster.manaCost = 0

monster.events = {
"UrmahlulluChanges",
}

monster.changeTarget = {
interval = 4000,
chance = 10,
Expand Down Expand Up @@ -57,9 +61,6 @@ monster.flags = {
canWalkOnPoison = true,
}

monster.events = {
"UrmahlulluChanges",
}
monster.light = {
level = 0,
color = 0,
Expand Down
86 changes: 43 additions & 43 deletions data-otservbr-global/npc/alyxo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ local function greetCallback(npc, creature)
local player = Player(creature)
local playerId = player:getId()

if player:getStorageValue(Storage.Kilmaresh.First.Access) < 1 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Access) < 1 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 1)
elseif (player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Kilmaresh.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Kilmaresh.First.Mission) < 3 then
elseif (player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) >= 0 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.JamesfrancisTask) <= 50) and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) < 3 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
npcHandler:setTopic(playerId, 15)
elseif player:getStorageValue(Storage.Kilmaresh.First.Mission) == 4 then
elseif player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission) == 4 then
npcHandler:setMessage(MESSAGE_GREET, "How could I help you?") -- It needs to be revised, it's not the same as the global
player:setStorageValue(Storage.Kilmaresh.First.Mission, 5)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.First.Mission, 5)
npcHandler:setTopic(playerId, 20)
end
return true
Expand All @@ -73,98 +73,98 @@ local function creatureSayCallback(npc, creature, type, message)

-- Mission 3 Steal The Ambassador Ring
if MsgContains(message, "mission") then
if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 1 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 1 then
npcHandler:setTopic(playerId, 1)
end
npcHandler:say({ "Could you kill 3 bosses for me?" }, npc, creature) -- needs review, this is not the speech of the global
elseif MsgContains(message, "yes") then
if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 1 then
if npcHandler:getTopic(playerId) == 1 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 1 then
npcHandler:say({ "Come back as soon as you kill all 3 bosses." }, npc, creature) -- needs review, this is not the speech of the global
player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 2)
player:setStorageValue(Storage.Kilmaresh.Twelve.Bragrumol, 1)
player:setStorageValue(Storage.Kilmaresh.Twelve.Mozradek, 1)
player:setStorageValue(Storage.Kilmaresh.Twelve.Xogixath, 1)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 2)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol, 1)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek, 1)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath, 1)
npcHandler:setTopic(playerId, 2)
else
npcHandler:say({ "Sorry, you do not have access." }, npc, creature)
npcHandler:setTopic(playerId, 0)
end
end
-- Mission 3 Steal The Ambassador Ring
if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then
if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then
if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then
npcHandler:say({ "Did you manage to face all 3 bosses?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 3)
end
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 2 then
if player:getStorageValue(Storage.Kilmaresh.Twelve.Bragrumol) == 2 and player:getStorageValue(Storage.Kilmaresh.Twelve.Mozradek) == 2 and player:getStorageValue(Storage.Kilmaresh.Twelve.Xogixath) == 2 then
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 3 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 2 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Bragrumol) == 2 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Mozradek) == 2 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Xogixath) == 2 then
npcHandler:say({ "I am very satisfied." }, npc, creature) -- needs review, this is not the speech of the global
player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 3)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 3)
npcHandler:setTopic(playerId, 4)
else
npcHandler:say({ "Sorry." }, npc, creature)
npcHandler:setTopic(playerId, 0)
end
end
if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then
if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then
if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then
npcHandler:say({ "Could you help me with some more work?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 5)
npcHandler:setTopic(playerId, 5)
end
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then
if player:getStorageValue(Storage.Kilmaresh.Twelve.Boss) == 3 then
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 5 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss) == 3 then
npcHandler:say({ "Kill 300 members of the Fafnar cult, help me find Ivory Lyre and help me find an animal to stone." }, npc, creature) -- needs review, this is not the speech of the global
player:setStorageValue(Storage.Kilmaresh.Twelve.Boss, 4)
player:setStorageValue(Storage.Kilmaresh.Thirteen.Fafnar, 1)
player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 1)
player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 1)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Twelve.Boss, 4)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, 1)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 1)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 1)
npcHandler:setTopic(playerId, 6)
else
npcHandler:say({ "Sorry." }, npc, creature)
npcHandler:setTopic(playerId, 0)
end
end
if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then
if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then
if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then
npcHandler:say({ "Have you finished killing the 300 members of Fafnar's cult?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 7)
end
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 7 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then
if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 300 then
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 7 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 300 then
npcHandler:say({ "Thanks. You killed the 300 members of the Fafnar cult." }, npc, creature) -- needs review, this is not the speech of the global
player:setStorageValue(Storage.Kilmaresh.Thirteen.Fafnar, 301)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar, 301)
npcHandler:setTopic(playerId, 8)
else
npcHandler:say({ "Sorry." }, npc, creature)
npcHandler:setTopic(playerId, 0)
end
end
if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then
if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then
if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then
npcHandler:say({ "Did you manage to find Lyre?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 9)
end
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 9 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 then
if player:getStorageValue(Storage.Kilmaresh.Thirteen.Lyre) == 3 and player:getItemById(31447, 1) then
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 9 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre) == 3 and player:getItemById(31447, 1) then
player:removeItem(31447, 1)
npcHandler:say({ "Thanks. I was looking for Lyre for a long time." }, npc, creature) -- needs review, this is not the speech of the global
player:setStorageValue(Storage.Kilmaresh.Thirteen.Lyre, 4)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Lyre, 4)
else
npcHandler:say({ "Sorry." }, npc, creature)
npcHandler:setTopic(playerId, 0)
end
end
if MsgContains(message, "report") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then
if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then
if MsgContains(message, "report") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then
npcHandler:say({ "Did you manage to find Small Tortoise?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 11)
end
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 11 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 then
if player:getStorageValue(Storage.Kilmaresh.Thirteen.Presente) == 2 and player:getItemById(31445, 1) then
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 11 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente) == 2 and player:getItemById(31445, 1) then
player:removeItem(31445, 1)
npcHandler:say({ "Thanks. I was looking for Small Tortoise." }, npc, creature) -- needs review, this is not the speech of the global
player:setStorageValue(Storage.Kilmaresh.Thirteen.Presente, 3)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Presente, 3)
npcHandler:setTopic(playerId, 12)
else
npcHandler:say({ "Sorry." }, npc, creature)
Expand All @@ -187,17 +187,17 @@ local function creatureSayCallback(npc, creature, type, message)
npcHandler:setTopic(playerId, 0)
end
end
if MsgContains(message, "mission") and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then
if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then
if MsgContains(message, "mission") and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then
npcHandler:say({ "Did you finish the 3 jobs I gave you?" }, npc, creature) -- needs review, this is not the speech of the global
npcHandler:setTopic(playerId, 13)
end
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 13 and player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then
if player:getStorageValue(Storage.Kilmaresh.Thirteen.Fafnar) == 301 then
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 13 and player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Thirteen.Fafnar) == 301 then
player:addAchievement("Sculptor Apprentice", 'Congratulations! You earned the achievement "Sculptor Apprentice".')
player:addItem(31574, 1)
npcHandler:say({ "Congratulations, you have completed the 3 jobs I gave you." }, npc, creature) -- needs review, this is not the speech of the global
player:setStorageValue(Storage.Kilmaresh.Fourteen.Remains, 1)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Fourteen.Remains, 1)
npcHandler:setTopic(playerId, 14)
else
npcHandler:say({ "Sorry." }, npc, creature)
Expand Down
42 changes: 25 additions & 17 deletions data-otservbr-global/npc/ambassador_of_rathleton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,31 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

keywordHandler:addKeyword({ "present" }, StdModule.say, {
npcHandler = npcHandler,
text = "This is a very beautiful ring. Thank you for this generous present!",
}, function(player)
return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 2 and player:getItemById(31263, true)
end, function(player)
player:removeItem(31263, 1)
player:setStorageValue(Storage.Kilmaresh.Fourth.Moe, 1)
player:setStorageValue(Storage.Kilmaresh.Third.Recovering, 3)
end)

keywordHandler:addKeyword({ "present" }, StdModule.say, {
npcHandler = npcHandler,
text = "Didn't you bring my gift?",
}, function(player)
return player:getStorageValue(Storage.Kilmaresh.Third.Recovering) == 2
end)
local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
local playerId = player:getId()

if not npcHandler:checkInteraction(npc, creature) then
return false
end

if MsgContains(message, "present") then
if player:getStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering) == 2 then
if player:getItemById(31263, true) then
npcHandler:say("This is a very beautiful ring. Thank you for this generous present!", npc, creature)
player:removeItem(31263, 1)
player:setStorageValue(Storage.Quest.U12_20.KilmareshQuest.Third.Recovering, 3)
else
npcHandler:say("Didn't you bring my gift?", npc, creature)
end
else
npcHandler:say("I don't need a present right now. Thank you.", npc, creature)
end
end

return true
end

npcHandler:setMessage(MESSAGE_GREET, "Greetings, friend.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Well, bye then.")

Expand Down
Loading

0 comments on commit 3750cf7

Please sign in to comment.