mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
feat(Core/Hooks): Add parameter to detect XP origin for OnGiveXP hook. (#16109)
Added enum parameter to detect where XP originated from.
This commit is contained in:
@@ -2372,8 +2372,6 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate, bool isLFGReward)
|
||||
|
||||
uint8 level = GetLevel();
|
||||
|
||||
sScriptMgr->OnGivePlayerXP(this, xp, victim);
|
||||
|
||||
// Favored experience increase START
|
||||
uint32 zone = GetZoneId();
|
||||
float favored_exp_mult = 0;
|
||||
@@ -5730,6 +5728,7 @@ void Player::CheckAreaExploreAndOutdoor()
|
||||
XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level) * sWorld->getRate(RATE_XP_EXPLORE));
|
||||
}
|
||||
|
||||
sScriptMgr->OnGivePlayerXP(this, XP, nullptr, PlayerXPSource::XPSOURCE_EXPLORE);
|
||||
GiveXP(XP, nullptr);
|
||||
SendExplorationExperience(areaId, XP);
|
||||
}
|
||||
@@ -6119,7 +6118,11 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
bg->UpdatePlayerScore(this, SCORE_BONUS_HONOR, honor, false); //false: prevent looping
|
||||
// Xinef: Only for BG activities
|
||||
if (!uVictim)
|
||||
GiveXP(uint32(honor * (3 + GetLevel() * 0.30f)), nullptr);
|
||||
{
|
||||
uint32 xp = uint32(honor * (3 + GetLevel() * 0.30f));
|
||||
sScriptMgr->OnGivePlayerXP(this, xp, nullptr, PlayerXPSource::XPSOURCE_BATTLEGROUND);
|
||||
GiveXP(xp, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_PVP_TOKEN_ENABLE))
|
||||
|
||||
Reference in New Issue
Block a user