• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Server.Map类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Server.Map的典型用法代码示例。如果您正苦于以下问题:C# Map类的具体用法?C# Map怎么用?C# Map使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Map类属于Server命名空间,在下文中一共展示了Map类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CraftShopRegion

 public CraftShopRegion( XmlElement xml, Map map, Region parent )
     : base(xml, map, parent)
 {
     int skill = 0;
     ReadInt32( xml, "skill", ref skill, true );
     m_Skills = (CraftSkillType)skill;
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:7,代码来源:CraftShopRegion.cs


示例2: TreasureRegion

        private const int Range = 5;// No house may be placed within 5 tiles of the treasure
        public TreasureRegion(int x, int y, Map map)
            : base(null, map, Region.DefaultPriority, new Rectangle2D(x - Range, y - Range, 1 + (Range * 2), 1 + (Range * 2)))
        {
            this.GoLocation = new Point3D(x, y, map.GetAverageZ(x, y));

            this.Register();
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:8,代码来源:TreasureMapProtection.cs


示例3: PlaySound

        public static void PlaySound( IPoint3D p, Map map, int soundID )
        {
            if ( soundID <= -1 )
                return;

            if ( map != null )
            {
                Packet playSound = null;

                IPooledEnumerable eable = map.GetClientsInRange( new Point3D( p ) );

                foreach ( NetState state in eable )
                {
                    state.Mobile.ProcessDelta();

                    if ( playSound == null )
                        playSound = Packet.Acquire( new PlaySound( soundID, p ) );

                    state.Send( playSound );
                }

                Packet.Release( playSound );

                eable.Free();
            }
        }
开发者ID:greeduomacro,项目名称:liberdade-uo-server,代码行数:26,代码来源:Effects.cs


示例4: Explode

		public virtual void Explode( Mobile from, Point3D loc, Map map )
		{
			if ( Deleted || map == null )
				return;

			Consume();
			
			// Check if any other players are using this potion
			for ( int i = 0; i < m_Users.Count; i ++ )
			{
				ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( from );
			}

			// Effects
			Effects.PlaySound( loc, map, 0x20C );

			for ( int i = -2; i <= 2; i ++ )
			{
				for ( int j = -2; j <= 2; j ++ )
				{
					Point3D p = new Point3D( loc.X + i, loc.Y + j, loc.Z );

					if ( map.CanFit( p, 12, true, false ) && from.InLOS( p ) )
						new InternalItem( from, p, map, MinDamage, MaxDamage );
				}
			}
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:30,代码来源:BaseConflagrationPotion.cs


示例5: OnExplode

        public override void OnExplode( Mobile source, Item itemSource, int intensity, Point3D loc, Map map )
        {
            Server.Effects.PlaySound( loc, map, 0x22F );

            int radius = 2; // for anything that's calling this, and is not a bomb
            if ( itemSource is BombPotion )
            {
                BombPotion bomb = itemSource as BombPotion;
                radius = bomb.ExplosionRange;
            }

            int delay = (int)(intensity * Divisor);
            if ( delay <= 0 )
                delay = 1;
            TimeSpan time = TimeSpan.FromSeconds( delay );

            List<Point3D> circlePoints = CircleHelper.CircleMidpoint( loc.X, loc.Y, loc.Z, radius, true );

            Point3D eye = new Point3D( loc );
            eye.Z += 14;
            foreach( Point3D point in circlePoints )
            {
                Point3D target = new Point3D(point);
                target.Z += 14;
                if ( map.LineOfSight( eye, target ) )
                {
                    FireTile tile = new FireTile( time+TimeSpan.FromSeconds( Utility.RandomDouble()*5 ), source, FireEffectType );
                    tile.MoveToWorld( point, map );
                    tile.AddCurrentOccupants();
                }
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:32,代码来源:FireEffect.cs


示例6: CustomRegion

        public CustomRegion( RegionControl m, Map map )
            : base("", "Custom Region", map, typeof( WarriorGuard ))
        {
            LoadFromXml = false;

            m_Controller = m;
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:7,代码来源:CustomRegion.cs


示例7: MovementPath

        public MovementPath(Mobile m, Point3D goal)
        {
            Point3D start = m.Location;
            Map map = m.Map;

            this.m_Map = map;
            this.m_Start = start;
            this.m_Goal = goal;

            if (map == null || map == Map.Internal)
                return;

            if (Utility.InRange(start, goal, 1))
                return;

            try
            {
                PathAlgorithm alg = m_OverrideAlgorithm;

                if (alg == null)
                {
                    alg = FastAStarAlgorithm.Instance;
                    //if ( !alg.CheckCondition( m, map, start, goal ) )	// SlowAstar is still broken
                    //	alg = SlowAStarAlgorithm.Instance;		// TODO: Fix SlowAstar
                }

                if (alg != null && alg.CheckCondition(m, map, start, goal))
                    this.m_Directions = alg.Find(m, map, start, goal);
            }
            catch (Exception e)
            {
                Console.WriteLine("Warning: {0}: Pathing error from {1} to {2}", e.GetType().Name, start, goal);
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:34,代码来源:MovementPath.cs


示例8: DeleteMoonGate

		private static int DeleteMoonGate(Map map, Point3D p)
		{
			Queue<Item> m_Queue = new Queue<Item>();

			IPooledEnumerable eable = map.GetItemsInRange(p, 0);

			foreach (Item item in eable)
			{
				if (item is PublicMoongate)
				{
					int delta = item.Z - p.Z;

					if (delta >= -12 && delta <= 12)
						m_Queue.Enqueue(item);
				}
			}

			eable.Free();

			int m_Count = m_Queue.Count;

			while (m_Queue.Count > 0)
				(m_Queue.Dequeue()).Delete();

			return m_Count;
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:26,代码来源:MoonGenDelete.cs


示例9: Sector

		public Sector( int x, int y, Map owner )
		{
			m_X = x;
			m_Y = y;
			m_Owner = owner;
			m_Active = false;
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:7,代码来源:Sector.cs


示例10: Explode

		public virtual void Explode( Mobile from, Point3D loc, Map map )
		{
			if ( Deleted || map == null )
				return;

			Consume();

			// Check if any other players are using this potion
			for ( int i = 0; i < m_Users.Count; i ++ )
			{
				ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( from );
			}

			// Effects
			Effects.PlaySound( loc, map, 0x207 );

			Geometry.Circle2D( loc, map, Radius, new DoEffect_Callback( BlastEffect ), 270, 90 );

			Timer.DelayCall( TimeSpan.FromSeconds( 0.3 ), new TimerStateCallback( CircleEffect2 ), new object[] { loc, map } );

			foreach ( Mobile mobile in map.GetMobilesInRange( loc, Radius ) )
			{
                if (mobile is BaseCreature)
                {
					BaseCreature mon = (BaseCreature) mobile;

					mon.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 5.0 ) ); // TODO check
				}
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:33,代码来源:BaseConfusionBlastPotion.cs


示例11: GetDestination

        public override bool GetDestination( PlayerMobile player, ref Point3D loc, ref Map map )
        {
            QuestSystem qs = player.Quest;

            if ( qs is EminosUndertakingQuest )
            {
                QuestObjective obj = qs.FindObjective( typeof( TakeBlueTeleporterObjective ) );

                if ( obj != null )
                {
                    if ( X == 423 && Y == 805 && Z == -1 )
                    {
                        loc = new Point3D( 411, 1116, 0 );
                    }

                    if ( X == 411 && Y == 1117 && Z == 0 )
                    {
                        loc = new Point3D( 424, 807, 0 );
                    }

                    map = Map.Malas;
                    return true;
                }
            }

            return false;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:27,代码来源:BlueTeleporter.cs


示例12: QuestCompleteObjectiveRegion

		public QuestCompleteObjectiveRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
		{
			XmlElement questEl = xml["quest"];

			ReadType( questEl, "type", ref m_Quest );
			ReadType( questEl, "complete", ref m_Objective );
		}
开发者ID:Godkong,项目名称:Origins,代码行数:7,代码来源:QuestCompleteObjectiveRegion.cs


示例13: CheckItem

        private static void CheckItem( Item item, Map oldMap )
        {
            if ( item.Map == null || item.Map == Map.Internal )
                return;

            if ( !m_Timers.ContainsKey( item ) )
            {
                MoonbindTimer timer = new MoonbindTimer( item );
                timer.Start();

                m_Timers.Add( item, timer );
            }

            Mobile parent = item.Parent as Mobile;

            if ( parent != null )
            {
                bool sendMessage = oldMap != null && oldMap != Map.Internal && ( oldMap == Map.Felucca || item.Map == Map.Felucca );

                if ( sendMessage )
                {
                    if ( item.IsEphemeral() )
                        parent.SendLocalizedMessage( 1153088 ); // The power of the moon Felucca no longer strengthens your Faction gear.
                    else
                        parent.SendLocalizedMessage( 1153087 ); // The power of the moon Felucca strengthens your Faction gear.
                }
            }

            item.InvalidateProperties();
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:30,代码来源:Moonbind.cs


示例14: Deserialize

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 2:
				{
					m_Level = reader.ReadInt();
					goto case 1;
				}
				case 1:
				{
					m_TargetMap = reader.ReadMap();
					break;
				}
				case 0:
				{
					m_TargetMap = Map.Trammel;
					break;
				}
			}

			if ( version < 2 )
				m_Level = GetRandomLevel();
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:28,代码来源:ParchmentMessage.cs


示例15: Explode

		public virtual void Explode( Mobile from, Point3D loc, Map map )
		{
			if ( Deleted || map == null )
				return;

			Consume();
			
			// Check if any other players are using this potion
			for ( int i = 0; i < m_Users.Count; i ++ )
			{
				ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( from );
			}
			
			// Add delay
			AddDelay( from );
			
			// Effects		
			Effects.PlaySound( loc, map, 0x207 );
			
			EffectCircle( loc, map, Radius );
			
			foreach ( Mobile mobile in map.GetMobilesInRange( loc, Radius ) )
			{
				if ( mobile is BaseCreature )
				{
					BaseCreature mon = (BaseCreature) mobile;
					
					mon.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 5.0 ) ); // TODO check
				}
			}
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:34,代码来源:BaseConfusionBlastPotion.cs


示例16: PCMoongateToll2Gump

		public PCMoongateToll2Gump( Item gate, CityManagementStone outgoingCity, Point3D locdes, Map mapdes ) : base( 50, 50 )
		{
			m_Gate = gate;
			m_Outgoing = outgoingCity;
			m_LocDes = locdes;
			m_MapDes = mapdes;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;

			AddPage(0);

			int incomingTax = 0;
			int outgoingTax = 0;

			if ( outgoingCity != null && outgoingCity.TravelTax >= 1 )
				outgoingTax = outgoingCity.TravelTax;

			int totalTax = incomingTax + outgoingTax;

			AddBackground(23, 27, 276, 269, 5120);
			AddImageTiled(28, 57, 269, 7, 5121);
			AddHtml( 32, 33, 259, 19, @"<BASEFONT COLOR= WHITE><CENTER>Travel Tax Report</CENTER></BASEFONT>", (bool)false, (bool)false);
			AddHtml( 32, 64, 258, 100, @"<CENTER><B>Taxes Info</B></CENTER><BR><BR>You are being taxed for this trip, This total below includes your incoming and outgoing fees, Incoming fees are taxes for the city you are entering, Outgoing fees are taxes for the city you are leaving, You have to pay these taxes each time you enter or leave a player city if that city has a travel tax in place.", (bool)true, (bool)true);
			AddLabel(35, 170, 1149, @"Incoming Tax: " + incomingTax.ToString() );
			AddLabel(35, 190, 1149, @"Outgoing Tax: " + outgoingTax.ToString() );
			AddLabel(35, 210, 1149, @"Total Amount: " + totalTax.ToString() );
			AddImageTiled(28, 235, 269, 7, 5121);
			AddLabel(86, 235, 1149, @"Do you wish to continue?");
			AddButton(89, 260, 247, 248, 1, GumpButtonType.Reply, 0);
			AddButton(165, 260, 241, 242, 2, GumpButtonType.Reply, 0);

		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:35,代码来源:PCMoongateToll2Gump.cs


示例17: DecoreItemInfo

 public DecoreItemInfo( string typestring, string name, int itemid, int hue, Point3D loc, Map map )
 {
     c_TypeString = typestring;
     c_ItemID = itemid;
     c_Location = loc;
     c_Map = map;
 }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:7,代码来源:DecoreItemInfo.cs


示例18: StaExBox_Callback

		private static void StaExBox_Callback(Mobile mob, Map map, Point3D start, Point3D end, object state)
		{
			object[] states = (object[])state;
			string file = (string)states[0];

			Export(mob, file, new Rectangle2D(new Point2D(start.X, start.Y), new Point2D(end.X+1, end.Y+1)));
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:StaticExport.cs


示例19: CheckMulti

		public static bool CheckMulti( Point3D p, Map map, bool houses, int housingrange )
		{
			if( map == null || map == Map.Internal )
				return false;

			Sector sector = map.GetSector( p.X, p.Y );

			for( int i = 0; i < sector.Multis.Count; ++i )
			{
				BaseMulti multi = sector.Multis[i];

				if( multi is BaseHouse )
				{
					BaseHouse bh = (BaseHouse)multi;

					if( ( houses && bh.IsInside( p, 16 ) ) || ( housingrange > 0 && bh.InRange( p, housingrange ) ) )
						return true;
				}
				else if( multi.Contains( p ))
				{
					return true;
				}
			}
			
			return false;
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:26,代码来源:SpellHelper.cs


示例20: FlameOfOrder

        public FlameOfOrder( Point3D location, Map map )
            : base(0x19AB)
        {
            Movable = false;
            Light = LightType.Circle225;

            MoveToWorld( location, map );

            m_Barriers = new List<EnergyBarrier>( m_BarrierLocations.Length );
            m_Blockers = new List<Blocker>( m_BarrierLocations.Length );
            m_MsgTriggers = new List<SBMessageTrigger>( m_MsgTriggerLocations.Length );

            foreach ( Point3D loc in m_BarrierLocations )
            {
                m_Barriers.Add( new EnergyBarrier( loc, map ) );

                Blocker blocker = new Blocker();
                blocker.MoveToWorld( loc, map );
                m_Blockers.Add( blocker );
            }

            foreach ( Point3D loc in m_MsgTriggerLocations )
            {
                SBMessageTrigger trigger = new SBMessageTrigger( this );
                trigger.MoveToWorld( loc, map );
                m_MsgTriggers.Add( trigger );
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:28,代码来源:FlameOfOrder.cs



注:本文中的Server.Map类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Server.Mobile类代码示例发布时间:2022-05-26
下一篇:
C# Server.LootPackItem类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap