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

  • Unchained
    Custom (Classic)
    • Players
    • 148 Online
    • 273 Peak
  • The Crossroads
    Mondain's Legacy
    • Players
    • 88 Online
    • 190 Peak
  • UO Eventine
    Custom (Classic)
    • Players
    • 77 Online
    • 137 Peak
  • Insane UO
    Endless Journey
    • Players
    • 72 Online
    • 105 Peak
  • UO: New Renaissance
    Custom (Classic)
    • Players
    • 25 Online
    • 85 Peak
  • CALYPSO
    Custom (Modern)
    • Players
    • 21 Online
    • 30 Peak
  • Pandora
    Custom (Modern)
    • Players
    • 20 Online
    • 32 Peak
  • UO Enigma
    Custom (Modern)
    • Players
    • 20 Online
    • 172 Peak
  • UO Phoenix
    Custom (Classic)
    • Players
    • 19 Online
    • 48 Peak
  • Arth
    Custom (Modern)
    • Players
    • 18 Online
    • 34 Peak

Donations

Total amount
$0.00
Goal
$500.00
Back