public double calc(L2Character caster, L2Character target, Skill skill, double initVal)
{
double value = initVal;
double mul = 1;
for (AbstractFunction func : _functions)
{
if ((func instanceof FuncMul) && ((func.getStat() == Stats.CRITICAL_RATE) || (func.getStat() == Stats.MCRITICAL_RATE)) && (func.getValue() > 1))
{
mul += func.getValue() - 1;
}
else
{
if (mul > 1)
{
value *= mul;
mul = 1;
}
value = func.calc(caster, target, skill, value);
}
}
if (mul > 1)
{
value *= mul;
}
return value;
}