AvatarsConquest/Scripts/Regions/TownRegion.cs

34 lines
710 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;
}
}
}