feat(Core): OnBeforeLootMoney hook (#13030)
This commit is contained in:
parent
a91b788304
commit
7a137767fa
3 changed files with 13 additions and 0 deletions
|
|
@ -168,6 +168,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
|
|||
|
||||
if (loot)
|
||||
{
|
||||
sScriptMgr->OnBeforeLootMoney(player, loot);
|
||||
loot->NotifyMoneyRemoved();
|
||||
if (shareMoney && player->GetGroup()) //item, pickpocket and players can be looted only single player
|
||||
{
|
||||
|
|
|
|||
|
|
@ -146,6 +146,14 @@ void ScriptMgr::OnPlayerMoneyChanged(Player* player, int32& amount)
|
|||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforeLootMoney(Player* player, Loot* loot)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||
{
|
||||
script->OnBeforeLootMoney(player, loot);
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGivePlayerXP(Player* player, uint32& amount, Unit* victim)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||
|
|
|
|||
|
|
@ -1021,6 +1021,9 @@ public:
|
|||
// Called when a player's money is modified (before the modification is done)
|
||||
virtual void OnMoneyChanged(Player* /*player*/, int32& /*amount*/) { }
|
||||
|
||||
// Called before looted money is added to a player
|
||||
virtual void OnBeforeLootMoney(Player* /*player*/, Loot* /*loot*/) {}
|
||||
|
||||
// Called when a player gains XP (before anything is given)
|
||||
virtual void OnGiveXP(Player* /*player*/, uint32& /*amount*/, Unit* /*victim*/) { }
|
||||
|
||||
|
|
@ -2208,6 +2211,7 @@ public: /* PlayerScript */
|
|||
void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints);
|
||||
void OnPlayerTalentsReset(Player* player, bool noCost);
|
||||
void OnPlayerMoneyChanged(Player* player, int32& amount);
|
||||
void OnBeforeLootMoney(Player* player, Loot* loot);
|
||||
void OnGivePlayerXP(Player* player, uint32& amount, Unit* victim);
|
||||
bool OnPlayerReputationChange(Player* player, uint32 factionID, int32& standing, bool incremental);
|
||||
void OnPlayerReputationRankChange(Player* player, uint32 factionID, ReputationRank newRank, ReputationRank oldRank, bool increased);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue