- diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
- index 0dac303..ca77d59 100755
- --- a/src/game/ObjectMgr.cpp
- +++ b/src/game/ObjectMgr.cpp
- @@ -9102,6 +9102,71 @@ void ObjectMgr::LoadGossipMenuItems(std::set<uint32>& gossipScriptSet)
- {
- for (std::set<uint32>::const_iterator itr = menu_ids.begin(); itr != menu_ids.end(); ++itr)
- sLog.outErrorDb("Table `gossip_menu` contain unused (in creature or GO or menu options) menu id %u.", *itr);
- +
- + struct array_associative
- + {
- + array_associative (uint32 key, const char* value)
- + {
- + bit = key;
- + name = value;
- + }
- + uint32 bit;
- + const char* name;
- + };
- +
- + array_associative array_npcflags[] = {
- + array_associative(UNIT_NPC_FLAG_TRAINER, "UNIT_NPC_FLAG_TRAINER"),
- + array_associative(UNIT_NPC_FLAG_VENDOR, "UNIT_NPC_FLAG_VENDOR"),
- + array_associative(UNIT_NPC_FLAG_FLIGHTMASTER, "UNIT_NPC_FLAG_FLIGHTMASTER"),
- + array_associative(UNIT_NPC_FLAG_INNKEEPER, "UNIT_NPC_FLAG_INNKEEPER"),
- + array_associative(UNIT_NPC_FLAG_BANKER, "UNIT_NPC_FLAG_BANKER"),
- + array_associative(UNIT_NPC_FLAG_PETITIONER, "UNIT_NPC_FLAG_PETITIONER"),
- + array_associative(UNIT_NPC_FLAG_TABARDDESIGNER, "UNIT_NPC_FLAG_TABARDDESIGNER"),
- + array_associative(UNIT_NPC_FLAG_BATTLEMASTER, "UNIT_NPC_FLAG_BATTLEMASTER"),
- + array_associative(UNIT_NPC_FLAG_AUCTIONEER, "UNIT_NPC_FLAG_AUCTIONEER"),
- + array_associative(UNIT_NPC_FLAG_STABLEMASTER, "UNIT_NPC_FLAG_STABLEMASTER"),
- + array_associative(UNIT_NPC_FLAG_GUILD_BANKER, "UNIT_NPC_FLAG_GUILD_BANKER"),
- + };
- +
- + uint32 gossip_npcflags_all = 0;
- + uint32 array_size = sizeof (array_npcflags) / sizeof (array_associative);
- + for (uint32 i = 0; i < array_size; ++i)
- + {
- + gossip_npcflags_all |= array_npcflags[i].bit;
- + }
- +
- + QueryResult* result = WorldDatabase.PQuery (
- + "SELECT "
- + "`creature_template`.`entry`, `creature_template`.`gossip_menu_id`, (`creature_template`.`npcflag` & %u) &~ BIT_OR(`gossip_menu_option`.`npc_option_npcflag`) AS `flags` "
- + "FROM "
- + "`creature_template`, `gossip_menu_option` "
- + "WHERE "
- + "`creature_template`.`gossip_menu_id`>0 "
- + "AND `creature_template`.`ScriptName`='' "
- + "AND `gossip_menu_option`.`menu_id`=`creature_template`.`gossip_menu_id` "
- + "GROUP BY "
- + "`creature_template`.`entry`, `creature_template`.`gossip_menu_id` "
- + "HAVING "
- + "`flags`>0", gossip_npcflags_all);
- + if (result)
- + {
- + BarGoLink bar (result->GetRowCount());
- + do
- + {
- + bar.step();
- +
- + Field* fields = result->Fetch();
- +
- + for (uint32 i = 0; i < array_size; ++i)
- + {
- + if (fields[2].GetUInt32() & array_npcflags[i].bit)
- + sLog.outErrorDb("Table `creature_template` with `entry` = %u and `gossip_menu_id` = %u has flag %s in `npcflag` but gossip menu does not have option with that value in `npc_option_npcflag`.", fields[0].GetUInt32(), fields[1].GetUInt32(), array_npcflags[i].name);
- + }
- + }
- + while (result->NextRow());
- +
- + delete result;
- + }
- }
- sLog.outString();