aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeji <alvaro.megias@outlook.com>2025-08-31 16:48:41 +0200
committerGitHub <noreply@github.com>2025-08-31 16:48:41 +0200
commit2a872d2cc23a91178167c92c54fb84adfa1a379c (patch)
tree27e2e506d8b6bf953617c6265633fbd487b7684c
parent920d5d89d92e005de3802938bbaca7e673dd3425 (diff)
Scripts/TheJadeForest: Implement quest "Touching Ground" (31766) (#31122)
-rw-r--r--sql/updates/world/master/2025_08_31_07_world.sql63
-rw-r--r--src/server/game/Spells/SpellMgr.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp6
-rw-r--r--src/server/scripts/Kalimdor/zone_durotar.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_orgrimmar.cpp2
-rw-r--r--src/server/scripts/Pandaria/zone_the_jade_forest.cpp149
6 files changed, 218 insertions, 10 deletions
diff --git a/sql/updates/world/master/2025_08_31_07_world.sql b/sql/updates/world/master/2025_08_31_07_world.sql
new file mode 100644
index 00000000000..11b694bf7ad
--- /dev/null
+++ b/sql/updates/world/master/2025_08_31_07_world.sql
@@ -0,0 +1,63 @@
+-- Creature templates
+UPDATE `creature_template` SET `BaseAttackTime`=2000, `unit_flags`=0x2000200, `unit_flags2`=0x4000800, `unit_flags3`=0x1000000, `VehicleId`=2479, `flags_extra`=`flags_extra`|128 WHERE `entry`=66640; -- Rappelling Rope
+UPDATE `creature_template` SET `AIName`='', `ScriptName`='npc_rappelling_rope' WHERE `entry`=66640;
+
+DELETE FROM `creature_template_addon` WHERE `entry`=66640;
+INSERT INTO `creature_template_addon` (`entry`, `PathId`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
+(66640, 0, 0, 0, 3, 0, 1, 0, 0, 2353, 0, 0, 0, ''); -- 66640 (Rappelling Rope)
+
+-- Vehicle data
+DELETE FROM `vehicle_template` WHERE `creatureId`=66640;
+INSERT INTO `vehicle_template` (`creatureId`, `despawnDelayMs`, `Pitch`, `CustomFlags`) VALUES
+(66640, 0, NULL, 0x1);
+
+-- Difficulties
+UPDATE `creature_template_difficulty` SET `ContentTuningID`=57, `StaticFlags1`=0x20000000, `VerifiedBuild`=61265 WHERE (`Entry`=66640 AND `DifficultyID`=0); -- 66640 (Rappelling Rope) - Floating
+DELETE FROM `creature_template_difficulty` WHERE `Entry` IN (66640) AND `DifficultyID`!=0;
+
+-- Quests
+DELETE FROM `quest_template_addon` WHERE `ID`=31766;
+INSERT INTO `quest_template_addon` (`ID`, `MaxLevel`, `AllowableClasses`, `SourceSpellID`, `PrevQuestID`, `NextQuestID`, `ExclusiveGroup`, `BreadcrumbForQuestId`, `RewardMailTemplateID`, `RewardMailDelay`, `RequiredSkillID`, `RequiredSkillPoints`, `RequiredMinRepFaction`, `RequiredMaxRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepValue`, `ProvidedItemCount`, `SpecialFlags`, `ScriptName`) VALUES
+(31766, 0, 0, 0, 31765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
+
+UPDATE `quest_poi` SET `VerifiedBuild`=61265 WHERE (`QuestID`=31766 AND `BlobIndex`=0 AND `Idx1`=2) OR (`QuestID`=31766 AND `BlobIndex`=0 AND `Idx1`=1) OR (`QuestID`=31766 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=83492 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=32009 AND `BlobIndex`=0 AND `Idx1`=1) OR (`QuestID`=32009 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=32008 AND `BlobIndex`=0 AND `Idx1`=1) OR (`QuestID`=32008 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=75874 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=65656 AND `BlobIndex`=1 AND `Idx1`=5) OR (`QuestID`=65656 AND `BlobIndex`=0 AND `Idx1`=4) OR (`QuestID`=65656 AND `BlobIndex`=1 AND `Idx1`=3) OR (`QuestID`=65656 AND `BlobIndex`=0 AND `Idx1`=2) OR (`QuestID`=65656 AND `BlobIndex`=1 AND `Idx1`=1) OR (`QuestID`=65656 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=53435 AND `BlobIndex`=0 AND `Idx1`=1) OR (`QuestID`=53435 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=50604 AND `BlobIndex`=0 AND `Idx1`=1) OR (`QuestID`=50604 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=50603 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=50562 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=49930 AND `BlobIndex`=0 AND `Idx1`=1) OR (`QuestID`=49930 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=27442 AND `BlobIndex`=0 AND `Idx1`=1) OR (`QuestID`=27442 AND `BlobIndex`=0 AND `Idx1`=0) OR (`QuestID`=13124 AND `BlobIndex`=0 AND `Idx1`=0);
+UPDATE `quest_poi_points` SET `VerifiedBuild`=61265 WHERE (`QuestID`=31766 AND `Idx1`=2 AND `Idx2`=0) OR (`QuestID`=31766 AND `Idx1`=1 AND `Idx2`=0) OR (`QuestID`=31766 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=83492 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=32009 AND `Idx1`=1 AND `Idx2`=0) OR (`QuestID`=32009 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=32008 AND `Idx1`=1 AND `Idx2`=0) OR (`QuestID`=32008 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=75874 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=65656 AND `Idx1`=5 AND `Idx2`=0) OR (`QuestID`=65656 AND `Idx1`=4 AND `Idx2`=0) OR (`QuestID`=65656 AND `Idx1`=3 AND `Idx2`=0) OR (`QuestID`=65656 AND `Idx1`=2 AND `Idx2`=0) OR (`QuestID`=65656 AND `Idx1`=1 AND `Idx2`=0) OR (`QuestID`=65656 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=53435 AND `Idx1`=1 AND `Idx2`=0) OR (`QuestID`=53435 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=50604 AND `Idx1`=1 AND `Idx2`=0) OR (`QuestID`=50604 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=50603 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=50562 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=49930 AND `Idx1`=1 AND `Idx2`=0) OR (`QuestID`=49930 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=27442 AND `Idx1`=1 AND `Idx2`=0) OR (`QuestID`=27442 AND `Idx1`=0 AND `Idx2`=0) OR (`QuestID`=13124 AND `Idx1`=0 AND `Idx2`=0);
+
+DELETE FROM `quest_details` WHERE `ID`=31766;
+INSERT INTO `quest_details` (`ID`, `Emote1`, `Emote2`, `Emote3`, `Emote4`, `EmoteDelay1`, `EmoteDelay2`, `EmoteDelay3`, `EmoteDelay4`, `VerifiedBuild`) VALUES
+(31766, 1, 0, 0, 0, 0, 0, 0, 0, 61265); -- Touching Ground
+
+DELETE FROM `quest_request_items` WHERE `ID`=31766;
+INSERT INTO `quest_request_items` (`ID`, `EmoteOnComplete`, `EmoteOnIncomplete`, `EmoteOnCompleteDelay`, `EmoteOnIncompleteDelay`, `CompletionText`, `VerifiedBuild`) VALUES
+(31766, 0, 0, 0, 0, 'What?', 61265); -- Touching Ground
+
+DELETE FROM `quest_offer_reward` WHERE `ID`=31766;
+INSERT INTO `quest_offer_reward` (`ID`, `Emote1`, `Emote2`, `Emote3`, `Emote4`, `EmoteDelay1`, `EmoteDelay2`, `EmoteDelay3`, `EmoteDelay4`, `RewardText`, `VerifiedBuild`) VALUES
+(31766, 1, 0, 0, 0, 0, 0, 0, 0, 'There you are!$b$bI was starting to worry we''d have to charge in and have all the fun without you.', 61265); -- Touching Ground
+
+UPDATE `creature_queststarter` SET `VerifiedBuild`=61265 WHERE (`id`=66667 AND `quest`=31766);
+
+UPDATE `creature_questender` SET `VerifiedBuild`=61265 WHERE (`id`=66190 AND `quest`=31766);
+
+-- Spells
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=130970;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 130970, 0, 0, 31, 0, 3, 40789, 0, 0, 0, 0, '', 'Spell "Rappelling Rope Aura" targets Generic Controller Bunny (CSA)');
+
+DELETE FROM `serverside_spell` WHERE `Id`=130999;
+INSERT INTO `serverside_spell` (`Id`, `DifficultyID`, `CategoryId`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `AttributesEx8`, `AttributesEx9`, `AttributesEx10`, `AttributesEx11`, `AttributesEx12`, `AttributesEx13`, `AttributesEx14`, `AttributesEx15`, `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
+(130999,0,0,0,0,0x29800100,0x10000020,0x4005,0x10100000,0x80,0x60008,0x21600,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,13,0,0,0,-1,0,0,0,'Rappelling Rope Credit',0,0,0,0,0,0,0,0,0,0,0,0,1,0);
+
+DELETE FROM `serverside_spell_effect` WHERE `SpellID`=130999;
+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
+(130999,0,0,134,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66646,0,0,0,0,0,0,0,1,0);
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_rappelling_rope', 'spell_rappelling_rope_aura');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(130960, 'spell_rappelling_rope'),
+(130970, 'spell_rappelling_rope_aura');
+
+-- Misc
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=34 AND `SourceEntry`=18902;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(34, 0, 18902, 0, 0, 47, 0, 31766, 2 | 8, 0, '', 0, 0, 0, '', 'Satisfy player condition if quest 31766 is taken | completed');
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 584daa8e372..6eebe71de45 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -5066,6 +5066,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AttributesEx4 &= ~SPELL_ATTR4_USE_FACING_FROM_SPELL;
});
+ // Rappelling Rope
+ ApplySpellFix({ 130960 }, [](SpellInfo* spellInfo)
+ {
+ spellInfo->AuraInterruptFlags |= SpellAuraInterruptFlags::LeaveWorld;
+ });
+
// ENDOF JADE FOREST SPELLS
//
diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
index 3f42b134149..1f7c3341da0 100644
--- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
@@ -549,7 +549,7 @@ class spell_the_kings_command_movie_aura : public SpellScript
{
GetHitUnit()->CastSpell(nullptr, Spells::FadeToBlack, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .OriginalCastId = GetSpell()->m_castId
+ .TriggeringSpell = GetSpell()
});
}
@@ -596,7 +596,7 @@ class spell_admiral_rogers_script_effect : public SpellScript
{
GetHitUnit()->CastSpell(nullptr, Spells::TeleportPrep, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .OriginalCastId = GetSpell()->m_castId
+ .TriggeringSpell = GetSpell()
});
}
@@ -623,7 +623,7 @@ class spell_teleport_prep_alliance : public SpellScript
hitUnit->CancelMountAura();
hitUnit->CastSpell(nullptr, Spells::TeleportTimer, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .OriginalCastId = GetSpell()->m_castId
+ .TriggeringSpell = GetSpell()
});
}
diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp
index 9e979057641..4ffbdc2e515 100644
--- a/src/server/scripts/Kalimdor/zone_durotar.cpp
+++ b/src/server/scripts/Kalimdor/zone_durotar.cpp
@@ -1263,7 +1263,7 @@ class spell_teleport_prep_horde : public SpellScript
hitUnit->CancelMountAura();
hitUnit->CastSpell(nullptr, Spells::TeleportTimer, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .OriginalCastId = GetSpell()->m_castId
+ .TriggeringSpell = GetSpell()
});
}
diff --git a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
index 34667e18522..19a90dc03b4 100644
--- a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
+++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
@@ -45,7 +45,7 @@ class spell_art_of_war_movie_aura : public SpellScript
{
GetHitUnit()->CastSpell(nullptr, Spells::FadeToBlack, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .OriginalCastId = GetSpell()->m_castId
+ .TriggeringSpell = GetSpell()
});
}
diff --git a/src/server/scripts/Pandaria/zone_the_jade_forest.cpp b/src/server/scripts/Pandaria/zone_the_jade_forest.cpp
index 4c3ff748c8c..886aba759a8 100644
--- a/src/server/scripts/Pandaria/zone_the_jade_forest.cpp
+++ b/src/server/scripts/Pandaria/zone_the_jade_forest.cpp
@@ -15,16 +15,44 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptMgr.h"
+#include "DB2Stores.h"
+#include "Map.h"
+#include "MotionMaster.h"
#include "PhasingHandler.h"
#include "Player.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
+#include "TemporarySummon.h"
#include "Unit.h"
+#include "Vehicle.h"
namespace Scripts::Pandaria::TheJadeForest
{
+namespace Points
+{
+ static constexpr uint32 RappellingRopeDestination = 1;
+}
+
+namespace Positions
+{
+ static constexpr std::array<Position, 3> RappellingRopeSpawns =
+ {{
+ { 3133.9192f, -750.8542f, 298.9847f },
+ { 3156.4932f, -742.7101f, 297.54916f },
+ { 3169.0479f, -737.92017f, 298.42493f }
+ }};
+
+ static constexpr std::array<Position, 3> RappellingRopeDestinations =
+ {{
+ { 3133.9475f, -749.46844f, 240.00467f },
+ { 3156.2786f, -742.8666f, 239.32095f },
+ { 3168.5525f, -738.01764f, 240.19081f }
+ }};
+}
+
namespace Quests
{
static constexpr uint32 PaintItRed = 31765;
@@ -50,6 +78,10 @@ namespace Spells
static constexpr uint32 AbandonVehicle = 92678;
static constexpr uint32 CannonExplosionTrigger = 130234;
static constexpr uint32 BarrelExplosionTrigger = 130247;
+
+ // Touching Ground
+ static constexpr uint32 ReverseCastRideSeat1 = 85299;
+ static constexpr uint32 RappellingRope = 130960;
}
// 121545 - Into the Mists Scene - JF
@@ -69,7 +101,7 @@ class spell_into_the_mists_scene_jf : public SpellScript
hitUnit->CancelMountAura();
hitUnit->CastSpell(nullptr, Spells::CancelBlackout, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .OriginalCastId = GetSpell()->m_castId
+ .TriggeringSpell = GetSpell()
});
}
@@ -97,7 +129,7 @@ class spell_into_the_mists_scene_end : public SpellScript
CastSpellExtraArgs const& castSpellExtraArgs = CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .OriginalCastId = GetSpell()->m_castId
+ .TriggeringSpell = GetSpell()
};
hitUnit->CastSpell(nullptr, Spells::TeleportPlayerToCrashSite, castSpellExtraArgs);
hitUnit->CastSpell(nullptr, Spells::CutToBlack, castSpellExtraArgs);
@@ -127,7 +159,7 @@ class spell_the_mission_scene_jf : public SpellScript
hitUnit->CancelMountAura();
hitUnit->CastSpell(nullptr, Spells::CancelBlackout, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .OriginalCastId = GetSpell()->m_castId
+ .TriggeringSpell = GetSpell()
});
}
@@ -158,7 +190,7 @@ class spell_the_mission_scene_end : public SpellScript
CastSpellExtraArgs const& castSpellExtraArgs = CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .OriginalCastId = GetSpell()->m_castId
+ .TriggeringSpell = GetSpell()
};
hitUnit->CastSpell(nullptr, Spells::TheMissionTeleportPlayer, castSpellExtraArgs);
hitUnit->CastSpell(nullptr, Spells::CutToBlack, castSpellExtraArgs);
@@ -271,12 +303,117 @@ class spell_barrel_explosion_reversecast : public SpellScript
OnEffectHitTarget += SpellEffectFn(spell_barrel_explosion_reversecast::HandleHitTarget, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
+
+// 66640 - Rappelling Rope
+struct npc_rappelling_rope : public ScriptedAI
+{
+ npc_rappelling_rope(Creature* creature) : ScriptedAI(creature) {}
+
+ void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) override
+ {
+ if (apply)
+ {
+ passenger->SetDisableGravity(true);
+ _scheduler.Schedule(1500ms, [this](TaskContext /*context*/)
+ {
+ auto closestPosition = std::ranges::min_element(Positions::RappellingRopeDestinations, std::ranges::less(),
+ [this](Position const& pos) { return me->GetDistance(pos); });
+
+ me->GetMotionMaster()->MovePoint(Points::RappellingRopeDestination, *closestPosition);
+ });
+ }
+ else
+ passenger->SetDisableGravity(false);
+ }
+
+ void MovementInform(uint32 type, uint32 id) override
+ {
+ if (type == POINT_MOTION_TYPE && id == Points::RappellingRopeDestination)
+ {
+ if (Vehicle* vehicle = me->GetVehicleKit())
+ vehicle->RemoveAllPassengers();
+
+ me->DespawnOrUnsummon(1s);
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+ }
+
+private:
+ TaskScheduler _scheduler;
+};
+
+// 130960 - Rappelling Rope
+class spell_rappelling_rope : public SpellScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ Spells::ReverseCastRideSeat1
+ });
+ }
+
+ void HandleHitTarget(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+
+ Unit* caster = GetCaster();
+ uint32 creatureId = uint32(GetEffectInfo().MiscValue);
+ SummonPropertiesEntry const* summonProperties = sSummonPropertiesStore.LookupEntry(uint32(GetEffectInfo().MiscValueB));
+ Milliseconds duration = Milliseconds(GetSpellInfo()->CalcDuration(caster));
+ auto closestPosition = std::ranges::min_element(Positions::RappellingRopeSpawns, std::ranges::less(),
+ [caster](Position const& pos) { return caster->GetDistance(pos); });
+
+ if (Creature* rappellingRope = caster->GetMap()->SummonCreature(creatureId, *closestPosition, summonProperties, duration, caster, GetSpellInfo()->Id))
+ {
+ if (TempSummon* summon = rappellingRope->ToTempSummon())
+ summon->SetCanFollowOwner(false);
+
+ rappellingRope->CastSpell(caster, Spells::ReverseCastRideSeat1, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .TriggeringSpell = GetSpell()
+ });
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHit += SpellEffectFn(spell_rappelling_rope::HandleHitTarget, EFFECT_0, SPELL_EFFECT_SUMMON);
+ }
+};
+
+// 130970 - Rappelling Rope Aura
+class spell_rappelling_rope_aura : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ Spells::RappellingRope
+ });
+ }
+
+ void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
+ {
+ GetTarget()->RemoveAurasDueToSpell(Spells::RappellingRope);
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_rappelling_rope_aura::HandleAfterEffectRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
}
void AddSC_zone_the_jade_forest()
{
using namespace Scripts::Pandaria::TheJadeForest;
+ // Creatures
+ RegisterCreatureAI(npc_rappelling_rope);
+
// Spells
RegisterSpellScript(spell_into_the_mists_scene_jf);
RegisterSpellScript(spell_into_the_mists_scene_end);
@@ -286,4 +423,6 @@ void AddSC_zone_the_jade_forest()
RegisterSpellScript(spell_summon_gunship_turret);
RegisterSpellScript(spell_cannon_explosion_reversecast);
RegisterSpellScript(spell_barrel_explosion_reversecast);
+ RegisterSpellScript(spell_rappelling_rope);
+ RegisterSpellScript(spell_rappelling_rope_aura);
}