feat(Core/Spell): AssertSpellInfo (#6115)

* feat(Core/Spell): AssertSpellInfo

(cherry picked from commit e52878b6b5)
(cherry picked from commit 8c44259fae)
Co-Authored-By: Shauren <shauren.trinity@gmail.com>
Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com>

* Update SpellMgr.h
This commit is contained in:
Kitzunu
2021-06-03 07:39:48 +02:00
committed by GitHub
parent 7152ddc82c
commit a75e34c793
15 changed files with 29 additions and 29 deletions

View File

@@ -1171,7 +1171,7 @@ public:
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{
SpellInfo const* talentSpell = sSpellMgr->GetSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT);
SpellInfo const* talentSpell = sSpellMgr->AssertSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT);
amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster());
if (Unit* totem = GetCaster())
if (Unit* owner = totem->ToTotem()->GetSummoner())
@@ -2563,7 +2563,7 @@ public:
{
// min pct of hp is stored in effect 0 of talent spell
uint8 rank = GetSpellInfo()->GetRank();
SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
SpellInfo const* talentProto = sSpellMgr->AssertSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage());
int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(talentProto->Effects[EFFECT_0].CalcValue(GetCaster())));