mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
feat(Scripting/Hooks): Add OnBeforeOpenItem Hook (#12576)
This commit is contained in:
@@ -598,6 +598,21 @@ void ScriptMgr::OnGroupRollRewardItem(Player* player, Item* item, uint32 count,
|
||||
});
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnBeforeOpenItem(Player* player, Item* item)
|
||||
{
|
||||
auto ret = IsValidBoolScript<PlayerScript>([&](PlayerScript* script)
|
||||
{
|
||||
return !script->OnBeforeOpenItem(player, item);
|
||||
});
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScriptMgr::OnFirstLogin(Player* player)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||
|
||||
Reference in New Issue
Block a user