This commit is contained in:
sevi
2018-05-22 07:43:43 +02:00
8 changed files with 8516 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
--
DELETE FROM `creature_addon` WHERE `guid` IN (255649,255653,255654,255655,255656,255660,255664,255773,255783,255975,255977,255979,255981,257450,257454,257471,257474,257481,257483,257486,257488,257498,257508,257509,257514,257535,257545,257549,257560,257567,257573,257575,257587,257601,257652,257655,257669,257711,257723,257724,257732,257751,257765,257794,257795,257806,257808,257820,257833,257840,257847,257873,257890,257896,257897,257899,257911,257912,257936,257939,257940,257944,257947,257963,257965,257979,257980,258398,258404,258405,258406,258412,258413,258414,258438,258473,258479,258483,258486,258489,258491,258496,258507,258528,258529,258531,258539,258541,258542,258557,258559,258561,258562,258564,258566,258571,258618,258648);

View File

@@ -0,0 +1,21 @@
/*
--
-- Quests "Investigate the Blue Recluse" & "Investigate the Alchemist Shop"
DELETE FROM `creature_text` WHERE `CreatureID` IN (5497,4568);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(5497,0,0,"Here, $n. Take a chest of containment coffers and a cantation of manifestation. You will need them for your mission.",12,7,100,25,0,0,2681,0,"Jennea Cannon"),
(4568,0,0,"Take a chest of containment coffers and a cantation of manifestation, $n. You will need them for your mission.",12,1,100,25,0,0,2682,0,"Anastasia Hartwell");
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry` IN (5497,4568);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (5497,4568) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (549700,456800) AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(5497,0,0,0,19,0,100,0,1920,0,0,0,80,549700,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jennea Cannon - On Quest 'Investigate the Blue Recluse' Taken - Run Script"),
(4568,0,0,0,19,0,100,0,1960,0,0,0,80,456800,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anastasia Hartwell - On Quest 'Investigate the Alchemist Shop' Taken - Run Script"),
(549700,9,0,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.96646,"Jennea Cannon - On Script - Set Orientation"),
(549700,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jennea Cannon - On Script - Say Line 0"),
(549700,9,2,0,0,0,100,0,10000,10000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.858,"Jennea Cannon - On Script - Set Orientation"),
(456800,9,0,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.77319,"Anastasia Hartwell - On Script - Set Orientation"),
(456800,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anastasia Hartwell - On Script - Say Line 0"),
(456800,9,2,0,0,0,100,0,10000,10000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,3.05433,"Anastasia Hartwell - On Script - Set Orientation");
*/

View File

