From 26b4294ea1938e86c0a9367fcc2cb621e50d5db7 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 25 Apr 2017 08:48:39 +0000 Subject: [PATCH] Fixed macro right click press skill exploit. --- .../gameserver/model/skills/SkillCaster.java | 11 ++++++++++- .../gameserver/model/skills/SkillCaster.java | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index b183377791..062dba1ee7 100644 --- a/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_Helios/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -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; diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index b183377791..062dba1ee7 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -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;