->Defender Mode in-game text updated.
->Set piece tiers are no longer based on the type of piece they are created on. Instead, tiers of higher rank require a lot more luck to obtain than lower tiers.
This commit is contained in:
parent
7bf3a6be9f
commit
1113ebbed8
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.7.3
|
||||
version: 3.7.3a
|
||||
commands:
|
||||
money:
|
||||
description: Tells the player the amount of money they are holding.
|
||||
|
@ -2058,7 +2058,7 @@ public class GenericFunctions {
|
||||
+ ChatColor.WHITE+"->Hitting mobs as a Defender aggros them to you.\n"
|
||||
+ ChatColor.GRAY+"->Knockback from attacks reduced by 75% while blocking.\n"
|
||||
+ ChatColor.WHITE+"- "+ChatColor.BOLD+"Rejuvenation"+ChatColor.RESET+ChatColor.WHITE+"\n"
|
||||
+ ChatColor.GRAY+"->Knockback from attacks reduced by 75% while blocking.\n"
|
||||
+ ChatColor.GRAY+"->Dropping your shield will give you Regeneration X for 10 seconds and 2 seconds of invulnerability.\n"
|
||||
;
|
||||
}
|
||||
case "striker":{
|
||||
@ -2069,7 +2069,7 @@ public class GenericFunctions {
|
||||
+ ChatColor.GRAY+"->Every 10% of missing health increases your damage by 10%. (Ex. 99% damage increase at 99% lost hp.)\n"
|
||||
+ ChatColor.WHITE+"->Getting hit increases Speed by 1 Level. Stacks up to Speed V (Lasts five seconds.)\n"
|
||||
+ 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.WHITE+"->Dropping 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 they have not noticed you yet does x3 normal damage.\n"
|
||||
;
|
||||
@ -2083,7 +2083,7 @@ public class GenericFunctions {
|
||||
+ ChatColor.WHITE+"You have immunity to all Thorns damage.\n"
|
||||
+ ChatColor.GRAY+"Shift-Right Click to change Bow Modes.\n"
|
||||
+ ChatColor.WHITE+"- "+ChatColor.BOLD+"Close Range Mode (Default):"+ChatColor.RESET+ChatColor.WHITE+" \n"
|
||||
+ ChatColor.GRAY+" You gain the ability to deal headshots from any distance, even directly onto an enemy's face. Each kill made in this mode gives you 100% dodge chance for the next hit taken. You can tumble and gain invulnerability for 1 second by pressing shift + left-click.\n"
|
||||
+ ChatColor.GRAY+" You gain the ability to deal headshots from any distance, even directly onto an enemy's face. Each kill made in this mode gives you 100% dodge chance for the next hit taken. You can tumble and gain invulnerability for 1 second by dropping your bow. Sneak while dropping it to tumble backwards.\n"
|
||||
+ ChatColor.WHITE+"- "+ChatColor.BOLD+"Sniping Mode:"+ChatColor.RESET+ChatColor.WHITE+" \n"
|
||||
+ ChatColor.GRAY+" Headshot collision area increases by x3. Headshots will deal an extra x0.25 damage for each headshot landed, up to a cap of 8 stacks. Each stack also increases your Slowness level by 1.\n"
|
||||
+ ChatColor.WHITE+" Arrows are lightning-fast in Sniping Mode.\n"
|
||||
@ -2469,58 +2469,6 @@ public class GenericFunctions {
|
||||
return pd.hasfullrangerset;
|
||||
}
|
||||
|
||||
public static double CalculateDodgeChance(Player p) {
|
||||
double dodgechance = 0.0d;
|
||||
dodgechance+=(ArtifactAbility.calculateValue(ArtifactAbility.DODGE, p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ArtifactAbility.DODGE, p.getEquipment().getItemInMainHand()))/100d);
|
||||
|
||||
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getArmorContents()[i]) &&
|
||||
p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) {
|
||||
dodgechance+=0.01*p.getEquipment().getArmorContents()[i].getEnchantmentLevel(Enchantment.LUCK);
|
||||
}
|
||||
ItemStack equip = p.getEquipment().getArmorContents()[i];
|
||||
if (isRanger(p) && equip!=null
|
||||
&& equip.getType()!=Material.AIR &&
|
||||
equip.hasItemMeta() && equip.getItemMeta().hasLore()) {
|
||||
if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Jamdak Set")) {
|
||||
dodgechance+=0.03;
|
||||
} else
|
||||
if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Darnys Set")) {
|
||||
dodgechance+=0.05;
|
||||
} else
|
||||
if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Alikahn Set")) {
|
||||
dodgechance+=0.08;
|
||||
} else
|
||||
if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Lorasaadi Set")) {
|
||||
dodgechance+=0.11;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getItemInMainHand()) &&
|
||||
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) {
|
||||
dodgechance+=0.2;
|
||||
}
|
||||
if (isRanger(p)) {
|
||||
dodgechance+=0.5;
|
||||
}
|
||||
if (pd.fulldodge) {
|
||||
dodgechance = 1.0;
|
||||
}
|
||||
return dodgechance;
|
||||
}
|
||||
|
||||
public static ItemStack applyModeName(ItemStack item) {
|
||||
if (item!=null &&
|
||||
item.getType()!=Material.AIR &&
|
||||
@ -2918,4 +2866,26 @@ public class GenericFunctions {
|
||||
ent.getEquipment().getBoots()
|
||||
};
|
||||
}
|
||||
|
||||
public static void updateSetItems(Player player) {
|
||||
TwosideKeeper.log("Inventory is size "+player.getInventory().getSize(),2);
|
||||
for (int i=0;i<player.getInventory().getSize();i++) {
|
||||
if (ItemSet.isSetItem(player.getInventory().getItem(i))) {
|
||||
//Update the lore. See if it's hardened. If it is, we will save just that piece.
|
||||
//Save the tier and type as well.
|
||||
ItemSet set = ItemSet.GetSet(player.getInventory().getItem(i));
|
||||
int tier = ItemSet.GetTier(player.getInventory().getItem(i));
|
||||
|
||||
List<String> newlore = new ArrayList<String>();
|
||||
|
||||
if (GenericFunctions.isHardenedItem(player.getInventory().getItem(i))) {
|
||||
newlore.add(ChatColor.GRAY+"Breaks Remaining: "+ChatColor.YELLOW+GenericFunctions.getHardenedItemBreaks(player.getInventory().getItem(i)));
|
||||
}
|
||||
newlore.addAll(ItemSet.GenerateLore(set, tier));
|
||||
ItemMeta m = player.getInventory().getItem(i).getItemMeta();
|
||||
m.setLore(newlore);
|
||||
player.getInventory().getItem(i).setItemMeta(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,28 +1,45 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
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);
|
||||
PANROS(1,1, 3,2, 10,10, 20,10),
|
||||
SONGSTEEL(4,4, 6,2, 8,4, 20,10),
|
||||
DAWNTRACKER(3,2, 2,1, 6,4, 4,2),
|
||||
LORASYS(0,0, 0,0, 0,0, 0,0);
|
||||
|
||||
int val1;
|
||||
int val2;
|
||||
int val3;
|
||||
int baseval;
|
||||
int increase_val;
|
||||
int baseval_bonus2;
|
||||
int increase_val_bonus2;
|
||||
int baseval_bonus3;
|
||||
int increase_val_bonus3;
|
||||
int baseval_bonus4;
|
||||
int increase_val_bonus4;
|
||||
|
||||
ItemSet(int val1,int val2, int val3) {
|
||||
this.val1=val1;
|
||||
this.val2=val2;
|
||||
this.val3=val3;
|
||||
ItemSet(int baseval,int increase_val,
|
||||
int baseval2,int increase_val2,
|
||||
int baseval3,int increase_val3,
|
||||
int baseval4,int increase_val4) {
|
||||
this.baseval=baseval;
|
||||
this.increase_val=increase_val;
|
||||
this.baseval_bonus2=baseval2;
|
||||
this.increase_val_bonus2=increase_val2;
|
||||
this.baseval_bonus3=baseval3;
|
||||
this.increase_val_bonus3=increase_val3;
|
||||
this.baseval_bonus4=baseval4;
|
||||
this.increase_val_bonus4=increase_val4;
|
||||
}
|
||||
|
||||
public static boolean isSetItem(ItemStack item) {
|
||||
@ -58,18 +75,28 @@ public enum ItemSet {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int GetBaseAmount(ItemStack item) {
|
||||
switch (GetTier(item)) {
|
||||
public static int GetBaseAmount(ItemSet set, int tier, int stat) {
|
||||
//stat will be 1 for the base value, 2 for the 2-piece set bonus, 3 for the 3-piece set bonus, and 4 for the 4-piece set bonus.
|
||||
switch (stat) {
|
||||
case 1:{
|
||||
return set.baseval+((tier-1)*set.increase_val);
|
||||
}
|
||||
case 2:{
|
||||
return set.baseval_bonus2+((tier-1)*set.increase_val_bonus2);
|
||||
}
|
||||
case 3:{
|
||||
return this.val2;
|
||||
return set.baseval_bonus3+((tier-1)*set.increase_val_bonus3);
|
||||
}
|
||||
case 4:{
|
||||
return this.val3;
|
||||
}
|
||||
default:{
|
||||
return this.val1;
|
||||
return set.baseval_bonus4+((tier-1)*set.increase_val_bonus4);
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log(ChatColor.RED+"Error occurred while attempting to grab the Base Amount!!!", 1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int GetBaseAmount(ItemStack item) {
|
||||
return baseval+((GetTier(item)-1)*increase_val);
|
||||
}
|
||||
|
||||
public static int GetSetCount(ItemSet set, LivingEntity ent) {
|
||||
@ -85,4 +112,140 @@ public enum ItemSet {
|
||||
TwosideKeeper.log("Currently have "+count+" pieces from the "+set.name()+" set.", 5);
|
||||
return count;
|
||||
}
|
||||
|
||||
public static int GetTierSetCount(ItemSet set, int tier, 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) && GetTier(GenericFunctions.getEquipment(ent)[i])==tier) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("Currently have "+count+" pieces from the "+set.name()+" set of Tier +"+tier+".", 5);
|
||||
return count;
|
||||
}
|
||||
|
||||
public static int GetTotalBaseAmount(LivingEntity ent, ItemSet set) {
|
||||
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 += set.GetBaseAmount(GenericFunctions.getEquipment(ent)[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("Base Total of all equipment from this set is "+count, 2);
|
||||
return count;
|
||||
}
|
||||
|
||||
public static boolean hasFullSet(LivingEntity ent, ItemSet set) {
|
||||
//Return a mapping of all tier values that meet the count requirement for that set.
|
||||
for (int i=0;i<GenericFunctions.getEquipment(ent).length;i++) {
|
||||
ItemSet temp = ItemSet.GetSet(GenericFunctions.getEquipment(ent)[i]);
|
||||
if (temp!=null) {
|
||||
int tier = ItemSet.GetTier(GenericFunctions.getEquipment(ent)[i]);
|
||||
if (ItemSet.GetTierSetCount(set, tier, ent)>=5) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static List<Integer> GetSetBonusCount(LivingEntity ent, ItemSet set, int count) {
|
||||
//Return a mapping of all tier values that meet the count requirement for that set.
|
||||
List<Integer> mapping = new ArrayList<Integer>();
|
||||
for (int i=0;i<GenericFunctions.getEquipment(ent).length;i++) {
|
||||
ItemSet temp = ItemSet.GetSet(GenericFunctions.getEquipment(ent)[i]);
|
||||
if (temp!=null) {
|
||||
int tier = ItemSet.GetTier(GenericFunctions.getEquipment(ent)[i]);
|
||||
if (ItemSet.GetTierSetCount(set, tier, ent)>=count) {
|
||||
if (!mapping.contains(tier)) {
|
||||
mapping.add(tier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return mapping;
|
||||
}
|
||||
|
||||
public static double TotalBaseAmountBasedOnSetBonusCount(Player p, ItemSet set, int count, int set_bonus) {
|
||||
double amt = 0.0;
|
||||
for (int i=0;i<ItemSet.GetSetBonusCount(p, set, count).size();i++) {
|
||||
int tier = ItemSet.GetSetBonusCount(p, set, count).get(i);
|
||||
amt+=ItemSet.GetBaseAmount(set, tier, set_bonus);
|
||||
}
|
||||
return amt;
|
||||
}
|
||||
|
||||
public static Collection<? extends String> GenerateLore(ItemSet set, int tier) {
|
||||
List<String> lore = new ArrayList<String>();
|
||||
switch (set) {
|
||||
case PANROS:{
|
||||
lore.add(ChatColor.LIGHT_PURPLE+"Striker Gear");
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Panros Set");
|
||||
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+" Damage");
|
||||
}break;
|
||||
case SONGSTEEL:{
|
||||
lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear");
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Songsteel Set");
|
||||
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+" Health");
|
||||
}break;
|
||||
case DAWNTRACKER:{
|
||||
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Dawntracker Set");
|
||||
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+"% Lifesteal");
|
||||
}break;
|
||||
case LORASYS:{
|
||||
lore.add(ChatColor.LIGHT_PURPLE+"Slayer Gear");
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Lorasys Set");
|
||||
lore.add(ChatColor.YELLOW+"???");
|
||||
}break;
|
||||
}
|
||||
|
||||
lore.add("");
|
||||
|
||||
switch (set) {
|
||||
case PANROS:{
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
||||
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+" Damage");
|
||||
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Dodge Chance");
|
||||
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+"% 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 SONGSTEEL:{
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
||||
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+" Max Health");
|
||||
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+" Absorption (30 seconds)");
|
||||
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+"% 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 DAWNTRACKER:{
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
||||
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+" Damage");
|
||||
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Lifesteal");
|
||||
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+" 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 LORASYS:{
|
||||
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;
|
||||
}
|
||||
return lore;
|
||||
}
|
||||
}
|
||||
|
@ -132,23 +132,28 @@ public class Loot {
|
||||
String set_name = "";
|
||||
String prefix = "";
|
||||
prefix = (hardened)?(ChatColor.LIGHT_PURPLE+""+ChatColor.BOLD+"Hardened Mega "):(ChatColor.AQUA+""+ChatColor.BOLD+"Mega ");
|
||||
ItemSet set = null;
|
||||
switch (type) {
|
||||
case 0:{
|
||||
set = ItemSet.PANROS;
|
||||
set_name = prefix+"Panros Striker "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Striker set.
|
||||
}break;
|
||||
case 1:{
|
||||
set = ItemSet.SONGSTEEL;
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.SHIELD);
|
||||
}
|
||||
set_name = prefix+"Songsteel Defender "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Defender set.
|
||||
}break;
|
||||
case 2:{
|
||||
set = ItemSet.DAWNTRACKER;
|
||||
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:{
|
||||
set = ItemSet.LORASYS;
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
//Convert Slayer weapon here. ???
|
||||
}
|
||||
@ -158,125 +163,9 @@ public class Loot {
|
||||
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;
|
||||
}
|
||||
int tier = 0;
|
||||
do {tier++;} while(Math.random()<=0.25);
|
||||
lore.addAll(ItemSet.GenerateLore(set,tier));
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.setLore(lore);
|
||||
m.setDisplayName(set_name);
|
||||
|
@ -511,7 +511,7 @@ public class NewCombat {
|
||||
ItemSet set = ItemSet.GetSet(GenericFunctions.getEquipment(shooter)[i]);
|
||||
if (set!=null) {
|
||||
if (set==ItemSet.PANROS) {
|
||||
double dmg = set.GetBaseAmount(GenericFunctions.getEquipment(shooter)[i]);
|
||||
double dmg = ItemSet.GetBaseAmount(set,ItemSet.GetTier(GenericFunctions.getEquipment(shooter)[i]),1);
|
||||
addToPlayerLogger(ent,"Set Piece Damage",dmg);
|
||||
basedmg += dmg;
|
||||
}
|
||||
@ -531,20 +531,14 @@ public class NewCombat {
|
||||
aPlugin.API.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+" dmg stored");
|
||||
}
|
||||
}
|
||||
}
|
||||
double dmg = ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.PANROS,2,2);
|
||||
addToPlayerLogger(ent,"Set Bonus",dmg);
|
||||
basedmg += dmg;
|
||||
|
||||
if (ItemSet.GetSetCount(ItemSet.PANROS, shooter)>=2) {
|
||||
double dmg = 5;
|
||||
dmg = ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.DAWNTRACKER,2,2);
|
||||
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;
|
||||
dmg = ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.DAWNTRACKER,4,4);
|
||||
addToPlayerLogger(ent,"Set Bonus",dmg);
|
||||
basedmg += dmg;
|
||||
}
|
||||
@ -843,8 +837,8 @@ public class NewCombat {
|
||||
if (shooter instanceof Player) {
|
||||
Player p = (Player)shooter;
|
||||
critchance += (GenericFunctions.isStriker(p)?0.2:0.0);
|
||||
critchance += ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.PANROS,4,4)/100d;
|
||||
}
|
||||
critchance += (ItemSet.GetSetCount(ItemSet.PANROS, shooter)>=4)?0.4:0.0;
|
||||
}
|
||||
return critchance;
|
||||
}
|
||||
@ -1167,9 +1161,7 @@ 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;
|
||||
}
|
||||
dmgreduction *= 1.0+(ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 4, 4)/100d);
|
||||
}
|
||||
|
||||
//Blocking: -((p.isBlocking())?ev.getDamage()*0.33:0) //33% damage will be reduced if we are blocking.
|
||||
@ -1223,9 +1215,7 @@ public class NewCombat {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ItemSet.GetSetCount(ItemSet.DAWNTRACKER, p)>=3) {
|
||||
lifestealpct += 0.10;
|
||||
}
|
||||
lifestealpct += ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 3, 3)/100d;
|
||||
return lifestealpct;
|
||||
}
|
||||
|
||||
@ -1364,7 +1354,7 @@ 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) {
|
||||
if (p.isBlocking() && ItemSet.hasFullSet(p, ItemSet.SONGSTEEL)) {
|
||||
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");
|
||||
@ -1441,5 +1431,55 @@ public class NewCombat {
|
||||
return finaldmg<=healthabs;
|
||||
}
|
||||
|
||||
public static double CalculateDodgeChance(Player p) {
|
||||
double dodgechance = 0.0d;
|
||||
dodgechance+=(ArtifactAbility.calculateValue(ArtifactAbility.DODGE, p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ArtifactAbility.DODGE, p.getEquipment().getItemInMainHand()))/100d);
|
||||
|
||||
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getArmorContents()[i]) &&
|
||||
p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) {
|
||||
dodgechance+=0.01*p.getEquipment().getArmorContents()[i].getEnchantmentLevel(Enchantment.LUCK);
|
||||
}
|
||||
ItemStack equip = p.getEquipment().getArmorContents()[i];
|
||||
if (GenericFunctions.isRanger(p) && equip!=null
|
||||
&& equip.getType()!=Material.AIR &&
|
||||
equip.hasItemMeta() && equip.getItemMeta().hasLore()) {
|
||||
if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Jamdak Set")) {
|
||||
dodgechance+=0.03;
|
||||
} else
|
||||
if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Darnys Set")) {
|
||||
dodgechance+=0.05;
|
||||
} else
|
||||
if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Alikahn Set")) {
|
||||
dodgechance+=0.08;
|
||||
} else
|
||||
if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Lorasaadi Set")) {
|
||||
dodgechance+=0.11;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getItemInMainHand()) &&
|
||||
p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) {
|
||||
dodgechance+=0.01*p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK);
|
||||
}
|
||||
|
||||
dodgechance+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.PANROS,3,3)/100d;
|
||||
|
||||
if (GenericFunctions.isStriker(p) &&
|
||||
pd.velocity>0) {
|
||||
dodgechance+=0.2;
|
||||
}
|
||||
if (GenericFunctions.isRanger(p)) {
|
||||
dodgechance+=0.5;
|
||||
}
|
||||
if (pd.fulldodge) {
|
||||
dodgechance = 1.0;
|
||||
}
|
||||
return dodgechance;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -447,13 +447,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
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) {
|
||||
double absorption_amt = ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 3, 3);
|
||||
if (absorption_amt>0) {
|
||||
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));
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4)+oldlv));
|
||||
} else {
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,599,2));
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1238,6 +1239,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
playerdata.put(ev.getPlayer().getUniqueId(), new PlayerStructure(ev.getPlayer(),getServerTickTime()));
|
||||
log("[TASK] New Player Data has been added. Size of array: "+playerdata.size(),4);
|
||||
|
||||
GenericFunctions.updateSetItems(ev.getPlayer());
|
||||
|
||||
//Update player max health. Check equipment too.
|
||||
setPlayerMaxHealth(ev.getPlayer());
|
||||
ev.getPlayer().getScoreboard().getTeam(ev.getPlayer().getName().toLowerCase()).setSuffix(createHealthbar(((ev.getPlayer().getHealth())/ev.getPlayer().getMaxHealth())*100,ev.getPlayer()));
|
||||
@ -2791,7 +2794,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
!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;
|
||||
boolean ex_version = ItemSet.hasFullSet(ev.getPlayer(), ItemSet.PANROS);
|
||||
ev.getItemDrop().setPickupDelay(0);
|
||||
Vector facing = ev.getPlayer().getLocation().getDirection();
|
||||
if (!second_charge) {
|
||||
@ -3766,7 +3769,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
//final double pcthp = ((p.getHealth())/p.getMaxHealth())*100;
|
||||
|
||||
double dodgechance = GenericFunctions.CalculateDodgeChance(p);
|
||||
double dodgechance = NewCombat.CalculateDodgeChance(p);
|
||||
|
||||
if (ev.getCause()==DamageCause.THORNS &&
|
||||
GenericFunctions.isRanger(p)) {
|
||||
@ -3968,7 +3971,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
if (p.hasPotionEffect(PotionEffectType.GLOWING)) {
|
||||
ev.setCancelled(true);
|
||||
}
|
||||
double dodgechance = GenericFunctions.CalculateDodgeChance(p);
|
||||
double dodgechance = NewCombat.CalculateDodgeChance(p);
|
||||
if (ev.getCause()==DamageCause.THORNS &&
|
||||
GenericFunctions.isRanger(p)) {
|
||||
dodgechance=1;
|
||||
@ -5818,9 +5821,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ItemSet.GetSetCount(ItemSet.SONGSTEEL, p)>=2) {
|
||||
hp += 8;
|
||||
}
|
||||
hp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 2, 2);
|
||||
|
||||
/*
|
||||
if (p.hasPotionEffect(PotionEffectType.ABSORPTION)) {
|
||||
@ -6126,7 +6127,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
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)+"%");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Dodge Chance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((NewCombat.CalculateDodgeChance(p))*100)+"%");
|
||||
TextComponent f = new TextComponent(ChatColor.GRAY+""+ChatColor.ITALIC+"Current Mode: ");
|
||||
f.addExtra(GenericFunctions.PlayerModeName(p));
|
||||
p.spigot().sendMessage(f);
|
||||
|
Loading…
x
Reference in New Issue
Block a user