Skip to content

Commit

Permalink
Merge branch 'main' into feat/lost-brother-quest
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel authored Apr 25, 2024
2 parents 147d7fa + bf8aa79 commit 3b48a55
Show file tree
Hide file tree
Showing 94 changed files with 1,289 additions and 832 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-*
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
# VCPKG
# cmake -DCMAKE_TOOLCHAIN_FILE=/opt/workspace/vcpkg/scripts/buildsystems/vcpkg.cmake ..
# Needed libs is in file vcpkg.json
# Windows required libs: .\vcpkg install --triplet x64-windows asio pugixml spdlog curl jsoncpp protobuf parallel-hashmap magic-enum mio luajit libmariadb mpir abseil
# Windows required libs: .\vcpkg install --triplet x64-windows asio pugixml spdlog curl protobuf parallel-hashmap magic-enum mio luajit libmariadb mpir abseil
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
Expand Down Expand Up @@ -48,11 +48,18 @@ include(LoggingHelper)
option(OPTIONS_ENABLE_CCACHE "Enable ccache" OFF)
option(OPTIONS_ENABLE_SCCACHE "Use sccache to speed up compilation process" OFF)
option(OPTIONS_ENABLE_IPO "Check and Enable interprocedural optimization (IPO/LTO)" ON)
option(FEATURE_METRICS "Enable metrics feature" OFF)

# *****************************************************************************
# Options Code
# *****************************************************************************

if(FEATURE_METRIC)
log_option_enabled("metrics")
else ()
log_option_disabled("metrics")
endif ()

# === CCACHE ===
if(OPTIONS_ENABLE_CCACHE)
find_program(CCACHE ccache)
Expand Down
7 changes: 4 additions & 3 deletions cmake/modules/BaseConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ find_package(ZLIB REQUIRED)
find_package(absl CONFIG REQUIRED)
find_package(asio CONFIG REQUIRED)
find_package(eventpp CONFIG REQUIRED)
find_package(jsoncpp CONFIG REQUIRED)
find_package(magic_enum CONFIG REQUIRED)
find_package(opentelemetry-cpp CONFIG REQUIRED)
find_package(prometheus-cpp CONFIG REQUIRED)
if(FEATURE_METRICS)
find_package(opentelemetry-cpp CONFIG REQUIRED)
find_package(prometheus-cpp CONFIG REQUIRED)
endif()
find_package(mio REQUIRED)
find_package(pugixml CONFIG REQUIRED)
find_package(spdlog REQUIRED)
Expand Down
28 changes: 17 additions & 11 deletions cmake/modules/CanaryLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,25 @@ target_link_libraries(${PROJECT_NAME}_lib
unofficial::argon2::libargon2
unofficial::libmariadb
unofficial::mariadbclient
opentelemetry-cpp::common
opentelemetry-cpp::metrics
opentelemetry-cpp::api
opentelemetry-cpp::ext
opentelemetry-cpp::sdk
opentelemetry-cpp::logs
opentelemetry-cpp::ostream_metrics_exporter
opentelemetry-cpp::prometheus_exporter
protobuf
)

if(FEATURE_METRICS)
add_definitions(-DFEATURE_METRICS)

target_link_libraries(${PROJECT_NAME}_lib
PUBLIC
opentelemetry-cpp::common
opentelemetry-cpp::metrics
opentelemetry-cpp::api
opentelemetry-cpp::ext
opentelemetry-cpp::sdk
opentelemetry-cpp::logs
opentelemetry-cpp::ostream_metrics_exporter
opentelemetry-cpp::prometheus_exporter
)
endif()

if(CMAKE_BUILD_TYPE MATCHES Debug)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC ${ZLIB_LIBRARY_DEBUG})
else()
Expand All @@ -124,16 +132,14 @@ endif()

if (MSVC)
if(BUILD_STATIC_LIBRARY)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC jsoncpp_static)
set(VCPKG_TARGET_TRIPLET "x64-windows-static" CACHE STRING "")
else()
target_link_libraries(${PROJECT_NAME}_lib PUBLIC jsoncpp_lib)
set(VCPKG_TARGET_TRIPLET "x64-windows" CACHE STRING "")
endif()

target_link_libraries(${PROJECT_NAME}_lib PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${MYSQL_CLIENT_LIBS})
else()
target_link_libraries(${PROJECT_NAME}_lib PUBLIC jsoncpp_static Threads::Threads)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC Threads::Threads)
endif (MSVC)

