Example #1
0
		public void LoadList( string Mapname ) {
			ClearList();

			Points = new SMobPoints( Mapname.ToEMap() );
			ActiveMapRule = SMobMapRule.GetRule( Points.Map );
			ResultTable table = Mysql.Query( "SELECT * FROM `shaiya_mob_db` WHERE mapname = '" + Mapname + "'" );
			if( table.Rows.Count == 0 )
				return;

			if( ListView != null )
				ListView.BeginUpdate();
			for( int i = 0; i < table.Rows.Count; i++ ) {
				ResultRow row = table.Rows[ i ];
				SMobPoint p = new SMobPoint();
				p.ID = row[ "id" ].GetInt();
				p.X = row[ "pos_x" ].GetInt();
				p.Y = row[ "pos_y" ].GetInt();
				p.Name = row[ "name" ].GetString();
				p.Level = row[ "level" ].GetString();
				p.Anzahl = row[ "anzahl" ].GetString();
				p.Element = row[ "element" ].GetEnum<EMobElement>();
				p.IsBoss = row[ "boss" ].GetInt() == 1;
				p.InfoDesc = row[ "info" ].GetString();

				if( p.Anzahl.IndexOf( "Boss" ) != -1 )
					p.IsBoss = true;

				AddToList( p );
			}
			if( ListView != null )
				ListView.EndUpdate();

		}
Example #2
0
        public static SMobPoint FromForm(int x, int y, frmMobPoint frm)
        {
            SMobPoint p = new SMobPoint(x, y);

            p.Name     = frm.txtName.Text;
            p.Level    = frm.txtLevel.Text;
            p.Anzahl   = frm.cbCount.Text;
            p.Element  = (EMobElement)frm.cbElement.SelectedIndex;
            p.IsBoss   = frm.chkBoss.Checked;
            p.InfoDesc = frm.txtInfo.Text;
            return(p);
        }
Example #3
0
		public static SMobPointEx FromPoint( SMobPoint Point ) {
			SMobPointEx p = new SMobPointEx();
			p.Anzahl = Point.Anzahl;
			p.Element = Point.Element;
			p.ID = Point.ID;
			p.InfoDesc = Point.InfoDesc;
			p.IsBoss = Point.IsBoss;
			p.Level = Point.Level;
			p.Marked = Point.Marked;
			p.Name = Point.Name;
			p.X = Point.X;
			p.Y = Point.Y;

			return p;
		}
Example #4
0
        public static SMobPointEx FromPoint(SMobPoint Point)
        {
            SMobPointEx p = new SMobPointEx();

            p.Anzahl   = Point.Anzahl;
            p.Element  = Point.Element;
            p.ID       = Point.ID;
            p.InfoDesc = Point.InfoDesc;
            p.IsBoss   = Point.IsBoss;
            p.Level    = Point.Level;
            p.Marked   = Point.Marked;
            p.Name     = Point.Name;
            p.X        = Point.X;
            p.Y        = Point.Y;

            return(p);
        }
Example #5
0
		public bool SelectPoint( SMobPoint p, bool Clear ) {
			if( Clear == true ) {
				listMobPoints.SelectedIndices.Clear();
				mMarkedMobs.Clear();
				MonsterMap.Invalidate();
			}

			for( int i = 0; i < mFactory.Points.Count; i++ ) {
				if( mFactory[ i ].Equals( p ) == true ) {
					mMarkedMobs.Add( i );

					for( int j = 0; j < listMobPoints.Items.Count; j++ )
						if( int.Parse( listMobPoints.Items[ j ].Tag.ToString() ) == i ) {
							listMobPoints.SelectedIndices.Add( j );
							break;
						}
					return true;
				}
			}
			return false;
		}
Example #6
0
		public static SMobPoint FromForm( int x, int y, frmMobPoint frm ) {
			SMobPoint p = new SMobPoint( x, y );
			p.Name = frm.txtName.Text;
			p.Level = frm.txtLevel.Text;
			p.Anzahl = frm.cbCount.Text;
			p.Element = (EMobElement)frm.cbElement.SelectedIndex;
			p.IsBoss = frm.chkBoss.Checked;
			p.InfoDesc = frm.txtInfo.Text;
			return p;
		}
Example #7
0
		public static ListViewItem BuildListItem( FactoryMobPoint mobFac, int PointNum, SMobPoint p ) {
			ListViewItem item = new ListViewItem( new string[] { p.Name, p.Level, p.Element.ToName( true ), p.Anzahl } );
			item.Tag = PointNum;
			item.ToolTipText = string.Format( "{0} ({1}) | {2} [{3}]", p.Name, p.Level, p.Element, p.Anzahl );
			item.ImageIndex = p.RuleLevelToIndex( mobFac );

			return item;
		}
Example #8
0
		public void DrawPoint( Graphics g, SMobPoint p, int markedCount, bool marked, bool ShowName ) {
			int imgIndex = p.RuleLevelToIndex( this );
			p.Marked = marked;
			if( Properties.Settings.Default.MarkedStandAlone == true && markedCount > 0 && p.Marked == false )
				return;

			g.DrawImage( SMobPoints.MobImages[ imgIndex ], p.RectX, p.RectY, SMobPoint.ImageSize, SMobPoint.ImageSize );
			if( p.Marked == true && !Properties.Settings.Default.MarkedStandAlone )
				g.DrawImage( p.Gif.GetNextFrame(), p.RectX - SMobPoint.MarkedDiffSize, p.RectY - SMobPoint.MarkedDiffSize, SMobPoint.MarkedImageSize, SMobPoint.MarkedImageSize );
			// Boss Overlay
			if( p.IsBoss == true )
				g.DrawImage( Properties.Resources.MobBoss, p.RectX - SMobPoint.BossDiffSize, p.RectY - SMobPoint.BossDiffSize, SMobPoint.BossImageSize, SMobPoint.BossImageSize );

			if( ShowName == false )
				return;

			// Point.X & .Y build's the Image Center, RectX & RectY the Top-Left Corner
			Font drawFont = new Font( "Tahoma", 8f );
			SizeF nameSize = g.MeasureString( p.Name, drawFont );
			Point drawAt = new Point( p.RectX + ( SMobPoint.ImageSize / 2 ) - (int)( nameSize.Width / 2 ), p.RectY - (int)nameSize.Height );

			g.DrawString( p.Name, drawFont, Brushes.White, drawAt.X + 1, drawAt.Y + 1 );
			g.DrawString( p.Name, drawFont, Brushes.Black, drawAt );

		}
Example #9
0
		private bool PointExists( SMobPoint p ) {
			return Mysql.QueryCount( "SELECT COUNT(id) AS count FROM `shaiya_mob_db` WHERE name = '{0}' AND mapname = '{1}' AND pos_x = {2} AND pos_y = {3}", p.Name.MysqlEscape(), Points.Map.ToName().MysqlEscape(), p.RectX, p.RectY ) > 0;
		}