Inheritance: Server.Items.MapItem
Esempio n. 1
0
		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));
		}
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
		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");
		}
Esempio n. 4
0
			public OpenMapEntry( TreasureMap map ) : base( 6150, 2 )
			{
				m_Map = map;
			}
Esempio n. 5
0
			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;
			}
        public NoxGreenDonationBoxAos()
        {
            Weight = 1.0;
            Hue = 1420;
            Item item = null;
            Name = "Defiance Nox Green Member Box of Holding";

            CharacterCreation.PlaceItemIn(this, 16, 60, (item = new DonationSkillBall( 25, false )));
            CharacterCreation.PlaceItemIn(this, 28, 60, (item = new DonationSkillBall( 25, false )));
            CharacterCreation.PlaceItemIn(this, 40, 60, (item = new DonationSkillBall( 25, false )));

            CharacterCreation.PlaceItemIn(this, 16, 81, (item = new HoodedShroudOfShadows()));
            item.Hue = 1420;
            item.Name = "Nox Shroud of Shadows";
                        item.LootType = LootType.Blessed;

            BaseContainer cont;
            CharacterCreation.PlaceItemIn(this, 58, 57, (cont = new Backpack()));
            cont.Hue = 1420;
            cont.Name = "a donation backpack";

            CharacterCreation.PlaceItemIn(cont, 44, 65, new SulfurousAsh(10000));
            CharacterCreation.PlaceItemIn(cont, 77, 65, new Nightshade(10000));
            CharacterCreation.PlaceItemIn(cont, 110, 65, new SpidersSilk(10000));
            CharacterCreation.PlaceItemIn(cont, 143, 65, new Garlic(10000));

            CharacterCreation.PlaceItemIn(cont, 44, 128, new Ginseng(10000));
            CharacterCreation.PlaceItemIn(cont, 77, 128, new Bloodmoss(10000));
            CharacterCreation.PlaceItemIn(cont, 110, 128, new BlackPearl(10000));
            CharacterCreation.PlaceItemIn(cont, 143, 128, new MandrakeRoot(10000));

            //CharacterCreation.PlaceItemIn(this, 74, 64, new DonationBandana());
            //Replaced the bandana with a deed - Edit by Blady
            CharacterCreation.PlaceItemIn(this, 74, 64, (item = new DonationDeed()));
            item.Hue = 1420;

            CharacterCreation.PlaceItemIn(this, 103, 58, (item = new Sandals()));
            item.Hue = 1420; //Utility.RandomList(1420, 1281, 1161, 1420, 1420, 1420, 1266, 1420, 1420, 1645);
            item.LootType = LootType.Blessed;

            CharacterCreation.PlaceItemIn( this, 122, 53, new SpecialDonateDye() );
            CharacterCreation.PlaceItemIn(this, 11420, 53, (item = new PigmentsOfTokuno( 5 )));
            ((PigmentsOfTokuno)item).Type = PigmentType.NoxGreen;
            CharacterCreation.PlaceItemIn(this, 156, 55, (item = new EtherealHorse()));
            item.Hue = 1420;
            item.Name = "No Age Ethereal";
            ((EtherealMount)item).IsDonationItem = true;

            CharacterCreation.PlaceItemIn(this, 34, 83, (item = new HolyDeedofBlessing()));
            item.Hue = 1420;
            CharacterCreation.PlaceItemIn(this, 43, 83, (item = new ClothingBlessDeed()));
            item.Hue = 1420;
            CharacterCreation.PlaceItemIn(this, 58, 83, (item = new TreasureMap(6, Map.Felucca)));
            item.Hue = 1420;
            CharacterCreation.PlaceItemIn(this, 73, 83, (item = new SmallBrickHouseDeed()));
            item.Hue = 1420;
            CharacterCreation.PlaceItemIn(this, 88, 83, (item = new NameChangeDeed()));
            item.Hue = 1420;
            CharacterCreation.PlaceItemIn(this, 103, 83, (item = new MiniHouseDeed()));
            item.Hue = 1420;
            //CharacterCreation.PlaceItemIn(this, 118, 83, (item = new BankCheck(100000)));
            //item.Hue = 1420;
            CharacterCreation.PlaceItemIn(this, 130, 83, (item = new MembershipTicket()));
            item.Hue = 1420;
            ((MembershipTicket)item).MemberShipTime = TimeSpan.MaxValue;
        }
Esempio n. 7
0
        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;
        }
        public static Item GetSmallRewardItem(int level)
        {
            Type[] itemtypes = SmallRewardItems[level];
			Type itemType = itemtypes[Utility.Random( itemtypes.Length )];

            Item item = null;

            if (itemType == typeof(TreasureMap))
                item = new TreasureMap(level + Utility.RandomMinMax(2, 3), Map.Felucca);
            else
                item = (Item)Activator.CreateInstance(itemType);

            return item;
        }
Esempio n. 9
0
        public void DropTMap(Mobile from, DaviesLockerEntry e, int index)
        {
            if (m_DefaultIndex == index)
                m_DefaultIndex = -1;

            m_Entries.RemoveAt(index);

            if (e.type == 1)
            {
                TreasureMap tmap = new TreasureMap(e.Level, e.Map)
                {
                    Decoder = e.Decoder,
                    ChestLocation = e.Location2d,
                    ChestMap = e.Map,
                    Bounds = e.Bounds
                };

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

                from.AddToBackpack(tmap);

                from.SendMessage("You have removed the Treasure Map");
            }
            else if (e.type == 2)
            {
                SOS sos = new SOS(e.Map, e.Level) {TargetLocation = e.Location3d};

                from.AddToBackpack(sos);
                from.SendMessage("You have removed the S.O.S.");
            }
            else
            {
                MessageInABottle mib = new MessageInABottle(e.Map, e.Level);

                from.AddToBackpack(mib);
                from.SendMessage("You have removed the message in a bottle");
            }
        }
Esempio n. 10
0
 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;
 }
