diff --git a/config.lua.dist b/config.lua.dist index 9ac7b62b..971dbe14 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -48,6 +48,7 @@ blackSkullDuration = 3 orangeSkullDuration = 7 blackSkulledDeathHealth = 40 blackSkulledDeathMana = 0 +fieldOwnershipDuration = 5 * 1000 cleanProtectionZones = false diff --git a/markdowns/CHANGELOG.md b/markdowns/CHANGELOG.md index 9bb8b967..a9133899 100644 --- a/markdowns/CHANGELOG.md +++ b/markdowns/CHANGELOG.md @@ -9,7 +9,7 @@ - New protocol 14.05 assets. ([Tryller](https://github.com/jprzimba)) - Fix gotoHouse talkaction. ([Tryller](https://github.com/jprzimba)) - Optimized the `onPlayerSellAllLoot` code to prevent prolonged freezes. ([Tryller](https://github.com/jprzimba)) -- Add a new configurable feature in `config.lua`: `chainSystemVipOnly`. ([Tryller](https://github.com/jprzimba)) +- Add new configurable featurees in `config.lua`: `chainSystemVipOnly`, `fieldOwnershipDuration`. ([Tryller](https://github.com/jprzimba)) ## Added files diff --git a/src/config/config_enums.hpp b/src/config/config_enums.hpp index 402b8dbf..0bd24e8d 100644 --- a/src/config/config_enums.hpp +++ b/src/config/config_enums.hpp @@ -346,4 +346,5 @@ enum ConfigKey_t : uint16_t { BLACK_SKULL_DEATH_HEALTH, BLACK_SKULL_DEATH_MANA, CHAIN_SYSTEM_VIP_ONLY, + FIELD_OWNERSHIP, }; diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index 2a6394bd..a7835f65 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -361,6 +361,7 @@ bool ConfigManager::load() { loadIntConfig(L, FAIRFIGHT_TIMERANGE, "fairFightTimeRange", 5 * 60 * 1000); loadIntConfig(L, BLACK_SKULL_DEATH_HEALTH, "blackSkulledDeathHealth", 40); loadIntConfig(L, BLACK_SKULL_DEATH_MANA, "blackSkulledDeathMana", 0); + loadIntConfig(L, FIELD_OWNERSHIP, "fieldOwnershipDuration", 5 * 1000); loadStringConfig(L, CORE_DIRECTORY, "coreDirectory", "data"); loadStringConfig(L, DATA_DIRECTORY, "dataPackDirectory", "data-global"); diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index ea1fc975..002acb69 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -2228,7 +2228,7 @@ void MagicField::onStepInField(const std::shared_ptr &creature) { } } - if (!harmfulField || (OTSYS_TIME() - createTime <= 5000) || creature->hasBeenAttacked(ownerId)) { + if (!harmfulField || (OTSYS_TIME() - createTime <= (uint32_t)g_configManager().getNumber(FIELD_OWNERSHIP)) || creature->hasBeenAttacked(ownerId)) { conditionCopy->setParam(CONDITION_PARAM_OWNER, ownerId); } }