feat(Core/Scripts): added OnAfterSpecSlotChanged hook (#17637)
This commit is contained in:
parent
95d9e52440
commit
f417a166bc
3 changed files with 14 additions and 0 deletions
|
|
@ -15171,6 +15171,8 @@ void Player::ActivateSpec(uint8 spec)
|
|||
else
|
||||
++iter;
|
||||
}
|
||||
|
||||
sScriptMgr->OnAfterSpecSlotChanged(this, GetActiveSpec());
|
||||
}
|
||||
|
||||
void Player::LoadActions(PreparedQueryResult result)
|
||||
|
|
|
|||
|
|
@ -153,6 +153,14 @@ void ScriptMgr::OnPlayerTalentsReset(Player* player, bool noCost)
|
|||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnAfterSpecSlotChanged(Player* player, uint8 newSlot)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([=](PlayerScript* script)
|
||||
{
|
||||
script->OnAfterSpecSlotChanged(player, newSlot);
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerMoneyChanged(Player* player, int32& amount)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||
|
|
|
|||
|
|
@ -1033,6 +1033,9 @@ public:
|
|||
// Called when a player's talent points are reset (right before the reset is done)
|
||||
virtual void OnTalentsReset(Player* /*player*/, bool /*noCost*/) { }
|
||||
|
||||
// Called after a player switches specs using the dual spec system
|
||||
virtual void OnAfterSpecSlotChanged(Player* /*player*/, uint8 /*newSlot*/) { }
|
||||
|
||||
// Called for player::update
|
||||
virtual void OnBeforeUpdate(Player* /*player*/, uint32 /*p_time*/) { }
|
||||
virtual void OnUpdate(Player* /*player*/, uint32 /*p_time*/) { }
|
||||
|
|
@ -2325,6 +2328,7 @@ public: /* PlayerScript */
|
|||
void OnPlayerLevelChanged(Player* player, uint8 oldLevel);
|
||||
void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints);
|
||||
void OnPlayerTalentsReset(Player* player, bool noCost);
|
||||
void OnAfterSpecSlotChanged(Player* player, uint8 newSlot);
|
||||
void OnPlayerMoneyChanged(Player* player, int32& amount);
|
||||
void OnBeforeLootMoney(Player* player, Loot* loot);
|
||||
void OnGivePlayerXP(Player* player, uint32& amount, Unit* victim, uint8 xpSource);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue