->Fixed a bug where Artifact bows were not able to gain any experience.

->Fixed a bug where player death messages were appearing more than once.
->Fixed a bug where Strikers were not getting a passive 20% critical
chance.
->Minions from Zombie Pigman Leaders are now actually Zombie Pigmen
instead of regular Zombies.
->Critical Strike Chance is now displayed in /stats.
->Life Steal Amount is now displayed in /stats.
->New Item Sets are now available as mob drops! Find them, mix and match
set bonuses, or try for a full set for the extra 5 set perk!
->Recycling Centers now prevent common items from appearing inside
Recycling Centers. (If they are actually common.)
->Death Loot Manager now properly survives server restarts, so players
who have died and ragequitted no longer will have permanently lost their
loot.
->Added 'hasPermissionToBreakWorldShopSign(Sign,Player)' to API.
->API methods that relied on block checks but had arguments of type
Location have been updated to Block arguments.
->Shops now update their stocked amount properly if they are relocated
to another chest or if the server crashes.
->Item Localization Fixes
->Artifact Equips that despawn have a 100% chance of ending up in a
Recycling Center.
->Hellfire Endermen now create Endermites while they fight you.
->Leader mobs glow red now.
->Reinforcements no longer spawn additional leaders.
->Pre-emptive strikes are now calculated as mobs not having noticed you
yet. Mobs that do notice you become exempt from a pre-emptive strike.
->Durability on equipment properly decreases when hitting monsters.
dev
sigonasr2 9 years ago
parent 284535db7c
commit 7bf3a6be9f
  1. BIN
      TwosideKeeper.jar
  2. 12
      src/plugin.yml
  3. 28
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  4. 5
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/Habitation.java
  5. 88
      src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java
  6. 192
      src/sig/plugin/TwosideKeeper/HelperStructures/Loot.java
  7. 12
      src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java
  8. 117
      src/sig/plugin/TwosideKeeper/NewCombat.java
  9. 1
      src/sig/plugin/TwosideKeeper/PlayerStructure.java
  10. 129
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java
  11. 3
      src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java

Binary file not shown.

@ -1,6 +1,6 @@
name: TwosideKeeper
main: sig.plugin.TwosideKeeper.TwosideKeeper
version: 3.7.3-alpha6
version: 3.7.3
commands:
money:
description: Tells the player the amount of money they are holding.
@ -106,4 +106,14 @@ commands:
description: DPS Logger.
usage: /dps
permission: TwosideKeeper.money
permission-message: No permissions!
muchlogsmuchwow:
description: D00d.
usage: /muchlogsmuchwow
permission: TwosideKeeper.muchlogsmuchwow
permission-message: No permissions!
make_set_item:
description: Turns an item into a set.
usage: /make_set_item <SET> <TIER>
permission: TwosideKeeper.makesetitem
permission-message: No permissions!

@ -57,6 +57,7 @@ import sig.plugin.TwosideKeeper.PlayerStructure;
import sig.plugin.TwosideKeeper.TwosideKeeper;
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
import sig.plugin.TwosideKeeper.HelperStructures.BowMode;
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
public class GenericFunctions {
@ -1869,7 +1870,8 @@ public class GenericFunctions {
item.getType().toString().contains("CHESTPLATE") ||
item.getType().toString().contains("LEGGINGS") ||
item.getType().toString().contains("HELMET") ||
item.getType().toString().contains("FISHING_ROD"))) {
item.getType().toString().contains("FISHING_ROD") ||
item.getType().toString().contains("SHIELD"))) {
return true;
} else {
return false;
@ -2069,7 +2071,7 @@ public class GenericFunctions {
+ ChatColor.GRAY+"->Swinging your weapon stops nearby flying arrows. Each arrow deflected will give you a Strength buff. Stacks up to Strength V (Lasts five seconds.)\n"
+ ChatColor.WHITE+"->Throwing your weapon will perform a line drive. Enemies you charge through take x7 your base damage. This costs 5% of your durability (Unbreaking decreases this amount.)\n"
+ ChatColor.GRAY+"->Strikers have a 20% chance to dodge incoming attacks from any damage source while moving.\n"
+ ChatColor.WHITE+"->Hitting a target when both the player and the enemy are at full health deals x3 normal damage.\n"
+ ChatColor.WHITE+"->Hitting a target when they have not noticed you yet does x3 normal damage.\n"
;
}
case "ranger":{
@ -2501,6 +2503,10 @@ public class GenericFunctions {
p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) {
dodgechance+=0.01*p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK);
}
if (ItemSet.GetSetCount(ItemSet.PANROS, p)>=3) {
dodgechance+=0.20;
}
if (isStriker(p) &&
pd.velocity>0) {
@ -2684,6 +2690,14 @@ public class GenericFunctions {
AwakenedArtifact.addPotentialEXP(damager.getEquipment().getItemInMainHand(), (int)((ratio*20)+5), p);
NewCombat.increaseArtifactArmorXP(p,(int)(ratio*10)+1);
}
if (damager instanceof Player) {
Player p = (Player)damager;
if (GenericFunctions.isEquip(p.getEquipment().getItemInMainHand())) {
aPlugin.API.damageItem(p, p.getEquipment().getItemInMainHand(), 1);
}
}
TwosideKeeper.log(ChatColor.BLUE+" "+oldhp+"->"+((LivingEntity)target).getHealth()+" HP",3);
}
@ -2894,4 +2908,14 @@ public class GenericFunctions {
}
return false;
}
public static ItemStack[] getEquipment(LivingEntity ent) {
return new ItemStack[]{
ent.getEquipment().getItemInMainHand(),
ent.getEquipment().getHelmet(),
ent.getEquipment().getChestplate(),
ent.getEquipment().getLeggings(),
ent.getEquipment().getBoots()
};
}
}

