示例#1
0
		public void OnCommand(GameClient client, string[] args)
		{
			ushort bindRadius = 750;
			if (args.Length >= 2)
			{
				try
				{
					bindRadius = UInt16.Parse(args[1]);
				}
				catch (Exception e)
				{
					DisplayMessage(client, LanguageMgr.GetTranslation(client, "GMCommands.Error", e.Message));
					return;
				}
			}
			BindPoint bp = new BindPoint();
			bp.X = client.Player.X;
			bp.Y = client.Player.Y;
			bp.Z = client.Player.Z;
			bp.Region = client.Player.CurrentRegionID;
			bp.Radius = bindRadius;
			GameServer.Database.AddObject(bp);
			client.Player.CurrentRegion.AddArea(new Area.BindArea("bind point", bp));
			DisplayMessage(client, LanguageMgr.GetTranslation(client, "GMCommands.AddBind.BindPointAdded", bp.X, bp.Y, bp.Z, bp.Radius, bp.Region));
		}
示例#2
0
文件: Area.cs 项目: mynew4/DOLSharp
            public override void LoadFromDatabase(DBArea area)
            {
                base.LoadFromDatabase(area);

                m_dbBindPoint = new BindPoint();
                m_dbBindPoint.Radius = (ushort)area.Radius;
                m_dbBindPoint.X = area.X;
                m_dbBindPoint.Y = area.Y;
                m_dbBindPoint.Z = area.Z;
                m_dbBindPoint.Region = area.Region;
            }
 /// <summary>
 /// Is player allowed to bind
 /// </summary>
 /// <param name="player"></param>
 /// <param name="point"></param>
 /// <returns></returns>
 public override bool IsAllowedToBind(GamePlayer player, BindPoint point)
 {
     if (point.Realm == 0) return true;
     return player.Realm == (eRealm)point.Realm;
 }
示例#4
0
 /// <summary>
 /// Is player allowed to bind
 /// </summary>
 /// <param name="player"></param>
 /// <param name="point"></param>
 /// <returns></returns>
 public virtual bool IsAllowedToBind(GamePlayer player, BindPoint point)
 {
     return true;
 }
示例#5
0
 public BindArea(string desc, BindPoint dbBindPoint)
     : base(desc, dbBindPoint.X, dbBindPoint.Y, dbBindPoint.Z, dbBindPoint.Radius)
 {
     m_dbBindPoint = dbBindPoint;
     m_displayMessage = false;
 }