mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
Added a hook for player::Update
This commit is contained in:
@@ -1574,6 +1574,8 @@ void Player::Update(uint32 p_time)
|
||||
if (!IsInWorld())
|
||||
return;
|
||||
|
||||
sScriptMgr->OnBeforePlayerUpdate(this, p_time);
|
||||
|
||||
// undelivered mail
|
||||
if (m_nextMailDelivereTime && m_nextMailDelivereTime <= time(NULL))
|
||||
{
|
||||
|
||||
@@ -1263,6 +1263,11 @@ void ScriptMgr::OnPlayerSpellCast(Player* player, Spell* spell, bool skipCheck)
|
||||
FOREACH_SCRIPT(PlayerScript)->OnSpellCast(player, spell, skipCheck);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforePlayerUpdate(Player* player, uint32 p_time)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnBeforeUpdate(player, p_time);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerLogin(Player* player)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnLogin(player);
|
||||
|
||||
@@ -777,6 +777,9 @@ class PlayerScript : public ScriptObject
|
||||
// Called when a player's talent points are reset (right before the reset is done)
|
||||
virtual void OnTalentsReset(Player* /*player*/, bool /*noCost*/) { }
|
||||
|
||||
// Called for player::update
|
||||
virtual void OnBeforeUpdate(Player* /*player*/, uint32 /*p_time*/){ }
|
||||
|
||||
// Called when a player's money is modified (before the modification is done)
|
||||
virtual void OnMoneyChanged(Player* /*player*/, int32& /*amount*/) { }
|
||||
|
||||
@@ -1177,6 +1180,8 @@ class ScriptMgr
|
||||
|
||||
public: /* PlayerScript */
|
||||
|
||||
|
||||
void OnBeforePlayerUpdate(Player* player, uint32 p_time);
|
||||
void OnPlayerReleasedGhost(Player* player);
|
||||
void OnPVPKill(Player* killer, Player* killed);
|
||||
void OnCreatureKill(Player* killer, Creature* killed);
|
||||
|
||||
Reference in New Issue
Block a user