aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Kalimdor
diff options
context:
space:
mode:
authorMeji <alvaro.megias@outlook.com>2024-11-27 22:34:34 +0100
committerGitHub <noreply@github.com>2024-11-27 22:34:34 +0100
commit65265f394d0aca57419133ca217d6a6a60b62263 (patch)
tree712322a50e10fc3c4330ecef8aa4b2510cbbcd92 /src/server/scripts/Kalimdor
parentd5b5030a0c622406982e96d3f9bafb8f4bf697ce (diff)
Scripts/TheJadeForest: Implement quest "Into the Mists" (29690) (#30443)
Diffstat (limited to 'src/server/scripts/Kalimdor')
-rw-r--r--src/server/scripts/Kalimdor/zone_durotar.cpp63
-rw-r--r--src/server/scripts/Kalimdor/zone_orgrimmar.cpp46
2 files changed, 88 insertions, 21 deletions
diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp
index 181151a15a7..9e69f784319 100644
--- a/src/server/scripts/Kalimdor/zone_durotar.cpp
+++ b/src/server/scripts/Kalimdor/zone_durotar.cpp
@@ -21,6 +21,8 @@
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "Spell.h"
+#include "SpellAuraEffects.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "ScriptedGossip.h"
@@ -31,7 +33,9 @@ namespace Durotar
{
namespace Spells
{
- static constexpr uint32 PhasePlayer = 130750;
+ static constexpr uint32 PhasePlayer = 130750;
+ static constexpr uint32 TeleportTimer = 132034;
+ static constexpr uint32 TeleportPlayerToCrashSite = 102930;
}
}
@@ -1240,6 +1244,57 @@ public:
}
};
+// 130810 - Teleport Prep
+class spell_teleport_prep : public SpellScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ Durotar::Spells::TeleportTimer
+ });
+ }
+
+ void HandleHitTarget(SpellEffIndex /*effIndex*/) const
+ {
+ Unit* hitUnit = GetHitUnit();
+
+ hitUnit->CastSpell(hitUnit, Durotar::Spells::TeleportTimer, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .OriginalCastId = GetSpell()->m_castId
+ });
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_teleport_prep::HandleHitTarget, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
+ }
+};
+
+// 132034 - Teleport Timer
+class spell_teleport_timer : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ Durotar::Spells::TeleportPlayerToCrashSite
+ });
+ }
+
+ void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
+ {
+ Unit* target = GetTarget();
+
+ target->CastSpell(target, Durotar::Spells::TeleportPlayerToCrashSite, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
+ });
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_teleport_timer::HandleAfterEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
void AddSC_durotar()
{
new npc_lazy_peon();
@@ -1281,6 +1336,10 @@ void AddSC_durotar()
RegisterCreatureAI(npc_voljin_garrosh_vision);
RegisterCreatureAI(npc_voljin_thrall_vision);
- // Hellscream's Fist
+ // AreaTriggers
new at_hellscreams_fist_gunship();
+
+ // Spells
+ RegisterSpellScript(spell_teleport_prep);
+ RegisterSpellScript(spell_teleport_timer);
}
diff --git a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
index 31ddbac6e11..83c2e6711b6 100644
--- a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
+++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
@@ -17,9 +17,8 @@
#include "Define.h"
#include "ScriptMgr.h"
-#include "SpellAuraDefines.h"
+#include "Spell.h"
#include "SpellAuraEffects.h"
-#include "SpellDefines.h"
#include "SpellScript.h"
#include "Unit.h"
@@ -33,48 +32,57 @@ namespace Orgrimmar
}
// 130412 - Art of War Movie Aura
-class spell_art_of_war_movie_aura : public AuraScript
+class spell_art_of_war_movie_aura : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({
- Orgrimmar::Spells::MOPHordeIntroMoviePlay,
Orgrimmar::Spells::FadeToBlack
});
}
- void HandleAfterEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
+ void HandleHitTarget(SpellEffIndex /*effIndex*/) const
{
- Unit* caster = GetCaster();
- if (!caster)
- return;
+ Unit* hitUnit = GetHitUnit();
- caster->CastSpell(GetTarget(), Orgrimmar::Spells::FadeToBlack, CastSpellExtraArgsInit{
+ hitUnit->CastSpell(hitUnit, Orgrimmar::Spells::FadeToBlack, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
- .TriggeringAura = aurEff
+ .OriginalCastId = GetSpell()->m_castId
});
}
- void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_art_of_war_movie_aura::HandleHitTarget, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
+ }
+};
+
+class spell_art_of_war_movie_aura_aura : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({
+ Orgrimmar::Spells::MOPHordeIntroMoviePlay
+ });
+ }
+
+ void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
{
- Unit* caster = GetCaster();
- if (!caster)
- return;
+ Unit* target = GetTarget();
- caster->CastSpell(GetTarget(), Orgrimmar::Spells::MOPHordeIntroMoviePlay, CastSpellExtraArgsInit{
+ target->CastSpell(target, Orgrimmar::Spells::MOPHordeIntroMoviePlay, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
});
}
void Register() override
{
- AfterEffectApply += AuraEffectApplyFn(spell_art_of_war_movie_aura::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
- AfterEffectRemove += AuraEffectRemoveFn(spell_art_of_war_movie_aura::HandleAfterEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_art_of_war_movie_aura_aura::HandleAfterEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
void AddSC_orgrimmar()
{
- // Grommash Hold
- RegisterSpellScript(spell_art_of_war_movie_aura);
+ // Spells
+ RegisterSpellAndAuraScriptPair(spell_art_of_war_movie_aura, spell_art_of_war_movie_aura_aura);
}