diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 1f1925e..b3cb99f 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/ActionBarBuffUpdater.java b/src/sig/plugin/TwosideKeeper/ActionBarBuffUpdater.java index fb20f88..498f60a 100644 --- a/src/sig/plugin/TwosideKeeper/ActionBarBuffUpdater.java +++ b/src/sig/plugin/TwosideKeeper/ActionBarBuffUpdater.java @@ -26,9 +26,7 @@ public class ActionBarBuffUpdater{ public static String getActionBarPrefix(LivingEntity p) { StringBuilder actionbardisplay = new StringBuilder(""); for (PotionEffect pe : p.getActivePotionEffects()) { - if (pe.getAmplifier()>3) { - actionbardisplay.append(ParseEffect(p,pe)); - } + actionbardisplay.append(ParseEffect(p,pe)); } actionbardisplay.append(AddAdditionalEffects(p)); //TwosideKeeper.log(actionbardisplay.toString(), 0); @@ -43,25 +41,25 @@ public class ActionBarBuffUpdater{ StringBuilder effectString=new StringBuilder(""); if (p instanceof Player) { PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)p); - if (p.getFireTicks()>=20) { + if (p.getFireTicks()>0) { effectString.append(ChatColor.GOLD); effectString.append("⚠"); effectString.append(AppendAmplifier((p.getFireTicks()/20)-1,false)); effectString.append(" "); } - if (pd.lifestealstacks>4) { + if (pd.lifestealstacks>0) { effectString.append(ChatColor.AQUA); effectString.append("❣"); effectString.append(AppendAmplifier(pd.lifestealstacks-1)); effectString.append(" "); } - if (pd.weaponcharges>4) { + if (pd.weaponcharges>0) { effectString.append(ChatColor.DARK_AQUA); effectString.append("☤"); effectString.append(AppendAmplifier(pd.weaponcharges-1)); effectString.append(" "); } - if (pd.damagepool>4) { + if (pd.damagepool>0) { effectString.append(ChatColor.DARK_PURPLE); effectString.append("♥"); effectString.append(AppendAmplifier((int)(pd.damagepool-1))); @@ -74,7 +72,7 @@ public class ActionBarBuffUpdater{ effectString.append(AppendAmplifier(((int)((pd.lastvendettastack+200)-TwosideKeeper.getServerTickTime())/20)-1,false)); effectString.append(" "); } - if (pd.swiftaegisamt>4) { + if (pd.swiftaegisamt>0) { effectString.append(ChatColor.YELLOW); effectString.append("❈"); effectString.append(AppendAmplifier((int)(GenericFunctions.getSwiftAegisAmt((Player)p)-1))); @@ -87,6 +85,9 @@ public class ActionBarBuffUpdater{ effectString.append(AppendAmplifier((int)(pd.regenpool))); effectString.append(" "); } + if (pd.vendetta_amt>0 && effectString.length()==0) { + + } } HashMap buffMap = Buff.getBuffData(p); for (String s : buffMap.keySet()) { diff --git a/src/sig/plugin/TwosideKeeper/CustomDamage.java b/src/sig/plugin/TwosideKeeper/CustomDamage.java index 8967cd4..df32165 100644 --- a/src/sig/plugin/TwosideKeeper/CustomDamage.java +++ b/src/sig/plugin/TwosideKeeper/CustomDamage.java @@ -278,6 +278,8 @@ public class CustomDamage { dmg += addMultiplierToPlayerLogger(damager,target,"Airborne Mult",dmg * calculateAirborneAttackMultiplier(shooter)); dmg += addMultiplierToPlayerLogger(damager,target,"Dodge Chance Set Bonus Mult",dmg * calculateDodgeChanceSetBonusMultiplier(shooter)); dmg += addMultiplierToPlayerLogger(damager,target,"Damage Reduction Set Bonus Mult",dmg * calculateDamageReductionSetBonusMultiplier(shooter)); + dmg += addMultiplierToPlayerLogger(damager,target,"Weapon Charge Bonus Mult",dmg * calculateWeaponChargeBonusMultiplier(shooter)); + dmg += addMultiplierToPlayerLogger(damager,target,"Damage Pool Bonus Mult",dmg * calculateDamagePoolBonusMultiplier(shooter)); if (reason==null || !reason.equalsIgnoreCase("Test Damage")) { double critdmg = addMultiplierToPlayerLogger(damager,target,"Critical Strike Mult",dmg * calculateCriticalStrikeMultiplier(weapon,shooter,target,reason,flags)); if (critdmg!=0.0) {crit=true; @@ -312,6 +314,30 @@ public class CustomDamage { return dmg; } + private static double calculateDamagePoolBonusMultiplier(LivingEntity shooter) { + double mult = 0.0; + if (shooter instanceof Player) { + Player p = (Player)shooter; + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + if (pd.damagepool>0) { + mult+=pd.damagepool*(ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LEGION, 4, 4)/100d); + } + } + return mult; + } + + private static double calculateWeaponChargeBonusMultiplier(LivingEntity shooter) { + double mult = 0.0; + if (shooter instanceof Player) { + Player p = (Player)shooter; + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + if (pd.weaponcharges>0) { + mult+=Math.min(pd.weaponcharges/10,20)*(ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LEGION, 3, 3)/100d); + } + } + return mult; + } + private static double calculateDodgeChanceSetBonusMultiplier(LivingEntity shooter) { double mult = 0.0; if (shooter instanceof Player) { @@ -533,7 +559,8 @@ public class CustomDamage { pd.thorns_amt+=((1-CalculateDamageReduction(1,target,damager))*pd.lastrawdamage)*0.01; } DecimalFormat df = new DecimalFormat("0.00"); - GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+" Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+((pd.thorns_amt>0)?"/"+ChatColor.GOLD+df.format(pd.thorns_amt):"")+ChatColor.GREEN+" dmg stored",true); + GenericFunctions.sendActionBarMessage(p, "", true); + //GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+" Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+((pd.thorns_amt>0)?"/"+ChatColor.GOLD+df.format(pd.thorns_amt):"")+ChatColor.GREEN+" dmg stored",true); } } if (getDamagerEntity(damager) instanceof Enderman) { @@ -566,6 +593,7 @@ public class CustomDamage { reduceKnockback(p); reduceSwiftAegisBuff(p); restoreHealthToPartyMembersWithProtectorSet(p); + applySustenanceSetonHitEffects(p); if (!isFlagSet(flags,NOAOE)) { if (damageMath.min(2*tier, 10)) { + b.setStacks(Math.min(2*tier, 10)); + } + } + if (ItemSet.hasFullSet(p, ItemSet.SUSTENANCE)) { + int regenamt = ItemSet.getHighestTierInSet(p, ItemSet.SUSTENANCE); + for (Player pl : PartyManager.getPartyMembers(p)) { + if (!pl.equals(p)) { + PlayerStructure pd = PlayerStructure.GetPlayerStructure(pl); + pd.regenpool+=regenamt; + hardCapRegenPool(pl,pd); + GenericFunctions.sendActionBarMessage(pl, "", true); + } + } + } + } + private static void restoreHealthToPartyMembersWithProtectorSet(Player p) { if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PROTECTOR, 4)) { double healamt = ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.PROTECTOR, 4, 4); @@ -1235,7 +1298,7 @@ public class CustomDamage { pd.damagepooltime=TwosideKeeper.getServerTickTime(); } if (damage>getTransferDamage(p)) { - pd.damagepool+=damage-getTransferDamage(p); + pd.damagepool+=(damage-getTransferDamage(p))*getDamagePoolMult(p); return getTransferDamage(p); } else { //pd.damagepool=0; @@ -1246,6 +1309,12 @@ public class CustomDamage { return damage; } + public static double getDamagePoolMult(Player p) { + double mult = 1.0; + mult -= ItemSet.GetTotalBaseAmount(p, ItemSet.LEGION)/100d; + return mult; + } + private static void increaseBarbarianStacks(Player p, ItemStack weapon) { if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); @@ -1443,8 +1512,15 @@ public class CustomDamage { }*/ PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) { + if ((p.getMaxHealth()-p.getHealth())0) { - double leftovers = 0; if (pd.regenpool>pd.damagepool) { pd.regenpool-=pd.damagepool; } @@ -1455,14 +1531,18 @@ public class CustomDamage { } else { pd.regenpool += lifestealamt; } - if (pd.regenpool>p.getMaxHealth()) { - pd.regenpool=p.getMaxHealth(); - } + hardCapRegenPool(p, pd); DecimalFormat df = new DecimalFormat("0.00"); GenericFunctions.sendActionBarMessage(p, ""); TwosideKeeper.log(p.getName()+" healed "+df.format(lifestealamt)+" dmg from Lifesteal.", 5); } + private static void hardCapRegenPool(Player p, PlayerStructure pd) { + if (pd.regenpool>p.getMaxHealth()) { + pd.regenpool=p.getMaxHealth(); + } + } + public static void castEruption(Player p, Entity target, ItemStack weapon) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); if (GenericFunctions.isArtifactEquip(weapon) && @@ -1944,7 +2024,8 @@ public class CustomDamage { pd.thorns_amt+=((1-CalculateDamageReduction(1,target,damager))*(rawdmg*0.01)); } DecimalFormat df = new DecimalFormat("0.00"); - GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+" Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+((pd.thorns_amt>0)?"/"+ChatColor.GOLD+df.format(pd.thorns_amt):"")+ChatColor.GREEN+" dmg stored",true); + GenericFunctions.sendActionBarMessage(p, "", true); + //GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+" Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+((pd.thorns_amt>0)?"/"+ChatColor.GOLD+df.format(pd.thorns_amt):"")+ChatColor.GREEN+" dmg stored",true); } if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.VIXEN, 4)) { p.setHealth(Math.min(p.getHealth()+(p.getMaxHealth()*0.1), p.getMaxHealth())); @@ -2002,9 +2083,9 @@ public class CustomDamage { dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.DARNYS)/100d); dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.JAMDAK)/100d); dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.LORASAADI)/100d); - TwosideKeeper.log("Dodge Chance: "+dodgechance, 0); + //TwosideKeeper.log("Dodge Chance: "+dodgechance, 0); dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.SHARD)/100d); - TwosideKeeper.log("Dodge Chance: "+dodgechance, 0); + //TwosideKeeper.log("Dodge Chance: "+dodgechance, 0); if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LUCI, 2)) { dodgechance=addMultiplicativeValue(dodgechance,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LUCI, 2, 2)/100d); } @@ -3271,9 +3352,12 @@ public class CustomDamage { if (pd.rage_time>TwosideKeeper.getServerTickTime()) { lifestealpct += (pd.rage_amt/2)*0.01; } - if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6)) { + if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6) || + ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION,6) || + ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE,6)) { lifestealpct+=0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand()); } + lifestealpct+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LEGION, 2, 2)/100d; if (reason!=null && reason.equalsIgnoreCase("sweep up")) { lifestealpct*=2; } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index b206920..5c7d292 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -2872,34 +2872,39 @@ public class GenericFunctions { @SuppressWarnings("deprecation") public static void PerformDodge(Player p) { - if (p.isOnGround() && PlayerMode.isRanger(p) && + if (PlayerMode.isRanger(p) && (GenericFunctions.getBowMode(p)==BowMode.CLOSE)) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); if (pd.last_dodge+GetModifiedCooldown(TwosideKeeper.DODGE_COOLDOWN,p)<=TwosideKeeper.getServerTickTime()) { - PlayerTumbleEvent ev = new PlayerTumbleEvent(p); - Bukkit.getPluginManager().callEvent(ev); - if (!ev.isCancelled()) { - pd.last_dodge=TwosideKeeper.getServerTickTime(); - aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.DODGE_COOLDOWN,p)); - SoundUtils.playLocalSound(p, Sound.ENTITY_DONKEY_CHEST, 1.0f, 1.0f); - - int dodgeduration = 20; - - if (GenericFunctions.HasFullRangerSet(p)) { - dodgeduration = 30; + if (p.isOnGround()) { + PlayerTumbleEvent ev = new PlayerTumbleEvent(p); + Bukkit.getPluginManager().callEvent(ev); + if (!ev.isCancelled()) { + pd.last_dodge=TwosideKeeper.getServerTickTime(); + aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.DODGE_COOLDOWN,p)); + SoundUtils.playLocalSound(p, Sound.ENTITY_DONKEY_CHEST, 1.0f, 1.0f); + + int dodgeduration = 20; + + if (GenericFunctions.HasFullRangerSet(p)) { + dodgeduration = 30; + } + + if (p.isSneaking()) { //Do a backwards dodge + jump. + p.setVelocity(p.getLocation().getDirection().multiply(-0.7f)); + } else { + p.setVelocity(p.getLocation().getDirection().multiply(1.4f)); + } + ApplySwiftAegis(p); + CustomDamage.addIframe(dodgeduration, p); + + logAndApplyPotionEffectToEntity(PotionEffectType.SPEED,dodgeduration,2,p); + TwosideKeeper.sendSuccessfulCastMessage(p); } - - if (p.isSneaking()) { //Do a backwards dodge + jump. - p.setVelocity(p.getLocation().getDirection().multiply(-0.7f)); - } else { - p.setVelocity(p.getLocation().getDirection().multiply(1.4f)); - } - ApplySwiftAegis(p); - CustomDamage.addIframe(dodgeduration, p); - - logAndApplyPotionEffectToEntity(PotionEffectType.SPEED,dodgeduration,2,p); } - } + } else { + TwosideKeeper.sendNotReadyCastMessage(p,ChatColor.LIGHT_PURPLE+"Dodge"); + } } } @@ -3669,6 +3674,18 @@ public class GenericFunctions { ItemStack[] equips = p.getEquipment().getArmorContents(); + if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION, 5)) { + if (!Buff.hasBuff(p, "COOLDOWN_UNDYING_RAGE") || Buff.hasBuff(p, "UNKILLABLE")) { + RevivePlayer(p,1); + revived=true; + if (!Buff.hasBuff(p, "COOLDOWN_UNDYING_RAGE")) { + Buff.addBuff(p, "UNKILLABLE", new Buff("Unkillable",ItemSet.getHighestTierInSet(p, ItemSet.LEGION)*20+120,0,org.bukkit.Color.PURPLE,ChatColor.YELLOW+"✩",true)); + Buff.addBuff(p, "COOLDOWN_UNDYING_RAGE", new Buff("Undying Rage Cooldown",20*60,0,null,ChatColor.WHITE+"",true)); + } + } + return true; + } + if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.GLADOMAIN, 5) && pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN, p)<=TwosideKeeper.getServerTickTime()) { pd.lastlifesavertime=TwosideKeeper.getServerTickTime(); @@ -4806,8 +4823,9 @@ public class GenericFunctions { aPlugin.API.setPlayerSpeedMultiplier(p, 0); p.setWalkSpeed(0f); p.setFlying(false); + } else { + GlowAPI.setGlowing(ent, GlowAPI.Color.BLACK, Bukkit.getOnlinePlayers()); } - GlowAPI.setGlowing(ent, GlowAPI.Color.BLACK, Bukkit.getOnlinePlayers()); } //l.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,ticks,99)); TwosideKeeper.log("Base Value: "+l.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getBaseValue(), 5); @@ -4901,8 +4919,8 @@ public class GenericFunctions { return ent.getCustomName().split(ChatColor.RESET+" ")[0]; }*/ if (!(ent instanceof Player)) { - LivingEntityStructure struct = LivingEntityStructure.GetLivingEntityStructure(ent); - return struct.getActualName(); + //return struct.getActualName(); + return LivingEntityStructure.GetLivingEntityStructure(ent).getDifficultyAndMonsterName(); } else { Player p = (Player)ent; return p.getName(); @@ -5049,10 +5067,12 @@ public class GenericFunctions { * surpass the maximum health of the entity. */ public static void HealEntity(LivingEntity p, double healamt) { - if (p.getHealth()+healamt0) { + if (p.getHealth()+healamt list = GenericFunctions.getNearbyMobs(p.getLocation(), 16); - List poisonlist = new ArrayList(); - int totalpoisonstacks = 0; - for (LivingEntity ent : list) { - if (!(ent instanceof Player)) { - boolean haspoison=false; - if (ent.hasPotionEffect(PotionEffectType.POISON)) { - int poisonlv = GenericFunctions.getPotionEffectLevel(PotionEffectType.POISON, ent); - totalpoisonstacks+=poisonlv+1; - haspoison=true; - } - if (ent.hasPotionEffect(PotionEffectType.BLINDNESS)) { - int blindnesslv = GenericFunctions.getPotionEffectLevel(PotionEffectType.BLINDNESS, ent); - totalpoisonstacks+=blindnesslv+1; - haspoison=true; - } - if (haspoison) { - poisonlist.add(ent); - } - } - } - if (totalpoisonstacks>0) { - pd.last_siphon=TwosideKeeper.getServerTickTime(); - SoundUtils.playLocalSound(p, Sound.BLOCK_FENCE_GATE_OPEN, 1.0f, 0.4f); - aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.SIPHON_COOLDOWN,p)); - for (LivingEntity ent : poisonlist) { - //Refresh poison stacks if necessary. - int totalpoisonlv = 0; - if (ent.hasPotionEffect(PotionEffectType.POISON)) { - int poisonlv = GenericFunctions.getPotionEffectLevel(PotionEffectType.POISON, ent); - int poisondur = GenericFunctions.getPotionEffectDuration(PotionEffectType.POISON, ent); - totalpoisonlv+=poisonlv+1; - if (poisondur<20*15) { - GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.POISON, 20*15, poisonlv, ent, true); + if (p.isOnGround()) { + List list = GenericFunctions.getNearbyMobs(p.getLocation(), 16); + List poisonlist = new ArrayList(); + int totalpoisonstacks = 0; + for (LivingEntity ent : list) { + if (!(ent instanceof Player)) { + boolean haspoison=false; + if (ent.hasPotionEffect(PotionEffectType.POISON)) { + int poisonlv = GenericFunctions.getPotionEffectLevel(PotionEffectType.POISON, ent); + totalpoisonstacks+=poisonlv+1; + haspoison=true; } - GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW, 20*15, poisonlv, ent); - } - if (Buff.hasBuff(ent, "Poison")) { - Buff b = Buff.getBuff(ent, "Poison"); - int poisonlv = b.getAmplifier(); - long poisondur = b.getRemainingBuffTime(); - totalpoisonlv+=poisonlv+1; - if (poisondur<20*15) { - //GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.POISON, 20*15, poisonlv, ent, true); - b.refreshDuration(20*15); + if (ent.hasPotionEffect(PotionEffectType.BLINDNESS)) { + int blindnesslv = GenericFunctions.getPotionEffectLevel(PotionEffectType.BLINDNESS, ent); + totalpoisonstacks+=blindnesslv+1; + haspoison=true; } - GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW, 20*15, poisonlv, ent); - } - /*if (ent.hasPotionEffect(PotionEffectType.BLINDNESS)) { - int poisonlv = GenericFunctions.getPotionEffectLevel(PotionEffectType.BLINDNESS, ent); - int poisondur = GenericFunctions.getPotionEffectDuration(PotionEffectType.BLINDNESS, ent); - totalpoisonlv+=poisonlv+1; - if (poisondur<20*15) { - GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 20*15, poisonlv, ent, true); + if (haspoison) { + poisonlist.add(ent); } - GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW, 20*15, poisonlv, ent); - }*/ - CustomDamage.ApplyDamage(totalpoisonlv*10, p, ent, null, "Siphon", CustomDamage.TRUEDMG|CustomDamage.IGNOREDODGE|CustomDamage.IGNORE_DAMAGE_TICK); + } } - CustomDamage.setAbsorptionHearts(p, CustomDamage.getAbsorptionHearts(p)+totalpoisonstacks*4); + if (totalpoisonstacks>0) { + pd.last_siphon=TwosideKeeper.getServerTickTime(); + SoundUtils.playLocalSound(p, Sound.BLOCK_FENCE_GATE_OPEN, 1.0f, 0.4f); + aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.SIPHON_COOLDOWN,p)); + for (LivingEntity ent : poisonlist) { + //Refresh poison stacks if necessary. + int totalpoisonlv = 0; + if (ent.hasPotionEffect(PotionEffectType.POISON)) { + int poisonlv = GenericFunctions.getPotionEffectLevel(PotionEffectType.POISON, ent); + int poisondur = GenericFunctions.getPotionEffectDuration(PotionEffectType.POISON, ent); + totalpoisonlv+=poisonlv+1; + if (poisondur<20*15) { + GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.POISON, 20*15, poisonlv, ent, true); + } + GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW, 20*15, poisonlv, ent); + } + if (Buff.hasBuff(ent, "Poison")) { + Buff b = Buff.getBuff(ent, "Poison"); + int poisonlv = b.getAmplifier(); + long poisondur = b.getRemainingBuffTime(); + totalpoisonlv+=poisonlv+1; + if (poisondur<20*15) { + //GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.POISON, 20*15, poisonlv, ent, true); + b.refreshDuration(20*15); + } + GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW, 20*15, poisonlv, ent); + } + /*if (ent.hasPotionEffect(PotionEffectType.BLINDNESS)) { + int poisonlv = GenericFunctions.getPotionEffectLevel(PotionEffectType.BLINDNESS, ent); + int poisondur = GenericFunctions.getPotionEffectDuration(PotionEffectType.BLINDNESS, ent); + totalpoisonlv+=poisonlv+1; + if (poisondur<20*15) { + GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 20*15, poisonlv, ent, true); + } + GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW, 20*15, poisonlv, ent); + }*/ + CustomDamage.ApplyDamage(totalpoisonlv*10, p, ent, null, "Siphon", CustomDamage.TRUEDMG|CustomDamage.IGNOREDODGE|CustomDamage.IGNORE_DAMAGE_TICK); + } + CustomDamage.setAbsorptionHearts(p, CustomDamage.getAbsorptionHearts(p)+totalpoisonstacks*4); + TwosideKeeper.sendSuccessfulCastMessage(p); + } else { + TwosideKeeper.sendNotReadyCastMessage(p,ChatColor.LIGHT_PURPLE+"Siphon"); + } } - } + } else { + TwosideKeeper.sendNotReadyCastMessage(p,ChatColor.LIGHT_PURPLE+"Siphon"); + } } } @@ -5214,7 +5246,12 @@ public class GenericFunctions { GenericFunctions.sendActionBarMessage(p, "", true); aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.WINDSLASH_COOLDOWN,p)); pd.lastusedwindslash = TwosideKeeper.getServerTickTime(); - } + TwosideKeeper.sendSuccessfulCastMessage(p); + } else { + TwosideKeeper.sendNotReadyCastMessage(p,ChatColor.BLUE+"Wind Slash"); + } + } else { + TwosideKeeper.sendNotReadyCastMessage(p,ChatColor.BLUE+"Wind Slash"); } //TILTED /////////////////\\\\\\\\\\\\\\\\\\\\\\\\\//////////////// } @@ -5226,13 +5263,16 @@ public class GenericFunctions { public static void performBeastWithin(Player p) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); - if (ItemSet.hasFullSet(p, ItemSet.LUCI) && pd.lastusedbeastwithin+GetModifiedCooldown(TwosideKeeper.BEASTWITHIN_COOLDOWN,p)<=TwosideKeeper.getServerTickTime()) { + if (pd.lastusedbeastwithin+GetModifiedCooldown(TwosideKeeper.BEASTWITHIN_COOLDOWN,p)<=TwosideKeeper.getServerTickTime()) { GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.NIGHT_VISION, 20, 1, p); SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_GENERIC_DRINK, 1.0f, 1.0f); Buff.addBuff(p, "BEASTWITHIN", new Buff("Beast Within",(ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())+ItemSet.BEASTWITHIN_DURATION)*20,1,org.bukkit.Color.MAROON,"♦",true)); GenericFunctions.sendActionBarMessage(p, "", true); aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.BEASTWITHIN_COOLDOWN,p)); pd.lastusedbeastwithin=TwosideKeeper.getServerTickTime(); + TwosideKeeper.sendSuccessfulCastMessage(p); + } else { + TwosideKeeper.sendNotReadyCastMessage(p,ChatColor.RED+"Beast Within"); } } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java b/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java index 03f3c6a..298607d 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java @@ -24,7 +24,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils; public enum ItemSet { PANROS(1,1, 6,4, 10,10, 20,10), SONGSTEEL(4,2, 6,2, 8,8, 20,10), - DAWNTRACKER(2,1, 20,10, 10,5, 10,5), + DAWNTRACKER(3,1, 20,10, 10,5, 10,5), LORASYS(2,2, 0,0, 0,0, 0,0), JAMDAK(3,3, 5,1, 10,1, 10,2), //Graceful Dodge is in ticks. DARNYS(2,1, 10,5, 20,5, 1,1), @@ -49,7 +49,7 @@ public enum ItemSet { SHARD(2,1, 10,10, 20,20, 10,10), TOXIN(2,2, 20,5, 10,3, 10,3), PROTECTOR(5,2, 10,5, 10,10, 1,1), - SUSTENANCE(8,4, 2,1, 2,2, 10,10), + SUSTENANCE(8,4, 2,2, 1,1, 10,10), LEGION(3,1, 12,12, 1,1, 1,1), PRIDE(10,10, 2,1, 2,2, 1,1), ASSASSIN(5,5, 0,0, 0,0, 0,0), @@ -367,7 +367,7 @@ public enum ItemSet { case DAWNTRACKER:{ lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear"); lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Dawntracker Set"); - if (((ItemSet.GetBaseAmount(set, tier, 1)+1)/3)>0) { + if (((ItemSet.GetBaseAmount(set, tier, 1))/3)>0) { lore.add(ChatColor.YELLOW+"-"+((ItemSet.GetBaseAmount(set, tier, 1)+1)/3)+" Damage taken per hit"); } }break; @@ -846,7 +846,8 @@ public enum ItemSet { case LEGION: lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:"); lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+"% Lifesteal"); - lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Damage per Weapon Charge"); + lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Damage per 10 Weapon Charges"); + lore.add(ChatColor.AQUA+" ( Max. 200 stacks - "+(ItemSet.GetBaseAmount(set, tier, 3)*200)+"% Damage )"); lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+"% Damage per 100 Damage Pool"); lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Undying Rage"+ABILITY_LABEL_END); lore.add(ChatColor.GRAY+" When taking fatal damage, removes all Damage"); @@ -899,7 +900,7 @@ public enum ItemSet { lore.add(ChatColor.DARK_AQUA+" 4 - "+ABILITY_LABEL+" Reinforce"+ABILITY_LABEL_END+" - Each hit taken restores"); lore.add(" "+ChatColor.WHITE+" "+ItemSet.GetBaseAmount(set, tier, 4)+" Health to other party members."); lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Unstoppable Team"+ABILITY_LABEL_END); - lore.add(ChatColor.GRAY+" Press the swap item key to channel for 1 second,"); + lore.add(ChatColor.GRAY+" Press the swap item key to channel for 3 seconds,"); lore.add(ChatColor.GRAY+" creating a "+(tier*20)+" Health shield for 30"); lore.add(ChatColor.GRAY+" seconds on all party members."); lore.add(ChatColor.GRAY+" "); @@ -942,14 +943,14 @@ public enum ItemSet { break; case SUSTENANCE: lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:"); - lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+" Lifesteal Stacks every hit taken"); - lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+" Regeneration Level per hit"); + lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+" to Regeneration Pool every hit taken"); + lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+" Regeneration Level"+(ItemSet.GetBaseAmount(set, tier, 3)==1?"":"s")+" per hit"); lore.add(ChatColor.GRAY+" (Max. Regeneration "+WorldShop.toRomanNumeral(Math.min(2*tier,10))+")"); lore.add(ChatColor.GRAY+" Decays at 1 Regeneration Level per second."); lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+"% Healing per Regeneration tick"); lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Share the Life"+ABILITY_LABEL_END); - lore.add(ChatColor.GRAY+" Increases lifesteal stacks for other party members"); - lore.add(ChatColor.GRAY+" by "+(tier)+" whenever you get hit."); + lore.add(ChatColor.GRAY+" Increases the Regeneration Pool for other party"); + lore.add(ChatColor.GRAY+" members by "+(tier)+" whenever you get hit."); break; case TOXIN: lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:"); diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/PlayerMode.java b/src/sig/plugin/TwosideKeeper/HelperStructures/PlayerMode.java index 8ffd106..45cbdd2 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/PlayerMode.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/PlayerMode.java @@ -4,6 +4,7 @@ import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; +import sig.plugin.TwosideKeeper.PartyManager; import sig.plugin.TwosideKeeper.PlayerStructure; import sig.plugin.TwosideKeeper.TwosideKeeper; import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver; diff --git a/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java b/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java index 8c97447..9874dc0 100644 --- a/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java +++ b/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java @@ -101,6 +101,18 @@ public class LivingEntityStructure { private boolean isModifiedName(String customName) { return customName.contains(MODIFIED_NAME_DELIMITER); } + public String getDifficultyAndMonsterName() { + StringBuilder sb = new StringBuilder(difficulty_modifier); + if (difficulty_modifier.length()>0) { + sb.append(" "); + } + sb.append(base_name); + if (suffix.length()>0) { + sb.append(" "); + sb.append(suffix); + } + return sb.toString(); + } public String getActualName() { StringBuilder sb = new StringBuilder(prefix); if (prefix.length()>0 && difficulty_modifier.length()>0) { diff --git a/src/sig/plugin/TwosideKeeper/Monster/Dummy.java b/src/sig/plugin/TwosideKeeper/Monster/Dummy.java index 0a9284a..9dae63d 100644 --- a/src/sig/plugin/TwosideKeeper/Monster/Dummy.java +++ b/src/sig/plugin/TwosideKeeper/Monster/Dummy.java @@ -17,6 +17,7 @@ import sig.plugin.TwosideKeeper.CustomMonster; import sig.plugin.TwosideKeeper.TwosideKeeper; import sig.plugin.TwosideKeeper.TwosideKeeperAPI; import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; +import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils; import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.MovementModifier; public class Dummy extends CustomMonster{ @@ -31,7 +32,8 @@ public class Dummy extends CustomMonster{ public Dummy(LivingEntity m) { super(m); //m.setCustomName(ChatColor.MAGIC+" "+ChatColor.RESET+"Test Dummy"+ChatColor.MAGIC+" "); - TwosideKeeperAPI.setCustomLivingEntityName(m, ChatColor.MAGIC+" "+ChatColor.RESET+"Test Dummy"+ChatColor.MAGIC+" "); + ChatColor randcolor = TextUtils.RandomColor(); + TwosideKeeperAPI.setCustomLivingEntityName(m, randcolor+""+ChatColor.MAGIC+" "+ChatColor.RESET+randcolor+"Test Dummy"+ChatColor.MAGIC+" "); m.setCustomNameVisible(true); this.spawnLoc = m.getLocation(); //m.setCollidable(false); diff --git a/src/sig/plugin/TwosideKeeper/PlayerStructure.java b/src/sig/plugin/TwosideKeeper/PlayerStructure.java index e697f55..c95e123 100644 --- a/src/sig/plugin/TwosideKeeper/PlayerStructure.java +++ b/src/sig/plugin/TwosideKeeper/PlayerStructure.java @@ -152,6 +152,7 @@ public class PlayerStructure { public long lastusedwindslash = TwosideKeeper.getServerTickTime(); public long lastusedbeastwithin = TwosideKeeper.getServerTickTime(); public long lastusedunstoppableteam = TwosideKeeper.getServerTickTime(); + public boolean had3pieceprotecterset = false; public long iframetime = 0; @@ -211,6 +212,7 @@ public class PlayerStructure { public long lastBurnTick=0; public float MoveSpeedMultBeforeCripple=1f; public Channel currentChannel=null; + public long lastFailedCastTime=0; List equipmentset = new ArrayList(); diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index d1890ca..20013fa 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -950,6 +950,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } else { double totalregen = 0; final double baseregen = 1; + double regenmult = 1; final ItemStack[] equips = GenericFunctions.getEquipment(p); for (ItemStack equip : equips) { if (GenericFunctions.isArtifactEquip(equip)) { @@ -964,11 +965,22 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (p.hasPotionEffect(PotionEffectType.REGENERATION)) { totalregen += (GenericFunctions.getPotionEffectLevel(PotionEffectType.REGENERATION, p)+1)*baseregen; } + if (Buff.hasBuff(p, "REGENERATION")) { + Buff b = Buff.getBuff(p, "REGENERATION"); + totalregen += b.getAmplifier()*baseregen; + } totalregen += (totalregen+baseregen)*pd.pctbonusregen; - if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6)) { - totalregen += (totalregen+baseregen) * (0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())); + if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6) || + ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION,6) || + ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE,6)) { + regenmult += (0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())); + } + + if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.SUSTENANCE, 4)) { + regenmult += ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SUSTENANCE, 4, 4)/100d; } - return totalregen+baseregen; + + return (totalregen+baseregen)*regenmult; } } @@ -1686,6 +1698,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { new ItemStack(Material.GOLD_BOOTS), new ItemStack(Material.GOLD_SWORD), new ItemStack(Material.GOLD_AXE), + new ItemStack(Material.GOLD_AXE), new ItemStack(Material.SHIELD), }) { List lore = new ArrayList(); @@ -4475,6 +4488,19 @@ public class TwosideKeeper extends JavaPlugin implements Listener { @EventHandler(priority=EventPriority.LOW,ignoreCancelled = true) public void onChannelCast(EntityChannelCastEvent ev) { //TwosideKeeper.log(GenericFunctions.getDisplayName(ev.getLivingEntity())+" has finished casting "+ev.getAbilityName(), 0); + switch (ev.getAbilityName()) { + case "Unstoppable Team":{ + if (ev.getLivingEntity() instanceof Player) { + Player p = (Player)ev.getLivingEntity(); + SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_VILLAGER_YES, 1.0f, 1.5f); + int tier = ItemSet.getHighestTierInSet(p, ItemSet.PROTECTOR); + for (Player pl : PartyManager.getPartyMembers(p)) { + //CustomDamage.setAbsorptionHearts(pl, Math.max(CustomDamage.getAbsorptionHearts(pl), (tier*20))); + GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.ABSORPTION, 20*30, (int)((tier*5)*ItemSet.GetPlayerModeSpecificMult(pl)), pl, true); + } + } + }break; + } } @EventHandler(priority=EventPriority.LOW,ignoreCancelled = true) @@ -4977,6 +5003,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener { pd.weaponcharges=0; double missinghealth = p.getMaxHealth()-p.getHealth(); CustomDamage.setAbsorptionHearts(p, (float)(CustomDamage.getAbsorptionHearts(p)+missinghealth)); + sendSuccessfulCastMessage(p); + } else { + sendNotReadyCastMessage(p,ChatColor.RED+"Barbarian's Rage"); } ev.setCancelled(true); return; @@ -4985,19 +5014,34 @@ public class TwosideKeeper extends JavaPlugin implements Listener { ItemSet.hasFullSet(p, ItemSet.PROTECTOR)) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); if (PlayerUtils.cooldownAvailable(pd.lastusedunstoppableteam, UNSTOPPABLETEAM_COOLDOWN, p)) { - Channel.createNewChannel(p, "Unstoppable Team", 20); + Channel.createNewChannel(p, "Unstoppable Team", 60); pd.lastusedunstoppableteam=TwosideKeeper.getServerTickTime(); UpdateUnstoppableTeamBuff(p, pd); + sendSuccessfulCastMessage(p); } else { - p.sendTitle("", ChatColor.GOLD+"Unstoppable Team not ready to cast!"); + sendNotReadyCastMessage(p,ChatColor.GOLD+"Unstoppable Team"); UpdateUnstoppableTeamBuff(p, pd); } ev.setCancelled(true); return; } } + public static void sendNotReadyCastMessage(Player p, String string) { + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + if (pd.lastFailedCastTime+20=TwosideKeeper.getServerTickTime()) { + pd.lastFailedCastTime=TwosideKeeper.getServerTickTime(); + p.sendTitle("", ""); + } + } private void UpdateUnstoppableTeamBuff(Player p, PlayerStructure pd) { - Buff b = new Buff("Unstoppable Team Unavailable",PlayerUtils.cooldownTimeRemaining(pd.lastusedunstoppableteam, UNSTOPPABLETEAM_COOLDOWN, p),0,null,"",true); + Buff b = new Buff("Unstoppable Team Unavailable",PlayerUtils.cooldownTimeRemaining(pd.lastusedunstoppableteam, UNSTOPPABLETEAM_COOLDOWN, p),0,null,ChatColor.WHITE+"",true); b.setDisplayTimerAlways(true); Buff.addBuff(p, "Unstoppable Team Unavailable", b); } @@ -5046,6 +5090,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { //ev.getPlayer().getEquipment().setItemInMainHand(ev.getItemDrop().getItemStack()); GenericFunctions.PerformAssassinate(ev.getPlayer(),ev.getItemDrop().getItemStack().getType()); //ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR)); + } else { + sendNotReadyCastMessage(ev.getPlayer(),ChatColor.DARK_BLUE+"Assassinate"); } return; } @@ -5059,6 +5105,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener { GenericFunctions.PerformRejuvenate(ev.getPlayer()); pd.last_rejuvenate = TwosideKeeper.getServerTickTime(); aPlugin.API.damageItem(ev.getPlayer(), ev.getItemDrop().getItemStack(), 400); + sendSuccessfulCastMessage(ev.getPlayer()); + } else { + sendNotReadyCastMessage(ev.getPlayer(),ChatColor.GREEN+"Rejuvenation"); } ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR)); } @@ -5078,10 +5127,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener { List le = GenericFunctions.getNearbyMobs(p.getLocation(), 12); for (LivingEntity ent : le) { if (!(ent instanceof Player)) { + if (ent instanceof LivingEntity) { + GenericFunctions.addStackingPotionEffect(ent, PotionEffectType.WEAKNESS, 20*15, 5, 2); + } if (ent instanceof Monster) { CustomDamage.provokeMonster((Monster)ent, p, ev.getItemDrop().getItemStack()); CustomDamage.setAggroGlowTickTime((Monster)ent, 20*15); - GenericFunctions.addStackingPotionEffect(ent, PotionEffectType.WEAKNESS, 20*15, 5, 2); } } } @@ -5092,6 +5143,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } else { aPlugin.API.sendCooldownPacket(p, ev.getItemDrop().getItemStack().getType(), GenericFunctions.GetModifiedCooldown(TwosideKeeper.MOCK_COOLDOWN,ev.getPlayer())); } + sendSuccessfulCastMessage(p); + } else { + sendNotReadyCastMessage(ev.getPlayer(),ChatColor.GOLD+"Mock"); } ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR)); } @@ -5150,6 +5204,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR)); + TwosideKeeper.sendSuccessfulCastMessage(ev.getPlayer()); + } else { + TwosideKeeper.sendNotReadyCastMessage(ev.getPlayer(),ChatColor.RED+"Line Drive"); } } else { if (ev.getItemDrop().getItemStack().getType().toString().contains("SWORD") && @@ -9900,16 +9957,39 @@ public class TwosideKeeper extends JavaPlugin implements Listener { ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.JAMDAK, 4, 4);*/ hp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SHARD, 4, 4); TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Shard HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime(); - if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6)) { - hp+=0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand()); + hp+=ItemSet.GetTotalBaseAmount(p, ItemSet.SUSTENANCE); + TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Sustenance HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime(); + if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6) || + ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION,6) || + ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE,6)) { + hp*=1.0+(0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())); } TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Dawntracker bonus HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime(); + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + if (!pd.had3pieceprotecterset && ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PROTECTOR, 3)) { + //Update all other party members' health. + pd.had3pieceprotecterset=true; + for (Player pl : PartyManager.getPartyMembers(p)) { + if (!pl.equals(p)) { + setPlayerMaxHealth(pl,pl.getHealth()/pl.getMaxHealth(),true); + } + } + } else + if (pd.had3pieceprotecterset && !ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PROTECTOR, 3)) { + //Update all other party members' health. + pd.had3pieceprotecterset=false; + for (Player pl : PartyManager.getPartyMembers(p)) { + if (!pl.equals(p)) { + setPlayerMaxHealth(pl,pl.getHealth()/pl.getMaxHealth(),true); + } + } + } for (Player pl : PartyManager.getPartyMembers(p)) { if (!pl.equals(p)) { - if (PlayerMode.getPlayerMode(pl)==PlayerMode.DEFENDER) { - hp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(pl, ItemSet.PROTECTOR, 3, 3)*ItemSet.GetPlayerModeSpecificMult(p); - } + //TwosideKeeper.log("Found a Defender: "+pl.getName(), 0); + hp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(pl, ItemSet.PROTECTOR, 3, 3)*ItemSet.GetPlayerModeSpecificMult(p); + //TwosideKeeper.log("Increased health by: "+(ItemSet.TotalBaseAmountBasedOnSetBonusCount(pl, ItemSet.PROTECTOR, 3, 3)*ItemSet.GetPlayerModeSpecificMult(p))+" HP.", 0); } } TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Protector Set Calculation", (int)(System.nanoTime()-time));time = System.nanoTime(); @@ -10048,20 +10128,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { public void run() { if (Bukkit.getPlayer(pd2.name)!=null && pd2.target!=null) { String MonsterName = pd2.target.getType().toString().toLowerCase(); - if (pd2.target.getCustomName()!=null) { - MonsterName = GenericFunctions.getDisplayName(pd2.target); - if (GenericFunctions.getDisplayName(pd2.target)!=null && - !GenericFunctions.getDisplayName(pd2.target).contains("Leader") && - MonsterController.isZombieLeader(pd2.target)) { - pd2.target.setCustomName(GenericFunctions.getDisplayName(pd2.target)+" Leader"); - MonsterName = GenericFunctions.getDisplayName(pd2.target); - } - } else { - MonsterName = GenericFunctions.CapitalizeFirstLetters(MonsterName.replace("_", " ")); - } - if (MonsterName.contains(ChatColor.RESET+" ")) { - MonsterName = MonsterName.split(ChatColor.RESET+" ")[0]; - } + MonsterName = GenericFunctions.getDisplayName(pd2.target); + final String finalMonsterName = MonsterName; String heartdisplay = "", remainingheartdisplay = ""; int color1=0,color2=1; @@ -10372,6 +10440,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (all || debuffresistchance>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Debuff Resistance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format(debuffresistchance)+"%");} double debuffchance = CustomDamage.calculateDebuffChance(p); if (all || debuffchance>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Debuff Chance: "+ChatColor.RESET+""+ChatColor.YELLOW+"+"+df.format(debuffchance*100d)+"%");} + double dmgpoolred = 1-CustomDamage.getDamagePoolMult(p); + if (all || dmgpoolred>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Damage Pool Reduction: "+ChatColor.RESET+""+ChatColor.YELLOW+""+df.format(dmgpoolred*100d)+"%");} double cooldownreduction = CustomDamage.calculateCooldownReduction(p); if (all || cooldownreduction>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Cooldown Reduction: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format(cooldownreduction*100)+"%");} TextComponent f = new TextComponent(ChatColor.GRAY+""+ChatColor.ITALIC+"Current Mode: "); diff --git a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java index e9f2542..d11defd 100644 --- a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java +++ b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java @@ -310,6 +310,9 @@ final class runServerHeartbeat implements Runnable { createPotionParticles(p); TwosideKeeper.HeartbeatLogger.AddEntry("Potion Effect Particles", (int)(System.nanoTime()-time));time=System.nanoTime(); + + removeRegenerationStacks(p); + TwosideKeeper.HeartbeatLogger.AddEntry("Regeneration Stack Removal", (int)(System.nanoTime()-time));time=System.nanoTime(); } //TwosideKeeper.outputArmorDurability(p,">"); } @@ -344,6 +347,19 @@ final class runServerHeartbeat implements Runnable { TwosideKeeper.HeartbeatLogger.AddEntry(ChatColor.LIGHT_PURPLE+"Total Server Heartbeat", (int)(System.nanoTime()-totaltime));totaltime=System.nanoTime(); } + private void removeRegenerationStacks(Player p) { + if (Buff.hasBuff(p, "REGENERATION")) { + Buff b = Buff.getBuff(p, "REGENERATION"); + if (b.getAmplifier()>1) { + //b.setStacks(b.getAmplifier()-1); + b.decreaseStacks(1); + } else { + Buff.removeBuff(p, "REGENERATION"); + } + GenericFunctions.sendActionBarMessage(p, "", true); + } + } + private void PerformPoisonTick(LivingEntity ent) { if (ent instanceof Player) { PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)ent);