Показать сообщение отдельно
Старый 13.09.2012, 17:21   #23
schmoozerd
MaNGOS Dev
 
Регистрация: 17.11.2011
Сообщений: 99
Сказал(а) спасибо: 35
Поблагодарили 80 раз(а) в 26 сообщениях
schmoozerd Скоро придёт к известности
По умолчанию

To throw in an alternative:

For checks like the ones above we can use _only_ a sql-script with some SELECT output.
Then there would no fancy output (that flag 2 == NPC_FLAG_QUESTGIVER), but the integrity check could be done as well.

And it should be enough, as this is only really required to be used by DB-developers, not normal routine

As example for this case here:
Код:
diff --git a/contrib/dbIntegrityChecks/001_checkGossipOptionFlags.sql b/contrib/dbIntegrityChecks/001_checkGossipOptionFlags.sql
new file mode 100644
index 0000000..031281d
--- /dev/null
+++ b/contrib/dbIntegrityChecks/001_checkGossipOptionFlags.sql
@@ -0,0 +1,16 @@
+-- This is a helper script to select gossip menu's that don't provide all gossip-options that might be required by npc-flags.
+
+SET @GOSSIP_SELECT_FLAGS=0x00000010/*TRAINER*/ | 0x00000080/*VENDOR*/ | 0x00002000/*FLIGHTMASTER*/ | 0x00010000/*INNKEEPER*/ | 0x00020000/*BANKER*/ | 0x00040000/*PETITIONER*/ | 0x00080000/*TABARDDESIGNER*/ | 0x00100000/*BATTLEMASTER*/ | 0x00200000/*AUCTIONEER*/ | 0x00400000/*STABLEMASTER*/ | 0x00800000/*GUILD_BANKER*/;
+
+SELECT ct.entry, ct.gossip_menu_id,
+       (ct.npcflag & @GOSSIP_SELECT_FLAGS) &~ BIT_OR(gmo.npc_option_npcflag) AS `flags`
+FROM creature_template AS ct, gossip_menu_option AS gmo
+WHERE
+ ct.gossip_menu_id > 0
+ AND ct.ScriptName=''
+ AND gmo.menu_id=ct.gossip_menu_id
+GROUP BY
+ ct.entry, ct.gossip_menu_id
+HAVING
+ `flags`>0;
+

Последний раз редактировалось schmoozerd; 13.09.2012 в 17:23.
schmoozerd вне форума   Ответить с цитированием