*Add SpellMgr::CalculateSpellEffectAmount function for consistency of effect amount calculations in core

*Remove SpellEntry::CalculateSimpleValue function and use the new cuntion instead
*Remove some workarounds made because of incorrect effect amount calculations
*Since now aura effect amount problems should be gone.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-07-14 16:57:13 +02:00
parent 6aa9ee1a2f
commit a43ec3f158
10 changed files with 142 additions and 132 deletions
+3 -3
View File
@@ -3431,7 +3431,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
if (!Has310Flyer(false) && pSkill->id == SKILL_MOUNTS)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
spellInfo->CalculateSimpleValue(i) == 310)
SpellMgr::CalculateSpellEffectAmount(spellInfo, i) == 310)
SetHas310Flyer(true);
if (HasSkill(pSkill->id))
@@ -3705,7 +3705,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
SpellEntry const *pSpellInfo = sSpellStore.LookupEntry(spell_id);
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (pSpellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
pSpellInfo->CalculateSimpleValue(i) == 310)
SpellMgr::CalculateSpellEffectAmount(pSpellInfo, i) == 310)
Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag
}
}
@@ -3799,7 +3799,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId)
pSpellInfo = sSpellStore.LookupEntry(itr->first);
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (pSpellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
pSpellInfo->CalculateSimpleValue(i) == 310)
SpellMgr::CalculateSpellEffectAmount(pSpellInfo, i) == 310)
{
SetHas310Flyer(true);
return true;