当前位置: 首页>>代码示例>>C#>>正文


C# Items.TreasureMap类代码示例

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


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

示例1: Test_Tmaps

		private static void Test_Tmaps(CommandEventArgs e)
		{
			Dictionary<UInt64, int> stats = new Dictionary<ulong, int>();
			for(int i = 0; i < 10000; ++i)
			{
				TreasureMap tmap = new TreasureMap(
					Utility.Random(7),
					Map.Felucca
				);
				UInt64 key = (UInt64)(tmap.ChestLocation.X | (tmap.ChestLocation.Y << 32));
				if (!stats.ContainsKey(key))
				{
					stats.Add(key, 1);
				}
				else
				{
					stats[key] = stats[key] + 1;
				}
			}

			e.Mobile.SendMessage(String.Format("Total Locations: {0}", stats.Count));

			int expectedAverage = 10000 / stats.Count;
			int maxDeviation = 0;
			foreach(int count in stats.Values)
			{
				maxDeviation = Math.Max(Math.Abs(expectedAverage - count), maxDeviation);
			}

			e.Mobile.SendMessage(String.Format("Max Deviation: {0}", maxDeviation));
		}
开发者ID:Crome696,项目名称:ServUO,代码行数:31,代码来源:Test.cs

示例2: OnComponentUsed

        public override void OnComponentUsed(AddonComponent component, Mobile from)
        {
            if (m_NextUse < DateTime.Now)
            {
                Container cont = from.Backpack;
                Map facet;
                int level = Utility.RandomMinMax(1, 4);

                switch (Utility.Random(6))
                {
                    default:
                    case 0: facet = Map.Trammel; break;
                    case 1: facet = Map.Ilshenar; break;
                    case 2: facet = Map.Malas; break;
                    case 3: facet = Map.Felucca; break;
                    case 4: facet = Map.Tokuno; break;
                    case 5: facet = Map.TerMur; break;
                }

                TreasureMap map = new TreasureMap(level, facet);

                if (cont == null || !cont.TryDropItem(from, map, false))
                {
                    from.BankBox.DropItem(map);
                    from.SendLocalizedMessage(1072224); // An item has been placed in your bank box.
                }
                else
                    from.SendLocalizedMessage(1072223); // An item has been placed in your backpack.

                m_NextUse = DateTime.Now + TimeSpan.FromDays(7);
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:32,代码来源:SkullRug.cs

示例3: DigTimer

			public DigTimer( Mobile from, TreasureMap treasureMap, Point3D p, Map map, int z, ChestThemeType m_type) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 1.0 ) )
			{
				
				m_From = from;
				m_TreasureMap = treasureMap;
				m_Map = map;
				m_Z = z;
				type = m_type;
				themed = m_TreasureMap.m_Themed;

				if (themed == false) themed = TreasureTheme.GetIsThemed(m_TreasureMap.Level);
					m_TreasureMap.m_Themed = themed;

				if(themed == true && type == ChestThemeType.None)
				{
					type = (ChestThemeType)TreasureTheme.GetThemeType(m_TreasureMap.Level); 
				}

				m_TreasureMap.m_type = type;
				m_Chest = new TreasureMapChest( from, m_TreasureMap.m_Level , themed, type );
				m_Chest.MoveToWorld( p, map );
				
				m_NextSkillTime = from.NextSkillTime;
				m_NextSpellTime = from.NextSpellTime;
				m_NextActionTime = from.NextActionTime;
				m_LastMoveTime = from.LastMoveTime;
			}
开发者ID:zerodowned,项目名称:angelisland,代码行数:27,代码来源:TreasureMap.cs

示例4: GetRandomSpecial

        private static Item GetRandomSpecial(int level, Map map)
        {
            Item special;

            switch (Utility.Random(8))
            {
                default:
                case 0: special = new CreepingVine(); break;
                case 1: special = new MessageInABottle(); break;
                case 2: special = new ScrollofAlacrity(PowerScroll.Skills[Utility.Random(PowerScroll.Skills.Count)]); break;
                case 3: special = new Skeletonkey(); break;
                case 4: special = new TastyTreat(5); break;
                case 5: special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), map); break;
                case 6: special = GetRandomRecipe(); break;
                case 7: special = ScrollofTranscendence.CreateRandom(1, 5); break;
            }

            return special;
        }
开发者ID:mcarriere,项目名称:ServUO,代码行数:19,代码来源:TreasureMapChest.cs

