aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp10
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp15
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp14
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp23
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp4
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp2
6 files changed, 37 insertions, 31 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 0399134fddb..04880e211de 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -953,11 +953,15 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
+ SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1);
+ if (!firstRankSpellInfo)
+ return false;
+
// can't use other spell than will of the necropolis due to spell_ranks dependency
- if (sSpellMgr->GetFirstSpellInChain(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id))
+ if (!spellInfo->IsRankOf(firstRankSpellInfo))
return false;
- uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id);
+ uint8 rank = spellInfo->GetRank();
if (!sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank, true))
return false;
@@ -981,7 +985,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
// min pct of hp is stored in effect 0 of talent spell
- uint32 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
+ uint8 rank = GetSpellInfo()->GetRank();
SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage());
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index fa3c6be7f72..d424915c368 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -597,16 +597,17 @@ class spell_pal_holy_shock : public SpellScriptLoader
{
PrepareSpellScript(spell_pal_holy_shock_SpellScript);
- bool Validate(SpellInfo const* spell) OVERRIDE
+ bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
- if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1))
+ SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1);
+ if (!firstRankSpellInfo)
return false;
// can't use other spell than holy shock due to spell_ranks dependency
- if (sSpellMgr->GetFirstSpellInChain(SPELL_PALADIN_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id))
+ if (!spellInfo->IsRankOf(firstRankSpellInfo))
return false;
- uint8 rank = sSpellMgr->GetSpellRank(spell->Id);
+ uint8 rank = spellInfo->GetRank();
if (!sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank, true))
return false;
@@ -618,11 +619,11 @@ class spell_pal_holy_shock : public SpellScriptLoader
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
{
- uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
+ uint8 rank = GetSpellInfo()->GetRank();
if (caster->IsFriendlyTo(unitTarget))
- caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true, 0);
+ caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true);
else
- caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
+ caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true);
}
}
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index cf52909ee3f..0b4c85ca802 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -382,13 +382,15 @@ class spell_pri_penance : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
- if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_PENANCE_R1))
+ SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PRIEST_PENANCE_R1);
+ if (!firstRankSpellInfo)
return false;
+
// can't use other spell than this penance due to spell_ranks dependency
- if (sSpellMgr->GetFirstSpellInChain(SPELL_PRIEST_PENANCE_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id))
+ if (!spellInfo->IsRankOf(firstRankSpellInfo))
return false;
- uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id);
+ uint8 rank = spellInfo->GetRank();
if (!sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank, true))
return false;
if (!sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank, true))
@@ -405,12 +407,12 @@ class spell_pri_penance : public SpellScriptLoader
if (!unitTarget->IsAlive())
return;
- uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
+ uint8 rank = GetSpellInfo()->GetRank();
if (caster->IsFriendlyTo(unitTarget))
- caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank), false, 0);
+ caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank), false);
else
- caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank), false, 0);
+ caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank), false);
}
}
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 69e02a37272..f686f2f30bd 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -441,10 +441,11 @@ class spell_sha_fire_nova : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
- if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FIRE_NOVA_R1) || sSpellMgr->GetFirstSpellInChain(SPELL_SHAMAN_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id))
+ SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FIRE_NOVA_R1);
+ if (!firstRankSpellInfo || !spellInfo->IsRankOf(firstRankSpellInfo))
return false;
- uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id);
+ uint8 rank = spellInfo->GetRank();
if (!sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, rank, true))
return false;
return true;
@@ -464,15 +465,12 @@ class spell_sha_fire_nova : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- if (Unit* caster = GetCaster())
+ Unit* caster = GetCaster();
+ if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]))
{
- uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
- if (uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, rank))
- {
- Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]);
- if (totem && totem->IsTotem())
- caster->CastSpell(totem, spellId, true);
- }
+ uint8 rank = GetSpellInfo()->GetRank();
+ if (totem->IsTotem())
+ caster->CastSpell(totem, sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, rank), true);
}
}
@@ -514,10 +512,11 @@ class spell_sha_flame_shock : public SpellScriptLoader
// Lava Flows
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0))
{
- if (sSpellMgr->GetFirstSpellInChain(SPELL_SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
+ SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_R1);
+ if (!aurEff->GetSpellInfo()->IsRankOf(firstRankSpellInfo))
return;
- uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId());
+ uint8 rank = aurEff->GetSpellInfo()->GetRank();
caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true);
}
}
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index be060e32030..f5c5018590c 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -135,7 +135,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader
{
if (Player* caster = GetCaster()->ToPlayer())
{
- uint8 spellRank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
+ uint8 spellRank = GetSpellInfo()->GetRank();
ItemPosCountVec dest;
InventoryResult msg = caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, iTypes[spellRank - 1][0], 1, NULL);
if (msg != EQUIP_ERR_OK)
@@ -165,7 +165,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader
break;
}
}
- uint8 spellRank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
+ uint8 spellRank = GetSpellInfo()->GetRank();
if (spellRank > 0 && spellRank <= 8)
CreateItem(effIndex, iTypes[spellRank - 1][rank]);
}
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 9e7ca75890f..fcb62a4a651 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -264,7 +264,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader
// apply percent damage mods
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
- ApplyPct(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
+ ApplyPct(damage, 16 * GetSpellInfo()->GetRank());
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);