@@ -0,0 +1,40 @@
/*
--
-- Wynne Larson
DELETE FROM `creature_text` WHERE `CreatureID`=1309;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(1309,0,0,"These are fine pieces, $n. Let me get started on your robe.",12,7,100,1,0,0,2647,0,"Wynne Larson"),
(1309,1,0,"That's it! It's all finished, $n.",12,7,100,1,0,0,2648,0,"Wynne Larson"),
(1309,2,0,"Ok, let's get to work!",12,7,100,0,0,0,2649,0,"Wynne Larson"),
(1309,3,0,"Now where did I put that silver spool...",12,7,100,0,0,0,2651,0,"Wynne Larson"),
(1309,4,0,"Aha! There it is.",12,7,100,0,0,0,2650,0,"Wynne Larson");
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=1309;
DELETE FROM `smart_scripts` WHERE `entryorguid`=1309 AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (130900,130901,130902,130903) AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(1309,0,0,0,20,0,100,0,1921,0,0,0,80,130900,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Quest 'Gathering Materials' Finished - Run Script"),
(1309,0,1,0,20,0,100,0,1940,0,0,0,80,130901,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Quest 'Pristine Spider Silk' Finished - Run Script"),
(1309,0,2,0,40,0,100,0,1,1309,0,0,80,130902,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Waypoint 1 Reached - Run Script"),
(1309,0,3,0,40,0,100,0,2,1309,0,0,80,130903,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Waypoint 2 Reached - Run Script"),
(130900,9,0,0,0,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Remove Npc Flag Questgiver"),
(130900,9,1,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Say Line 0"),
(130900,9,2,0,0,0,100,0,4000,4000,0,0,11,9157,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Cast 'Create Mage's Robe'"),
(130900,9,3,0,0,0,100,0,5000,5000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Say Line 1"),
(130900,9,4,0,0,0,100,0,0,0,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Add Npc Flag Questgiver"),
(130901,9,0,0,0,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Remove Npc Flag Questgiver"),
(130901,9,1,0,0,0,100,0,1000,1000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Say Line 2"),
(130901,9,2,0,0,0,100,0,4000,4000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Say Line 3"),
(130901,9,3,0,0,0,100,0,2000,2000,0,0,53,0,1309,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Start Waypoint"),
(130902,9,0,0,0,0,100,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Pause Waypoint"),
(130902,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,3.80513,"Wynne Larson - On Script - Set Orientation"),
(130902,9,2,0,0,0,100,0,1000,1000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Say Line 4"),
(130902,9,3,0,0,0,100,0,3000,3000,0,0,11,9157,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Cast 'Create Mage's Robe'"),
(130903,9,0,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,3.846,"Wynne Larson - On Script - Set Orientation"),
(130903,9,1,0,0,0,100,0,0,0,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wynne Larson - On Script - Add Npc Flag Questgiver");
DELETE FROM `waypoints` WHERE `entry`=1309;
INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
(1309,1,-8964.6,824.703,109.447,""),
(1309,2,-8963,822.517,109.447,"");
*/

View File

