Core/Spells: use SpellInfo class to get spell rank instead of SpellMgr helpers
This commit is contained in:
1 parent
bf100ffc3c
commit
2d6a48840c
9 files changed
+49
-44
No files matched your search
@@ -953,11 +953,15 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) OVERRIDE
|
||||
{
|
||||
// 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))
|
||||
SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1);
|
||||
if (!firstRankSpellInfo)
|
||||
return false;
|
||||
|
||||
uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id);
|
||||
// can't use other spell than will of the necropolis due to spell_ranks dependency
|
||||
if (!spellInfo->IsRankOf(firstRankSpellInfo))
|
||||
return false;
|
||||
|
||||
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());
|
||||
|
||||
Reference in new issue
Block a user