aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-09-04 15:13:15 +0200
committerShauren <shauren.trinity@gmail.com>2021-09-04 15:13:15 +0200
commit8a4e1119ac21e2d1112d1717337597fe073e495f (patch)
tree34f3215bec2096b59e3d9b2353661e1c137ff8b4 /src/server/scripts/EasternKingdoms
parent16ed458eeeebe436f05c43686928252992ae2a20 (diff)
Core/Spells: Unify spell effect access api in both branches
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp26
-rw-r--r--src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp4
5 files changed, 20 insertions, 20 deletions
diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp b/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp
index f2c8ef442ea..aaa627f79ec 100644
--- a/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp
+++ b/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp
@@ -270,7 +270,7 @@ class spell_occuthar_eyes_of_occuthar : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) override
{
- return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0)->CalcValue()) });
+ return !spellInfo->GetEffects().empty() && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
}
bool Load() override
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
index cbdc82d355e..b797436b3bd 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -500,21 +500,21 @@ public:
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
- // We only care about interrupt effects and only if they are durring a spell currently being cast
- if (spellInfo->HasEffect(SPELL_EFFECT_INTERRUPT_CAST) && me->IsNonMeleeSpellCast(false))
- {
- // Interrupt effect
- me->InterruptNonMeleeSpells(false);
+ //We only care about interrupt effects and only if they are durring a spell currently being cast
+ if (!spellInfo->HasEffect(SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCast(false))
+ return;
- // Normally we would set the cooldown equal to the spell duration
- // but we do not have access to the DurationStore
+ //Interrupt effect
+ me->InterruptNonMeleeSpells(false);
- switch (CurrentNormalSpell)
- {
- case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break;
- case SPELL_FIREBALL: FireCooldown = 5000; break;
- case SPELL_FROSTBOLT: FrostCooldown = 5000; break;
- }
+ //Normally we would set the cooldown equal to the spell duration
+ //but we do not have access to the DurationStore
+
+ switch (CurrentNormalSpell)
+ {
+ case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break;
+ case SPELL_FIREBALL: FireCooldown = 5000; break;
+ case SPELL_FROSTBOLT: FrostCooldown = 5000; break;
}
}
diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
index 3ef5498e7a7..fef3f9ea821 100644
--- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
+++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
@@ -299,7 +299,7 @@ class spell_shadow_portal_rooms : public SpellScriptLoader
return InstanceHasScript(GetCaster(), ScholomanceScriptName);
}
- void HandleSendEvent(SpellEffIndex effIndex)
+ void HandleSendEvent(SpellEffIndex /*effIndex*/)
{
// If only one player in threat list fail spell
@@ -309,7 +309,7 @@ class spell_shadow_portal_rooms : public SpellScriptLoader
int8 phase_to_set = 0;
int32 gate_to_close = 0;
- switch (GetSpellInfo()->GetEffect(effIndex)->MiscValue)
+ switch (GetEffectInfo().MiscValue)
{
case SPELL_EVENT_HALLOFSECRETS:
pos_to_summon = 0; // Not yet spawned
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
index ef29d76972b..71cd87f9b8a 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
@@ -603,12 +603,12 @@ class spell_kalecgos_tap_check : public SpellScript
bool Validate(SpellInfo const* spellInfo) override
{
- return spellInfo->GetEffect(EFFECT_0) && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0)->CalcValue()) });
+ return !spellInfo->GetEffects().empty() && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- GetHitUnit()->CastSpell(GetCaster(), (uint32)GetEffectInfo(EFFECT_0)->CalcValue(), true);
+ GetHitUnit()->CastSpell(GetCaster(), GetEffectInfo().CalcValue(), true);
}
void Register() override
diff --git a/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp b/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp
index ed287bbe846..9b0d1220ebe 100644
--- a/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp
@@ -380,7 +380,7 @@ public:
void HandleForceCast(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- GetHitUnit()->CastSpell(GetHitUnit(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true);
+ GetHitUnit()->CastSpell(GetHitUnit(), GetEffectInfo().TriggerSpell, true);
}
void Register() override
@@ -412,7 +412,7 @@ public:
void HandleForceCast(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
- GetHitUnit()->CastSpell(GetHitUnit(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true);
+ GetHitUnit()->CastSpell(GetHitUnit(), GetEffectInfo().TriggerSpell, true);
}
void Register() override