-- Date of the version : 12/11/ 2016
-- Remove warnings in worldserver.exe console like :
-- Creature (GUID: 178647) does not exist but has a record in 'creature_addon'
-- If the guid creature doesn't exist, we can remove it from creature_addon
DELETE FROM
creature_addon
WHERE
creature_addon.guid NOT IN (SELECT creature.guid
FROM
creature);
-- Remove warnings in worldserver.exe console like :
-- 'pool_creature' has a non existing creature spawn (GUID: 193186) defined for pool id (1500), skipped.
-- Same as previously, "pool_creature" know a guid (creature already ingame, not only in theory) which is not existing... So we can remove it from the pool_creature table.
DELETE FROM
pool_creature
WHERE
pool_creature.guid NOT IN (SELECT creature.guid
FROM
creature);
-- Remove warnings in worldserver.exe console like :
-- Table 'creature_questrelation' has creature entry (2952) for quest 14452, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER
-- The flag for a quest giver should be at least equal 2, but there aren't, so let's do it!
UPDATE `creature_template` SET `npcflag`='2'
WHERE creature_template.npcflag = 0 AND creature_template.entry IN
(SELECT creature_questrelation.id
FROM creature_questrelation );