diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 1991892..7c57137 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index 571c479..95d8b20 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.6.2r2 +version: 3.6.2-rangersop commands: money: description: Tells the player the amount of money they are holding. diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index dcac174..4e4a02a 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -1956,7 +1956,7 @@ public class GenericFunctions { + ChatColor.GRAY+"You have immunity to all Thorns damage.\n" + ChatColor.WHITE+"Shift-Left Click to change Bow Modes.\n" + ChatColor.GRAY+"- Close Range Mode (Default): \n" - + ChatColor.WHITE+" You gain the ability to deal headshots from any distance, even directly onto an enemy's face. (Old headshot behavior)\n" + + ChatColor.WHITE+" You gain the ability to deal headshots from any distance, even directly onto an enemy's face. Each kill made in this mode gives you 100% dodge chance for the next hit taken. You can tumble and gain invulnerability for 1 second by pressing shift + left-click.\n" + ChatColor.GRAY+"- Sniping Mode: \n" + ChatColor.WHITE+" Headshot collision area increases by x3. Headshots will deal an extra x0.25 damage for each headshot landed, up to a cap of 8 stacks. Each stack also increases your Slowness level by 1.\n" + ChatColor.GRAY+"- Debilitation Mode:\n" @@ -2586,4 +2586,29 @@ public class GenericFunctions { return -1; } } + + public static void PerformDodge(Player p) { + if (p.isSneaking() && p.isOnGround() && GenericFunctions.isRanger(p) && + GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.CLOSE) { + PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(p.getUniqueId()); + if (pd.last_dodge+100<=TwosideKeeper.getServerTickTime()) { + pd.last_dodge=TwosideKeeper.getServerTickTime(); + aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), 100); + aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), 100); + p.playSound(p.getLocation(), Sound.ENTITY_DONKEY_CHEST, 1.0f, 1.0f); + + int dodgeduration = 20; + + if (GenericFunctions.HasFullRangerSet(p)) { + dodgeduration=60; + } + + p.setVelocity(p.getLocation().getDirection().multiply(1.4f)); + + p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,dodgeduration,0)); + p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,dodgeduration,2)); + p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,dodgeduration,0)); + } + } + } } diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index a9f79b0..f4b8653 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -1809,31 +1809,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } //Check for a roll attempt here. - if ((ev.getAction()==Action.LEFT_CLICK_AIR || ev.getAction()==Action.LEFT_CLICK_BLOCK || - ev.getAction()==Action.PHYSICAL)) { + if ((ev.getAction()==Action.LEFT_CLICK_AIR || ev.getAction()==Action.LEFT_CLICK_BLOCK)) { Player p = ev.getPlayer(); - if (p.isSneaking() && p.isOnGround() && GenericFunctions.isRanger(p) && - GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.CLOSE) { - PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId()); - if (pd.last_dodge+100<=getServerTickTime()) { - pd.last_dodge=getServerTickTime(); - aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), 100); - aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), 100); - p.playSound(p.getLocation(), Sound.ENTITY_DONKEY_CHEST, 1.0f, 1.0f); - - int dodgeduration = 20; - - if (GenericFunctions.HasFullRangerSet(p)) { - dodgeduration=60; - } - - p.setVelocity(p.getLocation().getDirection().multiply(1.4f)); - - p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,dodgeduration,0)); - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,dodgeduration,2)); - p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,dodgeduration,0)); - } - } + GenericFunctions.PerformDodge(p); } //Check for a Scythe right click here. @@ -3842,6 +3820,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { ev.setDamage(DamageModifier.RESISTANCE,0); ev.setDamage(DamageModifier.ARMOR,0); + GenericFunctions.PerformDodge(p); + //log("Player dealt "+ev.getDamage(),2); if (m.getType()==EntityType.ZOMBIE &&