mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
Core/Gossips: added some sanity checks to prevent duplicate interaction
(cherry picked from commit8b6954e81b) Scripts: addition to8b6954e81bCloses #16466 (cherry picked from commitb259d5c2bc)
This commit is contained in:
@@ -979,6 +979,9 @@ class go_celestial_planetarium_access : public GameObjectScript
|
||||
|
||||
bool GossipHello(Player* player) override
|
||||
{
|
||||
if (go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE))
|
||||
return true;
|
||||
|
||||
bool hasKey = true;
|
||||
if (LockEntry const* lock = sLockStore.LookupEntry(go->GetGOInfo()->GetLockId()))
|
||||
{
|
||||
|
||||
@@ -1186,6 +1186,7 @@ class npc_brann_bronzebeard_ulduar_intro : public CreatureScript
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_BRANN_BRONZEBEARD && gossipListId == GOSSIP_OPTION_BRANN_BRONZEBEARD)
|
||||
{
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
if (Creature* loreKeeper = _instance->GetCreature(DATA_LORE_KEEPER_OF_NORGANNON))
|
||||
loreKeeper->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
@@ -1238,6 +1239,7 @@ class npc_lorekeeper : public CreatureScript
|
||||
{
|
||||
if (menuId == GOSSIP_MENU_LORE_KEEPER && gossipListId == GOSSIP_OPTION_LORE_KEEPER)
|
||||
{
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
_instance->instance->LoadGrid(364, -16); // make sure leviathan is loaded
|
||||
|
||||
@@ -1250,6 +1252,7 @@ class npc_lorekeeper : public CreatureScript
|
||||
{
|
||||
if (Creature* brann = _instance->GetCreature(DATA_BRANN_BRONZEBEARD_INTRO))
|
||||
{
|
||||
brann->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
delorah->GetMotionMaster()->MovePoint(0, brann->GetPositionX() - 4, brann->GetPositionY(), brann->GetPositionZ());
|
||||
/// @todo delorah->AI()->Talk(xxxx, brann->GetGUID()); when reached at branz
|
||||
}
|
||||
|
||||
@@ -1636,6 +1636,9 @@ class go_mimiron_hardmode_button : public GameObjectScript
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) override
|
||||
{
|
||||
if (go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE))
|
||||
return true;
|
||||
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user