Hi
pls help
I tried to use "using Server.Spells" and "using Server.Spell" i guess "Caster" var is there But one doesn't helps another doesn't exist
Im modifying a wand script

Wand:
using System;
using Server.Spells.First;
using Server.Spells.Eighth;

using System.Collections.Generic;
using Server.Items;
using Server.Mobiles;
using Server.Spells.SkillMasteries;
using System.Linq;
using Server.Spells.Spellweaving;
using Server.Spells;
//using Server.Spell;

namespace Server.Items
{
    public class WeaknessWand : BaseWand
    {
        [Constructable]
        public WeaknessWand()
            : base(WandEffect.Weakness, 5, 30)
        {
        }

        public WeaknessWand(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }

        public override void OnWandUse(Mobile from)
        {
            //this.Cast(new WeakenSpell(from, this));
            if (CheckCast())
                this.Cast(new EnergyVortexSpell(from, this));

        }
     
        public bool CheckCast()
        {
            if (!IsValidLocation(Caster.Location, Caster.Map))
            {
                Caster.SendLocalizedMessage(1072705); // You must be standing on an arcane circle, pentagram or abbatoir to use this spell.
                return false;
            }

My goal is make wand cast only on special spots
 
Edit 1:
C#:
 public bool CheckCast(Mobile caster)

Edit 2:
C#:
 if (!IsValidLocation(caster.Location, caster.Map))

Edit 3:
C#:
 caster.SendLocalizedMessage(1072705); // You must be standing on an arcane circle, pentagram or abbatoir to use this spell.

Edit 4:
C#:
 if (CheckCast(from))
 
thanks for help
first i had an error
"not all lines of code return a value"
so i added some "else return"
and it works
 
Back