public override Item Construct(Type type, Mobile from)
        {
            if (type == typeof(TreasureMap))
            {
                int level;
                if (from is PlayerMobile && ((PlayerMobile)from).Young && from.Map == Map.Trammel && TreasureMap.IsInHavenIsland(from))
                    level = 0;
                else
                    level = 1;

                return new TreasureMap(level, from.Map == Map.Felucca ? Map.Felucca : Map.Trammel);
            }
            else if (type == typeof(MessageInABottle))
            {
                return new MessageInABottle(from.Map == Map.Felucca ? Map.Felucca : Map.Trammel);
            }

            Container pack = from.Backpack;

            if (pack != null)
            {
                List<SOS> messages = pack.FindItemsByType<SOS>();

                for (int i = 0; i < messages.Count; ++i)
                {
                    SOS sos = messages[i];

                    if ((from.Map == Map.Felucca || from.Map == Map.Trammel) && from.InRange(sos.TargetLocation, 60))
                    {
                        Item preLoot = null;

                        switch ( Utility.Random(8) )
                        {
                            case 0: // Body parts
                                {
                                    int[] list = new int[]
                                    {
                                        0x1CDD, 0x1CE5, // arm
                                        0x1CE0, 0x1CE8, // torso
                                        0x1CE1, 0x1CE9, // head
                                        0x1CE2, 0x1CEC // leg
                                    };

                                    preLoot = new ShipwreckedItem(Utility.RandomList(list));
                                    break;
                                }
                            case 1: // Bone parts
                                {
                                    int[] list = new int[]
                                    {
                                        0x1AE0, 0x1AE1, 0x1AE2, 0x1AE3, 0x1AE4, // skulls
                                        0x1B09, 0x1B0A, 0x1B0B, 0x1B0C, 0x1B0D, 0x1B0E, 0x1B0F, 0x1B10, // bone piles
                                        0x1B15, 0x1B16 // pelvis bones
                                    };

                                    preLoot = new ShipwreckedItem(Utility.RandomList(list));
                                    break;
                                }
                            case 2: // Paintings and portraits
                                {
                                    preLoot = new ShipwreckedItem(Utility.Random(0xE9F, 10));
                                    break;
                                }
                            case 3: // Pillows
                                {
                                    preLoot = new ShipwreckedItem(Utility.Random(0x13A4, 11));
                                    break;
                                }
                            case 4: // Shells
                                {
                                    preLoot = new ShipwreckedItem(Utility.Random(0xFC4, 9));
                                    break;
                                }
                            case 5:	//Hats
                                {
                                    if (Utility.RandomBool())
                                        preLoot = new SkullCap();
                                    else
                                        preLoot = new TricorneHat();

                                    break;
                                }
                            case 6: // Misc
                                {
                                    int[] list = new int[]
                                    {
                                        0x1EB5, // unfinished barrel
                                        0xA2A, // stool
                                        0xC1F, // broken clock
                                        0x1047, 0x1048, // globe
                                        0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4 // barrel staves
                                    };

                                    if (Utility.Random(list.Length + 1) == 0)
                                        preLoot = new Candelabra();
                                    else
                                        preLoot = new ShipwreckedItem(Utility.RandomList(list));

                                    break;
                                }
                        }

                        if (preLoot != null)
                        {
                            if (preLoot is IShipwreckedItem)
                                ((IShipwreckedItem)preLoot).IsShipwreckedItem = true;

                            return preLoot;
                        }

                        LockableContainer chest;
						
                        if (Utility.RandomBool())
                            chest = new MetalGoldenChest();
                        else
                            chest = new WoodenChest();

                        if (sos.IsAncient)
                            chest.Hue = 0x481;

                        TreasureMapChest.Fill(chest, Math.Max(1, Math.Min(4, sos.Level)));

                        if (sos.IsAncient)
                            chest.DropItem(new FabledFishingNet());
                        else
                            chest.DropItem(new SpecialFishingNet());

                        chest.Movable = true;
                        chest.Locked = false;
                        chest.TrapType = TrapType.None;
                        chest.TrapPower = 0;
                        chest.TrapLevel = 0;

                        sos.Delete();

                        return chest;
                    }
                }
            }

            return base.Construct(type, from);
        }
