@Override public void removeFromMonster(Monster monster) { super.removeFromMonster(monster); LivingEntity entity = monster.getEntity(); removeBlocks(entity, entity.getType().toString()); if (this.damage > 0) { Skill.damageEntity( monster.getEntity(), this.usedBy, (int) this.damage, DamageCause.MAGIC, false); } }
public void slowdamage(Location nxt, Hero fhero) { for (LivingEntity target : getNearbyLivingEntities(nxt, 3)) { if (!targets.contains(target.getEntityId())) { if (Skill.damageCheck(fhero.getPlayer(), target)) { Skill.damageEntity( target, fhero.getPlayer(), 10, EntityDamageEvent.DamageCause.MAGIC, false); if (target instanceof Player) { plugin .getCharacterManager() .getHero((Player) target) .addEffect( new com.herocraftonline.heroes.characters.effects.common.SlowEffect( this, 1500, 2, false, null, null, fhero)); } } } } }
@Override public void removeFromHero(Hero hero) { super.removeFromHero(hero); Player player = hero.getPlayer(); removeBlocks(player, player.getName()); if (this.damage > 0) { Skill.damageEntity( hero.getPlayer(), this.usedBy, (int) this.damage, DamageCause.MAGIC, false); } }