diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 6b88cd5..51ea6af 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index 057386f..6eb3a4d 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.8.1r1 +version: 3.8.2 commands: money: description: Tells the player the amount of money they are holding. diff --git a/src/sig/plugin/TwosideKeeper/AutoUpdatePlugin.java b/src/sig/plugin/TwosideKeeper/AutoUpdatePlugin.java index 6e9e9ad..d4f4e94 100644 --- a/src/sig/plugin/TwosideKeeper/AutoUpdatePlugin.java +++ b/src/sig/plugin/TwosideKeeper/AutoUpdatePlugin.java @@ -69,22 +69,27 @@ public class AutoUpdatePlugin implements Runnable { if ((plugins.get(i).hash==null || !md5.equalsIgnoreCase(plugins.get(i).hash))) { //This plugin is different! Update the hash for it. Prepare for a restart of the server! - if (!TwosideKeeper.restarting_server) { - if (Bukkit.getOnlinePlayers().size()!=0) { - DiscordMessageSender.sendItalicizedRawMessageDiscord("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+". The server will restart in 3 minutes!"); - Bukkit.broadcastMessage("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+". The server will restart in 3 minutes!\n\n"+ChatColor.GRAY+ChatColor.ITALIC+"If all players leave, the update will occur immediately."); - } else { - DiscordMessageSender.sendItalicizedRawMessageDiscord("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+"."); - Bukkit.broadcastMessage("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+"."+ChatColor.GRAY+ChatColor.ITALIC+"If all players leave, the update will occur immediately."); - } - restarting=true; - TwosideKeeper.restarting_server=true; - //Save the new plugin hash. - - } else { - DiscordMessageSender.sendItalicizedRawMessageDiscord("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+"."); - Bukkit.broadcastMessage("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+"."+ChatColor.GRAY+ChatColor.ITALIC+"If all players leave, the update will occur immediately."); - } + final int ii=i; + Bukkit.getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("TwosideKeeper"), new Runnable() { + @Override + public void run() { + if (!TwosideKeeper.restarting_server) { + if (Bukkit.getOnlinePlayers().size()!=0) { + DiscordMessageSender.sendItalicizedRawMessageDiscord("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(ii).name+". The server will restart in 3 minutes!"); + Bukkit.broadcastMessage("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(ii).name+". The server will restart in 3 minutes!\n\n"+ChatColor.GRAY+ChatColor.ITALIC+"If all players leave, the update will occur immediately."); + } else { + DiscordMessageSender.sendItalicizedRawMessageDiscord("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(ii).name+"."); + Bukkit.broadcastMessage("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(ii).name+"."+ChatColor.GRAY+ChatColor.ITALIC+"If all players leave, the update will occur immediately."); + } + restarting=true; + TwosideKeeper.restarting_server=true; + //Save the new plugin hash. + + } else { + DiscordMessageSender.sendItalicizedRawMessageDiscord("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(ii).name+"."); + Bukkit.broadcastMessage("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(ii).name+"."+ChatColor.GRAY+ChatColor.ITALIC+"If all players leave, the update will occur immediately."); + } + }},1); TwosideKeeper.log("New hash: "+md5, 2); plugins.get(i).hash = md5; SaveHash(plugins.get(i)); diff --git a/src/sig/plugin/TwosideKeeper/EliteMonster.java b/src/sig/plugin/TwosideKeeper/EliteMonster.java index aec2fb7..ac6c465 100644 --- a/src/sig/plugin/TwosideKeeper/EliteMonster.java +++ b/src/sig/plugin/TwosideKeeper/EliteMonster.java @@ -25,6 +25,7 @@ import org.bukkit.entity.FallingBlock; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionEffect; @@ -33,6 +34,7 @@ import org.bukkit.potion.PotionType; import org.bukkit.util.Vector; import org.inventivetalent.glow.GlowAPI; +import sig.plugin.TwosideKeeper.HelperStructures.Loot; import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty; import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; @@ -152,6 +154,7 @@ public class EliteMonster { if (Math.random()<=0.2 && !p.isOnGround()) { //p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*5,-31)); p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,20*5,-1)); + p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10*1,7)); m.setTarget(p); p.setFlying(false); p.setVelocity(new Vector(0,-1,0)); @@ -228,7 +231,7 @@ public class EliteMonster { public void run() { m.teleport(l.getLocation().add(Math.random(),Math.random(),Math.random())); l.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,20*5,7)); - l.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,20*5,7)); + l.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10*1,7)); chasing=false; } },20*2); @@ -255,6 +258,10 @@ public class EliteMonster { m.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,Integer.MAX_VALUE,8),true); m.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE,Integer.MAX_VALUE,8),true); //m.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,Integer.MAX_VALUE,2),true); + ItemStack helm = new ItemStack(Material.GOLD_HELMET); + m.getEquipment().setHelmet(helm); + m.getEquipment().setHelmet(Loot.GenerateMegaPiece(helm.getType(), true, true, 1)); + m.getEquipment().setHelmetDropChance(1.0f); if (!enraged) { if (m.hasPotionEffect(PotionEffectType.INCREASE_DAMAGE)) { m.removePotionEffect(PotionEffectType.INCREASE_DAMAGE); @@ -268,6 +275,10 @@ public class EliteMonster { if (!targetlist.contains(damager) && (damager instanceof Player)) { targetlist.add((Player)damager); } + if (damager instanceof Player) { + Player p = (Player)damager; + p.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS,20*2,9)); + } last_regen_time=TwosideKeeper.getServerTickTime(); double randomrate = 0d; if (!chasing && NewCombat.getPercentHealthRemaining(m)<=50) { @@ -290,7 +301,7 @@ public class EliteMonster { Player target = ChooseRandomTarget(); if (target!=null) { if (last_storingenergy_health-m.getHealth()>0) { - storingenergy_hit=(last_storingenergy_health-m.getHealth())*90d; + storingenergy_hit=(last_storingenergy_health-m.getHealth())*1000d; for (int i=0;i0) { - return targetlist.get((int)(Math.random() * targetlist.size())); + Player p = targetlist.get((int)(Math.random() * targetlist.size())); + p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10*1,7)); + m.setTarget(p); + return p; } else { return null; } @@ -463,7 +477,7 @@ public class EliteMonster { p.playSound(p.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f); p.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION,20*4,0)); TwosideKeeper.log("Got hit for "+storingenergy_hit+" damage!", 2); - GenericFunctions.DealDamageToMob(NewCombat.CalculateDamageReduction(storingenergy_hit,p,m),p,m); + TwosideKeeperAPI.DealDamageToEntity(NewCombat.CalculateDamageReduction(storingenergy_hit,p,m),p,m); storingenergy_hit=0; } } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 7b5c279..3bf34c8 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -22,6 +22,7 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.ExperienceOrb; import org.bukkit.entity.Guardian; +import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; @@ -62,6 +63,7 @@ import sig.plugin.TwosideKeeper.MonsterStructure; import sig.plugin.TwosideKeeper.NewCombat; import sig.plugin.TwosideKeeper.PlayerStructure; import sig.plugin.TwosideKeeper.TwosideKeeper; +import sig.plugin.TwosideKeeper.TwosideKeeperAPI; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility; import sig.plugin.TwosideKeeper.HelperStructures.BowMode; import sig.plugin.TwosideKeeper.HelperStructures.ItemSet; @@ -2643,15 +2645,20 @@ public class GenericFunctions { NewCombat.addToPlayerLogger(damager,reason,dmg); NewCombat.addToLoggerTotal(damager, dmg); } + if (target!=null) { + (target).setLastDamage(0); + (target).setNoDamageTicks(0); + (target).setMaximumNoDamageTicks(0); + } if (shooter!=null) { if (!(shooter instanceof Monster) || !(target instanceof Monster)) { TwosideKeeper.log(GenericFunctions.GetEntityDisplayName(shooter)+"->"+ - GenericFunctions.GetEntityDisplayName(target)+ChatColor.WHITE+": Damage dealt was "+dmg,4); + GenericFunctions.GetEntityDisplayName(target)+ChatColor.WHITE+": Damage dealt was "+dmg,3); } } else { if (!(target instanceof Monster)) { TwosideKeeper.log(reason+"->"+ - GenericFunctions.GetEntityDisplayName(target)+ChatColor.WHITE+": Damage dealt was "+dmg,4); + GenericFunctions.GetEntityDisplayName(target)+ChatColor.WHITE+": Damage dealt was "+dmg,3); } } double oldhp=((LivingEntity)target).getHealth(); @@ -2690,8 +2697,8 @@ public class GenericFunctions { ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, item)) { TwosideKeeper.log("Found one.",5); int tier = item.getEnchantmentLevel(Enchantment.LUCK); - item = ArtifactAbility.downgradeEnchantment(p, item, ArtifactAbility.GREED); - if (Math.random()<=((16-tier)*0.1d)/100d) {p.sendMessage(ChatColor.DARK_AQUA+"A level of "+ChatColor.YELLOW+"Greed"+ChatColor.DARK_AQUA+" has been knocked off of your "+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():UserFriendlyMaterialName(item))); + if (Math.random()<=((16-tier)*0.1d)/100d) { + item = ArtifactAbility.downgradeEnchantment(p, item, ArtifactAbility.GREED);p.sendMessage(ChatColor.DARK_AQUA+"A level of "+ChatColor.YELLOW+"Greed"+ChatColor.DARK_AQUA+" has been knocked off of your "+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():UserFriendlyMaterialName(item))); brokeone=true; break; } @@ -2702,9 +2709,10 @@ public class GenericFunctions { ItemStack item = p.getEquipment().getItemInMainHand(); if (isArtifactEquip(item) && ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, item)) { - int tier = item.getEnchantmentLevel(Enchantment.LUCK); + int tier = item.getEnchantmentLevel(Enchantment.LUCK); + if (Math.random()<=((16-tier)*0.1d)/100d) { item = ArtifactAbility.downgradeEnchantment(p, item, ArtifactAbility.GREED); - if (Math.random()<=((11-tier)*5)/100d) {p.sendMessage(ChatColor.DARK_AQUA+"A level of "+ChatColor.YELLOW+"Greed"+ChatColor.DARK_AQUA+" has been knocked off of your "+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():UserFriendlyMaterialName(item))); + p.sendMessage(ChatColor.DARK_AQUA+"A level of "+ChatColor.YELLOW+"Greed"+ChatColor.DARK_AQUA+" has been knocked off of your "+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():UserFriendlyMaterialName(item))); brokeone=true; } } @@ -3338,11 +3346,11 @@ public class GenericFunctions { } } - public static void DealDamageToNearbyPlayers(Location l, double basedmg, int range) { - DealDamageToNearbyPlayers(l,basedmg,range,false,0); + public static void DealDamageToNearbyPlayers(Location l, double basedmg, int range, Entity damager) { + DealDamageToNearbyPlayers(l,basedmg,range,false,0,damager); } - public static void DealDamageToNearbyPlayers(Location l, double basedmg, int range, boolean knockup, double knockupamt) { + public static void DealDamageToNearbyPlayers(Location l, double basedmg, int range, boolean knockup, double knockupamt, Entity damager) { List nearbyentities = new ArrayList(); nearbyentities.addAll(l.getWorld().getNearbyEntities(l, range, range, range)); for (int i=0;idodgechance) { TwosideKeeper.log("Dealt "+basedmg+" raw damage.", 5); - DealDamageToMob(NewCombat.CalculateDamageReduction(basedmg,p,null),(LivingEntity)nearbyentities.get(i),null,null,"Slam"); + //DealDamageToMob(NewCombat.CalculateDamageReduction(basedmg,p,null),(LivingEntity)nearbyentities.get(i),null,null,"Slam"); + TwosideKeeperAPI.DealDamageToEntity(NewCombat.CalculateDamageReduction(basedmg,p,null), (Player)nearbyentities.get(i), damager); if (knockup) { p.setVelocity(new Vector(0,knockupamt,0)); } @@ -3465,9 +3474,28 @@ public class GenericFunctions { b.getType()==Material.LAVA || b.getType()==Material.NETHERRACK || b.getType()==Material.ENDER_STONE || - b.getType()==Material.COBBLESTONE) { + b.getType()==Material.COBBLESTONE || + b.getType()==Material.LOG || + b.getType()==Material.LOG_2 || + b.getType()==Material.LEAVES || + b.getType()==Material.LEAVES_2 || + b.getType()==Material.STATIONARY_LAVA || + b.getType()==Material.STATIONARY_WATER) { return true; } return false; } + + public static boolean giveItem(Player p, ItemStack... items) { + HashMap remaining = p.getInventory().addItem(items); + if (remaining.isEmpty()) { + return true; + } else { + for (Integer i : remaining.keySet()) { + Item it = p.getWorld().dropItem(p.getLocation(), remaining.get(i)); + it.setInvulnerable(true); + } + return false; + } + } } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java b/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java index 71a54fe..5148731 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java @@ -15,8 +15,8 @@ import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; public enum ItemSet { PANROS(1,1, 3,2, 10,10, 20,10), - SONGSTEEL(4,4, 6,2, 8,4, 20,10), - DAWNTRACKER(3,2, 2,1, 6,4, 4,2), + SONGSTEEL(4,2, 6,2, 8,4, 20,10), + DAWNTRACKER(4,4, 6,4, 20,20, 20,20), LORASYS(0,0, 0,0, 0,0, 0,0); int baseval; @@ -194,12 +194,12 @@ public enum ItemSet { case SONGSTEEL:{ lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear"); lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Songsteel Set"); - lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+" Health"); + lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+"% Block Chance"); }break; case DAWNTRACKER:{ lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear"); lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Dawntracker Set"); - lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+"% Lifesteal"); + lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+" Health"); }break; case LORASYS:{ lore.add(ChatColor.LIGHT_PURPLE+"Slayer Gear"); @@ -234,8 +234,8 @@ public enum ItemSet { case DAWNTRACKER:{ lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:"); lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+" Damage"); - lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Lifesteal"); - lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+" Damage"); + lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Debuff Resistance"); + lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+"% Lifesteal"); lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Powered Mock"); lore.add(ChatColor.GRAY+" Mock debuff duration increases from"); lore.add(ChatColor.GRAY+" 10->20 seconds, making it stackable."); diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java b/src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java index 0a18fae..b3371b9 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java @@ -182,40 +182,23 @@ public enum MonsterDifficulty { ), ELITE( new LootStructure[]{ //Common Loot - new LootStructure(Material.EMERALD_BLOCK), - new LootStructure(Material.DIAMOND_BLOCK), - new LootStructure(Material.GOLD_BLOCK), - new LootStructure(Material.REDSTONE_BLOCK), - new LootStructure(Material.IRON_BLOCK), - new LootStructure(Material.LAPIS_BLOCK), - new LootStructure(Material.BOW, false), - new LootStructure(Material.FISHING_ROD, false), - new LootStructure(Material.DIAMOND_SWORD, false), - new LootStructure(Material.DIAMOND_AXE, false), - new LootStructure(Material.DIAMOND_PICKAXE, false), - new LootStructure(Material.DIAMOND_HOE, false), - new LootStructure(Material.DIAMOND_SPADE, false), - new LootStructure(Material.DIAMOND_CHESTPLATE, false), - new LootStructure(Material.DIAMOND_LEGGINGS, false), - new LootStructure(Material.DIAMOND_BOOTS, false), - new LootStructure(Material.DIAMOND_HELMET, false), + new LootStructure(Material.EMERALD), + new LootStructure(Material.DIAMOND), + new LootStructure(Material.GOLD_INGOT), + new LootStructure(Material.REDSTONE), + new LootStructure(Material.IRON_INGOT), new LootStructure(Material.LEATHER_HELMET,3), new LootStructure(Material.LEATHER_CHESTPLATE,3), new LootStructure(Material.LEATHER_LEGGINGS,3), new LootStructure(Material.LEATHER_BOOTS,3), }, new LootStructure[]{ //Rare Loot - new LootStructure(Material.BOW, false), - new LootStructure(Material.FISHING_ROD, true), - new LootStructure(Material.GOLD_SWORD, true, 1), - new LootStructure(Material.GOLD_AXE, true, 1), - new LootStructure(Material.GOLD_PICKAXE, true, 1), - new LootStructure(Material.GOLD_HOE, true, 1), - new LootStructure(Material.GOLD_SPADE, true, 1), - new LootStructure(Material.GOLD_CHESTPLATE, true, 1), - new LootStructure(Material.GOLD_LEGGINGS, true, 1), - new LootStructure(Material.GOLD_BOOTS, true, 1), - new LootStructure(Material.GOLD_HELMET, true, 1), + new LootStructure(Material.EMERALD_BLOCK), + new LootStructure(Material.DIAMOND_BLOCK), + new LootStructure(Material.GOLD_BLOCK), + new LootStructure(Material.REDSTONE_BLOCK), + new LootStructure(Material.IRON_BLOCK), + new LootStructure(Material.LAPIS_BLOCK), new LootStructure(Material.LEATHER_HELMET,4), new LootStructure(Material.LEATHER_CHESTPLATE,4), new LootStructure(Material.LEATHER_LEGGINGS,4), @@ -224,15 +207,6 @@ public enum MonsterDifficulty { new LootStructure[]{ //Legendary Loot new LootStructure(Material.PRISMARINE_SHARD), new LootStructure(Material.POTION), - new LootStructure(Material.GOLD_SWORD, true, 2), - new LootStructure(Material.GOLD_AXE, true, 2), - new LootStructure(Material.GOLD_PICKAXE, true, 2), - new LootStructure(Material.GOLD_HOE, true, 2), - new LootStructure(Material.GOLD_SPADE, true, 2), - new LootStructure(Material.GOLD_CHESTPLATE, true, 2), - new LootStructure(Material.GOLD_LEGGINGS, true, 2), - new LootStructure(Material.GOLD_BOOTS, true, 2), - new LootStructure(Material.GOLD_HELMET, true, 2), } ); diff --git a/src/sig/plugin/TwosideKeeper/MonsterController.java b/src/sig/plugin/TwosideKeeper/MonsterController.java index d797bfe..9f9278d 100644 --- a/src/sig/plugin/TwosideKeeper/MonsterController.java +++ b/src/sig/plugin/TwosideKeeper/MonsterController.java @@ -534,6 +534,7 @@ public class MonsterController { m.getEquipment().setChestplateDropChance(1.0f); m.getEquipment().setLeggingsDropChance(1.0f); m.getEquipment().setHelmetDropChance(1.0f); + m.getEquipment().setItemInMainHandDropChance(1.0f); }break; default:{ if (Math.random()<0.1) { @@ -757,7 +758,7 @@ public class MonsterController { SetupCustomName(ChatColor.DARK_PURPLE+"Elite",m); //m.setCustomName(ChatColor.DARK_AQUA+"Dangerous Mob"); //m.setCustomNameVisible(true); - m.setMaxHealth(m.getHealth()*60.0); + m.setMaxHealth(4800); m.setHealth(m.getMaxHealth()); GlowAPI.setGlowing(m, Color.DARK_PURPLE, Bukkit.getOnlinePlayers()); if (isAllowedToEquipItems(m)) { diff --git a/src/sig/plugin/TwosideKeeper/NewCombat.java b/src/sig/plugin/TwosideKeeper/NewCombat.java index 9c807f1..3c2cb55 100644 --- a/src/sig/plugin/TwosideKeeper/NewCombat.java +++ b/src/sig/plugin/TwosideKeeper/NewCombat.java @@ -120,8 +120,8 @@ public class NewCombat { if (shooter!=null) { totaldmg += calculateMobBaseDamage((LivingEntity)shooter, target); - //totaldmg += CalculateWeaponDamage(shooter, target); - bonusmult *= calculateMonsterDifficultyMultiplier(shooter); + totaldmg += CalculateWeaponDamage(shooter, target); + //bonusmult *= calculateMonsterDifficultyMultiplier(shooter); } else { totaldmg = 1.0; } @@ -544,9 +544,6 @@ public class NewCombat { dmg = ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.DAWNTRACKER,2,2); addToPlayerLogger(ent,"Set Bonus",dmg); basedmg += dmg; - dmg = ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.DAWNTRACKER,4,4); - addToPlayerLogger(ent,"Set Bonus",dmg); - basedmg += dmg; } if (GenericFunctions.isHardenedItem(weapon) && !GenericFunctions.isArtifactEquip(weapon)) { @@ -601,6 +598,11 @@ public class NewCombat { } setPlayerTarget(damager,target,headshot,preemptive); + + if (shooter instanceof Monster) { + basedmg = 1.0 *calculateMonsterDifficultyMultiplier(shooter); + TwosideKeeper.log("New Base damage is "+basedmg, 2); + } return basedmg * basemult; } @@ -943,7 +945,7 @@ public class NewCombat { double mult1 = 1.0+(GenericFunctions.getPotionEffectLevel(PotionEffectType.INCREASE_DAMAGE, damager)+1)*0.1; addMultiplierToPlayerLogger(damager,"STRENGTH Mult",mult1); mult *= mult1; - + /* int weaknesslv = Math.abs(GenericFunctions.getPotionEffectLevel(PotionEffectType.WEAKNESS, damager))+1; if (weaknesslv<=10) { mult1 = 1.0-(weaknesslv*0.1); @@ -952,7 +954,7 @@ public class NewCombat { } else { addMultiplierToPlayerLogger(damager,ChatColor.RED+"WEAKNESS Mult",0.0); mult = 0.0; - } + }*/ return mult; } @@ -1231,13 +1233,13 @@ public class NewCombat { basedmg *= dmgreduce; TwosideKeeper.log("Base damage became "+(dmgreduce*100)+"% of original amount.",5); } - if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getArmorContents()[i])) { + /*if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getArmorContents()[i])) { dmgreduction /= ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getArmorContents()[i])?2:1; - } + }*/ } - if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())) { + /*if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())) { dmgreduction /= ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())?2:1; - } + }*/ setbonus = ((100-ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 4, 4))/100d); } @@ -1294,7 +1296,7 @@ public class NewCombat { } } } - lifestealpct += ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 3, 3)/100d; + lifestealpct += ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 4, 4)/100d; return lifestealpct; } @@ -1564,6 +1566,9 @@ public class NewCombat { } dodgechance+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.PANROS,3,3)/100d; + if (p.isBlocking()) { + dodgechance+=ItemSet.GetTotalBaseAmount(p, ItemSet.SONGSTEEL)/100d; + } if (GenericFunctions.isStriker(p) && pd.velocity>0) { diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index c1a3f2e..3750750 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -596,7 +596,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { //See if each player needs to regenerate their health. for (int i=0;ipd.debuffcount) { @@ -610,6 +610,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { removechance+=resistamt; } } + removechance+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 3, 3); log("Remove chance is "+removechance,5); int longestdur=0; PotionEffectType type=null; @@ -4180,7 +4181,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (amt>500) { testamt=500; } - if (val<=((double)testamt/(double)65)*(0.00125)*ARTIFACT_RARITY) { + if (val<=((double)testamt/(double)65)*(4.1666666666666666666666666666667e-4)*ARTIFACT_RARITY) { Item it = ev.getPlayer().getWorld().dropItemNaturally(ev.getPlayer().getLocation(), Artifact.createArtifactItem(ArtifactItem.MALLEABLE_BASE)); it.setPickupDelay(0); it.setInvulnerable(true); @@ -4492,6 +4493,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener { isBoss=GenericFunctions.isBossMonster(m); isElite=GenericFunctions.isEliteMonster(m); + if (isElite) { + isBoss=true; + } + if (killedByPlayer && GenericFunctions.isCoreMonster(m) && Math.random() generatedloot = MonsterController.getMonsterDifficulty((Monster)ev.getEntity()).RandomizeDrops(dropmult/participants.size(),false,false); - for (int j=0;j=hp) { p.setHealth(hp); } @@ -6671,7 +6677,15 @@ public class TwosideKeeper extends JavaPlugin implements Listener { receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Damage Reduction: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((1.0-store1)*100)+"%"); receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Life Steal: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format(NewCombat.calculateLifeStealAmount(p)*100)+"%"); receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Critical Strike Chance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((NewCombat.calculateCriticalStrikeChance(p.getEquipment().getItemInMainHand(), p))*100)+"%"); - receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Dodge Chance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((NewCombat.CalculateDodgeChance(p))*100)+"%"); + if (GenericFunctions.isDefender(p)) { + double dodgechance=0.0; + if (!p.isBlocking()) { + dodgechance+=ItemSet.GetTotalBaseAmount(p, ItemSet.SONGSTEEL)/100d; + } + receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Block Chance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((NewCombat.CalculateDodgeChance(p)+dodgechance)*100)+"%"); + } else { + receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Dodge Chance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((NewCombat.CalculateDodgeChance(p))*100)+"%"); + } TextComponent f = new TextComponent(ChatColor.GRAY+""+ChatColor.ITALIC+"Current Mode: "); f.addExtra(GenericFunctions.PlayerModeName(p)); if (receiver instanceof Player) {