Fix Ranger tumble.
This commit is contained in:
parent
4eae40adc8
commit
1db2164c3b
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
name: TwosideKeeper
|
name: TwosideKeeper
|
||||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||||
version: 3.6.2r2
|
version: 3.6.2-rangersop
|
||||||
commands:
|
commands:
|
||||||
money:
|
money:
|
||||||
description: Tells the player the amount of money they are holding.
|
description: Tells the player the amount of money they are holding.
|
||||||
|
@ -1956,7 +1956,7 @@ public class GenericFunctions {
|
|||||||
+ ChatColor.GRAY+"You have immunity to all Thorns damage.\n"
|
+ ChatColor.GRAY+"You have immunity to all Thorns damage.\n"
|
||||||
+ ChatColor.WHITE+"Shift-Left Click to change Bow Modes.\n"
|
+ ChatColor.WHITE+"Shift-Left Click to change Bow Modes.\n"
|
||||||
+ ChatColor.GRAY+"- Close Range Mode (Default): \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.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.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"
|
+ ChatColor.GRAY+"- Debilitation Mode:\n"
|
||||||
@ -2586,4 +2586,29 @@ public class GenericFunctions {
|
|||||||
return -1;
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1809,31 +1809,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check for a roll attempt here.
|
//Check for a roll attempt here.
|
||||||
if ((ev.getAction()==Action.LEFT_CLICK_AIR || ev.getAction()==Action.LEFT_CLICK_BLOCK ||
|
if ((ev.getAction()==Action.LEFT_CLICK_AIR || ev.getAction()==Action.LEFT_CLICK_BLOCK)) {
|
||||||
ev.getAction()==Action.PHYSICAL)) {
|
|
||||||
Player p = ev.getPlayer();
|
Player p = ev.getPlayer();
|
||||||
if (p.isSneaking() && p.isOnGround() && GenericFunctions.isRanger(p) &&
|
GenericFunctions.PerformDodge(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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check for a Scythe right click here.
|
//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.RESISTANCE,0);
|
||||||
ev.setDamage(DamageModifier.ARMOR,0);
|
ev.setDamage(DamageModifier.ARMOR,0);
|
||||||
|
|
||||||
|
GenericFunctions.PerformDodge(p);
|
||||||
|
|
||||||
//log("Player dealt "+ev.getDamage(),2);
|
//log("Player dealt "+ev.getDamage(),2);
|
||||||
|
|
||||||
if (m.getType()==EntityType.ZOMBIE &&
|
if (m.getType()==EntityType.ZOMBIE &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user