feat(Core/Scripts): added OnAfterSpecSlotChanged hook (#17637)
This commit is contained in:
@@ -15171,6 +15171,8 @@ void Player::ActivateSpec(uint8 spec)
|
|||||||
else
|
else
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sScriptMgr->OnAfterSpecSlotChanged(this, GetActiveSpec());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::LoadActions(PreparedQueryResult result)
|
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)
|
void ScriptMgr::OnPlayerMoneyChanged(Player* player, int32& amount)
|
||||||
{
|
{
|
||||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||||
|
|||||||
@@ -1033,6 +1033,9 @@ public:
|
|||||||
// Called when a player's talent points are reset (right before the reset is done)
|
// Called when a player's talent points are reset (right before the reset is done)
|
||||||
virtual void OnTalentsReset(Player* /*player*/, bool /*noCost*/) { }
|
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
|
// Called for player::update
|
||||||
virtual void OnBeforeUpdate(Player* /*player*/, uint32 /*p_time*/) { }
|
virtual void OnBeforeUpdate(Player* /*player*/, uint32 /*p_time*/) { }
|
||||||
virtual void OnUpdate(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 OnPlayerLevelChanged(Player* player, uint8 oldLevel);
|
||||||
void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints);
|
void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints);
|
||||||
void OnPlayerTalentsReset(Player* player, bool noCost);
|
void OnPlayerTalentsReset(Player* player, bool noCost);
|
||||||
|
void OnAfterSpecSlotChanged(Player* player, uint8 newSlot);
|
||||||
void OnPlayerMoneyChanged(Player* player, int32& amount);
|
void OnPlayerMoneyChanged(Player* player, int32& amount);
|
||||||
void OnBeforeLootMoney(Player* player, Loot* loot);
|
void OnBeforeLootMoney(Player* player, Loot* loot);
|
||||||
void OnGivePlayerXP(Player* player, uint32& amount, Unit* victim, uint8 xpSource);
|
void OnGivePlayerXP(Player* player, uint32& amount, Unit* victim, uint8 xpSource);
|
||||||
|
|||||||
Reference in New Issue
Block a user