What would be a simple way to make a tile that flags you criminal when you step on it? I basically want to have a tile that I'd put at a doorway to a vault for a bank, so if someone manages to break in, he walks through the door, gets flagged criminal and the guards attack him.
 
Code:
using System;
using Server;
using Server.Mobiles;
using Server.Misc;
using Server.Network;
namespace Server.Items
{
	public class CriminalTile : Item
	{
		[Constructable]
		public CriminalTile() : base(0x1BC3)
		{
			Movable = false;
			Visible = false;
			Name = "criminal tile";
		}
		public CriminalTile(Serial serial) : base(serial)
		{
		}
		public override bool OnMoveOver( Mobile m )
		{
			if ( m is PlayerMobile )
			{
				m.CriminalAction( true );
			}
			return true;
		}
		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();
		}
	}
}
 
Back