@ -47,7 +47,10 @@ public class Habitation {
}
public void addKillToLocation(LivingEntity l) {
String hash = getLocationHash(startinglocs.get(l.getUniqueId()));
String hash = getLocationHash(l.getLocation());
if (startinglocs.containsKey(l.getUniqueId())) {
hash = getLocationHash(startinglocs.get(l.getUniqueId()));
}
if (locationhashes.containsKey(hash)) {
int spawnamt = locationhashes.get(hash);
locationhashes.put(hash,++spawnamt);

@ -0,0 +1,88 @@
package sig.plugin.TwosideKeeper.HelperStructures;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.ItemStack;
import sig.plugin.TwosideKeeper.TwosideKeeper;
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
public enum ItemSet {
PANROS(1,2,3),
SONGSTEEL(4,6,10),
DAWNTRACKER(3,5,8),
LORASYS(0,0,0);
int val1;
int val2;
int val3;
ItemSet(int val1,int val2, int val3) {
this.val1=val1;
this.val2=val2;
this.val3=val3;
}
public static boolean isSetItem(ItemStack item) {
return GetSet(item)!=null;
}
public static ItemSet GetSet(ItemStack item) {
if (GenericFunctions.isEquip(item) &&
item.getItemMeta().hasLore()) {
List<String> lore = item.getItemMeta().getLore();
for (int i=0;i<lore.size();i++) {
if (lore.get(i).contains(ChatColor.GOLD+""+ChatColor.BOLD+"T")) {
//This is the tier line.
return ItemSet.valueOf(lore.get(i).replace(ChatColor.GOLD+""+ChatColor.BOLD+"T", "").split(" ")[1].toUpperCase());
}
}
}
return null;
}
public static int GetTier(ItemStack item) {
if (GenericFunctions.isEquip(item) &&
item.getItemMeta().hasLore()) {
List<String> lore = item.getItemMeta().getLore();
for (int i=0;i<lore.size();i++) {
if (lore.get(i).contains(ChatColor.GOLD+""+ChatColor.BOLD+"T")) {
//This is the tier line.
return Integer.parseInt(lore.get(i).replace(ChatColor.GOLD+""+ChatColor.BOLD+"T", "").split(" ")[0]);
}
}
}
TwosideKeeper.log(ChatColor.RED+"[ERROR] Could not detect proper tier of "+item.toString()+"!", 1);
return 0;
}
public int GetBaseAmount(ItemStack item) {
switch (GetTier(item)) {
case 3:{
return this.val2;
}
case 4:{
return this.val3;
}
default:{
return this.val1;
}
}
}
public static int GetSetCount(ItemSet set, LivingEntity ent) {
int count = 0;
for (int i=0;i<GenericFunctions.getEquipment(ent).length;i++) {
ItemSet temp = ItemSet.GetSet(GenericFunctions.getEquipment(ent)[i]);
if (temp!=null) {
if (temp.equals(set)) {
count++;
}
}
}
TwosideKeeper.log("Currently have "+count+" pieces from the "+set.name()+" set.", 5);
return count;
}
}

@ -17,8 +17,12 @@ public class Loot {
static double HARDENED_ENCHANT_MULT = 1.4;
static int MAX_ENCHANT_LEVEL = 10;
public static ItemStack GenerateMegaPiece(Material mat_type, boolean hardened) {
return GenerateMegaPiece(mat_type, hardened, false);
}
public static ItemStack GenerateMegaPiece(Material mat_type, boolean hardened, boolean setitem) {
ItemStack raresword = new ItemStack(mat_type);
ItemMeta sword_meta = raresword.getItemMeta();
sword_meta.setDisplayName(ChatColor.AQUA+""+ChatColor.BOLD+"Mega "+GenericFunctions.UserFriendlyMaterialName(mat_type));
@ -35,10 +39,11 @@ public class Loot {
raresword.setItemMeta(sword_meta);
raresword = addEnchantments(raresword,true);
}
/*
if (GenericFunctions.isArmor(raresword)) {
raresword = GenerateSetPiece(raresword);
}*/
if (setitem && (raresword.getType().toString().contains("SWORD") || GenericFunctions.isArmor(raresword))) {
raresword = GenerateSetPiece(raresword,hardened);
}
return raresword;
}
@ -58,6 +63,11 @@ public class Loot {
fakelore.add(ChatColor.LIGHT_PURPLE+"Ranger Gear");
fakelore.add(ChatColor.GOLD+""+ChatColor.BOLD+"Jamdak Set");
fakelore.add(ChatColor.YELLOW+"+3% Dodge Chance");
fakelore.add("");
fakelore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases duration of Tumble to 3 seconds.");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Damage Reduction by 20%.");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Maximum Health by 20.");
}
LeatherArmorMeta lm = (LeatherArmorMeta)sword_meta;
lm.setColor(Color.fromRGB(128, 64, 0));
@ -68,6 +78,11 @@ public class Loot {
fakelore.add(ChatColor.LIGHT_PURPLE+"Ranger Gear");
fakelore.add(ChatColor.GOLD+""+ChatColor.BOLD+"Darnys Set");
fakelore.add(ChatColor.YELLOW+"+5% Dodge Chance");
fakelore.add("");
fakelore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases duration of Tumble to 3 seconds.");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Damage Reduction by 20%.");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Maximum Health by 20.");
LeatherArmorMeta lm = (LeatherArmorMeta)sword_meta;
lm.setColor(Color.fromRGB(224, 224, 224));
}
@ -79,6 +94,11 @@ public class Loot {
fakelore.add(ChatColor.GOLD+""+ChatColor.BOLD+"Alikahn Set");
fakelore.add(ChatColor.YELLOW+"+8% Dodge Chance");
fakelore.add(ChatColor.GRAY+"Breaks Remaining: "+ChatColor.YELLOW+GetHardenedBreaks(mat_type));
fakelore.add("");
fakelore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus (Ranger Only):");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases duration of Tumble to 3 seconds.");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Damage Reduction by 20%.");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Maximum Health by 20.");
LeatherArmorMeta lm = (LeatherArmorMeta)sword_meta;
lm.setColor(Color.fromRGB(64, 0, 64));
}
@ -90,6 +110,11 @@ public class Loot {
fakelore.add(ChatColor.GOLD+""+ChatColor.BOLD+"Lorasaadi Set");
fakelore.add(ChatColor.YELLOW+"+11% Dodge Chance");
fakelore.add(ChatColor.GRAY+"Breaks Remaining: "+ChatColor.YELLOW+GetHardenedBreaks(mat_type));
fakelore.add("");
fakelore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases duration of Tumble to 3 seconds.");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Damage Reduction by 20%.");
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Maximum Health by 20.");
LeatherArmorMeta lm = (LeatherArmorMeta)sword_meta;
lm.setColor(Color.fromRGB(0, 64, 0));
}
@ -101,10 +126,161 @@ public class Loot {
return raresword;
}
ItemStack GenerateSetPiece(ItemStack item) {
if (item.getType().toString().contains("IRON")) { //This is a tier 1 piece.
static ItemStack GenerateSetPiece(ItemStack item, boolean hardened) {
List<String> lore = new ArrayList<String>();
int type = (int)(Math.random()*3);
String set_name = "";
String prefix = "";
prefix = (hardened)?(ChatColor.LIGHT_PURPLE+""+ChatColor.BOLD+"Hardened Mega "):(ChatColor.AQUA+""+ChatColor.BOLD+"Mega ");
switch (type) {
case 0:{
set_name = prefix+"Panros Striker "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Striker set.
}break;
case 1:{
if (item.getType().toString().contains("SWORD")) {
item.setType(Material.SHIELD);
}
set_name = prefix+"Songsteel Defender "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Defender set.
}break;
case 2:{
if (item.getType().toString().contains("SWORD")) {
item.setType(Material.valueOf(item.getType().toString().replace("SWORD","")+"AXE"));
}
set_name = prefix+"Dawntracker Barbarian "+GenericFunctions.UserFriendlyMaterialName(item.getType());
}break;
case 3:{
if (item.getType().toString().contains("SWORD")) {
//Convert Slayer weapon here. ???
}
set_name = prefix+"Lorasys Slayer "+GenericFunctions.UserFriendlyMaterialName(item.getType());
}break;
}
if (item.getItemMeta().hasLore()) {
lore = item.getItemMeta().getLore();
}
if (item.getType().toString().contains("STONE") || item.getType().toString().contains("IRON")) { //This is a tier 1/2 piece.
int tier = (item.getType().toString().contains("STONE")?1:2);
switch (type) {
case 0:{
lore.add(ChatColor.LIGHT_PURPLE+"Striker Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Panros Set");
lore.add(ChatColor.YELLOW+"+1 Damage");
}break;
case 1:{
lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Songsteel Set");
lore.add(ChatColor.YELLOW+"+4 Health");
}break;
case 2:{
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Dawntracker Set");
lore.add(ChatColor.YELLOW+"+3% Lifesteal");
}break;
case 3:{
lore.add(ChatColor.LIGHT_PURPLE+"Slayer Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Lorasys Set");
lore.add(ChatColor.YELLOW+"???");
}break;
}
} else
if (item.getType().toString().contains("DIAMOND")) { //This is a tier 3 piece.
switch (type) {
case 0:{
lore.add(ChatColor.LIGHT_PURPLE+"Striker Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T3 Panros Set");
lore.add(ChatColor.YELLOW+"+2 Damage");
}break;
case 1:{
lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T3 Songsteel Set");
lore.add(ChatColor.YELLOW+"+6 Health");
}break;
case 2:{
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T3 Dawntracker Set");
lore.add(ChatColor.YELLOW+"+5% Lifesteal");
}break;
case 3:{
lore.add(ChatColor.LIGHT_PURPLE+"Slayer Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T3 Lorasys Set");
lore.add(ChatColor.YELLOW+"???");
}break;
}
} else
if (item.getType().toString().contains("GOLD")) { //This is a tier 4 piece.
switch (type) {
case 0:{
lore.add(ChatColor.LIGHT_PURPLE+"Striker Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T4 Panros Set");
lore.add(ChatColor.YELLOW+"+3 Damage");
}break;
case 1:{
lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T4 Songsteel Set");
lore.add(ChatColor.YELLOW+"+10 Health");
}break;
case 2:{
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T4 Dawntracker Set");
lore.add(ChatColor.YELLOW+"+8% Lifesteal");
}break;
case 3:{
lore.add(ChatColor.LIGHT_PURPLE+"Slayer Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T4 Lorasys Set");
lore.add(ChatColor.YELLOW+"???");
}break;
}
} else
{
lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T4 Songsteel Set");
lore.add(ChatColor.YELLOW+"+10 Health");
}
lore.add("");
switch (type) {
case 0:{
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +5 Damage");
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +20% Dodge Chance");
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +40% Critical Chance");
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Powered Line Drive");
lore.add(ChatColor.GRAY+" Press the drop key while performing the");
lore.add(ChatColor.GRAY+" first line drive to line drive a second");
lore.add(ChatColor.GRAY+" time in another direction.");
}break;
case 1:{
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +8 Max Health");
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +12 Absorption (30 seconds)");
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +30% Damage Reduction");
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Vendetta");
lore.add(ChatColor.GRAY+" Blocking stores 30% of mitigation damage.");
lore.add(ChatColor.GRAY+" Attacking with a shield unleashes all stored");
lore.add(ChatColor.GRAY+" mitigation damage.");
}break;
case 2:{
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +3 Damage");
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +10% Lifesteal");
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +6 Damage");
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Powered Mock");
lore.add(ChatColor.GRAY+" Mock debuff duration increases from");
lore.add(ChatColor.GRAY+" 10->20 seconds, making it stackable.");
}break;
case 3:{
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" ???");
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" ???");
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" ???");
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" ???");
}break;
}
ItemMeta m = item.getItemMeta();
m.setLore(lore);
m.setDisplayName(set_name);
item.setItemMeta(m);
return item;
}

