Modify Zombie Leader HP. Remove unnecssary debug messages. Localized

Name function returns the name of the item if possible. Add Frosted Ice
back into the blacklist of Malleable Base Quest items. Increased loot of
zombie leaders at surface level.
This commit is contained in:
sigonasr2 2016-07-16 11:38:16 -05:00
parent 04cb3b2b55
commit 143f371086
9 changed files with 75 additions and 31 deletions

Binary file not shown.

View File

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

View File

@ -347,6 +347,10 @@ public class GenericFunctions {
}
public static String UserFriendlyMaterialName(ItemStack type) {
if (type.hasItemMeta() &&
type.getItemMeta().hasDisplayName()) {
return type.getItemMeta().getDisplayName();
}
switch (type.getType()) {
case ACACIA_DOOR_ITEM:{
return "Acacia Door";
@ -2213,14 +2217,14 @@ public class GenericFunctions {
}
TwosideKeeper.log("Attack is dealing "+finaldmg, 2);
if (target.getHealth()>finaldmg) {
TwosideKeeper.log("NOT FULL HEALTH. HP: "+target.getHealth(), 2);
//target.setHealth(target.getHealth()-finaldmg);
target.damage(finaldmg);
TwosideKeeper.log("NOT FULL HEALTH. HP: "+target.getHealth(), 5);
target.setHealth(target.getHealth()-finaldmg);
target.damage(0.000001);
target.setNoDamageTicks(20);
} else {
//Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(damager,target,DamageCause.ENTITY_ATTACK,finaldmg));
target.setHealth(0);
//target.damage(999999);
target.setHealth(0.00000000001);
target.damage(99999);
//TwosideKeeper.log("New Health."+target.getHealth(), 2);
target.setNoDamageTicks(20);
}

View File

@ -20,6 +20,9 @@ public class Loot {
ItemStack raresword = new ItemStack(mat_type);
ItemMeta sword_meta = raresword.getItemMeta();
sword_meta.setDisplayName(ChatColor.AQUA+""+ChatColor.BOLD+"Mega "+GenericFunctions.UserFriendlyMaterialName(mat_type));
List<String> fakelore = new ArrayList<String>();
fakelore.add(" ");
sword_meta.setLore(fakelore);
raresword.setItemMeta(sword_meta);
raresword = addEnchantments(raresword,false);
if (hardened) {

View File

@ -219,6 +219,7 @@ public class MalleableBaseQuest {
blacklisted_items.add(Material.FIRE);
blacklisted_items.add(Material.FIREBALL);
blacklisted_items.add(Material.FLOWER_POT);
blacklisted_items.add(Material.FROSTED_ICE);
blacklisted_items.add(Material.GLOWING_REDSTONE_ORE);
blacklisted_items.add(Material.GOLD_RECORD);
blacklisted_items.add(Material.GRASS);

View File

@ -17,9 +17,17 @@ public enum MonsterDifficulty {
},
new LootStructure[]{ //Rare Loot
new LootStructure(Material.STONE_SWORD, false),
new LootStructure(Material.IRON_INGOT),
new LootStructure(Material.DIAMOND),
new LootStructure(Material.GOLD_NUGGET),
},
new LootStructure[]{ //Legendary Loot
new LootStructure(Material.STONE_SWORD, true),
new LootStructure(Material.IRON_INGOT,(int)((Math.random()*3)+1)),
new LootStructure(Material.DIAMOND,(int)((Math.random()*3)+1)),
new LootStructure(Material.GOLD_NUGGET,(int)((Math.random()*3)+1)),
new LootStructure(Material.ENDER_PEARL,(int)((Math.random()*3)+1)),
new LootStructure(Material.ENDER_CHEST),
}
),
DANGEROUS(
@ -217,6 +225,13 @@ public enum MonsterDifficulty {
break;
}
}
if (Math.random()<=0.6) {
switch (this) {
case NORMAL:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE));
break;
}
}
}
if (isBoss) { //50% of the time, we drop something great.
if (Math.random()<=0.5 && this.loot_legendary.length>0) {

View File

@ -48,6 +48,7 @@ public class MonsterController {
if (isZombieLeader(ent)) {
//Zombie leaders have faster movement.
ent.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,999999,1));
//Set the HP of the leader to a more proper amount.
}
if (ylv>=128) {
//This is a 95% chance this will despawn.
@ -563,6 +564,11 @@ public class MonsterController {
m.getEquipment().clear();
RandomizeEquipment(m,1);
}
if(isZombieLeader(m))
{
m.setMaxHealth(13);
m.setHealth(m.getMaxHealth());
}
}break;
case DEADLY: {
String MonsterName = m.getType().toString().toLowerCase();
@ -574,6 +580,11 @@ public class MonsterController {
RandomizeEquipment(m,2);
}
m.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,99999,1));
if(isZombieLeader(m))
{
m.setMaxHealth(26);
m.setHealth(m.getMaxHealth());
}
}break;
case HELLFIRE:{
String MonsterName = m.getType().toString().toLowerCase();
@ -594,6 +605,11 @@ public class MonsterController {
m.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,99999,1));
m.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE,99999,1));
if (Math.random()<=0.2) {m.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,99999,1));}
if(isZombieLeader(m))
{
m.setMaxHealth(54);
m.setHealth(m.getMaxHealth());
}
}break;
default: {
if (isAllowedToEquipItems(m)) {
@ -603,6 +619,11 @@ public class MonsterController {
if (isZombieLeader(m)) {
m.setCustomName(ChatColor.WHITE+"Zombie Leader");
}
if(isZombieLeader(m))
{
m.setMaxHealth(6);
m.setHealth(m.getMaxHealth());
}
}break;
}
return m;

View File

@ -336,15 +336,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
Player p;
//Announce the server has restarted soon after.
if (SERVER_TYPE!=ServerType.QUIET) {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
@Override
public void run() {
boolean sent=false;
do {DiscordMessageSender.sendItalicizedRawMessageDiscord(SERVER_TYPE.GetServerName()+"Server has been restarted.\nRunning v."+Bukkit.getPluginManager().getPlugin("TwosideKeeper").getDescription().getVersion()+" of TwosideKeeper\nRunning v"+Bukkit.getPluginManager().getPlugin("aPlugin").getDescription().getVersion()+" of Jobs.");} while (!Bukkit.getPluginManager().isPluginEnabled("aPlugin"));
}
},100);
}
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
public void run(){
@ -3323,9 +3314,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public void updateHealthbarDamageEvent(EntityDamageEvent ev) {
Entity e = ev.getEntity();
log(ev.getCause().toString(),2);
log(ev.getCause().toString(),5);
log(ev.getDamage()+"",2);
log(ev.getDamage()+"",5);
if (ev.getCause()==DamageCause.FIRE || ev.getCause()==DamageCause.FIRE_TICK ||
ev.getCause()==DamageCause.WITHER || ev.getCause()==DamageCause.POISON
@ -6464,4 +6455,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
finalstring.insert(((vel*93.182445)<20)?(int)((vel*93.182445)+12):31, ChatColor.GRAY+"");
return finalstring.toString();
}
public static void announcePluginVersions() {
if (SERVER_TYPE!=ServerType.QUIET) {
DiscordMessageSender.sendItalicizedRawMessageDiscord(SERVER_TYPE.GetServerName()+"Server has been restarted.\nRunning v."+Bukkit.getPluginManager().getPlugin("TwosideKeeper").getDescription().getVersion()+" of TwosideKeeper\nRunning v"+Bukkit.getPluginManager().getPlugin("aPlugin").getDescription().getVersion()+" of Jobs.");
}
}
}

View File

@ -121,6 +121,9 @@ public final class TwosideKeeperAPI {
public static ServerType getServerType() {
return TwosideKeeper.getServerType();
}
public static void announcePluginVersions() {
TwosideKeeper.announcePluginVersions();
}
//Party COMMANDS.
public static List<Player> getPartyMembers(Player p) {