*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
+13 -12
View File
@@ -1212,6 +1212,8 @@ class SpellMgr
bool IsSkillBonusSpell(uint32 spellId) const;
bool IsSkillTypeSpell(uint32 spellId, SkillType type) const;
static int32 CalculateSpellEffectAmount(SpellEntry const * spellEntry, uint8 effIndex, Unit const * caster = NULL, int32 const * basePoints = NULL, Unit const * target = NULL);
static int32 CalculateSpellEffectBaseAmount(int32 value) {return value-1;};
// Spell correctess for client using
static bool IsSpellValid(SpellEntry const * spellInfo, Player* pl = NULL, bool msg = true);
@@ -1322,21 +1324,20 @@ class SpellMgr
}
void SetSpellDifficultyId(uint32 spellId, uint32 id) { mSpellDifficultySearcherMap[spellId] = id; }
const SpellsRequiringSpellMap GetSpellsRequiringSpell()
{
return this->mSpellsReqSpell;
}
const SpellsRequiringSpellMap GetSpellsRequiringSpell()
{
return this->mSpellsReqSpell;
}
uint32 GetSpellRequired(uint32 spell_id) const
{
SpellRequiredMap::const_iterator itr = mSpellReq.find(spell_id);
uint32 GetSpellRequired(uint32 spell_id) const
{
SpellRequiredMap::const_iterator itr = mSpellReq.find(spell_id);
if (itr == mSpellReq.end())
return NULL;
return itr->second;
}
if (itr == mSpellReq.end())
return NULL;
return itr->second;
}
// Modifiers
public: