This commit is contained in:
sigonasr2 2016-08-10 00:42:09 -05:00
parent b456d43c3f
commit 26a2339f98
8 changed files with 89 additions and 36 deletions

Binary file not shown.

View File

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

View File

@ -481,4 +481,8 @@ public class EliteMonster {
Location l = getNearbyFreeLocation(m.getLocation(),24);
m.teleport(l);
}
public void removeAllHealthbars() {
bar.removeAll();
}
}

View File

@ -3069,12 +3069,24 @@ public class GenericFunctions {
b.getType()==Material.GRASS ||
b.getType()==Material.GRAVEL ||
b.getType()==Material.CLAY ||
b.getType()==Material.HARD_CLAY ||
b.getType()==Material.STAINED_CLAY ||
b.getType()==Material.ENDER_STONE ||
b.getType()==Material.SOIL ||
b.getType()==Material.SNOW ||
b.getType()==Material.SOUL_SAND ||
b.getType()==Material.STONE ||
b.getType()==Material.COBBLESTONE ||
b.getType()==Material.NETHERRACK) {
b.getType()==Material.NETHERRACK ||
b.getType()==Material.WOOL ||
b.getType()==Material.WOOD ||
b.getType()==Material.COAL_ORE ||
b.getType()==Material.DIAMOND_ORE ||
b.getType()==Material.GOLD_ORE ||
b.getType()==Material.IRON_ORE ||
b.getType()==Material.REDSTONE_ORE ||
b.getType()==Material.LAPIS_ORE ||
b.getType()==Material.EMERALD_ORE) {
return true;
} else {
return false;
@ -3393,7 +3405,8 @@ public class GenericFunctions {
randomz = (int)((Math.random()*10000) - 5000);
testloc = new Location(Bukkit.getWorld("world"),randomx,96,randomz);
testloc.getChunk().load(); } while
(testloc.getBlock().getType()!=Material.AIR || testloc.getBlock().getRelative(0, 1, 0).getType()!=Material.AIR);
((testloc.getBlock().getType()!=Material.AIR || testloc.getBlock().getRelative(0, 1, 0).getType()!=Material.AIR) &&
AllNaturalBlocks(testloc.getBlock(),16,8,16));
return new Location(Bukkit.getWorld("world"),randomx,testloc.getBlockY(),randomz);
}
@ -3427,4 +3440,34 @@ public class GenericFunctions {
}
return m;
}
public static boolean AllNaturalBlocks(Block b, int x, int y, int z) {
for (int i=-x/2;i<x/2+1;i++) {
for (int j=-y/2;j<y/2+1;j++) {
for (int k=-z/2;k<z/2+1;k++) {
if (!isNaturalBlock(b.getRelative(i, j, k))) {
return false;
}
}
}
}
return true;
}
private static boolean isNaturalBlock(Block b) {
if (b.getType()==Material.DIRT ||
b.getType()==Material.SAND ||
b.getType()==Material.AIR ||
b.getType()==Material.CLAY ||
b.getType()==Material.GRASS ||
b.getType()==Material.STONE ||
b.getType()==Material.WATER ||
b.getType()==Material.LAVA ||
b.getType()==Material.NETHERRACK ||
b.getType()==Material.ENDER_STONE ||
b.getType()==Material.COBBLESTONE) {
return true;
}
return false;
}
}

View File

@ -188,42 +188,25 @@ public enum MonsterDifficulty {
new LootStructure(Material.REDSTONE_BLOCK),
new LootStructure(Material.IRON_BLOCK),
new LootStructure(Material.LAPIS_BLOCK),
new LootStructure(Material.BOW, true),
new LootStructure(Material.FISHING_ROD, 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.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.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, true),
new LootStructure(Material.BOW, false),
new LootStructure(Material.FISHING_ROD, true),
new LootStructure(Material.GOLD_SWORD, true),
new LootStructure(Material.GOLD_AXE, true),
new LootStructure(Material.GOLD_PICKAXE, true),
new LootStructure(Material.GOLD_HOE, true),
new LootStructure(Material.GOLD_SPADE, 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.LEATHER_HELMET,4),
new LootStructure(Material.LEATHER_CHESTPLATE,4),
new LootStructure(Material.LEATHER_LEGGINGS,4),
new LootStructure(Material.LEATHER_BOOTS,4),
},
new LootStructure[]{ //Legendary Loot
new LootStructure(Material.PRISMARINE_SHARD),
new LootStructure(Material.POTION),
new LootStructure(Material.GOLD_SWORD, true, 1),
new LootStructure(Material.GOLD_AXE, true, 1),
new LootStructure(Material.GOLD_PICKAXE, true, 1),
@ -233,6 +216,23 @@ public enum MonsterDifficulty {
new LootStructure(Material.GOLD_LEGGINGS, true, 1),
new LootStructure(Material.GOLD_BOOTS, true, 1),
new LootStructure(Material.GOLD_HELMET, true, 1),
new LootStructure(Material.LEATHER_HELMET,4),
new LootStructure(Material.LEATHER_CHESTPLATE,4),
new LootStructure(Material.LEATHER_LEGGINGS,4),
new LootStructure(Material.LEATHER_BOOTS,4),
},
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),
}
);