@@ -0,0 +1,58 @@
/*
-- Tabetha
DELETE FROM `creature_text` WHERE `CreatureID`=6546 AND `GroupID` IN (1,2,3,4,5,6,7,8,9);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(6546,1,0,"Ok, let's get this orb made...",12,0,100,0,0,0,2663,0,"Tabetha"),
(6546,2,0,"All right. It's made!",12,0,100,1,0,0,2664,0,"Tabetha"),
(6546,3,0,"Stand back, and ... hold your breath. I haven't done this in a while.",12,0,100,1,0,0,2708,0,"Tabetha"),
(6546,4,0,"It worked! Amazing! I guess I haven't lost my touch...",12,0,100,4,0,0,2709,0,"Tabetha"),
(6546,5,0,"Good luck out there, $n.",12,0,100,0,0,0,2624,0,"Tabetha"),
(6546,6,0,"I just have one thing to check...",12,0,100,0,0,0,2656,0,"Tabetha"),
(6546,7,0,"That's it! It worked!",12,0,100,4,0,0,2657,0,"Tabetha"),
(6546,8,0,"Thanks for your patience, $n.",12,0,100,2,0,0,2658,0,"Tabetha"),
(6546,9,0,"I'll just keep this here until we need it... ",12,0,100,1,0,0,2659,0,"Tabetha");
DELETE FROM `smart_scripts` WHERE `entryorguid`=6546 AND `source_type`=0 AND `id` IN (1,2,6,7,8,9,10);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (654604,654605,654606) AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(6546,0,1,0,20,0,100,0,1957,0,0,0,41,0,600,0,0,0,0,14,28294,103680,0,0,0,0,0,"Tabetha - On Quest 'Mana Surges' Finished - Despawn Gameobject 'Mana Rift'"),
(6546,0,2,3,19,0,100,0,1957,0,0,0,70,600,0,0,0,0,0,14,28294,103680,0,0,0,0,0,"Tabetha - On Quest 'Mana Surges' Taken - Respawn Gameobject 'Mana Rift'"),
(6546,0,6,0,20,0,100,0,1957,0,0,0,80,654604,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Quest 'Mana Surges' Finished - Run Script"),
(6546,0,7,0,19,0,100,0,1952,0,0,0,80,654605,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Quest 'Mage's Wand' Taken - Run Script"),
(6546,0,8,0,19,0,100,0,1957,0,0,0,11,9079,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Quest 'Mana Surges' Taken - Cast 'Create Rift'"),
(6546,0,9,0,19,0,100,0,1957,0,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Quest 'Mana Surges' Taken - Say Line 5"),
(6546,0,10,0,20,0,100,0,1947,0,0,0,80,654606,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Quest 'Journey to the Marsh' Finished - Run Script"),
(654604,9,0,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Remove Npc Flag Questgiver+Gossip"),
(654604,9,1,0,0,0,100,0,1000,1000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Say Line 1"),
(654604,9,2,0,0,0,100,0,0,0,0,0,11,9156,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Cast 'Create Mage's Orb'"),
(654604,9,3,0,0,0,100,0,5500,5500,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Say Line 2"),
(654604,9,4,0,0,0,100,0,0,0,0,0,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Add Npc Flag Questgiver+Gossip"),
(654605,9,0,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Remove Npc Flag Questgiver+Gossip"),
(654605,9,1,0,0,0,100,0,1000,1000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Say Line 3"),
(654605,9,2,0,0,0,100,0,3000,3000,0,0,11,32990,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Cast 'Enchanting Cast Visual'"),
(654605,9,3,0,0,0,100,0,6000,6000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Say Line 4"),
(654605,9,4,0,0,0,100,0,0,0,0,0,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Add Npc Flag Questgiver+Gossip"),
(654606,9,0,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Remove Npc Flag Questgiver+Gossip"),
(654606,9,1,0,0,0,100,0,0,0,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Say Line 6"),
(654606,9,2,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0.499598,"Tabetha - On Script - Set Orientation"),
(654606,9,3,0,0,0,100,0,1000,1000,0,0,17,133,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Set Emote State 133"),
(654606,9,4,0,0,0,100,0,10000,10000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Set Emote State 0"),
(654606,9,5,0,0,0,100,0,500,500,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Say Line 7"),
(654606,9,6,0,0,0,100,0,4000,4000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.1293,"Tabetha - On Script - Set Orientation"),
(654606,9,7,0,0,0,100,0,0,0,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Say Line 8"),
(654606,9,9,0,0,0,100,0,5000,5000,0,0,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Say Line 9"),
(654606,9,10,0,0,0,100,0,0,0,0,0,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tabetha - On Script - Add Npc Flag Questgiver+Gossip");
-- Mana Rift
UPDATE `gameobject` SET `spawntimesecs`=-600, `state`=1 WHERE `guid`=28294;
-- Mana Surge
DELETE FROM `smart_scripts` WHERE `entryorguid`=6550 AND `source_type`=0 AND `id`=3;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(6550,0,3,0,54,0,100,0,0,0,0,0,11,9096,0,0,0,0,0,1,0,0,0,0,0,0,0,"Mana Surge - On Just Summoned - Cast 'Rift SPawn Manifestation'");
-- Condition
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=6550 AND `ConditionTypeOrReference`=9;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(22,2,6550,0,0,9,0,1957,0,0,0,0,0,"","SAI triggers only if player has quest 'Mana Surges' taken");
*/

View File

@@ -6831,7 +6831,7 @@ void ObjectMgr::SetHighestGuids()
if (result)
sGuildMgr->SetNextGuildId((*result)[0].GetUInt32() + 1);
result = CharacterDatabase.Query("SELECT MAX(guid) FROM groups");
result = CharacterDatabase.Query("SELECT MAX(guid) FROM `groups`");
if (result)
sGroupMgr->SetGroupDbStoreSize((*result)[0].GetUInt32() + 1);

View File

