+> Fixed Ranger Mode issues and controls with Rangers not being able to

use their bow when cooldown meters were displayed.
+> Elite Monsters now gain 25% more health and 5% more base damage for
every player that joins after the 4th when fighting Elite Monsters.
>Party buff maximum cap reduced from 90% Bonus Damage/Defense to 60%
Bonus Damage/Defense Max.
>Fixed a bug causing Poison to kill players. This is unintended.
>Fixed a bug causing players in Slayer mode to not be revived properly.
>Fixed a bug causing players to be teleported above their revival
location on automatic buy-back thanks to the Sweet Candies.
testdev
sigonasr2 8 years ago
parent 464531b06e
commit 9b22eb4bb3
  1. BIN
      TwosideKeeper.jar
  2. 2
      src/plugin.yml
  3. 12
      src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java
  4. 63
      src/sig/plugin/TwosideKeeper/CustomDamage.java
  5. 18
      src/sig/plugin/TwosideKeeper/EliteMonster.java
  6. 43
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  7. 2
      src/sig/plugin/TwosideKeeper/HelperStructures/Utils/EntityUtils.java
  8. 2
      src/sig/plugin/TwosideKeeper/PartyManager.java
  9. 2
      src/sig/plugin/TwosideKeeper/PlayerStructure.java
  10. 33
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java

Binary file not shown.

@ -1,6 +1,6 @@
name: TwosideKeeper
main: sig.plugin.TwosideKeeper.TwosideKeeper
version: 3.10.1
version: 3.10.2
commands:
money:
description: Tells the player the amount of money they are holding.

