开发:有关于任务位面刷新生物、物件的修复的参考模板
可参考https://github.com/TrinityCore/TrinityCore/issues/29224
Handle phase 4139
SET @CGUID := xxxx;
SET @OGUID := xxxx;
DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+4;
INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `terrainSwapMap`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `VerifiedBuild`) VALUES
(@CGUID+0, 76556, 0, 4, 6963, '0', 4139, 0, 1190, 0, 1, -11481.1767578125, -3454.328125, 33.1897735595703125, 1.261624574661254882, 120, 0, 0, 3200, 0, 0, 0, 0, 50747), -- Ironmarch Grunt (Area: The Shattered Front - Difficulty: 0) CreateObject1 (Auras: 29266 - Permanent Feign Death)
(@CGUID+1, 76556, 0, 4, 6963, '0', 4139, 0, 1190, 0, 1, -11477.544921875, -3466.835205078125, 28.57114410400390625, 5.178782939910888671, 120, 0, 0, 3200, 0, 0, 0, 0, 50747), -- Ironmarch Grunt (Area: The Shattered Front - Difficulty: 0) CreateObject1 (Auras: 29266 - Permanent Feign Death)
(@CGUID+2, 76643, 0, 4, 6963, '0', 4139, 0, 1190, 0, 1, -11475.9970703125, -3452.428955078125, 32.78908157348632812, 2.560125589370727539, 120, 0, 0, 9600, 9573, 0, 0, 0, 50747), -- Archmage Khadgar (Area: The Shattered Front - Difficulty: 0) CreateObject1
(@CGUID+3, 38821, 0, 4, 6953, '0', 4139, 0, 1190, 0, 0, -11476.9951171875, -3467.401123046875, 28.61593055725097656, 0, 120, 0, 0, 112919, 0, 0, 0, 0, 50747), -- Dave's Industrial Light and Magic Bunny (Medium)(Sessile) (Area: Shattered Beachhead - Difficulty: 0) CreateObject1 (Auras: 140255 - Purple Fire Cosmetic)
(@CGUID+4, 38821, 0, 4, 6953, '0', 4139, 0, 1190, 0, 0, -11481.169921875, -3453.536376953125, 33.19791412353515625, 2.36602783203125, 120, 0, 0, 112919, 0, 0, 0, 0, 50747); -- Dave's Industrial Light and Magic Bunny (Medium)(Sessile) (Area: Shattered Beachhead - Difficulty: 0) CreateObject1 (Auras: 140255 - Purple Fire Cosmetic)
DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+4;
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
(@CGUID+0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '29266'), -- Ironmarch Grunt - 29266 - Permanent Feign Death
(@CGUID+1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '29266'), -- Ironmarch Grunt - 29266 - Permanent Feign Death
(@CGUID+3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, '140255'), -- Dave's Industrial Light and Magic Bunny (Medium)(Sessile) - 140255 - Purple Fire Cosmetic
(@CGUID+4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, '140255'); -- Dave's Industrial Light and Magic Bunny (Medium)(Sessile) - 140255 - Purple Fire Cosmetic
DELETE FROM `scene_template` WHERE `SceneId`=844;
INSERT INTO `scene_template` (`SceneId`, `Flags`, `ScriptPackageID`, `Encrypted`) VALUES
(844, 16, 1001, 0);
DELETE FROM `gameobject` WHERE `guid` = @OGUID+0;
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
(@OGUID+0, 234576, 0, 4, 6963, '0', 4139, 0, -11479.3994140625, -3452.3525390625, 33.07344436645507812, 1.162210941314697265, 0, 0, 0.548948287963867187, 0.835856318473815917, 120, 255, 1, 50747); -- Telescope (Area: The Shattered Front - Difficulty: 0) CreateObject1
DELETE FROM `creature_equip_template` WHERE (`ID`=1 AND `CreatureID` = 76643);
INSERT INTO `creature_equip_template` (`CreatureID`, `ID`, `ItemID1`, `AppearanceModID1`, `ItemVisual1`, `ItemID2`, `AppearanceModID2`, `ItemVisual2`, `ItemID3`, `AppearanceModID3`, `ItemVisual3`, `VerifiedBuild`) VALUES
(76643, 1, 28067, 0, 0, 0, 0, 0, 0, 0, 0, 50747); -- Archmage Khadgar
DELETE FROM `creature_template_movement` WHERE `CreatureId`=88206;
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES
(88206, 0, 0, 1, 1, 0, 0, NULL);
DELETE FROM `phase_name` WHERE `ID`=4139;
INSERT INTO `phase_name` (`ID`, `Name`) VALUES
(4139, 'Cosmetic - See Archmage Khadgar at The Shattered Front');
DELETE FROM `phase_area` WHERE `AreaId`=4 AND `PhaseId` = 4139;
INSERT INTO `phase_area` (`AreaId`, `PhaseId`, `Comment`) VALUES
(4, 4139, 'Archmage Khadgar at the top of the hill - Quest 36379');
DELETE FROM `areatrigger_scripts` WHERE `entry` = 10254;
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(10254, 'SmartTrigger');
DELETE FROM `smart_scripts` WHERE `entryorguid`=10254 AND `source_type`=2 AND `id`=0 AND `link`=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`, `event_param5`, `event_param_string`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `action_param7`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(10254, 2, 0, 0, 46, 0, 100, 0, 0, 0, 0, 0, 0, '', 1, 0, 0, 0, 0, 0, 0, 0, 19, 76643, 0, 0, 0, 0, 0, 0, 0, 'On trigger - Archmage Khadgar talks to Player');
DELETE FROM `creature_text` WHERE `CreatureID` = 76643;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(76643, 0, 0, 'I was a moment too late. Your scout is dead... this is worse than I could have imagined. The Iron Horde invasion has begun. Take a look for yourself.', 12, 0, 100, 16, 0, 0, 88578, 0, 'Archmage Khadgar to Player');
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=26 AND `SourceGroup` = 4139 AND `SourceEntry` = 4);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES
(26, 4139, 4, 0, 0, 47, 0, 36379, 8 | 2, 0, 0, 'Apply Phase 4139 if Quest 36379 is in progress | completed');
UPDATE `creature_template` SET `faction`=14 WHERE `entry`=76556; -- Ironmarch Grunt
UPDATE `creature_template` SET `BaseAttackTime`=2000, `unit_flags`=33024, `unit_flags2`=2048 WHERE `entry` = 76643; -- Archmage Khadgar
UPDATE `creature_queststarter` SET `VerifiedBuild`=50747 WHERE (`id`=85213 AND `quest` = 36379);
UPDATE `creature_questender` SET `VerifiedBuild`=50747 WHERE (`id`=85213 AND `quest` = 36379);
UPDATE `gameobject_template` SET `ContentTuningId`=1221, `VerifiedBuild`=50747 WHERE `entry`=234576; -- Telescope
UPDATE `gameobject_template_addon` SET `flags`=4 WHERE `entry`=234576; -- Telescope