internal PMWindow(Int16 Id)
		{
			this.Server = Framework.GetInstance();
			this.form = MainWindow2.GetInstance();
			this.Id = Id;
			this.PMPlayer = (GraalPlayer)this.Server.PlayerManager.FindPlayer(this.Id);
			this.CenterToScreen();
			
			string TitleText = "";
			TitleText = this.PMPlayer.Account;
			if (this.PMPlayer.Nickname != "" && this.PMPlayer.Nickname != null)
				TitleText +=  ": " + this.PMPlayer.Nickname;
			this.Text = TitleText;
			this.InitializeComponent(Id);
			this.richTextBox1.ReadOnly = true;
			//this.listBox1 = listBox1;

			//e.
			/*
			try
			{
				this.InitializeComponent();
				this.Show();
			}
			catch (SyntaxErrorException e)
			{
				this.form.Write_Text(e.Message + "\r\n");
			}
			*/
		}
        /// <summary>
        /// Add Player to Playerlist (or return player)
        /// </summary>
        public virtual GraalPlayer AddPlayer(Int16 Id, CSocket socket)
        {
            GraalPlayer pl = FindPlayer(Id);
            if (pl == null)
            {
                GraalPlayer Player = new GraalPlayer(Id, socket);
                PlayerList[Id] = Player;
                return Player;
            }

            return pl;
        }
		public void ReceivedPM(GraalPlayer Player, CString Message)
		{
			this.form = Abstraction.GetInstance();

			if (Player != null)
			{
				this.form.WriteText(" -!- Received PM from " + Player.Account.ToString() + "!\n");
				PMWindowManager = PMWindowList.GetInstance();
				PMWindow PM = PMWindowManager.AddPMWindow(Player.Id);

				if (PM != null)
				{
					PM.SetMessage(Message);
				}
			}
			else
				this.form.WriteText("Something went wrong. Player is null.");
		}
		public void WindowInit()
		{
			
			this.Icon = global::Gdk.Pixbuf.LoadFromResource("OpenGraal.GraalIM.Resources.rcicon.ico");
			this.Server = Framework.GetInstance();
			this.PMWindowManager = PMWindowList.GetInstance();

			this.PMPlayer = this.Server.FindPlayer(this.Id);
			string TitleText = "";
			if (this.PMPlayer != null)
			{
				TitleText = this.PMPlayer.Account;
				if (this.PMPlayer.Nickname != "" && this.PMPlayer.Nickname != null)
					TitleText += ": " + this.PMPlayer.Nickname;
			}
			this.Title = TitleText;
			this.Show();
		}
		public void ReceivedToall(GraalPlayer Player, CString Message)
		{
			this.form = Abstraction.GetInstance();

			ToallsWindow PM = ToallsWindow.GetInstance();

			if (PM != null)
			{
				PM.SetMessage(Player, Message);
			}
		}
		/// <summary>
		/// Delete Player from Level
		/// </summary>
		/// <param name="Player"></param>
		public void DeletePlayer(GraalPlayer Player)
		{
			if (Players.Contains(Player))
			{
				Player.CallNPCs("onPlayerLeaves", new object[] { Player });
				Players.Remove(Player);
				
				this.CallNPCs("onPlayerLeaves", new object[] { Player });
			}
		}
		/// <summary>
		/// Add Player to Level
		/// </summary>
		/// <param name="Player"></param>
		public void AddPlayer(GraalPlayer Player)
		{
			if (!Players.Contains(Player) && Player != null)
			{
				Players.Add(Player);
				try
				{
					Player.Level = this;
					this.CallNPCs("onPlayerEnters", new object[] { Player });
					Player.CallNPCs("onPlayerEnters", new object[] { Player });
				}
				catch (System.NullReferenceException e)
				{
					Console.WriteLine("error: " + e.Message);
				}
				
			}
		}
 /// <summary>
 /// Library Function -> Trigger Event
 /// </summary>
 public void trigger(GraalPlayer player, string Event, string[] args)
 {
     this.Call(Event, new object[] { player, args });
 }
 /// <summary>
 /// Attach Player to Object
 /// </summary>
 public void detachplayer(GraalPlayer player)
 {
     if (player != null && Ref.npcserver)
         this.SendGSPacket(new CString() + (byte)OpenGraal.Common.Levels.GraalLevelNPC.PacketOut.NCQUERY + (byte)OpenGraal.Common.Levels.GraalLevelNPC.NCREQ.PLSETPROPS + (short)player.Id + (byte)GraalPlayer.Properties.PLATTACHNPC + (byte)0 + (int)0);
 }