diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/SmashSpider.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/SmashSpider.java index 71833fcb6..9a52fd00f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/SmashSpider.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/SmashSpider.java @@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.smash.perks.spider; import java.util.HashMap; import java.util.Map; +import org.bukkit.Bukkit; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.entity.LivingEntity; @@ -10,6 +11,9 @@ 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.event.entity.EntityRegainHealthEvent; + +import com.sun.xml.internal.fastinfoset.algorithm.HexadecimalEncodingAlgorithm; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilParticle; @@ -64,7 +68,7 @@ public class SmashSpider extends SmashUltimate } // Regen - Manager.GetCondition().Factory().Regen(GetName(), player, player, DURATION / 1000, 0, false, false, false); + Manager.GetCondition().Factory().Regen(GetName(), player, player, DURATION / 1000, 2, false, false, false); } @EventHandler(priority = EventPriority.HIGH) @@ -140,7 +144,6 @@ public class SmashSpider extends SmashUltimate } damager.setMaxHealth(Math.min(30, damager.getMaxHealth() + diff)); - damager.setHealth(Math.min(damagee.getMaxHealth(), damager.getHealth() + diff)); UtilParticle.PlayParticle(ParticleType.HEART, damager.getLocation().add(0, 1, 0), 0, 0, 0, 0, 1, ViewDist.LONG, UtilServer.getPlayers()); @@ -151,4 +154,19 @@ public class SmashSpider extends SmashUltimate damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1.5f, 1f); } } + + @EventHandler(priority = EventPriority.HIGHEST) + public void onRegen(EntityRegainHealthEvent event) + { + if(!(event.getEntity() instanceof Player)) return; + + Player p = (Player) event.getEntity(); + + if(!hasPerk(p)) + { + return; + } + + Bukkit.broadcastMessage("Regen: " + p.getName() + " - " + event.getRegainReason().name() + " - " + event.getAmount() + " " + event.isCancelled()); + } }