feat(Core/Hook): New PlayerScript hook "OnPetInitStatsForLevel" (#2556)
This commit is contained in:
parent
0a97359c53
commit
dd81c21968
3 changed files with 13 additions and 0 deletions
|
|
@ -1065,6 +1065,10 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
|||
|
||||
SetFullHealth();
|
||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
||||
|
||||
if (Pet* pet = ToPet())
|
||||
sScriptMgr->OnPetInitStatsForLevel(pet);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1750,6 +1750,11 @@ bool ScriptMgr::CanJoinInBattlegroundQueue(Player* player, uint64 BattlemasterGu
|
|||
return ret;
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPetInitStatsForLevel(Pet* pet)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnPetInitStatsForLevel(pet);
|
||||
}
|
||||
|
||||
// Account
|
||||
void ScriptMgr::OnAccountLogin(uint32 accountId)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -961,6 +961,9 @@ class PlayerScript : public ScriptObject
|
|||
virtual void OnFirstLogin(Player* /*player*/) { }
|
||||
|
||||
virtual bool CanJoinInBattlegroundQueue(Player* /*player*/, uint64 /*BattlemasterGuid*/, BattlegroundTypeId /*BGTypeID*/, uint8 /*joinAsGroup*/, GroupJoinBattlegroundResult& /*err*/) { return true; }
|
||||
|
||||
// Called after the player's pet has been loaded and initialized
|
||||
virtual void OnPetInitStatsForLevel(Pet* /*pet*/) { }
|
||||
};
|
||||
|
||||
class AccountScript : public ScriptObject
|
||||
|
|
@ -1412,6 +1415,7 @@ class ScriptMgr
|
|||
void OnFirstLogin(Player* player);
|
||||
void OnPlayerCompleteQuest(Player* player, Quest const* quest);
|
||||
bool CanJoinInBattlegroundQueue(Player* player, uint64 BattlemasterGuid, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, GroupJoinBattlegroundResult& err);
|
||||
void OnPetInitStatsForLevel(Pet* pet);
|
||||
|
||||
public: /* AccountScript */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue