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

improve: small improvements and fixes #919

Merged
merged 28 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
76a88b3
fix: Small bugfixes. Indention of some code. Some TYPO corrections.
elsongabriel Mar 10, 2023
c2e5bfe
fix: Adjusted containersize of gold pouch to 20.
elsongabriel Mar 10, 2023
b3cb919
fix: Adjusted testserver_assistant.lua
elsongabriel Mar 10, 2023
d65be82
fix: Adjusted [DATA_DIRECTORY] globalString.
elsongabriel Mar 10, 2023
90be905
fix: Created toggles in to config.lua.dist to manage configs in serve…
elsongabriel Mar 11, 2023
52898fa
TYPO corrections.
elsongabriel Mar 11, 2023
7a66756
fix/small-adjustments: setting toggles values false as default.
elsongabriel Mar 13, 2023
e206ab3
fix/small-adjustments: reordered configs and created NOTES of custom …
elsongabriel Mar 13, 2023
c55f051
fix/small-adjustments: Created bestiary and bosstiary multiplier fact…
elsongabriel Mar 13, 2023
de415ba
fix/small-adjustments: Set moveable 0 in gold pouch.
elsongabriel Mar 13, 2023
629725e
fix/small-adjustments: formatted recompile.sh.
elsongabriel Mar 13, 2023
3e28a83
Merge branch 'main' into fix/small-adjustments
elsongabriel Mar 17, 2023
ad368e4
fix/small-adjustments: adjusted value in addBosstiaryKill sets.
elsongabriel Mar 17, 2023
6b5c421
Merge branch 'main' into fix/small-adjustments
elsongabriel Mar 19, 2023
320608e
Merge branch 'opentibiabr:main' into fix/small-adjustments
elsongabriel Mar 20, 2023
6b90ab4
fix/small-adjustments: created a variable 'forgeAmountMultiplier', an…
elsongabriel Mar 20, 2023
2ee855f
fix/small-adjustments: created an enum 'FORGE_AMOUNT_MULTIPLIER' in c…
elsongabriel Mar 20, 2023
7eeb64f
Merge branch 'main' of https://github.com/elsongabriel/canary into fi…
elsongabriel Mar 21, 2023
666e4f2
fix/small-adjustments: added action bless in testserver_assistant.lua
elsongabriel Mar 21, 2023
2770eef
fix/small-adjustments: adjusted actions in testserver_assistant.lua
elsongabriel Mar 22, 2023
d6273ba
fix/small-adjustments: adjusted logCommand path, to the folder alread…
elsongabriel Mar 22, 2023
356aead
Merge branch 'main' into fix/small-adjustments
elsongabriel Mar 22, 2023
999641f
fix/small-adjustments: adjusted actions in testserver_assistant.lua; …
elsongabriel Mar 22, 2023
6b19ad3
Merge branch 'opentibiabr:main' into fix/small-adjustments
elsongabriel Mar 23, 2023
31698a1
Merge branch 'main' into fix/small-adjustments.
elsongabriel Mar 23, 2023
8e645c8
Merge branch 'main' into fix/small-adjustments
elsongabriel Mar 24, 2023
b0ece80
Merge branch 'opentibiabr:main' into fix/small-adjustments
elsongabriel Mar 25, 2023
a8b3b2b
Merge branch 'opentibiabr:main' into fix/small-adjustments
elsongabriel Mar 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,4 @@ canary.old
vcpkg_installed

# CLION
src/cmake-build-debug
cmake-build-debug*
30 changes: 25 additions & 5 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ taskHuntingBonusRerollPrice = 1
taskHuntingFreeRerollTime = 20 * 60 * 60

-- Forge system
-- NOTE: forgeAmountMultiplier, amount dusts multiplies of influenced monsters, default 3
-- NOTE: forgeMinSlivers, min slivers from influenced monsters
-- NOTE: forgeMaxSlivers, max slivers from influenced monsters
-- NOTE: forgeInfluencedLimit, limit of influenced monsters that will be created in interval type and time
-- NOTE: forgeFiendishLimit, limit of diabolic monsters that will be created in interval type and time, less than forgeInfluencedLimit
-- NOTE: forgeFiendishIntervalType: "hour", "minute" or "second"
forgeMaxItemTier = 10
forgeCostOneSliver = 20
forgeSliverAmount = 3
Expand All @@ -98,14 +104,19 @@ forgeTransferCost = 100
forgeBaseSuccessRate = 50
forgeBonusSuccessRate = 15
forgeTierLossReduction = 50
forgeAmountMultiplier = 3
forgeMinSlivers = 3
forgeMaxSlivers = 7
forgeInfluencedLimit = 300
forgeFiendishLimit = 3
forgeFiendishIntervalType = "hour"
forgeFiendishIntervalTime = "1"

-- Bosstiary system
-- Bestiary & Bosstiary system
-- NOTE: bestiaryKillMultiplier, multiplier value of monster killed, default 1
-- NOTE: bosstiaryKillMultiplier, multiplier value of boss killed, default 1
bestiaryKillMultiplier = 1
bosstiaryKillMultiplier = 1
boostedBossSlot = true
boostedBossLootBonus = 250
boostedBossKillBonus = 3
Expand All @@ -119,17 +130,25 @@ familiarTime = 30
onlyPremiumAccount = false

-- Customs
-- NOTE: weatherRain = true, activates weather raining effects
-- NOTE: thunderEffect = true, activates thunder effects
-- NOTE: allConsoleLog = true, show all message logs
-- NOTE: stashMoving = true, stow an container inside your stash
-- NOTE: depotChest, the non-stackable items will be moved to the selected depot chest(I - XVIII).
-- NOTE: autoBank = true, the dropped coins from monsters will be automatically deposited to your bank account.
-- NOTE: toggleGoldPouchAllowAnything will allow players to move items or gold to gold pouch
-- NOTE: toggleServerIsRetroPVP will make this server as retro, setting PARTY_PROTECTION and ADVANCED_SECURE_MODE to 0
-- NOTE: toggleTravelsFree will make all travels from boat free
weatherRain = false
thunderEffect = false
allConsoleLog = false
-- stashMoving = true, stow an container inside your stash
-- the non-stackable items will be moved to the selected depot chest(I - XVIII).
stashMoving = false
depotChest = 4
autoLoot = false
-- autoBank = true, the dropped coins from monsters will be automatically
-- deposited to your bank account.
autoBank = false
toggleGoldPouchAllowAnything = false
toggleServerIsRetroPVP = false
toggleTravelsFree = false

-- Teleport summon
-- Set to true will never remove the summon
Expand Down Expand Up @@ -328,3 +347,4 @@ location = "South America"
-- The URL layout is https://discord.com/api/webhooks/:id/:token
-- Leave empty if you wish to disable.
discordWebhookURL = ""

3 changes: 2 additions & 1 deletion data-canary/scripts/creaturescripts/bestiary_kill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ function bestiaryOnKill.onKill(player, creature, lastHit)
return true
end

local bestiaryMultiplier = (configManager.getNumber(configKeys.BESTIARY_KILL_MULTIPLIER) or 1)
for cid, damage in pairs(creature:getDamageMap()) do
local participant = Player(cid)
if participant and participant:isPlayer() then
participant:addBestiaryKill(creature:getName())
participant:addBestiaryKill(creature:getName(), bestiaryMultiplier)
end
end

Expand Down
14 changes: 7 additions & 7 deletions data-canary/scripts/globalevents/global_server_save.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ end

local function ServerSaveWarning(time)
-- minus one minutes
local remaningTime = tonumber(time) - 60000
local remainingTime = tonumber(time) - 60000
if configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_MESSAGE) then
local message = "Server is saving game in " .. (remaningTime/60000) .." minute(s). Please logout."
local message = "Server is saving game in " .. (remainingTime/60000) .." minute(s). Please logout."
Webhook.send("Server save", message, WEBHOOK_COLOR_WARNING)
Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT)
end
-- if greater than one minute, schedule another warning
-- else the next event will be the server save
if remaningTime > 60000 then
addEvent(ServerSaveWarning, 60000, remaningTime)
if remainingTime > 60000 then
addEvent(ServerSaveWarning, 60000, remainingTime)
else
addEvent(ServerSave, 60000)
end
Expand All @@ -35,13 +35,13 @@ end
-- interval is the time between the event start and the the effective save, it will send an notify message every minute
local serversave = GlobalEvent("serversave")
function serversave.onTime(interval)
local remaningTime = configManager.getNumber(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_DURATION) * 60000
local remainingTime = configManager.getNumber(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_DURATION) * 60000
if configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_NOTIFY_MESSAGE) then
local message = "Server is saving game in " .. (remaningTime/60000) .." minute(s). Please logout."
local message = "Server is saving game in " .. (remainingTime/60000) .." minute(s). Please logout."
Webhook.send("Server save", message, WEBHOOK_COLOR_WARNING)
Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT)
end
addEvent(ServerSaveWarning, 60000, remaningTime) -- Schedule next event in 1 minute(60000)
addEvent(ServerSaveWarning, 60000, remainingTime) -- Schedule next event in 1 minute(60000)
return not configManager.getBoolean(configKeys.GLOBAL_SERVER_SAVE_SHUTDOWN)
end