Exemple #2
0
        public override Item Construct( Type type, Mobile from )
        {
            if ( type == typeof( MessageInABottle ) )
                return new MessageInABottle( SafeMap( from.Map ) );

            Container pack = from.Backpack;

            if ( pack != null )
            {
                Item[] messages = pack.FindItemsByType( typeof( SOS ) );

                for ( int i = 0; i < messages.Length; ++i )
                {
                    SOS sos = (SOS)messages[i];

                    if ( from.Map == sos.TargetMap && from.InRange( sos.TargetLocation, 60 ) )
                    {
                        Item preLoot = null;

                        switch ( Utility.Random( 7 ) )
                        {
                            case 0: // Body parts
                            {
                                int[] list = new int[]
                                    {
                                        0x1CDD, 0x1CE5, // arm
                                        0x1CE0, 0x1CE8, // torso
                                        0x1CE1, 0x1CE9, // head
                                        0x1CE2, 0x1CEC // leg
                                    };

                                preLoot = new ShipwreckedItem( Utility.RandomList( list ) );
                                break;
                            }
                            case 1: // Bone parts
                            {
                                int[] list = new int[]
                                    {
                                        0x1AE0, 0x1AE1, 0x1AE2, 0x1AE3, 0x1AE4, // skulls
                                        0x1B09, 0x1B0A, 0x1B0B, 0x1B0C, 0x1B0D, 0x1B0E, 0x1B0F, 0x1B10, // bone piles
                                        0x1B15, 0x1B16 // pelvis bones
                                    };

                                preLoot = new ShipwreckedItem( Utility.RandomList( list ) );
                                break;
                            }
                            case 2: // Paintings and portraits
                            {
                                preLoot = new ShipwreckedItem( Utility.Random( 0xE9F, 10 ) );
                                break;
                            }
                            case 3: // Pillows
                            {
                                preLoot = new ShipwreckedItem( Utility.Random( 0x13A4, 11 ) );
                                break;
                            }
                            case 4: // Shells
                            {
                                preLoot = new ShipwreckedItem( Utility.Random( 0xFC4, 9 ) );
                                break;
                            }
                            case 5: // Misc
                            {
                                int[] list = new int[]
                                    {
                                        0x1EB5, // unfinished barrel
                                        0xA2A, // stool
                                        0xC1F, // broken clock
                                        0x1047, 0x1048, // globe
                                        0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4 // barrel staves
                                    };

                                preLoot = new ShipwreckedItem( Utility.RandomList( list ) );
                                break;
                            }
                        }

                        if ( preLoot != null )
                            return preLoot;

                        sos.Delete();

                        WoodenChest chest = new WoodenChest();

                        //TreasureMapChest.Fill( chest, Utility.RandomMinMax( 1, 3 ) );

                        // TODO: Are there chances on this? All MIB's I've done had nets..
                        chest.DropItem( new SpecialFishingNet() );

                        chest.Movable = true;
                        chest.Locked = false;
                        chest.TrapType = TrapType.None;
                        chest.TrapPower = 0;
                        chest.Trapped = false;

                        return chest;
                    }
                }
            }

            return base.Construct( type, from );
        }
Exemple #3
0
        public override Item Construct(Type type, Mobile from, Item tool)
        {
            // Searing Weapon Support
            if (type == typeof(BaseWeapon))
                return null;

            if (type == typeof(TreasureMap))
            {
                int level;
                if (from is PlayerMobile && ((PlayerMobile)from).Young && from.Map == Map.Trammel && TreasureMap.IsInHavenIsland(from))
                    level = 0;
                else
                    level = 1;

                return new TreasureMap(level, from.Map == Map.Felucca ? Map.Felucca : Map.Trammel);
            }
            else if (type == typeof(MessageInABottle))
            {
                return new MessageInABottle(from.Map == Map.Felucca ? Map.Felucca : Map.Trammel);
            }
            else if (type == typeof(WhitePearl))
            {
                return new WhitePearl();
            }

            Container pack = from.Backpack;

            if (pack != null)
            {
                List<SOS> messages = pack.FindItemsByType<SOS>();

                for (int i = 0; i < messages.Count; ++i)
                {
                    SOS sos = messages[i];

                    if ((from.Map == Map.Felucca || from.Map == Map.Trammel) && from.InRange(sos.TargetLocation, 60))
                    {
                        Item preLoot = null;
                        bool dredge = HasTypeHook(tool, HookType.Dredging);

                        switch (Utility.Random(Core.HS ? 17 : 16))
                        {
                            case 0: // Body parts
                            case 1:
                                {
                                    int[] list = new int[]
                                    {
                                        0x1CDD, 0x1CE5, // arm
                                        0x1CE0, 0x1CE8, // torso
                                        0x1CE1, 0x1CE9, // head
                                        0x1CE2, 0x1CEC // leg
                                    };

                                    preLoot = new ShipwreckedItem(Utility.RandomList(list), dredge);
                                    break;
                                }
                            case 2: // Bone parts
                            case 3:
                                {
                                    int[] list = new int[]
                                    {
                                        0x1AE0, 0x1AE1, 0x1AE2, 0x1AE3, 0x1AE4, // skulls
                                        0x1B09, 0x1B0A, 0x1B0B, 0x1B0C, 0x1B0D, 0x1B0E, 0x1B0F, 0x1B10, // bone piles
                                        0x1B15, 0x1B16 // pelvis bones
                                    };

                                    preLoot = new ShipwreckedItem(Utility.RandomList(list), dredge);
                                    break;
                                }
                            case 4: // Paintings and portraits
                            case 5:
                                {
                                    preLoot = new ShipwreckedItem(Utility.Random(0xE9F, 10), dredge);
                                    break;
                                }
                            case 6: // Pillows
                            case 7:
                                {
                                    preLoot = new ShipwreckedItem(Utility.Random(0x13A4, 11), dredge);
                                    break;
                                }
                            case 8: // Shells
                            case 9:
                                {
                                    preLoot = new ShipwreckedItem(Utility.Random(0xFC4, 9), dredge);
                                    break;
                                }
                            case 10: //Hats
                            case 11:
                                {
                                    if (Utility.RandomBool())
                                        preLoot = new SkullCap();
                                    else
                                        preLoot = new TricorneHat();

                                    break;
                                }
                            case 12: // Misc
                            case 13:
                                {
                                    int[] list = new int[]
                                    {
                                        0x1EB5, // unfinished barrel
                                        0xA2A, // stool
                                        0xC1F, // broken clock
                                        0x1047, 0x1048, // globe
                                        0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4 // barrel staves
                                    };

                                    if (Utility.Random(list.Length + 1) == 0)
                                        preLoot = new Candelabra();
                                    else
                                        preLoot = new ShipwreckedItem(Utility.RandomList(list), dredge);

                                    break;
                                }
                            #region High Seas
                            case 14:
                                {
                                    int[] list = new int[]
                                    {
                                        0x1E19, 0x1E1A, 0x1E1B, //Fish heads
                                        0x1E2A, 0x1E2B,         //Ores
                                        0x1E71, 0x1E7A,         //Unfinished drawers
                                        0x1E75,                 //Unfinished legs
                                    };

                                    double ran = Utility.RandomDouble();

                                    if (ran < 0.05)
                                        preLoot = new YellowPolkaDotBikini();
                                    else if (ran < 0.25)
                                        preLoot = new ShipwreckedItem(list[Utility.RandomMinMax(3, 7)], dredge);
                                    else
                                        preLoot = new Item(list[Utility.Random(3)]);
                                    break;
                                }
                            #endregion
                        }

                        if (preLoot != null)
                        {
                            if (preLoot is IShipwreckedItem)
                                ((IShipwreckedItem)preLoot).IsShipwreckedItem = true;

                            return preLoot;
                        }

                        LockableContainer chest;
						
                        if (Utility.RandomBool())
                            chest = new MetalGoldenChest();
                        else
                            chest = new WoodenChest();

                        if (sos.IsAncient)
                            chest.Hue = 0x481;

                        TreasureMapChest.Fill(chest, from.Luck, Math.Max(1, Math.Min(4, sos.Level)), true, from.Map);

                        if (sos.IsAncient)
                            chest.DropItem(new FabledFishingNet());
                        else
                            chest.DropItem(new SpecialFishingNet());

                        chest.Movable = true;
                        chest.Locked = false;
                        chest.TrapType = TrapType.None;
                        chest.TrapPower = 0;
                        chest.TrapLevel = 0;

                        sos.Delete();

                        return chest;
                    }
                }
            }

            return base.Construct(type, from, tool);
        }
