fix(Core/Scripts): Fix bool script hooks not executing code (#9699)
* fix(Core/Scripts): Fix bool script hooks not executing code * warnings
This commit is contained in:
@@ -31,12 +31,16 @@ bool ScriptMgr::OnGossipHello(Player* player, Creature* creature)
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||||
|
{
|
||||||
|
ClearGossipMenuFor(player);
|
||||||
|
return tempScript->OnGossipHello(player, creature);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
return false;
|
||||||
ClearGossipMenuFor(player);
|
|
||||||
return tempScript ? tempScript->OnGossipHello(player, creature) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptMgr::OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
|
bool ScriptMgr::OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
|
||||||
@@ -51,11 +55,15 @@ bool ScriptMgr::OnGossipSelect(Player* player, Creature* creature, uint32 sender
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||||
|
{
|
||||||
|
return tempScript->OnGossipSelect(player, creature, sender, action);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
return false;
|
||||||
return tempScript ? tempScript->OnGossipSelect(player, creature, sender, action) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptMgr::OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code)
|
bool ScriptMgr::OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code)
|
||||||
@@ -71,11 +79,15 @@ bool ScriptMgr::OnGossipSelectCode(Player* player, Creature* creature, uint32 se
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||||
|
{
|
||||||
|
return tempScript->OnGossipSelectCode(player, creature, sender, action, code);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
return false;
|
||||||
return tempScript ? tempScript->OnGossipSelectCode(player, creature, sender, action, code) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptMgr::OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
bool ScriptMgr::OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||||
@@ -91,12 +103,16 @@ bool ScriptMgr::OnQuestAccept(Player* player, Creature* creature, Quest const* q
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||||
|
{
|
||||||
|
ClearGossipMenuFor(player);
|
||||||
|
return tempScript->OnQuestAccept(player, creature, quest);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
return false;
|
||||||
ClearGossipMenuFor(player);
|
|
||||||
return tempScript ? tempScript->OnQuestAccept(player, creature, quest) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptMgr::OnQuestSelect(Player* player, Creature* creature, Quest const* quest)
|
bool ScriptMgr::OnQuestSelect(Player* player, Creature* creature, Quest const* quest)
|
||||||
@@ -134,12 +150,16 @@ bool ScriptMgr::OnQuestReward(Player* player, Creature* creature, Quest const* q
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
if (auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId()))
|
||||||
|
{
|
||||||
|
ClearGossipMenuFor(player);
|
||||||
|
return tempScript->OnQuestReward(player, creature, quest, opt);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<CreatureScript>::GetScriptById(creature->GetScriptId());
|
return false;
|
||||||
ClearGossipMenuFor(player);
|
|
||||||
return tempScript ? tempScript->OnQuestReward(player, creature, quest, opt) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 ScriptMgr::GetDialogStatus(Player* player, Creature* creature)
|
uint32 ScriptMgr::GetDialogStatus(Player* player, Creature* creature)
|
||||||
|
|||||||
@@ -31,12 +31,16 @@ bool ScriptMgr::OnGossipHello(Player* player, GameObject* go)
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||||
|
{
|
||||||
|
ClearGossipMenuFor(player);
|
||||||
|
return tempScript->OnGossipHello(player, go);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
return false;
|
||||||
ClearGossipMenuFor(player);
|
|
||||||
return tempScript ? tempScript->OnGossipHello(player, go) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptMgr::OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action)
|
bool ScriptMgr::OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action)
|
||||||
@@ -51,11 +55,15 @@ bool ScriptMgr::OnGossipSelect(Player* player, GameObject* go, uint32 sender, ui
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||||
|
{
|
||||||
|
return tempScript->OnGossipSelect(player, go, sender, action);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
return false;
|
||||||
return tempScript ? tempScript->OnGossipSelect(player, go, sender, action) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptMgr::OnGossipSelectCode(Player* player, GameObject* go, uint32 sender, uint32 action, const char* code)
|
bool ScriptMgr::OnGossipSelectCode(Player* player, GameObject* go, uint32 sender, uint32 action, const char* code)
|
||||||
@@ -71,11 +79,15 @@ bool ScriptMgr::OnGossipSelectCode(Player* player, GameObject* go, uint32 sender
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||||
|
{
|
||||||
|
return tempScript->OnGossipSelectCode(player, go, sender, action, code);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
return false;
|
||||||
return tempScript ? tempScript->OnGossipSelectCode(player, go, sender, action, code) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptMgr::OnQuestAccept(Player* player, GameObject* go, Quest const* quest)
|
bool ScriptMgr::OnQuestAccept(Player* player, GameObject* go, Quest const* quest)
|
||||||
@@ -91,12 +103,16 @@ bool ScriptMgr::OnQuestAccept(Player* player, GameObject* go, Quest const* quest
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||||
|
{
|
||||||
|
ClearGossipMenuFor(player);
|
||||||
|
return tempScript->OnQuestAccept(player, go, quest);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
return false;
|
||||||
ClearGossipMenuFor(player);
|
|
||||||
return tempScript ? tempScript->OnQuestAccept(player, go, quest) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptMgr::OnQuestReward(Player* player, GameObject* go, Quest const* quest, uint32 opt)
|
bool ScriptMgr::OnQuestReward(Player* player, GameObject* go, Quest const* quest, uint32 opt)
|
||||||
@@ -112,12 +128,17 @@ bool ScriptMgr::OnQuestReward(Player* player, GameObject* go, Quest const* quest
|
|||||||
|
|
||||||
if (ret && *ret)
|
if (ret && *ret)
|
||||||
{
|
{
|
||||||
|
ClearGossipMenuFor(player);
|
||||||
|
|
||||||
|
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||||
|
{
|
||||||
|
return tempScript->OnQuestReward(player, go, quest, opt);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId());
|
return false;
|
||||||
ClearGossipMenuFor(player);
|
|
||||||
return tempScript ? tempScript->OnQuestReward(player, go, quest, opt) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 ScriptMgr::GetDialogStatus(Player* player, GameObject* go)
|
uint32 ScriptMgr::GetDialogStatus(Player* player, GameObject* go)
|
||||||
|
|||||||
Reference in New Issue
Block a user