From 718b0000baec41da5f810db62e842b2c3cce227a Mon Sep 17 00:00:00 2001 From: Tereneckla <50233983+Tereneckla@users.noreply.github.com> Date: Sun, 2 Jul 2023 18:02:14 +0000 Subject: [PATCH] fix(Core/Reputation): remove reputation splitting for being partied (#16660) remove rate for party --- src/server/game/Entities/Player/KillRewarder.cpp | 7 +++---- src/server/game/Entities/Player/KillRewarder.h | 2 +- src/server/game/Entities/Player/Player.cpp | 4 +--- src/server/game/Entities/Player/Player.h | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Player/KillRewarder.cpp b/src/server/game/Entities/Player/KillRewarder.cpp index e7393060269a42..dfeb8ed6d61021 100644 --- a/src/server/game/Entities/Player/KillRewarder.cpp +++ b/src/server/game/Entities/Player/KillRewarder.cpp @@ -174,11 +174,11 @@ void KillRewarder::_RewardXP(Player* player, float rate) } } -void KillRewarder::_RewardReputation(Player* player, float rate) +void KillRewarder::_RewardReputation(Player* player) { // 4.3. Give reputation (player must not be on BG). // Even dead players and corpses are rewarded. - player->RewardReputation(_victim, rate); + player->RewardReputation(_victim); } void KillRewarder::_RewardKillCredit(Player* player) @@ -208,7 +208,6 @@ void KillRewarder::_RewardPlayer(Player* player, bool isDungeon) if (!_isPvP || _isBattleGround) { float xpRate = _group ? _groupRate * float(player->GetLevel()) / _aliveSumLevel : /*Personal rate is 100%.*/ 1.0f; // Group rate depends on the sum of levels. - float reputationRate = _group ? _groupRate * float(player->GetLevel()) / _sumLevel : /*Personal rate is 100%.*/ 1.0f; // Group rate depends on the sum of levels. sScriptMgr->OnRewardKillRewarder(player, isDungeon, xpRate); // Personal rate is 100%. if (_xp) @@ -219,7 +218,7 @@ void KillRewarder::_RewardPlayer(Player* player, bool isDungeon) if (!_isBattleGround) { // If killer is in dungeon then all members receive full reputation at kill. - _RewardReputation(player, isDungeon ? 1.0f : reputationRate); + _RewardReputation(player); _RewardKillCredit(player); } } diff --git a/src/server/game/Entities/Player/KillRewarder.h b/src/server/game/Entities/Player/KillRewarder.h index ab6a3a635f03d3..6f1fda2578126d 100644 --- a/src/server/game/Entities/Player/KillRewarder.h +++ b/src/server/game/Entities/Player/KillRewarder.h @@ -37,7 +37,7 @@ class AC_GAME_API KillRewarder void _RewardHonor(Player* player); void _RewardXP(Player* player, float rate); - void _RewardReputation(Player* player, float rate); + void _RewardReputation(Player* player); void _RewardKillCredit(Player* player); void _RewardPlayer(Player* player, bool isDungeon); void _RewardGroup(); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1805c42b2ba2d6..16e1e0d54094bc 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5856,7 +5856,7 @@ float Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr } // Calculates how many reputation points player gains in victim's enemy factions -void Player::RewardReputation(Unit* victim, float rate) +void Player::RewardReputation(Unit* victim) { if (!victim || victim->GetTypeId() == TYPEID_PLAYER) return; @@ -5885,7 +5885,6 @@ void Player::RewardReputation(Unit* victim, float rate) if (Rep->RepFaction1 && (!Rep->TeamDependent || teamId == TEAM_ALLIANCE)) { float donerep1 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->GetLevel(), static_cast(Rep->RepValue1), ChampioningFaction ? ChampioningFaction : Rep->RepFaction1); - donerep1 *= rate; FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction1); if (factionEntry1) @@ -5897,7 +5896,6 @@ void Player::RewardReputation(Unit* victim, float rate) if (Rep->RepFaction2 && (!Rep->TeamDependent || teamId == TEAM_HORDE)) { float donerep2 = CalculateReputationGain(REPUTATION_SOURCE_KILL, victim->GetLevel(), static_cast(Rep->RepValue2), ChampioningFaction ? ChampioningFaction : Rep->RepFaction2); - donerep2 *= rate; FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction2); if (factionEntry2) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 1185f058b53072..8cb516504bdeef 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2086,7 +2086,7 @@ class Player : public Unit, public GridObject ReputationMgr& GetReputationMgr() { return *m_reputationMgr; } [[nodiscard]] ReputationMgr const& GetReputationMgr() const { return *m_reputationMgr; } [[nodiscard]] ReputationRank GetReputationRank(uint32 faction_id) const; - void RewardReputation(Unit* victim, float rate); + void RewardReputation(Unit* victim); void RewardReputation(Quest const* quest); float CalculateReputationGain(ReputationSource source, uint32 creatureOrQuestLevel, float rep, int32 faction, bool noQuestBonus = false);