Skip to content

Commit

Permalink
Merge branch 'main' into dudantas/feat-soul-war-quest
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed Apr 29, 2024
2 parents cd7a82c + 98e927d commit 8035147
Show file tree
Hide file tree
Showing 63 changed files with 688 additions and 390 deletions.
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ bld/
[Ll]og/
build/
vcproj/
!vcproj/canary.sln
!vcproj/canary.vcxproj
!vcproj/settings.props

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down Expand Up @@ -372,19 +375,14 @@ config.lua
config_canary.lua
client_assertions.txt
.env
otservbr.otbm
canary.otbm
otservbr-custom.otbm
data-otservbr-global/world/otservbr.otbm

# Extensions
*.ini
*.otb
*.exe
*.manifest
*.rar
*-house.xml
*-monster.xml
*-npc.xml
monster_count.txt

# SFTP for Sublime
Expand All @@ -398,4 +396,4 @@ canary.old
vcpkg_installed

# CLION
cmake-build-debug*
cmake-build-*
4 changes: 4 additions & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ wheelAtelierRevealGreaterCost = 6000000
familiarTime = 30

partyAutoShareExperience = true
-- partyShareRangeMultiplier: the range of the party share experience, default 3/2 (1.5)
partyShareRangeMultiplier = 1.5
partyShareLootBoosts = false
partyShareLootBoostsDimishingFactor = 0.7

Expand Down Expand Up @@ -239,6 +241,7 @@ onlyPremiumAccount = false
-- NOTE: enablePlayerPutItemInAmmoSlot = true, will enable players to put any items on ammo slot, more used in custom shopping system
-- NOTE: startStreakLevel will make a reward streak level for new players who never logged in
-- NOTE: if showLootsInBestiary is true, will cause all loots to be shown in the bestiary even if the player has not reached the required number of kills
-- NOTE: minTownIdToBankTransfer blocks towns less than defined from receiving money transfers
stashMoving = false
depotChest = 4
autoLoot = false
Expand All @@ -257,6 +260,7 @@ storeInboxMaxLimit = 2000
enablePlayerPutItemInAmmoSlot = false
startStreakLevel = 0
showLootsInBestiary = false
minTownIdToBankTransfer = 3

