-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Player: Modified reputation gain calculations #553
Changes from 3 commits
7e0ad65
5e819c1
66bbffd
a033997
480d525
4d99990
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6282,15 +6282,26 @@ int32 Player::CalculateReputationGain(ReputationSource source, int32 rep, int32 | |
|
||
uint32 currentLevel = GetLevel(); | ||
|
||
if (MaNGOS::XP::IsTrivialLevelDifference(currentLevel, creatureOrQuestLevel)) | ||
percent *= minRate; | ||
else | ||
// Level zero seems to be treated as always equal to players current level in IsTrivialLevelDifference therefore I have skipped level difference penalty computations for that value | ||
if (creatureOrQuestLevel > 0) | ||
{ | ||
// Pre-3.0.8: Declines with 20% for each level if 6 levels or more below the player down to a minimum (default: 20%) | ||
const uint32 treshold = (creatureOrQuestLevel + 5); | ||
// Old code seems to have been correct for computing level difference penalties for quests | ||
if (source == REPUTATION_SOURCE_QUEST) | ||
{ | ||
// Pre-3.0.8: Declines with 20% for each level if 6 levels or more below the player down to a minimum (default: 20%) | ||
const uint32 treshold = (creatureOrQuestLevel + 5); | ||
|
||
if (currentLevel > treshold) | ||
percent *= std::max(minRate, (1.0f - (0.2f * (currentLevel - treshold)))); | ||
} | ||
else if (source == REPUTATION_SOURCE_KILL) | ||
{ | ||
// For kill reputiation gains the penalties value seems to have been 20% for each level below lowest green level down to a minimum (default: 20%) | ||
const uint32_t lastGreenLevel = MaNGOS::XP::GetGrayLevel(currentLevel) + 1; | ||
|
||
if (currentLevel > treshold) | ||
percent *= std::max(minRate, (1.0f - (0.2f * (currentLevel - treshold)))); | ||
if (lastGreenLevel > creatureOrQuestLevel) | ||
percent *= std::max(minRate, (1.0f - (0.2f * (lastGreenLevel - creatureOrQuestLevel)))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand this is based on the forum post, but have you actually tested this on classic PTR or what specifically is this based on (I have read the links pointing it out) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After careful investigation, the function GetGrayLevel is deprecated and IsTrivialLevelDifference is the correct one. (trivial means grey in official naming) I went ahead and a 48 npc (green) on lvl 60 gives full rep, and the GetGrayLevel function would not do that properly |
||
} | ||
} | ||
|
||
if (percent <= 0.0f) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So here you are saying the reputation penalty isnt related for quest case with "grayness" in any way, but only related to the + 5 constant (cos gray level is dynamic based on level of source)