Core/Hooks: Add new Player hooks (#1481)

* Fix hook OnReputationChange
* Add hook OnReputationRankChange
* Add hook OnLearnSpell
* Add hook OnForgotSpell
This commit is contained in:
Dmitry Brusenskiy
2019-02-18 14:22:36 +03:00
committed by Kargatum
parent f68fef798d
commit 23d78ce6bc
4 changed files with 40 additions and 3 deletions

View File

@@ -271,7 +271,6 @@ void ReputationMgr::Initialize()
bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental, bool spillOverOnly)
{
sScriptMgr->OnPlayerReputationChange(_player, factionEntry->ID, standing, incremental);
bool res = false;
// if spillover definition exists in DB, override DBC
if (const RepSpilloverTemplate* repTemplate = sObjectMgr->GetRepSpilloverTemplate(factionEntry->ID))
@@ -376,6 +375,11 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in
if (new_rank > old_rank)
_sendFactionIncreased = true;
sScriptMgr->OnPlayerReputationChange(_player, factionEntry->ID, standing, incremental);
if (new_rank != old_rank)
sScriptMgr->OnPlayerReputationRankChange(_player, factionEntry->ID, new_rank, old_rank, _sendFactionIncreased);
UpdateRankCounters(old_rank, new_rank);
_player->ReputationChanged(factionEntry);