@ -298,7 +298,11 @@ public enum MonsterDifficulty {
//Turn it into a Mega Piece.
if (GenericFunctions.isTool(new ItemStack(ls.GetMaterial()))) {
if (Math.random()<=0.1) {
return Loot.GenerateMegaPiece(ls.GetMaterial(), ls.GetHardened());
if (Math.random()<=0.8) {
return Loot.GenerateMegaPiece(ls.GetMaterial(), ls.GetHardened(),true);
} else {
return Loot.GenerateMegaPiece(ls.GetMaterial(), ls.GetHardened(),false);
}
} else {
return new ItemStack(ls.GetMaterial(),1,(short)(Math.random()*ls.GetMaterial().getMaxDurability()));
}
@ -311,7 +315,11 @@ public enum MonsterDifficulty {
return DistributeRandomLoot(lootlist,isRanger);
}
} else {
return Loot.GenerateMegaPiece(ls.GetMaterial(), ls.GetHardened());
if (Math.random()<=0.8) {
return Loot.GenerateMegaPiece(ls.GetMaterial(), ls.GetHardened(),true);
} else {
return Loot.GenerateMegaPiece(ls.GetMaterial(), ls.GetHardened(),false);
}
}
}
} else {

@ -45,6 +45,7 @@ import com.google.common.collect.Iterables;
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbilityApplyEffects;
import sig.plugin.TwosideKeeper.HelperStructures.BowMode;
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
import sig.plugin.TwosideKeeper.HelperStructures.MonsterType;
import sig.plugin.TwosideKeeper.HelperStructures.Common.DamageType;
@ -126,7 +127,7 @@ public class NewCombat {
double finaldmg = calculateBonusMultiplier(totaldmg,bonusmult);
playerAddArtifactEXP(target,finaldmg);
applyOnHitMobEffects(target,damager);
applyOnHitMobEffects(target,damager,finaldmg);
finaldmg = CalculateDamageReduction(finaldmg,target,damager);
return calculateAbsorptionHearts(target, finaldmg);
@ -141,7 +142,13 @@ public class NewCombat {
if (shooter!=null) {
if (shooter instanceof Player) {
Player p = (Player)shooter;
ItemStack weapon = p.getEquipment().getItemInMainHand();
totaldmg+=CalculateWeaponDamage(damager, target);
double mult1 = calculatePlayerCriticalStrike(weapon,damager);
addMultiplierToPlayerLogger(damager,"Critical Strike Mult",mult1);
bonusmult*=mult1;
}
}
@ -499,6 +506,49 @@ public class NewCombat {
addToPlayerLogger(ent,"Weapon Base Damage",dmg);
basedmg += dmg;
}
for (int i=0;i<GenericFunctions.getEquipment(shooter).length;i++) {
ItemSet set = ItemSet.GetSet(GenericFunctions.getEquipment(shooter)[i]);
if (set!=null) {
if (set==ItemSet.PANROS) {
double dmg = set.GetBaseAmount(GenericFunctions.getEquipment(shooter)[i]);
addToPlayerLogger(ent,"Set Piece Damage",dmg);
basedmg += dmg;
}
}
}
if (shooter instanceof Player) {
Player p = (Player)shooter;
if (GenericFunctions.isDefender(p) && ItemSet.GetSetCount(ItemSet.SONGSTEEL, p)>=5) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (pd.vendetta_amt>0.0) {
p.playSound(p.getLocation(), Sound.BLOCK_GLASS_BREAK, 1.0f, 0.5f);
double dmg = pd.vendetta_amt;
addToPlayerLogger(ent,"Vendetta",dmg);
basedmg += dmg;
pd.vendetta_amt=0.0;
aPlugin.API.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+" dmg stored");
}
}
}
if (ItemSet.GetSetCount(ItemSet.PANROS, shooter)>=2) {
double dmg = 5;
addToPlayerLogger(ent,"Set Bonus",dmg);
basedmg += dmg;
}
if (ItemSet.GetSetCount(ItemSet.DAWNTRACKER, shooter)>=2) {
double dmg = 3;
addToPlayerLogger(ent,"Set Bonus",dmg);
basedmg += dmg;
}
if (ItemSet.GetSetCount(ItemSet.DAWNTRACKER, shooter)>=4) {
double dmg = 3;
addToPlayerLogger(ent,"Set Bonus",dmg);
basedmg += dmg;
}
if (GenericFunctions.isHardenedItem(weapon) && !GenericFunctions.isArtifactEquip(weapon)) {
double mult = 2.0;
addMultiplierToPlayerLogger(ent,"Hardened Item Mult",mult);
@ -766,10 +816,7 @@ public class NewCombat {
static double calculateArtifactAbilityMultiplier(ItemStack weapon, Entity damager, LivingEntity target) {
double mult = 1.0;
double mult1 = calculatePlayerCriticalStrike(weapon,damager);
addMultiplierToPlayerLogger(damager,"Critical Strike Mult",mult1);
mult*=mult1;
mult1 = calculateBeliggerentMultiplier(weapon,damager);
double mult1 = calculateBeliggerentMultiplier(weapon,damager);
addMultiplierToPlayerLogger(damager,"Belliggerent Mult",mult1);
mult*=mult1;
return mult;
@ -777,8 +824,10 @@ public class NewCombat {
static double calculatePlayerCriticalStrike(ItemStack weapon, Entity damager) {
boolean criticalstrike=false;
TwosideKeeper.log("Crit Strike chance is "+0.01*GenericFunctions.getAbilityValue(ArtifactAbility.CRITICAL,weapon), 4);
criticalstrike = isCriticalStrike(0.01*GenericFunctions.getAbilityValue(ArtifactAbility.CRITICAL,weapon));
double critchance = 0.0;
critchance += calculateCriticalStrikeChance(weapon, damager);
TwosideKeeper.log("Crit Strike chance is "+critchance,2);
criticalstrike = isCriticalStrike(critchance);
if (damager instanceof Player && criticalstrike) {
Player p = (Player)damager;
p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_CRIT, 1.0f, 1.0f);
@ -786,6 +835,20 @@ public class NewCombat {
return criticalstrike?(calculateCriticalStrikeMultiplier(weapon)):1.0;
}
static double calculateCriticalStrikeChance(ItemStack weapon, Entity damager) {
double critchance = 0.0;
critchance += 0.01*GenericFunctions.getAbilityValue(ArtifactAbility.CRITICAL,weapon);
LivingEntity shooter = getDamagerEntity(damager);
if (shooter!=null) {
if (shooter instanceof Player) {
Player p = (Player)shooter;
critchance += (GenericFunctions.isStriker(p)?0.2:0.0);
}
critchance += (ItemSet.GetSetCount(ItemSet.PANROS, shooter)>=4)?0.4:0.0;
}
return critchance;
}
//Chance is between 0.0-1.0. 1.0 is 100%.
static boolean isCriticalStrike(double chance) {
return (Math.random()<=chance);
@ -928,11 +991,19 @@ public class NewCombat {
}}
,100);
healDefenderSaturation(p);
increaseSwordComboCount(weapon, p);
}
}
}
private static void healDefenderSaturation(Player p) {
if (GenericFunctions.isDefender(p) && p.getSaturation()<20) {
p.setSaturation(p.getSaturation()+1);
}
}
public static void increaseArtifactArmorXP(Player p, int exp) {
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
if (GenericFunctions.isArtifactEquip(p.getEquipment().getArmorContents()[i]) &&
@ -1096,6 +1167,9 @@ public class NewCombat {
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())) {
dmgreduction /= Math.pow(ArtifactAbility.getEnchantmentLevel(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand()),2);
}
if (ItemSet.GetSetCount(ItemSet.SONGSTEEL, p)>=4) {
dmgreduction *= 1.3;
}
}
//Blocking: -((p.isBlocking())?ev.getDamage()*0.33:0) //33% damage will be reduced if we are blocking.
@ -1119,7 +1193,9 @@ public class NewCombat {
if (damager instanceof Player) {
Player p = (Player)damager;
double healamt = finaldmg*GenericFunctions.getAbilityValue(ArtifactAbility.LIFESTEAL, p.getEquipment().getItemInMainHand())/100;
double lifestealpct = calculateLifeStealAmount(p);
double healamt = finaldmg*lifestealpct;
//log("Healed "+healamt+" damage.",2);
double newhealth = p.getHealth()+healamt;
if (newhealth>p.getMaxHealth()) {
@ -1136,6 +1212,23 @@ public class NewCombat {
return finaldmg;
}
public static double calculateLifeStealAmount(Player p) {
double lifestealpct = GenericFunctions.getAbilityValue(ArtifactAbility.LIFESTEAL, p.getEquipment().getItemInMainHand())/100;
for (int i=0;i<GenericFunctions.getEquipment(p).length;i++) {
ItemSet set = ItemSet.GetSet(GenericFunctions.getEquipment(p)[i]);
if (set!=null) {
if (set==ItemSet.DAWNTRACKER) {
lifestealpct += set.GetBaseAmount(GenericFunctions.getEquipment(p)[i])/100d;
}
}
}
if (ItemSet.GetSetCount(ItemSet.DAWNTRACKER, p)>=3) {
lifestealpct += 0.10;
}
return lifestealpct;
}
private static void playerAddArtifactEXP(LivingEntity target, double dmg) {
if (target instanceof Player) {
Player p = (Player)target;
@ -1259,7 +1352,7 @@ public class NewCombat {
return Math.abs(arrowLoc.getY()-monsterHead.getY())<=headshot_acc || arrowLoc.getY()>monsterHead.getY();
}
private static void applyOnHitMobEffects(LivingEntity target, Entity damager) {
private static void applyOnHitMobEffects(LivingEntity target, Entity damager, double dmg) {
if (target instanceof Player) {
Player p = (Player)target;
if (GenericFunctions.isDefender(p)) {
@ -1271,6 +1364,12 @@ public class NewCombat {
p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,100,resistlevel));
}
if (p.isBlocking() && ItemSet.GetSetCount(ItemSet.SONGSTEEL, p)>=5) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.vendetta_amt+=(dmg-CalculateDamageReduction(dmg,target,damager))*0.3;
aPlugin.API.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+" dmg stored");
}
}
if (damager instanceof Enderman) {
if (MonsterController.getMonsterDifficulty(((Monster)damager))==MonsterDifficulty.HELLFIRE) {

@ -85,6 +85,7 @@ public class PlayerStructure {
public double deathloc_z = 0;
public String deathloc_world = "";
public List<ItemStack> deathloot = new ArrayList<ItemStack>();
public double vendetta_amt = 0.0;
public double prev_weapondmg=0.0;
public double prev_buffdmg=0.0;

@ -189,6 +189,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.CustomRecipe;
import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure;
import sig.plugin.TwosideKeeper.HelperStructures.ItemCube;
import sig.plugin.TwosideKeeper.HelperStructures.ItemRarity;
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
import sig.plugin.TwosideKeeper.HelperStructures.MalleableBaseQuest;
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
import sig.plugin.TwosideKeeper.HelperStructures.MonsterType;
@ -441,7 +442,23 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
getServer().getScheduler().runTaskLaterAsynchronously(this, new DiscordStatusUpdater(), 300l);
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
public void run(){
for (int i=0;i<Bukkit.getOnlinePlayers().size();i++) {
Player p = (Player)(Bukkit.getOnlinePlayers().toArray()[i]);
if (ItemSet.GetSetCount(ItemSet.SONGSTEEL, p)>=3) {
if (p.hasPotionEffect(PotionEffectType.ABSORPTION)) {
int oldlv = GenericFunctions.getPotionEffectLevel(PotionEffectType.ABSORPTION, p)+1;
p.removePotionEffect(PotionEffectType.ABSORPTION);
p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,599,2+oldlv));
} else {
p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,599,2));
}
}
}
}
},0l,600l);
//This is the constant timing method.
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
public void run(){
@ -882,7 +899,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
if (SERVER_TYPE==ServerType.TEST || SERVER_TYPE==ServerType.QUIET) {
//TwosideKeeperAPI.spawnAdjustedMonster(MonsterType.GIANT, p.getLocation());
Skeleton s = (Skeleton)p.getWorld().spawnEntity(p.getLocation(), EntityType.SKELETON);
//TwosideKeeper.log("This is from set "+ItemSet.GetSet(p.getEquipment().getItemInMainHand())+" T"+ItemSet.GetTier(p.getEquipment().getItemInMainHand()),2);
/*Skeleton s = (Skeleton)p.getWorld().spawnEntity(p.getLocation(), EntityType.SKELETON);
Horse h = (Horse)p.getWorld().spawnEntity(p.getLocation(), EntityType.HORSE);
s.setSkeletonType(SkeletonType.NORMAL);
@ -893,7 +911,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
h.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0.385f);
h.getInventory().setArmor(new ItemStack(Material.DIAMOND_BARDING));
h.getInventory().setItem(0, new ItemStack(Material.DIAMOND_BARDING));
h.setPassenger(s);
h.setPassenger(s);*/
//Arrow newar = p.getWorld().spawnArrow(p.getLocation(), p.getLocation().getDirection(), 1f, 12f);
//GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(), BowMode.SNIPE);
@ -1128,7 +1146,28 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
pd.damagelogging=!pd.damagelogging;
return true;
} else
if (cmd.getName().equalsIgnoreCase("muchlogsmuchwow")) {
Player p = (Player)sender;
for (int i=0;i<64;i++) {
Item it = p.getWorld().dropItemNaturally(p.getLocation(), new ItemStack(Material.LOG,64,(short)3));
it.setPickupDelay(0);
}
return true;
} else
if (cmd.getName().equalsIgnoreCase("make_set_item")) {
Player p = (Player)sender;
List<String> lore = new ArrayList<String>();
if (p.getEquipment().getItemInMainHand().getItemMeta().hasLore()) {
lore = p.getEquipment().getItemInMainHand().getItemMeta().getLore();
}
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+Integer.parseInt(args[1])+" "+ItemSet.valueOf(args[0])+" Set");
ItemMeta m = p.getEquipment().getItemInMainHand().getItemMeta();
m.setLore(lore);
p.getEquipment().getItemInMainHand().setItemMeta(m);
return true;
}
} else {
//Implement console/admin version later (Let's you check any name's money.)
}
@ -1984,7 +2023,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (GenericFunctions.isDefender(player)) {
player.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,200,1));
List<Entity> entities = player.getNearbyEntities(16, 16, 16);
for (int i=0;i<entities.size();i++) {
for (int i=0;i<entities.size();i++) {
if (entities.get(i) instanceof Monster) {
Monster m = (Monster)(entities.get(i));
m.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,100,5,true,true,Color.NAVY));
@ -2566,6 +2605,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
:p.getLocation(), p);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.hasDied=true;
pd.vendetta_amt=0.0;
p.getInventory().clear();
}
}
@ -2744,18 +2784,25 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
!GenericFunctions.isViewingInventory(ev.getPlayer())) {
ev.setCancelled(true);
PlayerStructure pd = (PlayerStructure)playerdata.get(ev.getPlayer().getUniqueId());
if (ev.getPlayer().isOnGround() &&
boolean second_charge = (ev.getPlayer().hasPotionEffect(PotionEffectType.GLOWING) || (ev.getPlayer().hasPotionEffect(PotionEffectType.SLOW) && GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW, ev.getPlayer())==20));
if ((ev.getPlayer().isOnGround() || second_charge) &&
pd.last_strikerspell+LINEDRIVE_COOLDOWN<getServerTickTime()) {
if (pd.target!=null &&
!pd.target.isDead()) {
pd.target.setNoDamageTicks(0);
}
boolean ex_version = ItemSet.GetSetCount(ItemSet.PANROS, ev.getPlayer())+((ItemSet.isSetItem(ev.getItemDrop().getItemStack())&&ItemSet.GetSet(ev.getItemDrop().getItemStack()).equals(ItemSet.PANROS))?1:0)>=5;
ev.getItemDrop().setPickupDelay(0);
final Vector facing = ev.getPlayer().getLocation().getDirection().setY(0);
ev.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW,15,20));
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
pd.last_strikerspell=getServerTickTime();
Vector facing = ev.getPlayer().getLocation().getDirection();
if (!second_charge) {
facing = ev.getPlayer().getLocation().getDirection().setY(0);
ev.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW,(ex_version)?7:15,20));
}
if (!ex_version || second_charge) {
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
pd.last_strikerspell=getServerTickTime();
}
ev.getPlayer().playSound(ev.getPlayer().getLocation(), Sound.UI_BUTTON_CLICK, 1.0f, 1.0f);
aPlugin.API.damageItem(ev.getPlayer(), ev.getItemDrop().getItemStack(), ev.getItemDrop().getItemStack().getType().getMaxDurability()/20);
final PlayerDropItemEvent ev1 = ev;
@ -2763,18 +2810,25 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
int mult=2;
final double xspd=ev1.getPlayer().getLocation().getDirection().getX()*mult;
final double yspd=0;
double tempyspd=0;
final double yspd=tempyspd;
final double zspd=ev1.getPlayer().getLocation().getDirection().getZ()*mult;
final double xpos=ev1.getPlayer().getLocation().getX();
final double ypos=ev1.getPlayer().getLocation().getY();
final double zpos=ev1.getPlayer().getLocation().getZ();
final Vector facing1 = facing;
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
ev1.getPlayer().setVelocity(facing.multiply(8));
ev1.getPlayer().setVelocity(facing1.multiply(8));
GenericFunctions.addIFrame(ev1.getPlayer(), 10);
ev1.getPlayer().playSound(ev1.getPlayer().getLocation(), Sound.ITEM_CHORUS_FRUIT_TELEPORT, 1.0f, 1.0f);
AreaEffectCloud lp = (AreaEffectCloud)ev1.getPlayer().getWorld().spawnEntity(ev1.getPlayer().getLocation(), EntityType.AREA_EFFECT_CLOUD);
final Location newpos=new Location(ev1.getPlayer().getWorld(),xpos,ypos,zpos);
final double xpos=ev1.getPlayer().getLocation().getX();
final double ypos=ev1.getPlayer().getLocation().getY();
final double zpos=ev1.getPlayer().getLocation().getZ();
AreaEffectCloud lp = (AreaEffectCloud)ev1.getPlayer().getWorld().spawnEntity(newpos, EntityType.AREA_EFFECT_CLOUD);
lp.setColor(Color.OLIVE);
DecimalFormat df = new DecimalFormat("0.00");
lp.setCustomName("LD "+df.format(NewCombat.CalculateWeaponDamage(ev1.getPlayer(),null)*7)+" "+ev1.getPlayer().getName());
@ -2789,10 +2843,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
final String customname = lp.getCustomName();
for (int i=0;i<range;i++) {
final int tempi=i;
final Location newpos=new Location(ev1.getPlayer().getWorld(),xpos,ypos,zpos).add(i*xspd,i*yspd,i*zspd);
final double xpos2=ev1.getPlayer().getLocation().getX();
final double ypos2=ev1.getPlayer().getLocation().getY();
final double zpos2=ev1.getPlayer().getLocation().getZ();
final Location newpos2=new Location(ev1.getPlayer().getWorld(),xpos2,ypos2,zpos2).add(i*xspd,i*yspd,i*zspd);
Bukkit.getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("TwosideKeeper"), new Runnable() {
public void run() {
AreaEffectCloud lp = (AreaEffectCloud)newpos.getWorld().spawnEntity(newpos, EntityType.AREA_EFFECT_CLOUD);
AreaEffectCloud lp = (AreaEffectCloud)newpos2.getWorld().spawnEntity(newpos2, EntityType.AREA_EFFECT_CLOUD);
lp.setColor(Color.OLIVE);
lp.setCustomName(customname);
lp.setBasePotionData(new PotionData(PotionType.INSTANT_DAMAGE));
@ -2805,7 +2862,16 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
},1);
}
}
},15);
},(ex_version)?7:15);
if (ex_version) {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
pd.last_strikerspell=getServerTickTime();
}
},17);
}
}
} else {
if (ev.getItemDrop().getItemStack().getType().toString().contains("SWORD") &&
@ -3450,7 +3516,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (ev.getSpawnReason().equals(SpawnReason.REINFORCEMENTS) || ev.getSpawnReason().equals(SpawnReason.VILLAGE_INVASION)) {
//Remove this one and spawn another one.
Location loc = ev.getEntity().getLocation().clone();
Monster m = (Monster)loc.getWorld().spawnEntity(loc, EntityType.ZOMBIE);
Monster m = (Monster)loc.getWorld().spawnEntity(loc, ev.getEntityType());
m.setTarget(((Monster)ev.getEntity()).getTarget());
MonsterController.MobHeightControl(m,true);
if (m.getCustomName()!=null) {
@ -3966,6 +4032,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public void run() {
log(ChatColor.BLUE+" "+oldhp+"->"+((LivingEntity)ev.getEntity()).getHealth()+" HP",3);
}},1);
if (ev.getDamager() instanceof Player) {
Player p = (Player)ev.getDamager();
if (GenericFunctions.isEquip(p.getEquipment().getItemInMainHand())) {
aPlugin.API.damageItem(p, p.getEquipment().getItemInMainHand(), 1);
}
}
}
} //Negative damage doesn't make sense. We'd apply it normally.
}
@ -4159,7 +4231,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
for (int i=0;i<drop.size();i++) {
deathloc.getWorld().dropItemNaturally(mer.getLocation(), drop.get(i));
Item it = deathloc.getWorld().dropItemNaturally(mer.getLocation(), drop.get(i));
it.setInvulnerable(true);
}
ExperienceOrb exp = (ExperienceOrb)deathloc.getWorld().spawnEntity(mer.getLocation(), EntityType.EXPERIENCE_ORB);
exp.setExperience((int)(expdrop*0.25));
@ -4186,7 +4259,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
for (int i=0;i<drop.size();i++) {
deathloc.getWorld().dropItemNaturally(mer1.getLocation(), drop.get(i));
Item it = deathloc.getWorld().dropItemNaturally(mer1.getLocation(), drop.get(i));
it.setInvulnerable(true);
}
ExperienceOrb exp = (ExperienceOrb)deathloc.getWorld().spawnEntity(mer1.getLocation(), EntityType.EXPERIENCE_ORB);
exp.setExperience((int)(expdrop1*0.25));
@ -5735,6 +5809,19 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,60,(p.isBlocking())?1:0));
}
for (int i=0;i<GenericFunctions.getEquipment(p).length;i++) {
ItemSet set = ItemSet.GetSet(GenericFunctions.getEquipment(p)[i]);
if (set!=null) {
if (set==ItemSet.SONGSTEEL) {
hp += set.GetBaseAmount(GenericFunctions.getEquipment(p)[i]);
}
}
}
if (ItemSet.GetSetCount(ItemSet.SONGSTEEL, p)>=2) {
hp += 8;
}
/*
if (p.hasPotionEffect(PotionEffectType.ABSORPTION)) {
Collection<PotionEffect> player_effects = p.getActivePotionEffects();
@ -6037,6 +6124,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.sendMessage("Habitat Quality: "+habitat_data.getHabitationLevel(p.getLocation()));
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Base Damage: "+ChatColor.RESET+""+ChatColor.DARK_PURPLE+df.format(store2));
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Damage Reduction: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((1.0-store1)*100)+"%");
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Life Steal: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format(NewCombat.calculateLifeStealAmount(p)*100)+"%");
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Critical Strike Chance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((NewCombat.calculateCriticalStrikeChance(p.getEquipment().getItemInMainHand(), p))*100)+"%");
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Dodge Chance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((GenericFunctions.CalculateDodgeChance(p))*100)+"%");
TextComponent f = new TextComponent(ChatColor.GRAY+""+ChatColor.ITALIC+"Current Mode: ");
f.addExtra(GenericFunctions.PlayerModeName(p));

@ -123,6 +123,9 @@ public final class TwosideKeeperAPI {
public static ItemStack generateMegaPiece(Material item, boolean hardened) {
return Loot.GenerateMegaPiece(item, hardened);
}
public static ItemStack generateMegaPiece(Material item, boolean hardened, boolean isSetPiece) {
return Loot.GenerateMegaPiece(item, hardened, isSetPiece);
}
//Server COMMANDS.
public static ServerType getServerType() {

Loading…
Cancel
Save