ESSENCES.

This commit is contained in:
sigonasr2 2017-01-18 22:49:27 -06:00
parent 6fb872b5ee
commit 28bb2cc3fe
8 changed files with 61 additions and 16 deletions

Binary file not shown.

View File

@ -1195,7 +1195,8 @@ public class CustomDamage {
}
private static void subtractWeaponDurability(Player p,ItemStack weapon) {
aPlugin.API.damageItem(p.getInventory(), weapon, 1);
//aPlugin.API.damageItem(p.getInventory(), weapon, 1);
aPlugin.API.damageItem(p, weapon, 1);
}
static void triggerEliteEvent(Player p, Entity damager) {
@ -1385,11 +1386,13 @@ public class CustomDamage {
}
static void leaderRallyNearbyMonsters(Monster m, Player p) {
LivingEntityStructure les = LivingEntityStructure.getLivingEntityStructure(m);
if ((MonsterController.isZombieLeader(m) || (
m.getCustomName()!=null && m.getCustomName().contains(ChatColor.MAGIC+"")
)) &&
!m.hasPotionEffect(PotionEffectType.GLOWING)) {
!m.hasPotionEffect(PotionEffectType.GLOWING) && !les.hasRallied) {
rallyNearbyMonsters(m,p,24);
les.hasRallied=true;
}
}
@ -1401,6 +1404,7 @@ public class CustomDamage {
mm.setTarget(p);
LivingEntityStructure ms = LivingEntityStructure.getLivingEntityStructure(mm);
ms.SetTarget(p);
ms.hasRallied=true;
}
}
}

View File

@ -154,7 +154,7 @@ public class SigDrop extends Drop{
} else {
set = LivingEntityDifficulty.PickAnItemSet(PlayerMode.getPlayerMode(p),diff2); //This is the set we have to generate.
}
TwosideKeeper.log("Set Chosen: "+set, 0);
TwosideKeeper.log("Set Chosen: "+set, 5);
//Turn it into the appropriate piece if necessary.
item = LivingEntityDifficulty.ConvertSetPieceIfNecessary(item, set);
@ -164,7 +164,7 @@ public class SigDrop extends Drop{
}
item = Loot.GenerateSetPiece(item, set, isHardened, tierbonus);
TwosideKeeper.log("Final Item: "+item, 0);
TwosideKeeper.log("Final Item: "+item, 5);
} else {
item = Loot.GenerateMegaPiece(item.getType(), isHardened);
}

View File

@ -3338,7 +3338,7 @@ public class GenericFunctions {
ItemUtils.addLore(item, ChatColor.AQUA+"Filtering:");
for (ItemStack it : items) {
if (ItemUtils.isValidItem(it)) {
ItemUtils.addLore(item, ChatColor.DARK_AQUA+" - "+GenericFunctions.UserFriendlyMaterialName(it.getType(),it.getDurability()));
ItemUtils.addLore(item, ChatColor.DARK_AQUA+" - "+GenericFunctions.UserFriendlyMaterialName(it.getType(),it.getDurability())+(it.getItemMeta().hasLore()?ChatColor.AQUA+" w/Lore":""));
}
}
}

View File

@ -106,7 +106,9 @@ public class InventoryUtils {
}
public static boolean InventoryContainSameMaterial(Inventory inv, ItemStack item) {
for (ItemStack i : inv.getContents()) {
if (i!=null && item!=null && i.getType()==item.getType()) {
if (i!=null && item!=null && i.getType()==item.getType() && (
(i.getItemMeta().hasLore() && item.getItemMeta().hasLore()) ||
(!i.getItemMeta().hasLore() && !item.getItemMeta().hasLore()))) {
return true;
}
}

View File

@ -24,6 +24,7 @@ public class LivingEntityStructure {
//public long lastSpiderBallThrow = 0;
public BossMonster bm = null;
public boolean checkedforcubes=false;
public boolean hasRallied=false;
public LivingEntityStructure(LivingEntity m) {
target=null;

View File

@ -6693,24 +6693,60 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (isBoss && Math.random()<=0.5) {
LivingEntityDifficulty diff = MonsterController.getLivingEntityDifficulty(m);
if (diff==LivingEntityDifficulty.END && Math.random()<=0.5) {
diff = LivingEntityDifficulty.HELLFIRE;
}
if (diff==LivingEntityDifficulty.HELLFIRE && Math.random()<=0.5) {
diff = LivingEntityDifficulty.DEADLY;
}
if (diff==LivingEntityDifficulty.DEADLY && Math.random()<=0.5) {
diff = LivingEntityDifficulty.DANGEROUS;
}
if (diff==LivingEntityDifficulty.DANGEROUS && Math.random()<=0.5) {
diff = LivingEntityDifficulty.NORMAL;
}
switch (diff) {
case DANGEROUS:
droplist.add(Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE));
if (m.getWorld().getName().equalsIgnoreCase("world")) {
droplist.add(Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE));
} else {
droplist.add(Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE));
}
break;
case DEADLY:
droplist.add(Artifact.createArtifactItem(ArtifactItem.LOST_CORE));
if (m.getWorld().getName().equalsIgnoreCase("world")) {
droplist.add(Artifact.createArtifactItem(ArtifactItem.LOST_ESSENCE));
} else {
droplist.add(Artifact.createArtifactItem(ArtifactItem.LOST_CORE));
}
break;
case ELITE:
droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
if (m.getWorld().getName().equalsIgnoreCase("world")) {
droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE));
} else {
droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
}
break;
case END:
droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
if (m.getWorld().getName().equalsIgnoreCase("world")) {
droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE));
} else {
droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
}
break;
case HELLFIRE:
droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
if (m.getWorld().getName().equalsIgnoreCase("world")) {
droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE));
} else {
droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
}
break;
default:
droplist.add(Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE));
if (m.getWorld().getName().equalsIgnoreCase("world")) {
droplist.add(Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE));
} else {
droplist.add(Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE));
}
}
}
}
@ -9885,7 +9921,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
public static void breakdownItem(ItemStack item, Player p) {
SoundUtils.playLocalSound(p, Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f);
p.sendMessage(ChatColor.DARK_RED+"Your "+ChatColor.YELLOW+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(item))+ChatColor.DARK_RED+" has broken!");
if (p!=null) {
SoundUtils.playLocalSound(p, Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f);
p.sendMessage(ChatColor.DARK_RED+"Your "+ChatColor.YELLOW+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(item))+ChatColor.DARK_RED+" has broken!");
}
}
}

View File

@ -858,9 +858,9 @@ final class runServerHeartbeat implements Runnable {
private void randomlyAggroNearbyEndermen(Player p) {
//List<LivingEntity> ents = GenericFunctions.getNearbyMobs(p.getLocation(), 16);
List<Monster> ments = CustomDamage.trimNonMonsterEntities(p.getNearbyEntities(16, 16, 16));
List<Monster> ments = CustomDamage.trimNonMonsterEntities(p.getNearbyEntities(8, 8, 8));
for (Monster m : ments) {
if (Math.random()<=0.05 && !m.hasPotionEffect(PotionEffectType.GLOWING)) {
if (!m.isDead() && Math.random()<=0.05 && !m.hasPotionEffect(PotionEffectType.GLOWING)) {
m.setTarget(p);
}
}