This way the 120% of spell-power is calculated in the beginning in the original version:
- Code: Select all
...
double power = m_spell.Power * 1.2;
...
This is right of course but this way the focus-bonus for %-costs had been added as NEGATIVE AND ABSOLUT value instead of positive percent-value:
- Code: Select all
...
power -= m_spell.Power * focusBonus;
...
correction (to be inserted into 'SpellHandler.cs'):
- Code: Select all
public virtual int CalculateNeededPower(GameLiving target)
{
double basepower = m_spell.Power; //<== defined a basevar first then modified this base-var to tell %-costs from absolut-costs
// percent of maxPower if less than zero
if (basepower < 0)
if (Caster is GamePlayer && ((GamePlayer)Caster).CharacterClass.ManaStat != eStat.UNDEFINED)
{
GamePlayer player = Caster as GamePlayer;
basepower = player.CalculateMaxMana(player.Level, player.GetBaseStat(player.CharacterClass.ManaStat)) * basepower * -0.01;
}
else
basepower = Caster.MaxMana * basepower * -0.01;
double power = basepower * 1.2; //<==NOW holding basepower*1.2 within 'power'
eProperty focusProp = SkillBase.SpecToFocus(SpellLine.Spec);
if (focusProp != eProperty.Undefined)
{
double focusBonus = Caster.GetModified(focusProp) * 0.4;
if (Spell.Level > 0)
focusBonus /= Spell.Level;
if (focusBonus > 0.4)
focusBonus = 0.4;
else if (focusBonus < 0)
focusBonus = 0;
power -= basepower * focusBonus; //<== So i can finally use 'basepower' for both calculations: % and absolut
}
else if (Caster is GamePlayer && ((GamePlayer)Caster).CharacterClass.ClassType == eClassType.Hybrid)
{
double specBonus = 0;
if (Spell.Level != 0) specBonus = (((GamePlayer)Caster).GetBaseSpecLevel(SpellLine.Spec) * 0.4 / Spell.Level);
if (specBonus > 0.4)
specBonus = 0.4;
else if (specBonus < 0)
specBonus = 0;
power -= basepower * specBonus;
}
// doubled power usage if quickcasting
if (Caster.EffectList.GetOfType(typeof(QuickCastEffect)) != null && Spell.CastTime > 0)
power *= 2;
return (int)power;
}