Exemple #4
0
        public override Item Construct( Type type, Mobile from )
        {
            if ( type == typeof( TreasureMap ) )
            {
                int level;
                if ( from is PlayerMobile && ((PlayerMobile)from).Young && from.Map == Map.Trammel && TreasureMap.IsInHavenIsland( from ) )
                    level = 0;
                else
                    level = 1;

                return new TreasureMap( level, from.Map == Map.Felucca ? Map.Felucca : Map.Trammel );
            }
            else if ( type == typeof( MessageInABottle ) )
            {
                return new MessageInABottle( SafeMap( from.Map ) );
            }

            Container pack = from.Backpack;

            if ( pack != null )
            {
                Item[] messages = pack.FindItemsByType( typeof( SOS ) );

                for ( int i = 0; i < messages.Length; ++i )
                {
                    SOS sos = (SOS)messages[i];

                    if ( from.Map == sos.TargetMap && from.InRange( sos.TargetLocation, 60 ) )
                    {
                        Item preLoot = null;

                        switch ( Utility.Random( 7 ) )
                        {
                            case 0: // Body parts
                            {
                                int[] list = new int[]
                                    {
                                        0x1CDD, 0x1CE5, // arm
                                        0x1CE0, 0x1CE8, // torso
                                        0x1CE1, 0x1CE9, // head
                                        0x1CE2, 0x1CEC // leg
                                    };

                                preLoot = new ShipwreckedItem( Utility.RandomList( list ) );
                                break;
                            }
                            case 1: // Bone parts
                            {
                                int[] list = new int[]
                                    {
                                        0x1AE0, 0x1AE1, 0x1AE2, 0x1AE3, 0x1AE4, // skulls
                                        0x1B09, 0x1B0A, 0x1B0B, 0x1B0C, 0x1B0D, 0x1B0E, 0x1B0F, 0x1B10, // bone piles
                                        0x1B15, 0x1B16 // pelvis bones
                                    };

                                preLoot = new ShipwreckedItem( Utility.RandomList( list ) );
                                break;
                            }
                            case 2: // Paintings and portraits
                            {
                                preLoot = new ShipwreckedItem( Utility.Random( 0xE9F, 10 ) );
                                break;
                            }
                            case 3: // Pillows
                            {
                                preLoot = new ShipwreckedItem( Utility.Random( 0x13A4, 11 ) );
                                break;
                            }
                            case 4: // Shells
                            {
                                preLoot = new ShipwreckedItem( Utility.Random( 0xFC4, 9 ) );
                                break;
                            }
                            case 5: // Misc
                            {
                                int[] list = new int[]
                                    {
                                        0x1EB5, // unfinished barrel
                                        0xA2A, // stool
                                        0xC1F, // broken clock
                                        0x1047, 0x1048, // globe
                                        0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4, // barrel staves
                                        0xB5B, 0xB4F, 0xB5E, 0xB57, 0xB53, // chairs
                                        0x1560, 0x1562, 0x155D, 0x155E, 0x1582, 0x1634, //Deco Bows/Swords
                                        0x156C, 0x157E, 0x1580, 0x1565, 0x1578, 0x1569, //Deco Shields/Axe
                                        0xC1B, 0xC10, 0xC19, 0xC2C, 0xC2D, 0xB95, // Ruined things/Sign
                                        0xE31, 0x19AA, 0x1853, 0x9FB, 0xA05, 0xA26, // Light sources
                                        0x1EA7, 0x26AC, 0x1879, 0x1005, 0x185B, 0xEFB, // Misc items
                                        0x1810, 0xEFC, 0X14F8, 0x166E // More Misc Items
                                        //
                                        // *** Can easily add more stuff to fish up while doing chest!!
                                        //
                                    };

                                preLoot = new ShipwreckedItem( Utility.RandomList( list ) );
                                // This statement converts to Item and tags "... from shipwreck"
                                break;
                            }
                        }

                        if (preLoot != null)  // Drew a "0-5" in above Case Stmt and have preLoot
                        {
                            if (0.143 > Utility.RandomDouble()) // Spawn weak monster ~ every 7 tries
                            {
                                BaseCreature serp1;

                                switch (Utility.Random(5))
                                {
                                    case 0:  { serp1 = new IcebergSnake(); break; }
                                    case 1:  { serp1 = new SeaSlime(); break; }
                                    case 2:  { serp1 = new SeaWorm(); break; }
                                    case 3:  { serp1 = new ToxicSlime(); break; }
                                    default: { serp1 = new OilSlime(); break; }
                                }

                                int x = from.X, y = from.Y;
                                Map map = from.Map;

                                for (int ii = 0; map != null && ii < 20; ++ii)
                                {
                                    int tx = from.X - 10 + Utility.Random(21);
                                    int ty = from.Y - 10 + Utility.Random(21);
                                    Tile t = map.Tiles.GetLandTile(tx, ty);

                                    if (t.Z == -5 && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, -5), map))
                                    {
                                        x = tx;
                                        y = ty;
                                        break;
                                    }
                                }

                                serp1.MoveToWorld(new Point3D(x, y, -5), map);
                                serp1.Home = serp1.Location;
                                serp1.RangeHome = 10;
                                from.SendLocalizedMessage(503170); // Uh oh! That doesn't look like a fish!

                            }

                            return preLoot;
                        }

                        sos.Delete();

                        WoodenChest chest = new WoodenChest();

                        TreasureMapChest.Fill( chest, Utility.RandomMinMax( 1, 4 ) );

                        // TODO: Are there chances on this? All MIB's I've done had nets..
                        chest.DropItem( new SpecialFishingNet() );

                        chest.Movable = true;
                        chest.Locked = false;
                        chest.TrapType = TrapType.None;
                        chest.TrapPower = 0;

                        return chest;
                    }
                }
            }

            return base.Construct( type, from );
        }
