chore(Core/ScriptMgr): Hooks used in mod-aoe-loot (#16589)

* Creating the necessary hooks for the loot aoe

* update hook

* Typing error

* Method name and add documentation

* codestyle

* Misc. fixes
This commit is contained in:
Walter Pagani
2023-06-24 08:23:23 -03:00
committed by GitHub
parent bf8ba6898f
commit 7f9cdda17b
4 changed files with 65 additions and 1 deletions

View File

@@ -905,6 +905,37 @@ bool ScriptMgr::CanSendMail(Player* player, ObjectGuid receiverGuid, ObjectGuid
return true;
}
bool ScriptMgr::CanSendErrorAlreadyLooted(Player* player)
{
auto ret = IsValidBoolScript<PlayerScript>([&](PlayerScript* script)
{
return !script->CanSendErrorAlreadyLooted(player);
});
if (ret && *ret)
{
return false;
}
return true;
}
void ScriptMgr::OnAfterCreatureLoot(Player* player)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
{
script->OnAfterCreatureLoot(player);
});
}
void ScriptMgr::OnAfterCreatureLootMoney(Player* player)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)
{
script->OnAfterCreatureLootMoney(player);
});
}
void ScriptMgr::PetitionBuy(Player* player, Creature* creature, uint32& charterid, uint32& cost, uint32& type)
{
ExecuteScript<PlayerScript>([&](PlayerScript* script)