Fixed macro right click press skill exploit.

This commit is contained in:
MobiusDev
2017-04-25 08:48:39 +00:00
parent c4da9e6a6e
commit 26b4294ea1
2 changed files with 20 additions and 2 deletions

View File

@@ -230,7 +230,7 @@ public class SkillCaster implements Runnable
return false;
}
_coolTime = Formulas.calcAtkSpd(caster, _skill, _skill.getCoolTime()); // TODO Get proper fomula of this.
_coolTime = Formulas.calcAtkSpd(caster, _skill, _skill.getCoolTime()); // TODO Get proper formula of this.
final int displayedCastTime = _castTime + Formulas.SKILL_LAUNCH_TIME; // For client purposes, it must be displayed to player the skill casting time + launch time.
final boolean instantCast = (_castingType == SkillCastingType.SIMULTANEOUS) || _skill.isAbnormalInstant() || _skill.isWithoutAction();
@@ -934,6 +934,15 @@ public class SkillCaster implements Runnable
player.sendPacket(sm);
return false;
}
// Check for skill reuse (fixes macro right click press exploit).
if (caster.hasSkillReuse(skill.getReuseHashCode()))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_IS_NOT_AVAILABLE_AT_THIS_TIME_BEING_PREPARED_FOR_REUSE);
sm.addSkillName(skill);
caster.sendPacket(sm);
return false;
}
}
return true;

View File

@@ -230,7 +230,7 @@ public class SkillCaster implements Runnable
return false;
}
_coolTime = Formulas.calcAtkSpd(caster, _skill, _skill.getCoolTime()); // TODO Get proper fomula of this.
_coolTime = Formulas.calcAtkSpd(caster, _skill, _skill.getCoolTime()); // TODO Get proper formula of this.
final int displayedCastTime = _castTime + Formulas.SKILL_LAUNCH_TIME; // For client purposes, it must be displayed to player the skill casting time + launch time.
final boolean instantCast = (_castingType == SkillCastingType.SIMULTANEOUS) || _skill.isAbnormalInstant() || _skill.isWithoutAction();
@@ -934,6 +934,15 @@ public class SkillCaster implements Runnable
player.sendPacket(sm);
return false;
}
// Check for skill reuse (fixes macro right click press exploit).
if (caster.hasSkillReuse(skill.getReuseHashCode()))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_IS_NOT_AVAILABLE_AT_THIS_TIME_BEING_PREPARED_FOR_REUSE);
sm.addSkillName(skill);
caster.sendPacket(sm);
return false;
}
}
return true;