-- Задание 25057 "В кандалы", 24572 "Возвращение Таурахо"
-- Мародер Таурахо больше не ваншотится
UPDATE `smart_scripts` SET `action_type`=2, `action_param1`=1077 WHERE `entryorguid`=37743 AND `source_type`=0 AND `id`=4 AND `link`=5; -- Taurajo Looter - On Link - Reset Faction
DELETE FROM `smart_scripts` WHERE `entryorguid`=37743 AND `source_type`=0 AND `id` IN (7, 8, 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
(37743, 0, 7, 0, 62, 0, 100, 0, 37743, 0, 0, 0, 42, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Taurajo Looter - On Gossip Select - Set Invincibility'),
(37743, 0, 8, 9, 7, 0, 100, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Taurajo Looter - On Evade - Reset Invincibility'),
(37743, 0, 9, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Taurajo Looter - On Link - Reset Faction');
-- Задания 25081, 24618 "Захватить Боевой Шрам"
-- Исправлен захват Флага Боевого Шрама
UPDATE `quest_objectives` SET `Type`=0/*10*/, `ObjectID`=37837/*-1*/, `Amount`=1/*0*/, `Description`='Battlescar Flag Scouted' WHERE `ID`=259939 AND `QuestID`=25081; -- Quest Claim the Battlescar (Alliance)
UPDATE `quest_objectives` SET `Type`=0/*10*/, `ObjectID`=39083/*-1*/, `Amount`=1/*0*/, `Description`='Battlescar Flag Scouted' WHERE `ID`=266351 AND `QuestID`=24618; -- Quest Claim the Battlescar (Horde)
DELETE FROM `areatrigger_scripts` WHERE `entry` IN (5784, 5667);
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(5784, 'SmartTrigger'), -- Areatrigger Battlescar Flag (Alliance)
(5667, 'SmartTrigger'); -- Areatrigger Battlescar Flag (Horde)
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (5784, 5667) AND `source_type`=2;
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
(5784, 2, 0, 0, 46, 0, 100, 0, 5784, 0, 0, 0, 33, 37837, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Areatrigger Battlescar Flag - On Trigger - Quest Credit (Alliance)'),
(5667, 2, 0, 0, 46, 0, 100, 0, 5667, 0, 0, 0, 33, 39083, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Areatrigger Battlescar Flag - On Trigger - Quest Credit (Horde)');
-- Задание 25120 "Последний бой Марли"
-- Исправлен разговор с Марлином Двукоссом и добавлен нпс для завершения задания
-- TODO
-- реализовать полет на вертолете
SET @GOSSIPID := 39155;
SET @MARLEY_GUID := 389000; -- Npc: 39188
DELETE FROM `creature` WHERE `id`=39188 AND `map`=1 AND `guid`=@MARLEY_GUID;
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`, `AiID`, `MovementID`, `MeleeID`, `isActive`, `skipClone`, `personal_size`, `isTeemingSpawn`, `unit_flags3`) VALUES
(@MARLEY_GUID, 39188, 1, 4709, 4856, 1, 1, '', 0, 0, -4077.44, -2294.32, 125.455, 3.14159, 120, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='', `gossip_menu_id`=@GOSSIPID WHERE `entry`=39155; -- Marley Twinbraid
DELETE FROM `gossip_menu_option` WHERE `MenuID`=@GOSSIPID;
INSERT INTO `gossip_menu_option` (`MenuID`, `OptionIndex`, `OptionNPC`, `OptionText`, `OptionType`, `OptionNpcflag`, `OptionNpcflag2`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxCurrency`, `BoxText`, `OptionBroadcastTextID`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES
(@GOSSIPID, 0, 0, 'I\'m ready. Marley. Let\'s fly!', 1, 1, 0, 0, 0, 0, 0, 0, '', 0, 0, 0);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceEntry`=0 AND `SourceGroup`=@GOSSIPID;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, @GOSSIPID, 0, 0, 0, 9, 0, 25120, 0, 0, 0, 0, '', 'Show gossip option if Player has Quest 25120');
DELETE FROM `smart_scripts` WHERE `entryorguid`=39155 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
(39155, 0, 0, 1, 62, 0, 100, 0, @GOSSIPID, 0, 0, 0, 33, 39187, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Marley Twinbraid - On Gossip Select - Killcredit'),
(39155, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Marley Twinbraid - On Link - Close Gossip'),
(39155, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, -4090.59, -2299.25, 124.877, 0.486945, 'Marley Twinbraid - On Link - Teleport to');