Prevent removal of global attack cooldown.
This commit is contained in:
parent
e7c69e2757
commit
22e1dc51bc
Binary file not shown.
@ -631,17 +631,21 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
removechance+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 3, 3);
|
removechance+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 3, 3);
|
||||||
log("Remove chance is "+removechance,5);
|
log("Remove chance is "+removechance,5);
|
||||||
int longestdur=0;
|
int longestdur=0;
|
||||||
|
int level=0;
|
||||||
PotionEffectType type=null;
|
PotionEffectType type=null;
|
||||||
for (int i1=0;i1<p.getActivePotionEffects().size();i1++) {
|
for (int i1=0;i1<p.getActivePotionEffects().size();i1++) {
|
||||||
if (GenericFunctions.isBadEffect(Iterables.get(p.getActivePotionEffects(), i1).getType()) && Iterables.get(p.getActivePotionEffects(), i1).getDuration()>longestdur) {
|
if (GenericFunctions.isBadEffect(Iterables.get(p.getActivePotionEffects(), i1).getType()) && Iterables.get(p.getActivePotionEffects(), i1).getDuration()>longestdur) {
|
||||||
longestdur=Iterables.get(p.getActivePotionEffects(), i1).getDuration();
|
longestdur=Iterables.get(p.getActivePotionEffects(), i1).getDuration();
|
||||||
type=Iterables.get(p.getActivePotionEffects(), i1).getType();
|
type=Iterables.get(p.getActivePotionEffects(), i1).getType();
|
||||||
|
level=Iterables.get(p.getActivePotionEffects(), i1).getAmplifier();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Math.random()<=removechance/100) {
|
if (Math.random()<=removechance/100) {
|
||||||
|
if (!type.equals(PotionEffectType.WEAKNESS) || level<9) {
|
||||||
p.removePotionEffect(type);
|
p.removePotionEffect(type);
|
||||||
p.sendMessage(ChatColor.DARK_GRAY+"You successfully resisted the application of "+ChatColor.WHITE+GenericFunctions.CapitalizeFirstLetters(type.getName().replace("_", " ")));
|
p.sendMessage(ChatColor.DARK_GRAY+"You successfully resisted the application of "+ChatColor.WHITE+GenericFunctions.CapitalizeFirstLetters(type.getName().replace("_", " ")));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
pd.debuffcount=GenericFunctions.CountDebuffs(p);
|
pd.debuffcount=GenericFunctions.CountDebuffs(p);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user