Хочу на хф сделать откат чтобы влияла скорость атаки и магии, но как сделать чтобы если меньше базовой перезарядка не понижалась?
/** Calculate reuse delay (in milliseconds) for skills */
public static long calcSkillReuseDelay(Creature actor, Skill skill)
{
long reuseDelay = skill.getReuseDelay();
if(actor.isMonster())
reuseDelay = skill.getReuseForMonsters();
if(skill.isReuseDelayPermanent() || skill.isHandler() || skill.isItemSkill())
return reuseDelay;
if(actor.getSkillMastery(skill.getId()) == 1)
{
actor.removeSkillMastery(skill.getId());
return 0;
}
if(skill.isMagic())
return (long)(actor.calcStat(Stats.MAGIC_REUSE_RATE, reuseDelay, null, skill) * 600 / (double)Math.max(actor.getMAtkSpd(), 1));
return (long) actor.calcStat(Stats.PHYSIC_REUSE_RATE, reuseDelay, null, skill) * 600 / (long)Math.max(actor.getPAtkSpd(), 1);
}
/** Calculate reuse delay (in milliseconds) for skills */
public static long calcSkillReuseDelay(Creature actor, Skill skill)
{
long reuseDelay = skill.getReuseDelay();
if(actor.isMonster())
reuseDelay = skill.getReuseForMonsters();
if(skill.isReuseDelayPermanent() || skill.isHandler() || skill.isItemSkill())
return reuseDelay;
if(actor.getSkillMastery(skill.getId()) == 1)
{
actor.removeSkillMastery(skill.getId());
return 0;
}
if(skill.isMagic())
return (long)(actor.calcStat(Stats.MAGIC_REUSE_RATE, reuseDelay, null, skill) * 600 / (double)Math.max(actor.getMAtkSpd(), 1));
return (long) actor.calcStat(Stats.PHYSIC_REUSE_RATE, reuseDelay, null, skill) * 600 / (long)Math.max(actor.getPAtkSpd(), 1);
}