SET @GUID := 389040; -- +8
-- Задание 36436, 33689 "Подрезка растений"
-- Исправлены квестовые существа
UPDATE `creature_template` SET `unit_flags`=32768, `unit_flags2`=2048, `dynamicflags`=0 WHERE `entry`=81721; -- Dionor Seedpriest
UPDATE `creature_template` SET `unit_flags`=32768, `unit_flags2`=2048, `dynamicflags`=0 WHERE `entry`=81730; -- Thornling Scavenger
UPDATE `creature_template` SET `unit_flags`=32768, `unit_flags2`=2048, `dynamicflags`=0 WHERE `entry`=82753; -- Enraged Gembiter
UPDATE `creature_template` SET `unit_flags`=32768, `unit_flags2`=2048, `dynamicflags`=0 WHERE `entry`=81729; -- Enraged Gembiter
UPDATE `creature_template` SET `unit_flags`=32768, `unit_flags2`=2048, `dynamicflags`=0 WHERE `entry`=82777; -- Steamscar Warrior
UPDATE `creature_template` SET `unit_flags`=32768, `unit_flags2`=2048, `dynamicflags`=0 WHERE `entry`=84427; -- Iron Shieldbearer
UPDATE `creature_template_addon` SET `bytes1`=0, `auras`='' WHERE `entry`=81721; -- Dionor Seedpriest
UPDATE `creature_template_addon` SET `bytes1`=0, `auras`='' WHERE `entry`=81730; -- Thornling Scavenger
UPDATE `creature_template_addon` SET `bytes1`=0, `auras`='' WHERE `entry`=82753; -- Enraged Gembiter
UPDATE `creature_template_addon` SET `bytes1`=0, `auras`='' WHERE `entry`=81729; -- Enraged Gembiter
UPDATE `creature_template_addon` SET `bytes1`=0, `auras`='' WHERE `entry`=82777; -- Steamscar Warrior
UPDATE `creature_template_addon` SET `bytes1`=0, `auras`=''/*159474*/ WHERE `entry`=84427; -- Iron Shieldbearer
-- Задание 36437, 33685 "Посол к древнему"
-- Исправлен диалог с "Березусом"(81723)
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=81723; -- Birchus
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceEntry`=0 AND `SourceGroup`=16665;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 16665, 0, 0, 0, 9, 0, 36437, 0, 0, 0, 0, '', 'Show gossip option if Player has Quest 36437'),
(15, 16665, 0, 0, 1, 9, 0, 33685, 0, 0, 0, 0, '', 'Show gossip option if Player has Quest 33685');
DELETE FROM `smart_scripts` WHERE `entryorguid`=81723 AND `source_type`=0;
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
(81723, 0, 0, 1, 62, 0, 100, 0, 16665, 0, 0, 0, 33, 81723, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Birchus - On Gossip Select - Killcredit'),
(81723, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Birchus - On Link - Close Gossip');
-- Исправлен "Путь в лагерь саблеронов"
-- Добавлены "Альтаур"(85432) и "Рактот"(85089) для начала задания
DELETE FROM `creature` WHERE `id`=85089 AND `guid`=@GUID+1;
DELETE FROM `creature` WHERE `id`=85432 AND `guid`=@GUID+0;
INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `npcflag2`, `unit_flags`, `dynamicflags`) VALUES
(@GUID+1, 85089, 1116, 6721, 7190, 1, 1, '', 0, 1, 6973.27, 871.246, 93.2205, 0.790355, 300, 0, 0, 379734, 0, 0, 0, 0, 0, 0), -- Rakthoth
(@GUID+0, 85432, 1116, 6721, 7190, 1, 1, '', 0, 1, 6976.18, 868.368, 93.2095, 0.798209, 300, 0, 0, 379734, 0, 0, 0, 0, 0, 0); -- Altauur
-- 36438 33662
UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI', `ScriptName`='' WHERE `entry`=232258; -- Large Boulder
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=82296; -- Beatface
DELETE FROM `smart_scripts` WHERE `entryorguid`=232258 AND `source_type`=1;
DELETE FROM `smart_scripts` WHERE `entryorguid`=82296 AND `source_type`=0;
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
(232258, 1, 0, 1, 64, 0, 100, 0, 0, 0, 0, 0, 33, 82368, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Large Boulder - On Activate Cage - Killcredit'),
(232258, 1, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 67, 1, 2000, 2000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Large Boulder - On Link - Set Timeout'),
(232258, 1, 2, 3, 59, 0, 100, 0, 1, 0, 0, 0, 45, 1, 0, 0, 0, 0, 0, 9, 82296, 0, 20, 0, 0, 0, 0, 'Large Boulder - On Timeout - Set Data to Beatface'),
(232258, 1, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Large Boulder - On Link - Despawn (in sec)'),
(82296, 0, 0, 0, 38, 0, 100, 0, 1, 0, 0, 0, 67, 1, 2000, 2000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Beatface - On Data Set - Set Timeout'),
(82296, 0, 1, 0, 59, 0, 100, 0, 1, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Beatface - On Timeout - Despawn (in ms)');
-- 36439 33663
UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI', `ScriptName`='' WHERE `entry`=235381; -- Strong Vine Barricade
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=85275; -- Mechashredder 5000
DELETE FROM `smart_scripts` WHERE `entryorguid`=235381 AND `source_type`=1;
DELETE FROM `smart_scripts` WHERE `entryorguid`=85275 AND `source_type`=0;
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
(235381, 1, 0, 1, 70, 0, 100, 0, 2, 0, 0, 0, 33, 82369, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Strong Vine Barricade - On Activate Cage - Killcredit'),
(235381, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 85, 170334, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Strong Vine Barricade - On Link - Cast Summon Quickie Shredder'),
(235381, 1, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 67, 1, 2000, 2000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Strong Vine Barricade - On Link - Set Timeout'),
(235381, 1, 3, 4, 59, 0, 100, 0, 1, 0, 0, 0, 45, 1, 0, 0, 0, 0, 0, 9, 85275, 0, 20, 0, 0, 0, 0, 'Strong Vine Barricade - On Timeout - Set Data to Mechashredder 5000'),
(235381, 1, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Strong Vine Barricade - On Link - Despawn (in sec)'),
(85275, 0, 0, 0, 38, 0, 100, 0, 1, 0, 0, 0, 67, 1, 2000, 2000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mechashredder 5000 - On Data Set - Set Timeout'),
(85275, 0, 1, 0, 59, 0, 100, 0, 1, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mechashredder 5000 - On Timeout - Despawn (in ms)');
-- Задание 36440, 33661 "Сокращение численности саблеронов"
-- Добавлены "Альтаур"(85431) и "Рактот"(82222) для начала задания
DELETE FROM `creature` WHERE `id`=82222 AND `guid`=@GUID+3;
DELETE FROM `creature` WHERE `id`=85431 AND `guid`=@GUID+2;
DELETE FROM `creature` WHERE `id`=82222 AND `guid`=@GUID+5;
DELETE FROM `creature` WHERE `id`=85431 AND `guid`=@GUID+4;
INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `npcflag2`, `unit_flags`, `dynamicflags`) VALUES
(@GUID+3, 82222, 1116, 6721, 7304, 1, 1, '', 0, 1, 6914.65, 792.963, 155.704, 2.36901, 300, 0, 0, 379734, 0, 0, 0, 0, 0, 0), -- Rakthoth
(@GUID+2, 85431, 1116, 6721, 7304, 1, 1, '', 0, 1, 6891.86, 811.743, 150.839, 5.26713, 300, 0, 0, 379734, 0, 0, 0, 0, 0, 0), -- Altauur
(@GUID+5, 82222, 1116, 6721, 7304, 1, 1, '', 0, 1, 6792.73, 900.713, 149.866, 2.71722, 300, 0, 0, 379734, 0, 0, 0, 0, 0, 0), -- Rakthoth
(@GUID+4, 85431, 1116, 6721, 7304, 1, 1, '', 0, 1, 6789.63, 906.291, 149.511, 2.57847, 300, 0, 0, 379734, 0, 0, 0, 0, 0, 0); -- Altauur
UPDATE `creature_template` SET `faction`=2714 WHERE `entry`=82222; -- Rakthoth
-- Задание 36441, 33660 "Возврат собственности"
-- Добавлены "Альтаур"(85436) и "Рактот"(82225) для завершения задания
DELETE FROM `creature` WHERE `id`=82225 AND `guid`=@GUID+7;
DELETE FROM `creature` WHERE `id`=85436 AND `guid`=@GUID+6;
INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `npcflag2`, `unit_flags`, `dynamicflags`) VALUES
(@GUID+7, 82225, 1116, 6721, 7304, 1, 1, '', 0, 1, 6768.22, 738.665, 189.387, 5.84048, 300, 0, 0, 379734, 0, 0, 0, 0, 0, 0), -- Rakthoth
(@GUID+6, 85436, 1116, 6721, 7304, 1, 1, '', 0, 1, 6769.32, 745.589, 189.218, 5.61009, 300, 0, 0, 379734, 0, 0, 0, 0, 0, 0); -- Altauur
UPDATE `creature_template` SET `faction`=2714 WHERE `entry`=82225; -- Rakthoth
-- Задание 36442, 33695 "Добыть Цветок Смерти"
-- Добавлен "Березус"(82302) для завершения задания
DELETE FROM `creature` WHERE `id`=82302 AND `guid`=@GUID+8;
INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `npcflag2`, `unit_flags`, `dynamicflags`) VALUES
(@GUID+8, 82302, 1116, 6721, 7190, 1, 1, '', 0, 0, 7000.0, 955.0, 80.0833, 5.06145, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0); -- Birchus
-- Задание 36443, 33706 "Упокоение Дионора"
-- Исправлен ритуал у "Березуса"(82302)
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=82302; -- Birchus
DELETE FROM `smart_scripts` WHERE `entryorguid`=82302 AND `source_type`=0;
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
(82302, 0, 0, 0, 19, 0, 100, 0, 36443, 0, 0, 0, 33, 82384, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Birchus - On Quest Accepted (A) - Killcredit'),
(82302, 0, 1, 0, 19, 0, 100, 0, 33706, 0, 0, 0, 33, 82384, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Birchus - On Quest Accepted (H) - Killcredit');