Small updates. Added /stats command. Updated ways to get Mysterious
essences. Lowered drop rate of other artifact items.
This commit is contained in:
parent
d72d498c36
commit
511a13f053
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
name: TwosideKeeper
|
name: TwosideKeeper
|
||||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||||
version: 3.4.7c
|
version: 3.4.7d
|
||||||
commands:
|
commands:
|
||||||
money:
|
money:
|
||||||
description: Tells the player the amount of money they are holding.
|
description: Tells the player the amount of money they are holding.
|
||||||
@ -72,3 +72,8 @@ commands:
|
|||||||
usage: /tp_world <world> <x> <y> <z>
|
usage: /tp_world <world> <x> <y> <z>
|
||||||
permission: TwosideKeeper.tp_world
|
permission: TwosideKeeper.tp_world
|
||||||
permission-message: No permissions!
|
permission-message: No permissions!
|
||||||
|
stats:
|
||||||
|
description: Display statistics for damage and defense.
|
||||||
|
usage: /stats [username]
|
||||||
|
permission: TwosideKeeper.money
|
||||||
|
permission-message: No permissions!
|
@ -76,13 +76,13 @@ public class AutoUpdatePlugin implements Runnable {
|
|||||||
DiscordMessageSender.sendItalicizedRawMessageDiscord("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+". The server will restart in 3 minutes!");
|
DiscordMessageSender.sendItalicizedRawMessageDiscord("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+". The server will restart in 3 minutes!");
|
||||||
Bukkit.broadcastMessage("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+". The server will restart in 3 minutes!");
|
Bukkit.broadcastMessage("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(i).name+". The server will restart in 3 minutes!");
|
||||||
//Move the file to the new location.
|
//Move the file to the new location.
|
||||||
try {
|
/*try {
|
||||||
FileUtils.copyFile(new File(TwosideKeeper.filesave,"updates/"+plugins.get(i).name),
|
FileUtils.copyFile(new File(TwosideKeeper.filesave,"updates/"+plugins.get(i).name),
|
||||||
new File(TwosideKeeper.filesave,"../"+plugins.get(i).name+".jar"));
|
new File(TwosideKeeper.filesave,"../"+plugins.get(i).name+".jar"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (restarting) {
|
if (restarting) {
|
||||||
|
@ -83,7 +83,7 @@ public class Loot {
|
|||||||
return enchantment_level;
|
return enchantment_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ItemStack addEnchantments(ItemStack item, boolean hardened) {
|
public static ItemStack addEnchantments(ItemStack item, boolean hardened) {
|
||||||
if (GenericFunctions.isHarvestingTool(item)) {
|
if (GenericFunctions.isHarvestingTool(item)) {
|
||||||
item.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, GetEnchantmentLevels(item.getType(),hardened));
|
item.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, GetEnchantmentLevels(item.getType(),hardened));
|
||||||
item.addUnsafeEnchantment(Enchantment.DIG_SPEED, GetEnchantmentLevels(item.getType(),hardened));
|
item.addUnsafeEnchantment(Enchantment.DIG_SPEED, GetEnchantmentLevels(item.getType(),hardened));
|
||||||
@ -123,7 +123,7 @@ public class Loot {
|
|||||||
if (Math.random()<0.2*HARDENED_ENCHANT_MULT && item.getType().toString().contains("HELMET")) {item.addUnsafeEnchantment(Enchantment.OXYGEN, 3);}
|
if (Math.random()<0.2*HARDENED_ENCHANT_MULT && item.getType().toString().contains("HELMET")) {item.addUnsafeEnchantment(Enchantment.OXYGEN, 3);}
|
||||||
if (Math.random()<0.2*HARDENED_ENCHANT_MULT && item.getType().toString().contains("BOOTS")) {item.addUnsafeEnchantment(Enchantment.FROST_WALKER, GetEnchantmentLevels(item.getType(),hardened));}
|
if (Math.random()<0.2*HARDENED_ENCHANT_MULT && item.getType().toString().contains("BOOTS")) {item.addUnsafeEnchantment(Enchantment.FROST_WALKER, GetEnchantmentLevels(item.getType(),hardened));}
|
||||||
if (Math.random()<0.08*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.THORNS, GetEnchantmentLevels(item.getType(),hardened));}
|
if (Math.random()<0.08*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.THORNS, GetEnchantmentLevels(item.getType(),hardened));}
|
||||||
item.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1);
|
//item.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1);
|
||||||
if (Math.random()<0.001*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.MENDING, GetEnchantmentLevels(item.getType(),hardened));}
|
if (Math.random()<0.001*HARDENED_ENCHANT_MULT) {item.addUnsafeEnchantment(Enchantment.MENDING, GetEnchantmentLevels(item.getType(),hardened));}
|
||||||
} else
|
} else
|
||||||
if (item.getType()==Material.FISHING_ROD) {
|
if (item.getType()==Material.FISHING_ROD) {
|
||||||
|
@ -167,7 +167,7 @@ public enum MonsterDifficulty {
|
|||||||
this.loot_regular.length>0) {
|
this.loot_regular.length>0) {
|
||||||
//This is a common roll.
|
//This is a common roll.
|
||||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_regular);
|
ItemStack gen_loot = DistributeRandomLoot(this.loot_regular);
|
||||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2);
|
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4);
|
||||||
droplist.add(gen_loot);
|
droplist.add(gen_loot);
|
||||||
}
|
}
|
||||||
//Rare Loot roll.
|
//Rare Loot roll.
|
||||||
@ -175,21 +175,23 @@ public enum MonsterDifficulty {
|
|||||||
this.loot_rare.length>0) {
|
this.loot_rare.length>0) {
|
||||||
//This is a common roll.
|
//This is a common roll.
|
||||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_rare);
|
ItemStack gen_loot = DistributeRandomLoot(this.loot_rare);
|
||||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2);
|
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4);
|
||||||
droplist.add(gen_loot);
|
droplist.add(gen_loot);
|
||||||
|
if (Math.random()<=0.2) {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case DANGEROUS:
|
case DANGEROUS:
|
||||||
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE));
|
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE));
|
||||||
break;
|
break;
|
||||||
case DEADLY:
|
case DEADLY:
|
||||||
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.LOST_ESSENCE));
|
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.LOST_ESSENCE));
|
||||||
break;
|
break;
|
||||||
case HELLFIRE:
|
case HELLFIRE:
|
||||||
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE));
|
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE));
|
||||||
break;
|
break;
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE));
|
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Legendary Loot roll.
|
//Legendary Loot roll.
|
||||||
@ -197,33 +199,35 @@ public enum MonsterDifficulty {
|
|||||||
this.loot_legendary.length>0) {
|
this.loot_legendary.length>0) {
|
||||||
//This is a common roll.
|
//This is a common roll.
|
||||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary);
|
ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary);
|
||||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2);
|
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4);
|
||||||
droplist.add(gen_loot);
|
droplist.add(gen_loot);
|
||||||
|
if (Math.random()<=0.2) {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case DANGEROUS:
|
case DANGEROUS:
|
||||||
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE));
|
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE));
|
||||||
break;
|
break;
|
||||||
case DEADLY:
|
case DEADLY:
|
||||||
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.LOST_CORE));
|
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.LOST_CORE));
|
||||||
break;
|
break;
|
||||||
case HELLFIRE:
|
case HELLFIRE:
|
||||||
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
|
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE));
|
||||||
break;
|
break;
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE));
|
droplist.add(sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isBoss) { //50% of the time, we drop something great.
|
if (isBoss) { //50% of the time, we drop something great.
|
||||||
if (Math.random()<=0.5 && this.loot_legendary.length>0) {
|
if (Math.random()<=0.5 && this.loot_legendary.length>0) {
|
||||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary);
|
ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary);
|
||||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2);
|
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4);
|
||||||
droplist.add(gen_loot);
|
droplist.add(gen_loot);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (this.loot_rare.length>0) { //Consolation Prize.
|
if (this.loot_rare.length>0) { //Consolation Prize.
|
||||||
ItemStack gen_loot = DistributeRandomLoot(this.loot_rare);
|
ItemStack gen_loot = DistributeRandomLoot(this.loot_rare);
|
||||||
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 2);
|
TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4);
|
||||||
droplist.add(gen_loot);
|
droplist.add(gen_loot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ import org.bukkit.potion.PotionEffect;
|
|||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.ItemRarity;
|
import sig.plugin.TwosideKeeper.HelperStructures.ItemRarity;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Loot;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.MonsterType;
|
import sig.plugin.TwosideKeeper.HelperStructures.MonsterType;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
@ -496,70 +497,7 @@ public class MonsterController {
|
|||||||
return RandomizeEnchantments(item, ItemRarity.VANILLA);
|
return RandomizeEnchantments(item, ItemRarity.VANILLA);
|
||||||
}
|
}
|
||||||
private static ItemStack RandomizeEnchantments(ItemStack item, ItemRarity rarity) {
|
private static ItemStack RandomizeEnchantments(ItemStack item, ItemRarity rarity) {
|
||||||
//Have a small chance to randomize every enchant with a random value too.
|
return Loot.addEnchantments(item, false);
|
||||||
switch (rarity) {
|
|
||||||
case RARE:
|
|
||||||
{
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, (int)(Math.random()*4)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, (int)(Math.random()*4)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, (int)(Math.random()*4)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, (int)(Math.random()*4)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, (int)(Math.random()*4)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.OXYGEN, (int)(Math.random()*2)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.WATER_WORKER, (int)(Math.random()*1)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.THORNS, (int)(Math.random()*2)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.DEPTH_STRIDER, (int)(Math.random()*2)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.FROST_WALKER, (int)(Math.random()*1)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.DURABILITY, (int)(Math.random()*2)+2);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.MENDING, (int)(Math.random()*1)+1);}
|
|
||||||
}break;
|
|
||||||
case EPIC:
|
|
||||||
{
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.OXYGEN, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.WATER_WORKER, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.THORNS, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.DEPTH_STRIDER, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.FROST_WALKER, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.DURABILITY, (int)(Math.random()*7)+2);}
|
|
||||||
if (Math.random()<=0.12) {item.addUnsafeEnchantment(Enchantment.MENDING, (int)(Math.random()*1)+1);}
|
|
||||||
}break;
|
|
||||||
case LEGENDARY:
|
|
||||||
{
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.OXYGEN, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.WATER_WORKER, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.THORNS, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.DEPTH_STRIDER, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.FROST_WALKER, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.DURABILITY, (int)(Math.random()*6)+5);}
|
|
||||||
if (Math.random()<=0.16) {item.addUnsafeEnchantment(Enchantment.MENDING, (int)(Math.random()*1)+1);}
|
|
||||||
}break;
|
|
||||||
default: //Vanilla.
|
|
||||||
{
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, (int)(Math.random()*5)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, (int)(Math.random()*5)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, (int)(Math.random()*5)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, (int)(Math.random()*5)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, (int)(Math.random()*5)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.OXYGEN, (int)(Math.random()*3)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.WATER_WORKER, (int)(Math.random()*1)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.THORNS, (int)(Math.random()*3)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.DEPTH_STRIDER, (int)(Math.random()*3)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.FROST_WALKER, (int)(Math.random()*2)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.DURABILITY, (int)(Math.random()*3)+1);}
|
|
||||||
if (Math.random()<=0.08) {item.addUnsafeEnchantment(Enchantment.MENDING, (int)(Math.random()*1)+1);}
|
|
||||||
}break;
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isZombieLeader(LivingEntity ent) {
|
public static boolean isZombieLeader(LivingEntity ent) {
|
||||||
@ -646,6 +584,8 @@ public class MonsterController {
|
|||||||
m.setHealth(m.getMaxHealth());
|
m.setHealth(m.getMaxHealth());
|
||||||
if (m.getType()!=EntityType.ENDERMAN) {
|
if (m.getType()!=EntityType.ENDERMAN) {
|
||||||
m.setFireTicks(999999);
|
m.setFireTicks(999999);
|
||||||
|
} else {
|
||||||
|
m.setFireTicks(120);
|
||||||
}
|
}
|
||||||
if (isAllowedToEquipItems(m)) {
|
if (isAllowedToEquipItems(m)) {
|
||||||
m.getEquipment().clear();
|
m.getEquipment().clear();
|
||||||
|
@ -519,15 +519,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
PartyList.get(j).IsInSameRegion(p)) {
|
PartyList.get(j).IsInSameRegion(p)) {
|
||||||
inParty=true;
|
inParty=true;
|
||||||
//Do party cleanups.
|
//Do party cleanups.
|
||||||
} /*else
|
}
|
||||||
if (PartyList.get(j).IsInParty(p) &&
|
|
||||||
!PartyList.get(j).IsInSameRegion(p) &&
|
|
||||||
PartyList.get(j).PlayerCountInParty()==1) {
|
|
||||||
//We're the only one in the party...why not
|
|
||||||
//just move it?
|
|
||||||
inParty=true;
|
|
||||||
PartyList.get(j).UpdateRegion(p.getLocation());
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Alright, none exist. Try to make a new party.
|
//Alright, none exist. Try to make a new party.
|
||||||
@ -756,6 +748,22 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
sender.sendMessage("Wrong arguments!");
|
sender.sendMessage("Wrong arguments!");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
} else
|
||||||
|
if (cmd.getName().equalsIgnoreCase("stats")) {
|
||||||
|
if (args.length==1) {
|
||||||
|
if (Bukkit.getPlayer(args[0])!=null) {
|
||||||
|
//If we can grab their stats, then calculate it.
|
||||||
|
Player p = Bukkit.getPlayer(args[0]);
|
||||||
|
sender.sendMessage("Display stats for "+ChatColor.YELLOW+p.getName());
|
||||||
|
showPlayerStats(p);
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("Player "+ChatColor.YELLOW+args[0]+" is not online!");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
showPlayerStats((Player)sender);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Implement console/admin version later (Let's you check any name's money.)
|
//Implement console/admin version later (Let's you check any name's money.)
|
||||||
@ -788,6 +796,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority=EventPriority.LOW)
|
@EventHandler(priority=EventPriority.LOW)
|
||||||
public void onPlayerJoin(PlayerJoinEvent ev) {
|
public void onPlayerJoin(PlayerJoinEvent ev) {
|
||||||
|
|
||||||
|
//Remove stray members from the player's party.
|
||||||
|
|
||||||
|
for (int j=0;j<PartyList.size();j++) {
|
||||||
|
PartyList.get(j).RemoveStrayMembers();
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0;i<Bukkit.getOnlinePlayers().toArray().length;i++) {
|
for (int i=0;i<Bukkit.getOnlinePlayers().toArray().length;i++) {
|
||||||
Player p = (Player)Bukkit.getOnlinePlayers().toArray()[i];
|
Player p = (Player)Bukkit.getOnlinePlayers().toArray()[i];
|
||||||
if (p!=null) {
|
if (p!=null) {
|
||||||
@ -796,7 +811,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
//MESSAGE: Sound.NOTE_STICKS, 0.6f, 0.85f);
|
//MESSAGE: Sound.NOTE_STICKS, 0.6f, 0.85f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pluginupdater.FetchPlugins();
|
if (SERVER_TYPE==ServerType.MAIN) {
|
||||||
|
pluginupdater.FetchPlugins();
|
||||||
|
}
|
||||||
playerdata.put(ev.getPlayer().getUniqueId(), new PlayerStructure(ev.getPlayer(),getServerTickTime()));
|
playerdata.put(ev.getPlayer().getUniqueId(), new PlayerStructure(ev.getPlayer(),getServerTickTime()));
|
||||||
log("[TASK] New Player Data has been added. Size of array: "+playerdata.size(),4);
|
log("[TASK] New Player Data has been added. Size of array: "+playerdata.size(),4);
|
||||||
|
|
||||||
@ -4795,54 +4812,53 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
final PlayerStructure pd2=pd;
|
final PlayerStructure pd2=pd;
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
String MonsterName = pd2.target.getType().toString().toLowerCase();
|
if (Bukkit.getPlayer(pd2.name)!=null) {
|
||||||
if (pd2.target.getCustomName()!=null) {
|
String MonsterName = pd2.target.getType().toString().toLowerCase();
|
||||||
MonsterName = pd2.target.getCustomName();
|
if (pd2.target.getCustomName()!=null) {
|
||||||
if (MonsterName.contains(ChatColor.DARK_RED+"Hellfire") &&
|
|
||||||
pd2.target.getType()!=EntityType.ENDERMAN) {
|
|
||||||
|
|
||||||
pd2.target.setFireTicks(99999);
|
|
||||||
}
|
|
||||||
if (pd2.target.getCustomName()!=null &&
|
|
||||||
!pd2.target.getCustomName().contains("Leader") &&
|
|
||||||
MonsterController.isZombieLeader(pd2.target)) {
|
|
||||||
pd2.target.setCustomName(pd2.target.getCustomName()+" Leader");
|
|
||||||
MonsterName = pd2.target.getCustomName();
|
MonsterName = pd2.target.getCustomName();
|
||||||
|
if (MonsterName.contains(ChatColor.DARK_RED+"Hellfire")) {
|
||||||
|
pd2.target.setFireTicks(99999);
|
||||||
|
}
|
||||||
|
if (pd2.target.getCustomName()!=null &&
|
||||||
|
!pd2.target.getCustomName().contains("Leader") &&
|
||||||
|
MonsterController.isZombieLeader(pd2.target)) {
|
||||||
|
pd2.target.setCustomName(pd2.target.getCustomName()+" Leader");
|
||||||
|
MonsterName = pd2.target.getCustomName();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
MonsterName = GenericFunctions.CapitalizeFirstLetters(MonsterName.replace("_", " "));
|
||||||
}
|
}
|
||||||
} else {
|
final String finalMonsterName = MonsterName;
|
||||||
MonsterName = GenericFunctions.CapitalizeFirstLetters(MonsterName.replace("_", " "));
|
String heartdisplay = "", remainingheartdisplay = "";
|
||||||
}
|
int color1=0,color2=1;
|
||||||
final String finalMonsterName = MonsterName;
|
double health=pd2.target.getHealth();
|
||||||
String heartdisplay = "", remainingheartdisplay = "";
|
double maxhealth=pd2.target.getMaxHealth();
|
||||||
int color1=0,color2=1;
|
if (health>20) {
|
||||||
double health=pd2.target.getHealth();
|
while (health>20) {
|
||||||
double maxhealth=pd2.target.getMaxHealth();
|
color1++;
|
||||||
if (health>20) {
|
color2++;
|
||||||
while (health>20) {
|
health-=20;
|
||||||
color1++;
|
}
|
||||||
color2++;
|
|
||||||
health-=20;
|
|
||||||
}
|
}
|
||||||
}
|
for (int i=0;i<health/2;i++) {
|
||||||
for (int i=0;i<health/2;i++) {
|
remainingheartdisplay+=Character.toString((char)0x2665);
|
||||||
remainingheartdisplay+=Character.toString((char)0x2665);
|
|
||||||
}
|
|
||||||
if (maxhealth>20) {
|
|
||||||
for (int i=0;i<10;i++) {
|
|
||||||
heartdisplay+=Character.toString((char)0x2665);
|
|
||||||
}
|
}
|
||||||
} else {
|
if (maxhealth>20) {
|
||||||
for (int i=0;i<maxhealth/2;i++) {
|
for (int i=0;i<10;i++) {
|
||||||
heartdisplay+=Character.toString((char)0x2665);
|
heartdisplay+=Character.toString((char)0x2665);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i=0;i<maxhealth/2;i++) {
|
||||||
|
heartdisplay+=Character.toString((char)0x2665);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ChatColor finalcolor = GetHeartColor(color1);
|
ChatColor finalcolor = GetHeartColor(color1);
|
||||||
ChatColor finalcolor2 = GetHeartColor(color2);
|
ChatColor finalcolor2 = GetHeartColor(color2);
|
||||||
final String finalheartdisplay=finalcolor2+((finalcolor2==ChatColor.MAGIC)?remainingheartdisplay.replace((char)0x2665, 'A'):remainingheartdisplay)+finalcolor+((finalcolor==ChatColor.MAGIC)?heartdisplay.substring(0, heartdisplay.length()-remainingheartdisplay.length()).replace((char)0x2665, 'A'):heartdisplay.substring(0, heartdisplay.length()-remainingheartdisplay.length()));
|
final String finalheartdisplay=finalcolor2+((finalcolor2==ChatColor.MAGIC)?remainingheartdisplay.replace((char)0x2665, 'A'):remainingheartdisplay)+finalcolor+((finalcolor==ChatColor.MAGIC)?heartdisplay.substring(0, heartdisplay.length()-remainingheartdisplay.length()).replace((char)0x2665, 'A'):heartdisplay.substring(0, heartdisplay.length()-remainingheartdisplay.length()));
|
||||||
|
|
||||||
p.sendTitle(message1, finalMonsterName+" "+finalheartdisplay+" "+ChatColor.RESET+ChatColor.DARK_GRAY+"x"+(int)(pd2.target.getHealth()/20+1));
|
p.sendTitle(message1, finalMonsterName+" "+finalheartdisplay+" "+ChatColor.RESET+ChatColor.DARK_GRAY+"x"+(int)(pd2.target.getHealth()/20+1));
|
||||||
}}
|
}}}
|
||||||
,1);
|
,1);
|
||||||
if (pd.title_task!=-1) {
|
if (pd.title_task!=-1) {
|
||||||
Bukkit.getScheduler().cancelTask(pd.title_task);
|
Bukkit.getScheduler().cancelTask(pd.title_task);
|
||||||
@ -5416,6 +5432,24 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
},20*180);
|
},20*180);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showPlayerStats(Player p) {
|
||||||
|
PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId());
|
||||||
|
double old_weapondmg = pd.prev_weapondmg;
|
||||||
|
double old_buffdmg = pd.prev_buffdmg;
|
||||||
|
double old_partydmg = pd.prev_partydmg;
|
||||||
|
double old_armordef = pd.prev_armordef;
|
||||||
|
double store1=CalculateDamageReduction(1,p,p);
|
||||||
|
|
||||||
|
double store2=old_weapondmg;
|
||||||
|
if (GenericFunctions.isWeapon(p.getEquipment().getItemInMainHand())) {
|
||||||
|
store2 = CalculateWeaponDamage(p,null);
|
||||||
|
}
|
||||||
|
pd.damagedealt=store2;
|
||||||
|
DecimalFormat df = new DecimalFormat("0.0");
|
||||||
|
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Base Damage: "+ChatColor.RESET+""+ChatColor.DARK_PURPLE+df.format(pd.damagedealt));
|
||||||
|
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Damage Reduction: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((1.0-pd.damagereduction)*100)+"%");
|
||||||
|
}
|
||||||
|
|
||||||
public static ServerType getServerType() {
|
public static ServerType getServerType() {
|
||||||
return SERVER_TYPE;
|
return SERVER_TYPE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user