diff --git a/config.lua.dist b/config.lua.dist index 0507b652e29..b731fadbcd7 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -397,7 +397,6 @@ resetSessionsOnStartup = false -- Misc. -- NOTE: experienceDisplayRates: set to false to ignore exp rate or true to include exp rate -- NOTE: disableLegacyRaids: set to true to disable legacy XML raids --- NOTE: combatChainDelay: set to minimum 50 miliseconds allowChangeOutfit = true toggleMountInProtectionZone = false freePremium = false @@ -430,7 +429,8 @@ maxElementalResistance = 200 maxDamageReflection = 200 -- Chain system -toggleChainSystem = true +-- NOTE: combatChainDelay: set to minimum 50 miliseconds +toggleChainSystem = false combatChainDelay = 50 combatChainTargets = 5 combatChainSkillFormulaAxe = 0.9 diff --git a/src/canary_server.cpp b/src/canary_server.cpp index ac981e06768..bfabbf51ab8 100644 --- a/src/canary_server.cpp +++ b/src/canary_server.cpp @@ -376,7 +376,7 @@ void CanaryServer::loadModules() { g_game().loadBoostedCreature(); g_ioBosstiary().loadBoostedBoss(); g_ioprey().initializeTaskHuntOptions(); - g_game().getCyclopediaStatistics(); + g_game().logCyclopediaStats(); } void CanaryServer::modulesLoadHelper(bool loaded, std::string moduleName) { diff --git a/src/creatures/creature.cpp b/src/creatures/creature.cpp index 9684e03b6d2..fd78e33ecf4 100644 --- a/src/creatures/creature.cpp +++ b/src/creatures/creature.cpp @@ -805,7 +805,7 @@ bool Creature::dropCorpse(std::shared_ptr lastHitCreature, std::shared auto monster = getMonster(); if (monster && !monster->isRewardBoss()) { std::ostringstream lootMessage; - auto collorMessage = player->getProtocolVersion() < 1200 || player->getOperatingSystem() >= CLIENTOS_OTCLIENT_LINUX; + auto collorMessage = player->getProtocolVersion() > 1200 && player->getOperatingSystem() < CLIENTOS_OTCLIENT_LINUX; lootMessage << "Loot of " << getNameDescription() << ": " << corpseContainer->getContentDescription(collorMessage) << "."; auto suffix = corpseContainer->getAttribute(ItemAttribute_t::LOOTMESSAGE_SUFFIX); if (!suffix.empty()) { diff --git a/src/creatures/players/cyclopedia/player_badge.cpp b/src/creatures/players/cyclopedia/player_badge.cpp index b9b1b0feedb..9b892a6164c 100644 --- a/src/creatures/players/cyclopedia/player_badge.cpp +++ b/src/creatures/players/cyclopedia/player_badge.cpp @@ -38,7 +38,7 @@ bool PlayerBadge::add(uint8_t id, uint32_t timestamp /* = 0*/) { return false; } - const Badge &badge = g_game().getBadgeByIdOrName(id); + const Badge &badge = g_game().getBadgeById(id); if (badge.m_id == 0) { return false; } @@ -86,7 +86,7 @@ void PlayerBadge::loadUnlockedBadges() { const auto &unlockedBadges = getUnlockedKV()->keys(); g_logger().debug("[{}] - Loading unlocked badges: {}", __FUNCTION__, unlockedBadges.size()); for (const auto &badgeName : unlockedBadges) { - const Badge &badge = g_game().getBadgeByIdOrName(0, badgeName); + const Badge &badge = g_game().getBadgeByName(badgeName); if (badge.m_id == 0) { g_logger().error("[{}] - Badge {} not found.", __FUNCTION__, badgeName); continue; diff --git a/src/game/game.cpp b/src/game/game.cpp index efd4dcdd4c2..ab6c411f732 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -3296,7 +3296,13 @@ void Game::playerEquipItem(uint32_t playerId, uint16_t itemId, bool hasTier /* = } else { const int32_t &slotPosition = equipItem->getSlotPosition(); // Checks if a two-handed item is being equipped in the left slot when the right slot is already occupied and move to backpack - if (slotPosition & SLOTP_LEFT && rightItem && (slotPosition & SLOTP_TWO_HAND)) { + if ( + (slotPosition & SLOTP_LEFT) + && (slotPosition & SLOTP_TWO_HAND) + && rightItem + && !(it.weaponType == WEAPON_DISTANCE) + && !rightItem->isQuiver() + ) { ret = internalCollectManagedItems(player, rightItem, getObjectCategory(rightItem), false); } @@ -10637,7 +10643,7 @@ std::map Game::getAchievements() { return m_achievements; } -void Game::getCyclopediaStatistics() { +void Game::logCyclopediaStats() { g_logger().info("Loaded {} badges from Badge System", m_badges.size()); g_logger().info("Loaded {} titles from Title system", m_titles.size()); } @@ -10646,12 +10652,25 @@ std::unordered_set Game::getBadges() { return m_badges; } -Badge Game::getBadgeByIdOrName(uint8_t id, const std::string &name /*= ""*/) { - if (id == 0 && name.empty()) { +Badge Game::getBadgeById(uint8_t id) { + if (id == 0) { + return {}; + } + auto it = std::find_if(m_badges.begin(), m_badges.end(), [id](const Badge &b) { + return b.m_id == id; + }); + if (it != m_badges.end()) { + return *it; + } + return {}; +} + +Badge Game::getBadgeByName(const std::string &name) { + if (name.empty()) { return {}; } - auto it = std::find_if(m_badges.begin(), m_badges.end(), [id, name](const Badge &b) { - return id != 0 ? b.m_id == id : b.m_name == name; + auto it = std::find_if(m_badges.begin(), m_badges.end(), [name](const Badge &b) { + return b.m_name == name; }); if (it != m_badges.end()) { return *it; diff --git a/src/game/game.hpp b/src/game/game.hpp index 8cc84900df2..2760d265246 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -100,7 +100,7 @@ class Game { void forceRemoveCondition(uint32_t creatureId, ConditionType_t type, ConditionId_t conditionId); - void getCyclopediaStatistics(); + void logCyclopediaStats(); /** * Load the main map @@ -724,7 +724,8 @@ class Game { std::map getAchievements(); std::unordered_set getBadges(); - Badge getBadgeByIdOrName(uint8_t id, const std::string &name = ""); + Badge getBadgeById(uint8_t id); + Badge getBadgeByName(const std::string &name); std::unordered_set getTitles(); Title getTitleByIdOrName(uint8_t id, const std::string &name = ""); diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 4489802b173..a404ac9c9a4 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -4164,11 +4164,11 @@ void ProtocolGame::sendTextMessage(const TextMessage &message) { break; } case MESSAGE_MARKET: { - internalType = MESSAGE_GAME_HIGHLIGHT; + internalType = MESSAGE_EVENT_ADVANCE; break; } case MESSAGE_MANA: { - internalType = MESSAGE_THANK_YOU; + internalType = MESSAGE_HEALED; break; } case MESSAGE_BEYOND_LAST: { @@ -4176,7 +4176,7 @@ void ProtocolGame::sendTextMessage(const TextMessage &message) { break; } case MESSAGE_ATTENTION: { - internalType = MESSAGE_DAMAGE_DEALT; + internalType = MESSAGE_EVENT_ADVANCE; break; } case MESSAGE_BOOSTED_CREATURE: { @@ -4219,11 +4219,9 @@ void ProtocolGame::sendTextMessage(const TextMessage &message) { } case MESSAGE_HEALED: case MESSAGE_HEALED_OTHERS: { - if (!oldProtocol) { - msg.addPosition(message.position); - msg.add<uint32_t>(message.primary.value); - msg.addByte(message.primary.color); - } + msg.addPosition(message.position); + msg.add<uint32_t>(message.primary.value); + msg.addByte(message.primary.color); break; } case MESSAGE_EXPERIENCE: