mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
feat(Core/Hook): New PlayerScript hook "OnPetInitStatsForLevel" (#2556)
This commit is contained in:
@@ -1065,6 +1065,10 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
|||||||
|
|
||||||
SetFullHealth();
|
SetFullHealth();
|
||||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
||||||
|
|
||||||
|
if (Pet* pet = ToPet())
|
||||||
|
sScriptMgr->OnPetInitStatsForLevel(pet);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1750,6 +1750,11 @@ bool ScriptMgr::CanJoinInBattlegroundQueue(Player* player, uint64 BattlemasterGu
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptMgr::OnPetInitStatsForLevel(Pet* pet)
|
||||||
|
{
|
||||||
|
FOREACH_SCRIPT(PlayerScript)->OnPetInitStatsForLevel(pet);
|
||||||
|
}
|
||||||
|
|
||||||
// Account
|
// Account
|
||||||
void ScriptMgr::OnAccountLogin(uint32 accountId)
|
void ScriptMgr::OnAccountLogin(uint32 accountId)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -961,6 +961,9 @@ class PlayerScript : public ScriptObject
|
|||||||
virtual void OnFirstLogin(Player* /*player*/) { }
|
virtual void OnFirstLogin(Player* /*player*/) { }
|
||||||
|
|
||||||
virtual bool CanJoinInBattlegroundQueue(Player* /*player*/, uint64 /*BattlemasterGuid*/, BattlegroundTypeId /*BGTypeID*/, uint8 /*joinAsGroup*/, GroupJoinBattlegroundResult& /*err*/) { return true; }
|
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
|
class AccountScript : public ScriptObject
|
||||||
@@ -1412,6 +1415,7 @@ class ScriptMgr
|
|||||||
void OnFirstLogin(Player* player);
|
void OnFirstLogin(Player* player);
|
||||||
void OnPlayerCompleteQuest(Player* player, Quest const* quest);
|
void OnPlayerCompleteQuest(Player* player, Quest const* quest);
|
||||||
bool CanJoinInBattlegroundQueue(Player* player, uint64 BattlemasterGuid, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, GroupJoinBattlegroundResult& err);
|
bool CanJoinInBattlegroundQueue(Player* player, uint64 BattlemasterGuid, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, GroupJoinBattlegroundResult& err);
|
||||||
|
void OnPetInitStatsForLevel(Pet* pet);
|
||||||
|
|
||||||
public: /* AccountScript */
|
public: /* AccountScript */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user