rebalanced to account for gear progression over time. Farm gear at one tier -> Get strong enough for next tier. Modified Mysterious Essence Behavior. They are now harder to find, but still as random as ever. Nerfed Malleable Base chance a tiny bit. Zombie Leaders / Bosses have a very high chance to now give a special piece, so they are worth fighting! Hellfire Zombies have gained a new ability: Wall Breakdown. Similar to old Charge Zombies, they will attempt to break down blocks around them to get to you. (Does NOT activate when they are idle!) Fixed bugs relating to damage calculations for explosions and fixed Blast Protection damage calculations.dev
parent
1a56bb7951
commit
d8a3d0f781
Binary file not shown.
@ -0,0 +1,187 @@ |
||||
package sig.plugin.TwosideKeeper; |
||||
|
||||
import org.bukkit.block.Block; |
||||
import org.bukkit.entity.Monster; |
||||
|
||||
import aPlugin.BlockUtils; |
||||
import sig.plugin.TwosideKeeper.HelperStructures.BlockToughness; |
||||
|
||||
public class ChargeZombie { |
||||
Monster m; |
||||
|
||||
public ChargeZombie(Monster m) { |
||||
this.m=m; |
||||
} |
||||
|
||||
public Monster GetZombie() { |
||||
return m; |
||||
} |
||||
public boolean isAlive() { |
||||
return !m.isDead(); |
||||
} |
||||
public boolean hasTarget() { |
||||
return (m.getTarget()!=null)?true:false; |
||||
} |
||||
|
||||
public void BreakBlocksAroundArea(int radius) { |
||||
for (int x=-radius;x<radius+1;x++) { |
||||
for (int y=0;y<radius+1;y++) { |
||||
for (int z=-radius;z<radius+1;z++) { |
||||
if (!BlockUtils.isExplosionProof(m.getLocation().add(x,y,z).getBlock().getType())) { |
||||
//Break it.
|
||||
if (ChanceToBreak(m.getLocation().add(x,y,z).getBlock())) { |
||||
m.getLocation().add(x,y,z).getBlock().breakNaturally(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
public boolean ChanceToBreak(Block b) { |
||||
int blocktoughness = 0; |
||||
switch (b.getType()) { |
||||
case OBSIDIAN:{ |
||||
blocktoughness=20; |
||||
}break; |
||||
case ENDER_CHEST:{ |
||||
blocktoughness=20; |
||||
}break; |
||||
case ANVIL:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case COAL_BLOCK:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case DIAMOND_BLOCK:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case EMERALD_BLOCK:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case IRON_BLOCK:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case REDSTONE_BLOCK:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case ENCHANTMENT_TABLE:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case IRON_FENCE:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case IRON_DOOR:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case IRON_TRAPDOOR:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case MOB_SPAWNER:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case WEB:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case DISPENSER:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case DROPPER:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case FURNACE:{ |
||||
blocktoughness=10; |
||||
}break; |
||||
case BEACON:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case GOLD_BLOCK:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case COAL_ORE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case DIAMOND_ORE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case EMERALD_ORE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case ENDER_STONE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case GOLD_ORE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case HOPPER:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case IRON_ORE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case LAPIS_BLOCK:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case LAPIS_ORE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case QUARTZ_ORE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case REDSTONE_ORE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case GLOWING_REDSTONE_ORE:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case TRAP_DOOR:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
case WOODEN_DOOR:{ |
||||
blocktoughness=6; |
||||
}break; |
||||
} |
||||
|
||||
/* |
||||
* OBSIDIAN(50), |
||||
ENDER_CHEST(23), |
||||
ANVIL(10), |
||||
COAL_BLOCK(10), |
||||
DIAMOND_BLOCK(10), |
||||
EMERALD_BLOCK(10), |
||||
IRON_BLOCK(10), |
||||
REDSTONE_BLOCK(10), |
||||
ENCHANTMENT_TABLE(10), |
||||
IRON_FENCE(10), |
||||
IRON_DOOR(10), |
||||
IRON_TRAPDOOR(10), |
||||
MONSTER_SPAWNER(10), |
||||
WEB(10), |
||||
DISPENSER(10), |
||||
DROPPER(10), |
||||
FURNACE(10), |
||||
BEACON(6), |
||||
BLOCK_OF_GOLD(6), |
||||
COAL_ORE(6), |
||||
DIAMOND_ORE(6), |
||||
EMERALD_ORE(6), |
||||
END_STONE(6), |
||||
GOLD_ORE(6), |
||||
HOPPER(6), |
||||
IRON_ORE(6), |
||||
LAPIS_BLOCK(6), |
||||
LAPIS_ORE(6), |
||||
NETHER_QUARTZ_ORE(6), |
||||
REDSTONE_ORE(6), |
||||
GLOWING_REDSTONE_ORE(6), |
||||
TRAP_DOOR(6), |
||||
WOODEN_DOOR(6); |
||||
*/ |
||||
|
||||
if (Math.random()*((double)blocktoughness/5)<1) { |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,50 @@ |
||||
package sig.plugin.TwosideKeeper.HelperStructures; |
||||
|
||||
import org.bukkit.Material; |
||||
|
||||
public enum BlockToughness { |
||||
|
||||
OBSIDIAN(20), |
||||
ENDER_CHEST(20), |
||||
ANVIL(10), |
||||
COAL_BLOCK(10), |
||||
DIAMOND_BLOCK(10), |
||||
EMERALD_BLOCK(10), |
||||
IRON_BLOCK(10), |
||||
REDSTONE_BLOCK(10), |
||||
ENCHANTMENT_TABLE(10), |
||||
IRON_FENCE(10), |
||||
IRON_DOOR(10), |
||||
IRON_TRAPDOOR(10), |
||||
MONSTER_SPAWNER(10), |
||||
WEB(10), |
||||
DISPENSER(10), |
||||
DROPPER(10), |
||||
FURNACE(10), |
||||
BEACON(6), |
||||
BLOCK_OF_GOLD(6), |
||||
COAL_ORE(6), |
||||
DIAMOND_ORE(6), |
||||
EMERALD_ORE(6), |
||||
END_STONE(6), |
||||
GOLD_ORE(6), |
||||
HOPPER(6), |
||||
IRON_ORE(6), |
||||
LAPIS_BLOCK(6), |
||||
LAPIS_ORE(6), |
||||
NETHER_QUARTZ_ORE(6), |
||||
REDSTONE_ORE(6), |
||||
GLOWING_REDSTONE_ORE(6), |
||||
TRAP_DOOR(6), |
||||
WOODEN_DOOR(6); |
||||
|
||||
int toughness=3; |
||||
|
||||
BlockToughness(int toughness) { |
||||
this.toughness=toughness; |
||||
} |
||||
|
||||
public int GetToughness() { |
||||
return this.toughness; |
||||
} |
||||
} |
@ -0,0 +1,144 @@ |
||||
package sig.plugin.TwosideKeeper.HelperStructures; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import org.bukkit.ChatColor; |
||||
import org.bukkit.Material; |
||||
import org.bukkit.enchantments.Enchantment; |
||||
import org.bukkit.inventory.ItemStack; |
||||
import org.bukkit.inventory.meta.ItemMeta; |
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; |
||||
|
||||
public class Loot { |
||||
|
||||
static double HARDENED_ENCHANT_MULT = 1.4; |
||||
static int MAX_ENCHANT_LEVEL = 10; |
||||
|
||||
public static ItemStack GenerateMegaPiece(Material mat_type, boolean hardened) { |
||||
ItemStack raresword = new ItemStack(mat_type); |
||||
ItemMeta sword_meta = raresword.getItemMeta(); |
||||
sword_meta.setDisplayName(ChatColor.AQUA+""+ChatColor.BOLD+"Mega "+GenericFunctions.UserFriendlyMaterialName(mat_type)); |
||||
raresword.setItemMeta(sword_meta); |
||||
raresword = addEnchantments(raresword,false); |
||||
if (hardened) { |
||||
sword_meta.setDisplayName(ChatColor.LIGHT_PURPLE+""+ChatColor.BOLD+"Hardened Mega "+GenericFunctions.UserFriendlyMaterialName(mat_type)); |
||||
List<String> lore = new ArrayList<String>(); |
||||
lore.add(ChatColor.GRAY+"Breaks Remaining: "+ChatColor.YELLOW+GetHardenedBreaks(mat_type)); |
||||
sword_meta.setLore(lore); |
||||
raresword.setItemMeta(sword_meta); |
||||
raresword = addEnchantments(raresword,true); |
||||
} |
||||
return raresword; |
||||
} |
||||
|
||||
private static int GetHardenedBreaks(Material type) { |
||||
if (type.toString().contains("STONE")) { |
||||
return (int)((Math.random()*3)+2); |
||||
} else |
||||
if (type.toString().contains("IRON")) { |
||||
return (int)((Math.random()*4)+3); |
||||
} else |
||||
if (type.toString().contains("DIAMOND")) { |
||||
return (int)((Math.random()*7)+5); |
||||
} else |
||||
if (type.toString().contains("GOLD")) { |
||||
return (int)((Math.random()*12)+10); |
||||
} else |
||||
{ |
||||
return 5; |
||||
} |
||||
} |
||||
|
||||
private static int GetEnchantmentLevels(Material type) { |
||||
return GetEnchantmentLevels(type, false); |
||||
} |
||||
|
||||
private static int GetEnchantmentLevels(Material type, boolean hardened) { |
||||
int enchantment_level = 0; |
||||
if (type.toString().contains("STONE")) { |
||||
enchantment_level = (int)(((Math.random()*3)+2)*((hardened)?HARDENED_ENCHANT_MULT:1)); |
||||
} else |
||||
if (type.toString().contains("IRON")) { |
||||
enchantment_level = (int)(((Math.random()*4)+3)*((hardened)?HARDENED_ENCHANT_MULT:1)); |
||||
} else |
||||
if (type.toString().contains("DIAMOND")) { |
||||
enchantment_level = (int)(((Math.random()*4)+5)*((hardened)?HARDENED_ENCHANT_MULT:1)); |
||||
} else |
||||
if (type.toString().contains("GOLD")) { |
||||
enchantment_level = (int)(((Math.random()*5)+6)*((hardened)?HARDENED_ENCHANT_MULT:1)); |
||||
} else |
||||
if (type.toString().contains("BOW")) { |
||||
enchantment_level = (int)(((Math.random()*5)+6)*((hardened)?HARDENED_ENCHANT_MULT:1)); |
||||
} else |
||||
{ |
||||
enchantment_level = (int)(((Math.random()*9))*((hardened)?HARDENED_ENCHANT_MULT:1)); |
||||
} |
||||
|
||||
if (enchantment_level>MAX_ENCHANT_LEVEL) { |
||||
enchantment_level = 10; |
||||
} |
||||
|
||||
return enchantment_level; |
||||
} |
||||
|
||||
private static ItemStack addEnchantments(ItemStack item, boolean hardened) { |
||||
if (GenericFunctions.isHarvestingTool(item)) { |
||||
item.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.DIG_SPEED, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.DURABILITY, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.LOOT_BONUS_BLOCKS, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.KNOCKBACK, 2); |
||||
if (item.getType().toString().contains("HOE")) {item.addUnsafeEnchantment(Enchantment.KNOCKBACK, 10);} |
||||
if (Math.random()<0.2*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.SILK_TOUCH, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.2*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.MENDING, GetEnchantmentLevels(item.getType(),hardened));} |
||||
} else |
||||
if (item.getType()==Material.BOW) { |
||||
item.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.ARROW_FIRE, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.DURABILITY, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.ARROW_KNOCKBACK, 2); |
||||
if (Math.random()<0.2*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.2*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.MENDING, GetEnchantmentLevels(item.getType(),hardened));} |
||||
} else |
||||
if (GenericFunctions.isWeapon(item)) { |
||||
item.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.DAMAGE_ARTHROPODS, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.DAMAGE_UNDEAD, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.DURABILITY, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1); |
||||
if (Math.random()<0.2*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.MENDING, GetEnchantmentLevels(item.getType(),hardened));} |
||||
} else |
||||
if (GenericFunctions.isArmor(item)) { |
||||
item.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, GetEnchantmentLevels(item.getType(),hardened)); |
||||
if (Math.random()<0.5*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.5*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.5*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.5*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.5*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.DEPTH_STRIDER, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.5*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.WATER_WORKER, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.5*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.OXYGEN, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.2*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.FROST_WALKER, GetEnchantmentLevels(item.getType(),hardened));} |
||||
if (Math.random()<0.08*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.THORNS, GetEnchantmentLevels(item.getType(),hardened));} |
||||
item.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1); |
||||
if (Math.random()<0.2*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.MENDING, GetEnchantmentLevels(item.getType(),hardened));} |
||||
} else |
||||
if (item.getType()==Material.FISHING_ROD) { |
||||
item.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.DURABILITY, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.LUCK, GetEnchantmentLevels(item.getType(),hardened)); |
||||
item.addUnsafeEnchantment(Enchantment.LURE, GetEnchantmentLevels(item.getType(),hardened)); |
||||
} else { |
||||
//Generic Random Enchantments.
|
||||
for (int i=0;i<Enchantment.values().length;i++) { |
||||
if (Math.random()<1.0/Enchantment.values().length*HARDENED_ENCHANT_MULT) { |
||||
item.addUnsafeEnchantment(Enchantment.values()[i], GetEnchantmentLevels(item.getType(),hardened)); |
||||
} |
||||
} |
||||
} |
||||
return item; |
||||
} |
||||
} |
@ -0,0 +1,48 @@ |
||||
package sig.plugin.TwosideKeeper.HelperStructures; |
||||
|
||||
import org.bukkit.Material; |
||||
|
||||
public class LootStructure { |
||||
Material mat; |
||||
boolean hardened_item; |
||||
int amt; |
||||
ArtifactItem art; |
||||
|
||||
public LootStructure(Material mat, boolean ishardened) { |
||||
this.mat=mat; |
||||
this.hardened_item=ishardened; |
||||
this.amt=1; |
||||
this.art=null; |
||||
} |
||||
public LootStructure(Material mat, int amt) { |
||||
this.mat=mat; |
||||
this.amt=amt; |
||||
this.hardened_item=false; |
||||
this.art=null; |
||||
} |
||||
public LootStructure(Material mat) { |
||||
this.mat=mat; |
||||
this.amt=1; |
||||
this.hardened_item=false; |
||||
this.art=null; |
||||
} |
||||
public LootStructure(ArtifactItem art, int amt) { |
||||
this.mat=null; |
||||
this.amt=1; |
||||
this.hardened_item=false; |
||||
this.art=art; |
||||
} |
||||
|
||||
public Material GetMaterial() { |
||||
return mat; |
||||
} |
||||
public boolean GetHardened() { |
||||
return hardened_item; |
||||
} |
||||
public int GetAmount() { |
||||
return amt; |
||||
} |
||||
public ArtifactItem GetArtifact() { |
||||
return art; |
||||
} |
||||
} |
@ -1,8 +1,227 @@ |
||||
package sig.plugin.TwosideKeeper.HelperStructures; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import org.bukkit.Material; |
||||
import org.bukkit.inventory.ItemStack; |
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper; |
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; |
||||
|
||||
public enum MonsterDifficulty { |
||||
NORMAL, |
||||
DANGEROUS, |
||||
DEADLY, |
||||
HELLFIRE |
||||
|
||||
NORMAL( //Contains info about loot for everything.
|
||||
new LootStructure[]{ //Regular Loot
|
||||
|
||||
}, |
||||
new LootStructure[]{ //Rare Loot
|
||||
new LootStructure(Material.STONE_SWORD, false), |
||||
new LootStructure(ArtifactItem.ARTIFACT_ESSENCE,1), |
||||
}, |
||||
new LootStructure[]{ //Legendary Loot
|
||||
new LootStructure(ArtifactItem.ARTIFACT_CORE,1), |
||||
new LootStructure(Material.STONE_SWORD, true), |
||||
} |
||||
), |
||||
DANGEROUS( |
||||
new LootStructure[]{ //Regular Loot
|
||||
new LootStructure(Material.IRON_INGOT,false), |
||||
}, |
||||
new LootStructure[]{ //Rare Loot
|
||||
new LootStructure(ArtifactItem.ANCIENT_ESSENCE,1), |
||||
new LootStructure(Material.IRON_BLOCK,false), |
||||
new LootStructure(Material.IRON_SWORD, false), |
||||
new LootStructure(Material.IRON_CHESTPLATE, false), |
||||
new LootStructure(Material.IRON_LEGGINGS, false), |
||||
new LootStructure(Material.IRON_BOOTS, false), |
||||
new LootStructure(Material.IRON_HELMET, false), |
||||
new LootStructure(Material.STONE_AXE, false), |
||||
new LootStructure(Material.STONE_PICKAXE, false), |
||||
new LootStructure(Material.STONE_HOE, false), |
||||
new LootStructure(Material.STONE_SPADE, false), |
||||
new LootStructure(Material.FISHING_ROD, false), |
||||
}, |
||||
new LootStructure[]{ //Legendary Loot
|
||||
new LootStructure(ArtifactItem.ANCIENT_CORE,1), |
||||
new LootStructure(Material.IRON_SWORD, true), |
||||
new LootStructure(Material.IRON_CHESTPLATE, true), |
||||
new LootStructure(Material.IRON_LEGGINGS, true), |
||||
new LootStructure(Material.IRON_BOOTS, true), |
||||
new LootStructure(Material.IRON_HELMET, true), |
||||
new LootStructure(Material.STONE_AXE, true), |
||||
new LootStructure(Material.STONE_PICKAXE, true), |
||||
new LootStructure(Material.STONE_HOE, true), |
||||
new LootStructure(Material.STONE_SPADE, true), |
||||
new LootStructure(Material.FISHING_ROD, true), |
||||
} |
||||
), |
||||
DEADLY( |
||||
new LootStructure[]{ //Regular Loot
|
||||
new LootStructure(Material.IRON_INGOT,(int)((Math.random()*2)+1)), |
||||
new LootStructure(Material.DIAMOND), |
||||
new LootStructure(Material.GOLD_NUGGET,(int)((Math.random()*3)+1)), |
||||
}, |
||||
new LootStructure[]{ //Rare Loot
|
||||
new LootStructure(ArtifactItem.LOST_ESSENCE,1), |
||||
new LootStructure(Material.IRON_BLOCK,(int)((Math.random()*2)+1)), |
||||
new LootStructure(Material.DIAMOND_BLOCK), |
||||
new LootStructure(Material.GOLD_INGOT,(int)((Math.random()*3)+1)), |
||||
new LootStructure(Material.DIAMOND_SWORD, false), |
||||
new LootStructure(Material.IRON_AXE, false), |
||||
new LootStructure(Material.IRON_PICKAXE, false), |
||||
new LootStructure(Material.IRON_HOE, false), |
||||
new LootStructure(Material.IRON_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.FISHING_ROD, false), |
||||
new LootStructure(Material.BOW, false), |
||||
}, |
||||
new LootStructure[]{ //Legendary Loot
|
||||
new LootStructure(ArtifactItem.LOST_CORE,1), |
||||
new LootStructure(Material.DIAMOND_SWORD, true), |
||||
new LootStructure(Material.IRON_AXE, true), |
||||
new LootStructure(Material.IRON_PICKAXE, true), |
||||
new LootStructure(Material.IRON_HOE, true), |
||||
new LootStructure(Material.IRON_SPADE, true), |
||||
new LootStructure(Material.FISHING_ROD, true), |
||||
new LootStructure(Material.DIAMOND_CHESTPLATE, true), |
||||
new LootStructure(Material.DIAMOND_LEGGINGS, true), |
||||
new LootStructure(Material.DIAMOND_BOOTS, true), |
||||
new LootStructure(Material.DIAMOND_HELMET, true), |
||||
new LootStructure(Material.FISHING_ROD, true), |
||||
} |
||||
), |
||||
HELLFIRE( |
||||
new LootStructure[]{ //Regular Loot
|
||||
new LootStructure(Material.EMERALD,(int)((Math.random()*3)+1)), |
||||
new LootStructure(Material.DIAMOND,(int)((Math.random()*3)+1)), |
||||
new LootStructure(Material.GOLD_INGOT,(int)((Math.random()*3)+1)), |
||||
}, |
||||
new LootStructure[]{ //Rare Loot
|
||||
new LootStructure(ArtifactItem.DIVINE_ESSENCE,1), |
||||
new LootStructure(Material.EMERALD_BLOCK), |
||||
new LootStructure(Material.DIAMOND_BLOCK,(int)((Math.random()*2)+1)), |
||||
new LootStructure(Material.GOLD_BLOCK), |
||||
new LootStructure(Material.DIAMOND_SWORD, false), |
||||
new LootStructure(Material.GOLD_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.GOLD_CHESTPLATE, false), |
||||
new LootStructure(Material.GOLD_LEGGINGS, false), |
||||
new LootStructure(Material.GOLD_BOOTS, false), |
||||
new LootStructure(Material.GOLD_HELMET, false), |
||||
new LootStructure(Material.BOW, false), |
||||
new LootStructure(Material.FISHING_ROD, false), |
||||
}, |
||||
new LootStructure[]{ //Legendary Loot
|
||||
new LootStructure(ArtifactItem.DIVINE_CORE,1), |
||||
new LootStructure(Material.GOLD_SWORD, true), |
||||
new LootStructure(Material.DIAMOND_SWORD, true), |
||||
new LootStructure(Material.DIAMOND_AXE, true), |
||||
new LootStructure(Material.DIAMOND_PICKAXE, true), |
||||
new LootStructure(Material.DIAMOND_HOE, true), |
||||
new LootStructure(Material.DIAMOND_SPADE, true), |
||||
new LootStructure(Material.DIAMOND_CHESTPLATE, true), |
||||
new LootStructure(Material.DIAMOND_LEGGINGS, true), |
||||
new LootStructure(Material.DIAMOND_BOOTS, true), |
||||
new LootStructure(Material.DIAMOND_HELMET, true), |
||||
new LootStructure(Material.GOLD_CHESTPLATE, true), |
||||
new LootStructure(Material.GOLD_LEGGINGS, true), |
||||
new LootStructure(Material.GOLD_BOOTS, true), |
||||
new LootStructure(Material.GOLD_HELMET, true), |
||||
new LootStructure(Material.BOW, true), |
||||
new LootStructure(Material.FISHING_ROD, true), |
||||
} |
||||
); |
||||
|
||||
LootStructure[] loot_regular; |
||||
LootStructure[] loot_rare; |
||||
LootStructure[] loot_legendary; |
||||
|
||||
private MonsterDifficulty(LootStructure[] loot_regular, LootStructure[] loot_rare, LootStructure[] loot_legendary) { |
||||
this.loot_regular=loot_regular; |
||||
this.loot_rare=loot_rare; |
||||
this.loot_legendary=loot_legendary; |
||||
} |
||||
|
||||
private ItemStack Artifact() { |
||||
sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,3); |
||||
return null; |
||||
} |
||||
|
||||
public List<ItemStack> RandomizeDrops(double dropmult, boolean isBoss) { |
||||
List<ItemStack> droplist = new ArrayList<ItemStack>(); |
||||
dropmult += 1; //Base dropmult is 1.0.
|
||||
|
||||
//Basically for each additional dropmult integer value, the
|
||||
//amount of rolls increases. (A dropmult of 1.0 is required for
|
||||
//an additional roll.)
|
||||
for (int i=0;i<dropmult;i++) { |
||||
//First do a common roll.
|
||||
if (Math.random()<TwosideKeeper.COMMON_DROP_RATE*dropmult && |
||||
this.loot_regular.length>0) { |
||||
//This is a common roll.
|
||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_regular); |
||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2); |
||||
droplist.add(gen_loot); |
||||
} |
||||
//Rare Loot roll.
|
||||
if (Math.random()<TwosideKeeper.RARE_DROP_RATE*dropmult && |
||||
this.loot_rare.length>0) { |
||||
//This is a common roll.
|
||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_rare); |
||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2); |
||||
droplist.add(gen_loot); |
||||
} |
||||
//Legendary Loot roll.
|
||||
if (Math.random()<TwosideKeeper.LEGENDARY_DROP_RATE*dropmult && |
||||
this.loot_legendary.length>0) { |
||||
//This is a common roll.
|
||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary); |
||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2); |
||||
droplist.add(gen_loot); |
||||
} |
||||
if (isBoss) { //50% of the time, we drop something great.
|
||||
if (Math.random()<=0.5 && this.loot_legendary.length>0) { |
||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary); |
||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2); |
||||
droplist.add(gen_loot); |
||||
} |
||||
else |
||||
if (this.loot_rare.length>0) { //Consolation Prize.
|
||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_rare); |
||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2); |
||||
droplist.add(gen_loot); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return droplist; |
||||
} |
||||
|
||||
private ItemStack DistributeRandomLoot(LootStructure[] lootlist) { |
||||
//Choose an item randomly from the loot list.
|
||||
if (lootlist.length>0) { |
||||
//Choose an element.
|
||||
LootStructure ls = lootlist[(int)((Math.random())*lootlist.length)]; |
||||
if (GenericFunctions.isEquip(new ItemStack(ls.GetMaterial()))) { |
||||
//Turn it into a Mega Piece.
|
||||
return Loot.GenerateMegaPiece(ls.GetMaterial(), ls.GetHardened()); |
||||
} else { |
||||
//Turn it into a normal item.
|
||||
return new ItemStack(ls.GetMaterial(),ls.GetAmount()); |
||||
} |
||||
} else { //Something bad happened if we got here...
|
||||
return new ItemStack(Material.AIR); |
||||
} |
||||
} |
||||
} |
||||
|
@ -0,0 +1,33 @@ |
||||
package sig.plugin.TwosideKeeper.Logging; |
||||
|
||||
import java.text.DecimalFormat; |
||||
|
||||
import org.bukkit.ChatColor; |
||||
|
||||
public class MysteriousEssenceLogger { |
||||
int essence_hellfire = 0; |
||||
int essence_other = 0; |
||||
int essence_despawned = 0; |
||||
public MysteriousEssenceLogger() { |
||||
|
||||
} |
||||
public void AddHellfireEssence() { |
||||
essence_hellfire++; |
||||
} |
||||
public void AddGeneralEssence() { |
||||
essence_other++; |
||||
} |
||||
public void AddEssenceDespawn() { |
||||
essence_despawned++; |
||||
} |
||||
public String GenerateReport() { |
||||
DecimalFormat df = new DecimalFormat("0.0"); |
||||
if (essence_hellfire+essence_other>0) { |
||||
return "Total Essences Spawned: "+ChatColor.YELLOW+(essence_hellfire+essence_other)+ChatColor.WHITE+"\n"+ |
||||
"Total Essences from Hellfires: "+ChatColor.YELLOW+essence_hellfire+ChatColor.RED+" ("+df.format(((double)essence_hellfire/(essence_other+essence_hellfire))*100)+"%)\n"+ChatColor.WHITE |
||||
+ "Total Essences Despawned: "+ChatColor.YELLOW+essence_despawned+ChatColor.BLUE+" ("+df.format(((double)essence_despawned/(essence_other+essence_hellfire))*100)+"%)"; |
||||
} else { |
||||
return "Not enough data yet!"; |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue