From 57ceb161f22c04d19b40532d551438560da558fc Mon Sep 17 00:00:00 2001 From: mrmdbeng Date: Tue, 4 Feb 2025 00:23:44 -0500 Subject: [PATCH 1/3] Perf skill wheel bonus this fixes the excessive damage output from skill wheel such as enhanced ethereal speak, the damage output still too high in comparison to real tibia. --- src/game/game.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index d755c05bb9e..c9b180d659a 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -7230,7 +7230,17 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s if (attackerPlayer && targetPlayer && attackerPlayer->getSkull() == SKULL_BLACK && attackerPlayer->getSkullClient(targetPlayer) == SKULL_NONE) { return false; } - + + if (damage.origin != ORIGIN_NONE) { + const auto events = target->getCreatureEvents(CREATURE_EVENT_HEALTHCHANGE); + if (!events.empty()) { + for (const auto &creatureEvent : events) { + creatureEvent->executeHealthChange(target, attacker, damage); + } + damage.origin = ORIGIN_NONE; + return combatChangeHealth(attacker, target, damage); + } + } // Wheel of destiny apply combat effects applyWheelOfDestinyEffectsToDamage(damage, attackerPlayer, target); @@ -7454,17 +7464,6 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s return true; } - if (damage.origin != ORIGIN_NONE) { - const auto events = target->getCreatureEvents(CREATURE_EVENT_HEALTHCHANGE); - if (!events.empty()) { - for (const auto &creatureEvent : events) { - creatureEvent->executeHealthChange(target, attacker, damage); - } - damage.origin = ORIGIN_NONE; - return combatChangeHealth(attacker, target, damage); - } - } - // Apply Custom PvP Damage (must be placed here to avoid recursive calls) if (attackerPlayer && targetPlayer) { applyPvPDamage(damage, attackerPlayer, targetPlayer); From 7c6766819725cd4caaa03c5aec3900d0c4915637 Mon Sep 17 00:00:00 2001 From: mrmdbeng Date: Tue, 4 Feb 2025 13:21:37 -0500 Subject: [PATCH 2/3] Follow scheme of code --- src/game/game.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/game.cpp b/src/game/game.cpp index c9b180d659a..5fe2bd10a45 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -7241,6 +7241,7 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s return combatChangeHealth(attacker, target, damage); } } + // Wheel of destiny apply combat effects applyWheelOfDestinyEffectsToDamage(damage, attackerPlayer, target); From 37bff6854cdf85ff7d9cd6f48cbc596f1fb9c08b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 8 Feb 2025 06:47:32 +0000 Subject: [PATCH 3/3] Code format - (Clang-format) --- src/game/game.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 5fe2bd10a45..fb50bef101c 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -7230,7 +7230,7 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s if (attackerPlayer && targetPlayer && attackerPlayer->getSkull() == SKULL_BLACK && attackerPlayer->getSkullClient(targetPlayer) == SKULL_NONE) { return false; } - + if (damage.origin != ORIGIN_NONE) { const auto events = target->getCreatureEvents(CREATURE_EVENT_HEALTHCHANGE); if (!events.empty()) { @@ -7241,7 +7241,7 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s return combatChangeHealth(attacker, target, damage); } } - + // Wheel of destiny apply combat effects applyWheelOfDestinyEffectsToDamage(damage, attackerPlayer, target);