Expand Down
6 changes: 3 additions & 3 deletions data-canary/scripts/globalevents/save_interval.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ end
local save = GlobalEvent("save")

function save.onTime(interval)
local remaningTime = 60 * 1000
local remainingTime = 60 * 1000
if configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL) then
local message = "The server will save all accounts within " .. (remaningTime/1000) .." seconds. \z
local message = "The server will save all accounts within " .. (remainingTime/1000) .." seconds. \z
You might lag or freeze for 5 seconds, please find a safe place."
Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT)
Spdlog.info(string.format(message, SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE))
addEvent(serverSave, remaningTime, interval)
addEvent(serverSave, remainingTime, interval)
return true
end
return not configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL)
Expand Down
8 changes: 4 additions & 4 deletions data-canary/scripts/movements/unscripted_movements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14056,14 +14056,14 @@ local items = {
itemid = 6529,
type = "equip",
slot = "feet",
level = 180
level = 10
},
{
-- pair of soft boots
itemid = 6529,
type = "deequip",
slot = "feet",
level = 180
level = 10
},
{
-- tortoise shield
Expand Down Expand Up @@ -14834,14 +14834,14 @@ local items = {
itemid = 3549,
type = "equip",
slot = "feet",
level = 180
level = 10
},
{
-- pair of soft boots
itemid = 3549,
type = "deequip",
slot = "feet",
level = 180
level = 10
},
{
-- scythe
Expand Down
6 changes: 1 addition & 5 deletions data-canary/scripts/talkactions/god/storage_set.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ local storageSet = TalkAction("/set")

function storageSet.onSay(cid, words, param)
local player = Player(cid)
if not player:getGroup():getAccess() then
if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
return true
end

if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end

local split = param:split(",")
if split[2] == nil then
player:sendCancelMessage("Insufficient parameters.")
Expand Down
72 changes: 43 additions & 29 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Reserved player action storage key ranges (const.h)
[103] = key 0010
[303] = key 0303
[1000] = level door. Here 1 must be used followed by the level.
Example: 1010 = level 10,
1100 = level 100]
Example: 1010 = level 10, 1100 = level 100

[3001-3008] = key 3001/3008
[3012] = key 3012
Expand Down Expand Up @@ -1275,10 +1274,10 @@ Storage = {
Statue = 51528,
LastMissionState = 51529
},
TheCursedCrystal = {
Oneeyedjoe = 51530,
MedusaOil = 51531,
Questline = 51532
TheCursedCrystal = {
Oneeyedjoe = 51530,
MedusaOil = 51531,
Questline = 51532
}
},
TheShatteredIsles = {
Expand Down Expand Up @@ -1421,7 +1420,7 @@ Storage = {
TrophyWarlord = 51720,
GreenhornDoor = 51721,
ScrapperDoor = 51722,
WarlordDoor= 51723
WarlordDoor = 51723
},
QuestChests = {
-- Reserved storage from 51730 - 51999
Expand Down Expand Up @@ -2124,18 +2123,21 @@ Storage = {
TheBeginning = {},
TheDemonOak = {},
FishForASerpent = {
QuestLine = 41651},
QuestLine = 41651
},
TheHuntForTheSeaSerpent = {
QuestLine = 41652,
SuccessSwitch = 41653,
Bait = 41654,
Direction = 41655,
Access = 41656},
Access = 41656
},
TheInquisition = {},
TheThievesGuild = {},
TrollSabotage = {
Questline = 41840,
JumpTimer = 41841},
JumpTimer = 41841
},
VampireHunter = {},
},
U8_4 = { -- update 8.4 - Reserved Storages 41901 - 42145
Expand All @@ -2149,10 +2151,12 @@ Storage = {
Lisander = 41906,
Ortheus = 41907,
Maris = 41908,
Armenius = 41909},
Armenius = 41909
},
Mission03 = 41910,
Mission04 = 41911,
VengothAccess = 41912},
VengothAccess = 41912
},
InServiceOfYalahar = {},
TheHiddenCityOfBeregar = {},
TopOfTheCity = {},
Expand Down Expand Up @@ -2259,7 +2263,7 @@ Storage = {
FahimCount = 42384,
},
AltKillCount = {
-- Grizzly Adams
-- Grizzly Adams
-- Apes
KongraCount = 42450,
MerlkinCount = 42451,
Expand Down Expand Up @@ -2293,7 +2297,7 @@ Storage = {
DrakenEliteCount = 42473,
DrakenSpellweaverCount = 42474,
DrakenWarmasterCount = 42475,
-- Others
-- Others
-- Minotaurs
MinotaurCount = 42476,
MinotaurGuardCount = 42477,
Expand Down Expand Up @@ -2343,21 +2347,24 @@ Storage = {
U8_54 = { -- update 8.54 - Reserved Storages 42551 - 42950
AnUneasyAlliance = {
Questline = 42551,
QuestDoor = 42552}, -- 42551 - 42600
QuestDoor = 42552
}, -- 42551 - 42600
ChildrenOfTheRevolution = {}, -- 42601 - 42650
SeaOfLight = {}, -- 42651 - 42700
TheNewFrontier = { -- 42701 - 42750
Questline = 42701,
FarmineFirstTravel = 42702,
Mission01 = 42703,
Mission02 = {42704,
Mission02 = {
42704,
Beaver1 = 42705,
Beaver2 = 42706,
Beaver3 = 42707,
},
Mission03 = 42708,
Mission04 = 42709,
Mission05 = {42710,
Mission05 = {
42710,
KingTibianus = 42711,
Leeland = 42712,
Angus = 42713,
Expand All @@ -2371,15 +2378,18 @@ Storage = {
HumgolfKeyword = 42845,
},
Mission06 = 42717,
Mission07 = {42718,
Mission07 = {
42718,
HiddenNote = 42719,
},
Mission08 = 42720,
Mission09 = {42721,
Mission09 = {
42721,
ArenaDoor = 42722,
RewardDoor = 42723,
},
Mission10 = {42724,
Mission10 = {
42724,
MagicCarpetDoor = 42725,
},
Reward = {
Expand Down Expand Up @@ -2588,7 +2598,8 @@ Storage = {
CultsOfTibia = {}, -- 45651 - 45750
ThreatenedDreams = { -- 45751 - 45850
QuestLine = 45751,
Mission01 = {45752, -- Troubled Animals
Mission01 = {
45752, -- Troubled Animals
PoacherChest = 45753,
PoacherNotes = 45754,
FeathersCount = 45755,
Expand All @@ -2597,8 +2608,9 @@ Storage = {
Feathers3 = 45758,
Feathers4 = 45759,
Feathers5 = 45760
},
Mission02 = {45761, -- Nightmare Intruders
},
Mission02 = {
45761, -- Nightmare Intruders
FrazzlemawsCount = 45762,
EnfeebledCount = 45763,
KroazurAccess = 45764,
Expand Down Expand Up @@ -2629,16 +2641,18 @@ Storage = {
StarlightPos03 = 45789,
StarlightPos04 = 45790,
StarlightPos05 = 45791
},
Mission03 = {45792, -- An Unlikely Couple
},
Mission03 = {
45792, -- An Unlikely Couple
UnlikelyCouple = 45793,
PanpipesTimer = 45794,
RavenHerbTimer = 45795,
DarkSunCatcher = 45796,
EmptyStarlightVial = 45797
},
Mission04 = {45798,
},
},
Mission04 = {
45798,
},
Mission05 = 45799
},
},
Expand Down Expand Up @@ -2817,7 +2831,7 @@ Storage = {
MegasylvanYseldaTimer = 47602,
},
CitizenOfIssaviOutfits = {},
RoyalBounaceanAdvisorOutfits= {},
RoyalBounaceanAdvisorOutfits = {},
TooHotToHandle = {}
},
U12_80 = { -- update 12.80 - Reserved Storages 47801 - 47850
Expand Down
Loading