Exemple #5
0
		public override Item Construct(Type type, Mobile from)
		{
			if (type == typeof(TreasureMap))
			{
				int level;
				//if ( from is PlayerMobile && ((PlayerMobile)from).Young && from.Map == Map.Trammel && TreasureMap.IsInHavenIsland( from ) )
				//	level = 0;
				//else
				level = 1;

				return new TreasureMap(level, Map.Felucca);
			}
			else if (type == typeof(MessageInABottle))
			{
				return new MessageInABottle( /*from.Map == Map.Felucca ?*/ Map.Felucca /* : Map.Trammel*/);
			}

			Container pack = from.Backpack;

			if (pack != null)
			{
				List<SOS> messages = pack.FindItemsByType<SOS>();

				for (int i = 0; i < messages.Count; ++i)
				{
					SOS sos = messages[i];

					if (from.Map == sos.TargetMap &&
						from.InRange(sos.TargetLocation, (int)(from.Skills[SkillName.Fishing].Value - 75.0)))
					{
						Item preLoot = null;

						switch (Utility.Random(8))
						{
							case 0: // Body parts
								{
									var list = new[]
									{
										0x1CDD, 0x1CE5, // arm
										0x1CE0, 0x1CE8, // torso
										0x1CE1, 0x1CE9, // head
										0x1CE2, 0x1CEC // leg
									};

									preLoot = new ShipwreckedItem(Utility.RandomList(list));
									break;
								}
							case 1: // Bone parts
								{
									var list = new[]
									{
										0x1AE0, 0x1AE1, 0x1AE2, 0x1AE3, 0x1AE4, // skulls
										0x1B09, 0x1B0A, 0x1B0B, 0x1B0C, 0x1B0D, 0x1B0E, 0x1B0F, 0x1B10, // bone piles
										0x1B15, 0x1B16 // pelvis bones
									};

									preLoot = new ShipwreckedItem(Utility.RandomList(list));
									break;
								}
							case 2: // Paintings and portraits
								{
									preLoot = new ShipwreckedItem(Utility.Random(0xE9F, 10));
									break;
								}
							case 3: // Pillows
								{
									preLoot = new ShipwreckedItem(Utility.Random(0x13A4, 11));
									break;
								}
							case 4: // Shells
								{
									preLoot = new ShipwreckedItem(Utility.Random(0xFC4, 9));
									break;
								}
							case 5: //Hats
								{
									if (Utility.RandomBool())
									{
										preLoot = new SkullCap();
									}
									else
									{
										preLoot = new TricorneHat();
									}

									break;
								}
							case 6: // Misc
								{
									var list = new[]
									{
										0x1EB5, // unfinished barrel
										0xA2A, // stool
										0xC1F, // broken clock
										0x1047, 0x1048, // globe
										0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4 // barrel staves
									};

									if (Utility.Random(list.Length + 1) == 0)
									{
										preLoot = new Candelabra();
									}
									else
									{
										preLoot = new ShipwreckedItem(Utility.RandomList(list));
									}

									break;
								}
						}

						if (preLoot != null)
						{
							if (preLoot is IShipwreckedItem)
							{
								((IShipwreckedItem)preLoot).IsShipwreckedItem = true;
							}

							return preLoot;
						}

						LockableContainer chest = null;

						switch (Utility.Random(3))
						{
							case 0:
								chest = new MetalGoldenChest();
								break;
							case 1:
								chest = new MetalChest();
								break;
							default:
							case 2:
								chest = new WoodenChest();
								break;
						}
						chest.Breakable = false;
						chest.Locked = false;

						if (sos.IsAncient)
						{
							int hue = 1150;

							if (0.20 > Utility.RandomDouble())
							{
								switch (Utility.Random((chest is WoodenChest) ? 6 : 14))
								{
									case 0:
										hue = 1193;
										break;
									case 1:
										hue = 1281;
										break;
									case 2:
										hue = 1190;
										break;
									case 3:
										hue = 1165;
										break;
									case 4:
										hue = 1160;
										break;
									case 5:
										hue = 1126;
										break;
									case 6:
										hue = CraftResources.GetInfo(CraftResource.Valorite).Hue;
										break;
									case 7:
										hue = CraftResources.GetInfo(CraftResource.Verite).Hue;
										break;
									case 8:
										hue = CraftResources.GetInfo(CraftResource.Agapite).Hue;
										break;
									case 9:
										hue = CraftResources.GetInfo(CraftResource.Gold).Hue;
										break;
									case 10:
										hue = CraftResources.GetInfo(CraftResource.Bronze).Hue;
										break;
									case 11:
										hue = CraftResources.GetInfo(CraftResource.Copper).Hue;
										break;
									case 12:
										hue = CraftResources.GetInfo(CraftResource.ShadowIron).Hue;
										break;
									case 13:
										hue = CraftResources.GetInfo(CraftResource.DullCopper).Hue;
										break;
								}
							}

							chest.Hue = hue;
						}
						else if ((chest is MetalChest || chest is MetalGoldenChest) && (0.5 * sos.Level) >= Utility.RandomDouble())
						{
							int randhue = Utility.Random(120);
							var resource = CraftResource.None;

							if (randhue >= 118)
							{
								resource = CraftResource.Valorite;
							}
							else if (randhue >= 115)
							{
								resource = CraftResource.Verite;
							}
							else if (randhue >= 110)
							{
								resource = CraftResource.Agapite;
							}
							else if (randhue >= 100)
							{
								resource = CraftResource.Gold;
							}
							else if (randhue >= 90)
							{
								resource = CraftResource.Bronze;
							}
							else if (randhue >= 70)
							{
								resource = CraftResource.Copper;
							}
							else if (randhue >= 40)
							{
								resource = CraftResource.ShadowIron;
							}
							else
							{
								resource = CraftResource.DullCopper;
							}

							chest.Hue = CraftResources.GetInfo(resource).Hue;
						}

						int soslevel = sos.Level;

						TreasureMapChest.Fill(chest, soslevel, from.Expansion);

						if (!sos.IsAncient)
						{
							chest.Locked = false;
						}

						double chance = Utility.RandomDouble();
						BaseCreature mibmonster1;
						BaseCreature mibmonster2;
						mibmonster1 = new DeepWaterElemental();
						if (chance <= 0.02 && from.Skills[SkillName.Fishing].Base >= 115)
						{
							mibmonster2 = new Osiredon();
							int choice = Utility.Random(5);
							switch (choice)
							{
								case 4:
									mibmonster2.PackItem(new SmallFishingNetDeed());
									break;
								case 3:
									mibmonster2.PackItem(new LargeFishingNetDeed());
									break;
								case 2:
									mibmonster2.PackItem(new Shell());
									break;
								case 1:
									mibmonster2.PackItem(new Anchor());
									break;
								case 0:
									mibmonster2.PackItem(new Hook());
									break;
							}
						}
						else if (soslevel < 5)
						{
							mibmonster2 = new WaterElemental();
						}
						else
						{
							mibmonster2 = new DeepWaterElemental();
						}
						int x = from.X, y = from.Y;

						Map map = from.Map;

						mibmonster1.MoveToWorld(new Point3D(x, y, -5), map);
						mibmonster2.MoveToWorld(new Point3D(x, y, -5), map);

						mibmonster1.Home = mibmonster1.Location;
						mibmonster1.HomeMap = mibmonster1.Map;
						mibmonster1.RangeHome = 10;

						mibmonster2.Home = mibmonster2.Location;
						mibmonster2.HomeMap = mibmonster2.Map;
						mibmonster2.RangeHome = 10;

						if (sos.IsAncient)
						{
							chest.DropItem(new FabledFishingNet());
						}
						else
						{
							chest.DropItem(new SpecialFishingNet());
						}

						chest.Movable = true;
						chest.Name = "treasure chest";
						chest.IsShipwreckedItem = true;

						if (sos.Level > 0)
						{
							chest.TrapType = TrapType.ExplosionTrap;
							chest.TrapPower = soslevel * Utility.RandomMinMax(9, 19);
							chest.TrapLevel = 0;
						}
						else
						{
							chest.TrapType = TrapType.None;
							chest.TrapPower = 1;
							chest.TrapLevel = 1;
						}

						sos.Delete();

						return chest;
					}
				}
			}

			return base.Construct(type, from);
		}
