Skip to content

Commit

Permalink
fix(Core/Reputation): remove reputation splitting for being partied (a…
Browse files Browse the repository at this point in the history
…zerothcore#16660)

remove rate for party
  • Loading branch information
Tereneckla committed Jul 2, 2023
1 parent 9d7e472 commit 718b000
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/server/game/Entities/Player/KillRewarder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Player/KillRewarder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 1 addition & 3 deletions src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<float>(Rep->RepValue1), ChampioningFaction ? ChampioningFaction : Rep->RepFaction1);
donerep1 *= rate;

FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction1);
if (factionEntry1)
Expand All @@ -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<float>(Rep->RepValue2), ChampioningFaction ? ChampioningFaction : Rep->RepFaction2);
donerep2 *= rate;

FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->RepFaction2);
if (factionEntry2)
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Player/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ class Player : public Unit, public GridObject<Player>
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);
Expand Down

0 comments on commit 718b000

Please sign in to comment.