# === OpenMP ===
Expand Down
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
3 changes: 0 additions & 3 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
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
8 changes: 6 additions & 2 deletions data-otservbr-global/npc/cledwyn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ end

local charge = {}

local chargePrice = {}

local chargeItem = {
["pendulet"] = { noChargeID = 29429, ChargeID = 30344 },
["sleep shawl"] = { noChargeID = 29428, ChargeID = 30342 },
Expand Down Expand Up @@ -137,18 +139,20 @@ local function creatureSayCallback(npc, creature, type, message)
elseif table.contains({ "pendulet", "sleep shawl", "blister ring", "theurgic amulet", "ring of souls", "turtle amulet" }, message:lower()) and npcHandler:getTopic(playerId) == 1 then
npcHandler:say("Should I enchant the item " .. message .. " for 2 " .. ItemType(npc:getCurrency()):getPluralName():lower() .. "?", npc, creature)
charge = message:lower()
chargePrice = 2
npcHandler:setTopic(playerId, 2)
elseif table.contains({ "spiritthorn ring", "alicorn ring", "arcanomancer sigil", "arboreal ring" }, message:lower()) and npcHandler:getTopic(playerId) == 1 then
npcHandler:say("Should I enchant the item " .. message .. " for 5 " .. ItemType(npc:getCurrency()):getPluralName():lower() .. "?", npc, creature)
charge = message:lower()
chargePrice = 5
npcHandler:setTopic(playerId, 2)
elseif npcHandler:getTopic(playerId) == 2 then
if MsgContains(message, "yes") then
if not chargeItem[charge] then
npcHandler:say("Sorry, you don't have an unenchanted " .. charge .. ".", npc, creature)
else
if (player:getItemCount(npc:getCurrency()) >= 2) and (player:getItemCount(chargeItem[charge].noChargeID) >= 1) then
player:removeItem(npc:getCurrency(), 2)
if (player:getItemCount(npc:getCurrency()) >= chargePrice) and (player:getItemCount(chargeItem[charge].noChargeID) >= 1) then
player:removeItem(npc:getCurrency(), chargePrice)
player:removeItem(chargeItem[charge].noChargeID, 1)
local itemAdd = player:addItem(chargeItem[charge].ChargeID, 1)
npcHandler:say("Ah, excellent. Here is your " .. itemAdd:getName():lower() .. ".", npc, creature)
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
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 @@ -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(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(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(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(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 @@ -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
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
9 changes: 6 additions & 3 deletions data/items/items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34797,7 +34797,7 @@
<attribute key="showduration" value="1"/>
<attribute key="showAttributes" value="1"/>
<attribute key="absorbpercentphysical" value="10"/>
<attribute key="absorbpercentpoison" value="8"/>
<attribute key="absorbpercentenergy" value="8"/>
<attribute key="duration" value="3600"/>
<attribute key="transformdeequipto" value="16114"/>
<attribute key="decayTo" value="0"/>
Expand Down Expand Up @@ -53105,6 +53105,9 @@ hands of its owner. Granted by TibiaRoyal.com"/>
<attribute key="showAttributes" value="1"/>
<attribute key="absorbpercentlifedrain" value="5"/>
<attribute key="weight" value="3800"/>
<attribute key="script" value="moveevent">
<attribute key="slot" value="ammo"/>
</attribute>
</item>
<item id="28494" article="a" name="silver chimes">
<attribute key="primarytype" value="shields"/>
Expand Down Expand Up @@ -75427,7 +75430,7 @@ Granted by TibiaGoals.com"/>
<attribute key="skillboost magic level" value="3"/>
</attribute>
<attribute key="script" value="moveevent;weapon">
<attribute key="level" value="250"/>
<attribute key="level" value="600"/>
<attribute key="mana" value="21"/>
<attribute key="unproperly" value="true"/>
<attribute key="fromDamage" value="113"/>
Expand Down Expand Up @@ -75455,7 +75458,7 @@ Granted by TibiaGoals.com"/>
<attribute key="skillboost magic level" value="3"/>
</attribute>
<attribute key="script" value="moveevent;weapon">
<attribute key="level" value="250"/>
<attribute key="level" value="600"/>
<attribute key="mana" value="21"/>
<attribute key="unproperly" value="true"/>
<attribute key="fromDamage" value="103"/>
Expand Down
Loading

0 comments on commit 3b48a55

Please sign in to comment.