Exemple #6
0
		public override Item Construct( Type type, Mobile from )
		{
			if ( type == typeof( TreasureMap ) )
			{
				int level;
				if ( from is PlayerMobile && ((PlayerMobile)from).Young && from.Map == Map.Felucca && TreasureMap.IsInHavenIsland( from ) )
					level = 0;
				else
					level = 1;

				return new TreasureMap( level, from.Map == Map.Felucca ? Map.Felucca : Map.Felucca );
			}
			else if ( type == typeof( MessageInABottle ) )
			{
				return new MessageInABottle( from.Map == Map.Felucca ? Map.Felucca : Map.Felucca );
			}

			Container pack = from.Backpack;

			if ( pack != null )
			{
				List<SOS> messages = pack.FindItemsByType<SOS>();

				for ( int i = 0; i < messages.Count; ++i )
				{
					SOS sos = messages[i];

					if ( from.Map == sos.TargetMap && from.InRange( sos.TargetLocation, 60 ) )
					{
						Item preLoot = null;

						switch ( Utility.Random( 7 ) )
						{
							case 0: // Bone parts
							{
								int[] list = new int[]
									{
										0x1AE0, 0x1AE1, 0x1AE2, 0x1AE3, 0x1AE4, // skulls
										0x1B09, 0x1B0A, 0x1B0B, 0x1B0C, 0x1B0D, 0x1B0E, 0x1B0F, 0x1B10, // bone piles
										0x1B15, 0x1B16, // pelvis bones
										0xECA, 0xECB, 0xECC, 0xECD, 0xECE, 0xECF, 0xED0, 0xED1, 0xED2 // skeletons
									};

								preLoot = new ShipwreckedItem( Utility.RandomList( list ) );
								break;
							}
							case 1: // Shells
							{
								preLoot = new ShipwreckedItem( Utility.Random( 0xFC4, 9 ) );
								break;
							}
							case 2: // Misc
							{
								int[] list = new int[]
									{
										0xE9F, 0xEA0, 0xEA1, 0xEA2, 0xEA3, 0xEA4, 0xEA5, 0xEA6, 0xEA7, 0xEA8, // paintings
										0x13A4, 0x13A5, 0x13A6, 0x13A7, 0x13A8, 0x13A9, 0x13AA, 0x13AB, 0x13AC, 0x13AD, 0x13AE, // pillows
										0x1EB5, // unfinished barrel
										0xA2A, // stool
										0xC1F, // broken clock
										0x1047, 0x1048, // globe
										0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4, // barrel staves
										0xE25, 0xE26, 0xE27, 0xE28, 0xE29, 0xE2A, 0xE2B, 0xE2C, // bottles
										0xC19, 0xC1A, 0xC1B, 0xC1C, 0xC1D, 0xC1E, // broken chairs
										0xC2C, 0xC2D, 0xC2E, 0xC2F, 0xC30, // ruined painting, debris
										0x13E5, 0x13E6, 0x13E7, 0x13E8, 0x13E9, 0x13EA // hanging armor
									};

								preLoot = new ShipwreckedItem( Utility.RandomList( list ) );
								break;
							}
							case 3: // Ship Items
							{
								int[] list = new int[]
									{
										0x14F8, 0x14FA, // ropes
										0x14F7, 0x14F9, // anchors
										0x14EB, 0x14EC, // maps
										0x1057, 0x1058, // sextants
										0x171A // feathered hat
									};

								preLoot = new ShipwreckedItem( Utility.RandomList( list ) );
								break;
							}
							case 4: // Shells
							{
								preLoot = new ShipwreckedItem( Utility.Random( 0xFC4, 9 ) );
								break;
							}
							case 5:	//Hats
							{
								if ( Utility.RandomBool() )
									preLoot = new SkullCap();
								else
									preLoot = new TricorneHat();

								break;
							}
							case 6: // Misc
							{
								int[] list = new int[]
									{
										0x1EB5, // unfinished barrel
										0xA2A, // stool
										0xC1F, // broken clock
										0x1047, 0x1048, // globe
										0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4 // barrel staves
									};

								if ( Utility.Random( list.Length + 1 ) == 0 )
									preLoot = new Candelabra();
								else
									preLoot = new ShipwreckedItem( Utility.RandomList( list ) );

								break;
							}
						}

						if ( preLoot != null )
						{
							if ( preLoot is IShipwreckedItem )
								( (IShipwreckedItem)preLoot ).IsShipwreckedItem = true;

							return preLoot;
						}

						LockableContainer chest;
						
						if ( Utility.RandomBool() )
							chest = new MetalGoldenChest();
						else
							chest = new WoodenChest();

						if ( sos.IsAncient )
							chest.Hue = 0x481;

						TreasureMapChest.Fill( chest, Math.Max( 1, Math.Max( 4, sos.Level ) ) );

						if ( sos.IsAncient )
							chest.DropItem( new FabledFishingNet() );
						else
							chest.DropItem( new SpecialFishingNet() );

						chest.Movable = true;
						chest.Locked = false;
						chest.TrapType = TrapType.None;
						chest.TrapPower = 0;
						chest.TrapLevel = 0;
// label chest with fisherman's name
						chest.Name = "Treasure chest fished up by " + from.Name;

						sos.Delete();

						return chest;
					}
				}
			}

			return base.Construct( type, from );
		}