Skip to content

Commit 8c58635

Browse files
authored
Scripts/Dalaran: Replace TeleportTo function with spells (#30965)
1 parent 88197ab commit 8c58635

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--
2+
DELETE FROM `spell_target_position` WHERE `ID` = 58681;
3+
INSERT INTO `spell_target_position` (`ID`,`EffectIndex`,`MapID`,`PositionX`,`PositionY`,`PositionZ`,`Orientation`,`VerifiedBuild`) VALUES
4+
(58681,0,571,5386.05,2840.97,418.675,3.14159,0);

src/server/scripts/Northrend/zone_dalaran.cpp

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,24 @@ struct npc_minigob_manabonk : public ScriptedAI
256256
EventMap events;
257257
};
258258

259+
enum TeleportToDalaran
260+
{
261+
SPELL_TELEPORT_TO_DALARAN = 53360
262+
};
263+
259264
// 54620 - Teleport Crystal: Teleport to Dalaran AICast Script
260265
class spell_dalaran_teleport_to_dalaran : public SpellScript
261266
{
262267
PrepareSpellScript(spell_dalaran_teleport_to_dalaran);
263268

269+
bool Validate(SpellInfo const* /*spellInfo*/) override
270+
{
271+
return ValidateSpellInfo({ SPELL_TELEPORT_TO_DALARAN });
272+
}
273+
264274
void HandleScript(SpellEffIndex /*effIndex*/)
265275
{
266-
/// @todo: replace this with spell
267-
if (Player* target = GetHitUnit()->ToPlayer())
268-
target->TeleportTo(571, 5807.75f, 588.063f, 660.939f, 1.64659f);
276+
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_TELEPORT_TO_DALARAN);
269277
}
270278

271279
void Register() override
@@ -274,16 +282,24 @@ class spell_dalaran_teleport_to_dalaran : public SpellScript
274282
}
275283
};
276284

285+
enum TeleportToLakeWintergrasp
286+
{
287+
SPELL_TELEPORT_TO_LAKE_WINTERGRASP = 58681
288+
};
289+
277290
// 58622 - Teleport to Lake Wintergrasp
278291
class spell_dalaran_teleport_to_lake_wintergrasp : public SpellScript
279292
{
280293
PrepareSpellScript(spell_dalaran_teleport_to_lake_wintergrasp);
281294

295+
bool Validate(SpellInfo const* /*spellInfo*/) override
296+
{
297+
return ValidateSpellInfo({ SPELL_TELEPORT_TO_LAKE_WINTERGRASP });
298+
}
299+
282300
void HandleScript(SpellEffIndex /*effIndex*/)
283301
{
284-
/// @todo: replace this with spell
285-
if (Player* target = GetHitUnit()->ToPlayer())
286-
target->TeleportTo(571, 5386.05f, 2840.97f, 418.675f, 3.14159f);
302+
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_TELEPORT_TO_LAKE_WINTERGRASP);
287303
}
288304

289305
void Register() override

0 commit comments

Comments
 (0)