aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2024_04_12_02_world.sql121
-rw-r--r--src/server/scripts/Pandaria/zone_the_wandering_isle.cpp219
2 files changed, 340 insertions, 0 deletions
diff --git a/sql/updates/world/master/2024_04_12_02_world.sql b/sql/updates/world/master/2024_04_12_02_world.sql
new file mode 100644
index 00000000000..c513d92aa51
--- /dev/null
+++ b/sql/updates/world/master/2024_04_12_02_world.sql
@@ -0,0 +1,121 @@
+-- Creature
+UPDATE `creature` SET `PhaseId` = 0 WHERE `id` = 54130 AND `PhaseId` = 629;
+UPDATE `creature_template` SET `StringId`='npc_min_dimwind', `VerifiedBuild`=53040 WHERE `entry`=54855;
+UPDATE `creature_template` SET `BaseAttackTime`=2000, `unit_flags`=768, `unit_flags2`=2048, `ScriptName`='npc_min_dimwind_summon' WHERE `entry`=56503; -- Min Dimwind
+UPDATE `creature_template_difficulty` SET `StaticFlags1`=268435456, `VerifiedBuild`=53584 WHERE (`DifficultyID`=0 AND `Entry` IN (54785,54855)); -- Min Dimwind
+UPDATE `creature_template_addon` SET `auras`='109005' WHERE `entry`=56503; -- Min Dimwind - Min Dimwind Guardian Aura (SERVERSIDE)
+
+UPDATE `creature` SET `ScriptName`='npc_amberleaf_scamp', `StringId`='npc_amberleaf_scamp_1', `VerifiedBuild`=53040 WHERE `guid`=450251;
+UPDATE `creature` SET `ScriptName`='npc_amberleaf_scamp', `StringId`='npc_amberleaf_scamp_2', `VerifiedBuild`=53040 WHERE `guid`=450268;
+UPDATE `creature` SET `ScriptName`='npc_amberleaf_scamp', `StringId`='npc_amberleaf_scamp_3', `VerifiedBuild`=53040 WHERE `guid`=450248;
+UPDATE `creature` SET `ScriptName`='npc_amberleaf_scamp', `StringId`='npc_amberleaf_scamp_4', `VerifiedBuild`=53040 WHERE `guid`=450245;
+UPDATE `creature` SET `ScriptName`='npc_amberleaf_scamp', `StringId`='npc_amberleaf_scamp_5', `VerifiedBuild`=53040 WHERE `guid`=450247;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=106205;
+INSERT INTO `conditions` VALUES
+(13, 1, 106205, 0, 0, 31, 0, 3, 54855, 0, '', 0, 0, 0, '', 'Spell \'Summon Cart Driver\' can only hit Min Dimwind');
+
+-- Missing Aysa Cloudsinger stuff
+UPDATE `creature_template_difficulty` SET `StaticFlags1`=268435712, `VerifiedBuild`=53584 WHERE (`Entry`=54567 AND `DifficultyID`=0); -- Aysa Cloudsinger
+
+DELETE FROM `creature_template_gossip` WHERE (`CreatureID`=54567 AND `MenuID`=13037);
+INSERT INTO `creature_template_gossip` (`CreatureID`, `MenuID`, `VerifiedBuild`) VALUES
+(54567, 13037, 53584); -- Aysa Cloudsinger
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=13037;
+INSERT INTO `conditions` VALUES (14, 13037, 0, 0, 0, 47, 0, 29419, 2 | 64, 0, '', 0, 0, 0, '', 'Aysa Cloudsinger - Show Gossip Menu 13037 if Quest 29419 is complete | rewarded');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=14672;
+INSERT INTO `conditions` VALUES (14, 14672, 0, 0, 0, 47, 0, 29419, 2 | 64, 0, '', 1, 0, 0, '', 'Aysa Cloudsinger - Show Gossip Menu 14672 if Quest 29419 is not complete | rewarded');
+
+-- Texts
+DELETE FROM `creature_text` WHERE `CreatureID` IN (54130, 56503) AND `GroupId` IN (0, 1, 2, 3);
+INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(54130, 0, 0, 'Look out! Its friendses are coming!', 14, 0, 100, 2, 0, 0, 56473, 0, 'Amberleaf Scamp to Player'),
+(54130, 1, 0, 'Run away!', 14, 0, 100, 2, 0, 0, 56474, 0, 'Amberleaf Scamp to Player'),
+(56503, 0, 0, 'Master Shang has trained you well. Thank you, friend!', 12, 0, 100, 2, 0, 0, 53265, 0, 'Min Dimwind to Player'),
+(56503, 1, 0, 'I couldn\'t have fought them off alone. Now, if you\'ll excuse me, I should go find my cart.', 12, 0, 100, 1, 0, 0, 56452, 0, 'Min Dimwind to Player'),
+(56503, 2, 0, 'Cart!', 14, 0, 100, 22, 0, 0, 56453, 0, 'Min Dimwind to Player'),
+(56503, 3, 0, 'Hello, cart. Still upside-downed, I see.', 12, 0, 100, 1, 0, 0, 56454, 0, 'Min Dimwind to Player');
+
+-- Phase
+DELETE FROM `phase_area` WHERE `AreaId` = 5825 AND `PhaseId` IN (629, 630);
+INSERT INTO `phase_area` (`AreaId`, `PhaseId`, `Comment`) VALUES
+(5825, 629, 'See Min Dimwind captured at The Dawning Valley'),
+(5825, 630, 'See Min Dimwind freed at The Dawning Valley');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=26 AND `SourceGroup`=629 AND `SourceEntry` = 0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(26, 629, 0, 0, 0, 47, 0, 29419, 2 | 64, 0, 1, 0, 0, '', 'Apply Phase 629 if quest 29419 is not complete | rewarded');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=26 AND `SourceGroup`=630 AND `SourceEntry`=0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(26, 630, 0, 0, 0, 1, 0, 106205, 0, 0, 1, 0, 0, '', 'Apply Phase 630 if has no aura 106205'),
+(26, 630, 0, 0, 0, 47, 0, 29419, 2 | 64, 0, 0, 0, 0, '', 'Apply Phase 630 if Quest 29419 is complete | rewarded');
+
+-- Areatrigger
+DELETE FROM `areatrigger_scripts` WHERE `entry`=6958;
+INSERT INTO `areatrigger_scripts` VALUES
+(6958, 'at_min_dimwind_captured');
+
+-- Quest
+DELETE FROM `quest_objectives_completion_effect` WHERE `ObjectiveID`=252090;
+INSERT INTO `quest_objectives_completion_effect` (`ObjectiveID`, `GameEventID`, `SpellID`, `ConversationID`, `UpdatePhaseShift`, `UpdateZoneAuras`) VALUES
+(252090, NULL, NULL, NULL, 1, 1);
+
+UPDATE `quest_template_locale` SET `QuestDescription`='Mi conductor salió corriendo tras los duendes, después de que nos atacaran. No creo que le hagan daño, pero lo necesito de vuelta para que me ayude a limpiar este desastre.$b$bLos siguió hacia los riscos del norte. Si vas en esa dirección, no tardarás en encontrarlo.', `VerifiedBuild`=53584 WHERE (`ID`=29419 AND `locale`='esES');
+UPDATE `quest_template_locale` SET `LogDescription`='Recupera 6 suministros de entrenamiento de malandrines Hojámbar.', `QuestDescription`='Unos malandrines Hojámbar asaltaron mi carro y se llevaron casi todos los suministros de entrenamiento que traía. Siempre nos han dado problemas, pero nunca los había visto tan agresivos. No sé qué les ha pasado.$b$bTe lo ruego, ayúdame a recuperar mis suministros.', `VerifiedBuild`=53584 WHERE (`ID`=29424 AND `locale`='esES');
+
+-- Serverside spells
+DELETE FROM `serverside_spell` WHERE `Id`=109005 AND `DifficultyID`=0;
+INSERT INTO `serverside_spell` (`Id`, `DifficultyID`, `CategoryId`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `AttributesEx8`, `AttributesEx9`, `AttributesEx10`, `AttributesEx11`, `AttributesEx12`, `AttributesEx13`, `AttributesEx14`, `Stances`, `StancesNot`, `Targets`, `TargetCreatureType`, `RequiresSpellFocus`, `FacingCasterFlags`, `CasterAuraState`, `TargetAuraState`, `ExcludeCasterAuraState`, `ExcludeTargetAuraState`, `CasterAuraSpell`, `TargetAuraSpell`, `ExcludeCasterAuraSpell`, `ExcludeTargetAuraSpell`, `CasterAuraType`, `TargetAuraType`, `ExcludeCasterAuraType`, `ExcludeTargetAuraType`, `CastingTimeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `StartRecoveryCategory`, `StartRecoveryTime`, `InterruptFlags`, `AuraInterruptFlags1`, `AuraInterruptFlags2`, `ChannelInterruptFlags1`, `ChannelInterruptFlags2`, `ProcFlags`, `ProcFlags2`, `ProcChance`, `ProcCharges`, `ProcCooldown`, `ProcBasePPM`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `Speed`, `LaunchDelay`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `ContentTuningId`, `SpellName`, `ConeAngle`, `ConeWidth`, `MaxTargetLevel`, `MaxAffectedTargets`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `SpellFamilyFlags4`, `DmgClass`, `PreventionType`, `AreaGroupId`, `SchoolMask`, `ChargeCategoryId`) VALUES
+(109005, 0, 0, 0, 0, 0x29800180, 0x420, 0x10484005, 0x10130200, 0x800080, 0x60008, 0x1200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 21, 1, 0, 0, 0, -1, 0, 0, 0, 'Min Dimwind Guardian Aura', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);
+
+DELETE FROM `serverside_spell_effect` WHERE `SpellID`=109005 AND `EffectIndex`=0 AND `DifficultyID`=0;
+INSERT INTO `serverside_spell_effect` (`SpellID`, `EffectIndex`, `DifficultyID`, `Effect`, `EffectAura`, `EffectAmplitude`, `EffectAttributes`, `EffectAuraPeriod`, `EffectBonusCoefficient`, `EffectChainAmplitude`, `EffectChainTargets`, `EffectItemType`, `EffectMechanic`, `EffectPointsPerResource`, `EffectPosFacing`, `EffectRealPointsPerLevel`, `EffectTriggerSpell`, `BonusCoefficientFromAP`, `PvpMultiplier`, `Coefficient`, `Variance`, `ResourceCoefficient`, `GroupSizeBasePointsCoefficient`, `EffectBasePoints`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectSpellClassMask1`, `EffectSpellClassMask2`, `EffectSpellClassMask3`, `EffectSpellClassMask4`, `ImplicitTarget1`, `ImplicitTarget2`) VALUES
+(109005, 0, 0, 119, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 1, 0);
+
+DELETE FROM `serverside_spell` WHERE `Id`=106231 AND `DifficultyID`=0;
+INSERT INTO `serverside_spell` (`Id`, `DifficultyID`, `CategoryId`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `AttributesEx8`, `AttributesEx9`, `AttributesEx10`, `AttributesEx11`, `AttributesEx12`, `AttributesEx13`, `AttributesEx14`, `Stances`, `StancesNot`, `Targets`, `TargetCreatureType`, `RequiresSpellFocus`, `FacingCasterFlags`, `CasterAuraState`, `TargetAuraState`, `ExcludeCasterAuraState`, `ExcludeTargetAuraState`, `CasterAuraSpell`, `TargetAuraSpell`, `ExcludeCasterAuraSpell`, `ExcludeTargetAuraSpell`, `CasterAuraType`, `TargetAuraType`, `ExcludeCasterAuraType`, `ExcludeTargetAuraType`, `CastingTimeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `StartRecoveryCategory`, `StartRecoveryTime`, `InterruptFlags`, `AuraInterruptFlags1`, `AuraInterruptFlags2`, `ChannelInterruptFlags1`, `ChannelInterruptFlags2`, `ProcFlags`, `ProcFlags2`, `ProcChance`, `ProcCharges`, `ProcCooldown`, `ProcBasePPM`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `Speed`, `LaunchDelay`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `ContentTuningId`, `SpellName`, `ConeAngle`, `ConeWidth`, `MaxTargetLevel`, `MaxAffectedTargets`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `SpellFamilyFlags4`, `DmgClass`, `PreventionType`, `AreaGroupId`, `SchoolMask`, `ChargeCategoryId`) VALUES
+(106231, 0, 0, 0, 0, 0x29800180, 0x420, 0x10484005, 0x10130200, 0x800080, 0x60008, 0x1200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, -1, 0, 0, 0, 'Escort Kill Credit', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);
+
+DELETE FROM `serverside_spell_effect` WHERE `SpellID`=106231 AND `EffectIndex`=0 AND `DifficultyID`=0;
+INSERT INTO `serverside_spell_effect` (`SpellID`, `EffectIndex`, `DifficultyID`, `Effect`, `EffectAura`, `EffectAmplitude`, `EffectAttributes`, `EffectAuraPeriod`, `EffectBonusCoefficient`, `EffectChainAmplitude`, `EffectChainTargets`, `EffectItemType`, `EffectMechanic`, `EffectPointsPerResource`, `EffectPosFacing`, `EffectRealPointsPerLevel`, `EffectTriggerSpell`, `BonusCoefficientFromAP`, `PvpMultiplier`, `Coefficient`, `Variance`, `ResourceCoefficient`, `GroupSizeBasePointsCoefficient`, `EffectBasePoints`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectSpellClassMask1`, `EffectSpellClassMask2`, `EffectSpellClassMask3`, `EffectSpellClassMask4`, `ImplicitTarget1`, `ImplicitTarget2`) VALUES
+(106231, 0, 0, 90, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54855, 0, 0, 0, 0, 0, 0, 0, 1, 0);
+
+-- Waypoint
+SET @ENTRY := 56503;
+SET @PATHOFFSET := 0;
+SET @PATH := @ENTRY * 100 + @PATHOFFSET;
+DELETE FROM `waypoint_path` WHERE `PathId`= @PATH;
+INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Comment`) VALUES
+(@PATH, 1, 0, 'Min Dimwind - The Missing Driver quest Path (Run)');
+
+DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH;
+INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES
+(@PATH, 0, 1398.465, 3547.49, 90.54716, NULL, 2151),
+(@PATH, 1, 1379.332, 3566.672, 91.59061, NULL, 0),
+(@PATH, 2, 1375.625, 3574.563, 92.0024, NULL, 0),
+(@PATH, 3, 1374.854, 3583.098, 91.44274, NULL, 2452),
+(@PATH, 4, 1350.017, 3582.917, 90.40493, NULL, 0),
+(@PATH, 5, 1343.707, 3578.441, 91.90857, NULL, 0),
+(@PATH, 6, 1335.036, 3568.839, 92.75056, NULL, 0),
+(@PATH, 7, 1327.979, 3558.321, 95.62209, NULL, 0),
+(@PATH, 8, 1323.058, 3544.156, 98.3161, NULL, 0),
+(@PATH, 9, 1315.585, 3536.41, 99.88802, NULL, 0),
+(@PATH, 10, 1306.488, 3529.573, 99.48459, NULL, 0),
+(@PATH, 11, 1298.543, 3526.758, 98.71962, NULL, 2258);
+
+SET @ENTRY := 56503;
+SET @PATHOFFSET := 1;
+SET @PATH := @ENTRY * 100 + @PATHOFFSET;
+DELETE FROM `waypoint_path` WHERE `PathId`= @PATH;
+INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Comment`) VALUES
+(@PATH, 0, 0, 'Min Dimwind - The Missing Driver quest Path (Walk)');
+
+DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH;
+INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES
+(@PATH, 0, 1295.491, 3518.463, 100.586, NULL, 0),
+(@PATH, 1, 1291.623, 3517.362, 100.1056, NULL, 0),
+(@PATH, 2, 1288.08, 3518.94, 98.69194, NULL, 0),
+(@PATH, 3, 1286.559, 3522.084, 97.63205, NULL, 0);
diff --git a/src/server/scripts/Pandaria/zone_the_wandering_isle.cpp b/src/server/scripts/Pandaria/zone_the_wandering_isle.cpp
index 3ae96020d88..dfdd821eb2f 100644
--- a/src/server/scripts/Pandaria/zone_the_wandering_isle.cpp
+++ b/src/server/scripts/Pandaria/zone_the_wandering_isle.cpp
@@ -24,11 +24,13 @@
#include "GridNotifiersImpl.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
+#include "PhasingHandler.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "TaskScheduler.h"
+#include "TemporarySummon.h"
enum TraineeMisc
{
@@ -620,6 +622,218 @@ class spell_ride_drake : public AuraScript
}
};
+// Quest 29419 - The Missing Driver
+enum TheMissingDriverMisc
+{
+ // Spells
+ SPELL_SERVERSIDE_DRIVER_CREDIT = 106231,
+ SPELL_FORCE_SUMMON_CART_DRIVER = 106206,
+ SPELL_SUMMON_CART_DRIVER = 106205,
+
+ // Texts
+ SAY_MIN_DIMWIND_TEXT_0 = 0,
+ SAY_MIN_DIMWIND_TEXT_1 = 1,
+ SAY_MIN_DIMWIND_TEXT_2 = 2,
+ SAY_MIN_DIMWIND_TEXT_3 = 3,
+
+ SAY_AMBERLEAF_SCAMP_0 = 0,
+ SAY_AMBERLEAF_SCAMP_1 = 1,
+
+ // Waypoint
+ PATH_MOVE_RUN = 5650300,
+ PATH_MOVE_WALK = 5650301,
+
+ WAYPOINT_TALK_0 = 0,
+ WAYPOINT_TALK_1 = 3,
+ WAYPOINT_MOVE_WALK = 11,
+
+ WAYPOINT_DESPAWN = 3,
+
+ POINT_MOVE_RANDOM = 0,
+
+ // Quests
+ QUEST_THE_MISSING_DRIVER = 29419
+};
+
+constexpr Position amberleafPos[5] =
+{
+ { 1410.2014f, 3598.6494f, 89.59319f },
+ { 1456.201f, 3568.265f, 88.39075f },
+ { 1383.158f, 3595.447f, 90.3155f },
+ { 1367.333f, 3594.927f, 88.89806f },
+ { 1350.278f, 3588.938f, 89.17908f }
+};
+
+// 6958 - Areatrigger
+class at_min_dimwind_captured : public AreaTriggerScript
+{
+ public:
+ at_min_dimwind_captured() : AreaTriggerScript("at_min_dimwind_captured") { }
+
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
+ {
+ if (!player->isDead() && player->GetQuestStatus(QUEST_THE_MISSING_DRIVER) == QUEST_STATUS_INCOMPLETE)
+ {
+ Creature* minDimwind = player->FindNearestCreatureWithOptions(20.0f, { .StringId = "npc_min_dimwind" });
+
+ if (!minDimwind)
+ return false;
+
+ minDimwind->CastSpell(player, SPELL_FORCE_SUMMON_CART_DRIVER, TRIGGERED_FULL_MASK);
+ player->CastSpell(player, SPELL_SERVERSIDE_DRIVER_CREDIT, TRIGGERED_FULL_MASK);
+ PhasingHandler::OnConditionChange(player); // phase 630 is added when kill credit but immediately is removed to be added again when Min Dimwind reaches final waypoint
+ }
+
+ return false;
+ }
+};
+
+// 56503 - Min Dimwind (Summon)
+struct npc_min_dimwind_summon : public ScriptedAI
+{
+ using ScriptedAI::ScriptedAI;
+
+ void IsSummonedBy(WorldObject* summoner) override
+ {
+ if (!summoner->IsPlayer())
+ return;
+
+ Creature* amberleafScamp1 = me->FindNearestCreatureWithOptions(20.0f, { .StringId = "npc_amberleaf_scamp_1" });
+ Creature* amberleafScamp2 = me->FindNearestCreatureWithOptions(20.0f, { .StringId = "npc_amberleaf_scamp_2" });
+ Creature* amberleafScamp3 = me->FindNearestCreatureWithOptions(20.0f, { .StringId = "npc_amberleaf_scamp_3" });
+ Creature* amberleafScamp5 = me->FindNearestCreatureWithOptions(20.0f, { .StringId = "npc_amberleaf_scamp_5" });
+
+ if (!amberleafScamp1 || !amberleafScamp2 || !amberleafScamp3 || !amberleafScamp5)
+ return;
+
+ amberleafScamp1->AI()->Talk(SAY_AMBERLEAF_SCAMP_0);
+ amberleafScamp1->GetMotionMaster()->MovePoint(0, amberleafPos[0]);
+
+ amberleafScamp2->GetMotionMaster()->MovePoint(0, amberleafPos[1]);
+
+ amberleafScamp3->GetMotionMaster()->MovePoint(0, amberleafPos[2]);
+
+ amberleafScamp5->GetMotionMaster()->MovePoint(0, amberleafPos[4]);
+
+ _scheduler.Schedule(2s, [this](TaskContext /*task*/)
+ {
+ Creature* amberleafScamp4 = me->FindNearestCreatureWithOptions(20.0f, { .StringId = "npc_amberleaf_scamp_4" });
+
+ if (!amberleafScamp4)
+ return;
+
+ amberleafScamp4->AI()->Talk(SAY_AMBERLEAF_SCAMP_1);
+ amberleafScamp4->GetMotionMaster()->MovePoint(0, amberleafPos[3]);
+ });
+
+ _scheduler.Schedule(5s, [this](TaskContext task)
+ {
+ Unit* summoner = me->ToTempSummon()->GetSummonerUnit();
+
+ if (!summoner)
+ return;
+
+ me->SetFacingToObject(summoner);
+ Talk(SAY_MIN_DIMWIND_TEXT_0, summoner);
+
+ task.Schedule(4s, [this](TaskContext task)
+ {
+ Talk(SAY_MIN_DIMWIND_TEXT_1);
+
+ task.Schedule(4s, [this](TaskContext /*task*/)
+ {
+ me->GetMotionMaster()->MovePath(PATH_MOVE_RUN, false);
+ });
+ });
+ });
+ }
+
+ void WaypointReached(uint32 waypointId, uint32 pathId) override
+ {
+ if (pathId == PATH_MOVE_RUN)
+ {
+ switch (waypointId)
+ {
+ case WAYPOINT_TALK_0:
+ case WAYPOINT_TALK_1:
+ {
+ Talk(SAY_MIN_DIMWIND_TEXT_2);
+ break;
+ }
+ case WAYPOINT_MOVE_WALK:
+ {
+ Talk(SAY_MIN_DIMWIND_TEXT_3);
+ me->GetMotionMaster()->MovePath(PATH_MOVE_WALK, false);
+ break;
+ }
+ }
+ }
+ else if (pathId == PATH_MOVE_WALK)
+ {
+ if (waypointId == WAYPOINT_DESPAWN)
+ {
+ me->SetFacingTo(0.575958f);
+ me->DespawnOrUnsummon(2s);
+
+ _scheduler.Schedule(1s, [this](TaskContext /*task*/)
+ {
+ if (me->IsSummon())
+ {
+ Unit* summoner = me->ToTempSummon()->GetSummonerUnit();
+
+ if (!summoner)
+ return;
+
+ summoner->RemoveAurasDueToSpell(SPELL_SUMMON_CART_DRIVER);
+ PhasingHandler::OnConditionChange(summoner);
+ }
+ });
+ }
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+ }
+
+private:
+ TaskScheduler _scheduler;
+};
+
+// 54130 - Amberleaf Scamp
+struct npc_amberleaf_scamp : public ScriptedAI
+{
+ using ScriptedAI::ScriptedAI;
+
+ void MovementInform(uint32 type, uint32 id) override
+ {
+ if (type == POINT_MOTION_TYPE && id == POINT_MOVE_RANDOM && !me->IsInCombat())
+ {
+ me->GetMotionMaster()->MoveRandom(10.0f);
+
+ _scheduler.Schedule(10s, [this](TaskContext /*task*/)
+ {
+ if (!me->IsInCombat())
+ me->GetMotionMaster()->MoveTargetedHome();
+ });
+ }
+ }
+
+ void JustReachedHome() override
+ {
+ me->GetMotionMaster()->InitializeDefault();
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+ }
+
+private:
+ TaskScheduler _scheduler;
+};
+
void AddSC_zone_the_wandering_isle()
{
RegisterCreatureAI(npc_tushui_huojin_trainee);
@@ -629,6 +843,11 @@ void AddSC_zone_the_wandering_isle()
RegisterGameObjectAI(go_edict_of_temperance);
RegisterCreatureAI(npc_jaomin_ro);
RegisterCreatureAI(npc_jaomin_ro_hawk);
+ RegisterCreatureAI(npc_min_dimwind_summon);
+ RegisterCreatureAI(npc_amberleaf_scamp);
+
RegisterSpellScript(spell_force_summoner_to_ride_vehicle);
RegisterSpellScript(spell_ride_drake);
+
+ new at_min_dimwind_captured();
}