Esempio n. 11
0
        public static void Fill(Mobile from, LockableContainer cont, int level, bool isSos)
        {
            Map map  = from.Map;
            int luck = from is PlayerMobile ? ((PlayerMobile)from).RealLuck : from.Luck;

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

            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;

                #region Gold
                cont.DropItem(new Gold(isSos ? level * 10000 : level * 5000));
                #endregion

                #region Scrolls
                if (isSos)
                {
                    switch (level)
                    {
                    default: count = 20; break;

                    case 0:
                    case 1: count = Utility.RandomMinMax(2, 5); break;

                    case 2: count = Utility.RandomMinMax(10, 15); break;
                    }
                }
                else
                {
                    count = level * 5;
                }

                for (int i = 0; i < count; ++i)
                {
                    cont.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                }
                #endregion

                #region Magical Items
                double propsScale = 1.0;

                switch (level)
                {
                case 1:
                    count      = isSos ? Utility.RandomMinMax(2, 6) : 32;
                    propsScale = 0.5625;
                    break;

                case 2:
                    count      = isSos ? Utility.RandomMinMax(10, 15) : 40;
                    propsScale = 0.6875;
                    break;

                case 3:
                    count      = isSos ? Utility.RandomMinMax(15, 20) : 48;
                    propsScale = 0.875;
                    break;

                case 4:
                    count = isSos ? Utility.RandomMinMax(15, 20) : 56;
                    break;

                case 5:
                    count = isSos ? Utility.RandomMinMax(15, 20) : 64;
                    break;

                case 6:
                    count = isSos ? Utility.RandomMinMax(15, 20) : 72;
                    break;

                case 7:
                    count = isSos ? Utility.RandomMinMax(15, 20) : 80;
                    break;

                default:
                    count = 0;
                    break;
                }

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

                    item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                    if (item != null && RandomItemGenerator.Enabled)
                    {
                        int min, max;
                        GetRandomItemStat(out min, out max, propsScale);

                        RunicReforging.GenerateRandomItem(item, luck, min, max, map);

                        cont.DropItem(item);
                    }
                    else if (item is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)item;

                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);

                        cont.DropItem(item);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseArmor armor = (BaseArmor)item;

                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);

                        cont.DropItem(item);
                    }
                    else if (item is BaseHat)
                    {
                        BaseHat hat = (BaseHat)item;

                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);

                        cont.DropItem(item);
                    }
                    else if (item is BaseJewel)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);

                        cont.DropItem(item);
                    }
                }
            }
            #endregion

            #region Reagents
            if (isSos)
            {
                switch (level)
                {
                default: count = Utility.RandomMinMax(45, 60); break;

                case 0:
                case 1: count = Utility.RandomMinMax(15, 20); break;

                case 2: count = Utility.RandomMinMax(25, 40); break;
                }
            }
            else
            {
                count = level == 0 ? 12 : Utility.RandomMinMax(40, 60) * (level + 1);
            }

            for (int i = 0; i < count; i++)
            {
                cont.DropItemStacked(Loot.RandomPossibleReagent());
            }
            #endregion

            #region Gems
            if (level == 0)
            {
                count = 2;
            }
            else
            {
                count = (level * 3) + 1;
            }

            for (int i = 0; i < count; i++)
            {
                cont.DropItem(Loot.RandomGem());
            }
            #endregion

            #region Imbuing Ingreds
            if (level > 1)
            {
                Item item = Loot.Construct(m_ImbuingIngreds[Utility.Random(m_ImbuingIngreds.Length)]);

                item.Amount = level;
                cont.DropItem(item);
            }
            #endregion

            Item arty       = null;
            Item special    = null;
            Item newSpecial = null;

            if (isSos)
            {
                if (0.004 * level > Utility.RandomDouble())
                {
                    arty = Loot.Construct(m_SOSArtifacts);
                }
                if (0.006 * level > Utility.RandomDouble())
                {
                    special = Loot.Construct(m_SOSDecor);
                }
                else if (0.009 * level > Utility.RandomDouble())
                {
                    special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), cont.Map);
                }

                if (level >= 4)
                {
                    switch (Utility.Random(4))
                    {
                    case 0: newSpecial = new AncientAquariumFishNet(); break;

                    case 1: newSpecial = new LiveRock(); break;

                    case 2: newSpecial = new SaltedSerpentSteaks(); break;

                    case 3: newSpecial = new OceanSapphire(); break;
                    }
                }
            }
            else
            {
                if (level >= 7)
                {
                    if (0.025 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelSevenOnly);
                    }
                    else if (0.10 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.25 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 6)
                {
                    if (0.025 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.20 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 5)
                {
                    if (0.005 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.15 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (.10 > Utility.RandomDouble())
                {
                    special = GetRandomSpecial(level, cont.Map);
                }

                if (Engines.Points.PointsSystem.JollyRogerData.Enabled && .30 > Utility.RandomDouble())
                {
                    cont.DropItem(new MysteriousFragment());
                }
            }

            if (arty != null)
            {
                Container pack = new Backpack();
                pack.Hue = 1278;

                pack.DropItem(arty);
                cont.DropItem(pack);
            }

            if (special != null)
            {
                cont.DropItem(special);
            }

            if (newSpecial != null)
            {
                cont.DropItem(newSpecial);
            }

            int rolls = 2;

            if (level >= 5)
            {
                rolls += level - 2;
            }

            RefinementComponent.Roll(cont, rolls, 0.10);
        }
		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 ) ) );
		}
