Merge branch 'daily_nerf'
Conflicts: TwosideKeeper.jar Continued work on Defender Revamp.
This commit is contained in:
commit
b4e8aed1f3
7
.project
7
.project
@ -24,11 +24,4 @@
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>jgrapht</name>
|
||||
<type>2</type>
|
||||
<location>C:/Applications/Eclipse.app/Contents/MacOS/D::/Data/jgrapht-1.0.1/jgrapht-1.0.1/source/jgrapht-core/src/main/java</location>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.12.1b
|
||||
version: 3.12.1b1
|
||||
loadbefore: [aPlugin]
|
||||
commands:
|
||||
money:
|
||||
|
@ -88,6 +88,16 @@ public class ActionBarBuffUpdater{
|
||||
if (pd.vendetta_amt>0 && effectString.length()==0) {
|
||||
|
||||
}
|
||||
if (pd.lastusedRejuvenation+GenericFunctions.GetModifiedCooldown(TwosideKeeper.REJUVENATION_COOLDOWN, (Player)p)>TwosideKeeper.getServerTickTime()) {
|
||||
effectString.append(ChatColor.GREEN);
|
||||
effectString.append(ChatColor.BOLD);
|
||||
effectString.append(ChatColor.UNDERLINE);
|
||||
effectString.append("Rejuvenation");
|
||||
int timeRemaining = (int)((pd.lastusedRejuvenation+GenericFunctions.GetModifiedCooldown(TwosideKeeper.REJUVENATION_COOLDOWN, (Player)p))-TwosideKeeper.getServerTickTime());
|
||||
effectString.append(ConvertBuffTimeToIcon(timeRemaining));
|
||||
effectString.append(ChatColor.RESET);
|
||||
effectString.append(" ");
|
||||
}
|
||||
}
|
||||
HashMap<String,Buff> buffMap = Buff.getBuffData(p);
|
||||
for (String s : buffMap.keySet()) {
|
||||
|
@ -132,28 +132,25 @@ public class ChallengeReward {
|
||||
switch (rank) {
|
||||
case 1:{
|
||||
return new ItemStack[]{
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,5),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,8),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE,4),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_BASE,2),
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,2),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,2),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE,1),
|
||||
};
|
||||
}
|
||||
case 2:{
|
||||
return new ItemStack[]{
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,3),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,4),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE,2),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_BASE,1),
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,1),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,1),
|
||||
};
|
||||
}
|
||||
case 3:{
|
||||
return new ItemStack[]{
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,3),
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,1),
|
||||
};
|
||||
}
|
||||
case 438190894:{
|
||||
return new ItemStack[]{
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,5),
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,2),
|
||||
};
|
||||
}
|
||||
default:{
|
||||
|
@ -168,7 +168,9 @@ public class CustomDamage {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
pd.lasthitproperties=NONE;
|
||||
}
|
||||
//TwosideKeeper.log(GenericFunctions.getDisplayName(target)+" has been hit for "+damage+" damage.", 0);
|
||||
if (!InvulnerableCheck(damager,damage,target,weapon,reason,flags)) {
|
||||
//TwosideKeeper.log("Passed Invulnerable check.", 0);
|
||||
double dmg = 0.0;
|
||||
if (isFlagSet(flags,TRUEDMG)) {
|
||||
//TwosideKeeper.log("Reason: "+reason, 0);
|
||||
@ -182,8 +184,6 @@ public class CustomDamage {
|
||||
} else {
|
||||
dmg = CalculateDamage(damage, damager, target, weapon, reason, flags);
|
||||
}
|
||||
dmg += CalculateBonusTrueDamage(damager, target, dmg);
|
||||
dmg += CalculatePVPDamageReduction(damager,target,dmg);
|
||||
if (damager!=null) {
|
||||
TwosideKeeper.logHealth(target,target.getHealth(),dmg,damager);
|
||||
}
|
||||
@ -194,6 +194,7 @@ public class CustomDamage {
|
||||
|
||||
setupDamagePropertiesForPlayer(damager,((reason!=null && reason.equalsIgnoreCase("thorns"))?IS_THORNS:0));
|
||||
if (!ev.isCancelled()) {
|
||||
dmg = ev.getDamage();
|
||||
//TwosideKeeper.log("Inside of here.", 0);
|
||||
LivingEntity shooter = getDamagerEntity(damager);
|
||||
if (shooter instanceof Player && target instanceof Player) {
|
||||
@ -213,6 +214,22 @@ public class CustomDamage {
|
||||
}
|
||||
}
|
||||
|
||||
private static double CalculateWellTimedBlockDamage(double damage, LivingEntity target) {
|
||||
//TwosideKeeper.log("In here. Damage: "+damage+" Target: "+GenericFunctions.getDisplayName(target), 0);
|
||||
if (target instanceof Player && PlayerMode.isDefender((Player)target)) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)target);
|
||||
//TwosideKeeper.log("Time is "+TwosideKeeper.getServerTickTime()+". Last block was at "+pd.lastblock, 0);
|
||||
if (pd.lastblock+5>TwosideKeeper.getServerTickTime()) {
|
||||
/*TwosideKeeper.log("This is a well timed block! Halve the damage.", 0);
|
||||
TwosideKeeper.log("Old damage: "+damage,0);
|
||||
TwosideKeeper.log("New damage: "+(damage/2),0);*/
|
||||
pd.lastblock=0; //Reset so they can perform another block.
|
||||
return damage/2;
|
||||
}
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
private static double CalculatePVPDamageReduction(Entity damager, LivingEntity target, double dmg) {
|
||||
double dmgIncrease=0;
|
||||
LivingEntity shooter = getDamagerEntity(damager);
|
||||
@ -392,6 +409,9 @@ public class CustomDamage {
|
||||
|
||||
setupDamagePropertiesForPlayer(damager,((crit)?IS_CRIT:0)|((headshot)?IS_HEADSHOT:0)|((preemptive)?IS_PREEMPTIVE:0),true);
|
||||
dmg = hardCapDamage(dmg+armorpendmg,target,reason);
|
||||
dmg += CalculateBonusTrueDamage(damager, target, dmg);
|
||||
dmg += CalculatePVPDamageReduction(damager,target,dmg);
|
||||
dmg = CalculateWellTimedBlockDamage(dmg,target);
|
||||
return dmg;
|
||||
}
|
||||
|
||||
@ -772,7 +792,7 @@ public class CustomDamage {
|
||||
restoreHealthToPartyMembersWithProtectorSet(p);
|
||||
applySustenanceSetonHitEffects(p);
|
||||
reduceStrengthAmountForStealthSet(p);
|
||||
handleBlockStacks(p);
|
||||
damage = handleBlockStacks(p,damage);
|
||||
if (!isFlagSet(flags,NOAOE)) {
|
||||
if (damage<p.getHealth()) {increaseArtifactArmorXP(p,(int)damage);}
|
||||
}
|
||||
@ -963,6 +983,7 @@ public class CustomDamage {
|
||||
pd.lastcombat=TwosideKeeper.getServerTickTime();
|
||||
increaseBarbarianStacks(p,weapon,reason);
|
||||
damage = applyBarbarianBonuses(p,target,weapon,damage,reason);
|
||||
applyShieldChargeEffect(p,weapon,reason);
|
||||
increaseWindCharges(p);
|
||||
applyWindSlashEffects(p,target,damage,reason);
|
||||
createFirePool(p,damager,target,damage,reason);
|
||||
@ -1063,6 +1084,14 @@ public class CustomDamage {
|
||||
return damage;
|
||||
}
|
||||
|
||||
private static void applyShieldChargeEffect(Player p, ItemStack weapon, String reason) {
|
||||
if (p.isSneaking() && (reason==null || !reason.equalsIgnoreCase("shield charge")) &&
|
||||
weapon!=null && weapon.equals(p.getEquipment().getItemInMainHand())) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
TwosideKeeper.PerformShieldCharge(p, pd);
|
||||
}
|
||||
}
|
||||
|
||||
private static double handleBlockStacks(Player p, double damage) {
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||
DefenderStance ds = DefenderStance.getDefenderStance(p);
|
||||
@ -1072,13 +1101,6 @@ public class CustomDamage {
|
||||
pd.blockStacks = Math.min(pd.blockStacks+1, 10);
|
||||
GenericFunctions.sendActionBarMessage(p, "", true);
|
||||
pd.customtitle.updateSideTitleStats(p);
|
||||
} else
|
||||
if (ds == DefenderStance.TANK) {
|
||||
if (pd.blockStacks>0) {
|
||||
pd.blockStacks--;
|
||||
GenericFunctions.sendActionBarMessage(p, "", true);
|
||||
pd.customtitle.updateSideTitleStats(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
return damage;
|
||||
@ -2055,7 +2077,7 @@ public class CustomDamage {
|
||||
}*/
|
||||
}
|
||||
|
||||
static void setAggroGlowTickTime(Monster m, int duration) {
|
||||
public static void setAggroGlowTickTime(Monster m, int duration) {
|
||||
//m.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,duration,0,true,true),true);
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.GLOWING, duration, 0, m);
|
||||
}
|
||||
@ -2071,7 +2093,7 @@ public class CustomDamage {
|
||||
}
|
||||
}
|
||||
|
||||
static void provokeMonster(LivingEntity m, Player p, ItemStack weapon) {
|
||||
public static void provokeMonster(LivingEntity m, Player p, ItemStack weapon) {
|
||||
if (!m.hasPotionEffect(PotionEffectType.GLOWING)) {
|
||||
setMonsterTarget(m,p);
|
||||
}
|
||||
@ -2519,14 +2541,14 @@ public class CustomDamage {
|
||||
|
||||
private static void refundRejuvenationCooldown(Player p) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
pd.last_rejuvenate-=40;
|
||||
int remainingtime = GenericFunctions.GetRemainingCooldownTime(p, pd.last_rejuvenate, TwosideKeeper.REJUVENATE_COOLDOWN);
|
||||
pd.last_mobcontrol-=40;
|
||||
int remainingtime = GenericFunctions.GetRemainingCooldownTime(p, pd.last_mobcontrol, TwosideKeeper.MOBCONTROL_COOLDOWN);
|
||||
if (remainingtime>0) {
|
||||
aPluginAPIWrapper.sendCooldownPacket(p, Material.SHIELD, remainingtime);
|
||||
}
|
||||
}
|
||||
|
||||
private static double GetAttackRate(Entity damager) {
|
||||
public static double GetAttackRate(Entity damager) {
|
||||
double attackrate = 0.0;
|
||||
if (damager instanceof Player) {
|
||||
Player p = (Player)damager;
|
||||
@ -2638,6 +2660,11 @@ public class CustomDamage {
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||
GenericFunctions.HealEntity(p, p.getMaxHealth()*0.05);
|
||||
}
|
||||
if (pd.blockStacks>0) {
|
||||
pd.blockStacks--;
|
||||
GenericFunctions.sendActionBarMessage(p, "", true);
|
||||
pd.customtitle.updateSideTitleStats(p);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -2745,7 +2772,8 @@ public class CustomDamage {
|
||||
}
|
||||
|
||||
if ((pd.fulldodge || pd.slayermegahit ||
|
||||
Buff.hasBuff(p, "BEASTWITHIN")) && !PVP.isPvPing(p)) {
|
||||
Buff.hasBuff(p, "BEASTWITHIN") ||
|
||||
(PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER && DefenderStance.getDefenderStance(p)==DefenderStance.TANK && pd.blockStacks>0)) && !PVP.isPvPing(p)) {
|
||||
dodgechance = 1.0;
|
||||
}
|
||||
|
||||
@ -2779,6 +2807,7 @@ public class CustomDamage {
|
||||
double artifactmult = 0;
|
||||
double dodgechancemult = 0;
|
||||
double defenderstancemult = 0;
|
||||
double defendersetmult = 0;
|
||||
|
||||
if (getDamagerEntity(damager) instanceof Player) {
|
||||
Player p = (Player)getDamagerEntity(damager);
|
||||
@ -2797,6 +2826,10 @@ public class CustomDamage {
|
||||
defenderstancemult = 0.5;
|
||||
}
|
||||
}
|
||||
if (ItemSet.hasFullSet(p, ItemSet.SONGSTEEL)) {
|
||||
int tier = ItemSet.getHighestTierInSet(p, ItemSet.SONGSTEEL);
|
||||
defendersetmult = (0.1*tier)+0.2;
|
||||
}
|
||||
}
|
||||
|
||||
if (target instanceof LivingEntity) {
|
||||
@ -3047,6 +3080,7 @@ public class CustomDamage {
|
||||
*(1d-artifactmult)
|
||||
*(1d-dodgechancemult)
|
||||
*(1d-defenderstancemult)
|
||||
*(1d-defendersetmult)
|
||||
*setbonus
|
||||
*((target instanceof Player && ((Player)target).isBlocking())?(PlayerMode.isDefender((Player)target))?0.30:0.50:1)
|
||||
*((target instanceof Player)?((PlayerMode.isDefender((Player)target))?(target.getEquipment().getItemInOffHand()!=null && target.getEquipment().getItemInOffHand().getType()==Material.SHIELD)?0.8:0.9:(target.getEquipment().getItemInOffHand()!=null && target.getEquipment().getItemInOffHand().getType()==Material.SHIELD)?0.95:1):1);
|
||||
|
@ -105,6 +105,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Utils.BlockUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.DebugUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemCubeUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MovementUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils;
|
||||
|
||||
@ -3203,14 +3204,44 @@ public class GenericFunctions {
|
||||
CustomDamage.addIframe(ticks, p);
|
||||
}
|
||||
|
||||
public static void PerformRejuvenate(Player player) {
|
||||
public static void PerformMobControl(Player player) {
|
||||
PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(player.getUniqueId());
|
||||
if (pd.last_rejuvenate+GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,player)<=TwosideKeeper.getServerTickTime()) {
|
||||
SoundUtils.playGlobalSound(player.getLocation(), Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0f, 1.0f);
|
||||
addIFrame(player,40);
|
||||
//GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,200,9,player,true);
|
||||
aPluginAPIWrapper.sendCooldownPacket(player, player.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,player));
|
||||
boolean hasFullSet = ItemSet.hasFullSet(player, ItemSet.DAWNTRACKER);
|
||||
List<LivingEntity> le = GenericFunctions.getNearbyMobs(player.getLocation(), 16);
|
||||
for (LivingEntity ent : le) {
|
||||
boolean allowed=true;
|
||||
if (ent instanceof Player && PVP.isFriendly(player, (Player)ent)) {
|
||||
allowed=false;
|
||||
}
|
||||
if (allowed) {
|
||||
/*if (ent instanceof LivingEntity) {
|
||||
GenericFunctions.addStackingPotionEffect(ent, PotionEffectType.WEAKNESS, 20*15, 5, 2);
|
||||
}*/
|
||||
if (ent instanceof Monster) {
|
||||
CustomDamage.provokeMonster((Monster)ent, player, player.getEquipment().getItemInMainHand());
|
||||
CustomDamage.setAggroGlowTickTime((Monster)ent, 20*15);
|
||||
}
|
||||
}
|
||||
}
|
||||
LivingEntity target = aPlugin.API.rayTraceTargetEntity(player, 32);
|
||||
if (target!=null) {
|
||||
Vector pullVelocity = MovementUtils.getVelocityTowardsLocation(target.getLocation(), player.getLocation(), Math.min(player.getLocation().distance(target.getLocation()),4));
|
||||
if (pullVelocity.getY()>0) {
|
||||
pullVelocity.setY(Math.min(pullVelocity.getY(), 1));
|
||||
} else {
|
||||
pullVelocity.setY(Math.max(pullVelocity.getY(), -1));
|
||||
}
|
||||
target.setVelocity(pullVelocity);
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(target);
|
||||
les.increaseAggro(player, 1000);
|
||||
}
|
||||
TwosideKeeper.aggroMonsters(player,pd,(500+((hasFullSet)?(ItemSet.getHighestTierInSet(player, ItemSet.DAWNTRACKER)*1000):0)*pd.blockStacks),16);
|
||||
pd.last_mobcontrol = TwosideKeeper.getServerTickTime()-(pd.blockStacks*20);
|
||||
TwosideKeeper.log("Time is "+TwosideKeeper.getServerTickTime()+". Mob control is now "+pd.last_mobcontrol, 0);
|
||||
pd.blockStacks=0;
|
||||
GenericFunctions.sendActionBarMessage(player, "", true);
|
||||
pd.customtitle.updateSideTitleStats(player);
|
||||
aPluginAPIWrapper.sendCooldownPacket(player, player.getEquipment().getItemInMainHand(), GetModifiedCooldown((int)(TwosideKeeper.MOBCONTROL_COOLDOWN-(TwosideKeeper.getServerTickTime()-pd.last_mobcontrol)),player));
|
||||
}
|
||||
|
||||
public static boolean isArmoredMob(LivingEntity m) {
|
||||
|
@ -26,7 +26,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils;
|
||||
|
||||
public enum ItemSet {
|
||||
PANROS(1,1, 6,4, 10,10, 20,10, 1,6,10,20),
|
||||
SONGSTEEL(50,50, 6,2, 8,8, 20,10, 4, 6, 8, 20),
|
||||
SONGSTEEL(50,50, 10,5, 8,8, 30,10, 4, 6, 8, 20),
|
||||
DAWNTRACKER(2,2, 20,10, 10,5, 10,5, 2, 20, 10, 10),
|
||||
LORASYS(2,2, 0,0, 0,0, 0,0, 2, 0, 0, 0),
|
||||
JAMDAK(3,3, 5,1, 10,1, 10,2, 3, 5, 10, 10), //Graceful Dodge is in ticks.
|
||||
@ -51,8 +51,8 @@ public enum ItemSet {
|
||||
LUCI(2,2, 4,4, 1,0, 1,0, 2, 4, 1, 1),
|
||||
SHARD(2,1, 10,10, 20,20, 10,10, 2, 10, 20, 10),
|
||||
TOXIN(2,2, 20,5, 10,3, 10,3, 2, 20, 10, 10),
|
||||
PROTECTOR(5,2, 10,5, 10,10, 1,1, 5, 10, 10, 1),
|
||||
SUSTENANCE(8,4, 2,2, 1,1, 10,10, 8, 2, 1, 10),
|
||||
PROTECTOR(5,2, 20,5, 10,10, 1,1, 5, 10, 10, 1),
|
||||
SUSTENANCE(8,4, 6,4, 1,1, 10,10, 8, 2, 1, 10),
|
||||
LEGION(3,1, 12,12, 1,1, 1,1, 3, 12, 1, 1),
|
||||
PRIDE(10,10, 2,1, 2,2, 1,1, 10, 2, 2, 1),
|
||||
ASSASSIN(5,5, 0,0, 0,0, 0,0, 5, 0, 0, 0),
|
||||
@ -611,12 +611,10 @@ public enum ItemSet {
|
||||
lore.add(ChatColor.GRAY+" time in another direction.");
|
||||
}break;
|
||||
case SONGSTEEL:{
|
||||
lore.add(ChatColor.WHITE+"Successful blocks reduce the cooldown of ");
|
||||
lore.add(ABILITY_LABEL+"Rejuvenation"+ABILITY_LABEL_END+" by 2 seconds.");
|
||||
lore.add(ChatColor.WHITE+""+ChatColor.ITALIC+"");
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
||||
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2, p)+" Max Health");
|
||||
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3, p)+" Absorption Health (30 seconds)");
|
||||
lore.add(ChatColor.DARK_AQUA+" 3 - "+ABILITY_LABEL+" Rejuvenation removes all Debuffs"+ABILITY_LABEL_END);
|
||||
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4, p)+"% Damage Reduction");
|
||||
lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Vendetta"+ABILITY_LABEL_END);
|
||||
lore.add(ChatColor.GRAY+" Blocking stores 40% of mitigation damage.");
|
||||
@ -625,6 +623,8 @@ public enum ItemSet {
|
||||
lore.add(ChatColor.GRAY+" all of your stored mitigation damage.");
|
||||
lore.add(ChatColor.GRAY+" Vendetta stacks wear off after 10 seconds.");
|
||||
lore.add(ChatColor.GRAY+" Can be refreshed by basic attacking monsters.");
|
||||
lore.add(ChatColor.WHITE+" +"+((10*tier)+20)+"% Damage Reduction");
|
||||
lore.add(ChatColor.WHITE+" +"+((tier*20)+30)+" Health");
|
||||
}break;
|
||||
case DAWNTRACKER:{
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
||||
@ -979,14 +979,14 @@ 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, p)+" 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 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+" Press the swap item key while Rejuvenation is on cooldown");
|
||||
lore.add(ChatColor.GRAY+" to channel for 3 seconds, creating a "+(tier*20)+" Health");
|
||||
lore.add(ChatColor.GRAY+" shield for 30 seconds on all party members.");
|
||||
lore.add(ChatColor.GRAY+" ");
|
||||
lore.add(ChatColor.GRAY+" (150 second cooldown)");
|
||||
lore.add(ChatColor.GRAY+" ");
|
||||
lore.add(ChatColor.WHITE+" +50% Armor Penetration");
|
||||
lore.add(ChatColor.WHITE+" +20 Damage");
|
||||
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Party Damage Reduction");
|
||||
lore.add(ChatColor.WHITE+" +"+(tier*5)+" Party Health");
|
||||
break;
|
||||
case SHARD:
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
||||
@ -1038,10 +1038,13 @@ public enum ItemSet {
|
||||
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4, p)+"% Healing per Regeneration tick");
|
||||
lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Share the Life"+ABILITY_LABEL_END);
|
||||
lore.add(ChatColor.GRAY+" Increases the Regeneration Pool for other party");
|
||||
lore.add(ChatColor.GRAY+" members by "+(tier)+" whenever you get hit.");
|
||||
lore.add(ChatColor.GRAY+" members by "+(tier)+" whenever you get hit. When");
|
||||
lore.add(ChatColor.GRAY+" party members are below half health, they will slowly");
|
||||
lore.add(ChatColor.GRAY+" steal health from you as long as your Health is above");
|
||||
lore.add(ChatColor.GRAY+" 50%.");
|
||||
lore.add(ChatColor.GRAY+" ");
|
||||
lore.add(ChatColor.WHITE+" +50% Armor Penetration");
|
||||
lore.add(ChatColor.WHITE+" +20 Damage");
|
||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Lifesteal");
|
||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+" Health");
|
||||
break;
|
||||
case TOXIN:
|
||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
||||
|
@ -5,7 +5,7 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class MovementUtils {
|
||||
public static Vector moveTowardsLocation(Location currloc, Location targetloc, double spd) {
|
||||
public static Vector getVelocityTowardsLocation(Location currloc, Location targetloc, double spd) {
|
||||
/*double deltax = currloc.getX()-targetloc.getX();
|
||||
double deltay = currloc.getY()-targetloc.getY();
|
||||
double deltaz = currloc.getZ()-targetloc.getZ();
|
||||
|
@ -51,11 +51,11 @@ public class HellfireGhast extends CustomMonster{
|
||||
//Begin charging towards player.
|
||||
m.setAI(false);
|
||||
if (target!=null && target.isValid() && !target.isDead() && target.getWorld().equals(m.getWorld())) {
|
||||
m.setVelocity(MovementUtils.moveTowardsLocation(m.getLocation(), target.getLocation(), 2));
|
||||
m.setVelocity(MovementUtils.getVelocityTowardsLocation(m.getLocation(), target.getLocation(), 2));
|
||||
} else {
|
||||
target = FindClosestNearbyTarget();
|
||||
if (target!=null) {
|
||||
m.setVelocity(MovementUtils.moveTowardsLocation(m.getLocation(), target.getLocation(), 2));
|
||||
m.setVelocity(MovementUtils.getVelocityTowardsLocation(m.getLocation(), target.getLocation(), 2));
|
||||
}
|
||||
}
|
||||
if (m.getLocation().distanceSquared(target.getLocation())<49) {
|
||||
|
@ -91,7 +91,7 @@ public class PlayerStructure {
|
||||
public boolean fulldodge=false;
|
||||
public long last_arrowbarrage=TwosideKeeper.getServerTickTime();
|
||||
public long last_laugh_time=TwosideKeeper.getServerTickTime();
|
||||
public long last_rejuvenate=TwosideKeeper.getServerTickTime();
|
||||
public long last_mobcontrol=TwosideKeeper.getServerTickTime();
|
||||
public DamageLogger damagedata;
|
||||
public boolean damagelogging=false;
|
||||
public boolean hasDied=false;
|
||||
@ -254,6 +254,7 @@ public class PlayerStructure {
|
||||
public long lastInfectionTick=0;
|
||||
public long lastCrippleTick=0;
|
||||
public long lastBurnTick=0;
|
||||
public long lastusedRejuvenation=0;
|
||||
public float MoveSpeedMultBeforeCripple=1f;
|
||||
public Channel currentChannel=null;
|
||||
public long lastFailedCastTime=0;
|
||||
@ -341,13 +342,14 @@ public class PlayerStructure {
|
||||
this.isViewingInventory=false;
|
||||
this.destroyedminecart=false;
|
||||
this.last_laugh_time=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.last_rejuvenate=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.last_mobcontrol=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.lastassassinatetime=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.lastlifesavertime=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.lastusedwindslash=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.icewandused=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.lastusedbeastwithin=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.lastusedunstoppableteam=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.lastusedRejuvenation=(TwosideKeeper.getServerType()==ServerType.MAIN)?TwosideKeeper.getServerTickTime():0;
|
||||
this.damagedata = new DamageLogger(p);
|
||||
this.damagelogging=false;
|
||||
this.isPlayingSpleef=false;
|
||||
@ -423,7 +425,7 @@ public class PlayerStructure {
|
||||
applyCooldownToAllTypes(p,"HOE",GenericFunctions.GetRemainingCooldownTime(p, pd.last_deathmark, TwosideKeeper.DEATHMARK_COOLDOWN));
|
||||
applyCooldownToAllTypes(p,"SPADE",GenericFunctions.GetRemainingCooldownTime(p, pd.lastusedearthwave, TwosideKeeper.EARTHWAVE_COOLDOWN));
|
||||
applyCooldownToAllTypes(p,"SWORD",GenericFunctions.GetRemainingCooldownTime(p, pd.last_strikerspell, TwosideKeeper.LINEDRIVE_COOLDOWN));
|
||||
aPluginAPIWrapper.sendCooldownPacket(p, Material.SHIELD, GenericFunctions.GetRemainingCooldownTime(p, pd.last_rejuvenate, TwosideKeeper.REJUVENATE_COOLDOWN));
|
||||
aPluginAPIWrapper.sendCooldownPacket(p, Material.SHIELD, GenericFunctions.GetRemainingCooldownTime(p, pd.last_mobcontrol, TwosideKeeper.MOBCONTROL_COOLDOWN));
|
||||
aPluginAPIWrapper.sendCooldownPacket(p, Material.SKULL_ITEM, GenericFunctions.GetRemainingCooldownTime(p, pd.lastlifesavertime, TwosideKeeper.LIFESAVER_COOLDOWN));
|
||||
aPluginAPIWrapper.sendCooldownPacket(p, Material.CHORUS_FLOWER, GenericFunctions.GetRemainingCooldownTime(p, pd.lastlifesavertime, TwosideKeeper.LIFESAVER_COOLDOWN));
|
||||
aPluginAPIWrapper.sendCooldownPacket(p, Material.WATCH, GenericFunctions.GetRemainingCooldownTime(p, pd.icewandused, TwosideKeeper.ICEWAND_COOLDOWN));
|
||||
@ -509,7 +511,7 @@ public class PlayerStructure {
|
||||
workable.set("COOLDOWN_usedearthwave", lastusedearthwave);
|
||||
workable.set("COOLDOWN_arrowbarrage", last_arrowbarrage);
|
||||
workable.set("COOLDOWN_laughtime", last_laugh_time);
|
||||
workable.set("COOLDOWN_rejuvenate", last_rejuvenate);
|
||||
workable.set("COOLDOWN_rejuvenate", last_mobcontrol);
|
||||
workable.set("COOLDOWN_swordhit", last_swordhit);
|
||||
workable.set("COOLDOWN_strikerspell", last_strikerspell);
|
||||
workable.set("COOLDOWN_absorptionhealthgiven", lastabsorptionhealthgiven);
|
||||
@ -621,7 +623,7 @@ public class PlayerStructure {
|
||||
workable.addDefault("COOLDOWN_usedearthwave", lastusedearthwave);
|
||||
workable.addDefault("COOLDOWN_arrowbarrage", last_arrowbarrage);
|
||||
workable.addDefault("COOLDOWN_laughtime", last_laugh_time);
|
||||
workable.addDefault("COOLDOWN_rejuvenate", last_rejuvenate);
|
||||
workable.addDefault("COOLDOWN_rejuvenate", last_mobcontrol);
|
||||
workable.addDefault("COOLDOWN_swordhit", last_swordhit);
|
||||
workable.addDefault("COOLDOWN_strikerspell", last_strikerspell);
|
||||
workable.addDefault("COOLDOWN_absorptionhealthgiven", lastabsorptionhealthgiven);
|
||||
@ -695,7 +697,7 @@ public class PlayerStructure {
|
||||
this.lastusedearthwave = workable.getLong("COOLDOWN_usedearthwave");
|
||||
this.last_arrowbarrage = workable.getLong("COOLDOWN_arrowbarrage");
|
||||
this.last_laugh_time = workable.getLong("COOLDOWN_laughtime");
|
||||
this.last_rejuvenate = workable.getLong("COOLDOWN_rejuvenate");
|
||||
this.last_mobcontrol = workable.getLong("COOLDOWN_rejuvenate");
|
||||
this.last_swordhit = workable.getLong("COOLDOWN_swordhit");
|
||||
this.last_strikerspell = workable.getLong("COOLDOWN_strikerspell");
|
||||
this.lastabsorptionhealthgiven = workable.getLong("COOLDOWN_absorptionhealthgiven");
|
||||
|
@ -308,6 +308,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
public final static int CUSTOM_DAMAGE_IDENTIFIER = 500000;
|
||||
|
||||
public final static int DAMAGE_QUEUE_MAX_BUFFER = 4; //How many damage events to handle at once.
|
||||
public final static int ITEM_QUEUE_MAX_BUFFER = 2; //How many item events to handle at once.
|
||||
|
||||
public static long SERVERTICK=0; //This is the SERVER's TOTAL TICKS when first loaded.
|
||||
public static long STARTTIME=0;
|
||||
public static long LASTSERVERCHECK=0;
|
||||
@ -355,6 +358,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
public static List<LavaPlume> lavaplume_list = new ArrayList<LavaPlume>();
|
||||
public static long LAST_SPECIAL_SPAWN = 0;
|
||||
public static long LAST_WEEKLY_RESET = 0;
|
||||
public static List<Integer> recentnumbers = new ArrayList<Integer>();
|
||||
|
||||
public static CustomItem HUNTERS_COMPASS;
|
||||
public static CustomItem UPGRADE_SHARD;
|
||||
@ -482,7 +486,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
public static final int EARTHWAVE_COOLDOWN=100;
|
||||
public static final int ERUPTION_COOLDOWN=100;
|
||||
public static final int LINEDRIVE_COOLDOWN=240;
|
||||
public static final int REJUVENATE_COOLDOWN=6000;
|
||||
public static final int MOBCONTROL_COOLDOWN=200;
|
||||
public static final int ASSASSINATE_COOLDOWN=200;
|
||||
public static final int LIFESAVER_COOLDOWN=6000;
|
||||
public static final int ARROWBARRAGE_COOLDOWN=2400;
|
||||
@ -492,6 +496,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
public static final int WINDSLASH_COOLDOWN = 100;
|
||||
public static final int BEASTWITHIN_COOLDOWN = 2400;
|
||||
public static final int UNSTOPPABLETEAM_COOLDOWN = 3000;
|
||||
public static final int REJUVENATION_COOLDOWN = 600;
|
||||
|
||||
public static final int BUFFER_LIMIT_STRUCTURE_HANDLING = 50; //Number of milliseconds Structure handling is allowed to run max.
|
||||
public static final int BUFFER_LIMIT_HEARTBEAT = 50; //Number of milliseconds Heartbeat is allowed to run max.
|
||||
@ -824,10 +829,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
runServerHeartbeat.runVacuumCubeSuckup(p,itemsIgnored);
|
||||
|
||||
TwosideKeeper.HeartbeatLogger.AddEntry("Player Cycle Handling->Vacuum Cube Handling", (int)(System.nanoTime()-time1));time1=System.nanoTime();
|
||||
if (PlayerStructure.GetPlayerStructure(p).last_rejuvenate+200>TwosideKeeper.getServerTickTime()) {
|
||||
/*if (PlayerStructure.GetPlayerStructure(p).last_mobcontrol+200>TwosideKeeper.getServerTickTime()) {
|
||||
GenericFunctions.HealEntity(p, 5);
|
||||
TwosideKeeper.HeartbeatLogger.AddEntry("Player Cycle Handling->Rejuvenate Handling", (int)(System.nanoTime()-time1));time1=System.nanoTime();
|
||||
}
|
||||
}*/
|
||||
/*if (p.getVehicle() instanceof EnderDragon) {
|
||||
EnderDragon ed = (EnderDragon)p.getVehicle();
|
||||
ed.setVelocity(p.getLocation().getDirection().multiply(2.0f));
|
||||
@ -1353,7 +1358,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
getServer().getScheduler().runTaskLaterAsynchronously(this, new DiscordStatusUpdater(), 300l);
|
||||
|
||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new ReapplyAbsorptionHeartsFromSet(),0l,600l);
|
||||
//getServer().getScheduler().scheduleSyncRepeatingTask(this, new ReapplyAbsorptionHeartsFromSet(),0l,600l);
|
||||
//getServer().getScheduler().scheduleSyncRepeatingTask(this, new SendMiningFatigueToAllNearbyElderGuardians(),0l,600l);
|
||||
|
||||
//This is the constant timing method.
|
||||
@ -1396,6 +1401,15 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
},"daily");
|
||||
aPlugin.API.addCommand(args->{
|
||||
int attempts=1000;
|
||||
int selectednumb = (int)(Math.random()*101);
|
||||
while (attempts>0 && recentnumbers.contains(selectednumb)) {
|
||||
selectednumb = (int)(Math.random()*101);
|
||||
attempts--;
|
||||
}
|
||||
recentnumbers.add(selectednumb);
|
||||
},"roll");
|
||||
}, 90);
|
||||
}
|
||||
|
||||
@ -4402,6 +4416,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||
pd.blocking=true;
|
||||
if (pd.lastblock+20<=TwosideKeeper.getServerTickTime()) {
|
||||
pd.lastblock=TwosideKeeper.getServerTickTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4478,34 +4495,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
if (ev.getAction() == Action.LEFT_CLICK_AIR || ev.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
//PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (pd.lastShieldCharge+(20*1)<=TwosideKeeper.getServerTickTime()) {
|
||||
if (PlayerMode.getPlayerMode(p) == PlayerMode.DEFENDER &&
|
||||
DefenderStance.getDefenderStance(p)==DefenderStance.CHARGE) {
|
||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.BLOCK_GLASS_PLACE, 1f, 1.25f);
|
||||
p.setVelocity(p.getLocation().getDirection().multiply(2));
|
||||
pd.lastShieldCharge = TwosideKeeper.getServerTickTime();
|
||||
Vector dir = p.getLocation().getDirection();
|
||||
for (int i=0;i<10;i++) {
|
||||
Vector newdir = dir.clone();
|
||||
newdir.multiply(i);
|
||||
Location checkpos = p.getLocation().add(newdir);
|
||||
/*double dmg = CustomDamage.CalculateDamage(0,p,);
|
||||
CustomDamage.ApplyDamage(, damager, target, weapon, reason, flags)*/
|
||||
//GenericFunctions.DealBlitzenLightningStrikeToNearbyMobs(l, basedmg, range, damager, flags);
|
||||
Block bb = checkpos.getBlock().getRelative(0, -1, 0);
|
||||
if (bb!=null && bb.getType()!=Material.AIR) {
|
||||
GenericFunctions.DealDamageToNearbyMobs(checkpos, 0, 1, true, 2, p, p.getEquipment().getItemInMainHand(), false, "Shield Charge");
|
||||
}
|
||||
}
|
||||
List<LivingEntity> ents = GenericFunctions.getNearbyMobs(p.getLocation(), 16);
|
||||
for (LivingEntity ent : ents) {
|
||||
if (!(ent instanceof Player)) {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(ent);
|
||||
les.increaseAggro(p, 50);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
PerformShieldCharge(p, pd);
|
||||
}
|
||||
|
||||
if (!Christmas.RunPlayerInteractEvent(ev)) {return;}
|
||||
@ -4811,9 +4801,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
//See if this player is blocking. If so, give them absorption.
|
||||
//Player p = ev.getPlayer();
|
||||
}*/
|
||||
if ((ev.getAction()==Action.RIGHT_CLICK_AIR ||
|
||||
if (PlayerMode.isDefender(ev.getPlayer()) && (ev.getAction()==Action.RIGHT_CLICK_AIR ||
|
||||
ev.getAction()==Action.RIGHT_CLICK_BLOCK) && (ev.getClickedBlock()==null || !BlockUtils.isInteractable(ev.getClickedBlock()))) {
|
||||
pd.blocking=true;
|
||||
if (pd.lastblock+20<=TwosideKeeper.getServerTickTime()) {
|
||||
pd.lastblock=TwosideKeeper.getServerTickTime();
|
||||
}
|
||||
}
|
||||
|
||||
//Check if we're allowed to open a shop chest.
|
||||
@ -5493,28 +5486,57 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
private void aggroMonsters(final Player p, PlayerStructure pd, int tauntAmt, int range) {
|
||||
if (PlayerMode.isDefender(p)) {
|
||||
List<Entity> entities = p.getNearbyEntities(range, range, range);
|
||||
for (int i=0;i<entities.size();i++) {
|
||||
if (entities.get(i) instanceof Monster) {
|
||||
if (pd.lastblock+20*5>=getServerTickTime()) {
|
||||
Monster m = (Monster)(entities.get(i));
|
||||
m.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,100,5,true,true,Color.NAVY));
|
||||
m.setTarget(p);
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
||||
//les.increaseAggro(p, 1000);
|
||||
les.increaseAggroWhileMultiplyingAllOthers(p, tauntAmt, 0.5);
|
||||
les.lastHit = TwosideKeeper.getServerTickTime();
|
||||
public static void PerformShieldCharge(final Player p, PlayerStructure pd) {
|
||||
if (pd.lastShieldCharge+(20*1)<=TwosideKeeper.getServerTickTime()) {
|
||||
if (PlayerMode.getPlayerMode(p) == PlayerMode.DEFENDER &&
|
||||
DefenderStance.getDefenderStance(p)==DefenderStance.CHARGE) {
|
||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.BLOCK_GLASS_PLACE, 1f, 1.25f);
|
||||
p.setVelocity(p.getLocation().getDirection().multiply(2));
|
||||
pd.lastShieldCharge = TwosideKeeper.getServerTickTime();
|
||||
Vector dir = p.getLocation().getDirection();
|
||||
for (int i=0;i<10;i++) {
|
||||
Vector newdir = dir.clone();
|
||||
newdir.multiply(i);
|
||||
Location checkpos = p.getLocation().add(newdir);
|
||||
/*double dmg = CustomDamage.CalculateDamage(0,p,);
|
||||
CustomDamage.ApplyDamage(, damager, target, weapon, reason, flags)*/
|
||||
//GenericFunctions.DealBlitzenLightningStrikeToNearbyMobs(l, basedmg, range, damager, flags);
|
||||
Block bb = checkpos.getBlock().getRelative(0, -1, 0);
|
||||
if (bb!=null && bb.getType()!=Material.AIR) {
|
||||
GenericFunctions.DealDamageToNearbyMobs(checkpos, 0, 1, true, 2, p, p.getEquipment().getItemInMainHand(), false, "Shield Charge");
|
||||
}
|
||||
}
|
||||
List<LivingEntity> ents = GenericFunctions.getNearbyMobs(p.getLocation(), 16);
|
||||
for (LivingEntity ent : ents) {
|
||||
if (!(ent instanceof Player)) {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(ent);
|
||||
les.increaseAggro(p, 50);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void aggroMonsters(final Player p, PlayerStructure pd, int tauntAmt, int range) {
|
||||
if (PlayerMode.isDefender(p)) {
|
||||
List<Entity> entities = p.getNearbyEntities(range, range, range);
|
||||
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));
|
||||
m.setTarget(p);
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
||||
//les.increaseAggro(p, 1000);
|
||||
les.increaseAggroWhileMultiplyingAllOthers(p, tauntAmt, 0.5);
|
||||
les.lastHit = TwosideKeeper.getServerTickTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
DecimalFormat df = new DecimalFormat("0.0");
|
||||
/*
|
||||
if (pd.lastblock+20*5<=getServerTickTime()) {
|
||||
p.sendMessage(ChatColor.GRAY+"Damage Reduction: "+ChatColor.DARK_AQUA+df.format(((1-CustomDamage.CalculateDamageReduction(1,p,null))*100))+"% "+ChatColor.GRAY+"Block Chance: "+ChatColor.DARK_AQUA+df.format(((CustomDamage.CalculateDodgeChance(p))*100))+"% ");
|
||||
pd.lastblock=getServerTickTime();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
private void consumeToken(Player p) {
|
||||
if (isHoldingDailyToken(p)) {
|
||||
@ -6298,20 +6320,38 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER &&
|
||||
ItemSet.hasFullSet(p, ItemSet.PROTECTOR)) {
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (PlayerUtils.cooldownAvailable(pd.lastusedunstoppableteam, UNSTOPPABLETEAM_COOLDOWN, p)) {
|
||||
Channel.createNewChannel(p, "Unstoppable Team", 60);
|
||||
pd.lastusedunstoppableteam=TwosideKeeper.getServerTickTime();
|
||||
UpdateUnstoppableTeamBuff(p, pd);
|
||||
sendSuccessfulCastMessage(p);
|
||||
if (ItemSet.hasFullSet(p, ItemSet.PROTECTOR) && pd.lastusedRejuvenation+GenericFunctions.GetModifiedCooldown(TwosideKeeper.REJUVENATION_COOLDOWN, (Player)p)>TwosideKeeper.getServerTickTime()) {
|
||||
if (PlayerUtils.cooldownAvailable(pd.lastusedunstoppableteam, UNSTOPPABLETEAM_COOLDOWN, p)) {
|
||||
Channel.createNewChannel(p, "Unstoppable Team", 60);
|
||||
pd.lastusedunstoppableteam=TwosideKeeper.getServerTickTime();
|
||||
UpdateUnstoppableTeamBuff(p, pd);
|
||||
sendSuccessfulCastMessage(p);
|
||||
} else {
|
||||
sendNotReadyCastMessage(p,ChatColor.GOLD+"Unstoppable Team");
|
||||
UpdateUnstoppableTeamBuff(p, pd);
|
||||
}
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
} else {
|
||||
sendNotReadyCastMessage(p,ChatColor.GOLD+"Unstoppable Team");
|
||||
UpdateUnstoppableTeamBuff(p, pd);
|
||||
if (pd.blockStacks>=10 && pd.lastusedRejuvenation+GenericFunctions.GetModifiedCooldown(TwosideKeeper.REJUVENATION_COOLDOWN, (Player)p)<=TwosideKeeper.getServerTickTime()) {
|
||||
//SoundUtils.playGlobalSound(p.getLocation(), Sound.BLOCK_NOTE_HARP, 1.0f, 2.0f);
|
||||
float[] vals = new float[]{2f,2.245f,2.378f,2.828f};
|
||||
for (int i=0;i<3;i++) {
|
||||
final float newval = vals[i];
|
||||
Bukkit.getScheduler().runTaskLater(this, ()->{
|
||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.BLOCK_NOTE_HARP, 1.0f, newval);
|
||||
}, i*3);
|
||||
}
|
||||
pd.lastusedRejuvenation=TwosideKeeper.getServerTickTime();
|
||||
sendSuccessfulCastMessage(p);
|
||||
} else {
|
||||
sendNotReadyCastMessage(p,ChatColor.GREEN+"Rejuvenation");
|
||||
}
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
public static void sendNotReadyCastMessage(Player p, String string) {
|
||||
@ -6385,23 +6425,22 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (ev.getItemDrop().getItemStack().getType()==Material.SHIELD && !GenericFunctions.isViewingInventory(ev.getPlayer())) {
|
||||
if (ev.getItemDrop().getItemStack().getType()==Material.SHIELD && !GenericFunctions.isViewingInventory(ev.getPlayer())) {
|
||||
ev.setCancelled(true);
|
||||
if (ev.getPlayer().getEquipment().getItemInMainHand()==null || ev.getPlayer().getEquipment().getItemInMainHand().getType()==Material.AIR) {
|
||||
ev.getPlayer().getEquipment().setItemInMainHand(ev.getItemDrop().getItemStack());
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(ev.getPlayer());
|
||||
if (pd.last_rejuvenate+GenericFunctions.GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,ev.getPlayer())<=TwosideKeeper.getServerTickTime() && PlayerMode.isDefender(ev.getPlayer())) {
|
||||
GenericFunctions.PerformRejuvenate(ev.getPlayer());
|
||||
pd.last_rejuvenate = TwosideKeeper.getServerTickTime();
|
||||
aPlugin.API.damageItem(ev.getPlayer(), ev.getItemDrop().getItemStack(), 400);
|
||||
if (pd.last_mobcontrol+GenericFunctions.GetModifiedCooldown(TwosideKeeper.MOBCONTROL_COOLDOWN,ev.getPlayer())<=TwosideKeeper.getServerTickTime() && PlayerMode.isDefender(ev.getPlayer())) {
|
||||
GenericFunctions.PerformMobControl(ev.getPlayer());
|
||||
//pd.last_mobcontrol = TwosideKeeper.getServerTickTime();
|
||||
sendSuccessfulCastMessage(ev.getPlayer());
|
||||
} else {
|
||||
sendNotReadyCastMessage(ev.getPlayer(),ChatColor.GREEN+"Rejuvenation");
|
||||
sendNotReadyCastMessage(ev.getPlayer(),ChatColor.GREEN+"Mob Control");
|
||||
}
|
||||
ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR));
|
||||
}
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
if (ev.getItemDrop().getItemStack().getType().name().contains("_AXE") && !GenericFunctions.isViewingInventory(ev.getPlayer())) {
|
||||
ev.setCancelled(true);
|
||||
@ -7929,6 +7968,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
} else {
|
||||
dmgdealt = event.getDamage();
|
||||
if (!(ev.getEntity() instanceof Player && PlayerMode.getPlayerMode((Player)(ev.getEntity()))==PlayerMode.SLAYER)) {
|
||||
if (dmgdealt < 1) {
|
||||
ev.setDamage(DamageModifier.BASE,dmgdealt);
|
||||
@ -8145,6 +8185,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
} else {
|
||||
dmgdealt = ev.getDamage();
|
||||
if (!(ev.getEntity() instanceof Player && PlayerMode.getPlayerMode((Player)(ev.getEntity()))==PlayerMode.SLAYER)) {
|
||||
if (dmgdealt < 1) {
|
||||
ev.setDamage(DamageModifier.BASE,dmgdealt);
|
||||
@ -11909,6 +11950,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (ItemSet.hasFullSet(p, ItemSet.SONGSTEEL)) {
|
||||
bonushp+=(ItemSet.getHighestTierInSet(p, ItemSet.SONGSTEEL)*20)+30;
|
||||
}
|
||||
|
||||
bonushp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.ALIKAHN, 2, 2)+ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.ALIKAHN, 3, 3);
|
||||
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Alikahn HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
||||
bonushp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.COMET, 2, 2);
|
||||
@ -12309,6 +12355,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
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)+"%");}
|
||||
double attackspd = 1+CustomDamage.GetAttackRate(p);
|
||||
if (all || attackspd>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Attack Speed: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format(attackspd*100)+"%");}
|
||||
TextComponent f = new TextComponent(ChatColor.GRAY+""+ChatColor.ITALIC+"Current Mode: ");
|
||||
f.addExtra(GenericFunctions.PlayerModeName(p));
|
||||
if (receiver instanceof Player) {
|
||||
|
@ -159,6 +159,7 @@ final public class runServerHeartbeat implements Runnable {
|
||||
//MOTD: "Thanks for playing on Sig's Minecraft!\n*bCheck out http://z-gamers.net/mc for update info!\n*aReport any bugs you find at http://zgamers.domain.com/mc/"
|
||||
ServerHeartbeat.getMOTD();
|
||||
ServerHeartbeat.getServer().broadcastMessage(ChatColor.translateAlternateColorCodes('*', TwosideKeeper.MOTD));
|
||||
TwosideKeeper.recentnumbers.clear();
|
||||
TwosideKeeper.habitat_data.increaseHabitationLevels();
|
||||
TwosideKeeper.habitat_data.startinglocs.clear();
|
||||
for (int i=0;i<Bukkit.getOnlinePlayers().size();i++) {
|
||||
@ -315,6 +316,8 @@ final public class runServerHeartbeat implements Runnable {
|
||||
|
||||
PerformStealthSetRegen(p,pd);
|
||||
|
||||
performRejuvenationHealing(p,pd);
|
||||
|
||||
updateCustomTitle(p, pd);
|
||||
TwosideKeeper.HeartbeatLogger.AddEntry("Update Custom Title", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
}
|
||||
@ -414,6 +417,13 @@ final public class runServerHeartbeat implements Runnable {
|
||||
TwosideKeeper.HeartbeatLogger.AddEntry(ChatColor.LIGHT_PURPLE+"Total Server Heartbeat", (int)(System.nanoTime()-totaltime));totaltime=System.nanoTime();
|
||||
}
|
||||
|
||||
private void performRejuvenationHealing(Player p, PlayerStructure pd) {
|
||||
if (pd.lastusedRejuvenation+200>TwosideKeeper.getServerTickTime()) {
|
||||
//Regenerate health.
|
||||
GenericFunctions.HealEntity(p, p.getMaxHealth()*0.05);
|
||||
}
|
||||
}
|
||||
|
||||
private void increaseAggroTowardsTarget(Player p) {
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||
if (DefenderStance.getDefenderStance(p)==DefenderStance.BLOCK) {
|
||||
@ -971,6 +981,11 @@ final public class runServerHeartbeat implements Runnable {
|
||||
spdmult += ItemSet.GetTotalBaseAmount(p, ItemSet.DASHER)/100d;
|
||||
}
|
||||
spdmult += ItemSet.GetTotalBaseAmount(p, ItemSet.STEALTH)/100d;
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER &&
|
||||
p.getEquipment().getItemInOffHand()!=null &&
|
||||
p.getEquipment().getItemInOffHand().getType()==Material.SHIELD) {
|
||||
spdmult -= 0.5;
|
||||
}
|
||||
aPlugin.API.setPlayerSpeedMultiplier(p, (float)(1.0f+spdmult));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user