|
@@ -60,21 +60,37 @@ public class Skills {
|
|
}
|
|
}
|
|
return x;
|
|
return x;
|
|
}
|
|
}
|
|
|
|
+ public static boolean isAllCooldownsOver(PlayerProfile PP)
|
|
|
|
+ {
|
|
|
|
+ long t = System.currentTimeMillis();
|
|
|
|
+ if(t - PP.getGreenTerraDeactivatedTimeStamp() >= (LoadProperties.greenTerraCooldown * 1000) &&
|
|
|
|
+ t - PP.getTreeFellerDeactivatedTimeStamp() >= (LoadProperties.treeFellerCooldown * 1000) &&
|
|
|
|
+ t - PP.getSuperBreakerDeactivatedTimeStamp() >= (LoadProperties.superBreakerCooldown * 1000) &&
|
|
|
|
+ t - PP.getSerratedStrikesDeactivatedTimeStamp() >= (LoadProperties.serratedStrikeCooldown * 1000) &&
|
|
|
|
+ t - PP.getBerserkDeactivatedTimeStamp() >= (LoadProperties.berserkCooldown * 1000) &&
|
|
|
|
+ t - PP.getSkullSplitterDeactivatedTimeStamp() >= (LoadProperties.skullSplitterCooldown * 1000) &&
|
|
|
|
+ t - PP.getGigaDrillBreakerDeactivatedTimeStamp() >= (LoadProperties.gigaDrillBreakerCooldown * 1000))
|
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
public static void watchCooldowns(Player player){
|
|
public static void watchCooldowns(Player player){
|
|
PlayerProfile PP = Users.getProfile(player);
|
|
PlayerProfile PP = Users.getProfile(player);
|
|
if(!PP.getGreenTerraInformed() && System.currentTimeMillis() - PP.getGreenTerraDeactivatedTimeStamp() >= (LoadProperties.greenTerraCooldown * 1000)){
|
|
if(!PP.getGreenTerraInformed() && System.currentTimeMillis() - PP.getGreenTerraDeactivatedTimeStamp() >= (LoadProperties.greenTerraCooldown * 1000)){
|
|
PP.setGreenTerraInformed(true);
|
|
PP.setGreenTerraInformed(true);
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Green Terra "+ChatColor.GREEN+"ability is refreshed!");
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Green Terra "+ChatColor.GREEN+"ability is refreshed!");
|
|
}
|
|
}
|
|
- if(!PP.getTreeFellerInformed() && System.currentTimeMillis() - PP.getTreeFellerDeactivatedTimeStamp() >= (LoadProperties.berserkCooldown * 1000)){
|
|
|
|
|
|
+ if(!PP.getTreeFellerInformed() && System.currentTimeMillis() - PP.getTreeFellerDeactivatedTimeStamp() >= (LoadProperties.greenTerraCooldown * 1000)){
|
|
PP.setTreeFellerInformed(true);
|
|
PP.setTreeFellerInformed(true);
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Tree Feller "+ChatColor.GREEN+"ability is refreshed!");
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Tree Feller "+ChatColor.GREEN+"ability is refreshed!");
|
|
}
|
|
}
|
|
- if(!PP.getSuperBreakerInformed() && System.currentTimeMillis() - PP.getSuperBreakerDeactivatedTimeStamp() >= (LoadProperties.berserkCooldown * 1000)){
|
|
|
|
|
|
+ if(!PP.getSuperBreakerInformed() && System.currentTimeMillis() - PP.getSuperBreakerDeactivatedTimeStamp() >= (LoadProperties.superBreakerCooldown * 1000)){
|
|
PP.setSuperBreakerInformed(true);
|
|
PP.setSuperBreakerInformed(true);
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Super Breaker "+ChatColor.GREEN+"ability is refreshed!");
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Super Breaker "+ChatColor.GREEN+"ability is refreshed!");
|
|
}
|
|
}
|
|
- if(!PP.getSerratedStrikesInformed() && System.currentTimeMillis() - PP.getSerratedStrikesDeactivatedTimeStamp() >= (LoadProperties.berserkCooldown * 1000)){
|
|
|
|
|
|
+ if(!PP.getSerratedStrikesInformed() && System.currentTimeMillis() - PP.getSerratedStrikesDeactivatedTimeStamp() >= (LoadProperties.serratedStrikeCooldown * 1000)){
|
|
PP.setSerratedStrikesInformed(true);
|
|
PP.setSerratedStrikesInformed(true);
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Serrated Strikes "+ChatColor.GREEN+"ability is refreshed!");
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Serrated Strikes "+ChatColor.GREEN+"ability is refreshed!");
|
|
}
|
|
}
|
|
@@ -82,11 +98,11 @@ public class Skills {
|
|
PP.setBerserkInformed(true);
|
|
PP.setBerserkInformed(true);
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Berserk "+ChatColor.GREEN+"ability is refreshed!");
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Berserk "+ChatColor.GREEN+"ability is refreshed!");
|
|
}
|
|
}
|
|
- if(!PP.getSkullSplitterInformed() && System.currentTimeMillis() - PP.getSkullSplitterDeactivatedTimeStamp() >= (LoadProperties.berserkCooldown * 1000)){
|
|
|
|
|
|
+ if(!PP.getSkullSplitterInformed() && System.currentTimeMillis() - PP.getSkullSplitterDeactivatedTimeStamp() >= (LoadProperties.skullSplitterCooldown * 1000)){
|
|
PP.setSkullSplitterInformed(true);
|
|
PP.setSkullSplitterInformed(true);
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Skull Splitter "+ChatColor.GREEN+"ability is refreshed!");
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Skull Splitter "+ChatColor.GREEN+"ability is refreshed!");
|
|
}
|
|
}
|
|
- if(!PP.getGigaDrillBreakerInformed() && System.currentTimeMillis() - PP.getGigaDrillBreakerDeactivatedTimeStamp() >= (LoadProperties.berserkCooldown * 1000)){
|
|
|
|
|
|
+ if(!PP.getGigaDrillBreakerInformed() && System.currentTimeMillis() - PP.getGigaDrillBreakerDeactivatedTimeStamp() >= (LoadProperties.gigaDrillBreakerCooldown * 1000)){
|
|
PP.setGigaDrillBreakerInformed(true);
|
|
PP.setGigaDrillBreakerInformed(true);
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Giga Drill Breaker "+ChatColor.GREEN+"ability is refreshed!");
|
|
player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Giga Drill Breaker "+ChatColor.GREEN+"ability is refreshed!");
|
|
}
|
|
}
|
|
@@ -104,149 +120,14 @@ public class Skills {
|
|
PP.setHoePreparationMode(true);
|
|
PP.setHoePreparationMode(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- public static void abilityActivationCheck(Player player){
|
|
|
|
- PlayerProfile PP = Users.getProfile(player);
|
|
|
|
- if(!PP.getAbilityUse())
|
|
|
|
- return;
|
|
|
|
- if(mcPermissions.getInstance().miningAbility(player) && m.isMiningPick(player.getItemInHand()) && !PP.getPickaxePreparationMode()){
|
|
|
|
- if(!PP.getSuperBreakerMode() && !cooldownOver(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)){
|
|
|
|
- player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
|
|
|
|
- +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)+"s)");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR PICKAXE**");
|
|
|
|
- PP.setPickaxePreparationATS(System.currentTimeMillis());
|
|
|
|
- PP.setPickaxePreparationMode(true);
|
|
|
|
- }
|
|
|
|
- if(mcPermissions.getInstance().excavationAbility(player) && m.isShovel(player.getItemInHand()) && !PP.getShovelPreparationMode()){
|
|
|
|
- if(!PP.getGigaDrillBreakerMode() && !cooldownOver(player, PP.getGigaDrillBreakerDeactivatedTimeStamp(), LoadProperties.gigaDrillBreakerCooldown)){
|
|
|
|
- player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
|
|
|
|
- +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getGigaDrillBreakerDeactivatedTimeStamp(), LoadProperties.gigaDrillBreakerCooldown)+"s)");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SHOVEL**");
|
|
|
|
- PP.setShovelPreparationATS(System.currentTimeMillis());
|
|
|
|
- PP.setShovelPreparationMode(true);
|
|
|
|
- }
|
|
|
|
- if(mcPermissions.getInstance().swordsAbility(player) && m.isSwords(player.getItemInHand()) && !PP.getSwordsPreparationMode()){
|
|
|
|
- if(!PP.getSerratedStrikesMode() && !cooldownOver(player, PP.getSerratedStrikesDeactivatedTimeStamp(), LoadProperties.serratedStrikeCooldown)){
|
|
|
|
- player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
|
|
|
|
- +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getSerratedStrikesDeactivatedTimeStamp(), LoadProperties.serratedStrikeCooldown)+"s)");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SWORD**");
|
|
|
|
- PP.setSwordsPreparationATS(System.currentTimeMillis());
|
|
|
|
- PP.setSwordsPreparationMode(true);
|
|
|
|
- }
|
|
|
|
- if(mcPermissions.getInstance().unarmedAbility(player) && player.getItemInHand().getTypeId() == 0 && !PP.getFistsPreparationMode()){
|
|
|
|
- if(!PP.getBerserkMode() && !cooldownOver(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)){
|
|
|
|
- player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
|
|
|
|
- +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)+"s)");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR FISTS**");
|
|
|
|
- PP.setFistsPreparationATS(System.currentTimeMillis());
|
|
|
|
- PP.setFistsPreparationMode(true);
|
|
|
|
- }
|
|
|
|
- if((mcPermissions.getInstance().axes(player) || mcPermissions.getInstance().woodcutting(player)) && !PP.getAxePreparationMode()){
|
|
|
|
- if(m.isAxes(player.getItemInHand())){
|
|
|
|
- player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR AXE**");
|
|
|
|
- PP.setAxePreparationATS(System.currentTimeMillis());
|
|
|
|
- PP.setAxePreparationMode(true);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- public static void serratedStrikesActivationCheck(Player player, Plugin pluginx){
|
|
|
|
- PlayerProfile PP = Users.getProfile(player);
|
|
|
|
- if(m.isSwords(player.getItemInHand())){
|
|
|
|
- if(PP.getSwordsPreparationMode()){
|
|
|
|
- PP.setSwordsPreparationMode(false);
|
|
|
|
- }
|
|
|
|
- int ticks = 2;
|
|
|
|
- int x = PP.getSwordsInt();
|
|
|
|
- while(x >= 50){
|
|
|
|
- x-=50;
|
|
|
|
- ticks++;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(!PP.getSerratedStrikesMode() && PP.getSerratedStrikesCooldown() == 0){
|
|
|
|
- player.sendMessage(ChatColor.GREEN+"**SERRATED STRIKES ACTIVATED**");
|
|
|
|
- for(Player y : pluginx.getServer().getOnlinePlayers()){
|
|
|
|
- if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
|
|
|
|
- y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Serrated Strikes!");
|
|
|
|
- }
|
|
|
|
- PP.setSerratedStrikesTicks((ticks * 2) * 1000);
|
|
|
|
- PP.setSerratedStrikesActivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
- PP.setSerratedStrikesMode(true);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- public static void berserkActivationCheck(Player player, Plugin pluginx){
|
|
|
|
- PlayerProfile PP = Users.getProfile(player);
|
|
|
|
- if(player.getItemInHand().getTypeId() == 0){
|
|
|
|
- if(PP.getFistsPreparationMode()){
|
|
|
|
- PP.setFistsPreparationMode(false);
|
|
|
|
- }
|
|
|
|
- int ticks = 2;
|
|
|
|
- int x = PP.getUnarmedInt();
|
|
|
|
- while(x >= 50){
|
|
|
|
- x-=50;
|
|
|
|
- ticks++;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(!PP.getBerserkMode() && cooldownOver(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)){
|
|
|
|
- player.sendMessage(ChatColor.GREEN+"**BERSERK ACTIVATED**");
|
|
|
|
- for(Player y : pluginx.getServer().getOnlinePlayers()){
|
|
|
|
- if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
|
|
|
|
- y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Berserk!");
|
|
|
|
- }
|
|
|
|
- PP.setBerserkTicks(ticks * 1000);
|
|
|
|
- PP.setBerserkActivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
- PP.setBerserkMode(true);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- public static void skullSplitterCheck(Player player, Plugin pluginx){
|
|
|
|
- PlayerProfile PP = Users.getProfile(player);
|
|
|
|
- if(m.isAxes(player.getItemInHand()) && mcPermissions.getInstance().axesAbility(player)){
|
|
|
|
- /*
|
|
|
|
- * CHECK FOR AXE PREP MODE
|
|
|
|
- */
|
|
|
|
- if(PP.getAxePreparationMode()){
|
|
|
|
- PP.setAxePreparationMode(false);
|
|
|
|
- }
|
|
|
|
- int ticks = 2;
|
|
|
|
- int x = PP.getAxesInt();
|
|
|
|
- while(x >= 50){
|
|
|
|
- x-=50;
|
|
|
|
- ticks++;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(!PP.getSkullSplitterMode() && cooldownOver(player, PP.getSkullSplitterDeactivatedTimeStamp(), LoadProperties.skullSplitterCooldown)){
|
|
|
|
- player.sendMessage(ChatColor.GREEN+"**SKULL SPLITTER ACTIVATED**");
|
|
|
|
- for(Player y : pluginx.getServer().getOnlinePlayers()){
|
|
|
|
- if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10)
|
|
|
|
- y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Skull Splitter!");
|
|
|
|
- }
|
|
|
|
- PP.setSkullSplitterTicks(ticks * 1000);
|
|
|
|
- PP.setSkullSplitterActivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
- PP.setSkullSplitterMode(true);
|
|
|
|
- }
|
|
|
|
- if(!PP.getSkullSplitterMode() && !cooldownOver(player, PP.getSkullSplitterDeactivatedTimeStamp(), LoadProperties.skullSplitterCooldown)){
|
|
|
|
- player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
|
|
|
|
- +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getSkullSplitterDeactivatedTimeStamp(), LoadProperties.skullSplitterCooldown)+"s)");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
public static void monitorSkills(Player player){
|
|
public static void monitorSkills(Player player){
|
|
- PlayerProfile PP = Users.getProfile(player);
|
|
|
|
- if(PP == null)
|
|
|
|
- Users.addUser(player);
|
|
|
|
- if(PP.getHoePreparationMode() && System.currentTimeMillis() - PP.getHoePreparationATS() >= 4000){
|
|
|
|
|
|
+ PlayerProfile PP = Users.getProfile(player);
|
|
|
|
+ if(PP == null)
|
|
|
|
+ Users.addUser(player);
|
|
|
|
+ if(PP.getHoePreparationMode() && System.currentTimeMillis() - PP.getHoePreparationATS() >= 4000){
|
|
PP.setHoePreparationMode(false);
|
|
PP.setHoePreparationMode(false);
|
|
player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR HOE**");
|
|
player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR HOE**");
|
|
- }
|
|
|
|
|
|
+ }
|
|
if(PP.getAxePreparationMode() && System.currentTimeMillis() - PP.getAxePreparationATS() >= 4000){
|
|
if(PP.getAxePreparationMode() && System.currentTimeMillis() - PP.getAxePreparationATS() >= 4000){
|
|
PP.setAxePreparationMode(false);
|
|
PP.setAxePreparationMode(false);
|
|
player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR AXE**");
|
|
player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR AXE**");
|
|
@@ -271,33 +152,30 @@ public class Skills {
|
|
* HERBALISM ABILITY
|
|
* HERBALISM ABILITY
|
|
*/
|
|
*/
|
|
if(mcPermissions.getInstance().herbalismAbility(player)){
|
|
if(mcPermissions.getInstance().herbalismAbility(player)){
|
|
- if(PP.getGreenTerraMode() && PP.getGreenTerraActivatedTimeStamp() + PP.getGreenTerraTicks() <= System.currentTimeMillis()){
|
|
|
|
- PP.setGreenTerraMode(false);
|
|
|
|
- PP.setGreenTerraInformed(false);
|
|
|
|
- player.sendMessage(ChatColor.RED+"**Green Terra has worn off**");
|
|
|
|
- PP.setGreenTerraDeactivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
- }
|
|
|
|
|
|
+ if(PP.getGreenTerraMode() && PP.getGreenTerraActivatedTimeStamp() + PP.getGreenTerraTicks() <= System.currentTimeMillis()){
|
|
|
|
+ PP.setGreenTerraMode(false);
|
|
|
|
+ PP.setGreenTerraInformed(false);
|
|
|
|
+ player.sendMessage(ChatColor.RED+"**Green Terra has worn off**");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- /*
|
|
|
|
- * AXES ABILITY
|
|
|
|
- */
|
|
|
|
- if(mcPermissions.getInstance().axesAbility(player)){
|
|
|
|
- if(PP.getSkullSplitterMode() && PP.getSkullSplitterActivatedTimeStamp() + PP.getSkullSplitterTicks() <= System.currentTimeMillis()){
|
|
|
|
- PP.setSkullSplitterMode(false);
|
|
|
|
- PP.setSkullSplitterInformed(false);
|
|
|
|
- player.sendMessage(ChatColor.RED+"**Skull Splitter has worn off**");
|
|
|
|
- PP.setSkullSplitterDeactivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
- }
|
|
|
|
|
|
+ /*
|
|
|
|
+ * AXES ABILITY
|
|
|
|
+ */
|
|
|
|
+ if(mcPermissions.getInstance().axesAbility(player)){
|
|
|
|
+ if(PP.getSkullSplitterMode() && PP.getSkullSplitterActivatedTimeStamp() + PP.getSkullSplitterTicks() <= System.currentTimeMillis()){
|
|
|
|
+ PP.setSkullSplitterMode(false);
|
|
|
|
+ PP.setSkullSplitterInformed(false);
|
|
|
|
+ player.sendMessage(ChatColor.RED+"**Skull Splitter has worn off**");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- /*
|
|
|
|
|
|
+ /*
|
|
* WOODCUTTING ABILITY
|
|
* WOODCUTTING ABILITY
|
|
*/
|
|
*/
|
|
- if(mcPermissions.getInstance().woodCuttingAbility(player)){
|
|
|
|
|
|
+ if(mcPermissions.getInstance().woodCuttingAbility(player)){
|
|
if(PP.getTreeFellerMode() && PP.getTreeFellerActivatedTimeStamp() + PP.getTreeFellerTicks() <= System.currentTimeMillis()){
|
|
if(PP.getTreeFellerMode() && PP.getTreeFellerActivatedTimeStamp() + PP.getTreeFellerTicks() <= System.currentTimeMillis()){
|
|
PP.setTreeFellerMode(false);
|
|
PP.setTreeFellerMode(false);
|
|
PP.setTreeFellerInformed(false);
|
|
PP.setTreeFellerInformed(false);
|
|
player.sendMessage(ChatColor.RED+"**Tree Feller has worn off**");
|
|
player.sendMessage(ChatColor.RED+"**Tree Feller has worn off**");
|
|
- PP.setTreeFellerDeactivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
@@ -308,7 +186,6 @@ public class Skills {
|
|
PP.setSuperBreakerMode(false);
|
|
PP.setSuperBreakerMode(false);
|
|
PP.setSuperBreakerInformed(false);
|
|
PP.setSuperBreakerInformed(false);
|
|
player.sendMessage(ChatColor.RED+"**Super Breaker has worn off**");
|
|
player.sendMessage(ChatColor.RED+"**Super Breaker has worn off**");
|
|
- PP.setSuperBreakerDeactivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
@@ -319,7 +196,6 @@ public class Skills {
|
|
PP.setGigaDrillBreakerMode(false);
|
|
PP.setGigaDrillBreakerMode(false);
|
|
PP.setGigaDrillBreakerInformed(false);
|
|
PP.setGigaDrillBreakerInformed(false);
|
|
player.sendMessage(ChatColor.RED+"**Giga Drill Breaker has worn off**");
|
|
player.sendMessage(ChatColor.RED+"**Giga Drill Breaker has worn off**");
|
|
- PP.setGigaDrillBreakerDeactivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
@@ -330,7 +206,6 @@ public class Skills {
|
|
PP.setSerratedStrikesMode(false);
|
|
PP.setSerratedStrikesMode(false);
|
|
PP.setSerratedStrikesInformed(false);
|
|
PP.setSerratedStrikesInformed(false);
|
|
player.sendMessage(ChatColor.RED+"**Serrated Strikes has worn off**");
|
|
player.sendMessage(ChatColor.RED+"**Serrated Strikes has worn off**");
|
|
- PP.setSerratedStrikesDeactivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
@@ -341,9 +216,60 @@ public class Skills {
|
|
PP.setBerserkMode(false);
|
|
PP.setBerserkMode(false);
|
|
PP.setBerserkInformed(false);
|
|
PP.setBerserkInformed(false);
|
|
player.sendMessage(ChatColor.RED+"**Berserk has worn off**");
|
|
player.sendMessage(ChatColor.RED+"**Berserk has worn off**");
|
|
- PP.setBerserkDeactivatedTimeStamp(System.currentTimeMillis());
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ public static void abilityActivationCheck(Player player){
|
|
|
|
+ PlayerProfile PP = Users.getProfile(player);
|
|
|
|
+ if(!PP.getAbilityUse())
|
|
|
|
+ return;
|
|
|
|
+ if(mcPermissions.getInstance().miningAbility(player) && m.isMiningPick(player.getItemInHand()) && !PP.getPickaxePreparationMode()){
|
|
|
|
+ if(!PP.getSuperBreakerMode() && !cooldownOver(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)){
|
|
|
|
+ player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
|
|
|
|
+ +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)+"s)");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR PICKAXE**");
|
|
|
|
+ PP.setPickaxePreparationATS(System.currentTimeMillis());
|
|
|
|
+ PP.setPickaxePreparationMode(true);
|
|
|
|
+ }
|
|
|
|
+ if(mcPermissions.getInstance().excavationAbility(player) && m.isShovel(player.getItemInHand()) && !PP.getShovelPreparationMode()){
|
|
|
|
+ if(!PP.getGigaDrillBreakerMode() && !cooldownOver(player, PP.getGigaDrillBreakerDeactivatedTimeStamp(), LoadProperties.gigaDrillBreakerCooldown)){
|
|
|
|
+ player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
|
|
|
|
+ +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getGigaDrillBreakerDeactivatedTimeStamp(), LoadProperties.gigaDrillBreakerCooldown)+"s)");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SHOVEL**");
|
|
|
|
+ PP.setShovelPreparationATS(System.currentTimeMillis());
|
|
|
|
+ PP.setShovelPreparationMode(true);
|
|
|
|
+ }
|
|
|
|
+ if(mcPermissions.getInstance().swordsAbility(player) && m.isSwords(player.getItemInHand()) && !PP.getSwordsPreparationMode()){
|
|
|
|
+ if(!PP.getSerratedStrikesMode() && !cooldownOver(player, PP.getSerratedStrikesDeactivatedTimeStamp(), LoadProperties.serratedStrikeCooldown)){
|
|
|
|
+ player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
|
|
|
|
+ +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getSerratedStrikesDeactivatedTimeStamp(), LoadProperties.serratedStrikeCooldown)+"s)");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SWORD**");
|
|
|
|
+ PP.setSwordsPreparationATS(System.currentTimeMillis());
|
|
|
|
+ PP.setSwordsPreparationMode(true);
|
|
|
|
+ }
|
|
|
|
+ if(mcPermissions.getInstance().unarmedAbility(player) && player.getItemInHand().getTypeId() == 0 && !PP.getFistsPreparationMode()){
|
|
|
|
+ if(!PP.getBerserkMode() && !cooldownOver(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)){
|
|
|
|
+ player.sendMessage(ChatColor.RED+"You are too tired to use that ability again."
|
|
|
|
+ +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)+"s)");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR FISTS**");
|
|
|
|
+ PP.setFistsPreparationATS(System.currentTimeMillis());
|
|
|
|
+ PP.setFistsPreparationMode(true);
|
|
|
|
+ }
|
|
|
|
+ if((mcPermissions.getInstance().axes(player) || mcPermissions.getInstance().woodcutting(player)) && !PP.getAxePreparationMode()){
|
|
|
|
+ if(m.isAxes(player.getItemInHand())){
|
|
|
|
+ player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR AXE**");
|
|
|
|
+ PP.setAxePreparationATS(System.currentTimeMillis());
|
|
|
|
+ PP.setAxePreparationMode(true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
public static void XpCheck(Player player){
|
|
public static void XpCheck(Player player){
|
|
PlayerProfile PP = Users.getProfile(player);
|
|
PlayerProfile PP = Users.getProfile(player);
|