-- Teleport summon
-- Set to true will never remove the summon
Expand Down
14 changes: 13 additions & 1 deletion data-otservbr-global/lib/core/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5592,7 +5592,7 @@ if not Quests then
},
[41] = {
name = "Adventurers Guild",
startStorageId = Storage.AdventurersGuild.GreatDragonHunt.WarriorSkeleton,
startStorageId = Storage.AdventurersGuild.QuestLine,
startStorageValue = 1,
missions = {
[1] = {
Expand All @@ -5606,6 +5606,18 @@ if not Quests then
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))
end,
},
[2] = {
name = "The Lost Brother",
storageId = Storage.AdventurersGuild.TheLostBrother,
missionId = 11000,
startValue = 1,
endValue = 3,
states = {
[1] = "At the Kha'zeel Mountains you met the merchant Tarun. His brother has gone missing and was last seen following a beautiful woman into a palace. Tarun fears this woman might have been a demon.",
[2] = "You found the remains of Tarun's brother containing a message. Go back to Tarun and report his brother's last words.",
[3] = "You told Tarun about his brother's sad fate. He was very downhearted but gave you his sincere thanks. The beautiful asuri have taken a young man's life and the happiness of another one.",
},
},
},
},
[42] = {
Expand Down
6 changes: 2 additions & 4 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ Storage = {
-- unused ExerciseDummyExhaust = 30029,
SamsOldBackpack = 30030,
SamsOldBackpackDoor = 30031,
StrawberryCupcake = 30032,
ChayenneReward = 30033,
SwampDiggingTimeout = 30034,
HydraEggQuest = 30035,
Expand All @@ -125,8 +124,6 @@ Storage = {
Navigator = 30048,
DwarvenLegs = 30049,
PrinceDrazzakTime = 30050,
LemonCupcake = 30052,
BlueberryCupcake = 30053,
-- Reserved in Global.Storage.FamiliarSummonEvent10 = 30054
-- Reserved in Global.Storage.FamiliarSummonEvent60 = 30055
ChayenneKeyTime = 30056,
Expand Down Expand Up @@ -1573,6 +1570,8 @@ Storage = {
WarriorSkeleton = 52146,
DragonCounter = 52147,
},
QuestLine = 52148,
TheLostBrother = 52149,
},
DreamersChallenge = {
-- Reserved storage from 52160 - 52199
Expand Down Expand Up @@ -2537,7 +2536,6 @@ Storage = {
NightmareTeddy = {},
PoacherCavesMiniWorldChange = {},
TheGreatDragonHunt = {},
TheLostBrother = {},
TheTaintedSouls = {},
},
U10_90 = { -- update 10.90 - Reserved Storages 45201 - 45350
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/asnarus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ npcConfig.shop = {
{ itemName = "animate dead rune", clientId = 3203, buy = 375 },
{ itemName = "arrow", clientId = 3447, buy = 2 },
{ itemName = "blue quiver", clientId = 35848, buy = 400 },
{ itemName = "bolt", clientId = 3483, buy = 4 },
{ itemName = "bolt", clientId = 3446, buy = 4 },
{ itemName = "bow", clientId = 3350, buy = 400, sell = 100 },
{ itemName = "bowl of terror sweat", clientId = 20204, sell = 500 },
{ itemName = "broken visor", clientId = 20184, sell = 1900 },
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/npc/hireling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function createHirelingType(HirelingName)
},
["distance"] = {
{ itemName = "arrow", clientId = 3447, buy = 2 },
{ itemName = "bolt", clientId = 3483, buy = 4 },
{ itemName = "bolt", clientId = 3446, buy = 4 },
{ itemName = "bow", clientId = 3350, buy = 400, sell = 100 },
{ itemName = "crossbow", clientId = 3349, buy = 500, sell = 120 },
{ itemName = "crystalline arrow", clientId = 15793, buy = 450 },
Expand Down
68 changes: 68 additions & 0 deletions data-otservbr-global/npc/tarun.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,74 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

local function creatureSayCallback(npc, creature, type, message)
local player = Player(creature)
if not player then
return false
end
local playerId = player:getId()

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

local theLostBrotherStorage = player:getStorageValue(Storage.AdventurersGuild.TheLostBrother)
if MsgContains(message, "mission") then
if theLostBrotherStorage < 1 then
npcHandler:say({
"My brother is missing. I fear, he went to this evil palace north of here. A place of great beauty, certainly filled with riches and luxury. But in truth it is a threshold to hell and demonesses are after his blood. ...",
"He is my brother, and I am deeply ashamed to admit but I don't dare to go there. Perhaps your heart is more courageous than mine. Would you go to see this place and search for my brother?",
}, npc, creature)
npcHandler:setTopic(playerId, 1)
elseif theLostBrotherStorage == 1 then
npcHandler:say("I hope you will find my brother.", npc, creature)
npcHandler:setTopic(playerId, 0)
elseif theLostBrotherStorage == 2 then
npcHandler:say({
"So, he is dead as I feared. I warned him not to go with this woman, but he gave in to temptation. My heart darkens and moans. But you have my sincere thanks. ...",
"Without your help I would have stayed in the dark about his fate. Please, take this as a little recompense.",
}, npc, creature)
player:addItem(3039, 1)
player:addExperience(3000, true)
player:setStorageValue(Storage.AdventurersGuild.TheLostBrother, 3)
npcHandler:setTopic(playerId, 0)
end
elseif npcHandler:getTopic(playerId) == 1 then
if MsgContains(message, "yes") then
npcHandler:say("I thank you! This is more than I could hope!", npc, creature)
if theLostBrotherStorage < 1 then
player:setStorageValue(Storage.AdventurersGuild.QuestLine, 1)
end
player:setStorageValue(Storage.AdventurersGuild.TheLostBrother, 1)
elseif MsgContains(message, "no") then
npcHandler:say("As you wish.", npc, creature)
end
npcHandler:setTopic(playerId, 0)
end

return true
end

local function onTradeRequest(npc, creature)
local player = Player(creature)
if not player then
return false
end
local playerId = player:getId()

if player:getStorageValue(Storage.AdventurersGuild.TheLostBrother) ~= 3 then
return false
end

return true
end

npcHandler:setMessage(MESSAGE_GREET, "Greetings!")
npcHandler:setMessage(MESSAGE_FAREWELL, "Farewell.")
npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, just have a look.")
npcHandler:setCallback(CALLBACK_ON_TRADE_REQUEST, onTradeRequest)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell.")
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

npcConfig.shop = {
Expand Down
51 changes: 0 additions & 51 deletions data-otservbr-global/scripts/actions/other/cup_cakes.lua

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ function adventurersWarriorSkeleton.onUse(player, item, fromPosition, target, to
if player:getStorageValue(Storage.AdventurersGuild.GreatDragonHunt.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

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)
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,26 @@ function teleportBoss.onStepIn(creature, item, position, fromPosition)
end
local player = creature
if player:getLevel() < config.requiredLevel then
player:teleportTo(fromPosition, true)
player:teleportTo(config.exitPosition, true)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be level " .. config.requiredLevel .. " or higher.")
return true
end
if locked then
player:teleportTo(fromPosition, true)
player:teleportTo(config.exitPosition, true)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There's already someone fighting with " .. config.bossName .. ".")
return false
end
if zone:countPlayers(IgnoredByMonsters) >= 5 then
player:teleportTo(fromPosition, true)
player:teleportTo(config.exitPosition, true)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The boss room is full.")
return false
end
local timeLeft = player:getBossCooldown(config.bossName) - os.time()
if timeLeft > 0 then
player:teleportTo(fromPosition, true)
player:teleportTo(config.exitPosition, true)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait " .. getTimeInWords(timeLeft) .. " to face " .. config.bossName .. " again!")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ local questTable = {
{ storage = Storage.Quest.U11_40.ThreatenedDreams.QuestLine, storageValue = 1 },
{ 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.AdventurersGuild.TheLostBrother, storageValue = 3 },
{ storage = Storage.Quest.U10_55.Dawnport.Questline, storageValue = 1 },
{ storage = Storage.Quest.U10_55.Dawnport.GoMain, storageValue = 1 },
{ storage = Storage.ForgottenKnowledge.AccessDeath, storageValue = 1 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function deathEvent.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller)
end
end
-- Minotaurs
killCheck(player, targetName, Storage.KillingInTheNameOf.BudrikMinos, 0, tasks.Budrik[1].creatures, nil, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.MinotaurCount)
killCheck(player, targetName, Storage.KillingInTheNameOf.BudrikMinos, 0, tasks.Budrik[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.MinotaurCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.MinotaurCount)
-- Necromancers and Priestesses
killCheck(player, targetName, Storage.KillingInTheNameOf.LugriNecromancers, 0, tasks.Lugri[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.NecromancerCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.NecromancerCount)
killCheck(player, targetName, Storage.KillingInTheNameOf.LugriNecromancers, 3, tasks.Lugri[1].creatures, Storage.Quest.U8_5.KillingInTheNameOf.AltKillCount.NecromancerCount, Storage.Quest.U8_5.KillingInTheNameOf.MonsterKillCount.NecromancerCount)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local findRemains = MoveEvent()

function findRemains.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end

if player:getStorageValue(Storage.AdventurersGuild.TheLostBrother) == 1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You stumble over some old bones. Something is carved into the stone wall here: 'Tarun, my brother, you were right. She's evil.'")
player:setStorageValue(Storage.AdventurersGuild.TheLostBrother, 2)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
end

return true
end

findRemains:position(Position(32959, 32674, 4))
findRemains:register()
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
function onGetFormulaValues(player, skill, attack, factor)
local distanceSkill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
local min = (player:getLevel() / 5)
local max = (0.09 * factor) * distanceSkill * 37 + (player:getLevel() / 5)
local max = (0.09 * factor) * distanceSkill * attack + (player:getLevel() / 5)
return -min, -max
end

Expand Down

0 comments on commit 8035147

Please sign in to comment.