feat(Scripting/Hooks): Add OnBeforeOpenItem Hook (#12576)
This commit is contained in:
parent
ffd409eb01
commit
9b6a3ee4f9
3 changed files with 31 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue