예제 #1
0
        /// <summary>Duel target type</summary>
        /// <param name="targets"></param>
        /// <param name="target"></param>
        /// <param name="failedReason"></param>
        public static void IsHostileOrHealable(SpellEffectHandler effectHandler, WorldObject target,
                                               ref SpellFailedReason failedReason)
        {
            WorldObject casterObject      = effectHandler.Cast.CasterObject;
            Spell       spell             = effectHandler.Cast.Spell;
            bool        hasHarmfulEffects = spell.HasHarmfulEffects;

            if (spell.HasHarmfulEffects == spell.HasBeneficialEffects)
            {
                return;
            }
            if (hasHarmfulEffects != casterObject.MayAttack((IFactionMember)target))
            {
                if (hasHarmfulEffects)
                {
                    failedReason = SpellFailedReason.TargetFriendly;
                }
                else
                {
                    failedReason = SpellFailedReason.TargetEnemy;
                }
            }
            else
            {
                if (!hasHarmfulEffects || target.CanBeHarmed)
                {
                    return;
                }
                failedReason = SpellFailedReason.NotHere;
            }
        }
예제 #2
0
파일: Buff.cs 프로젝트: Mixi59/Stump
        protected Buff(int id, FightActor target, FightActor caster, SpellEffectHandler effectHandler, Spell spell, bool critical, FightDispellableEnum dispelable, FightActor triggerer = null)
        {
            Id            = id;
            Target        = target;
            Caster        = caster;
            EffectHandler = effectHandler;
            Spell         = spell;
            Critical      = critical;

            Duration    = triggerer != null && EffectFix?.TriggerBuffDuration != null ? (short)EffectFix.TriggerBuffDuration : (short)(EffectHandler.Duration == -1 ? -1000 : Effect.Duration);
            Dispellable = EffectFix?.Dispellable != null ? (FightDispellableEnum)EffectFix.Dispellable : dispelable;

            Delay          = (short)EffectHandler.Delay;
            CustomActionId = (short?)EffectFix?.ActionId;

            Efficiency = 1.0d;

            if (triggerer == null && effectHandler.CastHandler?.Informations.Triggerer != null)
            {
                triggerer = effectHandler.CastHandler.Informations.Triggerer;
            }

            BuffTriggered      = triggerer != null;
            DecrementReference = triggerer ?? Caster;
        }
