/// <summary>
/// Cast Confusion
/// </summary>
/// <param name="caster">Caster.</param>
/// <param name="EffectID">Effect ID of the spell</param>
void Cast_VasAnWis(GameObject caster, int EffectID)
{
//Confusion.
RaycastHit hit= new RaycastHit();
NPC npc = GetNPCTargetRandom(caster, ref hit);
if (npc != null)
{
SpellProp_Mind mindspell = new SpellProp_Mind();
mindspell.init (EffectID,caster);
//Apply a impact effect to the npc
Impact.SpawnHitImpact(npc.transform.name + "_impact",npc.GetImpactPoint(),mindspell.impactFrameStart,mindspell.impactFrameEnd);
if (npc.gameObject.GetComponent<SpellEffectConfusion>()!=null)
{//Npc already has this effect. Only allow one cast.
npc.gameObject.GetComponent<SpellEffectConfusion>().counter=5;//Restart the counter
}
else
{//A new cast
int EffectSlot = CheckPassiveSpellEffectNPC(npc.gameObject);
if (EffectSlot!=-1)
{
SpellEffectConfusion sec= (SpellEffectConfusion)SetSpellEffect(npc.gameObject, npc.NPCStatusEffects, EffectSlot, EffectID);
sec.counter=mindspell.counter;
sec.Go ();
}
}
}
}