XP Gain from Roll has a CD now (60 seconds)

This commit is contained in:
nossr50
2019-03-21 14:32:01 -07:00
parent d59dbe7630
commit e40a7bb4e1
4 changed files with 35 additions and 10 deletions

View File

@ -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);

View File

@ -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;