mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 07:36:23 +00:00
feat(Core/Hooks): Add the KillRewarder reference to the OnRewardKillRewarder hook. (#18290)
* Another hackfix attempt at warden payload forcechecks ban fix. * Revert last commit, interrupt all forcechecks instead of just _dataSent ones. * Add rewarder parameter to OnRewardKillRewarder hook. * Undo old warden changes. * Removed too much!
This commit is contained in:
@@ -204,12 +204,13 @@ void KillRewarder::_RewardPlayer(Player* player, bool isDungeon)
|
||||
if (_victim->GetTypeId() == TYPEID_PLAYER)
|
||||
player->KilledPlayerCredit();
|
||||
}
|
||||
|
||||
// Give XP only in PvE or in battlegrounds.
|
||||
// Give reputation and kill credit only in PvE.
|
||||
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.
|
||||
sScriptMgr->OnRewardKillRewarder(player, isDungeon, xpRate); // Personal rate is 100%.
|
||||
sScriptMgr->OnRewardKillRewarder(player, this, isDungeon, xpRate); // Personal rate is 100%.
|
||||
|
||||
if (_xp)
|
||||
{
|
||||
@@ -290,3 +291,13 @@ void KillRewarder::Reward()
|
||||
if (Map* map = _victim->FindMap())
|
||||
map->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, _victim->GetEntry(), _victim);
|
||||
}
|
||||
|
||||
Unit* KillRewarder::GetVictim()
|
||||
{
|
||||
return _victim;
|
||||
}
|
||||
|
||||
Player* KillRewarder::GetKiller()
|
||||
{
|
||||
return _killer;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ public:
|
||||
KillRewarder(Player* killer, Unit* victim, bool isBattleGround);
|
||||
|
||||
void Reward();
|
||||
Unit* GetVictim();
|
||||
Player* GetKiller();
|
||||
|
||||
private:
|
||||
void _InitXP(Player* player);
|
||||
|
||||
Reference in New Issue
Block a user