diff --git a/config.lua.dist b/config.lua.dist index 0a962dfea9f..b309ecc4bfe 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -203,7 +203,6 @@ onlyPremiumAccount = false -- NOTE: buyBlessCommandFee will add fee when player buy bless by command (!bless), active changing value between 1 and 100 (fee percent. ex: 3 = 3%, 30 = 30%) -- NOTE: teleportPlayerToVocationRoom will enable oressa to teleport player to his/her room vocation -- NOTE: toggleReceiveReward = true, will enable players to choose one of reward exercise weapon by command !reward --- NOTE: randomMonsterSpawn = true, will enable monsters from the same spawn to be randomized between them, thus making a variable hunt weatherRain = false thunderEffect = false allConsoleLog = false @@ -219,7 +218,6 @@ buyAolCommandFee = 0 buyBlessCommandFee = 0 teleportPlayerToVocationRoom = true toggleReceiveReward = false -randomMonsterSpawn = false -- Teleport summon -- Set to true will never remove the summon diff --git a/data/modules/scripts/gamestore/init.lua b/data/modules/scripts/gamestore/init.lua index 7f0f2a80ca8..86c2c60d4bc 100644 --- a/data/modules/scripts/gamestore/init.lua +++ b/data/modules/scripts/gamestore/init.lua @@ -234,9 +234,6 @@ local function queueSendStoreAlertToUser(message, delay, playerId, storeErrorCod end function onRecvbyte(player, msg, byte) - if not configManager.getBoolean(STOREMODULES) then - return true - end if player:getVocation():getId() == 0 and not GameStore.haveCategoryRook() then return player:sendCancelMessage("Store don't have offers for rookgaard citizen.") end diff --git a/src/config/config_definitions.hpp b/src/config/config_definitions.hpp index 4880b07283e..417a5348a96 100644 --- a/src/config/config_definitions.hpp +++ b/src/config/config_definitions.hpp @@ -80,7 +80,6 @@ enum booleanConfig_t { PARTY_AUTO_SHARE_EXPERIENCE, PARTY_SHARE_LOOT_BOOSTS, RESET_SESSIONS_ON_STARTUP, - RANDOM_MONSTER_SPAWN, TOGGLE_WHEELSYSTEM, TOGGLE_ATTACK_SPEED_ONFIST, VIP_SYSTEM_ENABLED, diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index a404a23082e..8f46b9b3f4d 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -100,7 +100,6 @@ bool ConfigManager::load() { boolean[OPTIMIZE_DATABASE] = getGlobalBoolean(L, "startupDatabaseOptimization", true); boolean[TOGGLE_MAP_CUSTOM] = getGlobalBoolean(L, "toggleMapCustom", true); boolean[TOGGLE_MAINTAIN_MODE] = getGlobalBoolean(L, "toggleMaintainMode", false); - boolean[RANDOM_MONSTER_SPAWN] = getGlobalBoolean(L, "randomMonsterSpawn", false); string[MAINTAIN_MODE_MESSAGE] = getGlobalString(L, "maintainModeMessage", ""); string[IP] = getGlobalString(L, "ip", "127.0.0.1"); diff --git a/src/creatures/monsters/spawns/spawn_monster.cpp b/src/creatures/monsters/spawns/spawn_monster.cpp index a86f43ed1bb..aa9bcb14cf0 100644 --- a/src/creatures/monsters/spawns/spawn_monster.cpp +++ b/src/creatures/monsters/spawns/spawn_monster.cpp @@ -198,12 +198,7 @@ void SpawnMonster::startup() { for (const auto &it : spawnMonsterMap) { uint32_t spawnMonsterId = it.first; const spawnBlock_t &sb = it.second; - if (g_configManager().getBoolean(RANDOM_MONSTER_SPAWN)) { - const spawnBlock_t &randSb = std::next(spawnMonsterMap.begin(), uniform_random(0, spawnMonsterMap.size() - 1))->second; - spawnMonster(spawnMonsterId, randSb.monsterType, sb.pos, sb.direction, true); - } else { - spawnMonster(spawnMonsterId, sb.monsterType, sb.pos, sb.direction, true); - } + spawnMonster(spawnMonsterId, sb.monsterType, sb.pos, sb.direction, true); } } @@ -220,35 +215,27 @@ void SpawnMonster::checkSpawnMonster() { continue; } - const spawnBlock_t &sb = it.second; - + spawnBlock_t &sb = it.second; if (!sb.monsterType->canSpawn(sb.pos)) { - spawnMonsterMap[spawnMonsterId].lastSpawn = OTSYS_TIME(); - continue; - } - - if (sb.monsterType->info.isBlockable && findPlayer(sb.pos)) { - spawnMonsterMap[spawnMonsterId].lastSpawn = OTSYS_TIME(); + sb.lastSpawn = OTSYS_TIME(); continue; } - spawnBlock_t currentSb; - if (g_configManager().getBoolean(RANDOM_MONSTER_SPAWN)) { - currentSb = std::next(spawnMonsterMap.begin(), uniform_random(0, spawnMonsterMap.size() - 1))->second; - currentSb.pos = sb.pos; - currentSb.direction = sb.direction; - } else { - currentSb = sb; - } + if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) { + if (sb.monsterType->info.isBlockable && findPlayer(sb.pos)) { + sb.lastSpawn = OTSYS_TIME(); + continue; + } - if (currentSb.monsterType->info.isBlockable) { - spawnMonster(spawnMonsterId, currentSb.monsterType, currentSb.pos, currentSb.direction, true); - } else { - scheduleSpawn(spawnMonsterId, currentSb, 3 * NONBLOCKABLE_SPAWN_MONSTER_INTERVAL); - } + if (sb.monsterType->info.isBlockable) { + spawnMonster(spawnMonsterId, sb.monsterType, sb.pos, sb.direction); + } else { + scheduleSpawn(spawnMonsterId, sb, 3 * NONBLOCKABLE_SPAWN_MONSTER_INTERVAL); + } - if (++spawnMonsterCount >= static_cast(g_configManager().getNumber(RATE_SPAWN))) { - break; + if (++spawnMonsterCount >= static_cast(g_configManager().getNumber(RATE_SPAWN))) { + break; + } } } diff --git a/src/lua/functions/core/game/config_functions.cpp b/src/lua/functions/core/game/config_functions.cpp index 663bd430dcf..bdeaa226fc1 100644 --- a/src/lua/functions/core/game/config_functions.cpp +++ b/src/lua/functions/core/game/config_functions.cpp @@ -128,7 +128,6 @@ void ConfigFunctions::init(lua_State* L) { registerEnumIn(L, "configKeys", RED_SKULL_DURATION); registerEnumIn(L, "configKeys", BLACK_SKULL_DURATION); registerEnumIn(L, "configKeys", ORANGE_SKULL_DURATION); - registerEnumIn(L, "configKeys", RANDOM_MONSTER_SPAWN); registerEnumIn(L, "configKeys", RATE_MONSTER_HEALTH); registerEnumIn(L, "configKeys", RATE_MONSTER_ATTACK); registerEnumIn(L, "configKeys", RATE_MONSTER_DEFENSE);