mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 15:16:24 +00:00
fix(Core): Impelement CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ (#7101)
This commit is contained in:
@@ -83,6 +83,13 @@ uint32 Acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false
|
||||
}
|
||||
|
||||
xpMod *= isBattleGround ? sWorld->getRate(RATE_XP_BG_KILL) : sWorld->getRate(RATE_XP_KILL);
|
||||
|
||||
// if players dealt less than 50% of the damage and were credited anyway (due to CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ), scale XP gained appropriately (linear scaling)
|
||||
if (creature && creature->m_PlayerDamageReq)
|
||||
{
|
||||
xpMod *= 1.0f - 2.0f * creature->m_PlayerDamageReq / creature->GetMaxHealth();
|
||||
}
|
||||
|
||||
gain = uint32(gain * xpMod);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user