AvatarsConquest/Scripts/Regions/TownRegion.cs

43 lines
995 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.Xml;
using Server;
using Server.Commands;
using Server.Mobiles;
using Server.Spells;
namespace Server.Regions
{
public class TownRegion : BaseRegion
{
public TownRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
{
}
public override bool OnBeginSpellCast( Mobile m, ISpell s )
{
if ( !s.OnCastInTown( this ) )
{
m.SendLocalizedMessage( 500946 ); // You cannot cast this in town!
return false;
}
return base.OnBeginSpellCast( m, s );
}
public override bool AllowHousing( Mobile from, Point3D p )
{
return true;
}
public override void OnEnter( Mobile m )
{
base.OnEnter( m );
if ( m != null && m.Player )
{
m.SendMessage( "You have entered <BASEFONT COLOR='#00FF00'>{0}</BASEFONT>.", this.Name );
}
}
}
}