Core: Use new SpellInfo class in core. Sadly, this commit is not compatibile with some of the custom code. To make your code work again you may need to change:
*SpellEntry is now SpellInfo *GetSpellProto is now GetSpellInfo *SpellEntry::Effect*[effIndex] is now avalible under SpellInfo.Effects[effIndex].* *sSpellStore.LookupEntry is no longer valid, use sSpellMgr->GetSpellInfo() *SpellFunctions from SpellMgr.h like DoSpellStuff(spellId) are now: spellInfo->DoStuff() *SpellMgr::CalculateEffectValue and similar functions are now avalible in SpellEffectInfo class. *GET_SPELL macro is removed, code which used it is moved to SpellMgr::LoadDbcDataCorrections *code which affected dbc data in SpellMgr::LoadSpellCustomAttr is now moved to LoadDbcDataCorrections
This commit is contained in:
1 parent
29c228a801
commit
b0fe236265
195 files changed
+4630
-6929
No files matched your search
@@ -55,7 +55,7 @@ class spell_dk_anti_magic_shell_raid : public SpellScriptLoader
|
||||
|
||||
bool Load()
|
||||
{
|
||||
absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
|
||||
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,14 +96,14 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
|
||||
uint32 absorbPct, hpPct;
|
||||
bool Load()
|
||||
{
|
||||
absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
|
||||
hpPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1, GetCaster());
|
||||
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||
hpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Validate(SpellEntry const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
return sSpellStore.LookupEntry(DK_SPELL_RUNIC_POWER_ENERGIZE);
|
||||
return sSpellMgr->GetSpellInfo(DK_SPELL_RUNIC_POWER_ENERGIZE);
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
||||
@@ -154,19 +154,19 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
|
||||
|
||||
bool Load()
|
||||
{
|
||||
absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
|
||||
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Validate(SpellEntry const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
return sSpellStore.LookupEntry(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
|
||||
return sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
|
||||
{
|
||||
SpellEntry const* talentSpell = sSpellStore.LookupEntry(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
|
||||
amount = SpellMgr::CalculateSpellEffectAmount(talentSpell, EFFECT_0, GetCaster());
|
||||
SpellInfo const* talentSpell = sSpellMgr->GetSpellInfo(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
|
||||
amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||
// assume caster is a player here
|
||||
if (Unit* caster = GetCaster())
|
||||
amount += int32(2 * caster->ToPlayer()->GetTotalAttackPowerValue(BASE_ATTACK));
|
||||
@@ -200,11 +200,11 @@ class spell_dk_corpse_explosion : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_dk_corpse_explosion_SpellScript);
|
||||
|
||||
bool Validate(SpellEntry const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED))
|
||||
if (!sSpellMgr->GetSpellInfo(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(DK_SPELL_GHOUL_EXPLODE))
|
||||
if (!sSpellMgr->GetSpellInfo(DK_SPELL_GHOUL_EXPLODE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ class spell_dk_corpse_explosion : public SpellScriptLoader
|
||||
else // Some corpse
|
||||
{
|
||||
bp = GetEffectValue();
|
||||
GetCaster()->CastCustomSpell(unitTarget, SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), 1), &bp, NULL, NULL, true);
|
||||
GetCaster()->CastCustomSpell(unitTarget, GetSpellInfo()->Effects[EFFECT_1].CalcValue(), &bp, NULL, NULL, true);
|
||||
// Corpse Explosion (Suicide)
|
||||
unitTarget->CastSpell(unitTarget, DK_SPELL_CORPSE_EXPLOSION_TRIGGERED, true);
|
||||
// Set corpse look
|
||||
@@ -374,9 +374,9 @@ class spell_dk_scourge_strike : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_dk_scourge_strike_SpellScript);
|
||||
|
||||
bool Validate(SpellEntry const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(DK_SPELL_SCOURGE_STRIKE_TRIGGERED))
|
||||
if (!sSpellMgr->GetSpellInfo(DK_SPELL_SCOURGE_STRIKE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -417,7 +417,7 @@ class spell_dk_spell_deflection : public SpellScriptLoader
|
||||
|
||||
bool Load()
|
||||
{
|
||||
absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
|
||||
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -457,9 +457,9 @@ class spell_dk_blood_boil : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_dk_blood_boil_SpellScript);
|
||||
|
||||
bool Validate(SpellEntry const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(DK_SPELL_BLOOD_BOIL_TRIGGERED))
|
||||
if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_BOIL_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -503,7 +503,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_dk_will_of_the_necropolis_AuraScript);
|
||||
|
||||
bool Validate(SpellEntry const *spellEntry)
|
||||
bool Validate(SpellInfo const *spellEntry)
|
||||
{
|
||||
// can't use other spell than will of the necropolis due to spell_ranks dependency
|
||||
if (sSpellMgr->GetFirstSpellInChain(DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
|
||||
@@ -520,7 +520,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
|
||||
|
||||
bool Load()
|
||||
{
|
||||
absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
|
||||
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -533,11 +533,11 @@ 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(GetSpellProto()->Id);
|
||||
SpellEntry const* talentProto = sSpellStore.LookupEntry(sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
|
||||
uint32 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
|
||||
SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
|
||||
|
||||
int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage());
|
||||
int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(SpellMgr::CalculateSpellEffectAmount(talentProto, EFFECT_0, GetCaster())));
|
||||
int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(talentProto->Effects[EFFECT_0].CalcValue(GetCaster())));
|
||||
|
||||
// Damage that would take you below [effect0] health or taken while you are at [effect0]
|
||||
if (remainingHp < minHp)
|
||||
@@ -566,11 +566,11 @@ public:
|
||||
class spell_dk_improved_blood_presence_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_improved_blood_presence_AuraScript)
|
||||
bool Validate(SpellEntry const* /*entry*/)
|
||||
bool Validate(SpellInfo const* /*entry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(DK_SPELL_BLOOD_PRESENCE))
|
||||
if (!sSpellMgr->GetSpellInfo(DK_SPELL_BLOOD_PRESENCE))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED))
|
||||
if (!sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -614,11 +614,11 @@ public:
|
||||
class spell_dk_improved_unholy_presence_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dk_improved_unholy_presence_AuraScript)
|
||||
bool Validate(SpellEntry const* /*entry*/)
|
||||
bool Validate(SpellInfo const* /*entry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(DK_SPELL_UNHOLY_PRESENCE))
|
||||
if (!sSpellMgr->GetSpellInfo(DK_SPELL_UNHOLY_PRESENCE))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
if (!sSpellMgr->GetSpellInfo(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -629,7 +629,7 @@ public:
|
||||
if (target->HasAura(DK_SPELL_UNHOLY_PRESENCE) && !target->HasAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
{
|
||||
// Not listed as any effect, only base points set in dbc
|
||||
int32 basePoints0 = SpellMgr::CalculateSpellEffectAmount(aurEff->GetSpellProto(), 1);
|
||||
int32 basePoints0 = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
||||
target->CastCustomSpell(target, DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints0 , &basePoints0, &basePoints0, true, 0, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user