diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java index a710ccb1b..a3df8747f 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java @@ -1617,4 +1617,35 @@ public class UtilBlock } } + + public static boolean water(Material type) + { + return type == Material.WATER || type == Material.STATIONARY_WATER; + } + + public static boolean lava(Material type) + { + return type == Material.LAVA || type == Material.STATIONARY_LAVA; + } + + public static boolean liquid(Material type) + { + return water(type) || lava(type); + } + + public static boolean water(Block block) + { + return water(block.getType()); + } + + public static boolean lava(Block block) + { + return lava(block.getType()); + } + + public static boolean liquid(Block block) + { + return liquid(block.getType()); + } + } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java index 12dbee6b4..07b4e54e9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java @@ -88,6 +88,15 @@ public class ProjectileManager extends MiniPlugin sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult)); } + public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, + long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, + Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, double charge) + { + _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, + expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false, + sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, charge)); + } + public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult) @@ -133,14 +142,14 @@ public class ProjectileManager extends MiniPlugin } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, - long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, - Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, List canHit) + long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, + Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, List canHit) { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, - expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false, - sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, canHit)); + expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false, + sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, canHit)); } - + public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult, List canHit) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java index 31aee43b1..16213685f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java @@ -62,6 +62,8 @@ public class ProjectileUser private UpdateType _effectRate = UpdateType.TICK; private double _hitboxGrow; + + private double _charge; private List _canHit; @@ -104,6 +106,47 @@ public class ProjectileUser _canHit = null; } + public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback, + long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup, + Sound sound, float soundVolume, float soundPitch, + Effect effect, int effectData, UpdateType effectRate, + ParticleType particle, float particleX, float particleY, + float particleZ, float particleS, int particleC, double hitboxMult, double charge) + { + Throw = throwInput; + + _thrown = thrown; + _thrower = thrower; + _callback = callback; + + _expireTime = expireTime; + _startTime = System.currentTimeMillis(); + + _hitPlayer = hitPlayer; + _hitNonPlayerEntity = hitNonPlayerEntity; + _hitBlock = hitBlock; + _idle = idle; + _pickup = pickup; + + _sound = sound; + _soundVolume = soundVolume; + _soundPitch = soundPitch; + _particle = particle; + _particleX = particleX; + _particleY = particleY; + _particleZ = particleZ; + _particleS = particleS; + _particleC = particleC; + _effect = effect; + _effectData = effectData; + _effectRate = effectRate; + + _hitboxGrow = hitboxMult; + _canHit = null; + + _charge = charge; + } + public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup, Sound sound, float soundVolume, float soundPitch, @@ -142,6 +185,7 @@ public class ProjectileUser _hitboxGrow = hitboxMult; _canHit = canHit; } + public void effect(UpdateEvent event) { @@ -311,6 +355,11 @@ public class ProjectileUser return false; } + + public double getCharge() + { + return _charge; + } public IThrown getIThrown() { diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java index 7aecaade1..2a87b1c30 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java @@ -33,7 +33,7 @@ public class Blink extends SkillActive { private HashMap _loc = new HashMap(); private HashMap _blinkTime = new HashMap(); - + public Blink(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels, int energy, int energyMod, @@ -206,6 +206,9 @@ public class Blink extends SkillActive done = true; } + target.setYaw(player.getLocation().getYaw()); + target.setPitch(player.getLocation().getPitch()); + player.teleport(target); player.setFallDistance(0); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Evade.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Evade.java index c00d10c69..128ee2a11 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Evade.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Evade.java @@ -29,6 +29,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.recharge.Recharge; import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; @@ -213,10 +214,11 @@ public class Evade extends SkillActive { Player player = activeIter.next(); - if (!player.isOnline() || !player.isBlocking() || UtilTime.elapsed(_active.get(player), 750)) + if (!player.isOnline() || !player.isBlocking() || UtilTime.elapsed(_active.get(player), 1000)) { activeIter.remove(); UtilPlayer.message(player, F.main(GetClassType().name(), "You failed to " + F.skill(GetName()) + ".")); + Recharge.Instance.useForce(player, GetName(), 10000l, true); } } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Recall.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Recall.java index 1918c5cf4..16b032c06 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Recall.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Recall.java @@ -14,6 +14,7 @@ import org.bukkit.event.player.PlayerDropItemEvent; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; @@ -28,7 +29,6 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; -import net.minecraft.server.v1_8_R3.Material; public class Recall extends Skill { @@ -69,6 +69,12 @@ public class Recall extends Skill event.setCancelled(true); + if (UtilBlock.water(player.getLocation().getBlock())) + { + UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water.")); + return; + } + //Check Allowed SkillTriggerEvent trigger = new SkillTriggerEvent(player, GetName(), GetClassType()); Bukkit.getServer().getPluginManager().callEvent(trigger); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/ViperStrikes.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/ViperStrikes.java index 7cac7e593..6aaaba4a2 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/ViperStrikes.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/ViperStrikes.java @@ -6,12 +6,14 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; import mineplex.core.common.util.UtilGear; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; public class ViperStrikes extends Skill { @@ -21,8 +23,8 @@ public class ViperStrikes extends Skill SetDesc(new String[] { - "Your attacks give enemies", - "Shock, Slow 1 and Poison 1", + "Your attacks give", + "enemies Poison 1", "for #0#1 seconds." }); } @@ -47,10 +49,9 @@ public class ViperStrikes extends Skill LivingEntity damagee = event.GetDamageeEntity(); if (damagee == null) return; - - //Confuse - Factory.Condition().Factory().PoisonShock(GetName(), damagee, damager, level, false); - Factory.Condition().Factory().Slow(GetName(), damagee, damager, level, 0, false, false, true, false); + + Factory.Damage().NewDamageEvent(damagee, damager, null, DamageCause.POISON, 0, false, true, true, damager.getName(), GetName()); + damagee.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 20 * (2 + level), 0)); //Sound damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1f, 2f); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java index 800547f8b..3422b690b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java @@ -9,32 +9,34 @@ import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.entity.Entity; import org.bukkit.entity.FallingBlock; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityChangeBlockEvent; -import org.bukkit.event.entity.ItemSpawnEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.player.PlayerInteractEvent; -import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.core.common.util.F; -import mineplex.core.projectile.IThrown; -import mineplex.core.projectile.ProjectileUser; -import mineplex.core.recharge.Recharge; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.updater.UpdateType; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilGear; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.projectile.IThrown; +import mineplex.core.projectile.ProjectileUser; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Skill.SkillCharge; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.event.BlockTossExpireEvent; @@ -90,7 +92,7 @@ public class BlockToss extends SkillCharge implements IThrown @Override public String GetRechargeString() { - return "Recharge: " + "#4#-0.5 Seconds"; + return "Recharge: " + "#5.5#-0.5 Seconds"; } @EventHandler @@ -193,7 +195,22 @@ public class BlockToss extends SkillCharge implements IThrown //Effect player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, block.getMaterial().getId()); } - + + @EventHandler + public void Damage(EntityDamageByEntityEvent event) + { + Entity vehicle = event.getEntity().getVehicle(); + + if (_holding.containsKey(vehicle)) + { + Player attacker = (Player) event.getDamager(); + + //Forward Damage + Factory.Damage().NewDamageEvent((Player) vehicle, attacker, Factory.Damage().GetProjectile(event), + event.getCause(), event.getDamage(), true, false, false, null, null, event.isCancelled()); + } + } + @EventHandler public void Throw(UpdateEvent event) { @@ -224,7 +241,7 @@ public class BlockToss extends SkillCharge implements IThrown } //Throw - if (!cur.isBlocking()) + if (!cur.isBlocking() || (_charge.containsKey(cur) && _charge.get(cur) >= 1)) throwSet.add(cur); //Charged Tick @@ -241,7 +258,7 @@ public class BlockToss extends SkillCharge implements IThrown for (Player cur : throwSet) { Recharge.Instance.recharge(cur, GetName()); - Recharge.Instance.use(cur, GetName(), 4000 - (500 * getLevel(cur)), false, true); + Recharge.Instance.use(cur, GetName(), 5500 - (500 * getLevel(cur)), false, true); FallingBlock block = _holding.remove(cur); float charge = _charge.remove(cur); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/CripplingBlow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/CripplingBlow.java index 3e384a64c..1ae7b8f6e 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/CripplingBlow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/CripplingBlow.java @@ -24,7 +24,7 @@ public class CripplingBlow extends Skill { "Your powerful axe attacks give", "targets Slow 2 for 1.5 second,", - "as well as 50% less knockback." + "as well as 25% less knockback." }); } @@ -57,7 +57,7 @@ public class CripplingBlow extends Skill //Damage event.AddMod(damager.getName(), GetName(), 0, true); - event.AddKnockback(GetName(), 0.5); + event.AddKnockback(GetName(), 0.75); //Event UtilServer.getServer().getPluginManager().callEvent(new SkillEvent(damager, GetName(), ClassType.Brute, damagee)); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/DwarfToss.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/DwarfToss.java index 915c78b7a..1ce818b5f 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/DwarfToss.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/DwarfToss.java @@ -73,7 +73,7 @@ public class DwarfToss extends SkillActive { if (_used.contains(player)) return false; - + return true; } @@ -96,7 +96,13 @@ public class DwarfToss extends SkillActive { int level = getLevel(player); if (level == 0) return false; - + + if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9) + { + UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water.")); + return false; + } + //Check Material if (player.getItemInHand() != null) if (!_itemSet.contains(player.getItemInHand().getType())) @@ -337,6 +343,9 @@ public class DwarfToss extends SkillActive target.leaveVehicle(); final double mult = (1.8) * timeScale; + //Protection + Factory.Condition().Factory().Invulnerable(GetName(), target, target, 1.25, false, false); + //Delay Bukkit.getScheduler().scheduleSyncDelayedTask(Factory.getPlugin(), new Runnable() { diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java index 373caea1f..588571fdc 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java @@ -101,16 +101,16 @@ public class FleshHook extends SkillActiveCharge implements IThrown //Release Charge else if (_charge.containsKey(cur)) { - float charge = _charge.remove(cur); + double charge = _charge.remove(cur); //Action Item item = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(131)); UtilAction.velocity(item, cur.getLocation().getDirection(), - 1 + charge , false, 0, 0.2, 20, false); + 1 + charge, false, 0, 0.2, 20, false); Factory.Projectile().AddThrow(item, cur, this, -1, true, true, true, true, - Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 0.6f); - + Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 0.6f, charge); + //Inform UtilPlayer.message(cur, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + ".")); @@ -148,14 +148,14 @@ public class FleshHook extends SkillActiveCharge implements IThrown //Pull UtilAction.velocity(target, UtilAlg.getTrajectory(target.getLocation(), player.getLocation()), - 1.2 + (0.3 * level), false, 0, 0.7, 1.2, true); + velocity, false, 0, 0.7, 1.2, true); //Condition Factory.Condition().Factory().Falling(GetName(), target, player, 10, false, true); //Damage Event Factory.Damage().NewDamageEvent(target, player, null, - DamageCause.CUSTOM, 5 + level, false, true, false, + DamageCause.CUSTOM, (5 + level) * data.getCharge(), false, true, false, player.getName(), GetName()); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Intimidation.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Intimidation.java index cab4d77fa..1f5d560b9 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Intimidation.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Intimidation.java @@ -21,7 +21,7 @@ public class Intimidation extends Skill SetDesc(new String[] { "You intimidate nearby enemies;", - "Enemies within #3#3 blocks receive Slow 1.", + "Enemies within #4#2 blocks receive Slow 1.", }); } @@ -36,7 +36,7 @@ public class Intimidation extends Skill int level = getLevel(cur); if (level == 0) continue; - HashMap targets = UtilPlayer.getInRadius(cur.getLocation(), 3 + (level * 3)); + HashMap targets = UtilPlayer.getInRadius(cur.getLocation(), 3 + (level * 2)); for (Player other : targets.keySet()) if (!other.equals(cur)) if (Factory.Relation().canHurt(cur, other)) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java index bf2d6aa75..14ae0fcf1 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java @@ -52,7 +52,7 @@ public class AxeThrow extends SkillActive implements IThrown SetDesc(new String[] { "Throw your axe with #0.7#0.1 velocity, ", - "dealing #5.5#0.5 damage.", + "dealing #4.5#0.5 damage.", "", "You pull your axe back to you when it", "collides with anything.", @@ -107,7 +107,7 @@ public class AxeThrow extends SkillActive implements IThrown if (level <= 0) return; - double damage = 5.5 + 0.5 * level; + double damage = 4.5 + 0.5 * level; //Damage Event Factory.Damage().NewDamageEvent(target, data.getThrower(), null, diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/HiltSmash.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/HiltSmash.java index 9e743cea2..cf9845e03 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/HiltSmash.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/HiltSmash.java @@ -46,7 +46,7 @@ public class HiltSmash extends SkillActive SetDesc(new String[] { "Smash the hilt of your sword into", - "your opponent, dealing #2#1 damage", + "your opponent, dealing #1#1 damage", "and Slow 3 for #0.5#0.5 seconds." }); } @@ -153,7 +153,7 @@ public class HiltSmash extends SkillActive //Damage Event Factory.Damage().NewDamageEvent((LivingEntity)ent, player, null, - DamageCause.CUSTOM, 2 + level, false, true, false, + DamageCause.CUSTOM, 1 + level, false, true, false, player.getName(), GetName()); //Sound diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/Swordsmanship.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/Swordsmanship.java index 1e29be118..5d62eac5f 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/Swordsmanship.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/Swordsmanship.java @@ -30,7 +30,7 @@ public class Swordsmanship extends Skill { "Prepare a powerful sword attack;", "You gain 1 Charge every #5#-1 seconds.", - "You can store a maximum of #0#1 Charges.", + "You can store a maximum of #1#1 Charges.", "", "When you next attack, your damage is", "increased by the number of your Charges,", @@ -79,7 +79,7 @@ public class Swordsmanship extends Skill if (!Recharge.Instance.use(cur, GetName(), 5000 - (1000 * level), false, false)) continue; - int max = level; + int max = 1 + level; int charge = 1; if (_charges.containsKey(cur)) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java index 57bf77854..e27680712 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java @@ -67,7 +67,7 @@ public class Blizzard extends SkillActive @Override public String GetEnergyString() { - return "Energy: #34#-2 per Second"; + return "Energy: #42#-2 per Second"; } @Override @@ -114,7 +114,7 @@ public class Blizzard extends SkillActive } //Energy - if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, true)) + if (!Factory.Energy().Use(cur, GetName(), 2.1 - (0.1 * level), true, true)) { _active.remove(cur); continue; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java index 2c2c0f118..a04b31ebc 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java @@ -48,7 +48,7 @@ public class IcePrison extends SkillActive implements IThrown { "Launch an icy orb. When it collides,", "it creates a hollow sphere of ice", - "thats lasts for #3#1.5 seconds.", + "thats lasts for #3#1 seconds.", }); } @@ -171,7 +171,7 @@ public class IcePrison extends SkillActive implements IThrown if (!UtilBlock.airFoliage(freeze)) return; - long time = 3500 + (1500 * level); + long time = 3500 + (1000 * level); int yDiff = freeze.getY() - mid.getY(); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Immolate.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Immolate.java index 043333409..d0f884988 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Immolate.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Immolate.java @@ -152,6 +152,12 @@ public class Immolate extends Skill Remove(cur); continue; } + + if (cur.getLocation().getBlock().getType() == Material.WATER || cur.getLocation().getBlock().getType() == Material.STATIONARY_WATER) + { + Remove(cur); + continue; + } //Energy if (!Factory.Energy().Use(cur, GetName(), 0.65 - (level * 0.05), true, true)) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Inferno.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Inferno.java index 9ef227c18..2c07078cb 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Inferno.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Inferno.java @@ -53,7 +53,7 @@ public class Inferno extends SkillActive @Override public String GetEnergyString() { - return "Energy: #34#-2 per Second"; + return "Energy: #42#-2 per Second"; } @Override @@ -100,7 +100,7 @@ public class Inferno extends SkillActive } //Energy - if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, false)) + if (!Factory.Energy().Use(cur, GetName(), 2.1 - (0.1 * level), true, false)) { _active.remove(cur); continue; @@ -113,7 +113,7 @@ public class Inferno extends SkillActive itemStack.setItemMeta(meta); Item fire = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), itemStack); - Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), 1, GetName(), false); + Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), .25, GetName(), false); fire.teleport(cur.getEyeLocation()); double x = 0.07 - (UtilMath.r(14)/100d); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LifeBonds.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LifeBonds.java index 837fb8ada..4ad73365d 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LifeBonds.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LifeBonds.java @@ -42,8 +42,8 @@ public class LifeBonds extends Skill { "Drop Axe/Sword to Toggle.", "", - "Transfers life from healthy allies", - "to nearby allies with less health.", + "Transfers life from yourself to", + "nearby allies with less health.", "", "Transfers #0.5#0.5 health every second.", "Maximum range of #3#3 Blocks from user." @@ -188,9 +188,6 @@ public class LifeBonds extends Skill int level = getLevel(cur); //Bonds - Player highest = null; - double highestHp = 0; - Player lowest = null; double lowestHp = 20; @@ -199,12 +196,6 @@ public class LifeBonds extends Skill if (Factory.Relation().canHurt(cur, other) && !other.equals(cur)) continue; - if (highest == null || other.getHealth() > highestHp) - { - highest = other; - highestHp = other.getHealth(); - } - if (lowest == null || other.getHealth() < lowestHp) { lowest = other; @@ -213,18 +204,18 @@ public class LifeBonds extends Skill } //Nothing to Transfer - if (highest == null || lowest == null || highest.equals(lowest) || highestHp - lowestHp < 2) + if (cur.equals(lowest) || cur.getHealth() - lowestHp < 2) continue; double amount = 0.5 + (0.5 * level); - amount = Math.min((double)(highestHp - lowestHp) / 2d, amount); + amount = Math.min((double)(cur.getHealth() - lowestHp) / 2d, amount); //Steal - UtilPlayer.health(highest, -amount); + UtilPlayer.health(cur, -amount); //Hearts - _hearts.add(new LifeBondsData(highest.getLocation().add(0, 0.8, 0), lowest, amount)); + _hearts.add(new LifeBondsData(cur.getLocation().add(0, 0.8, 0), lowest, amount)); //Effect //highest.getWorld().playEffect(highest.getLocation(), Effect.STEP_SOUND, 18); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/MagmaBlade.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/MagmaBlade.java index 4ad21a66b..e107aca50 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/MagmaBlade.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/MagmaBlade.java @@ -22,7 +22,7 @@ public class MagmaBlade extends Skill SetDesc(new String[] { "Your sword deals an additional,", - "#0.5#0.5 damage to burning opponents,", + "#0.25#0.25 damage to burning opponents,", "but also extinguishes them.", }); } @@ -54,7 +54,7 @@ public class MagmaBlade extends Skill if (level == 0) return; //Damage - event.AddMod(damager.getName(), GetName(), 0.5 + 0.5 * level, true); + event.AddMod(damager.getName(), GetName(), 0.25 + 0.25 * level, true); //Effect damager.getWorld().playSound(damager.getLocation(), Sound.FIZZ, 0.8f, 0f); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Sharpshooter.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Sharpshooter.java index 77218628b..4a0f2ede7 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Sharpshooter.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Sharpshooter.java @@ -18,18 +18,24 @@ import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import org.bukkit.Sound; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityShootBowEvent; +import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.util.BlockIterator; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; public class Sharpshooter extends Skill { + private WeakHashMap _missedCount = new WeakHashMap(); private WeakHashMap _hitCount = new WeakHashMap(); - private HashMap _arrows = new HashMap(); + private HashMap _arrows = new HashMap(); public Sharpshooter(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels) { @@ -53,9 +59,15 @@ public class Sharpshooter extends Skill int level = getLevel((Player)event.getEntity()); if (level == 0) return; - + + if (!(event.getProjectile() instanceof Arrow)) + { + System.out.println(GetName() + " : " + event.getEntity().getName() + " shot bow but resulting projectile was now Arrow?!?!?!?"); + return; + } + //Store - _arrows.put(event.getProjectile(), (Player)event.getEntity()); + _arrows.put((Arrow) event.getProjectile(), (Player)event.getEntity()); } @EventHandler(priority = EventPriority.HIGH) @@ -98,9 +110,46 @@ public class Sharpshooter extends Skill projectile.remove(); + _missedCount.remove(player); + Recharge.Instance.useForce(player, GetName() + " Timer", 5000); } + @EventHandler + public void missReset(ProjectileHitEvent event) + { + final Projectile projectile = event.getEntity(); + Factory.runSyncLater(() -> { + if (!projectile.isDead() && _arrows.containsKey(projectile)) + { + Player shooter = (Player) projectile.getShooter(); + + if (!_hitCount.containsKey(shooter)) + { + return; + } + + if (!_missedCount.containsKey(shooter)) + { + _missedCount.put(shooter, Integer.valueOf(1)); + } + else + { + _missedCount.put(shooter, Integer.valueOf(_missedCount.get(shooter).intValue() + 1)); + + // Reset + if (_missedCount.get(shooter).intValue() >= 2) + { + _hitCount.remove(shooter); + _missedCount.remove(shooter); + UtilPlayer.message(shooter, F.main(GetClassType().name(), GetName() + " : " + F.elem("Damage Bonus Reset"))); + shooter.playSound(shooter.getLocation(), Sound.NOTE_PLING, 1f, 0.75f); + } + } + } + }, 3l); + } + @EventHandler public void resetViaTime(UpdateEvent event) { @@ -148,5 +197,6 @@ public class Sharpshooter extends Skill public void Reset(Player player) { _hitCount.remove(player); + _missedCount.remove(player); } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java index db7e4e34c..310146f5a 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java @@ -1,28 +1,26 @@ package mineplex.minecraft.game.classcombat.Skill.Ranger; import java.util.HashMap; +import java.util.Iterator; +import java.util.Map.Entry; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; -import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.updater.UpdateType; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilParticle.ParticleType; -import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; public class VitalitySpores extends Skill { - private HashMap _lastMove = new HashMap(); + private HashMap _lastDamage = new HashMap<>(); public VitalitySpores(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels) { @@ -30,47 +28,52 @@ public class VitalitySpores extends Skill SetDesc(new String[] { - "While standing still, forest spores", - "heal you for #0#0.5 health per 2 seconds." + "After getting hit, if no damage is taken", + "for 10 Seconds then you will receive", + "Regeneration #2#0 for #5#1 Seconds", }); } @EventHandler - public void playerMove(PlayerMoveEvent event) + public void damage(CustomDamageEvent event) { - if (doesUserHaveSkill(event.getPlayer()) && UtilMath.offset(event.getFrom(), event.getTo()) > 0) - _lastMove.put(event.getPlayer(), System.currentTimeMillis()); + if (doesUserHaveSkill(event.GetDamageePlayer())) + { + if (event.GetDamageePlayer().hasPotionEffect(PotionEffectType.REGENERATION)) + { + event.GetDamageePlayer().removePotionEffect(PotionEffectType.REGENERATION); + } + else + { + _lastDamage.put(event.GetDamageePlayer(), Long.valueOf(System.currentTimeMillis())); + } + } } @EventHandler public void update(UpdateEvent event) { if (event.getType() != UpdateType.TICK) + { return; - - for (Player cur : GetUsers()) - { - int level = getLevel(cur); - if (level == 0) continue; - - if (!_lastMove.containsKey(cur)) - continue; - - if (UtilTime.elapsed(_lastMove.get(cur), 2000)) + } + + Iterator> iterator = _lastDamage.entrySet().iterator(); + while (iterator.hasNext()) + { + Entry entry = iterator.next(); + + if (UtilTime.elapsed(entry.getValue().longValue(), 10000)) { - UtilPlayer.health(cur, 0.5 * level); - - UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation().add(UtilAlg.getBehind(cur.getLocation().getDirection().multiply(0.5))), 0, 0.2f, 0, 0, 1, - ViewDist.LONG, UtilServer.getPlayers()); - - _lastMove.put(cur, System.currentTimeMillis()); - } + iterator.remove(); + entry.getKey().addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, (20 * (5 + getLevel(entry.getKey()))), 1)); + } } } @Override public void Reset(Player player) { - _lastMove.remove(player); + _lastDamage.remove(player); } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java index 51e412beb..195ff7a27 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java @@ -45,7 +45,7 @@ public class WolfsPounce extends SkillChargeSword "Taking damage cancels charge.", "", "Colliding with another player", - "mid-air deals up to #4#1 damage", + "mid-air deals up to #2#1 damage", "and Slow 2 for 3 seconds." }); @@ -128,7 +128,7 @@ public class WolfsPounce extends SkillChargeSword if (_chargeStore.containsKey(damager)) charge = _chargeStore.remove(damager); - int damage = (int)((4 + getLevel(damager)) * charge); + int damage = (int)((2 + getLevel(damager)) * charge); //Damage Event Factory.Damage().NewDamageEvent(damagee, damager, null, diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java index 7fd52db63..8bc9f565b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java @@ -221,10 +221,6 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory AddSkill(new Fitness(this, "Mana Pool", ClassType.Mage, SkillType.GlobalPassive, 1, 3)); AddSkill(new Recharge(this, "Mana Regeneration", ClassType.Mage, SkillType.GlobalPassive, 1, 3)); - AddSkill(new Fitness(this, "Fitness", ClassType.Assassin, SkillType.GlobalPassive, 1, 3)); - AddSkill(new Recharge(this, "Rest", ClassType.Assassin, SkillType.GlobalPassive, 1, 3)); - - //AddSkill(new Stamina(this, "Stamina", ClassType.Global, SkillType.GlobalPassive, 1, 1)); //AddSkill(new Swim(this, "Swim", ClassType.Global, SkillType.GlobalPassive, 1, 1)); } @@ -235,9 +231,9 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory //Sword AddSkill(new Evade(this, "Evade", ClassType.Assassin, SkillType.Sword, - 1, 4, + 2, 1, 0, 0, - 6500, -500, true, + 2500, -500, true, new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD}, new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); @@ -337,7 +333,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory AddSkill(new Takedown(this, "Takedown", ClassType.Brute, SkillType.Axe, 1, 5, 0, 0, - 21000, -1000, true, + 17000, -1000, true, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); @@ -374,7 +370,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory AddSkill(new Riposte(this, "Riposte", ClassType.Knight, SkillType.Sword, 1, 5, 0, 0, - 11000, -1000, false, + 15000, -1000, false, new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD}, new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); @@ -411,7 +407,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory AddSkill(new AxeThrow(this, "Roped Axe Throw", ClassType.Knight, SkillType.Axe, 1, 5, 0, 0, - 3300, -300, true, + 4300, -300, true, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/Condition.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/Condition.java index b84ac5cd0..8109e3ef2 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/Condition.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/Condition.java @@ -72,7 +72,9 @@ public class Condition protected boolean _add = false; protected boolean _live = false; - + + protected boolean _cancelPotion; + protected boolean _showIndicator = true; public Condition(ConditionManager manager, String reason, LivingEntity ent, LivingEntity source, @@ -101,6 +103,35 @@ public class Condition //Live if NOT Additive _live = !add; } + + public Condition(ConditionManager manager, String reason, LivingEntity ent, LivingEntity source, + ConditionType type, int mult, int ticks, boolean add, Material visualType, byte visualData, boolean showIndicator, boolean ambient, boolean cancelPotion) + { + Manager = manager; + _time = System.currentTimeMillis(); + + _reason = reason; + + _ent = ent; + _source = source; + + _type = type; + _mult = mult; + _ticks = ticks; + _ticksTotal = ticks; + _ambient = ambient; + + _indicatorType = visualType; + _indicatorData = visualData; + _showIndicator = showIndicator; + + _cancelPotion = cancelPotion; + + _add = add; + + //Live if NOT Additive + _live = !add; + } public boolean Tick() { @@ -124,6 +155,11 @@ public class Condition public void Add() { + if (_cancelPotion) + { + return; + } + try { PotionEffectType type = PotionEffectType.getByName(_type.toString()); diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/ConditionFactory.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/ConditionFactory.java index e6fac9836..fcfa571e1 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/ConditionFactory.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/ConditionFactory.java @@ -239,10 +239,16 @@ public class ConditionFactory public Condition Poison(String reason, LivingEntity ent, LivingEntity source, double duration, int mult, boolean extend, boolean showIndicator, boolean ambient) + { + return Poison(reason, ent, source, duration, mult, extend, showIndicator, ambient, false); + } + + public Condition Poison(String reason, LivingEntity ent, LivingEntity source, + double duration, int mult, boolean extend, boolean showIndicator, boolean ambient, boolean cancelPotion) { return Manager.AddCondition(new Condition(Manager, reason, ent, source, ConditionType.POISON, mult, (int)(20 * duration), extend, - Material.SLIME_BALL, (byte)14, showIndicator, ambient)); + Material.SLIME_BALL, (byte)14, showIndicator, ambient, cancelPotion)); } public Condition PoisonShock(String reason, LivingEntity ent, LivingEntity source, diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index bcd04629c..8d5435b32 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -2,10 +2,12 @@ package nautilus.game.arcade.game; import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; + import mineplex.core.common.util.*; import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.elo.EloPlayer; import mineplex.core.elo.EloTeam; +import mineplex.core.gadget.types.GadgetType; import mineplex.core.itemstack.ItemBuilder; import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.PacketInfo; @@ -34,6 +36,7 @@ import nautilus.game.arcade.world.WorldData; import net.minecraft.server.v1_8_R3.EntityItem; import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity; import net.minecraft.server.v1_8_R3.WorldServer; + import org.bukkit.*; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -1649,6 +1652,18 @@ public abstract class Game implements Listener // End SetState(GameState.End); } + + @EventHandler + public void disableParticles(GameStateChangeEvent event) + { + if (event.GetState() == GameState.Prepare && Manager.getCosmeticManager().getGadgetManager().hideParticles()) + { + for (Player player : GetPlayers(false)) + { + getArcadeManager().getCosmeticManager().getGadgetManager().removeGadgetType(player, GadgetType.PARTICLE); + } + } + } @EventHandler public void onGameStart(GameStateChangeEvent event) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsCTF.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsCTF.java index fbe9a5428..32855df7d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsCTF.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsCTF.java @@ -1,9 +1,7 @@ package nautilus.game.arcade.game.games.champions; import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilPlayer; -import mineplex.core.inventory.data.Item; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.combat.DeathMessageType; @@ -28,7 +26,6 @@ import nautilus.game.arcade.stats.SpecialWinStatTracker; import nautilus.game.arcade.stats.TheLongestShotStatTracker; import org.bukkit.Location; -import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java index f8583deec..52763c8a3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java @@ -16,7 +16,6 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage; import nautilus.game.arcade.game.games.champions.kits.KitRanger; import nautilus.game.arcade.game.games.common.Domination; import nautilus.game.arcade.kit.Kit; -import nautilus.game.arcade.managers.chat.ChatStatData; import nautilus.game.arcade.stats.ElectrocutionStatTracker; import nautilus.game.arcade.stats.KillReasonStatTracker; import nautilus.game.arcade.stats.SeismicSlamStatTracker; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java index 3f6441659..8baa4a01c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java @@ -16,7 +16,6 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage; import nautilus.game.arcade.game.games.champions.kits.KitRanger; import nautilus.game.arcade.game.games.common.TeamDeathmatch; import nautilus.game.arcade.kit.Kit; -import nautilus.game.arcade.managers.chat.ChatStatData; import nautilus.game.arcade.stats.ElectrocutionStatTracker; import nautilus.game.arcade.stats.KillAllOpposingStatTracker; import nautilus.game.arcade.stats.KillReasonStatTracker; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java index 55535e846..c21d4e824 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java @@ -4,6 +4,15 @@ import mineplex.core.common.util.*; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTime; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.PacketInfo; @@ -311,13 +320,14 @@ public class HideSeek extends TeamGame { if (event.GetState() == GameState.Prepare) { + System.out.println("prep"); this.getArcadeManager().getPacketHandler().addPacketHandler(_blockDisguise, PacketPlayOutSpawnEntityLiving.class, PacketPlayOutEntityDestroy.class); this.getArcadeManager().getPacketHandler().addPacketHandler(_useEntity, true, PacketPlayInUseEntity.class); } else if (event.GetState() == GameState.Dead) { - this.getArcadeManager().getPacketHandler().removePacketHandler(_blockDisguise); - this.getArcadeManager().getPacketHandler().removePacketHandler(_useEntity); + this.getArcadeManager().getPacketHandler().removePacketHandler(_blockDisguise); + this.getArcadeManager().getPacketHandler().removePacketHandler(_useEntity); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java index 6ab2f5018..18a6494aa 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.game.games.wizards; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -51,11 +50,11 @@ import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClick; import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClickBlock; import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClickEntity; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.managers.chat.ChatStatData; import net.minecraft.server.v1_8_R3.EntityFireball; import net.minecraft.server.v1_8_R3.PacketPlayOutSetSlot; import net.minecraft.server.v1_8_R3.PacketPlayOutWindowItems; -import nautilus.game.arcade.managers.chat.ChatStatData; import org.apache.commons.lang.IllegalClassException; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -736,7 +735,7 @@ public class Wizards extends SoloGame done++; } } - + private void displayProgress(String progressColor, String prefix, double amount, String suffix, Player... players) { // Generate Bar @@ -863,7 +862,7 @@ public class Wizards extends SoloGame return items; } - + private void dropSpells(Player player) { HashSet spells = new HashSet(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index c00b8f81d..c4ef3eaf9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -720,7 +720,7 @@ public class GameFlagManager implements Listener player.removePotionEffect(potion.getType()); //Visual - Manager.GetCondition().Factory().Blind("Ghost", player, player, 2.5, 0, false, false, false); +// Manager.GetCondition().Factory().Blind("Ghost", player, player, 2.5, 0, false, false, false); player.setFireTicks(0); player.setFallDistance(0);