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

C# Items.MapItem类代码示例

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

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



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

示例1: OnMapTarget

		public void OnMapTarget( MapItem map )
		{
			Caster.SendMessage( "OnMapTarget" );

			if ( map.RootParent != Caster )
				Caster.SendMessage( "The map must be in your backpack for you to use." );
			else if ( map.Pins.Count < 1 )
				Caster.SendMessage( "The map doesn't have any pins to teleport to." );
			else
			{
				Point3D point = new Point3D( map.Pins[0].X, map.Pins[0].Y, map.DisplayMap.GetAverageZ( map.Pins[0].X, map.Pins[0].Y ) );
				Caster.SendMessage( "Base Location " + point.X.ToString() + ", " + point.Y.ToString() );
				point.X += map.Bounds.X;
				point.Y += map.Bounds.Y;
				Caster.SendMessage( "Map Scaled Location " + point.X.ToString() + ", " + point.Y.ToString() );

				if ( !SpellHelper.FindValidSpawnLocation( map.DisplayMap, ref point, false ) )
				{
					Caster.SendMessage( "That is not a valid location." );
					Caster.SendMessage( "Failed Location " + point.X.ToString() + ", " + point.Y.ToString() );
				}
				else if ( !SpellHelper.CheckTravel( map.DisplayMap, point, TravelCheckType.RecallTo ) )
				{
					Caster.SendMessage( "Travel there is restricted." );
					Caster.SendMessage( "Failed Location " + point.X.ToString() + ", " + point.Y.ToString() );
				}
				else
				{
					Caster.SendMessage( "Teleporting to " + point.X.ToString() + ", " + point.Y.ToString() );
					Caster.Mana -= ScaleMana( GetMana() );
					Caster.MoveToWorld( point, map.DisplayMap );

					Effects.SendLocationParticles( EffectItem.Create( new Point3D ( point.X, point.Y, point.Z ), Caster.Map, EffectItem.DefaultDuration ), 0x3716, 7, 10, 1266, 3, 5052, 0 );
					Effects.SendLocationParticles( EffectItem.Create( new Point3D ( point.X, point.Y, point.Z+20 ), Caster.Map, EffectItem.DefaultDuration ), 0x3716, 7, 10, 1266, 3, 5052, 0 );
					Effects.SendLocationParticles( EffectItem.Create( new Point3D ( point.X, point.Y, point.Z+40 ), Caster.Map, EffectItem.DefaultDuration ), 0x3716, 7, 10, 1266, 3, 5052, 0 );
					Effects.SendLocationParticles( EffectItem.Create( new Point3D ( point.X, point.Y, point.Z+60 ), Caster.Map, EffectItem.DefaultDuration ), 0x3716, 7, 10, 1266, 3, 5052, 0 );

				}
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:42,代码来源:Traveler.cs


示例2: AssociateMap

		public void AssociateMap( MapItem map )
		{
			if ( CheckDecay() )
				return;

			if ( map is BlankMap )
			{
				if ( TillerMan != null )
					TillerMan.Say( 502575 ); // Ar, that is not a map, tis but a blank piece of paper!
			}
			else if ( map.Pins.Count == 0 )
			{
				if ( TillerMan != null )
					TillerMan.Say( 502576 ); // Arrrr, this map has no course on it!
			}
			else
			{
				StopMove( false );

				MapItem = map;
				NextNavPoint = -1;

				if ( TillerMan != null )
					TillerMan.Say( 502577 ); // A map!
			}
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:26,代码来源:BaseBoat.cs


示例3: Deserialize

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 3:
				{
					m_MapItem = (MapItem) reader.ReadItem();
					m_NextNavPoint = reader.ReadInt();

					goto case 2;
				}
				case 2:
				{
					m_Facing = (Direction)reader.ReadInt();

					goto case 1;
				}
				case 1:
				{
					m_DecayTime = reader.ReadDeltaTime();

					goto case 0;
				}
				case 0:
				{
					if ( version < 3 )
						m_NextNavPoint = -1;

					if ( version < 2 )
					{
						if ( ItemID == NorthID )
							m_Facing = Direction.North;
						else if ( ItemID == SouthID )
							m_Facing = Direction.South;
						else if ( ItemID == EastID )
							m_Facing = Direction.East;
						else if ( ItemID == WestID )
							m_Facing = Direction.West;
					}

					m_Owner = reader.ReadMobile();
					m_PPlank = reader.ReadItem() as Plank;
					m_SPlank = reader.ReadItem() as Plank;
					m_TillerMan = reader.ReadItem() as TillerMan;
					m_Hold = reader.ReadItem() as Hold;
					m_Anchored = reader.ReadBool();
					m_ShipName = reader.ReadString();

					if ( version < 1)
						Refresh();

					break;
				}
			}

			m_Instances.Add( this );
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:61,代码来源:BaseBoat.cs


示例4: OnComplete

		public override void OnComplete()
		{
			PlayerMobile from = System.From;

			Point3D loc = WitchApprenticeQuest.RandomZeefzorpulLocation();

			MapItem mapItem = new MapItem();
			mapItem.SetDisplay( loc.X - 200, loc.Y - 200, loc.X + 200, loc.Y + 200, 200, 200 );
			mapItem.AddWorldPin( loc.X, loc.Y );
			from.AddToBackpack( mapItem );

			from.AddToBackpack( new MagicFlute() );

			from.SendLocalizedMessage( 1055061 ); // You have received a map and a magic flute.

			System.AddConversation( new ImpDeathConversation( loc ) );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:17,代码来源:Objectives.cs


示例5: GetRoutes_OnCommand

        public static void GetRoutes_OnCommand(CommandEventArgs e)
        {
            MapItem mapitem;

            for (int i = 0; i < SpawnDefinition.PirateTramFelCoursesJhelom.Length; i++)
            {
                mapitem = new MapItem();
                mapitem.SetDisplay(5, 5, 5120 - 32, 4096 - 10, 400, 400);

                for (int j = 0; j < SpawnDefinition.PirateTramFelCoursesJhelom[i].Length; j++)
                {
                    Point2D pnt = SpawnDefinition.PirateTramFelCoursesJhelom[i][j];
                    mapitem.AddWorldPin(pnt.X, pnt.Y);
                }

                mapitem.Name = String.Format("Pirate - Jhelom {0}", i + 1);
                e.Mobile.AddToBackpack(mapitem);
            }

            for (int i = 0; i < SpawnDefinition.PirateTramFelCoursesMoonglow.Length; i++)
            {
                mapitem = new MapItem();
                mapitem.SetDisplay(5, 5, 5120 - 32, 4096 - 10, 400, 400);

                for (int j = 0; j < SpawnDefinition.PirateTramFelCoursesJhelom[i].Length; j++)
                {
                    Point2D pnt = SpawnDefinition.PirateTramFelCoursesJhelom[i][j];
                    mapitem.AddWorldPin(pnt.X, pnt.Y);
                }

                mapitem.Name = String.Format("Pirate - Moonglow {0}", i + 1);
                e.Mobile.AddToBackpack(mapitem);
            }

            for (int i = 0; i < SpawnDefinition.PirateTokunoCourses.Length; i++)
            {
                mapitem = new MapItem();
                mapitem.SetDisplay(5, 5, 1448 - 32, 1448 - 10, 400, 400);

                for (int j = 0; j < SpawnDefinition.PirateTokunoCourses[i].Length; j++)
                {
                    Point2D pnt = SpawnDefinition.PirateTokunoCourses[i][j];
                    mapitem.AddWorldPin(pnt.X, pnt.Y);
                }

                mapitem.Name = String.Format("Pirate - tokuno {0}", i + 1);
                e.Mobile.AddToBackpack(mapitem);
            }

            for (int i = 0; i < SpawnDefinition.MerchantTokunoCourses.Length; i++)
            {
                mapitem = new MapItem();
                mapitem.SetDisplay(5, 5, 1448 - 32, 1448 - 10, 400, 400);

                for (int j = 0; j < SpawnDefinition.PirateTokunoCourses[i].Length; j++)
                {
                    Point2D pnt = SpawnDefinition.PirateTokunoCourses[i][j];
                    mapitem.AddWorldPin(pnt.X, pnt.Y);
                }

                mapitem.Name = String.Format("Merchant - tokuno {0}", i + 1);
                e.Mobile.AddToBackpack(mapitem);
            }
            for (int i = 0; i < SpawnDefinition.MerchantTramFelCourses1.Length; i++)
            {
                mapitem = new MapItem();
                mapitem.SetDisplay(5, 5, 5120 - 32, 4096 - 10, 400, 400);

                for (int j = 0; j < SpawnDefinition.MerchantTramFelCourses1[i].Length; j++)
                {
                    Point2D pnt = SpawnDefinition.MerchantTramFelCourses1[i][j];
                    mapitem.AddWorldPin(pnt.X, pnt.Y);
                }

                mapitem.Name = String.Format("Merchant - tram/fel(a) {0}", i + 1);
                e.Mobile.AddToBackpack(mapitem);
            }
            for (int i = 0; i < SpawnDefinition.MerchantTramFelCourses2.Length; i++)
            {
                mapitem = new MapItem();
                mapitem.SetDisplay(5, 5, 5120 - 32, 4096 - 10, 400, 400);

                for (int j = 0; j < SpawnDefinition.MerchantTramFelCourses2[i].Length; j++)
                {
                    Point2D pnt = SpawnDefinition.MerchantTramFelCourses2[i][j];
                    mapitem.AddWorldPin(pnt.X, pnt.Y);
                }

                mapitem.Name = String.Format("Merchant - tram/fel(b) {0}", i + 1);
                e.Mobile.AddToBackpack(mapitem);
            }

        }
开发者ID:Crome696,项目名称:ServUO,代码行数:93,代码来源:BountyQuestSpawner.cs


示例6: MapSetEditable

			public MapSetEditable( MapItem map, bool editable ) : base( map, 7, editable ? 1 : 0, 0, 0 )
			{
			}
开发者ID:Crome696,项目名称:ServUO,代码行数:3,代码来源:MapItem.cs


示例7: MapAddPin

			public MapAddPin( MapItem map, Point2D point ) : base( map, 1, 0, point.X, point.Y )
			{
			}
开发者ID:Crome696,项目名称:ServUO,代码行数:3,代码来源:MapItem.cs


示例8: MapDisplay

			public MapDisplay( MapItem map ) : base( map, 5, 0, 0, 0 )
			{
			}
开发者ID:Crome696,项目名称:ServUO,代码行数:3,代码来源:MapItem.cs


示例9: MapCommand

			public MapCommand( MapItem map, int command, int number, int x, int y ) : base ( 0x56, 11 )
			{
				m_Stream.Write( (int) map.Serial );
				m_Stream.Write( (byte) command );
				m_Stream.Write( (byte) number );
				m_Stream.Write( (short) x );
				m_Stream.Write( (short) y ); 
			}
开发者ID:Crome696,项目名称:ServUO,代码行数:8,代码来源:MapItem.cs


示例10: NewMapDetails

            public NewMapDetails(MapItem map) : base(0xF5, 21)
            {
                m_Stream.Write((int)map.Serial);
                m_Stream.Write((short)0x139D);
                m_Stream.Write((short)map.Bounds.Start.X);
                m_Stream.Write((short)map.Bounds.Start.Y);
                m_Stream.Write((short)map.Bounds.End.X);
                m_Stream.Write((short)map.Bounds.End.Y);
                m_Stream.Write((short)map.Width);
                m_Stream.Write((short)map.Height);

                short mapValue = 0x00;
                if (map.Facet == Map.Felucca)
                    mapValue = 0x00;
                else if (map.Facet == Map.Trammel)
                    mapValue = 0x01;
                else if (map.Facet == Map.Ilshenar)
                    mapValue = 0x02;
                else if (map.Facet == Map.Malas)
                    mapValue = 0x03;
                else if (map.Facet == Map.Tokuno)
                    mapValue = 0x04;
                else if (map.Facet == Map.TerMur)
                    mapValue = 0x05;

                m_Stream.Write(mapValue);
            }
开发者ID:Crome696,项目名称:ServUO,代码行数:27,代码来源:MapItem.cs


示例11: MapDetails

			public MapDetails( MapItem map ) : base ( 0x90, 19 )
			{
				m_Stream.Write( (int) map.Serial );
				m_Stream.Write( (short) 0x139D );
				m_Stream.Write( (short) map.Bounds.Start.X );
				m_Stream.Write( (short) map.Bounds.Start.Y );
				m_Stream.Write( (short) map.Bounds.End.X );
				m_Stream.Write( (short) map.Bounds.End.Y );
				m_Stream.Write( (short) map.Width );
				m_Stream.Write( (short) map.Height );
			}
开发者ID:Crome696,项目名称:ServUO,代码行数:11,代码来源:MapItem.cs


示例12: Deserialize

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

            int version = reader.ReadInt();

            switch (version)
            {
                case 8:
                    {
                        m_Sunk = reader.ReadBool();
                        goto case 7;
                    }
                case 7:
                    {
                        int numm_DamageEntries = reader.ReadInt();
                        for (int i = 0; i < numm_DamageEntries; i++)
                        {
                            Mobile mob = reader.ReadMobile();
                            int damage = reader.ReadInt();
                            DateTime expiration = DateTime.UtcNow + reader.ReadTimeSpan();
                            AddDamageEntry(mob, damage, expiration);
                        }
                        goto case 6;
                    }
                case 6:
                    {
                        int count = reader.ReadInt();
                        for (int i = 0; i < count; i++)
                        {
                            BoatComponent component = reader.ReadItem() as BoatComponent;
                            if (component != null) BoatComponents.Add(component);
                        }
                        goto case 5;
                    }
                case 5:
                    {
                        m_Hits = reader.ReadInt();
                        goto case 4;
                    }
                case 4:
                    {
                        m_RequiresWater = reader.ReadBool();
                        goto case 3;
                    }
                case 3:
                    {
                        m_MapItem = (MapItem)reader.ReadItem();
                        m_NextNavPoint = reader.ReadInt();

                        goto case 2;
                    }
                case 2:
                    {
                        m_Facing = (Direction)reader.ReadInt();

                        goto case 1;
                    }
                case 1:
                    {
                        m_DecayTime = reader.ReadDeltaTime();

                        goto case 0;
                    }
                case 0:
                    {
                        if (version < 3)
                            m_NextNavPoint = -1;

                        if (version < 2)
                        {
                            if (ItemID == NorthID)
                                m_Facing = Direction.North;
                            else if (ItemID == SouthID)
                                m_Facing = Direction.South;
                            else if (ItemID == EastID)
                                m_Facing = Direction.East;
                            else if (ItemID == WestID)
                                m_Facing = Direction.West;
                        }

                        m_Owner = reader.ReadMobile();
                        m_PPlank = reader.ReadItem() as Plank;
                        m_SPlank = reader.ReadItem() as Plank;
                        m_TillerMan = reader.ReadItem() as TillerMan;
                        m_Hold = reader.ReadItem() as Hold;
                        m_Anchored = reader.ReadBool();
                        m_ShipName = reader.ReadString();

                        if (version < 1)
                            Refresh();

                        break;
                    }
            }

            m_Instances.Add(this);
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:98,代码来源:BaseBoat.cs


示例13: Deserialize

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

            int version = reader.ReadInt();

            switch (version)
            {
                case 4:
                    {
                        if (reader.ReadInt() == 1)
                        {
                            m_BoatCourse = new BoatCourse(reader);
                            m_BoatCourse.Boat = this;
                            m_BoatCourse.Map = this.Map;
                        }

                        m_DockedBoat = reader.ReadItem() as BaseDockedBoat;
                        m_VirtualMount = reader.ReadItem() as BoatMountItem;
                        m_Decay = reader.ReadBool();
                        goto case 3;
                    }
                case 3:
                    {
                        m_MapItem = (MapItem)reader.ReadItem();
                        m_NextNavPoint = reader.ReadInt();

                        goto case 2;
                    }
                case 2:
                    {
                        m_Facing = (Direction)reader.ReadInt();

                        goto case 1;
                    }
                case 1:
                    {
                        m_DecayTime = reader.ReadDeltaTime();

                        goto case 0;
                    }
                case 0:
                    {
                        if (version < 3)
                            m_NextNavPoint = -1;

                        if (version < 2)
                        {
                            if (ItemID == NorthID)
                                m_Facing = Direction.North;
                            else if (ItemID == SouthID)
                                m_Facing = Direction.South;
                            else if (ItemID == EastID)
                                m_Facing = Direction.East;
                            else if (ItemID == WestID)
                                m_Facing = Direction.West;
                        }

                        m_Owner = reader.ReadMobile();
                        m_PPlank = reader.ReadItem() as Plank;
                        m_SPlank = reader.ReadItem() as Plank;

                        if (!IsClassicBoat && !(this is RowBoat))
                            m_TillerMan = reader.ReadMobile() as object;
                        else
                            m_TillerMan = reader.ReadItem() as object;

                        m_Hold = reader.ReadItem() as Hold;
                        m_Anchored = reader.ReadBool();
                        m_ShipName = reader.ReadString();

                        m_Anchored = false; //No more anchors[High Seas]

                        if (version < 1)
                            Refresh();

                        break;
                    }
            }

            m_Instances.Add(this);

            if (m_VirtualMount == null)
                m_VirtualMount = new BoatMountItem(this);

            if (version == 6)
            {
                if (m_MapItem != null)
                    Timer.DelayCall(TimeSpan.FromSeconds(10), delegate
                    {
                        BoatCourse = new BoatCourse(this, m_MapItem);
                    });
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:94,代码来源:BaseBoat.cs


示例14: BoatCourse

        public BoatCourse(BaseBoat boat, MapItem item)
        {
            m_Boat = boat;
            m_Map = boat.Map;
            m_GivenMap = false;

            for (int i = 0; i < item.Pins.Count; i++)
            {
                int x, y;
                item.ConvertToWorld(item.Pins[i].X, item.Pins[i].Y, out x, out y);
                m_Waypoints.Add(new Point2D(x, y));
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:13,代码来源:BaseBoat.cs


示例15: NewMapDetails

            public NewMapDetails(MapItem map)
                : base(0xF5, 21)
            {
                Map newmap = map.Map;

                if (newmap != Map.Trammel)
                    newmap = Map.Trammel;
                    
                m_Stream.Write((int)map.Serial);
                m_Stream.Write((short)0x139D);
                m_Stream.Write((short)map.Bounds.Start.X);
                m_Stream.Write((short)map.Bounds.Start.Y);
                m_Stream.Write((short)map.Bounds.End.X);
                m_Stream.Write((short)map.Bounds.End.Y);
                m_Stream.Write((short)map.Width);
                m_Stream.Write((short)map.Height);
                m_Stream.Write((short) /*( map.Facet == null ? 0 :*/ newmap.MapID);
            }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:18,代码来源:MapItem.cs


示例16: NewMapDetails

 public NewMapDetails(MapItem map)
     : base(0xF5, 21)
 {
     m_Stream.Write((int)map.Serial);
     m_Stream.Write((short)0x139D);
     m_Stream.Write((short)map.Bounds.Start.X);
     m_Stream.Write((short)map.Bounds.Start.Y);
     m_Stream.Write((short)map.Bounds.End.X);
     m_Stream.Write((short)map.Bounds.End.Y);
     m_Stream.Write((short)map.Width);
     m_Stream.Write((short)map.Height);
     m_Stream.Write((short)map.Facet.MapID);
 }
开发者ID:mcarriere,项目名称:ServUO,代码行数:13,代码来源:MapItem.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Items.MegaSpawner类代码示例发布时间:2022-05-26
下一篇:
C# Items.LockableContainer类代码示例发布时间: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