From 1c24bd498766328e9e6b906c7e1f0d83aa012d09 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 19 Dec 2023 09:22:54 -0300 Subject: [PATCH 1/3] Created config to enable/disable players with red/black lose store items. --- config.lua.dist | 1 + data/modules/scripts/blessings/blessings.lua | 2 +- src/config/config_definitions.hpp | 3 ++- src/config/configmanager.cpp | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.lua.dist b/config.lua.dist index fec7fb25e72..4a97d94173b 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -373,6 +373,7 @@ showScriptsLogInConsole = false criticalChance = 10 inventoryGlowOnFiveBless = false adventurersBlessingLevel = 21 +skulledDeathLoseStoreItem = true experienceDisplayRates = true -- configure attack base on Fist Fighting skill/experience -- multiplierSpeedOnFist * 5 (multiplies the value obtained from the player fist skill and multiplies it * 5) max 25 is recommended due minTicks limits else player stop attack diff --git a/data/modules/scripts/blessings/blessings.lua b/data/modules/scripts/blessings/blessings.lua index c7c1ce42a72..4266213eae8 100644 --- a/data/modules/scripts/blessings/blessings.lua +++ b/data/modules/scripts/blessings/blessings.lua @@ -23,7 +23,7 @@ Blessings.Config = { AdventurerBlessingLevel = 0, -- Free full bless until level HasToF = false, -- Enables/disables twist of fate InquisitonBlessPriceMultiplier = 1.1, -- Bless price multiplied by henricus - SkulledDeathLoseStoreItem = true, -- Destroy all items on store when dying with red/blackskull + SkulledDeathLoseStoreItem = configManager.getBoolean(configKeys.SKULLED_DEATH_LOSE_STORE_ITEM), -- Destroy all items on store when dying with red/blackskull InventoryGlowOnFiveBless = true, -- Glow in yellow inventory items when the player has 5 or more bless, Debug = false, -- Prin debug messages in console if enabled } diff --git a/src/config/config_definitions.hpp b/src/config/config_definitions.hpp index 541da679351..94e5bb03198 100644 --- a/src/config/config_definitions.hpp +++ b/src/config/config_definitions.hpp @@ -218,7 +218,8 @@ enum ConfigKey_t : uint16_t { SCRIPTS_CONSOLE_LOGS, SERVER_MOTD, SERVER_NAME, - SORT_LOOT_BY_CHANCE, + SKULLED_DEATH_LOSE_STORE_ITEM, + SORT_LOOT_BY_CHANCE, SQL_PORT, STAIRHOP_DELAY, STAMINA_GREEN_DELAY, diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index 97d1052ad03..ceb10545c13 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -218,6 +218,7 @@ bool ConfigManager::load() { loadIntConfig(L, CRITICALCHANCE, "criticalChance", 10); loadIntConfig(L, ADVENTURERSBLESSING_LEVEL, "adventurersBlessingLevel", 21); + loadBoolConfig(L, SKULLED_DEATH_LOSE_STORE_ITEM, "skulledDeathLoseStoreItem", true); loadIntConfig(L, FORGE_MAX_ITEM_TIER, "forgeMaxItemTier", 10); loadIntConfig(L, FORGE_COST_ONE_SLIVER, "forgeCostOneSliver", 20); loadIntConfig(L, FORGE_SLIVER_AMOUNT, "forgeSliverAmount", 3); From 97e90f36c141326c040a97eee428dad15fb7ef30 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 19 Dec 2023 12:23:32 +0000 Subject: [PATCH 2/3] Code format - (Clang-format) --- src/config/config_definitions.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/config_definitions.hpp b/src/config/config_definitions.hpp index 94e5bb03198..f5d779b57f2 100644 --- a/src/config/config_definitions.hpp +++ b/src/config/config_definitions.hpp @@ -218,8 +218,8 @@ enum ConfigKey_t : uint16_t { SCRIPTS_CONSOLE_LOGS, SERVER_MOTD, SERVER_NAME, - SKULLED_DEATH_LOSE_STORE_ITEM, - SORT_LOOT_BY_CHANCE, + SKULLED_DEATH_LOSE_STORE_ITEM, + SORT_LOOT_BY_CHANCE, SQL_PORT, STAIRHOP_DELAY, STAMINA_GREEN_DELAY, From f617f0ed07c39cceb8f6cebda6986fd21fe02479 Mon Sep 17 00:00:00 2001 From: Luan Santos Date: Thu, 28 Dec 2023 11:01:53 -0800 Subject: [PATCH 3/3] Apply suggestions from code review --- config.lua.dist | 2 +- src/config/configmanager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.lua.dist b/config.lua.dist index 4a97d94173b..f30da1842f8 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -373,7 +373,7 @@ showScriptsLogInConsole = false criticalChance = 10 inventoryGlowOnFiveBless = false adventurersBlessingLevel = 21 -skulledDeathLoseStoreItem = true +skulledDeathLoseStoreItem = false experienceDisplayRates = true -- configure attack base on Fist Fighting skill/experience -- multiplierSpeedOnFist * 5 (multiplies the value obtained from the player fist skill and multiplies it * 5) max 25 is recommended due minTicks limits else player stop attack diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index ceb10545c13..9c7257e29c7 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -218,7 +218,7 @@ bool ConfigManager::load() { loadIntConfig(L, CRITICALCHANCE, "criticalChance", 10); loadIntConfig(L, ADVENTURERSBLESSING_LEVEL, "adventurersBlessingLevel", 21); - loadBoolConfig(L, SKULLED_DEATH_LOSE_STORE_ITEM, "skulledDeathLoseStoreItem", true); + loadBoolConfig(L, SKULLED_DEATH_LOSE_STORE_ITEM, "skulledDeathLoseStoreItem", false); loadIntConfig(L, FORGE_MAX_ITEM_TIER, "forgeMaxItemTier", 10); loadIntConfig(L, FORGE_COST_ONE_SLIVER, "forgeCostOneSliver", 20); loadIntConfig(L, FORGE_SLIVER_AMOUNT, "forgeSliverAmount", 3);