예제 #3
0
 public static void IsFriendly(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
 {
     if (effectHandler.Cast.CasterObject.MayAttack(target))
     {
         failedReason = SpellFailedReason.TargetEnemy;
     }
 }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 public static void IsVisible(SpellEffectHandler effectHandler, WorldObject target,
                              ref SpellFailedReason failedReason)
 {
     failedReason = effectHandler.Cast.CasterUnit.CanSee(target)
         ? SpellFailedReason.Ok
         : SpellFailedReason.BmOrInvisgod;
 }
예제 #5
0
        /// <summary>
        /// Duel target type
        /// </summary>
        /// <param name="targets"></param>
        /// <param name="target"></param>
        /// <param name="failedReason"></param>
        public static void IsHostileOrHealable(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
        {
            var caster    = effectHandler.Cast.CasterObject;
            var spell     = effectHandler.Cast.Spell;
            var isHarmful = spell.HasHarmfulEffects;
            var isHarmfulAndBeneficial = spell.HasHarmfulEffects == spell.HasBeneficialEffects;

            if (!isHarmfulAndBeneficial)
            {
                if (isHarmful != caster.MayAttack(target))
                {
                    if (isHarmful)
                    {
                        failedReason = SpellFailedReason.TargetFriendly;
                    }
                    else
                    {
                        failedReason = SpellFailedReason.TargetEnemy;
                    }
                }
                else if (isHarmful && !target.CanBeHarmed)
                {
                    failedReason = SpellFailedReason.NotHere;
                }
            }
        }
예제 #6
0
		/// <summary>
		/// Duel target type
		/// </summary>
		/// <param name="targets"></param>
		/// <param name="target"></param>
		/// <param name="failedReason"></param>
		public static void IsHostileOrHealable(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			var caster = effectHandler.Cast.CasterObject;
			var spell = effectHandler.Cast.Spell;
			var isHarmful = spell.HasHarmfulEffects;
			var isHarmfulAndBeneficial = spell.HasHarmfulEffects == spell.HasBeneficialEffects;

			if (!isHarmfulAndBeneficial)
			{
				if (isHarmful != caster.MayAttack(target))
				{
					if (isHarmful)
					{
						failedReason = SpellFailedReason.TargetFriendly;
					}
					else
					{
						failedReason = SpellFailedReason.TargetEnemy;
					}
				}
				else if (isHarmful && !target.CanBeHarmed)
				{
					failedReason = SpellFailedReason.NotHere;
				}
			}
		}
예제 #7
0
		public static void IsFriendly(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			if (effectHandler.Cast.CasterObject.MayAttack(target))
			{
				failedReason = SpellFailedReason.TargetEnemy;
			}
		}
예제 #8
0
        public void AddSpellEffectHandler(SpellEffectHandler handler)
        {
            var type = handler.GetType();

            if (type.GetCustomAttribute <DefaultEffectHandlerAttribute>() != null)
            {
                throw new Exception("Default handler cannot be added");
            }

            var attributes = type.GetCustomAttributes <EffectHandlerAttribute>().ToArray();

            if (attributes.Length == 0)
            {
                throw new Exception(string.Format("EffectHandler '{0}' has no EffectHandlerAttribute", type.Name));
            }

            var ctor = type.GetConstructor(new[] { typeof(EffectDice), typeof(FightActor), typeof(SpellCastHandler), typeof(Cell), typeof(bool) });

            if (ctor == null)
            {
                throw new Exception("No valid constructors found !");
            }

            foreach (var effect in attributes.Select(entry => entry.Effect))
            {
                m_spellsEffectHandler.Add(effect, ctor.CreateDelegate <SpellEffectConstructor>());

                if (!m_effectsHandlers.ContainsKey(effect))
                {
                    m_effectsHandlers.Add(effect, new List <Type>());
                }

                m_effectsHandlers[effect].Add(type);
            }
        }
예제 #9
0
		public static void IsSameClass(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			var caster = effectHandler.Cast.CasterUnit;
			if (caster == null || !(target is Unit) || caster.Class != ((Unit)target).Class)
			{
				failedReason = SpellFailedReason.BadTargets;
			}
		}
예제 #10
0
 public static void IsSamePartyAndClass(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
 {
     IsAllied(effectHandler, target, ref failedReason);
     if (failedReason == SpellFailedReason.Ok)
     {
         IsSameClass(effectHandler, target, ref failedReason);
     }
 }
예제 #11
0
 public static void IsAllied(SpellEffectHandler effectHandler, WorldObject target,
                             ref SpellFailedReason failedReason)
 {
     if (effectHandler.Cast.CasterObject.IsAlliedWith((IFactionMember)target))
     {
         return;
     }
     failedReason = SpellFailedReason.TargetNotInParty;
 }
예제 #12
0
        public static void IsSameClass(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
        {
            var caster = effectHandler.Cast.CasterUnit;

            if (caster == null || !(target is Unit) || caster.Class != ((Unit)target).Class)
            {
                failedReason = SpellFailedReason.BadTargets;
            }
        }
예제 #13
0
 public static void IsFriendly(SpellEffectHandler effectHandler, WorldObject target,
                               ref SpellFailedReason failedReason)
 {
     if (!effectHandler.Cast.CasterObject.MayAttack((IFactionMember)target))
     {
         return;
     }
     failedReason = SpellFailedReason.TargetEnemy;
 }
예제 #14
0
        public override bool IsTargetValid(FightActor actor, SpellEffectHandler handler)
        {
            if (Caster)
            {
                return(Required ? handler.Caster.HasState(State) : !handler.Caster.HasState(State));
            }

            return(Required ? actor.HasState(State) : !actor.HasState(State));
        }
예제 #15
0
        /// <summary>
        /// AI heal spells.
        /// This evaluator demonstrates how to losen constraints - i.e. don't go for the best choice, but go for anyone that satisfies some condition.
        /// </summary>
        public static int AnyWoundedEvaluator(SpellEffectHandler effectHandler, WorldObject target)
        {
            if (!(target is Unit))
            {
                return(int.MaxValue);
            }
            Unit unit = (Unit)target;

            return(unit.MaxHealth - unit.Health >= effectHandler.CalcDamageValue() / 2 ? -1 : 0);
        }
예제 #16
0
        /// <summary>AI heal spells</summary>
        public static int MostWoundedEvaluator(SpellEffectHandler effectHandler, WorldObject target)
        {
            if (!(target is Unit))
            {
                return(int.MaxValue);
            }
            Unit unit = (Unit)target;

            return(-Math.Min(unit.MaxHealth - unit.Health, effectHandler.CalcDamageValue()));
        }
예제 #17
0
 public static void IsSamePartyAndClass(SpellEffectHandler effectHandler, WorldObject target,
                                        ref SpellFailedReason failedReason)
 {
     DefaultTargetFilters.IsAllied(effectHandler, target, ref failedReason);
     if (failedReason != SpellFailedReason.Ok)
     {
         return;
     }
     DefaultTargetFilters.IsSameClass(effectHandler, target, ref failedReason);
 }
예제 #18
0
        public TriggerBuff(int id, FightActor target, FightActor caster, SpellEffectHandler effect, Spell spell, Spell parentSpell, bool critical, FightDispellableEnum dispelable, int priority,
                           TriggerBuffApplyHandler applyTrigger, TriggerBuffRemoveHandler removeTrigger = null)
            : base(id, target, caster, effect, spell, critical, dispelable)
        {
            ParentSpell   = parentSpell;
            ApplyTrigger  = applyTrigger;
            RemoveTrigger = removeTrigger;

            Triggers = Effect.Triggers.Split('|').Select(GetTriggerFromString).ToList();
        }
예제 #19
0
        /// <summary>
        ///
        /// </summary>
        public static int NearestEvaluator(SpellEffectHandler effectHandler, WorldObject target)
        {
            WorldObject casterObject = effectHandler.Cast.CasterObject;

            if (casterObject == null)
            {
                return(0);
            }
            return((int)(casterObject.GetDistanceSq(target) * 10.0));
        }
예제 #20
0
        public static void IsSameClass(SpellEffectHandler effectHandler, WorldObject target,
                                       ref SpellFailedReason failedReason)
        {
            Unit casterUnit = effectHandler.Cast.CasterUnit;

            if (casterUnit != null && target is Unit && casterUnit.Class == ((Unit)target).Class)
            {
                return;
            }
            failedReason = SpellFailedReason.BadTargets;
        }
예제 #21
0
		public static void IsHostile(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			var caster = effectHandler.Cast.CasterObject;
			if (!caster.MayAttack(target))
			{
				failedReason = SpellFailedReason.TargetFriendly;
			}
			else if (!target.CanBeHarmed)
			{
				failedReason = SpellFailedReason.NotHere;
			}
		}
예제 #22
0
		/// <summary>
		/// 
		/// </summary>
		public static int NearestEvaluator(SpellEffectHandler effectHandler, WorldObject target)
		{
			var caster = effectHandler.Cast.CasterObject;
			if (caster == null)
			{
				// no one is near or close
				return 0;
			}

			// the less the squared distance, the closer the target
			// less means better in evaluators
			return (int)(caster.GetDistanceSq(target) * 10);	// round the float to one digit after the dot
		}
예제 #23
0
        public static void IsHostile(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
        {
            var caster = effectHandler.Cast.CasterObject;

            if (!caster.MayAttack(target))
            {
                failedReason = SpellFailedReason.TargetFriendly;
            }
            else if (!target.CanBeHarmed)
            {
                failedReason = SpellFailedReason.NotHere;
            }
        }
예제 #24
0
        public static void IsInFrontOfCaster(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason, TargetFilter filter)
        {
            var caster = effectHandler.Cast.CasterObject;

            if (caster.IsPlayer && !target.IsInFrontOf(caster))
            {
                failedReason = SpellFailedReason.NotInfront;
            }
            else
            {
                filter(effectHandler, target, ref failedReason);
            }
        }
예제 #25
0
        /// <summary>
        /// AI heal spells
        /// </summary>
        public static int MostWoundedEvaluator(SpellEffectHandler effectHandler, WorldObject target)
        {
            if (target is Unit)
            {
                // try to select the most wounded
                var unit          = (Unit)target;
                var missingHealth = unit.MaxHealth - unit.Health;

                // cap at the max that the spell can heal
                // else weaker creatures might never get healed, simply because they can't lose as much health
                return(-Math.Min(missingHealth, effectHandler.CalcDamageValue()));
            }
            return(int.MaxValue);
        }
예제 #26
0
        /// <summary>
        ///
        /// </summary>
        public static int NearestEvaluator(SpellEffectHandler effectHandler, WorldObject target)
        {
            var caster = effectHandler.Cast.CasterObject;

            if (caster == null)
            {
                // no one is near or close
                return(0);
            }

            // the less the squared distance, the closer the target
            // less means better in evaluators
            return((int)(caster.GetDistanceSq(target) * 10));                   // round the float to one digit after the dot
        }
예제 #27
0
		/// <summary>
		/// AI heal spells
		/// </summary>
		public static int MostWoundedEvaluator(SpellEffectHandler effectHandler, WorldObject target)
		{
			if (target is Unit)
			{
				// try to select the most wounded
				var unit = (Unit)target;
				var missingHealth = unit.MaxHealth - unit.Health;

				// cap at the max that the spell can heal
				// else weaker creatures might never get healed, simply because they can't lose as much health
				return -Math.Min(missingHealth, effectHandler.CalcDamageValue());
			}
			return int.MaxValue;
		}
예제 #28
0
        /// <summary>
        /// Only select targets that have at least half of what the effect can heal
        /// </summary>
        public static void IsWoundedEnough(SpellEffectHandler effectHandler, WorldObject target,
                                           ref SpellFailedReason failedReason)
        {
            if (target is Unit)
            {
                Unit unit = (Unit)target;
                if (unit.MaxHealth - unit.Health >= effectHandler.CalcDamageValue() / 2)
                {
                    return;
                }
            }

            failedReason = SpellFailedReason.AlreadyAtFullHealth;
        }
예제 #29
0
 public static void IsAllied(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
 {
     //if (targets.Cast.Caster is Character && target is Character)
     //{
     //    var caster = (Character)targets.Cast.Caster;
     //    if (!caster.IsAlliedWith(target))
     //    {
     //        failedReason = SpellFailedReason.TargetNotInParty;
     //    }
     //}
     if (!effectHandler.Cast.CasterObject.IsAlliedWith(target))
     {
         failedReason = SpellFailedReason.TargetNotInParty;
     }
 }
예제 #30
0
		public static void IsAllied(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			//if (targets.Cast.Caster is Character && target is Character)
			//{
			//    var caster = (Character)targets.Cast.Caster;
			//    if (!caster.IsAlliedWith(target))
			//    {
			//        failedReason = SpellFailedReason.TargetNotInParty;
			//    }
			//}
			if (!effectHandler.Cast.CasterObject.IsAlliedWith(target))
			{
				failedReason = SpellFailedReason.TargetNotInParty;
			}
		}
예제 #31
0
 public static void IsHostile(SpellEffectHandler effectHandler, WorldObject target,
                              ref SpellFailedReason failedReason)
 {
     if (!effectHandler.Cast.CasterObject.MayAttack((IFactionMember)target))
     {
         failedReason = SpellFailedReason.TargetFriendly;
     }
     else
     {
         if (target.CanBeHarmed)
         {
             return;
         }
         failedReason = SpellFailedReason.NotHere;
     }
 }
예제 #32
0
        public override bool IsTargetValid(FightActor actor, SpellEffectHandler handler)
        {
            if (Caster)
            {
                actor = handler.Caster;
            }

            if (actor is CharacterFighter)
            {
                return(Required ? (int)((CharacterFighter)actor).Character.BreedId == Breed : (int)((CharacterFighter)actor).Character.BreedId != Breed);
            }
            else
            {
                return(Required ? (int)BreedEnum.MONSTER == Breed : (int)BreedEnum.MONSTER != Breed);
            }
        }
예제 #33
0
        /// <summary>
        /// Is caster behind target?
        /// </summary>
        public static void IsCasterBehind(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
        {
            var caster = effectHandler.Cast.CasterObject;

            if (!caster.IsBehind(target))
            {
                failedReason = SpellFailedReason.NotBehind;
            }
            else
            {
                var harmful = effectHandler.Cast.Spell.HasHarmfulEffects;
                if (harmful != caster.MayAttack(target))
                {
                    failedReason = harmful ? SpellFailedReason.TargetFriendly : SpellFailedReason.TargetEnemy;
                }
            }
        }
예제 #34
0
 public override void Execute()
 {
     if (!this.m_initialized)
     {
         this.Initialize();
     }
     SpellEffectHandler[] handlers = this.Handlers;
     for (int i = 0; i < handlers.Length; i++)
     {
         SpellEffectHandler spellEffectHandler = handlers[i];
         if (spellEffectHandler is DefaultSpellEffect && (int)spellEffectHandler.Effect.EffectId != 1160)
         {
             string dump = string.Format("{0}[{1}] : EffectId = {2} ; Target = {3} ; AffectedCells = {4} \n", this.Spell.Template.Name, i, spellEffectHandler.Effect.EffectId, spellEffectHandler.Targets.ToString(), string.Join("/", spellEffectHandler.AffectedCells.Select(x => x.Id)));
             System.IO.File.AppendAllText("spell_effects.txt", dump);
         }
         spellEffectHandler.Apply();
     }
 }
예제 #35
0
        /// <summary>
        /// Only select targets that have at least half of what the effect can heal
        /// </summary>
        public static void IsWoundedEnough(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
        {
            if (target is Unit)
            {
                // useful heal spell: Amount to be healed is greater or equal half of what the spell can heal
                // Select anyone with that problem
                var unit          = (Unit)target;
                var missingHealth = unit.MaxHealth - unit.Health;
                if (missingHealth >= effectHandler.CalcDamageValue() / 2)
                {
                    // good choice
                    return;
                }
            }

            // not wounded or not wounded enough
            failedReason = SpellFailedReason.AlreadyAtFullHealth;
        }
예제 #36
0
		/// <summary>
		/// AI heal spells.
		/// This evaluator demonstrates how to losen constraints - i.e. don't go for the best choice, but go for anyone that satisfies some condition.
		/// </summary>
		public static int AnyWoundedEvaluator(SpellEffectHandler effectHandler, WorldObject target)
		{
			if (target is Unit)
			{
				// useful heal spell: Amount to be healed is greater or equal half of what the spell can heal
				// Select anyone with that problem
				var unit = (Unit)target;
				var missingHealth = unit.MaxHealth - unit.Health;
				if (missingHealth >= effectHandler.CalcDamageValue() / 2)
				{
					// good choice
					return -1;
				}
				// not so good choice
				return 0;
			}
			// should never happen
			return int.MaxValue;
		}
예제 #37
0
        /// <summary>Is caster behind target?</summary>
        public static void IsCasterBehind(SpellEffectHandler effectHandler, WorldObject target,
                                          ref SpellFailedReason failedReason)
        {
            WorldObject casterObject = effectHandler.Cast.CasterObject;

            if (!casterObject.IsBehind(target))
            {
                failedReason = SpellFailedReason.NotBehind;
            }
            else
            {
                bool hasHarmfulEffects = effectHandler.Cast.Spell.HasHarmfulEffects;
                if (hasHarmfulEffects == casterObject.MayAttack((IFactionMember)target))
                {
                    return;
                }
                failedReason = hasHarmfulEffects ? SpellFailedReason.TargetFriendly : SpellFailedReason.TargetEnemy;
            }
        }
예제 #38
0
 /// <summary>
 /// AI heal spells.
 /// This evaluator demonstrates how to losen constraints - i.e. don't go for the best choice, but go for anyone that satisfies some condition.
 /// </summary>
 public static int AnyWoundedEvaluator(SpellEffectHandler effectHandler, WorldObject target)
 {
     if (target is Unit)
     {
         // useful heal spell: Amount to be healed is greater or equal half of what the spell can heal
         // Select anyone with that problem
         var unit          = (Unit)target;
         var missingHealth = unit.MaxHealth - unit.Health;
         if (missingHealth >= effectHandler.CalcDamageValue() / 2)
         {
             // good choice
             return(-1);
         }
         // not so good choice
         return(0);
     }
     // should never happen
     return(int.MaxValue);
 }
예제 #39
0
		public static void IsInFrontAndHostile(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			IsInFrontOfCaster(effectHandler, target, ref failedReason, IsHostile);
		}
예제 #40
0
		public static void IsSamePartyAndClass(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			IsAllied(effectHandler, target, ref failedReason);
			if (failedReason == SpellFailedReason.Ok)
			{
				IsSameClass(effectHandler, target, ref failedReason);
			}
		}
예제 #41
0
		public static int RandomEvaluator(SpellEffectHandler effectHandler, WorldObject target)
		{
			return Utility.Random(0, int.MaxValue);
		}
예제 #42
0
		/// <summary>
		/// Only select targets that have at least half of what the effect can heal
		/// </summary>
		public static void IsWoundedEnough(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			if (target is Unit)
			{
				// useful heal spell: Amount to be healed is greater or equal half of what the spell can heal
				// Select anyone with that problem
				var unit = (Unit)target;
				var missingHealth = unit.MaxHealth - unit.Health;
				if (missingHealth >= effectHandler.CalcDamageValue() / 2)
				{
					// good choice
					return;
				}
			}

			// not wounded or not wounded enough
			failedReason = SpellFailedReason.AlreadyAtFullHealth;
		}
예제 #43
0
		public static void IsInFrontOfCaster(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason, TargetFilter filter)
		{
			var caster = effectHandler.Cast.CasterObject;
			if (caster.IsPlayer && !target.IsInFrontOf(caster))
			{
				failedReason = SpellFailedReason.NotInfront;
			}
			else
			{
				filter(effectHandler, target, ref failedReason);
			}
		}
예제 #44
0
		/// <summary>
		/// 
		/// </summary>
		public static void IsNotPlayer(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			failedReason = target is Character ? SpellFailedReason.TargetIsPlayer : SpellFailedReason.Ok;
		}
예제 #45
0
		/// <summary>
		/// 
		/// </summary>
		public static void IsVisible(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			failedReason = effectHandler.Cast.CasterUnit.CanSee(target) ? SpellFailedReason.Ok : SpellFailedReason.BmOrInvisgod;
		}
예제 #46
0
		/// <summary>
		/// Is caster behind target?
		/// </summary>
		public static void IsCasterBehind(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			var caster = effectHandler.Cast.CasterObject;
			if (!caster.IsBehind(target))
			{
				failedReason = SpellFailedReason.NotBehind;
			}
			else
			{
				var harmful = effectHandler.Cast.Spell.HasHarmfulEffects;
				if (harmful != caster.MayAttack(target))
				{
					failedReason = harmful ? SpellFailedReason.TargetFriendly : SpellFailedReason.TargetEnemy;
				}
			}
		}