Esempio n. 13
0
        public ParagonChest(string name, string title, int level, Mobile from) : base(Utility.RandomList(m_ItemIDs))
        {
            int tMapLevel = level;

            level = level + 4;
            if (level > 7)
            {
                level = 7;
            }

            m_Name = name;
            if (title != "" && title != null)
            {
                m_Name = name + " " + title;
            }

            Hue = Utility.RandomList(m_Hues);

            if (level > 0)
            {
                ContainerFunctions.FillTheContainer(level, this, from);
            }
            if (level > 3)
            {
                ContainerFunctions.FillTheContainer(level, this, from);
            }
            if (level > 7)
            {
                ContainerFunctions.FillTheContainer(level, this, from);
            }

            ContainerFunctions.LockTheContainer(level, this, 1);

            int xTraCash = Utility.RandomMinMax((level * 600), (level * 900));

            ContainerFunctions.AddGoldToContainer(xTraCash, this, 0, from);

            if (Utility.RandomMinMax(0, 100) < (level * 5))
            {
                Item arty = ArtifactBuilder.CreateArtifact("random");
                DropItem(arty);
                BaseContainer.DropItemFix(arty, from, ItemID, GumpID);
            }

            Map tMap = Map.Sosaria;

            switch (Utility.RandomMinMax(0, 4))
            {
            case 0: tMap = Map.Sosaria; break;

            case 1: tMap = Map.Lodor; break;

            case 2: tMap = Map.SerpentIsland; break;

            case 3: tMap = Map.IslesDread; break;

            case 4: tMap = Map.SavagedEmpire; break;

            case 5: tMap = Map.Underworld; break;
            }

            Point3D loc = new Point3D(200, 200, 0);
            Item    map = new TreasureMap(tMapLevel, tMap, loc, 200, 200);

            DropItem(map);
            BaseContainer.DropItemFix(map, from, ItemID, GumpID);

            int  giveRelics = level;
            Item relic      = Loot.RandomRelic();

            while (giveRelics > 0)
            {
                relic = Loot.RandomRelic();
                ContainerFunctions.RelicValueIncrease(level, relic);
                BaseContainer.DropItemFix(relic, from, ItemID, GumpID);
                DropItem(relic);
                giveRelics = giveRelics - 1;
            }
        }
		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);

		}
