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:
QAston committed 2011-07-26 23:09:28 +02:00
1 parent 29c228a801
commit b0fe236265
195 files changed
+4630 -6929

No files matched your search

+14 -14
View File
@@ -48,14 +48,14 @@ public:
ROG_SPELL_CHEAT_DEATH_COOLDOWN = 31231,
};
bool Validate(SpellEntry const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellEntry*/)
{
return sSpellStore.LookupEntry(ROG_SPELL_CHEAT_DEATH_COOLDOWN);
return sSpellMgr->GetSpellInfo(ROG_SPELL_CHEAT_DEATH_COOLDOWN);
}
bool Load()
{
absorbChance = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0);
absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
return GetUnitOwner()->ToPlayer();
}
@@ -115,7 +115,7 @@ public:
bool Load()
{
absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
return true;
}
@@ -153,9 +153,9 @@ class spell_rog_preparation : public SpellScriptLoader
class spell_rog_preparation_SpellScript : public SpellScript
{
PrepareSpellScript(spell_rog_preparation_SpellScript)
bool Validate(SpellEntry const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(ROGUE_SPELL_GLYPH_OF_PREPARATION))
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_GLYPH_OF_PREPARATION))
return false;
return true;
}
@@ -170,7 +170,7 @@ class spell_rog_preparation : public SpellScriptLoader
const SpellCooldowns& cm = caster->ToPlayer()->GetSpellCooldownMap();
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(itr->first);
if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE)
{
@@ -217,9 +217,9 @@ public:
class spell_rog_prey_on_the_weak_AuraScript : public AuraScript
{
PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript)
bool Validate(SpellEntry const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(ROGUE_SPELL_PREY_ON_THE_WEAK))
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_PREY_ON_THE_WEAK))
return false;
return true;
}
@@ -232,7 +232,7 @@ public:
{
if (!target->HasAura(ROGUE_SPELL_PREY_ON_THE_WEAK))
{
int32 bp = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), 0);
int32 bp = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
target->CastCustomSpell(target, ROGUE_SPELL_PREY_ON_THE_WEAK, &bp, 0, 0, true);
}
}
@@ -260,9 +260,9 @@ class spell_rog_shiv : public SpellScriptLoader
class spell_rog_shiv_SpellScript : public SpellScript
{
PrepareSpellScript(spell_rog_shiv_SpellScript)
bool Validate(SpellEntry const* /*spellEntry*/)
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(ROGUE_SPELL_SHIV_TRIGGERED))
if (!sSpellMgr->GetSpellInfo(ROGUE_SPELL_SHIV_TRIGGERED))
return false;
return true;
}
@@ -348,7 +348,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader
if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(enchant->spellid[s]);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]);
if (!spellInfo)
{
sLog->outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", enchant->ID, enchant->spellid[s]);
@@ -363,7 +363,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader
if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0))
continue;
if (IsPositiveSpell(enchant->spellid[s]))
if (spellInfo->IsPositive())
player->CastSpell(player, enchant->spellid[s], true, item);
else
player->CastSpell(target, enchant->spellid[s], true, item);