mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 02:04:44 +02:00
XP Gain from Roll has a CD now (60 seconds)
This commit is contained in:
@ -210,7 +210,7 @@ public class Roll extends AcrobaticsSubSkill {
|
||||
//player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text"));
|
||||
|
||||
//if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) {
|
||||
if(!isExploiting(player))
|
||||
if(!isExploiting(player) && mcMMOPlayer.getAcrobaticsManager().canGainRollXP())
|
||||
SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, true), XPGainReason.PVE);
|
||||
//}
|
||||
|
||||
@ -219,7 +219,7 @@ public class Roll extends AcrobaticsSubSkill {
|
||||
}
|
||||
else if (!isFatal(player, damage)) {
|
||||
//if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) {
|
||||
if(!isExploiting(player))
|
||||
if(!isExploiting(player) && mcMMOPlayer.getAcrobaticsManager().canGainRollXP())
|
||||
SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, false), XPGainReason.PVE);
|
||||
//}
|
||||
}
|
||||
@ -249,14 +249,14 @@ public class Roll extends AcrobaticsSubSkill {
|
||||
{
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Acrobatics.Ability.Proc");
|
||||
SoundManager.sendCategorizedSound(player, player.getLocation(), SoundType.ROLL_ACTIVATED, SoundCategory.PLAYERS,0.5F);
|
||||
if(!isExploiting(player))
|
||||
if(!isExploiting(player) && mcMMOPlayer.getAcrobaticsManager().canGainRollXP())
|
||||
SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, true), XPGainReason.PVE);
|
||||
|
||||
addFallLocation(player);
|
||||
return modifiedDamage;
|
||||
}
|
||||
else if (!isFatal(player, damage)) {
|
||||
if(!isExploiting(player))
|
||||
if(!isExploiting(player) && mcMMOPlayer.getAcrobaticsManager().canGainRollXP())
|
||||
SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, false), XPGainReason.PVE);
|
||||
|
||||
addFallLocation(player);
|
||||
|
@ -24,6 +24,24 @@ public class AcrobaticsManager extends SkillManager {
|
||||
super(mcMMOPlayer, PrimarySkillType.ACROBATICS);
|
||||
}
|
||||
|
||||
private long rollXPCooldown = 0;
|
||||
private long rollXPInterval = (1000 * 60); //1 Minute
|
||||
private long rollXPIntervalLengthen = (1000 * 10); //10 Seconds
|
||||
|
||||
public boolean canGainRollXP()
|
||||
{
|
||||
if(System.currentTimeMillis() >= rollXPCooldown)
|
||||
{
|
||||
rollXPCooldown = System.currentTimeMillis() + rollXPInterval;
|
||||
rollXPIntervalLengthen = (1000 * 10); //5 Seconds
|
||||
return true;
|
||||
} else {
|
||||
rollXPCooldown += rollXPIntervalLengthen;
|
||||
rollXPIntervalLengthen += 1000; //Add another second to the next penalty
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canDodge(Entity damager) {
|
||||
if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ACROBATICS_DODGE))
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user