Esempio n. 15
0
        public static void Fill(LockableContainer cont, int luck, int level, bool isSos)
        {
            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));
                }

                /*
                 *              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;

                    item = Loot.RandomArmorOrShieldOrWeapon();

                    if (item is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)item;

                        weapon.DamageLevel     = (WeaponDamageLevel)Utility.Random(6);
                        weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                        weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);

                        cont.DropItem(item);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseArmor armor = (BaseArmor)item;

                        armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                        armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);

                        cont.DropItem(item);
                    }
                    else if (item is BaseHat)
                    {
                        BaseHat hat = (BaseHat)item;

                        cont.DropItem(item);
                    }
                    else if (item is BaseJewel)
                    {
                        cont.DropItem(item);
                    }
                }
            }

            int reagents;

            if (level == 0)
            {
                reagents = 12;
            }
            else
            {
                reagents = level + 1;
            }

            for (int i = 0; i < reagents; i++)
            {
                Item item = Loot.RandomReagent();
                item.Amount = Utility.RandomMinMax(40, 60);
                cont.DropItem(item);
            }

            int gems;

            if (level == 0)
            {
                gems = 2;
            }
            else
            {
                gems = (level * 3) + 1;
            }

            for (int i = 0; i < gems; i++)
            {
                Item item = Loot.RandomGem();
                cont.DropItem(item);
            }

            //   Item arty = null;
            Item special = null;

            if (isSos)
            {
                if (0.009 * level > Utility.RandomDouble())
                {
                    special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), cont.Map);
                }
            }
            else
            {
                if (level >= 7)
                {
                    if (0.25 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (level >= 6)
                {
                    if (0.10 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (level >= 5)
                {
                    if (0.25 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (.10 > Utility.RandomDouble())
                {
                    special = GetRandomSpecial(level, cont.Map);
                }
            }

            if (special != null)
            {
                cont.DropItem(special);
            }
        }
Esempio n. 16
0
			public CartGump( TreasureMap tmap, MessageEntry entry, Map map, Point2D loc ) : base( (640 - entry.Width) / 2, (480 - entry.Height) / 2 )
			{
				string fmtx;
				string fmty;
				Tmap = tmap;

				fmtx = String.Format( xc.ToString() );
				fmty = String.Format( yc.ToString() );

				AddPage( 0 );
				AddBackground( 0, 0, entry.Width, entry.Height, 2520 );
				AddHtml( 38, 38, entry.Width - 83, entry.Height - 86, String.Format( "From what you can tell, the location of the treasure is at these coordinates." ), false, false );
				AddHtml( 30, 120, 120, 30, fmtx, false, false );
				AddHtml( 90, 120, 120, 90, fmty, false, false );
			}
Esempio n. 17
0
        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;
        }
        private static void CreateItens(bool pImportItensToPlayer)
        {
            Bag bagItens = new Bag();
            bagItens.Name = "Itens de " + sphereCharName;
            bagItens.Hue = 1153;

            Bag bagGold = new Bag();
            Bag bagOres = new Bag();
            Bag bagIngots = new Bag();
            Bag bagArmor = new Bag();
            Bag bagWeapon = new Bag();
            Bag bagMount = new Bag();
            Bag bagOther = new Bag();
            Bag bagPotion = new Bag();
            Bag bagRegs = new Bag();
            Bag bagCloth = new Bag();
            Bag bagContainer = new Bag();
            Bag bagMaps = new Bag();

            Bag bagPlateOutras = new Bag();
            bagPlateOutras.Hue = DimensionsNewAge.Scripts.HueOreConst.HueIron;
            bagArmor.DropItem(bagPlateOutras);

            Bag bagPlateRusty = new Bag();
            bagPlateRusty.Hue = DimensionsNewAge.Scripts.HueOreConst.HueRusty;
            bagArmor.DropItem(bagPlateRusty);

            Bag bagPlateOldCopper = new Bag();
            bagArmor.DropItem(bagPlateOldCopper);
            bagPlateOldCopper.Hue = DimensionsNewAge.Scripts.HueOreConst.HueOldCopper;

            Bag bagPlateDullCopper = new Bag();
            bagArmor.DropItem(bagPlateDullCopper);
            bagPlateDullCopper.Hue = DimensionsNewAge.Scripts.HueOreConst.HueDullCopper;

            Bag bagPlateRuby = new Bag();
            bagPlateRuby.Hue = DimensionsNewAge.Scripts.HueOreConst.HueRuby;
            bagArmor.DropItem(bagPlateRuby);

            Bag bagPlateCopper = new Bag();
            bagPlateCopper.Hue = DimensionsNewAge.Scripts.HueOreConst.HueCopper;
            bagArmor.DropItem(bagPlateCopper);

            Bag bagPlateBronze = new Bag();
            bagPlateBronze.Hue = DimensionsNewAge.Scripts.HueOreConst.HueBronze;
            bagArmor.DropItem(bagPlateBronze);

            Bag bagPlateShadowIron = new Bag();
            bagPlateShadowIron.Hue = DimensionsNewAge.Scripts.HueOreConst.HueShadow;
            bagArmor.DropItem(bagPlateShadowIron);

            Bag bagPlateSilver = new Bag();
            bagPlateSilver.Hue = DimensionsNewAge.Scripts.HueOreConst.HueSilver;
            bagArmor.DropItem(bagPlateSilver);

            Bag bagPlateMercury = new Bag();
            bagPlateMercury.Hue = DimensionsNewAge.Scripts.HueOreConst.HueMercury;
            bagArmor.DropItem(bagPlateMercury);

            Bag bagPlateRose = new Bag();
            bagPlateRose.Hue = DimensionsNewAge.Scripts.HueOreConst.HueRose;
            bagArmor.DropItem(bagPlateRose);

            Bag bagPlateGold = new Bag();
            bagPlateGold.Hue = DimensionsNewAge.Scripts.HueOreConst.HueGold;
            bagArmor.DropItem(bagPlateGold);

            Bag bagPlateAgapite = new Bag();
            bagPlateAgapite.Hue = DimensionsNewAge.Scripts.HueOreConst.HueAgapite;
            bagArmor.DropItem(bagPlateAgapite);

            Bag bagPlateVerite = new Bag();
            bagPlateVerite.Hue = DimensionsNewAge.Scripts.HueOreConst.HueVerite;
            bagArmor.DropItem(bagPlateVerite);

            Bag bagPlatePlutonio = new Bag();
            bagPlatePlutonio.Hue = DimensionsNewAge.Scripts.HueOreConst.HuePlutonio;
            bagArmor.DropItem(bagPlatePlutonio);

            Bag bagPlateBloodRock = new Bag();
            bagPlateBloodRock.Hue = DimensionsNewAge.Scripts.HueOreConst.HueBloodRock;
            bagArmor.DropItem(bagPlateBloodRock);

            Bag bagPlateValorite = new Bag();
            bagPlateValorite.Hue = DimensionsNewAge.Scripts.HueOreConst.HueValorite;
            bagArmor.DropItem(bagPlateValorite);

            Bag bagPlateBlackRock = new Bag();
            bagPlateBlackRock.Hue = DimensionsNewAge.Scripts.HueOreConst.HueBlackRock;
            bagArmor.DropItem(bagPlateBlackRock);

            Bag bagPlateMytheril = new Bag();
            bagPlateMytheril.Hue = DimensionsNewAge.Scripts.HueOreConst.HueAqua;
            bagArmor.DropItem(bagPlateMytheril);

            Bag bagPlateAqua = new Bag();
            bagPlateAqua.Hue = DimensionsNewAge.Scripts.HueOreConst.HueAqua;
            bagArmor.DropItem(bagPlateAqua);

            bagItens.DropItem(bagOres);
            bagItens.DropItem(bagIngots);
            bagItens.DropItem(bagArmor);
            bagItens.DropItem(bagWeapon);
            bagItens.DropItem(bagMount);
            bagItens.DropItem(bagOther);
            bagItens.DropItem(bagGold);
            bagItens.DropItem(bagPotion);
            bagItens.DropItem(bagRegs);
            bagItens.DropItem(bagCloth);
            bagItens.DropItem(bagContainer);
            bagItens.DropItem(bagMaps);

            Spellbook book = new Spellbook();
            book.Content = ulong.MaxValue;
            bagItens.DropItem(book);
            bagItens.DropItem(new Runebook());
            bagItens.DropItem(new Runebook());

            if (pImportItensToPlayer)
            {
                foreach (Mobile mobile in World.Mobiles.Values)
                {
                    if (mobile is PlayerMobile && mobile.Account.Username == runuoAccName && mobile.Name == runuoCharName)
                    {
                        mobile.BankBox.DropItem(bagItens);
                        break;
                    }
                }
            }
            else
            {
                caller.Backpack.DropItem(bagItens);
            }

            foreach (SphereItemClass sphereItem in sphereItensListToAcc)
            {

                try
                {
                    object item;

                    if (sphereItem.itemType == typeof(TreasureMap))
                        item = new TreasureMap(new Random().Next(1, 3), Map.Felucca);
                    else
                        item = RewardUtil.CreateRewardInstance(sphereItem.itemType);

                    if (item is Item)
                    {
                        if (((Item)item).Stackable)
                        {
                            ((Item)item).Amount = sphereItem.qtAmount;
                        }
                    }

                    if (item is BaseOre)
                    {
                        bagOres.DropItem((Item)item);
                    }
                    else if (item is Gold)
                    {
                        bagGold.DropItem((Item)item);
                    }
                    else if (item is BaseIngot)
                    {
                        bagIngots.DropItem((Item)item);
                    }
                    else if (item is BaseWeapon)
                    {
                        bagWeapon.DropItem((Item)item);
                    }
                    else if (item is BaseReagent)
                    {
                        bagRegs.DropItem((Item)item);
                    }
                    else if (item is LockableContainer)
                    {
                        bagContainer.DropItem((Item)item);
                    }
                    else if (item is TreasureMap)
                    {
                        bagMaps.DropItem((Item)item);
                    }
                    else if (item is BaseArmor)
                    {

                        bagPlateOutras.DropItem((Item)item);

                        if (item is PlateChestRusty
                            || item is PlateArmsRusty
                            || item is PlateLegsRusty
                            || item is PlateCloseHelmRusty
                            || item is PlateGorgetRusty
                            || item is PlateGlovesRusty
                            || item is SwordRusty
                            || item is WarMaceRusty
                            || item is KryssRusty
                            || item is WarMaceRusty
                            || item is HeaterShieldRusty
                            || item is BowRusty)
                        {
                            bagPlateRusty.DropItem((Item)item);
                        }

                        if (item is PlateChestOldCopper
                            || item is PlateArmsOldCopper
                            || item is PlateLegsOldCopper
                            || item is PlateCloseHelmOldCopper
                            || item is PlateGorgetOldCopper
                            || item is PlateGlovesOldCopper
                            || item is SwordOldCopper
                            || item is WarMaceOldCopper
                            || item is KryssOldCopper
                            || item is WarMaceOldCopper
                            || item is HeaterShieldOldCopper
                            || item is BowOldCopper)
                        {
                            bagPlateOldCopper.DropItem((Item)item);
                        }

                        if (item is PlateChestDullCopper
                            || item is PlateArmsDullCopper
                            || item is PlateLegsDullCopper
                            || item is PlateCloseHelmDullCopper
                            || item is PlateGorgetDullCopper
                            || item is PlateGlovesDullCopper
                            || item is SwordDullCopper
                            || item is WarMaceDullCopper
                            || item is KryssDullCopper
                            || item is WarMaceDullCopper
                            || item is HeaterShieldDullCopper
                            || item is BowDullCopper)
                        {
                            bagPlateDullCopper.DropItem((Item)item);
                        }

                        if (item is PlateChestRuby
                            || item is PlateArmsRuby
                            || item is PlateLegsRuby
                            || item is PlateCloseHelmRuby
                            || item is PlateGorgetRuby
                            || item is PlateGlovesRuby
                            || item is SwordRuby
                            || item is WarMaceRuby
                            || item is KryssRuby
                            || item is WarMaceRuby
                            || item is HeaterShieldRuby
                            || item is BowRuby)
                        {
                            bagPlateRuby.DropItem((Item)item);
                        }

                        if (item is PlateChestCopper
                            || item is PlateArmsCopper
                            || item is PlateLegsCopper
                            || item is PlateCloseHelmCopper
                            || item is PlateGorgetCopper
                            || item is PlateGlovesCopper
                            || item is SwordCopper
                            || item is WarMaceCopper
                            || item is KryssCopper
                            || item is WarMaceCopper
                            || item is HeaterShieldCopper
                            || item is BowCopper)
                        {
                            bagPlateCopper.DropItem((Item)item);
                        }

                        if (item is PlateChestBronze
                            || item is PlateArmsBronze
                            || item is PlateLegsBronze
                            || item is PlateCloseHelmBronze
                            || item is PlateGorgetBronze
                            || item is PlateGlovesBronze
                            || item is SwordBronze
                            || item is WarMaceBronze
                            || item is KryssBronze
                            || item is WarMaceBronze
                            || item is HeaterShieldBronze
                            || item is BowBronze)
                        {
                            bagPlateBronze.DropItem((Item)item);
                        }

                        if (item is PlateChestShadow
                            || item is PlateArmsShadow
                            || item is PlateLegsShadow
                            || item is PlateCloseHelmShadow
                            || item is PlateGorgetShadow
                            || item is PlateGlovesShadow
                            || item is SwordShadow
                            || item is WarMaceShadow
                            || item is KryssShadow
                            || item is WarMaceShadow
                            || item is HeaterShieldShadow
                            || item is BowShadow)
                        {
                            bagPlateShadowIron.DropItem((Item)item);
                        }

                        if (item is PlateChestSilver
                            || item is PlateArmsSilver
                            || item is PlateLegsSilver
                            || item is PlateCloseHelmSilver
                            || item is PlateGorgetSilver
                            || item is PlateGlovesSilver
                            || item is SwordSilver
                            || item is WarMaceSilver
                            || item is KryssSilver
                            || item is WarMaceSilver
                            || item is HeaterShieldSilver
                            || item is BowSilver)
                        {
                            bagPlateSilver.DropItem((Item)item);
                        }

                        if (item is PlateChestMercury
                            || item is PlateArmsMercury
                            || item is PlateLegsMercury
                            || item is PlateCloseHelmMercury
                            || item is PlateGorgetMercury
                            || item is PlateGlovesMercury
                            || item is SwordMercury
                            || item is WarMaceMercury
                            || item is KryssMercury
                            || item is WarMaceMercury
                            || item is HeaterShieldMercury
                            || item is BowMercury)
                        {
                            bagPlateMercury.DropItem((Item)item);
                        }

                        if (item is PlateChestRose
                            || item is PlateArmsRose
                            || item is PlateLegsRose
                            || item is PlateCloseHelmRose
                            || item is PlateGorgetRose
                            || item is PlateGlovesRose
                            || item is SwordRose
                            || item is WarMaceRose
                            || item is KryssRose
                            || item is WarMaceRose
                            || item is HeaterShieldRose
                            || item is BowRose)
                        {
                            bagPlateRose.DropItem((Item)item);
                        }

                        if (item is PlateChestGold
                            || item is PlateArmsGold
                            || item is PlateLegsGold
                            || item is PlateCloseHelmGold
                            || item is PlateGorgetGold
                            || item is PlateGlovesGold
                            || item is SwordGold
                            || item is WarMaceGold
                            || item is KryssGold
                            || item is WarMaceGold
                            || item is HeaterShieldGold
                            || item is BowGold)
                        {
                            bagPlateGold.DropItem((Item)item);
                        }

                        if (item is PlateChestAgapite
                            || item is PlateArmsAgapite
                            || item is PlateLegsAgapite
                            || item is PlateCloseHelmAgapite
                            || item is PlateGorgetAgapite
                            || item is PlateGlovesAgapite
                            || item is SwordAgapite
                            || item is WarMaceAgapite
                            || item is KryssAgapite
                            || item is WarMaceAgapite
                            || item is HeaterShieldAgapite
                            || item is BowAgapite)
                        {
                            bagPlateAgapite.DropItem((Item)item);
                        }

                        if (item is PlateChestVerite
                            || item is PlateArmsVerite
                            || item is PlateLegsVerite
                            || item is PlateCloseHelmVerite
                            || item is PlateGorgetVerite
                            || item is PlateGlovesVerite
                            || item is SwordVerite
                            || item is WarMaceVerite
                            || item is KryssVerite
                            || item is WarMaceVerite
                            || item is HeaterShieldVerite
                            || item is BowVerite)
                        {
                            bagPlateVerite.DropItem((Item)item);
                        }

                        if (item is PlateChestPlutonio
                            || item is PlateArmsPlutonio
                            || item is PlateLegsPlutonio
                            || item is PlateCloseHelmPlutonio
                            || item is PlateGorgetPlutonio
                            || item is PlateGlovesPlutonio
                            || item is SwordPlutonio
                            || item is WarMacePlutonio
                            || item is KryssPlutonio
                            || item is WarMacePlutonio
                            || item is HeaterShieldPlutonio
                            || item is BowPlutonio)
                        {
                            bagPlatePlutonio.DropItem((Item)item);
                        }

                        if (item is PlateChestBloodRock
                            || item is PlateArmsBloodRock
                            || item is PlateLegsBloodRock
                            || item is PlateCloseHelmBloodRock
                            || item is PlateGorgetBloodRock
                            || item is PlateGlovesBloodRock
                            || item is SwordBloodRock
                            || item is WarMaceBloodRock
                            || item is KryssBloodRock
                            || item is WarMaceBloodRock
                            || item is HeaterShieldBloodRock
                            || item is BowBloodRock)
                        {
                            bagPlateBloodRock.DropItem((Item)item);
                        }

                        if (item is PlateChestValorite
                            || item is PlateArmsValorite
                            || item is PlateLegsValorite
                            || item is PlateCloseHelmValorite
                            || item is PlateGorgetValorite
                            || item is PlateGlovesValorite
                            || item is SwordValorite
                            || item is WarMaceValorite
                            || item is KryssValorite
                            || item is WarMaceValorite
                            || item is HeaterShieldValorite
                            || item is BowValorite)
                        {
                            bagPlateValorite.DropItem((Item)item);
                        }

                        if (item is PlateChestBlackRock
                            || item is PlateArmsBlackRock
                            || item is PlateLegsBlackRock
                            || item is PlateCloseHelmBlackRock
                            || item is PlateGorgetBlackRock
                            || item is PlateGlovesBlackRock
                            || item is SwordBlackRock
                            || item is WarMaceBlackRock
                            || item is KryssBlackRock
                            || item is WarMaceBlackRock
                            || item is HeaterShieldBlackRock
                            || item is BowBlackRock)
                        {
                            bagPlateBlackRock.DropItem((Item)item);
                        }

                        if (item is PlateChestMytheril
                            || item is PlateArmsMytheril
                            || item is PlateLegsMytheril
                            || item is PlateCloseHelmMytheril
                            || item is PlateGorgetMytheril
                            || item is PlateGlovesMytheril
                            || item is SwordMytheril
                            || item is WarMaceMytheril
                            || item is KryssMytheril
                            || item is WarMaceMytheril
                            || item is HeaterShieldMytheril
                            || item is BowMytheril)
                        {
                            bagPlateMytheril.DropItem((Item)item);
                        }

                        if (item is PlateChestAqua
                            || item is PlateArmsAqua
                            || item is PlateLegsAqua
                            || item is PlateCloseHelmAqua
                            || item is PlateGorgetAqua
                            || item is PlateGlovesAqua
                            || item is SwordAqua
                            || item is WarMaceAqua
                            || item is KryssAqua
                            || item is WarMaceAqua
                            || item is HeaterShieldAqua
                            || item is BowAqua)
                        {
                            bagPlateAqua.DropItem((Item)item);
                        }

                    }
                    else if (item is BaseClothing)
                    {
                        bagCloth.DropItem((Item)item);
                    }
                    else if (item is BasePotion)
                    {
                        //for (int i = 0; i <= sphereItem.qtAmount - 1; i++)
                        //{
                        //    object itemPotion = RewardUtil.CreateRewardInstance(sphereItem.itemType);
                        //    bagPotion.DropItem((Item)itemPotion);
                        //}

                        bagPotion.DropItem((Item)item);
                    }
                    else if (item is BaseCreature)
                    {
                        if (sphereItem.Hue != 1)
                        {
                            ((BaseCreature)item).Hue = sphereItem.Hue;
                        }

                        ShrinkItem shrunkenPet = new ShrinkItem((BaseCreature)item);
                        bagMount.DropItem(shrunkenPet);
                    }
                    else
                    {
                        bagOther.DropItem((Item)item);
                    }

                    if (item is Server.Mobiles.Horse && sphereItem.Hue != 1)
                    {
                        ((Server.Mobiles.Horse)item).Hue = DimensionsNewAge.Scripts.HueItemConst.GetNewHueBySphereHue(sphereItem.Hue);
                        ((Server.Mobiles.Horse)item).Name = "Wild Horse";
                    }

                    if (item is Server.Items.MagicDyeTub && sphereItem.Hue != 1)
                        ((Server.Items.MagicDyeTub)item).DyedHue = DimensionsNewAge.Scripts.HueItemConst.GetNewHueBySphereHue(sphereItem.Hue);

                    if (item is Server.Items.BaseClothing && sphereItem.Hue != 1)
                        ((Server.Items.BaseClothing)item).Hue = DimensionsNewAge.Scripts.HueItemConst.GetNewHueBySphereHue(sphereItem.Hue);

                }
                catch (Exception ex)
                {
                    Logger.LogSphereImport(string.Format("CreateItens ERRO " + ex.Message), sphereCharName);
                }
            }

            if (bagOres.Items.Count == 0)
                bagOres.Delete();
            if (bagIngots.Items.Count == 0)
                bagIngots.Delete();
            if (bagArmor.Items.Count == 0)
                bagArmor.Delete();
            if (bagWeapon.Items.Count == 0)
                bagWeapon.Delete();
            if (bagMount.Items.Count == 0)
                bagMount.Delete();
            if (bagOther.Items.Count == 0)
                bagOther.Delete();
            if (bagGold.Items.Count == 0)
                bagGold.Delete();
            if (bagPotion.Items.Count == 0)
                bagPotion.Delete();
            if (bagRegs.Items.Count == 0)
                bagRegs.Delete();
            if (bagCloth.Items.Count == 0)
                bagCloth.Delete();
            if (bagContainer.Items.Count == 0)
                bagContainer.Delete();
            if (bagMaps.Items.Count == 0)
                bagMaps.Delete();

            if (bagPlateOutras.Items.Count == 0)
                bagPlateOutras.Delete();
            if (bagPlateRusty.Items.Count == 0)
                bagPlateRusty.Delete();
            if (bagPlateOldCopper.Items.Count == 0)
                bagPlateOldCopper.Delete();
            if (bagPlateDullCopper.Items.Count == 0)
                bagPlateDullCopper.Delete();
            if (bagPlateRuby.Items.Count == 0)
                bagPlateRuby.Delete();
            if (bagPlateCopper.Items.Count == 0)
                bagPlateCopper.Delete();
            if (bagPlateBronze.Items.Count == 0)
                bagPlateBronze.Delete();
            if (bagPlateShadowIron.Items.Count == 0)
                bagPlateShadowIron.Delete();
            if (bagPlateSilver.Items.Count == 0)
                bagPlateSilver.Delete();
            if (bagPlateMercury.Items.Count == 0)
                bagPlateMercury.Delete();
            if (bagPlateRose.Items.Count == 0)
                bagPlateRose.Delete();
            if (bagPlateGold.Items.Count == 0)
                bagPlateGold.Delete();
            if (bagPlateAgapite.Items.Count == 0)
                bagPlateAgapite.Delete();
            if (bagPlateVerite.Items.Count == 0)
                bagPlateVerite.Delete();
            if (bagPlatePlutonio.Items.Count == 0)
                bagPlatePlutonio.Delete();
            if (bagPlateBloodRock.Items.Count == 0)
                bagPlateBloodRock.Delete();
            if (bagPlateValorite.Items.Count == 0)
                bagPlateValorite.Delete();
            if (bagPlateBlackRock.Items.Count == 0)
                bagPlateBlackRock.Delete();
            if (bagPlateMytheril.Items.Count == 0)
                bagPlateMytheril.Delete();
            if (bagPlateAqua.Items.Count == 0)
                bagPlateAqua.Delete();
        }
Esempio n. 19
0
		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;
		}
Esempio n. 20
0
        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)
                        item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
                    else
                        item = Loot.RandomArmorOrShieldOrWeapon();

                    if (item != null && Core.HS && RandomItemGenerator.Enabled)
                    {
                        int min, max;
                        GetRandomItemStat(out min, out max, propsScale);

                        RunicReforging.GenerateRandomItem(item, LootPack.GetLuckChance(luck), min, max);

                        cont.DropItem(item);
                    }
                    else if (item is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                        }
                        else
                        {
                            weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6);
                            weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6);
                            weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseArmor armor = (BaseArmor)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                        }
                        else
                        {
                            armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                            armor.Durability = (ArmorDurabilityLevel)Utility.Random(6);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseHat)
                    {
                        BaseHat hat = (BaseHat)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseJewel)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);

                        cont.DropItem(item);
                    }
                }
            }

            int reagents;
            if (level == 0)
                reagents = 12;
            else
                reagents = level + 1;

            for (int i = 0; i < reagents; i++)
            {
                Item item = Loot.RandomPossibleReagent();
                item.Amount = Utility.RandomMinMax(40, 60);
                cont.DropItem(item);
            }

            int gems;
            if (level == 0)
                gems = 2;
            else
                gems = (level * 3) + 1;

            for (int i = 0; i < gems; i++)
            {
                Item item = Loot.RandomGem();
                cont.DropItem(item);
            }

            if (level > 1)
            {
                Item item = Loot.Construct(m_ImbuingIngreds[Utility.Random(m_ImbuingIngreds.Length)]);

                item.Amount = level;
                cont.DropItem(item);
            }

            Item arty = null;
            Item special = null;

            if (isSos)
            {
                if (0.004 * level > Utility.RandomDouble())
                    arty = Loot.Construct(m_SOSArtifacts);
                if (0.006 * level > Utility.RandomDouble())
                    special = Loot.Construct(m_SOSDecor);
                else if (0.009 * level > Utility.RandomDouble())
                    special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), cont.Map);

            }
            else
            {
                if (level >= 7)
                {
                    if (0.025 > Utility.RandomDouble())
                        special = Loot.Construct(m_LevelSevenOnly);
                    else if (0.10 > Utility.RandomDouble())
                        special = Loot.Construct(m_LevelFiveToSeven);
                    else if (0.25 > Utility.RandomDouble())
                        special = GetRandomSpecial(level, cont.Map);

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 6)
                {
                    if (0.025 > Utility.RandomDouble())
                        special = Loot.Construct(m_LevelFiveToSeven);
                    else if (0.10 > Utility.RandomDouble())
                        special = GetRandomSpecial(level, cont.Map);

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 5)
                {
                    if (0.05 > Utility.RandomDouble())
                        special = Loot.Construct(m_LevelFiveToSeven);
                    else if (0.25 > Utility.RandomDouble())
                        special = GetRandomSpecial(level, cont.Map);
                }
                else if (.10 > Utility.RandomDouble())
                {
                    special = GetRandomSpecial(level, cont.Map);
                }
            }

            if (arty != null)
            {
                Container pack = new Backpack();
                pack.Hue = 1278;

                pack.DropItem(arty);
                cont.DropItem(pack);
            }

            if (special != null)
                cont.DropItem(special);
        }
Esempio n. 21
0
 public OpenMapEntry(TreasureMap map) : base(6150, 2)
 {
     m_Map = map;
 }
Esempio n. 22
0
			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;
			}
Esempio n. 23
0
            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);
            }
Esempio n. 24
0
			public DigTarget( TreasureMap map ) : base( 6, true, TargetFlags.None )
			{
				m_Map = map;
			}
Esempio n. 25
0
        public static void Fill(LockableContainer cont, int luck, int level, bool isSos, Map map)
        {
            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)
                    {
                        item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
                    }
                    else
                    {
                        item = Loot.RandomArmorOrShieldOrWeapon();
                    }

                    if (item != null && Core.HS && RandomItemGenerator.Enabled)
                    {
                        int min, max;
                        GetRandomItemStat(out min, out max, propsScale);

                        RunicReforging.GenerateRandomItem(item, luck, min, max, map);

                        cont.DropItem(item);
                    }
                    else if (item is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                        }
                        else
                        {
                            weapon.DamageLevel     = (WeaponDamageLevel)Utility.Random(6);
                            weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                            weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseArmor armor = (BaseArmor)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                        }
                        else
                        {
                            armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                            armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseHat)
                    {
                        BaseHat hat = (BaseHat)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseJewel)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);

                        cont.DropItem(item);
                    }
                }
            }

            int reagents;

            if (level == 0)
            {
                reagents = 12;
            }
            else
            {
                reagents = level + 1;
            }

            for (int i = 0; i < reagents; i++)
            {
                Item item = Loot.RandomPossibleReagent();
                item.Amount = Utility.RandomMinMax(40, 60);
                cont.DropItem(item);
            }

            int gems;

            if (level == 0)
            {
                gems = 2;
            }
            else
            {
                gems = (level * 3) + 1;
            }

            for (int i = 0; i < gems; i++)
            {
                Item item = Loot.RandomGem();
                cont.DropItem(item);
            }

            if (level > 1)
            {
                Item item = Loot.Construct(m_ImbuingIngreds[Utility.Random(m_ImbuingIngreds.Length)]);

                item.Amount = level;
                cont.DropItem(item);
            }

            Item arty    = null;
            Item special = null;

            if (isSos)
            {
                if (0.004 * level > Utility.RandomDouble())
                {
                    arty = Loot.Construct(m_SOSArtifacts);
                }
                if (0.006 * level > Utility.RandomDouble())
                {
                    special = Loot.Construct(m_SOSDecor);
                }
                else if (0.009 * level > Utility.RandomDouble())
                {
                    special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), cont.Map);
                }
            }
            else
            {
                if (level >= 7)
                {
                    if (0.025 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelSevenOnly);
                    }
                    else if (0.10 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.25 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 6)
                {
                    if (0.025 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.20 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }

                    arty = Loot.Construct(m_Artifacts);
                }
                else if (level >= 5)
                {
                    if (0.005 > Utility.RandomDouble())
                    {
                        special = Loot.Construct(m_LevelFiveToSeven);
                    }
                    else if (0.15 > Utility.RandomDouble())
                    {
                        special = GetRandomSpecial(level, cont.Map);
                    }
                }
                else if (.10 > Utility.RandomDouble())
                {
                    special = GetRandomSpecial(level, cont.Map);
                }
            }

            if (arty != null)
            {
                Container pack = new Backpack();
                pack.Hue = 1278;

                pack.DropItem(arty);
                cont.DropItem(pack);
            }

            if (special != null)
            {
                cont.DropItem(special);
            }

            if (Core.SA)
            {
                int rolls = 2;

                if (level >= 5)
                {
                    rolls += level - 2;
                }

                RefinementComponent.Roll(cont, rolls, 0.10);
            }
        }
Esempio n. 26
0
			public DecodeMapEntry( TreasureMap map ) : base( 6147, 2 )
			{
				m_Map = map;
			}
 public DigTarget(TreasureMap map) : base(6, true, TargetFlags.None)
 {
     m_Map = map;
 }
Esempio n. 28
0
			public DigEntry( TreasureMap map, bool enabled ) : base( 6148, 2 )
			{
				m_Map = map;

				if ( !enabled )
					this.Flags |= CMEFlags.Disabled;
			}
 public DecodeMapEntry(TreasureMap map) : base(6147, 2)
 {
     m_Map = map;
 }
Esempio n. 30
0
		public static void Fill( LockableContainer cont )
		{
			// Gold, about 100K
			for (int ix=0; ix < 100; ix++)
				cont.DropItem( new Gold( Utility.RandomMinMax( 900, 1100 ) ) );
			
			// plus about 20 chances for magic jewelry and/or clothing
			for (int ix=0; ix < 20; ix++)
			{
				PackMagicItem( cont, 3, 3, 0.20 );
				PackMagicItem( cont, 3, 3, 0.10 );
				PackMagicItem( cont, 3, 3, 0.05 );
			}

			// drop some scrolls and weapons/armor
			for ( int ix = 0; ix < 25; ++ix )
			{
				int level = 5;
				Item item;
				item = Loot.RandomArmorOrShieldOrWeapon();
				item = Loot.ImbueWeaponOrArmor (item, level, 0.05, false);

				// erl: SDrop chance
				// ..
				if( Server.Engines.SDrop.SDropTest( item, CoreAI.EScrollChance ) )
				{
					// Drop a scroll instead
					EnchantedScroll escroll = Loot.GenEScroll((object) item);

					// Delete the original item
					item.Delete();

					// Re-reference item to escroll and continue
					item = (Item) escroll;
				}
				// ..

				cont.DropItem( item );
			}

			// drop a few nice maps
			for (int ix=0; ix < 5; ix++)
			{
				TreasureMap map = new TreasureMap (5, Map.Felucca);
				cont.DropItem( map );				
			}

			// drop a few single-color leather dye tubs with 100 charges
			for (int ix=0; ix < 25; ix++)
			{
				LeatherArmorDyeTub tub = new LeatherArmorDyeTub ();
				cont.DropItem( tub );				
			}
			
			// pack some other goodies
			TreasureMapChest.PackRegs(cont, 300);
			TreasureMapChest.PackGems(cont, 300);

		}
Esempio n. 31
0
        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;
        }