示例5: Fill

        public static void Fill(LockableContainer cont, int luck, int level, bool isSos)
        {
			// Apply Felucca luck bonus
			if (cont.Map == Map.Felucca)
				luck += Mobiles.RandomItemGenerator.FeluccaLuckBonus;

            cont.Movable = false;
            cont.Locked = true;
            int numberItems;

            if (level == 0)
            {
                cont.LockLevel = 0; // Can't be unlocked

                cont.DropItem(new Gold(Utility.RandomMinMax(50, 100)));

                if (Utility.RandomDouble() < 0.75)
                    cont.DropItem(new TreasureMap(0, Map.Trammel));
            }
            else
            {
                cont.TrapType = TrapType.ExplosionTrap;
                cont.TrapPower = level * 25;
                cont.TrapLevel = level;

                switch (level)
                {
                    case 1:
                        cont.RequiredSkill = 5;
                        break;
                    case 2:
                        cont.RequiredSkill = 45;
                        break;
                    case 3:
                        cont.RequiredSkill = 65;
                        break;
                    case 4:
                        cont.RequiredSkill = 75;
                        break;
                    case 5:
                        cont.RequiredSkill = 75;
                        break;
                    case 6:
                        cont.RequiredSkill = 80;
                        break;
					case 7:
                        cont.RequiredSkill = 80;
                        break;
                }

                cont.LockLevel = cont.RequiredSkill - 10;
                cont.MaxLockLevel = cont.RequiredSkill + 40;

                cont.DropItem(new Gold(level * 5000));

                for (int i = 0; i < level * 5; ++i)
                    cont.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));

				double propsScale = 1.0;
                if (Core.SE)
                {
                    switch (level)
                    {
                        case 1:
                            numberItems = 32;
							propsScale = 0.5625;
                            break;
                        case 2:
                            numberItems = 40;
							propsScale = 0.6875;
                            break;
                        case 3:
                            numberItems = 48;
							propsScale = 0.875;
                            break;
                        case 4:
                            numberItems = 56;
                            break;
                        case 5:
                            numberItems = 64;
                            break;
                        case 6:
                            numberItems = 72;
                            break;
                        case 7:
                            numberItems = 80;
                            break;
                        default:
                            numberItems = 0;
                            break;
                    }
                }
                else
                    numberItems = level * 6;

                for (int i = 0; i < numberItems; ++i)
                {
                    Item item;

                    if (Core.AOS)
//.........这里部分代码省略.........
开发者ID:mcarriere,项目名称:ServUO,代码行数:101,代码来源:TreasureMapChest.cs

示例6: Fill

		public static void Fill( LockableContainer cont, int level )
		{
			cont.Movable = false;
            cont.TrapType = Utility.RandomBool() ? TrapType.PoisonTrap : TrapType.ExplosionTrap;
			cont.TrapPower = level * 25;
			cont.Locked = true;

			switch ( level )
			{
					// Adam: add level 0 (trainer chests)
				case 0: cont.RequiredSkill = Utility.RandomMinMax (30, 37) ; break;
				case 1: cont.RequiredSkill = 36; break;
				case 2: cont.RequiredSkill = 76; break;
				case 3: cont.RequiredSkill = 84; break;
				case 4: cont.RequiredSkill = 92; break;
				case 5: cont.RequiredSkill = 100; break;
			}

			cont.LockLevel = cont.RequiredSkill - 10;
			cont.MaxLockLevel = cont.RequiredSkill + 40;

			// adam: change treasure map chest loot MIN-MAX so as to decrease daily take home
			if (level != 0)
				cont.DropItem( 
					new Gold( Utility.RandomMinMax( 
						(int)(((double)((level * 1000) / 3)) * .75), // min is 75% of MAX
						(level * 1000) / 3 ) ) );

            // skin tone creme for level 4 & 5 chests
            if (Utility.RandomDouble() < 0.05 && level > 3)
            {
                cont.DropItem(new SkinHueCreme());
            }

			// adam: scrolls * 3 and not 5
			for ( int i = 0; i < level * 3; ++i )
			{
				int minCircle = level;
				int maxCircle = (level + 3);
				PackScroll( cont, minCircle, maxCircle );
			}

			// plus "level chances" for magic jewelry & clothing
			switch (level)
			{
				case 0:	// Adam: trainer chest
				case 1:	// none
					break;	
				case 2:
					PackMagicItem( cont, 1, 1, 0.05 );
					break;
				case 3:
					PackMagicItem( cont, 1, 2, 0.10 );
					PackMagicItem( cont, 1, 2, 0.05 );
					break;
				case 4:
					PackMagicItem( cont, 2, 3, 0.10 );
					PackMagicItem( cont, 2, 3, 0.05 );
					PackMagicItem( cont, 2, 3, 0.02 );
					break;
				case 5:
                    PackMagicItem(cont, 3, 3, 0.10);
                    PackMagicItem(cont, 3, 3, 0.05);
                    PackMagicItem(cont, 3, 3, 0.02);
					break;
			}

			// TreasureMap( int level, Map map
			//	5% chance to get a treasure map
			//  Changed chance for tmap to 1%
			if (level != 0)
				if (Utility.RandomDouble() < 0.01)
				{
					int mlevel = level;

					//	20% chance to get a treasure map one level better than the level of this chest
					if (Utility.RandomDouble() < 0.20)
						mlevel += (level < 5) ? 1 : 0;	// bump up the map level by one

					TreasureMap map = new TreasureMap (mlevel, Map.Felucca);
					cont.DropItem( map );				// drop it baby!
				}

			// if You're doing a level 3, 4, or 5 chest you have a 1.5%, 2%, or 2.5% chance to get a monster statue
			double chance = 0.00 + (((double)level) * 0.005);
			if ( (level > 3) && (Utility.RandomDouble() < chance) )
			{
				int ndx = level - 3;
				MonsterStatuette mx =
					new MonsterStatuette(m_monsters[ndx][Utility.Random(m_monsters[ndx].Length)]);
				mx.LootType = LootType.Regular;					// not blessed
				cont.DropItem( mx );							// drop it baby!
			}

			TreasureMapChest.PackRegs(cont, level * 10);
			TreasureMapChest.PackGems(cont, level * 5);

		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:98,代码来源:DungeonTreasureChest.cs

示例7: DropTMap

		public void DropTMap(Mobile from, TMapBookEntry e, int index)
		{
			if (m_DefaultIndex == index)
			{
				m_DefaultIndex = -1;
			}

			m_Entries.RemoveAt(index);

			var tmap = new TreasureMap(e.Level, e.Map) {
				Decoder = e.Decoder,
				ChestLocation = e.Location,
				ChestMap = e.Map,
				Bounds = e.Bounds
			};

			tmap.ClearPins();
			tmap.AddWorldPin(e.Location.X, e.Location.Y);

			from.AddToBackpack(tmap);

			from.SendMessage("You have removed the Treasure Map");
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:23,代码来源:TMapBook.cs

示例8: OpenMapEntry

			public OpenMapEntry( TreasureMap map ) : base( 6150, 2 )
			{
				m_Map = map;
			}
开发者ID:Leorgrium,项目名称:runuo,代码行数:4,代码来源:TreasureMap.cs

示例9: DigTimer

			public DigTimer( Mobile from, TreasureMap treasureMap, Point3D location, Map map ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 1.0 ) )
			{
				m_From = from;
				m_TreasureMap = treasureMap;

				m_Location = location;
				m_Map = map;

				m_NextSkillTime = from.NextSkillTime;
				m_NextSpellTime = from.NextSpellTime;
				m_NextActionTime = from.NextActionTime;
				m_LastMoveTime = from.LastMoveTime;

				Priority = TimerPriority.TenMS;
			}
开发者ID:Leorgrium,项目名称:runuo,代码行数:15,代码来源:TreasureMap.cs

示例10: CheckTreasureMap

        public static bool CheckTreasureMap( TreasureMap map, double award )
        {
            if ( map.Level == 1 && award == 5 )
                return true;

            if ( map.Level == 2 && award == 8 )
                return true;

            if ( map.Level == 3 && award == 11 )
                return true;

            if ( map.Level == 4 && award == 14 )
                return true;

            if ( map.Level == 5 && award == 17 )
                return true;

            if ( map.Level == 6 && award == 20 )
                return true;

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

示例11: InternalTimer

            public InternalTimer(Mobile from, Double minskilllevel, TreasureMap map) : base(TimeSpan.FromSeconds(3.0))
            {
                m_From = from;
                m_MinSkillLevel = minskilllevel;
                m_TreasureMap = map;

                if (from is PlayerMobile)
                    ((PlayerMobile)from).ResetPlayerAction(this);
            }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:9,代码来源:TreasureMap.cs

示例12: GiveReward

		public static Item GiveReward( Mobile from, Item tool )
		{
			int bonus = 1;

			if ( tool is SturdyShovel )
				bonus = 2;

			if ( tool is GraveDiggersShovel )
				bonus = 4;

			if ( tool is GoldenShovel )
				bonus = 6;

			if ( tool is DiamondShovel )
				bonus = 8;

			if ( tool is SummonShovel )
				bonus = 10;

			Item i = null;

			try
			{
				Double chance = from.Skills[SkillName.Forensics].Value / 50 * bonus;
				
				if ( Utility.Random( 200 ) <= chance && from.Skills[SkillName.Forensics].Value >= 80 )
				{
					i = Activator.CreateInstance( m_EnhancedLoot[Utility.Random( m_EnhancedLoot.Length )] ) as Item;
					from.SendMessage( "You find something extraordinary!" );
				}
				else if ( Utility.Random( 100 ) < 15 )
				{

					i = new TreasureMap( Utility.RandomMinMax( 1, 7 ), from.Map );
					from.SendMessage( "You find a treasure map!" );
				}
				else
				{
					i = Activator.CreateInstance( m_GenericLoot[Utility.Random( m_GenericLoot.Length )] ) as Item;
					from.SendMessage( "You find something buried in the grave!" );
				}
			}
			catch
			{
			}

			if ( i.Stackable == true )
				i.Amount = Utility.RandomMinMax( 2, 10 ) * bonus;

			//TODO: Add chance to spawn mini boss from grave digging.

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

示例13: Construct

        private TreasureMap Construct(TreasureMapEntry entry)
        {
            if (entry == null)
                return null;

            TreasureMap map = new TreasureMap();
            map.ChestLocation = new Point2D(entry.Location.X, entry.Location.Y);

            map.Level = entry.Level;
            map.Facet = entry.Map;

            map.Completed = entry.Completed;
            map.CompletedBy = entry.CompletedBy;
            map.Decoder = entry.Decoder;
            map.NextReset = entry.NextReset;

            map.Width = 300;
            map.Height = 300;
            int x = entry.Location.X;
            int y = entry.Location.Y;
            int width, height;
            Map facet = entry.Map;

            map.GetWidthAndHeight(facet, out width, out height);

            int x1 = x - Utility.RandomMinMax(width / 4, (width / 4) * 3);
            int y1 = y - Utility.RandomMinMax(height / 4, (height / 4) * 3);

            if (x1 < 0) x1 = 0;
            if (y1 < 0) y1 = 0;

            int x2, y2;

            map.AdjustMap(facet, out x2, out y2, x1, y1, width, height);

            x1 = x2 - width;
            y1 = y2 - height;

            map.Bounds = new Rectangle2D(x1, y1, width, height);
            map.Protected = true;

            map.AddWorldPin(x, y);

            return map;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:45,代码来源:DaviesLocker.cs

示例14: TreasureMapEntry

 public TreasureMapEntry(TreasureMap map) : base(map.Facet, new Point3D(map.ChestLocation.X, map.ChestLocation.Y, 0), map.Level)
 {
     m_Completed = map.Completed;
     m_CompletedBy = map.CompletedBy;
     m_Decoder = map.Decoder;
     m_NextReset = map.NextReset;
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:DaviesLocker.cs

示例15: OverlandTreasureHunter

		public OverlandTreasureHunter()
		{
			SpeechHue = Utility.RandomDyedHue();
			Title = "the treasure hunter";

			SetStr( 96, 115 );
			SetDex( 86, 105 );
			SetInt( 51, 65 );

			SetDamage( 23, 27 );

			SetSkill( SkillName.Anatomy, 60.0, 82.5 );
			SetSkill( SkillName.Wrestling, 88.5, 100.0 );
			SetSkill( SkillName.MagicResist, 88.5, 100.0 );
			SetSkill( SkillName.Tactics, 60.0, 82.5 );

			Fame = 2500;
			Karma = -2500;

			// Configure our treasuremap
			TreasureMap map = new TreasureMap( 5, Map.Felucca );
			map.LootType = LootType.Newbied;
			map.Themed = true;
			map.Theme = TreasureTheme.RandomOverlandTheme();
			map.Decoder = this;
			PackItem( map );

			// configure our distination (to the chest)
			Destination = new Point3D(map.ChestLocation,0).ToString();

			Shovel shovel = new Shovel( );
			shovel.LootType = LootType.Newbied;
			PackItem( shovel );

			Runebook book = new Runebook( );
			book.LootType = LootType.Newbied;
			book.Name = "Fromm's treasure hunting guide";
			AddItem( book );

			Item light = null;
			if (Utility.RandomBool())
				light = new Lantern();
			else
				light = new Torch();
			PackItem( light );

			// select a gem for payment
			m_GemIndex = Utility.Random(TreasureMapChest.m_GemTypes.Length);
			m_GemsRequired = 50 * (2 + Utility.Random( 9 )); // 100-500

			PackItem( new Bandage( Utility.RandomMinMax( 1, 15 ) ) );
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:52,代码来源:OverlandTreasureHunter.cs


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