text: SET NAMES 'utf8';
  
  DELETE FROM `trinity_string` WHERE entry IN (756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,780,781,782,783);
  INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
  ('756', 'Battle begins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Битва началась'),
  ('757', '%s has successfully defended the fortress!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '%s успешно защитил(а) крепость!'),
  ('758', '%s has taken over the fortress!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '%s захватил(а) крепость'),
  ('759', 'The %s siege workshop has been damaged by the %s!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('760', 'The %s siege workshop has been destroyed by the %s!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('761', 'The %s tower has been damaged!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '%s башня повреждена'),
  ('762', 'The %s tower has been destroyed!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '%s башня уничтожена!'),
  ('763', 'Wintergrasp fortress is under attack!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('764', 'Wintergrasp is now under the control of the %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('765', 'Wintergrasp timer set to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('766', 'Wintergrasp battle started.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('767', 'Wintergrasp battle finished.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('768', 'Wintergrasp info: %s controlled. Timer: %s. Wartime: %s. Number of Players: (Horde: %u, Alliance: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('769', 'Wintergrasp outdoorPvP is disabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('770', 'Wintergrasp outdoorPvP is enabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  ('771', 'You have reached Rank 1: Corporal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Вы достигли Ранга 1: Капрал'),
  ('772', 'You have reached Rank 2: First Lieutenant', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Вы достигли Ранга 2: Лейтенант'),
  ('780', 'Before the Battle of  Wintergrasp left 30 minutes!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'До битвы на  Озере Ледяных Оков осталось 30 минут!'),
  ('781', 'Before the Battle of  Wintergrasp left 10 minutes! Portal from Dalaran will work at begin of the battle.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'До битвы на  Озере Ледяных Оков осталось 10 минут! Портал с Даларана начнет работу во время боя.'),
  ('782', 'The battle for Wintergrasp  has stopped! Not enough defenders. Wintergrasp Fortress remains  Attackers.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Битва за Озеро Ледяных Оков Остановлена. Не хватает защитников. Крепость переходит атакующей  стороне.'),
  ('783', 'The battle for Wintergrasp  has stopped! Not enough attackers. Wintergrasp Fortress remains  Defenders.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Битва за Озеро Ледяных Оков Остановлена. Не хватает нападающих. Крепость остается защитникам.');
  
  DELETE FROM `command` WHERE name IN ('wg','wg enable','wg start','wg status','wg stop','wg switch','wg timer');
  INSERT INTO `command` (`name`, `security`, `help`) VALUES
  ('wg', '3', 'Syntax: .wg $subcommand.'),
  ('wg enable', '3', 'Syntax: .wg enable [on/off] Enable/Disable Wintergrasp outdoorPvP.'),
  ('wg start', '3', 'Syntax: .wg start\r\nForce Wintergrasp battle start.'),
  ('wg status', '3', 'Syntax: .wg status\r\nWintergrasp info, defender, timer, wartime.'),
  ('wg stop', '3', 'Syntax: .wg stop\r\nForce Wintergrasp battle stop (No rewards).'),
  ('wg switch', '3', 'Syntax: .wg switch\r\nSwitchs Wintergrasp defender team.'),
  ('wg timer', '3', 'Syntax: .wg timer $minutes\r\nChange the current timer. Min value = 1, Max value 60 (Wartime), 1440 (Not Wartime)');
  
  DELETE FROM `outdoorpvp_template` WHERE TypeId=7;
  INSERT INTO `outdoorpvp_template` (`TypeId`, `ScriptName`, `comment`) VALUES 
  ('7', 'outdoorpvp_wg', 'Wintergrasp');
  UPDATE `creature_template` SET `ScriptName` = 'npc_demolisher_engineerer' WHERE `entry` IN (30400,30499);
  
  DELETE FROM `spell_target_position` WHERE id IN ('59096', '58632', '58633');
  INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES
  ('59096', '571', '5325.06', '2843.36', '409.285', '3.20278'),
  ('58632', '571', '5097.79', '2180.29', '365.61', '2.41'),
  ('58633', '571', '5026.80', '3676.69', '362.58', '3.94');
  
  DELETE FROM `spell_linked_spell` WHERE spell_trigger=54640;
  INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES 
  ('54640','54643','0','Defender\'s Portal Activate Proper Spell');
  
  DELETE FROM `spell_linked_spell` WHERE spell_trigger=58729;
  INSERT INTO `spell_linked_spell` VALUES (58729, -33786, 2, 'Spiritual Immunity: Protect From Cyclone (now Immune always)');
  
  DELETE FROM gameobject WHERE id IN ('194323', '194162');
  DELETE FROM `gameobject` WHERE `id`=192829;
  
  UPDATE `gameobject_template` SET `faction` = 0, `flags` = 6553632 WHERE `entry` IN (190356,190357,190358);
  UPDATE creature_template SET npcflag=npcflag|32768 WHERE entry IN (31841,31842);
  UPDATE creature_template SET faction_A = '1802', faction_H = '1802' WHERE entry IN (30499,28312,28319);
  UPDATE creature_template SET faction_A = '1801', faction_H = '1801' WHERE entry IN (30400,32629,32627);
  UPDATE creature_template SET npcflag=npcflag|32768 WHERE entry   IN (31841,31842);
  
  DELETE FROM `conditions` WHERE ConditionValue2=27852;
  INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
  (13, 0, 49899, 0, 18, 1, 27852, 0, 0, '', NULL),
  (13, 0, 56575, 0, 18, 1, 27852, 0, 0, '', NULL),
  (13, 0, 56661, 0, 18, 1, 27852, 0, 0, '', NULL),
  (13, 0, 56663, 0, 18, 1, 27852, 0, 0, '', NULL),
  (13, 0, 56665, 0, 18, 1, 27852, 0, 0, '', NULL),
  (13, 0, 56667, 0, 18, 1, 27852, 0, 0, '', NULL),
  (13, 0, 56669, 0, 18, 1, 27852, 0, 0, '', NULL),
  (13, 0, 61408, 0, 18, 1, 27852, 0, 0, '', NULL);
  
  UPDATE `gameobject_template` SET `faction` = 35 WHERE `entry` IN (192028,192029,192030,192031,192032,192033);
  DELETE FROM `spell_area` WHERE spell IN (58730, 57940, 58045);
  INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_start_active`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`) VALUES
  (58730, 4197, 0, 0, 0, 0, 0, 2, 1),
  (58730, 4584, 0, 0, 0, 0, 0, 2, 1),
  (58730, 4581, 0, 0, 0, 0, 0, 2, 1),
  (58730, 4585, 0, 0, 0, 0, 0, 2, 1),
  (58730, 4612, 0, 0, 0, 0, 0, 2, 1),
  (58730, 4582, 0, 0, 0, 0, 0, 2, 1),
  (58730, 4611, 0, 0, 0, 0, 0, 2, 1),
  (58730, 4578, 0, 0, 0, 0, 0, 2, 1),
  (58730, 4576, 0, 0, 0, 0, 0, 2, 1),
  (58730, 4538, 0, 0, 0, 0, 0, 2, 1),
  (57940, 65, 0, 0, 0, 0, 0, 2, 1),
  (57940, 66, 0, 0, 0, 0, 0, 2, 1),
  (57940, 67, 0, 0, 0, 0, 0, 2, 1),
  (57940, 206, 0, 0, 0, 0, 0, 2, 1),
  (57940, 210, 0, 0, 0, 0, 0, 2, 1),
  (57940, 394, 0, 0, 0, 0, 0, 2, 1),
  (57940, 395, 0, 0, 0, 0, 0, 2, 1),
  (57940, 1196, 0, 0, 0, 0, 0, 2, 1),
  (57940, 2817, 0, 0, 0, 0, 0, 2, 1),
  (57940, 3456, 0, 0, 0, 0, 0, 2, 1),
  (57940, 3477, 0, 0, 0, 0, 0, 2, 1),
  (57940, 3537, 0, 0, 0, 0, 0, 2, 1),
  (57940, 3711, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4100, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4196, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4228, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4264, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4265, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4272, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4273, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4395, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4415, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4416, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4493, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4494, 0, 0, 0, 0, 0, 2, 1),
  (57940, 4603, 0, 0, 0, 0, 0, 2, 1),
  (58045, 4197, 0, 0, 0, 0, 0, 2, 1);
  
  DELETE FROM `gameobject` WHERE `id`=193772;
  INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
  ('', 193772, 571, 1, 64, 5924.11, 573.387, 661.087, 4.43208, 0, 0, 0.798953, -0.601393, 300, 0, 1),
  ('', 193772, 571, 1, 65535, 5686.57, 772.921, 647.754, 5.62225, 0, 0, 0.324484, -0.945891, 600, 0, 1),
  ('', 193772, 571, 1, 65535, 5930.82, 548.961, 640.632, 1.88506, 0, 0, 0.809047, 0.587744, 300, 0, 1);
  
  DELETE FROM `creature` WHERE `id`=32170;
  INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
  ('', 32170, 571, 1, 65535, 27801, 0, 5925.34, 573.71, 661.087, 4.06662, 300, 0, 0, 504000, 440700, 0, 0, 0, 0),
  ('', 32170, 571, 1, 64, 0, 918, 5932.96, 549.906, 641.595, 2.09189, 300, 0, 0, 504000, 440700, 0, 0, 0, 0);
  
  UPDATE `creature_template` SET `ScriptName`='npc_wg_ally_battle_mage' WHERE `entry`=32169;
  UPDATE `creature_template` SET `ScriptName`='npc_wg_horde_battle_mage' WHERE `entry`=32170;
  
  UPDATE `gameobject_template` SET `type` = 6, `faction` = 0, `data2` = 10, `data3` = 54643, `ScriptName` = 'go_wg_veh_teleporter' WHERE `entry` = 192951;