aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2025-05-28 14:55:11 +0300
committerGitHub <noreply@github.com>2025-05-28 13:55:11 +0200
commit8c5863596e428916aa5b9d2c5fa4c31ef67317e7 (patch)
tree094eca796008dcd419512f8438b453ad18156a7c
parent88197ab4c6a874111c20137263c44cd66d52e248 (diff)
Scripts/Dalaran: Replace TeleportTo function with spells (#30965)
-rw-r--r--sql/updates/world/3.3.5/2025_05_28_00_world.sql4
-rw-r--r--src/server/scripts/Northrend/zone_dalaran.cpp28
2 files changed, 26 insertions, 6 deletions
diff --git a/sql/updates/world/3.3.5/2025_05_28_00_world.sql b/sql/updates/world/3.3.5/2025_05_28_00_world.sql
new file mode 100644
index 00000000000..d9def17a7e8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2025_05_28_00_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `spell_target_position` WHERE `ID` = 58681;
+INSERT INTO `spell_target_position` (`ID`,`EffectIndex`,`MapID`,`PositionX`,`PositionY`,`PositionZ`,`Orientation`,`VerifiedBuild`) VALUES
+(58681,0,571,5386.05,2840.97,418.675,3.14159,0);
diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp
index 0634794a35e..81478800661 100644
--- a/src/server/scripts/Northrend/zone_dalaran.cpp
+++ b/src/server/scripts/Northrend/zone_dalaran.cpp
@@ -256,16 +256,24 @@ private:
EventMap events;
};
+enum TeleportToDalaran
+{
+ SPELL_TELEPORT_TO_DALARAN = 53360
+};
+
// 54620 - Teleport Crystal: Teleport to Dalaran AICast Script
class spell_dalaran_teleport_to_dalaran : public SpellScript
{
PrepareSpellScript(spell_dalaran_teleport_to_dalaran);
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_TELEPORT_TO_DALARAN });
+ }
+
void HandleScript(SpellEffIndex /*effIndex*/)
{
- /// @todo: replace this with spell
- if (Player* target = GetHitUnit()->ToPlayer())
- target->TeleportTo(571, 5807.75f, 588.063f, 660.939f, 1.64659f);
+ GetHitUnit()->CastSpell(GetHitUnit(), SPELL_TELEPORT_TO_DALARAN);
}
void Register() override
@@ -274,16 +282,24 @@ class spell_dalaran_teleport_to_dalaran : public SpellScript
}
};
+enum TeleportToLakeWintergrasp
+{
+ SPELL_TELEPORT_TO_LAKE_WINTERGRASP = 58681
+};
+
// 58622 - Teleport to Lake Wintergrasp
class spell_dalaran_teleport_to_lake_wintergrasp : public SpellScript
{
PrepareSpellScript(spell_dalaran_teleport_to_lake_wintergrasp);
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_TELEPORT_TO_LAKE_WINTERGRASP });
+ }
+
void HandleScript(SpellEffIndex /*effIndex*/)
{
- /// @todo: replace this with spell
- if (Player* target = GetHitUnit()->ToPlayer())
- target->TeleportTo(571, 5386.05f, 2840.97f, 418.675f, 3.14159f);
+ GetHitUnit()->CastSpell(GetHitUnit(), SPELL_TELEPORT_TO_LAKE_WINTERGRASP);
}
void Register() override