diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main$1.class b/BankEconomyMod/bin/me/kaZep/Base/Main$1.class index 2a66184..ecf56ff 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main$1.class and b/BankEconomyMod/bin/me/kaZep/Base/Main$1.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main$2.class b/BankEconomyMod/bin/me/kaZep/Base/Main$2.class index 753eeb4..db12478 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main$2.class and b/BankEconomyMod/bin/me/kaZep/Base/Main$2.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main$3.class b/BankEconomyMod/bin/me/kaZep/Base/Main$3.class index c9406ed..4bcdb97 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main$3.class and b/BankEconomyMod/bin/me/kaZep/Base/Main$3.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main$4.class b/BankEconomyMod/bin/me/kaZep/Base/Main$4.class index 041755b..7cce4aa 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main$4.class and b/BankEconomyMod/bin/me/kaZep/Base/Main$4.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/Main.class b/BankEconomyMod/bin/me/kaZep/Base/Main.class index 6a846c3..7fef7f7 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/Main.class and b/BankEconomyMod/bin/me/kaZep/Base/Main.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class index e543041..e4b7258 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class index 7b31d3c..d85091f 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class index 9b5c1ad..c11580e 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class index a7b812c..866e7cd 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class index d14e621..8a79037 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class index db62528..f512cbd 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class index 33decdd..b29a334 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class and b/BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class differ diff --git a/BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class b/BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class index f5a8588..b89e0ac 100644 Binary files a/BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class and b/BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class differ diff --git a/BankEconomyMod/src/me/kaZep/Base/Main.java b/BankEconomyMod/src/me/kaZep/Base/Main.java index dade123..fb920e9 100644 --- a/BankEconomyMod/src/me/kaZep/Base/Main.java +++ b/BankEconomyMod/src/me/kaZep/Base/Main.java @@ -106,6 +106,7 @@ public class Main extends JavaPlugin public long check_nether_time=0; public long check_lights_time=0; public long check_spleef_game=0; + public boolean harrowing_night=false; public int REVIVE_EFFECT=0; public Location REVIVE_EFFECT_LOC; @@ -2853,7 +2854,16 @@ public void checkJukeboxes() { //Bukkit.getPlayer("sigonasr2").sendMessage("Entered 2."); if (p2!=p) { if (supportlv>=20) { - if (!p2.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)) { + int get_resistance_level=-1; + Iterator effects = p2.getActivePotionEffects().iterator(); + while (effects.hasNext()) { + PotionEffect pot = effects.next(); + if (pot.getType()==PotionEffectType.DAMAGE_RESISTANCE) { + get_resistance_level=pot.getAmplifier(); + break; + } + } + if (get_resistance_level<1) { //Bukkit.getPlayer("sigonasr2").sendMessage("Entered 4."); p2.sendMessage(ChatColor.YELLOW+"[Aura]"+ChatColor.ITALIC+"Damage reduction buff (40%) from Support "+ChatColor.DARK_RED+p.getName()); p2.sendMessage(ChatColor.YELLOW+"[Aura]"+ChatColor.ITALIC+"Food Exhaustion buff (50% less food consumption) from Support "+ChatColor.DARK_RED+p.getName()); @@ -2866,7 +2876,16 @@ public void checkJukeboxes() { if (supportlv>=5) { //Bukkit.getPlayer("sigonasr2").sendMessage("Entered 3."); //Give them a resistance buff. - if (!p2.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)) { + int get_resistance_level=-1; + Iterator effects = p2.getActivePotionEffects().iterator(); + while (effects.hasNext()) { + PotionEffect pot = effects.next(); + if (pot.getType()==PotionEffectType.DAMAGE_RESISTANCE) { + get_resistance_level=pot.getAmplifier(); + break; + } + } + if (get_resistance_level<0) { //Bukkit.getPlayer("sigonasr2").sendMessage("Entered 4."); p2.sendMessage(ChatColor.YELLOW+"[Aura]"+ChatColor.ITALIC+"Damage reduction buff (20%) from Support "+ChatColor.DARK_RED+p.getName()); p2.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 601, 0, false)); @@ -3219,7 +3238,11 @@ public void updateTime() { last_world_time+=2; raisecount++; } - Bukkit.getWorld("world").setFullTime(Bukkit.getWorld("world").getFullTime()-raisecount); + if (!harrowing_night) { + Bukkit.getWorld("world").setFullTime(Bukkit.getWorld("world").getFullTime()-raisecount); + } else { + Bukkit.getWorld("world").setFullTime(last_world_time); + } /* if (Bukkit.getWorld("world").getFullTime()-last_world_time+hold_diff>=2) { last_world_time = Bukkit.getWorld("world").getFullTime()+((Bukkit.getWorld("world").getFullTime()-last_world_time+(hold_diff/2))/2); diff --git a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java index 575f13b..0bed24f 100644 --- a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java +++ b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java @@ -1613,6 +1613,18 @@ public class PlayerListener book.setItemMeta(bookdata); p.getInventory().addItem(book); } + if (!this.plugin.getAccountsConfig().contains(p.getName() + ".join.halloween_vote_signs")) { + this.plugin.getAccountsConfig().set(p.getName() + ".join.halloween_vote_signs", Boolean.valueOf(true)); + this.plugin.saveAccountsConfig(); + ItemStack sign = new ItemStack(Material.SIGN,2); + ItemMeta meta = sign.getItemMeta(); + meta.setDisplayName(ChatColor.BLUE+p.getName()); + sign.setItemMeta(meta); + p.getInventory().addItem(sign); + p.sendMessage("You have received 2 vote signs. Go vote at the Pumpkin Patch for the best pumpkin! (Note that voting for yourself does not count. Please vote the best of the others' pumpkins.)"); + } else { + p.sendMessage("You do not have enough room in your inventory to receive Pumpkin vote signs. Clear some of your inventory and then rejoin."); + } } if (!this.plugin.getAccountsConfig().contains(p.getName() + ".halloween.chest1")) { this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest1", Boolean.valueOf(false)); @@ -1625,10 +1637,16 @@ public class PlayerListener this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest8", Boolean.valueOf(false)); this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest9", Boolean.valueOf(false)); this.plugin.getAccountsConfig().set(p.getName() + ".halloween.chest10", Boolean.valueOf(false)); + this.plugin.saveAccountsConfig(); } if (!this.plugin.getAccountsConfig().contains(p.getName() + ".jobs.ultimate")) { this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimate", String.valueOf("None")); this.plugin.getAccountsConfig().set(p.getName() + ".jobs.ultimatesealed", Boolean.valueOf(false)); + this.plugin.saveAccountsConfig(); + } + if (!this.plugin.getAccountsConfig().contains(p.getName() + ".halloween.wand")) { + this.plugin.getAccountsConfig().set(p.getName() + ".halloween.wand", Long.valueOf(Bukkit.getWorld("world").getFullTime())); + this.plugin.saveAccountsConfig(); } } //Check if this player has unallocated stat points. @@ -1729,34 +1747,115 @@ public class PlayerListener @EventHandler public void onPlayerInteract(PlayerInteractEntityEvent ev) { Entity theAnimal = ev.getRightClicked(); - if (theAnimal.getType() == EntityType.WOLF) { - Wolf dog = (Wolf)theAnimal; - DyeColor dogcolor = dog.getCollarColor(); - Player p = ev.getPlayer(); - if (dog.getOwner() == null) { - return; - } - if (p != dog.getOwner()) { - return; - } - if (!dog.isAngry()) { - //Switch state of wolf. - //dog.setSitting(!dog.isSitting()); - return; - } - ev.setCancelled(true); - double oldhealth = dog.getHealth(); - dog.setSitting(true); - dog.remove(); - Location wolfloc = dog.getLocation(); - World world = Bukkit.getWorld("world"); - Entity newAnimal = world.spawnEntity(wolfloc, EntityType.WOLF); - Wolf newdog = (Wolf)newAnimal; - newdog.setOwner(p); - newdog.setHealth(oldhealth); - newdog.setSitting(true); - newdog.setCollarColor(dogcolor); - p.sendMessage(ChatColor.GREEN + "This dog is now happy!"); + if (ev.getPlayer().getItemInHand().getType()==Material.getMaterial(127)) { + if (this.plugin.getAccountsConfig().getLong(ev.getPlayer().getName()+".halloween.wand")=96) { - //This is a tall world. - if (entity.getLocation().getBlockY()>104) { - despawnchancer*=(Math.random()*3.0d)+1; + if (!this.plugin.harrowing_night) { + if (Bukkit.getWorld("world").getHighestBlockYAt(entity.getLocation())>=96) { + //This is a tall world. + if (entity.getLocation().getBlockY()>104) { + despawnchancer*=(Math.random()*3.0d)+1; + } else { + for (int i=104-entity.getLocation().getBlockY();i>0;i--) { + despawnchancer/=1.0175d; + } + } } else { - for (int i=104-entity.getLocation().getBlockY();i>0;i--) { - despawnchancer/=1.0175d; + //This is a short world. + if (entity.getLocation().getBlockY()>52) { + despawnchancer*=(Math.random()*3.0d)+1; + } else { + for (int i=52-entity.getLocation().getBlockY();i>0;i--) { + despawnchancer/=1.025d; + } } } } else { - //This is a short world. - if (entity.getLocation().getBlockY()>52) { - despawnchancer*=(Math.random()*3.0d)+1; - } else { - for (int i=52-entity.getLocation().getBlockY();i>0;i--) { - despawnchancer/=1.025d; - } + for (int i=52;i>0;i--) { + despawnchancer/=1.025d; } } //if (e.getSpawnReason()!=SpawnReason.NATURAL) { //If it's a natural spawn, we gotta do it. Ignore our checking stuff. @@ -5538,24 +5643,8 @@ public ItemStack getGoodie() { if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled")) { e.setDroppedExp(e.getDroppedExp()*2); } - Player p = null; - for (int i=0;i data = p.getInventory().getContents()[m].getItemMeta().getLore(); - //newlore.add("Requires "+((int)(Math.random()*1000)+100)+" Pumpkin Pie in inventory"); - ItemStack magic_pie = null; - for (int i=0;i data = p.getInventory().getContents()[m].getItemMeta().getLore(); + //newlore.add("Requires "+((int)(Math.random()*1000)+100)+" Pumpkin Pie in inventory"); + ItemStack magic_pie = null; + for (int i=0;i=pies) { - p.getInventory().remove(magic_pie); - //Check to see if there are any pies we need to keep for later. - List items = new ArrayList(); + //Now count all pumpkin pies in inventory. If they are greater than the amount in the inventory (and are not special pies), remove them. + int piecount=0; + ItemStack ideal_pie = null; for (int i=0;i0) { - if (amountleft>=64) { - p.getInventory().addItem(new ItemStack(Material.PUMPKIN_PIE,64)); - amountleft-=64; - } else { - p.getInventory().addItem(new ItemStack(Material.PUMPKIN_PIE,1)); - amountleft--; + Bukkit.getLogger().info("We have "+piecount+" pies."); + if (ideal_pie!=null && magic_pie!=null && piecount>=pies) { + p.getInventory().remove(magic_pie); + //Check to see if there are any pies we need to keep for later. + List items = new ArrayList(); + for (int i=0;i0) { + if (amountleft>=64) { + p.getInventory().addItem(new ItemStack(Material.PUMPKIN_PIE,64)); + amountleft-=64; + } else { + p.getInventory().addItem(new ItemStack(Material.PUMPKIN_PIE,1)); + amountleft--; + } + } + for (int i=0;i finallore = new ArrayList(); for (int j=0;j enchants1 = new ArrayList(); + List enchants2 = new ArrayList(); + ItemStack finalitem = null; + if (type==0) { + finalitem=new ItemStack(Material.DIAMOND_HELMET); + enchants1.add("Protective"); + enchants1.add("Fire-Proof"); + enchants1.add("Blast Resistant"); + enchants1.add("Untouchable"); + enchants1.add("Breathing"); + enchants1.add("Working"); + enchants1.add("Unbreaking"); + enchants1.add("Thorny"); + enchants2.add("Life"); + enchants2.add("Resistance"); + enchants2.add("Durability"); + enchants2.add("Protection"); + } + if (type==1) { + finalitem=new ItemStack(Material.DIAMOND_CHESTPLATE); + enchants1.add("Protective"); + enchants1.add("Fire-Proof"); + enchants1.add("Blast Resistant"); + enchants1.add("Untouchable"); + enchants1.add("Unbreaking"); + enchants1.add("Thorny"); + enchants2.add("Life"); + enchants2.add("Resistance"); + enchants2.add("Durability"); + enchants2.add("Protection"); + } + if (type==2) { + finalitem=new ItemStack(Material.DIAMOND_LEGGINGS); + enchants1.add("Protective"); + enchants1.add("Fire-Proof"); + enchants1.add("Blast Resistant"); + enchants1.add("Untouchable"); + enchants1.add("Unbreaking"); + enchants1.add("Thorny"); + enchants2.add("Life"); + enchants2.add("Resistance"); + enchants2.add("Durability"); + enchants2.add("Protection"); + } + if (type==3) { + finalitem=new ItemStack(Material.DIAMOND_BOOTS); + enchants1.add("Protective"); + enchants1.add("Fire-Proof"); + enchants1.add("Blast Resistant"); + enchants1.add("Untouchable"); + enchants1.add("Lightweight"); + enchants1.add("Unbreaking"); + enchants1.add("Thorny"); + enchants2.add("Life"); + enchants2.add("Resistance"); + enchants2.add("Durability"); + enchants2.add("Protection"); + } + if (type==4) { + finalitem=new ItemStack(Material.BOW); + enchants1.add("Power"); + enchants1.add("Punch"); + enchants1.add("Flaming"); + enchants1.add("Infinite"); + enchants1.add("Unbreaking"); + enchants2.add("Smiting"); + enchants2.add("Penetration"); + enchants2.add("Draining"); + enchants2.add("Fury"); + enchants2.add("Power"); + } + if (type==5) { + finalitem=new ItemStack(Material.DIAMOND_SWORD); + enchants1.add("Damaging"); + enchants1.add("Knockback"); + enchants1.add("Undead"); + enchants1.add("Baning"); + enchants1.add("Fiery"); + enchants1.add("Greedy"); + enchants1.add("Unbreaking"); + enchants2.add("Smiting"); + enchants2.add("Penetration"); + enchants2.add("Draining"); + enchants2.add("Fury"); + enchants2.add("Power"); + } + prefix = enchants1.get((int)(Math.random()*enchants1.size())); + suffix = enchants2.get((int)(Math.random()*enchants2.size())); + if (prefix.equalsIgnoreCase("Protective")) { + finalitem.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10); + } + if (prefix.equalsIgnoreCase("Fire-Proof")) { + finalitem.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, 10); + } + if (prefix.equalsIgnoreCase("Blast Resistant")) { + finalitem.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 10); + } + if (prefix.equalsIgnoreCase("Untouchable")) { + finalitem.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 10); + } + if (prefix.equalsIgnoreCase("Breathing")) { + finalitem.addUnsafeEnchantment(Enchantment.OXYGEN, 10); + } + if (prefix.equalsIgnoreCase("Working")) { + finalitem.addUnsafeEnchantment(Enchantment.WATER_WORKER, 10); + } + if (prefix.equalsIgnoreCase("Unbreaking")) { + finalitem.addUnsafeEnchantment(Enchantment.DURABILITY, 10); + } + if (prefix.equalsIgnoreCase("Thorny")) { + finalitem.addUnsafeEnchantment(Enchantment.THORNS, 10); + } + if (prefix.equalsIgnoreCase("Untouchable")) { + finalitem.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 10); + } + if (prefix.equalsIgnoreCase("Lightweight")) { + finalitem.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, 10); + } + if (prefix.equalsIgnoreCase("Power")) { + finalitem.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 10); + } + if (prefix.equalsIgnoreCase("Damaging")) { + finalitem.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 10); + } + if (prefix.equalsIgnoreCase("Knockback")) { + finalitem.addUnsafeEnchantment(Enchantment.KNOCKBACK, 10); + } + if (prefix.equalsIgnoreCase("Punch")) { + finalitem.addUnsafeEnchantment(Enchantment.ARROW_KNOCKBACK, 10); + } + if (prefix.equalsIgnoreCase("Flaming")) { + finalitem.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); + } + if (prefix.equalsIgnoreCase("Infinite")) { + finalitem.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 10); + } + if (prefix.equalsIgnoreCase("Undead")) { + finalitem.addUnsafeEnchantment(Enchantment.DAMAGE_UNDEAD, 10); + } + if (prefix.equalsIgnoreCase("Baning")) { + finalitem.addUnsafeEnchantment(Enchantment.DAMAGE_ARTHROPODS, 10); + } + if (prefix.equalsIgnoreCase("Fiery")) { + finalitem.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, 10); + } + if (prefix.equalsIgnoreCase("Greedy")) { + finalitem.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 10); + } + ItemMeta meta = finalitem.getItemMeta(); + meta.setDisplayName(ChatColor.GOLD+""+ChatColor.BOLD+prefix+" "+convertToItemName(finalitem.getType().name())+" of "+suffix); + List setLore = new ArrayList(); + if (suffix.equalsIgnoreCase("Life")) { + setLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+10)+" "+ChatColor.BLUE+"Health"); + } + if (suffix.equalsIgnoreCase("Resistance")) { + setLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*70)+20)+"% "+ChatColor.BLUE+"Damage Reduction"); + } + if (suffix.equalsIgnoreCase("Durability")) { + setLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*200)+50)*10)+"% "+ChatColor.BLUE+"Durability"); + } + if (suffix.equalsIgnoreCase("Protection")) { + setLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*50)+10))+"% "+ChatColor.BLUE+"Block Chance"); + } + if (suffix.equalsIgnoreCase("Smiting")) { + setLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*50)+10))+"% "+ChatColor.BLUE+"Critical Chance"); + } + if (suffix.equalsIgnoreCase("Penetration")) { + setLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*20)+5))+" "+ChatColor.BLUE+"Armor Penetration"); + } + if (suffix.equalsIgnoreCase("Draining")) { + setLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*30)+20))+"% "+ChatColor.BLUE+"Life Steal"); + } + if (suffix.equalsIgnoreCase("Fury")) { + setLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*50)+10))+"% "+ChatColor.BLUE+"Attack Speed"); + } + if (suffix.equalsIgnoreCase("Power")) { + setLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*10)+5))+" "+ChatColor.BLUE+"Damage"); + } + setLore.add(""); + setLore.add(ChatColor.YELLOW+"[Halloween]"); + setLore.add("This item was created during the Halloween"); + setLore.add("event. When this item breaks, it simply turns"); + setLore.add("into a \"broken\" state and has a recharge time"); + setLore.add("of 1 week. The item will be fully restored after"); + setLore.add("a week of cooldown."); + meta.setLore(setLore); + finalitem.setItemMeta(meta); + //finalitem.setDurability((short)1560); //TESTING. + boolean full=true; + for (int j=0;j0) { + chance_increase=1.5d; + } + if (type2.equalsIgnoreCase("BOW")) { + item = new ItemStack(Material.BOW); + int enchants[] = {48,49,50,51}; + for (int j=0;j ourLore = new ArrayList(); + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+1)+"% "+ChatColor.BLUE+"Critical Chance"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*3)+1)+" "+ChatColor.BLUE+"Armor Penetration"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+1)+"% "+ChatColor.BLUE+"Life Steal"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+1)+"% "+ChatColor.BLUE+"Attack Speed"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*5)+1)+" "+ChatColor.BLUE+"Damage"); + } + ItemMeta meta1 = item.getItemMeta(); + meta1.setLore(ourLore); + item.setItemMeta(meta1); + } else { + item = new ItemStack(Material.getMaterial(type1+"_"+type2)); + if (type2.equalsIgnoreCase("SWORD")) { + int enchants[] = {16,17,18,19,20,21,34}; + for (int j=0;j ourLore = new ArrayList(); + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+1)+"% "+ChatColor.BLUE+"Critical Chance"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*3)+1)+" "+ChatColor.BLUE+"Armor Penetration"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+1)+"% "+ChatColor.BLUE+"Life Steal"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+1)+"% "+ChatColor.BLUE+"Attack Speed"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*5)+1)+" "+ChatColor.BLUE+"Damage"); + } + ItemMeta meta1 = item.getItemMeta(); + meta1.setLore(ourLore); + item.setItemMeta(meta1); + } else if (type2.equalsIgnoreCase("SPADE") || type2.equalsIgnoreCase("PICKAXE") || type2.equalsIgnoreCase("HOE") || type2.equalsIgnoreCase("AXE")) { + int enchants[] = {32,33,34,35}; + for (int j=0;j ourLore = new ArrayList(); + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+1)+"% "+ChatColor.BLUE+"Critical Chance"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*3)+1)+" "+ChatColor.BLUE+"Armor Penetration"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+1)+"% "+ChatColor.BLUE+"Life Steal"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+1)+"% "+ChatColor.BLUE+"Attack Speed"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*5)+1)+" "+ChatColor.BLUE+"Damage"); + } + ItemMeta meta1 = item.getItemMeta(); + meta1.setLore(ourLore); + item.setItemMeta(meta1); + } else { + int enchants[] = {0,1,2,3,4,5,6,7,34}; + for (int j=0;j ourLore = new ArrayList(); + if (rarity==2) { + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*16)+1)+" "+ChatColor.BLUE+"Health"); + } else + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*40)+1)+"% "+ChatColor.BLUE+"Damage Reduction"); + } else + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*200)+1)*10)+"% "+ChatColor.BLUE+"Durability"); + } else + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*40)+1)+"% "+ChatColor.BLUE+"Block Chance"); + } else + { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*40)+1)+"% "+ChatColor.BLUE+"Speed Boost Chance"); + } + } else + if (rarity==1) { + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*8)+1)+" "+ChatColor.BLUE+"Health"); + } else + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*20)+1)+"% "+ChatColor.BLUE+"Damage Reduction"); + } else + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*100)+1)*10)+"% "+ChatColor.BLUE+"Durability"); + } else + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*20)+1)+"% "+ChatColor.BLUE+"Block Chance"); + } else + { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*20)+1)+"% "+ChatColor.BLUE+"Speed Boost Chance"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*8)+1)+" "+ChatColor.BLUE+"Health"); + } else + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*20)+1)+"% "+ChatColor.BLUE+"Damage Reduction"); + } else + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*100)+1)*10)+"% "+ChatColor.BLUE+"Durability"); + } else + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*20)+1)+"% "+ChatColor.BLUE+"Block Chance"); + } else + { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*20)+1)+"% "+ChatColor.BLUE+"Speed Boost Chance"); + } + } else { + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*4)+1)+" "+ChatColor.BLUE+"Health"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+1)+"% "+ChatColor.BLUE+"Damage Reduction"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*50)+1)*10)+"% "+ChatColor.BLUE+"Durability"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+1)+"% "+ChatColor.BLUE+"Block Chance"); + } + if (Math.random()<=0.2) { + ourLore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+1)+"% "+ChatColor.BLUE+"Speed Boost Chance"); + } + } + ItemMeta meta1 = item.getItemMeta(); + meta1.setLore(ourLore); + if (rarity==1) { + meta1.setDisplayName(ChatColor.BLUE+"Rare "+item.getType().name().replace("_", " ")); + } + if (rarity==2) { + meta1.setDisplayName(ChatColor.YELLOW+""+ChatColor.BOLD+"Legendary "+item.getType().name().replace("_", " ")); + } + item.setItemMeta(meta1); + } + } + + p.getInventory().addItem(item); + ItemStack wand = new ItemStack(Material.getMaterial(127)); + ItemMeta wand_meta = wand.getItemMeta(); + wand_meta.setDisplayName(ChatColor.RED+"P"+ + ChatColor.GOLD+"o"+ChatColor.YELLOW+"l"+ + ChatColor.GREEN+"y"+ChatColor.BLUE+"m"+ + ChatColor.LIGHT_PURPLE+"o"+ChatColor.DARK_RED+"r" + +ChatColor.DARK_GREEN+"p"+ChatColor.DARK_PURPLE+"h"+ChatColor.RESET+" Wand"); + List newLore = new ArrayList(); + newLore.add("A "+ChatColor.YELLOW+"[Halloween]"+ChatColor.DARK_PURPLE+""+ChatColor.ITALIC+" item received as a reward"); + newLore.add("for participating in the event. This item can"); + newLore.add("turn a creature into another creature."); + newLore.add("Can be used once a minute."); + wand_meta.setLore(newLore); + wand.setItemMeta(wand_meta); + p.getInventory().addItem(wand); + } + } + },400); + Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() { + @Override + public void run() { + Bukkit.broadcastMessage(ChatColor.GOLD+""+ChatColor.BOLD+""); + Bukkit.broadcastMessage(ChatColor.GOLD+""+ChatColor.BOLD+"Again, thank you for participating, and everyone have a great night!"); + } + },600); + Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() { + @Override + public void run() { + Bukkit.broadcastMessage(ChatColor.DARK_GRAY+""+ChatColor.ITALIC+" And so the Harrowing ends...."); + } + },700); + Bukkit.getWorld("world").setDifficulty(Difficulty.HARD); + this.plugin.harrowing_night=true; + this.plugin.saveConfig(); + } if (args[0].equalsIgnoreCase("spawn_dungeon") && args[1].equalsIgnoreCase("boss")) { //Empty the whole area. double xoffset = Math.random()*10+15;