feat(Core): OnBeforeChooseGraveyard Hook (#12860)

This commit is contained in:
ZhengPeiRu21
2022-09-06 12:47:37 -06:00
committed by GitHub
parent 5d25a0686d
commit 80e6a6d781
3 changed files with 20 additions and 0 deletions

View File

@@ -1349,6 +1349,14 @@ void ScriptMgr::OnPlayerResurrect(Player* player, float restore_percent, bool ap
});
}
void ScriptMgr::OnBeforeChooseGraveyard(Player* player, TeamId teamId, bool nearCorpse, uint32& graveyardOverride)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
{
script->OnBeforeChooseGraveyard(player, teamId, nearCorpse, graveyardOverride);
});
}
bool ScriptMgr::CanPlayerUseChat(Player* player, uint32 type, uint32 language, std::string& msg)
{
auto ret = IsValidBoolScript<PlayerScript>([&](PlayerScript* script)

View File

@@ -1316,6 +1316,9 @@ public:
virtual void OnPlayerResurrect(Player* /*player*/, float /*restore_percent*/, bool /*applySickness*/) { }
// Called before selecting the graveyard when releasing spirit
virtual void OnBeforeChooseGraveyard(Player* /*player*/, TeamId /*teamId*/, bool /*nearCorpse*/, uint32& /*graveyardOverride*/) { }
/**
* @brief This hook called before player sending message in default chat
*
@@ -2317,6 +2320,7 @@ public: /* PlayerScript */
void OnSetServerSideVisibility(Player* player, ServerSideVisibilityType& type, AccountTypes& sec);
void OnSetServerSideVisibilityDetect(Player* player, ServerSideVisibilityType& type, AccountTypes& sec);
void OnPlayerResurrect(Player* player, float restore_percent, bool applySickness);
void OnBeforeChooseGraveyard(Player* player, TeamId teamId, bool nearCorpse, uint32& graveyardOverride);
bool CanPlayerUseChat(Player* player, uint32 type, uint32 language, std::string& msg);
bool CanPlayerUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Player* receiver);
bool CanPlayerUseChat(Player* player, uint32 type, uint32 language, std::string& msg, Group* group);