@@ -125,14 +125,14 @@ void GroupMgr::LoadGroups()
uint32 oldMSTime = getMSTime();
// Delete all groups whose leader does not exist
CharacterDatabase.DirectExecute("DELETE FROM groups WHERE leaderGuid NOT IN (SELECT guid FROM characters)");
CharacterDatabase.DirectExecute("DELETE FROM `groups` WHERE leaderGuid NOT IN (SELECT guid FROM characters)");
// Delete all groups with less than 2 members
CharacterDatabase.DirectExecute("DELETE FROM groups WHERE guid NOT IN (SELECT guid FROM group_member GROUP BY guid HAVING COUNT(guid) > 1)");
CharacterDatabase.DirectExecute("DELETE FROM `groups` WHERE guid NOT IN (SELECT guid FROM group_member GROUP BY guid HAVING COUNT(guid) > 1)");
// 0 1 2 3 4 5 6 7 8 9
QueryResult result = CharacterDatabase.Query("SELECT g.leaderGuid, g.lootMethod, g.looterGuid, g.lootThreshold, g.icon1, g.icon2, g.icon3, g.icon4, g.icon5, g.icon6"
// 10 11 12 13 14 15 16 17 18
", g.icon7, g.icon8, g.groupType, g.difficulty, g.raidDifficulty, g.masterLooterGuid, g.guid, lfg.dungeon, lfg.state FROM groups g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
", g.icon7, g.icon8, g.groupType, g.difficulty, g.raidDifficulty, g.masterLooterGuid, g.guid, lfg.dungeon, lfg.state FROM `groups` g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 group definitions. DB table `groups` is empty!");
@@ -168,8 +168,8 @@ void GroupMgr::LoadGroups()
uint32 oldMSTime = getMSTime();
// Delete all rows from group_member or group_instance with no group
CharacterDatabase.DirectExecute("DELETE FROM group_member WHERE guid NOT IN (SELECT guid FROM groups)");
CharacterDatabase.DirectExecute("DELETE FROM group_instance WHERE guid NOT IN (SELECT guid FROM groups)");
CharacterDatabase.DirectExecute("DELETE FROM group_member WHERE guid NOT IN (SELECT guid FROM `groups`)");
CharacterDatabase.DirectExecute("DELETE FROM group_instance WHERE guid NOT IN (SELECT guid FROM `groups`)");
// Delete all members that does not exist
CharacterDatabase.DirectExecute("DELETE FROM group_member WHERE memberGuid NOT IN (SELECT guid FROM characters)");
@@ -207,7 +207,7 @@ void GroupMgr::LoadGroups()
// 0 1 2 3 4 5
QueryResult result = CharacterDatabase.Query("SELECT gi.guid, i.map, gi.instance, gi.permanent, i.difficulty, i.resettime, "
// 6
"(SELECT COUNT(1) FROM character_instance ci LEFT JOIN groups g ON ci.guid = g.leaderGuid WHERE ci.instance = gi.instance AND ci.permanent = 1 LIMIT 1) "
"(SELECT COUNT(1) FROM character_instance ci LEFT JOIN `groups` g ON ci.guid = g.leaderGuid WHERE ci.instance = gi.instance AND ci.permanent = 1 LIMIT 1) "
"FROM group_instance gi LEFT JOIN instance i ON gi.instance = i.id ORDER BY guid");
if (!result)

View File

@@ -273,7 +273,7 @@ void InstanceSaveManager::LoadInstances()
// Delete invalid character_instance and group_instance references
CharacterDatabase.DirectExecute("DELETE ci.* FROM character_instance AS ci LEFT JOIN characters AS c ON ci.guid = c.guid WHERE c.guid IS NULL");
CharacterDatabase.DirectExecute("DELETE gi.* FROM group_instance AS gi LEFT JOIN groups AS g ON gi.guid = g.guid WHERE g.guid IS NULL");
CharacterDatabase.DirectExecute("DELETE gi.* FROM group_instance AS gi LEFT JOIN `groups` AS g ON gi.guid = g.guid WHERE g.guid IS NULL");
// Delete invalid instance references
CharacterDatabase.DirectExecute("DELETE i.* FROM instance AS i LEFT JOIN character_instance AS ci ON i.id = ci.instance LEFT JOIN group_instance AS gi ON i.id = gi.instance WHERE ci.guid IS NULL AND gi.guid IS NULL");