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.
dev
sigonasr2 9 years ago
parent 04cb3b2b55
commit 143f371086
  1. BIN
      TwosideKeeper.jar
  2. 2
      src/plugin.yml
  3. 14
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  4. 3
      src/sig/plugin/TwosideKeeper/HelperStructures/Loot.java
  5. 1
      src/sig/plugin/TwosideKeeper/HelperStructures/MalleableBaseQuest.java
  6. 41
      src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java
  7. 21
      src/sig/plugin/TwosideKeeper/MonsterController.java
  8. 21
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java
  9. 3
      src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java

Binary file not shown.

@ -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.

@ -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);
}

@ -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) {

@ -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);

@ -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(
@ -202,19 +210,26 @@ public enum MonsterDifficulty {
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4);
droplist.add(gen_loot);
if (Math.random()<=0.2) {
switch (this) {
case DANGEROUS:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE));
break;
case DEADLY:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.LOST_CORE));
break;
case HELLFIRE:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
break;
case NORMAL:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE));
break;
switch (this) {
case DANGEROUS:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE));
break;
case DEADLY:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.LOST_CORE));
break;
case HELLFIRE:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
break;
case NORMAL:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE));
break;
}
}
if (Math.random()<=0.6) {
switch (this) {
case NORMAL:
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE));
break;
}
}
}

@ -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;

@ -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
@ -3860,7 +3851,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.playSound(p.getLocation(), Sound.BLOCK_SAND_BREAK, 1.0f, 1.0f);
}
}
}
}
//Detect all nearby mobs and knock them up. Deal damage to them as well.
List<Entity> nearby = p.getNearbyEntities(2, 2, 2);
for (int i=0;i<nearby.size();i++) {
@ -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.");
}
}
}

@ -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) {

Loading…
Cancel
Save