Fixed and updated bugs and issues with Elite Zombies / Vendetta.
This commit is contained in:
parent
d35942b678
commit
ac3cf8846c
@ -303,23 +303,27 @@ public class EliteZombie extends EliteMonster{
|
|||||||
} else {
|
} else {
|
||||||
m.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(DEFAULT_MOVE_SPD);
|
m.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(DEFAULT_MOVE_SPD);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (l.getLocation().getY()>m.getLocation().getY()+1) {
|
if (l.getLocation().getY()>m.getLocation().getY()+1) {
|
||||||
//Jump up to compensate. Move towards the player too.
|
//Jump up to compensate. Move towards the player too.
|
||||||
m.setVelocity((m.getLocation().getDirection()).add(new Vector(0,0.2*(l.getLocation().getY()-m.getLocation().getY()),0)));
|
m.setVelocity((m.getLocation().getDirection()).add(new Vector(0,0.2*(l.getLocation().getY()-m.getLocation().getY()),0)));
|
||||||
|
}
|
||||||
|
if (lastLoc!=null && lastLoc.distance(m.getLocation())<=0.4) {
|
||||||
|
stuckTimer++;
|
||||||
|
//TwosideKeeper.log("Stuck. "+stuckTimer, 0);
|
||||||
|
} else {
|
||||||
|
stuckTimer=0;
|
||||||
|
}
|
||||||
|
lastLoc = m.getLocation().clone();
|
||||||
|
if (stuckTimer>5) {
|
||||||
|
//Teleport randomly.
|
||||||
|
m.teleport(getNearbyFreeLocation(m.getLocation()));
|
||||||
|
stuckTimer=0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (lastLoc!=null && lastLoc.distance(m.getLocation())<=0.4) {
|
if (l instanceof Player) {
|
||||||
stuckTimer++;
|
Player pl = (Player)l;
|
||||||
//TwosideKeeper.log("Stuck. "+stuckTimer, 0);
|
pl.setFlying(false);
|
||||||
} else {
|
|
||||||
stuckTimer=0;
|
|
||||||
}
|
|
||||||
lastLoc = m.getLocation().clone();
|
|
||||||
if (stuckTimer>5) {
|
|
||||||
//Teleport randomly.
|
|
||||||
m.teleport(getNearbyFreeLocation(m.getLocation()));
|
|
||||||
stuckTimer=0;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
targetlist.remove(l);
|
targetlist.remove(l);
|
||||||
@ -591,7 +595,7 @@ public class EliteZombie extends EliteMonster{
|
|||||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f);
|
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f);
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.CONFUSION,20*4,0,p);
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.CONFUSION,20*4,0,p);
|
||||||
TwosideKeeper.log("Got hit for "+storingenergy_hit+" damage!", 2);
|
TwosideKeeper.log("Got hit for "+storingenergy_hit+" damage!", 2);
|
||||||
GenericFunctions.removeNoDamageTick(p, m);
|
//GenericFunctions.removeNoDamageTick(p, m);
|
||||||
if (CustomDamage.ApplyDamage(storingenergy_hit, m, p, null, "Stored Energy", CustomDamage.IGNOREDODGE|CustomDamage.IGNORE_DAMAGE_TICK)) {
|
if (CustomDamage.ApplyDamage(storingenergy_hit, m, p, null, "Stored Energy", CustomDamage.IGNOREDODGE|CustomDamage.IGNORE_DAMAGE_TICK)) {
|
||||||
//TwosideKeeperAPI.DealDamageToEntity(.CalculateDamageReduction(storingenergy_hit,p,m),p,m);
|
//TwosideKeeperAPI.DealDamageToEntity(.CalculateDamageReduction(storingenergy_hit,p,m),p,m);
|
||||||
storingenergy_hit=0;
|
storingenergy_hit=0;
|
||||||
|
@ -48,6 +48,7 @@ import org.bukkit.potion.PotionType;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import aPlugin.API;
|
import aPlugin.API;
|
||||||
|
import sig.plugin.TwosideKeeper.Boss.EliteZombie;
|
||||||
import sig.plugin.TwosideKeeper.Events.EntityDamagedEvent;
|
import sig.plugin.TwosideKeeper.Events.EntityDamagedEvent;
|
||||||
import sig.plugin.TwosideKeeper.Events.PlayerDodgeEvent;
|
import sig.plugin.TwosideKeeper.Events.PlayerDodgeEvent;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
|
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
|
||||||
@ -1164,10 +1165,14 @@ public class CustomDamage {
|
|||||||
private static int GetHeartAmount(double dmg) {
|
private static int GetHeartAmount(double dmg) {
|
||||||
int heartcount = 1;
|
int heartcount = 1;
|
||||||
double dmgamountcopy = dmg;
|
double dmgamountcopy = dmg;
|
||||||
|
TwosideKeeper.log("Starting Damage: "+dmgamountcopy, 0);
|
||||||
while (dmgamountcopy>10) {
|
while (dmgamountcopy>10) {
|
||||||
dmgamountcopy/=2;
|
dmgamountcopy/=2;
|
||||||
heartcount++;
|
heartcount++;
|
||||||
|
TwosideKeeper.log("Hearts: "+heartcount, 0);
|
||||||
|
TwosideKeeper.log("Remaining Damage: "+dmgamountcopy, 0);
|
||||||
}
|
}
|
||||||
|
TwosideKeeper.log(ChatColor.RED+"Final Heart Count: "+heartcount, 0);
|
||||||
return heartcount;
|
return heartcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1520,6 +1525,9 @@ public class CustomDamage {
|
|||||||
if (damager instanceof Player && target instanceof Player && !damager.getWorld().getPVP()) {
|
if (damager instanceof Player && target instanceof Player && !damager.getWorld().getPVP()) {
|
||||||
return true; //Cancel all PvP related events.
|
return true; //Cancel all PvP related events.
|
||||||
}
|
}
|
||||||
|
if (isFlagSet(flags,IGNORE_DAMAGE_TICK)) {
|
||||||
|
GenericFunctions.removeNoDamageTick(target, damager);
|
||||||
|
}
|
||||||
if (isFlagSet(flags,IGNORE_DAMAGE_TICK) || (GenericFunctions.enoughTicksHavePassed(target, damager) && canHitMobDueToWeakness(damager) && !GenericFunctions.isSuppressed(getDamagerEntity(damager)) && !target.isDead())) {
|
if (isFlagSet(flags,IGNORE_DAMAGE_TICK) || (GenericFunctions.enoughTicksHavePassed(target, damager) && canHitMobDueToWeakness(damager) && !GenericFunctions.isSuppressed(getDamagerEntity(damager)) && !target.isDead())) {
|
||||||
TwosideKeeper.log("Enough ticks have passed.", 5);
|
TwosideKeeper.log("Enough ticks have passed.", 5);
|
||||||
|
|
||||||
@ -1538,6 +1546,23 @@ public class CustomDamage {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (damager instanceof Monster) {
|
||||||
|
Monster m = (Monster)damager;
|
||||||
|
LivingEntityStructure les = LivingEntityStructure.getLivingEntityStructure(m);
|
||||||
|
if (les.isElite) {
|
||||||
|
for (EliteMonster em : TwosideKeeper.elitemonsters) {
|
||||||
|
if (em.m.equals(m)) {
|
||||||
|
if (em instanceof EliteZombie) {
|
||||||
|
EliteZombie ez = (EliteZombie)em;
|
||||||
|
if (ez.storingenergy) {
|
||||||
|
return true; //Cancel it, we're storing energy right now.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isFlagSet(flags,IGNOREDODGE) || !PassesIframeCheck(target,damager)) {
|
if (isFlagSet(flags,IGNOREDODGE) || !PassesIframeCheck(target,damager)) {
|
||||||
TwosideKeeper.log("Not in an iframe.", 5);
|
TwosideKeeper.log("Not in an iframe.", 5);
|
||||||
|
@ -464,7 +464,7 @@ public enum ItemSet {
|
|||||||
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Damage Reduction");
|
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Damage Reduction");
|
||||||
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Swift Aegis "+WorldShop.toRomanNumeral(ItemSet.GetBaseAmount(set, tier, 4)));
|
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Swift Aegis "+WorldShop.toRomanNumeral(ItemSet.GetBaseAmount(set, tier, 4)));
|
||||||
lore.add(ChatColor.GRAY+" Builds "+ItemSet.GetBaseAmount(set, tier, 4)+" stack"+((ItemSet.GetBaseAmount(set, tier, 4))!=1?"s":"")+" of Resist");
|
lore.add(ChatColor.GRAY+" Builds "+ItemSet.GetBaseAmount(set, tier, 4)+" stack"+((ItemSet.GetBaseAmount(set, tier, 4))!=1?"s":"")+" of Resist");
|
||||||
lore.add(ChatColor.GRAY+" (20% Damage Reduction) every 5 seconds of sprinting,");
|
lore.add(ChatColor.GRAY+" ("+(ItemSet.GetBaseAmount(set, tier, 4)*10)+"% Damage Reduction) every 5 seconds of sprinting,");
|
||||||
lore.add(ChatColor.GRAY+" and with every Tumble. Each hit taken removes one");
|
lore.add(ChatColor.GRAY+" and with every Tumble. Each hit taken removes one");
|
||||||
lore.add(ChatColor.GRAY+" stack of Resist. Caps at Resist 10. Lasts 20 seconds.");
|
lore.add(ChatColor.GRAY+" stack of Resist. Caps at Resist 10. Lasts 20 seconds.");
|
||||||
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Boosts All Modes of Ranger");
|
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Boosts All Modes of Ranger");
|
||||||
|
@ -462,6 +462,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
public static HashMap<UUID,BankSession> banksessions;
|
public static HashMap<UUID,BankSession> banksessions;
|
||||||
public static Habitation habitat_data;
|
public static Habitation habitat_data;
|
||||||
public static boolean last_announced_storm = false; //Whether or not the last announcement was about a storm.
|
public static boolean last_announced_storm = false; //Whether or not the last announcement was about a storm.
|
||||||
|
public static long lastTimingReport=0;
|
||||||
|
|
||||||
public static List<String> weather_watch_users = new ArrayList<String>();
|
public static List<String> weather_watch_users = new ArrayList<String>();
|
||||||
|
|
||||||
@ -5709,6 +5710,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
CustomDamage.ApplyDamage(pd.vendetta_amt, ev.getDamager(), (LivingEntity)ev.getEntity(), null, "Vendetta");
|
CustomDamage.ApplyDamage(pd.vendetta_amt, ev.getDamager(), (LivingEntity)ev.getEntity(), null, "Vendetta");
|
||||||
pd.vendetta_amt=0.0;
|
pd.vendetta_amt=0.0;
|
||||||
GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+" dmg stored",true);
|
GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+" dmg stored",true);
|
||||||
|
ev.setCancelled(true);
|
||||||
} else {
|
} else {
|
||||||
CustomDamage.ApplyDamage(0, ev.getDamager(), (LivingEntity)ev.getEntity(), weapon, null);
|
CustomDamage.ApplyDamage(0, ev.getDamager(), (LivingEntity)ev.getEntity(), weapon, null);
|
||||||
if (ev.getDamager() instanceof Projectile) {
|
if (ev.getDamager() instanceof Projectile) {
|
||||||
|
@ -36,6 +36,7 @@ import org.inventivetalent.glow.GlowAPI.Color;
|
|||||||
|
|
||||||
import aPlugin.DiscordMessageSender;
|
import aPlugin.DiscordMessageSender;
|
||||||
import net.minecraft.server.v1_9_R1.EnumParticle;
|
import net.minecraft.server.v1_9_R1.EnumParticle;
|
||||||
|
import net.minecraft.server.v1_9_R1.MinecraftServer;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
|
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.BankSession;
|
import sig.plugin.TwosideKeeper.HelperStructures.BankSession;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
|
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
|
||||||
@ -297,6 +298,8 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
if (pd.vendetta_amt>0 && pd.lastvendettastack+200<serverTickTime) {
|
if (pd.vendetta_amt>0 && pd.lastvendettastack+200<serverTickTime) {
|
||||||
pd.vendetta_amt=0;
|
pd.vendetta_amt=0;
|
||||||
}
|
}
|
||||||
|
pd.vendetta_amt=50000;
|
||||||
|
pd.lastvendettastack=TwosideKeeper.getServerTickTime()+500;
|
||||||
if (pd.lastattacked+(20*5)<serverTickTime) {
|
if (pd.lastattacked+(20*5)<serverTickTime) {
|
||||||
pd.lastattacked=0;
|
pd.lastattacked=0;
|
||||||
pd.lifestealstacks=0;
|
pd.lifestealstacks=0;
|
||||||
@ -432,9 +435,25 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
PartyManager.SetupParties();
|
PartyManager.SetupParties();
|
||||||
|
|
||||||
TwosideKeeper.TwosideSpleefGames.TickEvent();
|
TwosideKeeper.TwosideSpleefGames.TickEvent();
|
||||||
|
|
||||||
|
performTimingsReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void performTimingsReport() {
|
||||||
|
double tps = MinecraftServer.getServer().recentTps[0];
|
||||||
|
if (tps<18 && TwosideKeeper.lastTimingReport+36000<TwosideKeeper.getServerTickTime()) {
|
||||||
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
|
aPlugin.API.discordSendRawItalicized("**Server is lagging.**\nCurrent TPS: **"+df.format(tps)+"**");
|
||||||
|
if (TwosideKeeper.getServerTickTime()-TwosideKeeper.lastTimingReport>72000) {
|
||||||
|
aPlugin.API.takeTimings(1200);
|
||||||
|
} else {
|
||||||
|
aPlugin.API.takeTimings(3600);
|
||||||
|
}
|
||||||
|
TwosideKeeper.lastTimingReport=TwosideKeeper.getServerTickTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void CheckAndAnnounceWeather() {
|
private void CheckAndAnnounceWeather() {
|
||||||
if (Bukkit.getWorld("world").hasStorm()) {
|
if (Bukkit.getWorld("world").hasStorm()) {
|
||||||
if (!TwosideKeeper.last_announced_storm) {
|
if (!TwosideKeeper.last_announced_storm) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user