package com.elmakers.mine.bukkit.plugins.magic.spells;

import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;

import com.elmakers.mine.bukkit.plugins.magic.Spell;
import com.elmakers.mine.bukkit.plugins.magic.SpellResult;
import com.elmakers.mine.bukkit.plugins.magic.Target;
import com.elmakers.mine.bukkit.utilities.borrowed.ConfigurationNode;

public class HealSpell extends Spell 
{
	@Override
	public SpellResult onCast(ConfigurationNode parameters) 
	{
		Target target = getTarget();
		Entity targetEntity = target.getEntity();
		if (targetEntity != null && targetEntity instanceof LivingEntity)
		{
			castMessage("You heal your target");
			((LivingEntity)targetEntity).setHealth(20);
			return SpellResult.SUCCESS;    
		}
		castMessage("You heal yourself");
		player.setHealth(20);
		player.setExhaustion(0);
		player.setFoodLevel(20);
		return SpellResult.SUCCESS;
	}
}

@@ -49,16 +49,44 @@
 pells;%0A%0A
+import org.bukkit.Location;%0A
 import o
@@ -148,16 +148,80 @@
 gEntity;
+%0Aimport org.bukkit.entity.Player;%0Aimport org.bukkit.util.Vector;
 %0A%0Aimport
@@ -380,16 +380,125 @@
 Target;%0A
+import com.elmakers.mine.bukkit.utilities.EffectRing;%0Aimport com.elmakers.mine.bukkit.utilities.EffectTrail;%0A
 import c
@@ -819,16 +819,363 @@
 ty)%0A%09%09%7B%0A
+%09%09%09Location effectLocation = player.getEyeLocation();%0A%09%09%09Vector effectDirection = effectLocation.getDirection();%0A%09%09%09EffectTrail effect = new EffectTrail(spells.getPlugin(), effectLocation, effectDirection, 32);%0A%09%09%09effect.setEffectName(%22heart%22);%0A%09%09%09effect.setParticleCount(2);%0A%09%09%09effect.setEffectSpeed(2);%0A%09%09%09effect.setSpeed(3);%0A%09%09%09effect.start();%0A
 %09%09%09castM
@@ -1209,17 +1209,34 @@
 t%22);%0A%09%09%09
-(
+LivingEntity li = 
 (LivingE
@@ -1253,17 +1253,23 @@
 etEntity
-)
+;%0A%09%09%09li
 .setHeal
@@ -1275,51 +1275,465 @@
 lth(
-20);%0A%09%09%09return SpellResult.SUCCESS;    %0A%09%09%7D
+li.getMaxHealth());%0A%09%09%09if (targetEntity instanceof Player) %7B%0A%09%09%09%09Player p = (Player)targetEntity;%0A%09%09%09%09p.setExhaustion(0);%0A%09%09%09%09p.setFoodLevel(20);%0A%09%09%09%7D%0A%09%09%09return SpellResult.SUCCESS;    %0A%09%09%7D%0A%09%09Location effectLocation = player.getEyeLocation();%0A%09%09EffectRing effect = new EffectRing(spells.getPlugin(), effectLocation, 4, 8);%0A%09%09effect.setEffectName(%22heart%22);%0A%09%09effect.setParticleCount(1);%0A%09%09effect.setEffectSpeed(2);%0A%09%09effect.setInvert(true);%0A%09%09effect.start();
 %0A%09%09c
@@ -1784,18 +1784,37 @@
 tHealth(
-20
+player.getMaxHealth()
 );%0A%09%09pla

Add particle effects to the heal spell.