@ -341,6 +341,11 @@ public class EliteZombie extends EliteMonster{
bar.setColor(BarColor.RED);
if (!targetlist.contains(damager) && (damager instanceof Player)) {
targetlist.add((Player)damager);
if (targetlist.size()>4) {
double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4));
m.setMaxHealth(baseHP+hpgain);
m.setHealth(m.getHealth()+hpgain);
}
}
if (!participantlist.contains(damager) && (damager instanceof Player)) {
participantlist.add((Player)damager);
@ -526,9 +531,9 @@ public class EliteZombie extends EliteMonster{
} else {
b.setType(storedblocks.get(b));
}
aPlugin.API.sendSoundlessExplosion(target_leap_loc, 4);
SoundUtils.playGlobalSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.7f, 1.2f);
}
aPlugin.API.sendSoundlessExplosion(target_leap_loc, 4);
storedblocks.clear();
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.7f, 1.2f);
List<Player> nearbyplayers = GenericFunctions.getNearbyPlayers(target_leap_loc, radius);
@ -549,6 +554,11 @@ public class EliteZombie extends EliteMonster{
public void hitEvent(LivingEntity ent) {
if (!targetlist.contains(ent) && (ent instanceof Player)) {
targetlist.add((Player)ent);
if (targetlist.size()>4) {
double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4));
m.setMaxHealth(baseHP+hpgain);
m.setHealth(m.getHealth()+hpgain);
}
}
if (Math.random()<=0.33) {
if (ent.hasPotionEffect(PotionEffectType.POISON)) {

@ -380,7 +380,11 @@ public class CustomDamage {
if (getDamagerEntity(damager) instanceof Player) {
Player p = (Player)getDamagerEntity(damager);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
return pd.partybonus*0.1;
if (pd.partybonus>6) {
return 6*0.1d;
} else {
return pd.partybonus*0.1;
}
}
return 0.0;
}
@ -513,13 +517,17 @@ public class CustomDamage {
removePermEnchantments(p,item);
}
damage = IncreaseDamageDealtByElites(p, damager, damage);
damage = calculateDefenderAbsorption(p, damager, damage, reason);
damage = sendDamageToDamagePool(p, damage, reason);
damage = modifyFateBasedOnHolidayTreats(p, damage);
if (GenericFunctions.AttemptRevive(p, damage, reason)) {
damage = preventPoisonDamageFromKilling(p, damage, reason);
if (damage>0 && GenericFunctions.AttemptRevive(p, damage, reason)) {
damage=0;
}
}
@ -688,6 +696,33 @@ public class CustomDamage {
return damage;
}
private static double IncreaseDamageDealtByElites(Player p, Entity damager, double damage) {
LivingEntity shooter = getDamagerEntity(damager);
if (shooter!=null) {
LivingEntityStructure les = LivingEntityStructure.getLivingEntityStructure(shooter);
if (les.isElite) {
for (EliteMonster bm : TwosideKeeper.elitemonsters) {
if (bm.getMonster().getUniqueId().equals(shooter.getUniqueId())) {
if (bm.getTargetList().size()>4) {
damage += damage*((bm.getTargetList().size()-4)*0.05);
}
}
}
}
}
return damage;
}
private static double preventPoisonDamageFromKilling(Player p, double damage, String reason) {
if (reason!=null && reason.equalsIgnoreCase("POISON") && p.getHealth()<=damage) {
p.setHealth(1);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.slayermodehp=1;
return 0;
}
return damage;
}
private static double modifyFateBasedOnHolidayTreats(Player p, double damage) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (pd.lastcandyconsumed+40<TwosideKeeper.getServerTickTime()) {
@ -702,8 +737,11 @@ public class CustomDamage {
RemoveOneItem(p.getInventory(),item,i);
Bukkit.broadcastMessage(ChatColor.GOLD+p.getName()+ChatColor.WHITE+" almost died... But came back to life!");
aPlugin.API.discordSendRawItalicized(ChatColor.GOLD+p.getName()+ChatColor.WHITE+" almost died... But came back to life!");
SoundUtils.playLocalSound(p, Sound.ENTITY_PLAYER_LEVELUP, 1.0f, 0.6f);
p.setHealth(p.getMaxHealth());
SoundUtils.playLocalSound(p, Sound.ENTITY_PLAYER_LEVELUP, 1.0f, 0.6f);
p.setHealth(p.getMaxHealth());
GenericFunctions.RevivePlayer(p,p.getMaxHealth());
ItemStack[] hotbar = GenericFunctions.getHotbarItems(p);
GenericFunctions.RandomlyBreakBaubles(p, hotbar);
consumed=true;
return 0;
}
@ -1477,9 +1515,6 @@ public class CustomDamage {
GenericFunctions.updateNoDamageTickMap(target, damager);
return true;
}
if (LowEnoughToResistPoison(target,reason)) {
return true;
}
if (isFlagSet(flags,IGNOREDODGE) || !PassesIframeCheck(target,damager)) {
@ -1524,7 +1559,7 @@ public class CustomDamage {
return attackrate;
}
private static boolean LowEnoughToResistPoison(LivingEntity target, String reason) {
private static boolean LowEnoughToResistPoison(LivingEntity target, double damage, String reason) {
TwosideKeeper.log("Target health: "+target.getHealth(), 5);
if (reason!=null && reason.equalsIgnoreCase("POISON") && target.getHealth()<=2) {
return true;
@ -1860,7 +1895,7 @@ public class CustomDamage {
Player p = (Player)target;
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
partylevel = pd.partybonus;
if (partylevel>9) {partylevel=9;}
if (partylevel>6) {partylevel=6;}
if (p.getLocation().getY()>=0) {TwosideKeeper.log("Light level: "+p.getLocation().add(0,0,0).getBlock().getLightLevel(),5);}
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getArmorContents()[i]) &&
@ -2265,7 +2300,7 @@ public class CustomDamage {
TwosideKeeper.log("We somehow made it to here???", 5);
Player p = (Player)proj.getShooter();
if (PlayerMode.isRanger(p) &&
GenericFunctions.getBowMode(weapon)==BowMode.SNIPE) {
GenericFunctions.getBowMode(p)==BowMode.SNIPE) {
aPlugin.API.sendSoundlessExplosion(arrowLoc, 1);
headshotvaly *= 4;
}
@ -2280,7 +2315,7 @@ public class CustomDamage {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (PlayerMode.isRanger(p) && GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE) {
if (PlayerMode.isRanger(p) && GenericFunctions.getBowMode(p)==BowMode.SNIPE) {
if (pd.headshotcombo<8) {pd.headshotcombo++;}
double headshotincrease = (2+(pd.headshotcombo*0.25));
mult+=headshotincrease;
@ -2321,7 +2356,7 @@ public class CustomDamage {
}
}
if (PlayerMode.isRanger(p) && GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.DEBILITATION) {
if (PlayerMode.isRanger(p) && GenericFunctions.getBowMode(p)==BowMode.DEBILITATION) {
if (m.hasPotionEffect(PotionEffectType.BLINDNESS) && isheadshot) {
//Add to the current stack of BLINDNESS.
for (PotionEffect pe : m.getActivePotionEffects()) {
@ -2458,7 +2493,7 @@ public class CustomDamage {
Player p = (Player)getDamagerEntity(damager);
if (GenericFunctions.HasFullRangerSet(p) &&
PlayerMode.isRanger(p) &&
GenericFunctions.getBowMode(weapon)==BowMode.SNIPE) {
GenericFunctions.getBowMode(p)==BowMode.SNIPE) {
critdmg+=1.0;
}
critdmg+=API.getPlayerBonuses(p).getBonusCriticalDamage();
@ -2575,7 +2610,7 @@ public class CustomDamage {
}
if (GenericFunctions.HasFullRangerSet(p) &&
PlayerMode.isRanger(p) &&
GenericFunctions.getBowMode(weapon)==BowMode.DEBILITATION) {
GenericFunctions.getBowMode(p)==BowMode.DEBILITATION) {
finaldmg += dmg*0.5;
}
finaldmg += API.getPlayerBonuses(p).getBonusArmorPenetration();

@ -50,6 +50,7 @@ public class EliteMonster {
protected boolean chasing=false;
protected boolean enraged=false;
protected boolean storingenergy=false;
public double baseHP = 0.0;
protected List<Player> targetlist = new ArrayList<Player>();
protected List<Player> participantlist = new ArrayList<Player>();
@ -63,6 +64,7 @@ public class EliteMonster {
this.myspawn=m.getLocation();
bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SEGMENTED_6, BarFlag.CREATE_FOG);
willpower_bar = m.getServer().createBossBar("Willpower", BarColor.PINK, BarStyle.SOLID, BarFlag.CREATE_FOG);
this.baseHP = m.getMaxHealth();
}
public void runTick() {
@ -214,6 +216,12 @@ public class EliteMonster {
bar.setColor(BarColor.GREEN);
m.setHealth(Math.min(m.getHealth()+1,m.getMaxHealth()));
}
if (m.getMaxHealth()>(baseHP+(baseHP*(0.25*((targetlist.size()>4)?(targetlist.size()-4):0))))) {
m.setMaxHealth((baseHP+(baseHP*(0.25*((targetlist.size()>4)?(targetlist.size()-4):0)))));
if (m.getHealth()>m.getMaxHealth()) {
m.setHealth(m.getMaxHealth());
}
}
}
public void runPlayerLeaveEvent(Player p) {
@ -227,6 +235,11 @@ public class EliteMonster {
bar.setColor(BarColor.RED);
if (!targetlist.contains(damager) && (damager instanceof Player)) {
targetlist.add((Player)damager);
if (targetlist.size()>4) {
double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4));
m.setMaxHealth(baseHP+hpgain);
m.setHealth(m.getHealth()+hpgain);
}
}
if (!participantlist.contains(damager) && (damager instanceof Player)) {
participantlist.add((Player)damager);
@ -263,6 +276,11 @@ public class EliteMonster {
public void hitEvent(LivingEntity ent) {
if (!targetlist.contains(ent) && (ent instanceof Player)) {
targetlist.add((Player)ent);
if (targetlist.size()>4) {
double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4));
m.setMaxHealth(baseHP+hpgain);
m.setHealth(m.getHealth()+hpgain);
}
}
}

@ -2571,8 +2571,9 @@ public class GenericFunctions {
return pd.hasfullrangerset;*/
}
public static ItemStack applyModeName(ItemStack item) {
if (item!=null &&
@Deprecated
public static void applyModeName(ItemStack item) {
/*if (item!=null &&
item.getType()!=Material.AIR &&
item.hasItemMeta()) {
ItemMeta m = item.getItemMeta();
@ -2599,12 +2600,12 @@ public class GenericFunctions {
ItemMeta m = item.getItemMeta();
String newname = UserFriendlyMaterialName(item)+" "+ChatColor.GREEN+"("+CapitalizeFirstLetters(getBowMode(item).GetCoolName())+" Mode)"+ChatColor.WHITE;
m.setDisplayName(newname);
item.setItemMeta(m);
return item;
item.setItemMeta(m);*/
//return item;
}
public static BowMode getBowMode(ItemStack item) {
if (item!=null &&
public static BowMode getBowMode(Player p) {
/*if (item!=null &&
item.getType()!=Material.AIR &&
item.hasItemMeta()) {
if (!item.getItemMeta().hasLore()) {
@ -2621,11 +2622,13 @@ public class GenericFunctions {
}
} else {
return BowMode.CLOSE;
}
}*/
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
return pd.rangermode;
}
public static ItemStack setBowMode(ItemStack item, BowMode mode) {
if (item!=null &&
public static void setBowMode(Player p, BowMode mode) {
/*if (item!=null &&
item.getType()!=Material.AIR &&
item.hasItemMeta()) {
ItemMeta m = item.getItemMeta();
@ -2650,6 +2653,10 @@ public class GenericFunctions {
}
}
return item;
*/
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.rangermode = mode;
GenericFunctions.sendActionBarMessage(p, ChatColor.BLUE+"Bow Mode: "+ChatColor.GOLD+mode.GetCoolName()+" Mode"+ChatColor.RESET, true);
}
public static void AutoRepairItems(Player p) {
@ -2783,7 +2790,7 @@ public class GenericFunctions {
@SuppressWarnings("deprecation")
public static void PerformDodge(Player p) {
if (p.isOnGround() && PlayerMode.isRanger(p) &&
(GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.CLOSE)) {
(GenericFunctions.getBowMode(p)==BowMode.CLOSE)) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (pd.last_dodge+GetModifiedCooldown(TwosideKeeper.DODGE_COOLDOWN,p)<=TwosideKeeper.getServerTickTime()) {
PlayerTumbleEvent ev = new PlayerTumbleEvent(p);
@ -3447,6 +3454,7 @@ public class GenericFunctions {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.lastdamagetaken=dmg;
pd.lasthitdesc=reason;
pd.slayermodehp = p.getMaxHealth();
ItemStack[] equips = p.getEquipment().getArmorContents();
ItemStack[] hotbar = GenericFunctions.getHotbarItems(p);
@ -3455,7 +3463,6 @@ public class GenericFunctions {
pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN, p)<=TwosideKeeper.getServerTickTime()) {
pd.lastlifesavertime=TwosideKeeper.getServerTickTime();
RevivePlayer(p,p.getMaxHealth());
pd.slayermodehp = p.getMaxHealth();
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {GenericFunctions.applyStealth(p,false);}
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED, 20*10, 3, p, true);
deAggroNearbyTargets(p);
@ -3489,7 +3496,7 @@ public class GenericFunctions {
return revived;
}
private static void RandomlyBreakBaubles(Player p, ItemStack[] hotbar) {
public static void RandomlyBreakBaubles(Player p, ItemStack[] hotbar) {
for (int i=0;i<9;i++) {
ItemSet set = ItemSet.GetSet(hotbar[i]);
if (set!=null) {
@ -3529,8 +3536,8 @@ public class GenericFunctions {
}
}
private static void RevivePlayer(Player p, double healdmg) {
p.setHealth(healdmg);
public static void RevivePlayer(Player p, double healdmg) {
p.setHealth(Math.min(healdmg,p.getMaxHealth()));
SoundUtils.playLocalSound(p, Sound.BLOCK_REDSTONE_TORCH_BURNOUT, 1.0f, 1.5f);
for (PotionEffect eff : p.getActivePotionEffects()) {
if (isBadEffect(eff.getType())) {
@ -3540,6 +3547,8 @@ public class GenericFunctions {
}, 1);
}
}
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.slayermodehp = Math.min(healdmg,p.getMaxHealth());
p.setFireTicks(0);
CustomDamage.addIframe(40, p);
//p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,20,0));
@ -4473,7 +4482,7 @@ public class GenericFunctions {
finalmsg=message+" "+prefix;
if (important || (pd.lastimportantactionbarmsg+20<TwosideKeeper.getServerTickTime())) {
//TwosideKeeper.log("["+TwosideKeeper.getServerTickTime()+"] Sent Message", 0);
if (prefix.length()>0) {
if (prefix.length()>0 || aPlugin.API.getLastXPBar(p).length() > 2) {
aPlugin.API.sendActionBarMessage(p, String.format(aPlugin.API.getLastXPBar(p), finalmsg));
} else {
if (message.length()>0) {
@ -4666,7 +4675,7 @@ public class GenericFunctions {
@SuppressWarnings("deprecation")
public static void PerformArrowBarrage(Player p) {
if (p.isOnGround() && PlayerMode.isRanger(p) &&
(GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE)) {
(GenericFunctions.getBowMode(p)==BowMode.SNIPE)) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (pd.last_arrowbarrage+GetModifiedCooldown(TwosideKeeper.ARROWBARRAGE_COOLDOWN,p)<=TwosideKeeper.getServerTickTime()) {
pd.last_arrowbarrage=TwosideKeeper.getServerTickTime();
@ -4679,7 +4688,7 @@ public class GenericFunctions {
@SuppressWarnings("deprecation")
public static void PerformSiphon(Player p) {
if (p.isOnGround() && PlayerMode.isRanger(p) &&
(GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.DEBILITATION)) {
(GenericFunctions.getBowMode(p)==BowMode.DEBILITATION)) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (pd.last_siphon+GetModifiedCooldown(TwosideKeeper.SIPHON_COOLDOWN,p)<=TwosideKeeper.getServerTickTime()) {
List<LivingEntity> list = GenericFunctions.getNearbyMobs(p.getLocation(), 16);

@ -29,7 +29,7 @@ public class EntityUtils {
for (Entity e : ents) {
if (e instanceof LivingEntity) {
LivingEntityDifficulty diff = MonsterController.getLivingEntityDifficulty((LivingEntity)e);
if (e.getType()==type && !strongest.isStronger(diff)) {
if (e!=null && e.getType()==type && (strongest==null || !strongest.isStronger(diff))) {
strongest = diff;
}
}

@ -90,7 +90,7 @@ public class PartyManager {
int membercount = partymembers.size();
StringBuilder partydisplay = new StringBuilder("");
if (membercount>=2) {
int dmgbonus=((membercount-1)<10)?(membercount-1)*10:90;
int dmgbonus=((membercount-1)<6)?(membercount-1)*10:60;
partydisplay.append(" +"+dmgbonus+"%DMG/DEF");
}
return partydisplay.toString();

@ -21,6 +21,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.potion.PotionEffect;
import sig.plugin.TwosideKeeper.HelperStructures.BowMode;
import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure;
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
import sig.plugin.TwosideKeeper.HelperStructures.ServerType;
@ -156,6 +157,7 @@ public class PlayerStructure {
public long lastsneak=0;
public long lastcombat=0;
public long lastsantabox=0;
public BowMode rangermode=BowMode.CLOSE;
public boolean isPlayingSpleef=false;

@ -1073,6 +1073,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
case "WITHER":{
LivingEntity m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.WITHER), MonsterDifficulty.ELITE);
}break;
case "ELITE":{
LivingEntity m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.ZOMBIE), MonsterDifficulty.ELITE);
}break;
case "VACUUM":{
ItemStack[] remaining = InventoryUtils.insertItemsInVacuumCube(p, new ItemStack(Material.ENDER_PEARL,16), new ItemStack(Material.IRON_PICKAXE,1), new ItemStack(Material.GOLDEN_APPLE,64));
for (ItemStack items : remaining) {
@ -2636,7 +2639,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (PlayerMode.isRanger(p) && p.isSneaking() && p.getEquipment().getItemInMainHand().getType()==Material.BOW) {
//Rotate Bow Modes.
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.SLOW,p);
BowMode mode = GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand());
BowMode mode = GenericFunctions.getBowMode(p);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (ev.getAction().name().contains("RIGHT")) {
if (pd.lastbowmodeswitch+6>=getServerTickTime()) {
@ -2645,17 +2648,17 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
switch (mode) {
case CLOSE:{
SoundUtils.playLocalSound(p, Sound.ENTITY_ZOMBIE_INFECT, 0.5f, 0.1f);
GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.SNIPE);
GenericFunctions.setBowMode(p,BowMode.SNIPE);
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_arrowbarrage, ARROWBARRAGE_COOLDOWN));
}break;
case SNIPE:{
SoundUtils.playLocalSound(p, Sound.BLOCK_BREWING_STAND_BREW, 0.5f, 0.1f);
GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.DEBILITATION);
GenericFunctions.setBowMode(p,BowMode.DEBILITATION);
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_siphon, SIPHON_COOLDOWN));
}break;
case DEBILITATION:{
SoundUtils.playLocalSound(p, Sound.BLOCK_CHEST_LOCKED, 0.5f, 3.5f);
GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.CLOSE);
GenericFunctions.setBowMode(p,BowMode.CLOSE);
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_dodge, DODGE_COOLDOWN));
}break;
}
@ -2667,24 +2670,28 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
switch (mode) {
case CLOSE:{
SoundUtils.playLocalSound(p, Sound.BLOCK_BREWING_STAND_BREW, 0.5f, 0.1f);
GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.DEBILITATION);
GenericFunctions.setBowMode(p,BowMode.DEBILITATION);
//GenericFunctions.applyModeName(p.getEquipment().getItemInMainHand());
p.updateInventory();
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_siphon, SIPHON_COOLDOWN));
}break;
case SNIPE:{
SoundUtils.playLocalSound(p, Sound.BLOCK_CHEST_LOCKED, 0.5f, 3.5f);
GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.CLOSE);
GenericFunctions.setBowMode(p,BowMode.CLOSE);
//GenericFunctions.applyModeName(p.getEquipment().getItemInMainHand());
p.updateInventory();
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_dodge, DODGE_COOLDOWN));
}break;
case DEBILITATION:{
SoundUtils.playLocalSound(p, Sound.ENTITY_ZOMBIE_INFECT, 0.5f, 0.1f);
GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.SNIPE);
GenericFunctions.setBowMode(p,BowMode.SNIPE);
//GenericFunctions.applyModeName(p.getEquipment().getItemInMainHand());
p.updateInventory();
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_arrowbarrage, ARROWBARRAGE_COOLDOWN));
}break;
}
pd.lastbowmodeswitch=getServerTickTime();
}
GenericFunctions.applyModeName(p.getEquipment().getItemInMainHand());
p.updateInventory();
ev.setCancelled(true);
return;
}
@ -5658,7 +5665,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId());
if (PlayerMode.isRanger(p) &&
GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.CLOSE) {
GenericFunctions.getBowMode(p)==BowMode.CLOSE) {
pd.fulldodge=true;
}
@ -5782,7 +5789,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
}
if (isRanger) {
switch (GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())) {
switch (GenericFunctions.getBowMode(p)) {
case CLOSE:{
BowLogger.AddCloseMode();
}break;
@ -7006,7 +7013,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
if (PlayerMode.isRanger(p)) {
LivingEntity findtarget = aPlugin.API.rayTraceTargetEntity(p,100);
if (GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE) {
if (GenericFunctions.getBowMode(p)==BowMode.SNIPE) {
if (findtarget==null || !p.hasLineOfSight(findtarget)) {
arr.setVelocity(arr.getVelocity().multiply(1000));
} else {
@ -7023,7 +7030,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId());
pd.lastarrowpower=arr.getVelocity().lengthSquared();
pd.lastarrowwasinrangermode=(PlayerMode.isRanger(p)&&GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE);
pd.lastarrowwasinrangermode=(PlayerMode.isRanger(p)&&GenericFunctions.getBowMode(p)==BowMode.SNIPE);
log("Arrow velocity is "+arr.getVelocity().lengthSquared(),5);
arr.setCustomName("HIT");
if (arr.hasMetadata("INFINITEARROW")) {

Loading…
Cancel
Save