r270. Fixed a few bugs. Not ready for release. Unknown max health bug.
This commit is contained in:
parent
1382c3d4dc
commit
84e20c4f3f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1116,6 +1116,7 @@ public void runTick() {
|
|||||||
enderdragon.setRemoveWhenFarAway(false);
|
enderdragon.setRemoveWhenFarAway(false);
|
||||||
//enderdragon.teleport(new Location(p.getWorld(),p.getLocation().getBlockX()+i,-250,p.getLocation().getBlockZ()+j));
|
//enderdragon.teleport(new Location(p.getWorld(),p.getLocation().getBlockX()+i,-250,p.getLocation().getBlockZ()+j));
|
||||||
//p.sendMessage(ChatColor.DARK_PURPLE+"You feel a dark presence nearby.");
|
//p.sendMessage(ChatColor.DARK_PURPLE+"You feel a dark presence nearby.");
|
||||||
|
Bukkit.getPlayer("sigonasr2").sendMessage("Trigger this.");
|
||||||
zombie.setRemoveWhenFarAway(false);
|
zombie.setRemoveWhenFarAway(false);
|
||||||
zombie.setMaxHealth(300);
|
zombie.setMaxHealth(300);
|
||||||
zombie.setHealth(300);
|
zombie.setHealth(300);
|
||||||
@ -1505,7 +1506,7 @@ public void runTick() {
|
|||||||
//l.setCustomNameVisible(true);
|
//l.setCustomNameVisible(true);
|
||||||
l.setMaxHealth(l.getMaxHealth()+20);
|
l.setMaxHealth(l.getMaxHealth()+20);
|
||||||
}
|
}
|
||||||
l.setHealth(l.getMaxHealth()*0.95d);
|
l.setHealth(l.getMaxHealth());
|
||||||
} else {
|
} else {
|
||||||
if (Math.random()<=0.10+((heightmodifier-l.getLocation().getY())*0.01d)) {
|
if (Math.random()<=0.10+((heightmodifier-l.getLocation().getY())*0.01d)) {
|
||||||
if (Math.random()<=0.25) {
|
if (Math.random()<=0.25) {
|
||||||
@ -1521,8 +1522,8 @@ public void runTick() {
|
|||||||
l.getEquipment().setHelmet(new ItemStack(Material.AIR));
|
l.getEquipment().setHelmet(new ItemStack(Material.AIR));
|
||||||
Zombie g = (Zombie)l;
|
Zombie g = (Zombie)l;
|
||||||
g.setBaby(true);
|
g.setBaby(true);
|
||||||
//l.setMaxHealth(l.getMaxHealth()+20);
|
l.setMaxHealth(l.getMaxHealth()*0.65d);
|
||||||
l.setHealth(l.getMaxHealth()*0.65d);
|
l.setHealth(l.getMaxHealth());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1912,6 +1912,8 @@ public class PlayerListener
|
|||||||
boolean despawn=true;
|
boolean despawn=true;
|
||||||
if (entity instanceof Monster) {
|
if (entity instanceof Monster) {
|
||||||
LivingEntity test = (LivingEntity)entity;
|
LivingEntity test = (LivingEntity)entity;
|
||||||
|
test.setMaxHealth(10);
|
||||||
|
test.setHealth(test.getMaxHealth());
|
||||||
boolean block=false;
|
boolean block=false;
|
||||||
if (test.getCustomName()!=null && (test.getCustomName().contains(ChatColor.DARK_PURPLE+"") || test.getCustomName().contains(ChatColor.DARK_AQUA+"Polymorphed Creature"))) {
|
if (test.getCustomName()!=null && (test.getCustomName().contains(ChatColor.DARK_PURPLE+"") || test.getCustomName().contains(ChatColor.DARK_AQUA+"Polymorphed Creature"))) {
|
||||||
for (int i=-2;i<3;i++) {
|
for (int i=-2;i<3;i++) {
|
||||||
@ -2753,7 +2755,7 @@ public class PlayerListener
|
|||||||
//Wear diamond armor almost always. Enchanted diamond pieces here and there.
|
//Wear diamond armor almost always. Enchanted diamond pieces here and there.
|
||||||
if (entity.getType()==EntityType.SKELETON || entity.getType()==EntityType.ZOMBIE) {
|
if (entity.getType()==EntityType.SKELETON || entity.getType()==EntityType.ZOMBIE) {
|
||||||
LivingEntity l = (LivingEntity) entity;
|
LivingEntity l = (LivingEntity) entity;
|
||||||
l.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST,999999,1));
|
//l.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST,999999,1));
|
||||||
l.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,999999,1));
|
l.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,999999,1));
|
||||||
l.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,999999,0));
|
l.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,999999,0));
|
||||||
l.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE,999999,0));
|
l.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE,999999,0));
|
||||||
@ -6343,14 +6345,22 @@ public ItemStack getGoodie() {
|
|||||||
if (m.getType()!=EntityType.ENDER_DRAGON && m.getType()!=EntityType.WITHER) {
|
if (m.getType()!=EntityType.ENDER_DRAGON && m.getType()!=EntityType.WITHER) {
|
||||||
if (m.getCustomName()==null) {
|
if (m.getCustomName()==null) {
|
||||||
if (m.getMaxHealth()>65) {
|
if (m.getMaxHealth()>65) {
|
||||||
|
Bukkit.broadcastMessage("This mob had too much HP. HP: "+m.getMaxHealth());
|
||||||
m.setMaxHealth(65); //65 HP cap.
|
m.setMaxHealth(65); //65 HP cap.
|
||||||
m.setHealth(m.getMaxHealth());
|
m.setHealth(65);
|
||||||
|
m.setCustomName("Super Mob");
|
||||||
|
m.setCustomNameVisible(true);
|
||||||
|
Bukkit.broadcastMessage("This mob had too much HP. Lowered to "+m.getHealth()+"/"+m.getMaxHealth());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!m.getCustomName().contains(ChatColor.DARK_PURPLE+"")) { //Make sure it's not a boss.
|
if (!m.getCustomName().contains(ChatColor.DARK_PURPLE+"")) { //Make sure it's not a boss.
|
||||||
if (m.getMaxHealth()>65) {
|
if (m.getMaxHealth()>65) {
|
||||||
|
Bukkit.broadcastMessage("This mob had too much HP. HP: "+m.getMaxHealth());
|
||||||
m.setMaxHealth(65); //65 HP cap.
|
m.setMaxHealth(65); //65 HP cap.
|
||||||
m.setHealth(m.getMaxHealth());
|
m.setHealth(65);
|
||||||
|
m.setCustomName("Super Mob");
|
||||||
|
m.setCustomNameVisible(true);
|
||||||
|
Bukkit.broadcastMessage("This mob had too much HP. Lowered to "+m.getHealth()+"/"+m.getMaxHealth());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6363,14 +6373,22 @@ public ItemStack getGoodie() {
|
|||||||
if (m.getType()!=EntityType.ENDER_DRAGON && m.getType()!=EntityType.WITHER) {
|
if (m.getType()!=EntityType.ENDER_DRAGON && m.getType()!=EntityType.WITHER) {
|
||||||
if (m.getCustomName()==null) {
|
if (m.getCustomName()==null) {
|
||||||
if (m.getMaxHealth()>65) {
|
if (m.getMaxHealth()>65) {
|
||||||
|
Bukkit.broadcastMessage("This mob had too much HP. HP: "+m.getMaxHealth());
|
||||||
m.setMaxHealth(65); //65 HP cap.
|
m.setMaxHealth(65); //65 HP cap.
|
||||||
m.setHealth(m.getMaxHealth());
|
//m.setHealth(65);
|
||||||
|
m.setCustomName("Super Mob");
|
||||||
|
m.setCustomNameVisible(true);
|
||||||
|
Bukkit.broadcastMessage("This mob had too much HP. Lowered to "+m.getHealth()+"/"+m.getMaxHealth());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!m.getCustomName().contains(ChatColor.DARK_PURPLE+"")) { //Make sure it's not a boss.
|
if (!m.getCustomName().contains(ChatColor.DARK_PURPLE+"")) { //Make sure it's not a boss.
|
||||||
if (m.getMaxHealth()>65) {
|
if (m.getMaxHealth()>65) {
|
||||||
|
Bukkit.broadcastMessage("This mob had too much HP. HP: "+m.getMaxHealth());
|
||||||
m.setMaxHealth(65); //65 HP cap.
|
m.setMaxHealth(65); //65 HP cap.
|
||||||
m.setHealth(m.getMaxHealth());
|
m.setHealth(65);
|
||||||
|
m.setCustomName("Super Mob");
|
||||||
|
m.setCustomNameVisible(true);
|
||||||
|
Bukkit.broadcastMessage("This mob had too much HP. Lowered to "+m.getHealth()+"/"+m.getMaxHealth());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6378,6 +6396,7 @@ public ItemStack getGoodie() {
|
|||||||
}
|
}
|
||||||
final LivingEntity l = (LivingEntity)e.getEntity();
|
final LivingEntity l = (LivingEntity)e.getEntity();
|
||||||
if (l.getCustomName()!=null && l.getCustomName().contains(ChatColor.DARK_PURPLE+"")) {
|
if (l.getCustomName()!=null && l.getCustomName().contains(ChatColor.DARK_PURPLE+"")) {
|
||||||
|
Bukkit.getPlayer("sigonasr2").sendMessage("Entered Boss Entity hit loop.");
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -10631,25 +10650,6 @@ public void onEntityExpode(ExplosionPrimeEvent e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<Entity> nearby = p.getNearbyEntities(30, 30, 30);
|
|
||||||
for (int i=0;i<nearby.size();i++) {
|
|
||||||
if (nearby.get(i).getType()==EntityType.ZOMBIE ||
|
|
||||||
nearby.get(i).getType()==EntityType.SPIDER ||
|
|
||||||
nearby.get(i).getType()==EntityType.SKELETON ||
|
|
||||||
nearby.get(i).getType()==EntityType.CREEPER ||
|
|
||||||
nearby.get(i).getType()==EntityType.PIG_ZOMBIE ||
|
|
||||||
nearby.get(i).getType()==EntityType.ENDERMAN ||
|
|
||||||
nearby.get(i).getType()==EntityType.GHAST ||
|
|
||||||
nearby.get(i).getType()==EntityType.MAGMA_CUBE) {
|
|
||||||
LivingEntity l = (LivingEntity)nearby.get(i);
|
|
||||||
if (l.getCustomName()!=null && l.getCustomName().contains(ChatColor.DARK_PURPLE+"")) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
nearby.get(i).remove();
|
|
||||||
}
|
|
||||||
//Delete it from existence.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!this.plugin.PlayerinJob(p, "Explorer") || (this.plugin.PlayerinJob(p, "Explorer") && this.plugin.getJobLv("Explorer", p)<20)) {
|
if (!this.plugin.PlayerinJob(p, "Explorer") || (this.plugin.PlayerinJob(p, "Explorer") && this.plugin.getJobLv("Explorer", p)<20)) {
|
||||||
double balance = Main.economy.getBalance(p.getName());
|
double balance = Main.economy.getBalance(p.getName());
|
||||||
double lose = this.plugin.getConfig().getDouble("losemoney.LoseAmount");
|
double lose = this.plugin.getConfig().getDouble("losemoney.LoseAmount");
|
||||||
|
@ -24,6 +24,9 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Monster;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
@ -1462,6 +1465,18 @@ public String convertToItemName(String val) {
|
|||||||
teleportloc.setWorld(Bukkit.getWorld(deathWorld));
|
teleportloc.setWorld(Bukkit.getWorld(deathWorld));
|
||||||
//p.sendMessage("Got 6.");
|
//p.sendMessage("Got 6.");
|
||||||
p.teleport(teleportloc);
|
p.teleport(teleportloc);
|
||||||
|
List<Entity> nearby = p.getNearbyEntities(30, 30, 30);
|
||||||
|
for (int i=0;i<nearby.size();i++) {
|
||||||
|
if (nearby.get(i) instanceof Monster) {
|
||||||
|
LivingEntity l = (LivingEntity)nearby.get(i);
|
||||||
|
if (l.getCustomName()!=null && l.getCustomName().contains(ChatColor.DARK_PURPLE+"") && l.getCustomName().contains(ChatColor.DARK_AQUA+"")) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
nearby.get(i).remove();
|
||||||
|
}
|
||||||
|
//Delete it from existence.
|
||||||
|
}
|
||||||
|
}
|
||||||
//p.sendMessage("Got 7.");
|
//p.sendMessage("Got 7.");
|
||||||
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" decided to revive to their death location.");
|
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" decided to revive to their death location.");
|
||||||
} else {
|
} else {
|
||||||
@ -1503,6 +1518,12 @@ public String convertToItemName(String val) {
|
|||||||
if (target == null) {
|
if (target == null) {
|
||||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||||
} else {
|
} else {
|
||||||
|
boolean is_in_vehicle = false;
|
||||||
|
Entity vehicle = null;
|
||||||
|
if (p.isInsideVehicle()) {
|
||||||
|
is_in_vehicle=true;
|
||||||
|
vehicle = p.getVehicle();
|
||||||
|
}
|
||||||
if (target.getName() == this.plugin.getAccountsConfig().getString(p.getName() + ".teleplayer")) {
|
if (target.getName() == this.plugin.getAccountsConfig().getString(p.getName() + ".teleplayer")) {
|
||||||
//Determine distance of player to other player.
|
//Determine distance of player to other player.
|
||||||
double otherx = target.getLocation().getX();
|
double otherx = target.getLocation().getX();
|
||||||
@ -1523,7 +1544,20 @@ public String convertToItemName(String val) {
|
|||||||
}
|
}
|
||||||
p.sendMessage("Teleported to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" for $"+ChatColor.YELLOW+df.format(finalcost)+ChatColor.WHITE+". New Account balance: $"+df.format(mymoney-finalcost));
|
p.sendMessage("Teleported to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" for $"+ChatColor.YELLOW+df.format(finalcost)+ChatColor.WHITE+". New Account balance: $"+df.format(mymoney-finalcost));
|
||||||
target.sendMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" teleported to your location.");
|
target.sendMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" teleported to your location.");
|
||||||
|
if (is_in_vehicle) {
|
||||||
|
vehicle.eject();
|
||||||
|
p.eject();
|
||||||
|
final Player p2 = p;
|
||||||
|
final Player target2 = target;
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
p2.teleport(target2);
|
||||||
|
}
|
||||||
|
},5);
|
||||||
|
} else {
|
||||||
p.teleport(target);
|
p.teleport(target);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage("You need $"+ChatColor.YELLOW+df.format(finalcost)+" in the bank to teleport to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+"!");
|
p.sendMessage("You need $"+ChatColor.YELLOW+df.format(finalcost)+" in the bank to teleport to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+"!");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user