/// <summary>
/// The calculated relative spell cost.
/// E.g., 50% mana reserved will return 50.
///
/// </summary>
///
/// <returns/>
public float SpellCost()
{
float num1 = (float) this.Cost;
if (!this.RequiresPercentPower)
{
float num2 = (float) (1.0 + (double) this.GetStatFromAll(StatTypeGGG.MonsterLevelScaleMaximumManaAndManaCostPosPctFinal) / 100.0);
num1 *= num2;
}
int num3 = -this.GetStatFromAll(this.RequiresReservedPower ? StatTypeGGG.ManaReservationPosPct : StatTypeGGG.ManaCostPosPct);
if (num3 >= 100)
return 0.0f;
float num4 = num1 - (float) ((double) num1 * (double) num3 / 100.0);
if (!this.RequiresReservedPower)
num4 += (float) this.GetStatFromAll(StatTypeGGG.SkillManaCostPos);
if ((double) num4 < 0.0)
num4 = 0.0f;
return num4;
}