View File

@ -155,6 +155,7 @@ public class MonsterController {
&& ent.getWorld().equals(Bukkit.getWorld("world"))) {
TwosideKeeper.log("Trying for an elite monster.", 4);
if (GenericFunctions.PercentBlocksAroundArea(ent.getLocation().getBlock(),Material.AIR,16,8,16)>=75 &&
GenericFunctions.AllNaturalBlocks(ent.getLocation().getBlock(),16,8,16) &&
ent.getNearbyEntities(128, 32, 128).size()<=2) {
TwosideKeeper.LAST_ELITE_SPAWN=TwosideKeeper.getServerTickTime();
return true;

View File

@ -1215,6 +1215,8 @@ public class NewCombat {
}
double setbonus = 1.0;
if (target instanceof Player) {
Player p = (Player)target;
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
@ -1236,7 +1238,7 @@ public class NewCombat {
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())) {
dmgreduction /= ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())?2:1;
}
dmgreduction *= 1.0+(ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 4, 4)/100d);
setbonus = ((100-ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 4, 4))/100d);
}
//Blocking: -((p.isBlocking())?ev.getDamage()*0.33:0) //33% damage will be reduced if we are blocking.
@ -1251,6 +1253,7 @@ public class NewCombat {
*((10-resistlevel)*0.1)
*((100-protectionlevel)*0.01)
*((10-partylevel)*0.1)
*setbonus
*((target instanceof Player && ((Player)target).isBlocking())?(GenericFunctions.isDefender((Player)target))?0.30:0.50:1)
*((target instanceof Player)?((GenericFunctions.isDefender((Player)target))?0.9:(target.getEquipment().getItemInOffHand()!=null && target.getEquipment().getItemInOffHand().getType()==Material.SHIELD)?0.95:1):1);

View File

@ -993,7 +993,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (p.getLocation().add(0,0,0).getBlock().getType()==Material.PISTON_MOVING_PIECE) {
p.getLocation().add(0,0,0).getBlock().setType(Material.AIR);
}
if (SERVER_TYPE==ServerType.TEST || SERVER_TYPE==ServerType.QUIET) {
if (SERVER_TYPE==ServerType.TEST || SERVER_TYPE==ServerType.QUIET || p.isOp()) {
Monster m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.ZOMBIE), MonsterDifficulty.ELITE);
m.setHealth(m.getMaxHealth()/16d);
//TwosideKeeperAPI.spawnAdjustedMonster(MonsterType.GIANT, p.getLocation());
@ -4554,12 +4554,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
Player pl = participants.get(i);
ExperienceOrb exp = GenericFunctions.spawnXP(pl.getLocation(), ev.getDroppedExp()*300);
exp.setInvulnerable(true);
List<ItemStack> generatedloot = MonsterController.getMonsterDifficulty((Monster)ev.getEntity()).RandomizeDrops(dropmult/participants.size(),false,false);
/*List<ItemStack> generatedloot = MonsterController.getMonsterDifficulty((Monster)ev.getEntity()).RandomizeDrops(dropmult/participants.size(),false,false);
for (int j=0;j<generatedloot.size();j++) {
Item it = pl.getWorld().dropItemNaturally(pl.getLocation(),generatedloot.get(j));
it.setInvulnerable(true);
log("Dropping "+generatedloot.get(j).toString(),2);
}
}*/
if (participants_list.length()<1) {
participants_list.append(pl.getName());
} else {
@ -4579,6 +4579,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
m.getWorld().spawnEntity(m.getLocation(), EntityType.LIGHTNING);
m.getWorld().setStorm(true);
m.getWorld().setWeatherDuration(20*60*15);
em.removeAllHealthbars();
elitemonsters.remove(em);
GenericFunctions.generateNewElite();
}