Core/Stats: Fixed spellpower display and implemented gaining spellpower from intellect.
This commit is contained in:
1 parent
15086e92f1
commit
82efe7e505
7 files changed
+50
-47
No files matched your search
@@ -9689,6 +9689,10 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask)
|
||||
// Base value
|
||||
DoneAdvertisedBenefit += ToPlayer()->GetBaseSpellPowerBonus();
|
||||
|
||||
// Check if we are ever using mana - PaperDollFrame.lua
|
||||
if (GetPowerIndexByClass(POWER_MANA, getClass()) != MAX_POWERS)
|
||||
DoneAdvertisedBenefit += std::max(0, int32(GetStat(STAT_INTELLECT)) - 10); // spellpower from intellect
|
||||
|
||||
// Damage bonus from stats
|
||||
AuraEffectList const& mDamageDoneOfStatPercent = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT);
|
||||
for (AuraEffectList::const_iterator i = mDamageDoneOfStatPercent.begin(); i != mDamageDoneOfStatPercent.end(); ++i)
|
||||
@@ -10211,6 +10215,10 @@ int32 Unit::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask)
|
||||
// Base value
|
||||
AdvertisedBenefit += ToPlayer()->GetBaseSpellPowerBonus();
|
||||
|
||||
// Check if we are ever using mana - PaperDollFrame.lua
|
||||
if (GetPowerIndexByClass(POWER_MANA, getClass()) != MAX_POWERS)
|
||||
AdvertisedBenefit += std::max(0, int32(GetStat(STAT_INTELLECT)) - 10); // spellpower from intellect
|
||||
|
||||
// Healing bonus from stats
|
||||
AuraEffectList const& mHealingDoneOfStatPercent = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT);
|
||||
for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i)
|
||||
@@ -12799,32 +12807,6 @@ void Unit::SetMaxHealth(uint32 val)
|
||||
SetHealth(val);
|
||||
}
|
||||
|
||||
uint32 Unit::GetPowerIndexByClass(uint32 powerId, uint32 classId) const
|
||||
{
|
||||
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(classId);
|
||||
|
||||
ASSERT(classEntry && "Class not found");
|
||||
|
||||
uint32 index = 0;
|
||||
for (uint32 i = 0; i <= sChrPowerTypesStore.GetNumRows(); ++i)
|
||||
{
|
||||
ChrPowerTypesEntry const* powerEntry = sChrPowerTypesStore.LookupEntry(i);
|
||||
if (!powerEntry)
|
||||
continue;
|
||||
|
||||
if (powerEntry->classId != classId)
|
||||
continue;
|
||||
|
||||
if (powerEntry->power == powerId)
|
||||
return index;
|
||||
|
||||
++index;
|
||||
}
|
||||
|
||||
// return invalid value - this class doesn't use this power
|
||||
return MAX_POWERS;
|
||||
};
|
||||
|
||||
int32 Unit::GetPower(Powers power) const
|
||||
{
|
||||
uint32 powerIndex = GetPowerIndexByClass(power, getClass());
|
||||
|
||||
Reference in new issue
Block a user