Lemke

Member
Yo guys,there is some code to prevent players using item under guards?
The item is a deed to summon a creature,i got it running well,but when a player use it under guards,they instakill the summoned creature,thank you!!!
 
You can modify the "OnDoubleClick" method so that it checks to see what type of region they are in.

If you have defined OnDoubleClick already, then just add the "if" portion at the top of your method.

C#:
        public override void OnDoubleClick(Mobile from)
        {
            if (from.Region is GuardedRegion) return;
            base.OnDoubleClick(from);
        }
 
Or give a nice message:
C#:
            if (from.Region is GuardedRegion)
            {
                from.SendMessage("This cannot be used in a Guarded Region.");
                return;
            }
 

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back