public HarvestBank( HarvestDefinition def, HarvestVein defaultVein )
 {
     m_Maximum = Utility.RandomMinMax( def.MinTotal, def.MaxTotal );
     m_Current = m_Maximum;
     m_DefaultVein = defaultVein;
     m_Vein = m_DefaultVein;
 }
Beispiel #2
0
		public void CheckRespawn()
		{
			if ( m_Current == m_Maximum || m_NextRespawn > DateTime.Now )
				return;

			m_Current = m_Maximum;
			m_Vein = m_DefaultVein;
		}
Beispiel #3
0
        public HarvestBank( HarvestDefinition def, HarvestVein defaultVein, double chanceToFallback )
        {
            m_Maximum = Utility.RandomMinMax( def.MinTotal, def.MaxTotal );
            m_Current = m_Maximum;
            m_DefaultVein = defaultVein;
            m_Vein = m_DefaultVein;
            m_ChanceToFallback = chanceToFallback;

            m_Definition = def;
        }
Beispiel #4
0
		public void CheckRespawn()
		{
			if ( m_Current == m_Maximum || m_NextRespawn > DateTime.UtcNow )
				return;

			m_Current = m_Maximum;

			if ( m_Definition.RandomizeVeins )
			{
				m_DefaultVein = m_Definition.GetVeinFrom( Utility.RandomDouble() );
			}

			m_Vein = m_DefaultVein;
		}
Beispiel #5
0
        public void CheckRespawn()
        {
            if (this.m_Current == this.m_Maximum || this.m_NextRespawn > DateTime.Now)
                return;

            this.m_Current = this.m_Maximum;

            if (this.m_Definition.RandomizeVeins)
            {
                this.m_DefaultVein = this.m_Definition.GetVeinFrom(Utility.RandomDouble());
            }

            this.m_Vein = this.m_DefaultVein;
        }
Beispiel #6
0
        public void CheckRespawn()
        {
            // Malik's random veins fix
            if (m_NextRespawn > DateTime.Now)
                return;
            if (m_Current == 0)
            {
                m_Vein = m_Definition.GetVeinFrom(Utility.RandomDouble());
                m_Current = m_Maximum;
            }

            /*
			if ( m_Definition.RandomizeVeins )
			{
				m_DefaultVein = m_Definition.GetVeinFrom( Utility.RandomDouble() );
			}

			m_Vein = m_DefaultVein;
            */
        }
		public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
		{
/* include this part for rare extras
			// modded by greywolf for random items coming in

			double skillvaluelj = killerguy.Skills[SkillName.Magery].Base;
			int i_itemid = (int)(killerguy.Skills[SkillName.ItemID].Base/10);

			if ((Utility.RandomMinMax( 1, 1500 ) <= (1 + i_itemid)) && (skillvaluelj >= 70.1))
			{
				switch (Utility.RandomMinMax( 0, 10 ))
				{
					case 1 : default:  from.AddToBackpack(new Kindling()); from.SendMessage ("you find something wedged in the tree, a weird peice of wood ");break;
					case 2 : from.AddToBackpack(new BarkFragment()); from.SendMessage ("you find something wedged in the tree, a peice of bark ");break;
					case 3 : from.AddToBackpack(new LuminescentFungi()); from.SendMessage ("you find something wedged in the tree, some fungi ");break;
					case 4 : from.AddToBackpack(new ParasiticPlant()); from.SendMessage ("you find something wedged in the tree, a weird looking plant");break;
					case 5 : from.AddToBackpack(new DiseasedBark()); from.SendMessage ("you find something wedged in the tree, some weird looking bark ");break;
				}
			}
*/
		}
Beispiel #8
0
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            base.OnHarvestFinished(from, tool, def, vein, bank, resource, harvested);

            if (tool is YewAxe && def == m_Definition && 0.10 >= Utility.RandomDouble())
            {
                HarvestResource res = vein.PrimaryResource;

                if (res == resource)
                {
                    try
                    {
                        Map map = from.Map;

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

                        BaseCreature spawned = Activator.CreateInstance(typeof(Reaper)) as BaseCreature;

                        if (spawned != null)
                        {
                            int offset = Utility.Random(4) * 2;

                            for (int i = 0; i < m_Offsets.Length; i++)
                            {
                                int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
                                int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
                                int z = (map.CanSpawnMobile(x, y, from.Z) ? from.Z : map.GetAverageZ(x, y));

                                if (!map.CanSpawnMobile(x, y, z))
                                {
                                    x = from.X;
                                    y = from.Y;
                                    z = from.Z;
                                }

                                if (map.CanSpawnMobile(x, y, z))
                                {
                                    spawned.OnBeforeSpawn(new Point3D(x, y, z), map);
                                    spawned.MoveToWorld(new Point3D(x, y, z), map);
                                    spawned.Combatant = from;

                                    from.SendMessage("You have awoken a spirit tree!");
                                    break;
                                }
                            }
                        }
                    }
                    catch { }
                }
            }
        }
Beispiel #9
0
        private Mining()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            #region Mining for ore and stone
            HarvestDefinition oreAndStone = this.m_OreAndStone = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            oreAndStone.BankWidth  = 8;
            oreAndStone.BankHeight = 8;

            // Every bank holds from 10 to 34 ore
            oreAndStone.MinTotal = 10;
            oreAndStone.MaxTotal = 34;

            // A resource bank will respawn its content every 10 to 20 minutes
            oreAndStone.MinRespawn = TimeSpan.FromMinutes(10.0);
            oreAndStone.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Mining skill
            oreAndStone.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            oreAndStone.Tiles = m_MountainAndCaveTiles;

            // Players must be within 2 tiles to harvest
            oreAndStone.MaxRange = 2;

            // One ore per harvest action
            oreAndStone.ConsumedPerHarvest        = 1;
            oreAndStone.ConsumedPerFeluccaHarvest = 2;

            // The digging effect
            oreAndStone.EffectActions    = new int[] { Core.SA ? 3 : 11 };
            oreAndStone.EffectSounds     = new int[] { 0x125, 0x126 };
            oreAndStone.EffectCounts     = new int[] { 1 };
            oreAndStone.EffectDelay      = TimeSpan.FromSeconds(1.6);
            oreAndStone.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            oreAndStone.NoResourcesMessage     = "Nao tem minerio aqui";                 // There is no metal here to mine.
            oreAndStone.DoubleHarvestMessage   = "Alguem pegou seu minerio";             // Someone has gotten to the metal before you.
            oreAndStone.TimedOutOfRangeMessage = "Voce esta muito longe do minerio";     // You have moved too far away to continue mining.
            oreAndStone.OutOfRangeMessage      = "Isto esta muito longe";                // That is too far away.
            oreAndStone.FailMessage            = "Voce nao conseguiu encontrar minerio"; // You loosen some rocks but fail to find any useable ore.
            oreAndStone.PackFullMessage        = "Sua mochila esta cheia";               // Your backpack is full, so the ore you mined is lost.
            oreAndStone.ToolBrokeMessage       = "Sua ferramenta quebrou !";             // You have worn out your tool!

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 100.0, "Voce encontrou minero de ferro e colocou em sua mochila", typeof(IronOre), typeof(Granite)),
                new HarvestResource(65.0, 25.0, 105.0, "Voce encontrou minero de cobre rustico e colocou em sua mochila", typeof(DullCopperOre), typeof(DullCopperGranite), typeof(DullCopperElemental)),
                new HarvestResource(70.0, 30.0, 110.0, "Voce encontrou minero de onyx e colocou em sua mochila", typeof(ShadowIronOre), typeof(ShadowIronGranite), typeof(ShadowIronElemental)),
                new HarvestResource(75.0, 35.0, 115.0, "Voce encontrou minero de cobre e colocou em sua mochila", typeof(CopperOre), typeof(CopperGranite), typeof(CopperElemental)),
                new HarvestResource(80.0, 40.0, 120.0, "Voce encontrou minero de bronze e colocou em sua mochila", typeof(BronzeOre), typeof(BronzeGranite), typeof(BronzeElemental)),
                new HarvestResource(85.0, 45.0, 125.0, "Voce encontrou minero de ouro e colocou em sua mochila", typeof(GoldOre), typeof(GoldGranite), typeof(GoldenElemental)),
                new HarvestResource(90.0, 50.0, 130.0, "Voce encontrou minero de agapite e colocou em sua mochila", typeof(AgapiteOre), typeof(AgapiteGranite), typeof(AgapiteElemental)),
                new HarvestResource(95.0, 55.0, 135.0, "Voce encontrou minero de verite e colocou em sua mochila", typeof(VeriteOre), typeof(VeriteGranite), typeof(VeriteElemental)),
                new HarvestResource(99.0, 59.0, 139.0, "Voce encontrou minero de valorite e colocou em sua mochila", typeof(ValoriteOre), typeof(ValoriteGranite), typeof(ValoriteElemental))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(49.6, 0.0, res[0], null),   // Iron
                new HarvestVein(11.2, 0.5, res[1], res[0]), // Dull Copper
                new HarvestVein(09.8, 0.5, res[2], res[0]), // Shadow Iron
                new HarvestVein(08.4, 0.5, res[3], res[0]), // Copper
                new HarvestVein(07.0, 0.5, res[4], res[0]), // Bronze
                new HarvestVein(05.6, 0.5, res[5], res[0]), // Gold
                new HarvestVein(04.2, 0.5, res[6], res[0]), // Agapite
                new HarvestVein(02.8, 0.5, res[7], res[0]), // Verite
                new HarvestVein(01.4, 0.5, res[8], res[0])  // Valorite
            };

            oreAndStone.Resources = res;
            oreAndStone.Veins     = veins;

            if (Core.ML)
            {
                oreAndStone.BonusResources = new BonusHarvestResource[]
                {
                    new BonusHarvestResource(0, 99.2, null, null), //Nothing
                    new BonusHarvestResource(100, .1, 1072562, typeof(BlueDiamond)),
                    new BonusHarvestResource(100, .1, 1072567, typeof(DarkSapphire)),
                    new BonusHarvestResource(100, .1, 1072570, typeof(EcruCitrine)),
                    new BonusHarvestResource(100, .1, 1072564, typeof(FireRuby)),
                    new BonusHarvestResource(100, .1, 1072566, typeof(PerfectEmerald)),
                    new BonusHarvestResource(100, .1, 1072568, typeof(Turquoise)),
                    new BonusHarvestResource(100, .1, 1077180, typeof(SmallPieceofBlackrock)),
                    new BonusHarvestResource(100, .1, 1113344, typeof(CrystallineBlackrock), Map.TerMur)
                };
            }

            oreAndStone.RaceBonus      = Core.ML;
            oreAndStone.RandomizeVeins = Core.ML;

            this.Definitions.Add(oreAndStone);
            #endregion

            #region Mining for sand
            HarvestDefinition sand = this.m_Sand = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            sand.BankWidth  = 8;
            sand.BankHeight = 8;

            // Every bank holds from 6 to 12 sand
            sand.MinTotal = 6;
            sand.MaxTotal = 13;

            // A resource bank will respawn its content every 10 to 20 minutes
            sand.MinRespawn = TimeSpan.FromMinutes(10.0);
            sand.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Mining skill
            sand.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            sand.Tiles = m_SandTiles;

            // Players must be within 2 tiles to harvest
            sand.MaxRange = 2;

            // One sand per harvest action
            sand.ConsumedPerHarvest        = 1;
            sand.ConsumedPerFeluccaHarvest = 2;

            // The digging effect
            sand.EffectActions    = new int[] { Core.SA ? 3 : 11 };
            sand.EffectSounds     = new int[] { 0x125, 0x126 };
            sand.EffectCounts     = new int[] { 6 };
            sand.EffectDelay      = TimeSpan.FromSeconds(1.6);
            sand.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            oreAndStone.NoResourcesMessage     = "Nao tem areia aqui";                   // There is no metal here to mine.
            oreAndStone.DoubleHarvestMessage   = "Alguem pegou sua areia";               // Someone has gotten to the metal before you.
            oreAndStone.TimedOutOfRangeMessage = "Voce esta muito longe do minerio";     // You have moved too far away to continue mining.
            oreAndStone.OutOfRangeMessage      = "Isto esta muito longe";                // That is too far away.
            oreAndStone.FailMessage            = "Voce nao conseguiu encontrar minerio"; // You loosen some rocks but fail to find any useable ore.
            oreAndStone.PackFullMessage        = "Sua mochila esta cheia";               // Your backpack is full, so the ore you mined is lost.
            oreAndStone.ToolBrokeMessage       = "Sua ferramenta quebrou !";             // You have worn out your tool!


            res = new HarvestResource[]
            {
                new HarvestResource(100.0, 70.0, 100.0, 1044631, typeof(Sand))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(100.0, 0.0, res[0], null)
            };

            sand.Resources = res;
            sand.Veins     = veins;

            this.Definitions.Add(sand);
            #endregion
        }
Beispiel #10
0
		private Mining()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

			#region Mining for ore and stone
			HarvestDefinition oreAndStone = m_OreAndStone = new HarvestDefinition();

			// Resource banks are every 8x8 tiles
			oreAndStone.BankWidth = 8;
			oreAndStone.BankHeight = 8;

			// Every bank holds from 10 to 34 ore
			oreAndStone.MinTotal = 10;
			oreAndStone.MaxTotal = 34;

			// A resource bank will respawn its content every 10 to 20 minutes
			oreAndStone.MinRespawn = TimeSpan.FromMinutes( 5.0 );
			oreAndStone.MaxRespawn = TimeSpan.FromMinutes( 10.0 );

			// Skill checking is done on the Mining skill
			oreAndStone.Skill = SkillName.Mining;

			// Set the list of harvestable tiles
			oreAndStone.Tiles = m_MountainAndCaveTiles;

			// Players must be within 2 tiles to harvest
			oreAndStone.MaxRange = 2;

			// One ore per harvest action
			oreAndStone.ConsumedPerHarvest = 1;
			oreAndStone.ConsumedPerFeluccaHarvest = 2;

			// The digging effect
			oreAndStone.EffectActions = new int[]{ 11 };
			oreAndStone.EffectSounds = new int[]{ 0x125, 0x126 };
			oreAndStone.EffectCounts = new int[]{ 1 };
			oreAndStone.EffectDelay = TimeSpan.FromSeconds( 1.6 );
			oreAndStone.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

			oreAndStone.NoResourcesMessage = 503040; // There is no metal here to mine.
			oreAndStone.DoubleHarvestMessage = 503042; // Someone has gotten to the metal before you.
			oreAndStone.TimedOutOfRangeMessage = 503041; // You have moved too far away to continue mining.
			oreAndStone.OutOfRangeMessage = 500446; // That is too far away.
			oreAndStone.FailMessage = 503043; // You loosen some rocks but fail to find any useable ore.
			oreAndStone.PackFullMessage = 1010481; // Your backpack is full, so the ore you mined is lost.
			oreAndStone.ToolBrokeMessage = 1044038; // You have worn out your tool!

			res = new HarvestResource[]
				{
					new HarvestResource( 00.0, 00.0, 100.0, 1007072, typeof( IronOre ),		typeof( Granite ) ),
					new HarvestResource( 40.0, 25.0, 105.0, 1007073, typeof( DullCopperOre ),	typeof( DullCopperGranite ),		typeof( DullCopperElemental ) ),
					new HarvestResource( 45.0, 27.5, 107.5, 1007074, typeof( ShadowIronOre ),	typeof( ShadowIronGranite ),		typeof( ShadowIronElemental ) ),
					new HarvestResource( 50.0, 30.0, 110.0, 1007075, typeof( CopperOre ),		typeof( CopperGranite ),		typeof( CopperElemental ) ),
					new HarvestResource( 55.0, 32.5, 112.5, 1007076, typeof( BronzeOre ),		typeof( BronzeGranite ),		typeof( BronzeElemental ) ),
					new HarvestResource( 60.0, 35.0, 115.0, 1007077, typeof( GoldOre ),		typeof( GoldGranite ),			typeof( GoldenElemental ) ),
					new HarvestResource( 65.0, 37.5, 117.5, 1007078, typeof( AgapiteOre ),		typeof( AgapiteGranite ),		typeof( AgapiteElemental ) ),
					new HarvestResource( 70.0, 40.0, 120.0, 1007079, typeof( VeriteOre ),		typeof( VeriteGranite ),		typeof( VeriteElemental ) ),
					new HarvestResource( 75.0, 42.5, 122.5, 1007080, typeof( ValoriteOre ),		typeof( ValoriteGranite ),		typeof( ValoriteElemental ) ),
					new HarvestResource( 80.0, 45.0, 125.0, "You dig some silver ore and put it in your backpack" , typeof( SilverOre ), typeof( SilverGranite ), typeof( SilverElemental ) ),
					new HarvestResource( 85.0, 47.5, 127.5, "You dig some platinum ore and put it in your backpack" , typeof( PlatinumOre ), typeof( PlatinumGranite ), typeof( PlatinumElemental ) ),
					new HarvestResource( 90.0, 50.0, 130.0, "You dig some mythril ore and put it in your backpack" , typeof( MythrilOre ), typeof( MythrilGranite ), typeof( MythrilElemental ) ),
					new HarvestResource( 95.0, 52.5, 132.5, "You dig some obsidian ore and put it in your backpack" , typeof( ObsidianOre ), typeof( ObsidianGranite ), typeof( ObsidianElemental ) ),
					new HarvestResource( 100.0, 55.0, 135.0, "You dig some jade ore and put it in your backpack" , typeof( JadeOre ), typeof( JadeGranite ), typeof( JadeElemental ) ),
					new HarvestResource( 105.0, 57.5, 137.5, "You dig some moonstone ore and put it in your backpack" , typeof( MoonstoneOre ), typeof( MoonstoneGranite ), typeof( MoonstoneElemental ) ),
					new HarvestResource( 110.0, 60.0, 140.0, "You dig some sunstone ore and put it in your backpack" , typeof( SunstoneOre ), typeof( SunstoneGranite ), typeof( SunstoneElemental ) ),
					new HarvestResource( 115.0, 62.5, 142.5, "You dig some bloodstone ore and put it in your backpack" , typeof( BloodstoneOre ), typeof( BloodstoneGranite ), typeof( BloodstoneElemental ) )
				};

			veins = new HarvestVein[]
				{
					new HarvestVein( 21.2, 0.0, res[0], null   ), // Iron
					new HarvestVein( 10.2, 0.5, res[1], res[0] ), // Dull Copper
					new HarvestVein( 09.8, 0.5, res[2], res[0] ), // Shadow Iron
					new HarvestVein( 06.8, 0.5, res[3], res[0] ), // Copper
					new HarvestVein( 06.4, 0.5, res[4], res[0] ), // Bronze
					new HarvestVein( 06.0, 0.5, res[5], res[0] ), // Gold
					new HarvestVein( 05.6, 0.5, res[6], res[0] ), // Agapite
					new HarvestVein( 05.2, 0.5, res[7], res[0] ), // Verite
					new HarvestVein( 04.8, 0.5, res[8], res[0] ),  // Valorite
					new HarvestVein( 04.4, 0.5, res[9], res[0] ), // Silver
					new HarvestVein( 04.0, 0.5, res[10], res[0] ), // Platinum
					new HarvestVein( 03.6, 0.5, res[11], res[0] ), // Mythril
					new HarvestVein( 03.2, 0.5, res[12], res[0] ), // Obsidian
					new HarvestVein( 02.8, 0.5, res[13], res[0] ), // Jade
					new HarvestVein( 02.4, 0.5, res[14], res[0] ), // Moonstone
					new HarvestVein( 02.0, 0.5, res[15], res[0] ), // Sunstone
					new HarvestVein( 01.6, 0.5, res[16], res[0] ) // Bloodstone
				};

			oreAndStone.Resources = res;
			oreAndStone.Veins = veins;

			Definitions.Add( oreAndStone );
			#endregion

			#region Mining for sand
			HarvestDefinition sand = m_Sand = new HarvestDefinition();

			// Resource banks are every 8x8 tiles
			sand.BankWidth = 8;
			sand.BankHeight = 8;

			// Every bank holds from 6 to 12 sand
			sand.MinTotal = 6;
			sand.MaxTotal = 12;

			// A resource bank will respawn its content every 10 to 20 minutes
			sand.MinRespawn = TimeSpan.FromMinutes( 10.0 );
			sand.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

			// Skill checking is done on the Mining skill
			sand.Skill = SkillName.Mining;

			// Set the list of harvestable tiles
			sand.Tiles = m_SandTiles;

			// Players must be within 2 tiles to harvest
			sand.MaxRange = 2;

			// One sand per harvest action
			sand.ConsumedPerHarvest = 1;
			sand.ConsumedPerFeluccaHarvest = 1;

			// The digging effect
			sand.EffectActions = new int[]{ 11 };
			sand.EffectSounds = new int[]{ 0x125, 0x126 };
			sand.EffectCounts = new int[]{ 6 };
			sand.EffectDelay = TimeSpan.FromSeconds( 1.6 );
			sand.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

			sand.NoResourcesMessage = 1044629; // There is no sand here to mine.
			sand.DoubleHarvestMessage = 1044629; // There is no sand here to mine.
			sand.TimedOutOfRangeMessage = 503041; // You have moved too far away to continue mining.
			sand.OutOfRangeMessage = 500446; // That is too far away.
			sand.FailMessage = 1044630; // You dig for a while but fail to find any of sufficient quality for glassblowing.
			sand.PackFullMessage = 1044632; // Your backpack can't hold the sand, and it is lost!
			sand.ToolBrokeMessage = 1044038; // You have worn out your tool!

			res = new HarvestResource[]
				{
					new HarvestResource( 100.0, 70.0, 400.0, 1044631, typeof( Sand ) )
				};

			veins = new HarvestVein[]
				{
					new HarvestVein( 100.0, 0.0, res[0], null )
				};

			sand.Resources = res;
			sand.Veins = veins;

			Definitions.Add( sand );
			#endregion
		}
Beispiel #11
0
        public override void FinishHarvesting(Mobile from, Item tool, HarvestDefinition def, object toHarvest, object locked)
        {
            //Lava fishing needs to have its own set of rules.
            if (IsLavaHarvest(tool, toHarvest))
            {
                from.EndAction(locked);

                if (!CheckHarvest(from, tool))
                {
                    return;
                }

                int     tileID;
                Map     map;
                Point3D loc;

                if (!GetHarvestDetails(from, tool, toHarvest, out tileID, out map, out loc))
                {
                    OnBadHarvestTarget(from, tool, toHarvest);
                    return;
                }
                else if (!def.Validate(tileID) && !def.ValidateSpecial(tileID))
                {
                    OnBadHarvestTarget(from, tool, toHarvest);
                    return;
                }

                if (!CheckRange(from, tool, def, map, loc, true))
                {
                    return;
                }
                else if (!CheckResources(from, tool, def, map, loc, true))
                {
                    return;
                }
                else if (!CheckHarvest(from, tool, def, toHarvest))
                {
                    return;
                }

                HarvestBank bank = def.GetBank(map, loc.X, loc.Y);

                if (bank == null)
                {
                    return;
                }

                HarvestVein vein = bank.Vein;

                if (vein == null)
                {
                    return;
                }

                Type type = null;

                HarvestResource resource = MutateResource(from, tool, def, map, loc, vein, vein.PrimaryResource, vein.FallbackResource);

                if (from.CheckSkill(def.Skill, resource.MinSkill, resource.MaxSkill))
                {
                    //Special eye candy item
                    type = GetSpecialLavaItem(from, tool, map, loc, toHarvest);

                    //Special fish
                    if (type == null)
                    {
                        type = FishInfo.GetSpecialItem(from, tool, loc, IsLavaHarvest(tool, tileID));
                    }

                    if (type != null)
                    {
                        Item item = Construct(type, from, tool);

                        if (item == null)
                        {
                            type = null;
                        }
                        else
                        {
                            if (from.AccessLevel == AccessLevel.Player)
                            {
                                bank.Consume(Convert.ToInt32(map != null && map.Rules == MapRules.FeluccaRules ? Math.Ceiling(item.Amount / 2.0) : item.Amount), from);
                            }

                            if (Give(from, item, true))
                            {
                                SendSuccessTo(from, item, null);
                            }
                            else
                            {
                                SendPackFullTo(from, item, def, null);
                                item.Delete();
                            }
                        }
                    }
                }

                if (type == null)
                {
                    def.SendMessageTo(from, def.FailMessage);

                    double skill = (double)from.Skills[SkillName.Fishing].Value / 50;

                    if (0.5 / skill > Utility.RandomDouble())
                    {
                        OnToolUsed(from, tool, false);
                    }
                }
                else
                {
                    OnToolUsed(from, tool, true);
                }

                OnHarvestFinished(from, tool, def, vein, bank, null, null);
            }
            else
            {
                base.FinishHarvesting(from, tool, def, toHarvest, locked);
            }
        }
Beispiel #12
0
        private Lumberjacking()
        {
            HarvestResource[] res;
            HarvestVein[] veins;

            #region Lumberjacking
            HarvestDefinition lumber = new HarvestDefinition();

            // Resource banks are every 4x3 tiles
            lumber.BankWidth = 4;
            lumber.BankHeight = 3;

            // Every bank holds from 20 to 45 logs
            lumber.MinTotal = 20;
            lumber.MaxTotal = 45;

            // A resource bank will respawn its content every 20 to 30 minutes
            lumber.MinRespawn = TimeSpan.FromMinutes(20.0);
            lumber.MaxRespawn = TimeSpan.FromMinutes(30.0);

            // Skill checking is done on the Lumberjacking skill
            lumber.Skill = SkillName.Lumberjacking;

            // Set the list of harvestable tiles
            lumber.Tiles = m_TreeTiles;

            // Players must be within 2 tiles to harvest
            lumber.MaxRange = 2;

            // Ten logs per harvest action
            lumber.ConsumedPerHarvest = 10;
            lumber.ConsumedPerFeluccaHarvest = 20;

            // The chopping effect
            lumber.EffectActions = new int[] { 13 };
            lumber.EffectSounds = new int[] { 0x13E };
            lumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
            lumber.EffectDelay = TimeSpan.FromSeconds(1.6);
            lumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            lumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
            lumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
            lumber.OutOfRangeMessage = 500446; // That is too far away.
            lumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
            lumber.ToolBrokeMessage = 500499; // You broke your axe.

            if (Core.ML)
            {
                res = new HarvestResource[]
                {
                    new HarvestResource(00.0, 00.0, 100.0, 1072540, typeof(Log)),
                    new HarvestResource(65.0, 25.0, 105.0, 1072541, typeof(OakLog)),
                    new HarvestResource(80.0, 40.0, 120.0, 1072542, typeof(AshLog)),
                    new HarvestResource(95.0, 55.0, 135.0, 1072543, typeof(YewLog)),
                    new HarvestResource(100.0, 60.0, 140.0, 1072544, typeof(HeartwoodLog)),
                    new HarvestResource(100.0, 60.0, 140.0, 1072545, typeof(BloodwoodLog)),
                    new HarvestResource(100.0, 60.0, 140.0, 1072546, typeof(FrostwoodLog)),
                };

                veins = new HarvestVein[]
                {
                    new HarvestVein(49.0, 0.0, res[0], null), // Ordinary Logs
                    new HarvestVein(30.0, 0.5, res[1], res[0]), // Oak
                    new HarvestVein(10.0, 0.5, res[2], res[0]), // Ash
                    new HarvestVein(05.0, 0.5, res[3], res[0]), // Yew
                    new HarvestVein(03.0, 0.5, res[4], res[0]), // Heartwood
                    new HarvestVein(02.0, 0.5, res[5], res[0]), // Bloodwood
                    new HarvestVein(01.0, 0.5, res[6], res[0]), // Frostwood
                };

                lumber.BonusResources = new BonusHarvestResource[]
                {
                    new BonusHarvestResource(0, 83.9, null, null), //Nothing
                    new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
                    new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
                    new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
                    new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
                    new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
                };
            }
            else
            {
                res = new HarvestResource[]
                {
                    new HarvestResource(00.0, 00.0, 100.0, 500498, typeof(Log))
                };

                veins = new HarvestVein[]
                {
                    new HarvestVein(100.0, 0.0, res[0], null)
                };
            }

            lumber.Resources = res;
            lumber.Veins = veins;

            lumber.RaceBonus = Core.ML;
            lumber.RandomizeVeins = Core.ML;

            this.m_Definition = lumber;
            this.Definitions.Add(lumber);
            #endregion
        }
Beispiel #13
0
        private Lumberjacking()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            #region Lumberjacking
            HarvestDefinition lumber = new HarvestDefinition();

            // Resource banks are every 4x3 tiles
            lumber.BankWidth  = 8;
            lumber.BankHeight = 8;

            lumber.MinTotal = 10;
            lumber.MaxTotal = 50;

            lumber.MinRespawn = TimeSpan.FromMinutes(10.0);
            lumber.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Lumberjacking skill
            lumber.Skill = SkillName.Lumberjacking;

            // Set the list of harvestable tiles
            lumber.Tiles = m_TreeTiles;

            // Players must be within 2 tiles to harvest
            lumber.MaxRange = 2;

            // Ten logs per harvest action
            lumber.ConsumedPerHarvest        = 10;
            lumber.ConsumedPerFeluccaHarvest = 10;

            // The chopping effect
            lumber.EffectActions    = new int[] { 13 };
            lumber.EffectSounds     = new int[] { 0x13E };
            lumber.EffectCounts     = new int[] { 1, 2, 2, 2, 3 };
            lumber.EffectDelay      = TimeSpan.FromSeconds(1.6);
            lumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            lumber.NoResourcesMessage = 500493;      // There's not enough wood here to harvest.
            lumber.FailMessage        = 500495;      // You hack at the tree for a while, but fail to produce any useable wood.
            lumber.OutOfRangeMessage  = 500446;      // That is too far away.
            lumber.PackFullMessage    = 500497;      // You can't place any wood into your backpack!
            lumber.ToolBrokeMessage   = 500499;      // You broke your axe.

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 100.0, 500498, typeof(Log))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(100.0, 0.0, res[0], null)
            };

            lumber.Resources = res;
            lumber.Veins     = veins;

            m_Definition = lumber;
            Definitions.Add(lumber);
            #endregion
        }
        private Lumberjacking()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            #region Lumberjacking
            HarvestDefinition lumber = new HarvestDefinition();

            // Resource banks are every 4x3 tiles
            lumber.BankWidth  = 4;
            lumber.BankHeight = 3;

            // Every bank holds from 20 to 45 logs
            lumber.MinTotal = 20;
            lumber.MaxTotal = 45;

            // A resource bank will respawn its content every 20 to 30 minutes
            lumber.MinRespawn = TimeSpan.FromMinutes(20.0);
            lumber.MaxRespawn = TimeSpan.FromMinutes(30.0);

            // Skill checking is done on the Lumberjacking skill
            lumber.Skill = SkillName.Lumberjacking;

            // Set the list of harvestable tiles
            lumber.Tiles = m_TreeTiles;

            // Players must be within 2 tiles to harvest
            lumber.MaxRange = 2;

            // Ten logs per harvest action
            lumber.ConsumedPerHarvest        = 10;
            lumber.ConsumedPerFeluccaHarvest = 20;

            // The chopping effect
            lumber.EffectActions    = new int[] { 13 };
            lumber.EffectSounds     = new int[] { 0x13E };
            lumber.EffectCounts     = (Core.AOS ? new int[] { 3 } : new int[] { 1, 2, 2, 2, 3 });
            lumber.EffectDelay      = TimeSpan.FromSeconds(1.6);
            lumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            lumber.NoResourcesMessage = 500493;      // There's not enough wood here to harvest.
            lumber.FailMessage        = 500495;      // You hack at the tree for a while, but fail to produce any useable wood.
            lumber.OutOfRangeMessage  = 500446;      // That is too far away.
            lumber.PackFullMessage    = 500497;      // You can't place any wood into your backpack!
            lumber.ToolBrokeMessage   = 500499;      // You broke your axe.

            if (Core.ML)
            {
                res = new HarvestResource[]
                {
                    new HarvestResource(00.0, 00.0, 100.0, 1072540, typeof(Log)),
                    new HarvestResource(65.0, 25.0, 105.0, 1072541, typeof(OakLog)),
                    new HarvestResource(80.0, 40.0, 120.0, 1072542, typeof(AshLog)),
                    new HarvestResource(95.0, 55.0, 135.0, 1072543, typeof(YewLog)),
                    new HarvestResource(100.0, 60.0, 140.0, 1072544, typeof(HeartwoodLog)),
                    new HarvestResource(100.0, 60.0, 140.0, 1072545, typeof(BloodwoodLog)),
                    new HarvestResource(100.0, 60.0, 140.0, 1072546, typeof(FrostwoodLog)),

                    new HarvestResource(55.0, 55.0, 105.0, 1072541, typeof(FineLog)),
                    new HarvestResource(75.0, 75.0, 105.0, 1072541, typeof(PoisonLog)),
                    new HarvestResource(90.0, 90.0, 105.0, 1072541, typeof(FireLog)),
                };


                veins = new HarvestVein[]
                {
                    new HarvestVein(40.0, 0.0, res[0], null),     // Ordinary Logs
                    new HarvestVein(0.0, 0.5, res[1], res[0]),    // Oak
                    new HarvestVein(0.0, 0.5, res[2], res[0]),    // Ash
                    new HarvestVein(0.0, 0.5, res[3], res[0]),    // Yew
                    new HarvestVein(0.0, 0.5, res[4], res[0]),    // Heartwood
                    new HarvestVein(0.0, 0.5, res[5], res[0]),    // Bloodwood
                    new HarvestVein(0.0, 0.5, res[6], res[0]),    // Frostwood

                    new HarvestVein(30.0, 0.5, res[7], res[0]),   // Fine
                    new HarvestVein(20.0, 0.5, res[8], res[0]),   // Poison
                    new HarvestVein(10.0, 0.5, res[9], res[0]),   // Fire
                };

                lumber.BonusResources = new BonusHarvestResource[]
                {
                    new BonusHarvestResource(0, 83.9, null, null),                              //Nothing
                    new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
                    new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
                    new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
                    new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
                    new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
                };
            }
            else
            {
                res = new HarvestResource[]
                {
                    new HarvestResource(00.0, 00.0, 100.0, 500498, typeof(Log))
                };

                veins = new HarvestVein[]
                {
                    new HarvestVein(100.0, 0.0, res[0], null)
                };
            }

            lumber.Resources = res;
            lumber.Veins     = veins;

            lumber.RaceBonus      = false; // Core.ML;
            lumber.RandomizeVeins = true;  // Core.ML;

            m_Definition = lumber;
            Definitions.Add(lumber);
            #endregion
        }
Beispiel #15
0
        private ClayMining()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

            #region Mining for Clay
            HarvestDefinition Clay = m_Clay = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            Clay.BankWidth = 8;
            Clay.BankHeight = 8;

            // Every bank holds from 6 to 12 Clay
            Clay.MinTotal = 5;
            Clay.MaxTotal = 8;

            // A resource bank will respawn its content every 10 to 20 minutes
            Clay.MinRespawn = TimeSpan.FromMinutes(10.0);
            Clay.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Mining skill
            Clay.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            Clay.Tiles = m_SwampTiles;

            // Players must be within 2 tiles to harvest
            Clay.MaxRange = 2;

            // One Clay per harvest action
            Clay.ConsumedPerHarvest = 1;
            Clay.ConsumedPerFeluccaHarvest = 1;

            // The digging effect
            Clay.EffectActions = new int[] { 11 };
            Clay.EffectSounds = new int[] { 0x125, 0x126 };
            Clay.EffectCounts = new int[] { 1 };
            Clay.EffectDelay = TimeSpan.FromSeconds(1.6);
            Clay.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            Clay.NoResourcesMessage = "There is no Clay here to mine."; // There is no Clay here to mine.
            Clay.DoubleHarvestMessage = "There is no Clay here to mine."; // There is no Clay here to mine.
            Clay.TimedOutOfRangeMessage = "You have moved too far away to continue mining."; // You have moved too far away to continue mining.
            Clay.OutOfRangeMessage = "That is too far away."; // That is too far away.
            Clay.FailMessage = "You dig for a while but fail to find any Clay."; // You dig for a while but fail to find any Clay.
            Clay.PackFullMessage = "Your backpack can't hold the Clay, and it is lost!"; // Your backpack can't hold the Clay, and it is lost!
            Clay.ToolBrokeMessage = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
				{
                    new HarvestResource( 100.0, 85.0, 400.0, "You dig some Clay and put it in your backpack", typeof (Clay)),
				
				};

            veins = new HarvestVein[]
				{
                    new HarvestVein( 100.0, 0.0, res[0], null   ),//Clay
				};

            Clay.Resources = res;
            Clay.Veins = veins;

            Definitions.Add(Clay);
            #endregion
		}
Beispiel #16
0
        private GraveRobbing()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            #region GraveRobbing
            HarvestDefinition grave = new HarvestDefinition();
            grave.BankWidth                 = 2;
            grave.BankHeight                = 2;
            grave.MinTotal                  = 1;
            grave.MaxTotal                  = 2;
            grave.MinRespawn                = TimeSpan.FromMinutes(10.0);
            grave.MaxRespawn                = TimeSpan.FromMinutes(20.0);
            grave.Skill                     = SkillName.Mining;
            grave.Tiles                     = m_GraveTiles;
            grave.MaxRange                  = 2;
            grave.ConsumedPerHarvest        = 1;
            grave.ConsumedPerFeluccaHarvest = 1;
            grave.EffectActions             = new int[] { 13 };
            grave.EffectSounds              = new int[] { 0x13E };
            grave.EffectCounts              = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
            grave.EffectDelay               = TimeSpan.FromSeconds(1.6);
            grave.EffectSoundDelay          = TimeSpan.FromSeconds(0.9);
            grave.NoResourcesMessage        = "Thou dost see nothing worth taking.";         // Nothing worth taking..
            grave.FailMessage               = "Thou hast dug for a wile but found nothing."; // Nothing visible happens..
            grave.OutOfRangeMessage         = 500446;                                        // That is too far away.
            grave.PackFullMessage           = 500720;                                        // You don't have enough room in your backpack!
            grave.ToolBrokeMessage          = "Thou hast broken thy shovel.";                // You broke your axe.

            res = new HarvestResource[]
            {
                new HarvestResource(020.0, 010.0, 150.0, "You put some Bones in your backpack", typeof(Bone), typeof(VengefulSpirit)),
                new HarvestResource(050.0, 030.0, 150.0, "You put some Mandrakeroot in your backpack", typeof(MandrakeRoot)),
                new HarvestResource(050.0, 030.0, 150.0, "You put some Nightshade in your backpack", typeof(Nightshade)),
                new HarvestResource(050.0, 030.0, 150.0, "You put some SpidersSilk in your backpack", typeof(SpidersSilk)),
                new HarvestResource(065.0, 040.0, 150.0, "You put some DestroyingAngel in your backpack", typeof(DestroyingAngel)),
                new HarvestResource(065.0, 040.0, 150.0, "You put some PetrafiedWood in your backpack", typeof(PetrafiedWood))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(35.0, 0.0, res[0], res[0]),                     // Bones
                new HarvestVein(15.0, 0.5, res[1], res[0]),                     // MandrakeRoot
                new HarvestVein(15.0, 0.5, res[2], res[0]),                     // Nightshade
                new HarvestVein(15.0, 0.5, res[3], res[0]),                     // SpidersSilk
                new HarvestVein(10.0, 0.5, res[4], res[0]),                     // DestroyingAngel
                new HarvestVein(10.0, 0.5, res[5], res[0])                      // PetrafiedWood
            };

            if (Core.ML)
            {
                grave.BonusResources = new BonusHarvestResource[]                 // cos this is mining after all
                {
                    new BonusHarvestResource(0, 99.8998, null, null),             //Nothing	//Note: Rounded the below to .0167 instead of 1/6th of a %.  Close enough
                    new BonusHarvestResource(100, .0167, 1072562, typeof(BlueDiamond)),
                    new BonusHarvestResource(100, .0167, 1072567, typeof(DarkSapphire)),
                    new BonusHarvestResource(100, .0167, 1072570, typeof(EcruCitrine)),
                    new BonusHarvestResource(100, .0167, 1072564, typeof(FireRuby)),
                    new BonusHarvestResource(100, .0167, 1072566, typeof(PerfectEmerald)),
                    new BonusHarvestResource(100, .0167, 1072568, typeof(Turquoise))
                };
            }

            grave.RandomizeVeins = Core.ML;

            grave.Resources = res;
            grave.Veins     = veins;

            m_Definition = grave;
            Definitions.Add(grave);
            #endregion
        }
        public virtual void FinishHarvesting(Mobile from, Item tool, HarvestDefinition def, object toHarvest, object locked)
        {
            from.EndAction(locked);

            if (!CheckHarvest(from, tool))
            {
                return;
            }

            int     tileID;
            Map     map;
            Point3D loc;

            if (!GetHarvestDetails(from, tool, toHarvest, out tileID, out map, out loc))
            {
                OnBadHarvestTarget(from, tool, toHarvest);
                return;
            }
            else if (!def.Validate(tileID))
            {
                OnBadHarvestTarget(from, tool, toHarvest);
                return;
            }

            if (!CheckRange(from, tool, def, map, loc, true))
            {
                return;
            }
            else if (!CheckResources(from, tool, def, map, loc, true))
            {
                return;
            }
            else if (!CheckHarvest(from, tool, def, toHarvest))
            {
                return;
            }

            if (SpecialHarvest(from, tool, def, map, loc))
            {
                return;
            }

            HarvestBank bank = def.GetBank(map, loc.X, loc.Y);

            if (bank == null)
            {
                return;
            }

            HarvestVein vein = bank.Vein;

            if (vein != null)
            {
                vein = MutateVein(from, tool, def, bank, toHarvest, vein);
            }

            if (vein == null)
            {
                return;
            }

            HarvestResource primary  = vein.PrimaryResource;
            HarvestResource fallback = vein.FallbackResource;
            HarvestResource resource = MutateResource(from, tool, def, map, loc, vein, primary, fallback);

            double skillBase  = from.Skills[def.Skill].Base;
            double skillValue = from.Skills[def.Skill].Value;

            Type type = null;

            if (skillBase >= resource.ReqSkill && from.CheckSkill(def.Skill, resource.MinSkill, resource.MaxSkill))
            {
                type = GetResourceType(from, tool, def, map, loc, resource);

                if (type != null)
                {
                    type = MutateType(type, from, tool, def, map, loc, resource);
                }

                if (type != null)
                {
                    Item item = Construct(type, from, ObjectArgs(type, from, tool, def, map, loc, resource));

                    if (item == null)
                    {
                        type = null;
                    }
                    else
                    {
                        if (item.Stackable)
                        {
                            if (map == Map.Felucca && bank.Current >= def.ConsumedPerFeluccaHarvest)
                            {
                                item.Amount = def.ConsumedPerFeluccaHarvest;
                            }
                            else
                            {
                                item.Amount = def.ConsumedPerHarvest;
                            }
                        }

                        bank.Consume(def, item.Amount);

                        if (Give(from, item, def.PlaceAtFeetIfFull))
                        {
                            SendSuccessTo(from, item, resource);
                        }
                        else
                        {
                            SendPackFullTo(from, item, def, resource);
                            item.Delete();
                        }

                        if (tool is IUsesRemaining)
                        {
                            IUsesRemaining toolWithUses = (IUsesRemaining)tool;

                            toolWithUses.ShowUsesRemaining = true;

                            if (toolWithUses.UsesRemaining > 0)
                            {
                                --toolWithUses.UsesRemaining;
                            }

                            if (toolWithUses.UsesRemaining < 1)
                            {
                                tool.Delete();
                                def.SendMessageTo(from, def.ToolBrokeMessage);
                            }
                        }
                    }
                }
            }

            if (type == null)
            {
                def.SendMessageTo(from, def.FailMessage);
                OnHarvestFailed(type, from, tool, def, map, loc, resource);
            }

            OnHarvestFinished(from, tool, def, vein, bank, resource, toHarvest);
        }
Beispiel #18
0
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            int tileID; Map map; Point3D loc;

            if (GetHarvestDetails(from, tool, harvested, out tileID, out map, out loc))
            {
                if (0.15 > Utility.RandomDouble())
                {
                    HarvestResource res = vein.PrimaryResource;

                    if (res == resource)
                    {
                        try
                        {
                            Type   chance; int num;
                            double miningskill = from.Skills[SkillName.Mining].Base;

                            if ((0.67 > Utility.RandomDouble()) && (res.Types.Length >= 2))
                            {
                                num = (((int)miningskill - 20) + Utility.Random(40)) / 20;

                                if (num >= 0 && num <= 5 && (0.90 > Utility.RandomDouble()))
                                {
                                    chance = Spirit[num];
                                }
                                else
                                {
                                    chance = res.Types[1];
                                }

                                BaseCreature spawned = Activator.CreateInstance(chance, new object[] { 10 }) as BaseCreature;
                                if (spawned != null)
                                {
                                    spawned.MoveToWorld(loc, map);
                                    spawned.Say("Who has disturbed me!");
                                    spawned.Combatant = from;
                                }
                            }

                            double stealingskill = from.Skills[SkillName.Stealing].Base;

                            if ((stealingskill < 60) ? (0.22 > Utility.RandomDouble()) : (0.17 > Utility.RandomDouble()))
                            {
                                num = ((((int)stealingskill - 30) + Utility.Random(11)) / 7) + 1;

                                if (num < 0)
                                {
                                    num = 0;
                                }
                                else if (num > 9)
                                {
                                    num = 9;
                                }

                                BaseContainer goodies = Activator.CreateInstance(GraveGoods[Utility.Random(num)], new object[] { }) as BaseContainer;
                                if (goodies != null)
                                {
                                    goodies.MoveToWorld(loc, map);
                                    from.SendMessage("Thou hast dug up something interesting!");
                                }
                            }
                        }
                        catch { }
                    }
                }
            }
        }
        private Lumberjacking()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            HarvestDefinition lumber = new HarvestDefinition();

            lumber.BankWidth  = 4;
            lumber.BankHeight = 3;

            lumber.MinTotal = 20;
            lumber.MaxTotal = 35;

            lumber.MinRespawn = TimeSpan.FromMinutes(20.0);
            lumber.MaxRespawn = TimeSpan.FromMinutes(30.0);

            lumber.Skill = SkillName.Lumberjacking;

            lumber.Tiles = m_TreeTiles;

            lumber.MaxRange = 2;

            lumber.ConsumedPerHarvest        = 10;
            lumber.ConsumedPerFeluccaHarvest = 10;

            lumber.EffectActions    = new int[] { 13 };
            lumber.EffectSounds     = new int[] { 0x13E };
            lumber.EffectCounts     = (Core.AOS ? new int[] { 1 } : new int[] { 1, 1, 1, 1, 1 }); //new int[]{ 1, 2, 2, 2, 3 });
            lumber.EffectDelay      = TimeSpan.FromSeconds(1.6);
            lumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            lumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
            lumber.FailMessage        = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
            lumber.OutOfRangeMessage  = 500446; // That is too far away.
            lumber.PackFullMessage    = 500497; // You can't place any wood into your backpack!
            lumber.ToolBrokeMessage   = 500499; // You broke your axe.

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 100.0, 1072540, typeof(Log)),
                new HarvestResource(65.0, 25.0, 105.0, 1072541, typeof(OakLog)),
                new HarvestResource(80.0, 40.0, 120.0, 1072542, typeof(AshLog)),
                new HarvestResource(95.0, 55.0, 135.0, 1072543, typeof(YewLog)),
                new HarvestResource(100.0, 60.0, 140.0, 1072544, typeof(HeartwoodLog)),
                new HarvestResource(100.0, 60.0, 140.0, 1072545, typeof(BloodwoodLog)),
                new HarvestResource(100.0, 60.0, 140.0, 1072546, typeof(FrostwoodLog)),
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(49.0, 0.0, res[0], null),                     // Log
                new HarvestVein(30.0, 0.5, res[1], res[0]),                   // Oak
                new HarvestVein(10.0, 0.5, res[2], res[0]),                   // Ash
                new HarvestVein(05.0, 0.5, res[3], res[0]),                   // Yew
                new HarvestVein(03.0, 0.5, res[4], res[0]),                   // Heartwood
                new HarvestVein(02.0, 0.5, res[5], res[0]),                   // Bloodwood
                new HarvestVein(01.0, 0.5, res[6], res[0]),                   // Frostwood
            };

            lumber.Resources = res;
            lumber.Veins     = veins;

            //TEST: Check This
            lumber.RaceBonus      = false;
            lumber.RandomizeVeins = true;

            m_Definition = lumber;
            Definitions.Add(lumber);
        }
Beispiel #20
0
        private WheatGathering()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            #region WheatGathering
            HarvestDefinition wheat = new HarvestDefinition();

            // Resource banks are every 4x3 tiles
            wheat.BankWidth  = 2;
            wheat.BankHeight = 2;

            // Every bank holds from 4 to 5 wheat
            wheat.MinTotal = 4;
            wheat.MaxTotal = 5;

            // A resource bank will respawn its content every 20 to 30 minutes
            wheat.MinRespawn = TimeSpan.FromMinutes(20.0);
            wheat.MaxRespawn = TimeSpan.FromMinutes(30.0);

            // Skill checking is done on the Mining skill
            wheat.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            wheat.Tiles = m_WheatTiles;

            // Players must be within 2 tiles to harvest
            wheat.MaxRange = 2;

            // Ten logs per harvest action
            wheat.ConsumedPerHarvest        = 1;
            wheat.ConsumedPerFeluccaHarvest = 1;

            // The chopping effect
            wheat.EffectActions    = new int[] { 13 };
            wheat.EffectSounds     = new int[] { 0x13E };
            wheat.EffectCounts     = new int[] { 1, 2 };
            wheat.EffectDelay      = TimeSpan.FromSeconds(1.3);
            wheat.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            wheat.NoResourcesMessage = "There's not enough wheat here to harvest";
            wheat.FailMessage        = "You hack away for a while, but fail to produce any useable wheat.";
            wheat.OutOfRangeMessage  = 500446;        // That is too far away.
            wheat.PackFullMessage    = "You can't place any wheat into your backpack";
            wheat.ToolBrokeMessage   = "You broken your tool";

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 00.0, "You put some Wheat in your backpack", typeof(Wheat))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(10.0, 0.0, res[0], null)                  // Wheat
            };

            wheat.Resources = res;
            wheat.Veins     = veins;

            m_Definition = wheat;
            Definitions.Add(wheat);
            #endregion
        }
        public virtual HarvestResource MutateResource( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestVein vein, HarvestResource primary, HarvestResource fallback )
        {
            if ( vein.ChanceToFallback > Utility.RandomDouble() )
                return fallback;

            double skillValue = from.Skills[def.Skill].Value;

            if ( fallback != null && (skillValue < primary.ReqSkill || skillValue < primary.MinSkill) )
                return fallback;

            return primary;
        }
Beispiel #22
0
        public virtual HarvestResource MutateResource(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestVein vein, HarvestResource primary, HarvestResource fallback)
        {
            bool racialBonus = (def.RaceBonus && from.Race == Race.Elf);

            if (vein.ChanceToFallback > (Utility.RandomDouble() + (racialBonus ? .20 : 0)))
            {
                return(fallback);
            }

            double skillValue = from.Skills[def.Skill].Value;

            if (fallback != null && (skillValue < primary.ReqSkill || skillValue < primary.MinSkill))
            {
                return(fallback);
            }

            return(primary);
        }
Beispiel #23
0
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            double skillvaluelj = from.Skills[SkillName.Mining].Base;
            int    i_itemid     = (int)(from.Skills[SkillName.ItemID].Base / 10);

            if ((Utility.RandomMinMax(1, 1500) <= (1 + i_itemid)) && (skillvaluelj >= 70.1))
            {
                switch (Utility.RandomMinMax(0, 10))
                {
                case 1: from.AddToBackpack(new BarkFragment()); from.SendMessage("you find something wedged in the wheat, a piece of bark "); break;

                case 2: from.AddToBackpack(new LuminescentFungi()); from.SendMessage("you find something wedged in the wheat, some fungi "); break;

                case 3: from.AddToBackpack(new ParasiticPlant()); from.SendMessage("you find something wedged in the wheat a weird looking plant"); break;

                case 4: from.AddToBackpack(new DiseasedBark()); from.SendMessage("you find something wedged in the wheat, some weird looking bark "); break;
                }
            }
        }
Beispiel #24
0
        private Mining()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            #region Mining for ore and stone
            HarvestDefinition oreAndStone = this.m_OreAndStone = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            oreAndStone.BankWidth  = 8;
            oreAndStone.BankHeight = 8;

            // Every bank holds from 10 to 34 ore
            oreAndStone.MinTotal = 10;
            oreAndStone.MaxTotal = 34;

            // A resource bank will respawn its content every 10 to 20 minutes
            oreAndStone.MinRespawn = TimeSpan.FromMinutes(10.0);
            oreAndStone.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Mining skill
            oreAndStone.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            oreAndStone.Tiles = m_MountainAndCaveTiles;

            // Players must be within 2 tiles to harvest
            oreAndStone.MaxRange = 2;

            // One ore per harvest action
            oreAndStone.ConsumedPerHarvest        = 1;
            oreAndStone.ConsumedPerFeluccaHarvest = 2;

            // The digging effect
            oreAndStone.EffectActions    = new int[] { 11 };
            oreAndStone.EffectSounds     = new int[] { 0x125, 0x126 };
            oreAndStone.EffectCounts     = new int[] { 1 };
            oreAndStone.EffectDelay      = TimeSpan.FromSeconds(1.6);
            oreAndStone.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            oreAndStone.NoResourcesMessage     = 503040;  // There is no metal here to mine.
            oreAndStone.DoubleHarvestMessage   = 503042;  // Someone has gotten to the metal before you.
            oreAndStone.TimedOutOfRangeMessage = 503041;  // You have moved too far away to continue mining.
            oreAndStone.OutOfRangeMessage      = 500446;  // That is too far away.
            oreAndStone.FailMessage            = 503043;  // You loosen some rocks but fail to find any useable ore.
            oreAndStone.PackFullMessage        = 1010481; // Your backpack is full, so the ore you mined is lost.
            oreAndStone.ToolBrokeMessage       = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 100.0, 1007072, typeof(IronOre), typeof(Granite)),
                new HarvestResource(65.0, 25.0, 105.0, 1007073, typeof(DullCopperOre), typeof(DullCopperGranite), typeof(DullCopperElemental)),
                new HarvestResource(70.0, 30.0, 110.0, 1007074, typeof(ShadowIronOre), typeof(ShadowIronGranite), typeof(ShadowIronElemental)),
                new HarvestResource(75.0, 35.0, 115.0, 1007075, typeof(CopperOre), typeof(CopperGranite), typeof(CopperElemental)),
                new HarvestResource(80.0, 40.0, 120.0, 1007076, typeof(BronzeOre), typeof(BronzeGranite), typeof(BronzeElemental)),
                new HarvestResource(85.0, 45.0, 125.0, 1007077, typeof(GoldOre), typeof(GoldGranite), typeof(GoldenElemental)),
                new HarvestResource(90.0, 50.0, 130.0, 1007078, typeof(AgapiteOre), typeof(AgapiteGranite), typeof(AgapiteElemental)),
                new HarvestResource(95.0, 55.0, 135.0, 1007079, typeof(VeriteOre), typeof(VeriteGranite), typeof(VeriteElemental)),
                new HarvestResource(99.0, 59.0, 139.0, 1007080, typeof(ValoriteOre), typeof(ValoriteGranite), typeof(ValoriteElemental))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(49.6, 0.0, res[0], null),   // Iron
                new HarvestVein(11.2, 0.5, res[1], res[0]), // Dull Copper
                new HarvestVein(09.8, 0.5, res[2], res[0]), // Shadow Iron
                new HarvestVein(08.4, 0.5, res[3], res[0]), // Copper
                new HarvestVein(07.0, 0.5, res[4], res[0]), // Bronze
                new HarvestVein(05.6, 0.5, res[5], res[0]), // Gold
                new HarvestVein(04.2, 0.5, res[6], res[0]), // Agapite
                new HarvestVein(02.8, 0.5, res[7], res[0]), // Verite
                new HarvestVein(01.4, 0.5, res[8], res[0])  // Valorite
            };

            oreAndStone.Resources = res;
            oreAndStone.Veins     = veins;

            if (Core.ML)
            {
                oreAndStone.BonusResources = new BonusHarvestResource[]
                {
                    new BonusHarvestResource(0, 99.4, null, null), //Nothing
                    new BonusHarvestResource(100, .1, 1072562, typeof(BlueDiamond)),
                    new BonusHarvestResource(100, .1, 1072567, typeof(DarkSapphire)),
                    new BonusHarvestResource(100, .1, 1072570, typeof(EcruCitrine)),
                    new BonusHarvestResource(100, .1, 1072564, typeof(FireRuby)),
                    new BonusHarvestResource(100, .1, 1072566, typeof(PerfectEmerald)),
                    new BonusHarvestResource(100, .1, 1072568, typeof(Turquoise))
                };
            }

            oreAndStone.RaceBonus      = Core.ML;
            oreAndStone.RandomizeVeins = Core.ML;

            this.Definitions.Add(oreAndStone);
            #endregion

            #region Mining for sand
            HarvestDefinition sand = this.m_Sand = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            sand.BankWidth  = 8;
            sand.BankHeight = 8;

            // Every bank holds from 6 to 12 sand
            sand.MinTotal = 6;
            sand.MaxTotal = 12;

            // A resource bank will respawn its content every 10 to 20 minutes
            sand.MinRespawn = TimeSpan.FromMinutes(10.0);
            sand.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Mining skill
            sand.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            sand.Tiles = m_SandTiles;

            // Players must be within 2 tiles to harvest
            sand.MaxRange = 2;

            // One sand per harvest action
            sand.ConsumedPerHarvest        = 1;
            sand.ConsumedPerFeluccaHarvest = 1;

            // The digging effect
            sand.EffectActions    = new int[] { 11 };
            sand.EffectSounds     = new int[] { 0x125, 0x126 };
            sand.EffectCounts     = new int[] { 6 };
            sand.EffectDelay      = TimeSpan.FromSeconds(1.6);
            sand.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            sand.NoResourcesMessage     = 1044629; // There is no sand here to mine.
            sand.DoubleHarvestMessage   = 1044629; // There is no sand here to mine.
            sand.TimedOutOfRangeMessage = 503041;  // You have moved too far away to continue mining.
            sand.OutOfRangeMessage      = 500446;  // That is too far away.
            sand.FailMessage            = 1044630; // You dig for a while but fail to find any of sufficient quality for glassblowing.
            sand.PackFullMessage        = 1044632; // Your backpack can't hold the sand, and it is lost!
            sand.ToolBrokeMessage       = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
            {
                new HarvestResource(100.0, 70.0, 400.0, 1044631, typeof(Sand))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(100.0, 0.0, res[0], null)
            };

            sand.Resources = res;
            sand.Veins     = veins;

            this.Definitions.Add(sand);
            #endregion
        }
Beispiel #25
0
		public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
		{
			if ( tool is GargoylesPickaxe && def == m_OreAndStone && 0.1 > Utility.RandomDouble() )
			{
				HarvestResource res = vein.PrimaryResource;

				if ( res == resource && res.Types.Length >= 3 )
				{
					try
					{
						Map map = from.Map;

						if ( map == null )
							return;

						BaseCreature spawned = Activator.CreateInstance( res.Types[2], new object[]{ 25 } ) as BaseCreature;

						if ( spawned != null )
						{
							int offset = Utility.Random( 8 ) * 2;

							for ( int i = 0; i < m_Offsets.Length; i += 2 )
							{
								int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
								int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

								if ( map.CanSpawnMobile( x, y, from.Z ) )
								{
									spawned.MoveToWorld( new Point3D( x, y, from.Z ), map );
									spawned.Combatant = from;
									return;
								}
								else
								{
									int z = map.GetAverageZ( x, y );

									if ( map.CanSpawnMobile( x, y, z ) )
									{
										spawned.MoveToWorld( new Point3D( x, y, z ), map );
										spawned.Combatant = from;
										return;
									}
								}
							}

							spawned.MoveToWorld( from.Location, from.Map );
							spawned.Combatant = from;
						}
					}
					catch
					{
					}
				}
			}
		}
Beispiel #26
0
        private Fishing()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            #region Fishing
            HarvestDefinition fish = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            fish.BankWidth  = 8;
            fish.BankHeight = 8;

            // Every bank holds from 5 to 15 fish
            fish.MinTotal = 5;
            fish.MaxTotal = 15;

            // A resource bank will respawn its content every 10 to 20 minutes
            fish.MinRespawn = TimeSpan.FromMinutes(10.0);
            fish.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Fishing skill
            fish.Skill = SkillName.Fishing;

            // Set the list of harvestable tiles
            fish.Tiles       = m_WaterTiles;
            fish.RangedTiles = true;

            // Players must be within 4 tiles to harvest
            fish.MaxRange = 4;

            // One fish per harvest action
            fish.ConsumedPerHarvest        = 1;
            fish.ConsumedPerFeluccaHarvest = 1;

            // The fishing
            fish.EffectActions    = new int[] { 12 };
            fish.EffectSounds     = new int[0];
            fish.EffectCounts     = new int[] { 1 };
            fish.EffectDelay      = TimeSpan.Zero;
            fish.EffectSoundDelay = TimeSpan.FromSeconds(8.0);

            fish.NoResourcesMessage     = 503172; // The fish don't seem to be biting here.
            fish.FailMessage            = 503171; // You fish a while, but fail to catch anything.
            fish.TimedOutOfRangeMessage = 500976; // You need to be closer to the water to fish!
            fish.OutOfRangeMessage      = 500976; // You need to be closer to the water to fish!
            fish.PackFullMessage        = 503176; // You do not have room in your backpack for a fish.
            fish.ToolBrokeMessage       = 503174; // You broke your fishing pole.

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 100.0, 1043297, typeof(Fish))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(100.0, 0.0, res[0], null)
            };

            fish.Resources = res;
            fish.Veins     = veins;

            if (Core.ML)
            {
                fish.BonusResources = new BonusHarvestResource[]
                {
                    new BonusHarvestResource(0, 99.4, null, null),                       //set to same chance as mining ml gems
                    new BonusHarvestResource(80.0, .6, 1072597, typeof(WhitePearl))
                };
            }

            m_Definition = fish;
            Definitions.Add(fish);
            #endregion
        }
Beispiel #27
0
		public virtual HarvestVein MutateVein( Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein )
		{
			return vein;
		}
Beispiel #28
0
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            base.OnHarvestFinished(from, tool, def, vein, bank, resource, harvested);

            if (Core.ML)
            {
                from.RevealingAction();
            }
        }
		private NecroReagentGathering()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

			#region NecroReagentGathering
			HarvestDefinition reagent = new HarvestDefinition();

			// Resource banks are every 4x3 tiles
			reagent.BankWidth = 2;
			reagent.BankHeight = 2;

			// Every bank holds from 20 to 45 logs
			reagent.MinTotal = 0;
			reagent.MaxTotal = 4;

			// A resource bank will respawn its content every 20 to 30 minutes
			reagent.MinRespawn = TimeSpan.FromMinutes( 20.0 );
			reagent.MaxRespawn = TimeSpan.FromMinutes( 40.0 );

			// Skill checking is done on the Magery skill
			reagent.Skill = SkillName.Necromancy;

			// Set the list of harvestable tiles
			reagent.Tiles = m_TreeTiles;

			// Players must be within 2 tiles to harvest
			reagent.MaxRange = 3;

			// Ten logs per harvest action
			reagent.ConsumedPerHarvest = 1;
			reagent.ConsumedPerFeluccaHarvest = 1;

			// The chopping effect
			reagent.EffectActions = new int[]{ 13 };
			reagent.EffectSounds = new int[]{ 0x13E };
			reagent.EffectCounts = new int[]{ 1, 2 };
			reagent.EffectDelay = TimeSpan.FromSeconds( 1.3 );
			reagent.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

			reagent.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
			reagent.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
			reagent.OutOfRangeMessage = 500446; // That is too far away.
			reagent.PackFullMessage = 500497; // You can't place any wood into your backpack!
			reagent.ToolBrokeMessage = 500499; // You broke your axe.

			res = new HarvestResource[]
				{
                    // NUMBERS BELOW ARE...
                    // 1st Required Skill Needed
                    // 2nd Min Skill Needed
                    // 3rd Max Skill Needed
                    // 4th Success Message CLI No

				new HarvestResource( 000.0, 000.0, 010.0, "You put some Kindling in your backpack",		typeof( Kindling ) ),
				new HarvestResource( 50.0, 50.0, 50.0, "You put some Grave Dust in your backpack",		typeof( GraveDust ) ),
				new HarvestResource( 50.0, 50.0, 50.0, "You put some Daemon Blood in your backpack",		typeof( DaemonBlood ) ),
				new HarvestResource( 50.0, 50.0, 50.0, "You put some Nox Crystal in your backpack",		typeof( NoxCrystal  ) ),
				new HarvestResource( 50.0, 50.0, 50.0, "You put some Pig Iron Root in your backpack",		typeof( PigIron ) ),
				new HarvestResource( 50.0, 50.0, 50.0, "You put some Bat Wing  in your backpack",		typeof( BatWing ) ),
				new HarvestResource( 50.0, 50.0, 50.0, "You put some Grave Dust in your backpack",		typeof( GraveDust ) ),
				new HarvestResource( 50.0, 50.0, 50.0, "You put some Daemon Blood in your backpack",		typeof( DaemonBlood ) ),
				new HarvestResource( 50.0, 50.0, 50.0, "You put some Nox Crystal in your backpack",		typeof( NoxCrystal ) ),
				new HarvestResource( 50.0, 50.0, 50.0, "You put some Pig Iron in your backpack",		typeof( PigIron ) )
				};

			veins = new HarvestVein[]
				{
                    // NUMBERS BELOW ARE...
                    // 1ST Vein Chance
                    // 2ND Chance To Fallback
                    // 3RD Primary Resource
                    // 4TH Fallback Resource
				new HarvestVein( 10.0, 0.0, res[0], null ), 	// Kindling
				new HarvestVein( 10.0, 0.2, res[1], res[0] ), 	// GraveDust
				new HarvestVein( 10.0, 0.2, res[2], res[0] ), 	// DaemonBlood
				new HarvestVein( 10.0, 0.2, res[3], res[0] ), 	// NoxCrystal
				new HarvestVein( 10.0, 0.2, res[4], res[0] ), 	// MandrakeRoot
				new HarvestVein( 10.0, 0.2, res[5], res[0] ), 	// PigIron
				new HarvestVein( 10.0, 0.2, res[6], res[0] ), 	// BatWing 
				new HarvestVein( 10.0, 0.2, res[7], res[0] ), 	// DaemonBlood
				new HarvestVein( 10.0, 0.2, res[8], res[0] ), 	// NoxCrystal
				new HarvestVein( 10.0, 0.2, res[9], res[0] )	// PigIron 
			};

			reagent.Resources = res;
			reagent.Veins = veins;

			m_Definition = reagent;
			Definitions.Add( reagent );
			#endregion
		}
Beispiel #30
0
        private Lumberjacking()
        {
            var res = ZhConfig.Resources.Logs.Entries.Where(e => e.HarvestSkillRequired > 0.0).Select(e =>
                                                                                                      new HarvestResource(e.HarvestSkillRequired, $"{e.Name}(s)", e.ResourceType)).ToArray();
            var veins = ZhConfig.Resources.Logs.Entries.Where(e => e.VeinChance > 0.0).Select((e, i) =>
                                                                                              new HarvestVein(e.VeinChance, res[i])).OrderBy(v => v.VeinChance).ToArray();
            var defaultLog  = ZhConfig.Resources.Logs.Entries[0];
            var defaultVein = new HarvestVein(defaultLog.VeinChance, new HarvestResource(
                                                  defaultLog.HarvestSkillRequired,
                                                  defaultLog.Name, defaultLog.ResourceType));

            #region Lumberjacking

            HarvestDefinition lumber = new HarvestDefinition
            {
                // Resource banks are every 1x1 tiles
                BankWidth  = ZhConfig.Resources.Logs.BankWidth,
                BankHeight = ZhConfig.Resources.Logs.BankHeight,

                // Every bank holds from 45 to 90 ore
                MinTotal = ZhConfig.Resources.Logs.MinTotal,
                MaxTotal = ZhConfig.Resources.Logs.MaxTotal,

                // A resource bank will respawn its content every 10 to 20 minutes
                MinRespawn = TimeSpan.FromMinutes(ZhConfig.Resources.Logs.MinRespawn),
                MaxRespawn = TimeSpan.FromMinutes(ZhConfig.Resources.Logs.MaxRespawn),

                // Skill checking is done on the Mining skill
                Skill = ZhConfig.Resources.Logs.Skill,

                // Set the list of harvestable tiles
                Tiles = m_TreeTiles,

                // Players must be within 2 tiles to harvest
                MaxRange = ZhConfig.Resources.Logs.MaxRange,

                // Ten logs per harvest action
                ConsumedPerHarvest = skillValue => (int)(skillValue / 15) + 1,

                // Maximum chance to roll for colored veins
                MaxChance = ZhConfig.Resources.Logs.MaxChance,

                // The chopping effect
                EffectActions    = ZhConfig.Resources.Logs.LogEffect.Actions,
                EffectSounds     = ZhConfig.Resources.Logs.LogEffect.Sounds,
                EffectCounts     = ZhConfig.Resources.Logs.LogEffect.Counts,
                EffectDelay      = TimeSpan.FromSeconds(ZhConfig.Resources.Logs.LogEffect.Delay),
                EffectSoundDelay = TimeSpan.FromSeconds(ZhConfig.Resources.Logs.LogEffect.SoundDelay),

                NoResourcesMessage = 500493, // There's not enough wood here to harvest.
                FailMessage        = 500495, // You hack at the tree for a while, but fail to produce any useable wood.
                OutOfRangeMessage  = 500446, // That is too far away.
                PackFullMessage    = 500497, // You can't place any wood into your backpack!
                ToolBrokeMessage   = 500499, // You broke your axe.

                Resources = res,
                Veins     = veins,

                DefaultVein = defaultVein,

                BonusEffect = HarvestBonusEffect
            };

            Definition = lumber;
            Definitions.Add(lumber);

            #endregion
        }
Beispiel #31
0
		private Fishing()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

			#region Fishing
			HarvestDefinition fish = new HarvestDefinition();

			// Resource banks are every 8x8 tiles
			fish.BankWidth = 8;
			fish.BankHeight = 8;

			// Every bank holds from 5 to 15 fish
			fish.MinTotal = 5;
			fish.MaxTotal = 15;

			// A resource bank will respawn its content every 10 to 20 minutes
			fish.MinRespawn = TimeSpan.FromMinutes( 10.0 );
			fish.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

			// Skill checking is done on the Fishing skill
			fish.Skill = SkillName.Fishing;

			// Set the list of harvestable tiles
			fish.Tiles = m_WaterTiles;
			fish.RangedTiles = true;

			// Players must be within 4 tiles to harvest
			fish.MaxRange = 4;

			// One fish per harvest action
			fish.ConsumedPerHarvest = 1;
			fish.ConsumedPerFeluccaHarvest = 1;

			// The fishing
			fish.EffectActions = new int[] { 12 };
			fish.EffectSounds = new int[0];
			fish.EffectCounts = new int[] { 1 };
			fish.EffectDelay = TimeSpan.Zero;
			fish.EffectSoundDelay = TimeSpan.FromSeconds( 8.0 );

			fish.NoResourcesMessage = 503172; // The fish don't seem to be biting here.
			fish.FailMessage = 503171; // You fish a while, but fail to catch anything.
			fish.TimedOutOfRangeMessage = 500976; // You need to be closer to the water to fish!
			fish.OutOfRangeMessage = 500976; // You need to be closer to the water to fish!
			fish.PackFullMessage = 503176; // You do not have room in your backpack for a fish.
			fish.ToolBrokeMessage = 503174; // You broke your fishing pole.

			res = new HarvestResource[]
				{
					new HarvestResource( 00.0, 00.0, 100.0, 1043297, typeof( Fish ) )
				};

			veins = new HarvestVein[]
				{
					new HarvestVein( 100.0, 0.0, res[0], null )
				};

			fish.Resources = res;
			fish.Veins = veins;

			fish.BonusResources = new BonusHarvestResource[]
				{
					new BonusHarvestResource( 20.0, 45.0, "You pull up a large, black oyster!", typeof( PearlOyster ) ),
					new BonusHarvestResource( 40.0, 10.0, "You pull up a bone shard!", typeof( BoneShards ) ),
					new BonusHarvestResource( 40.0, 10.0, "You pull up a rib cage!", typeof( RibCage ) ),
					new BonusHarvestResource( 65.0, 5.0, "You pull up a piece of silverware!", typeof( Fork ) ),
					new BonusHarvestResource( 65.0, 5.0, "You pull up a piece of silverware!", typeof( Spoon ) ),
					new BonusHarvestResource( 90.0, 5.0, "You pull up a bale of wire!", typeof( IronWire ) ),
					new BonusHarvestResource( 90.0, 5.0, "You pull up a bale of wire!", typeof( CopperWire ) ),
					new BonusHarvestResource( 95.0, 2.0, "You pull up a bale of wire!", typeof( GoldWire ) ),
					new BonusHarvestResource( 100.0, 0.10, "You pull up an oddly shaped key!", typeof( Server.Items.SkullKey ) ),
				};

			m_Definition = fish;
			Definitions.Add( fish );
			#endregion
		}
Beispiel #32
0
        private GemMining()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            HarvestDefinition Gems = m_Gems = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            Gems.BankWidth  = 8;
            Gems.BankHeight = 8;

            // Every bank holds from 10 to 34 ore
            Gems.MinTotal = 2;
            Gems.MaxTotal = 5;

            // A resource bank will respawn its content every 10 to 20 minutes
            Gems.MinRespawn = TimeSpan.FromMinutes(15.0);
            Gems.MaxRespawn = TimeSpan.FromMinutes(30.0);

            // Skill checking is done on the Mining skill
            Gems.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            Gems.Tiles = m_CrystalTiles;

            // Players must be within 2 tiles to harvest
            Gems.MaxRange = 2;

            // One ore per harvest action
            Gems.ConsumedPerHarvest        = 1;
            Gems.ConsumedPerFeluccaHarvest = 2;

            // The digging effect
            Gems.EffectActions    = new int[] { 11 };
            Gems.EffectSounds     = new int[] { 0x125, 0x126 };
            Gems.EffectCounts     = new int[] { 1 };
            Gems.EffectDelay      = TimeSpan.FromSeconds(1.6);
            Gems.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            Gems.NoResourcesMessage     = "There are no Crystals here to mine.";                            // There is no gems here to mine.
            Gems.DoubleHarvestMessage   = "Someone mined to the Crystals before you.";                      // Someone has gotten to the gems before you.
            Gems.TimedOutOfRangeMessage = "You have moved too far away to continue Crystal Mining.";        // You have moved too far away to continue Gem Mining.
            Gems.OutOfRangeMessage      = "That Crystal is too far away.";                                  // That is too far away.
            Gems.FailMessage            = "You loosen some Crystals but fail to find any useable gems.";    // You loosen some rocks but fail to find any useable gems.
            Gems.PackFullMessage        = "Your backpack is full, so the gems you Crystal Mined are lost."; // Your backpack is full, so the gems you mined is lost.
            Gems.ToolBrokeMessage       = "You have worn out your Crystal Mining tool!";                    // You have worn out your tool!

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 100.0, "You pick at the Crystal and find a Amber gem, and you put it into your backpack.", typeof(Amber)),
                new HarvestResource(65.0, 25.0, 105.0, "You pick at the Crystal and find a Amethyst gem, and you put it into your backpack.", typeof(Amethyst)),
                new HarvestResource(70.0, 30.0, 110.0, "You pick at the Crystal and find a Citrine gem, and you put it into your backpack.", typeof(Citrine)),
                new HarvestResource(75.0, 35.0, 115.0, "You pick at the Crystal and find a Diamond gem, and you put it into your backpack.", typeof(Diamond)),
                new HarvestResource(80.0, 40.0, 120.0, "You pick at the Crystal and find a Emerald gem, and you put it into your backpack.", typeof(Emerald)),
                new HarvestResource(85.0, 45.0, 125.0, "You pick at the Crystal and find a Ruby gem, and you put it into your backpack.", typeof(Ruby)),
                new HarvestResource(90.0, 50.0, 130.0, "You pick at the Crystal and find a Sapphire gem, and you put it into your backpack.", typeof(Sapphire)),
                new HarvestResource(95.0, 55.0, 135.0, "You pick at the Crystal and find a Star Sapphire gem, and you put it into your backpack.", typeof(StarSapphire)),
                new HarvestResource(99.0, 59.0, 139.0, "You pick at the Crystal and find a Tourmaline gem, and you put it into your backpack.", typeof(Tourmaline))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(49.6, 0.0, res[0], null),                             // Amber
                new HarvestVein(11.2, 0.5, res[1], res[0]),                           // Amethyst
                new HarvestVein(09.8, 0.5, res[2], res[0]),                           // Citrine
                new HarvestVein(08.4, 0.5, res[3], res[0]),                           // Diamond
                new HarvestVein(07.0, 0.5, res[4], res[0]),                           // Emerald
                new HarvestVein(05.6, 0.5, res[5], res[0]),                           // Ruby
                new HarvestVein(04.2, 0.5, res[6], res[0]),                           // Sapphire
                new HarvestVein(02.8, 0.5, res[7], res[0]),                           // StarSapphire
                new HarvestVein(01.4, 0.5, res[8], res[0])                            // Tourmaline
            };

            Gems.Resources = res;
            Gems.Veins     = veins;

            if (Core.ML)
            {
                Gems.BonusResources = new BonusHarvestResource[]
                {
                    new BonusHarvestResource(0, 65.0, null, null),                              //Nothing
                    new BonusHarvestResource(100, 5.0, "You pick at the Crystal and a rare Chipped Amethyst falls from a fragment, and you put it into your backpack", typeof(ChippedAmethyst)),
                    new BonusHarvestResource(100, 5.0, "You pick at the Crystal and a rare Chipped Diamond falls from a fragment, and you put it into your backpack.", typeof(ChippedDiamond)),
                    new BonusHarvestResource(100, 5.0, "You pick at the Crystal and a rare Chipped Emerald falls from a fragment, and you put it into your backpack.", typeof(ChippedEmerald)),
                    new BonusHarvestResource(100, 5.0, "You pick at the Crystal and a rare Chipped Ruby falls from a fragment, and you put it into your backpack.", typeof(ChippedRuby)),
                    new BonusHarvestResource(100, 5.0, "You pick at the Crystal and a rare Chipped Sapphire falls from a fragment, and you put it into your backpack.", typeof(ChippedSapphire)),
                    new BonusHarvestResource(100, 5.0, "You pick at the Crystal and a rare Chipped Topaz falls from a fragment, and you put it into your backpack.", typeof(ChippedTopaz)),
                    new BonusHarvestResource(100, 5.0, "You pick at the Crystal and a rare Chipped Skull falls from a fragment, and you put it into your backpack.", typeof(ChippedSkull))
                };
            }

            //oreAndStone.RaceBonus = Core.ML;
            //oreAndStone.RandomizeVeins = Core.ML;

            Definitions.Add(Gems);
        }
Beispiel #33
0
        private Mining()
        {
            HarvestResource[] res;
            HarvestVein[] veins;

            #region Mining for ore and stone
            HarvestDefinition oreAndStone = m_OreAndStone = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            oreAndStone.BankWidth = 4;
            oreAndStone.BankHeight = 4;

            // Every bank holds from 10 to 34 ore
            oreAndStone.MinTotal = 8;
            oreAndStone.MaxTotal = 25;

            // A resource bank will respawn its content every 10 to 20 minutes
            oreAndStone.MinRespawn = TimeSpan.FromMinutes( 10.0 );
            oreAndStone.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

            // Skill checking is done on the Mining skill
            oreAndStone.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            oreAndStone.Tiles = m_MountainAndCaveTiles;

            // Players must be within 2 tiles to harvest
            oreAndStone.MaxRange = 2;

            // One ore per harvest action
            oreAndStone.ConsumedPerHarvest = 1;
            oreAndStone.ConsumedPerFeluccaHarvest = 1;

            // The digging effect
            oreAndStone.EffectActions = new int[]{ 11 };
            oreAndStone.EffectSounds = new int[]{ 0x125, 0x126 };
            oreAndStone.EffectCounts = new int[]{ 1 };
            oreAndStone.EffectDelay = TimeSpan.FromSeconds( 1.6 );
            oreAndStone.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

            oreAndStone.NoResourcesMessage = 503040; // There is no metal here to mine.
            oreAndStone.DoubleHarvestMessage = 503042; // Someone has gotten to the metal before you.
            oreAndStone.TimedOutOfRangeMessage = 503041; // You have moved too far away to continue mining.
            oreAndStone.OutOfRangeMessage = 500446; // That is too far away.
            oreAndStone.FailMessage = 503043; // You loosen some rocks but fail to find any useable ore.
            oreAndStone.PackFullMessage = 1010481; // Your backpack is full, so the ore you mined is lost.
            oreAndStone.ToolBrokeMessage = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
                {
                    new HarvestResource( 00.0, 00.0, 50.0, 1007075, typeof( CopperOre ),		typeof( Coal ),				typeof( Bat ) ),
                    new HarvestResource( 00.0, 00.0, 50.0, 1007073, typeof( TinOre ),			typeof( Granite ),			typeof( Bat ) ),
                    new HarvestResource( 60.0, 40.0, 100.0, 1007072, typeof( IronOre ),			typeof( Granite ),			typeof( Bat ) ),
                    new HarvestResource( 85.0, 50.0, 100.0, 1007078, typeof( SilverOre ),		typeof( Granite ),			typeof( Bat ) ),
                    new HarvestResource( 95.0, 55.0, 100.0, 1007077, typeof( GoldOre ),			typeof( Granite ),			typeof( Bat ) ),

                };

            veins = new HarvestVein[]
                {
                    new HarvestVein( 45.0, 0.5, res[0], res[0] ),  // Copper
                    new HarvestVein( 30.0, 0.5, res[1], res[0] ),  // Tin
                    new HarvestVein( 24.0, 0.5, res[2], res[0] ),  // Iron
                    new HarvestVein( 0.9, 0.5, res[3], res[0] ),   // Silver
                    new HarvestVein( 0.1, 0.5, res[4], res[0] ),   // Gold
                };

            oreAndStone.Resources = res;
            oreAndStone.Veins = veins;

            Definitions.Add( oreAndStone );
            #endregion

            #region Mining for sand
            HarvestDefinition sand = m_Sand = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            sand.BankWidth = 2;
            sand.BankHeight = 2;

            // Every bank holds from 6 to 12 sand
            sand.MinTotal = 10;
            sand.MaxTotal = 18;

            // A resource bank will respawn its content every 10 to 20 minutes
            sand.MinRespawn = TimeSpan.FromMinutes( 10.0 );
            sand.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

            // Skill checking is done on the Mining skill
            sand.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            sand.Tiles = m_SandTiles;

            // Players must be within 2 tiles to harvest
            sand.MaxRange = 2;

            // One sand per harvest action
            sand.ConsumedPerHarvest = 1;
            sand.ConsumedPerFeluccaHarvest = 1;

            // The digging effect
            sand.EffectActions = new int[]{ 11 };
            sand.EffectSounds = new int[]{ 0x125, 0x126 };
            sand.EffectCounts = new int[]{ 1 };
            sand.EffectDelay = TimeSpan.FromSeconds( 1.6 );
            sand.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

            sand.NoResourcesMessage = 1044629; // There is no sand here to mine.
            sand.DoubleHarvestMessage = 1044629; // There is no sand here to mine.
            sand.TimedOutOfRangeMessage = 503041; // You have moved too far away to continue mining.
            sand.OutOfRangeMessage = 500446; // That is too far away.
            sand.FailMessage = 1044630; // You dig for a while but fail to find any of sufficient quality for glassblowing.
            sand.PackFullMessage = 1044632; // Your backpack can't hold the sand, and it is lost!
            sand.ToolBrokeMessage = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
                {
                    new HarvestResource( 0.0, 0.0, 50.0, 1044631, typeof( Sand ) )
                };

            veins = new HarvestVein[]
                {
                    new HarvestVein( 0.0, 0.0, res[0], null )
                };

            sand.Resources = res;
            sand.Veins = veins;

            Definitions.Add( sand );
            #endregion
        }
		private ExoticFishing()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

			#region ExoticFishing
			HarvestDefinition fish = new HarvestDefinition();

			// Resource banks are every 8x8 tiles
			fish.BankWidth = 1;
			fish.BankHeight = 1;

			// Every bank holds from 1 to 2 fish
			fish.MinTotal = 1;
			fish.MaxTotal = 2;

			// A resource bank will respawn its content every 10 to 20 minutes
			fish.MinRespawn = TimeSpan.FromMinutes( 10.0 );
			fish.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

			// Skill checking is done on the Fishing skill
			fish.Skill = SkillName.Fishing;

			// Set the list of harvestable tiles
			fish.Tiles = m_WaterTiles;
			fish.RangedTiles = true;

			// Players must be within 6 tiles to harvest
			fish.MaxRange = 6;

			// One fish per harvest action
			fish.ConsumedPerHarvest = 1;
			fish.ConsumedPerFeluccaHarvest = 1;

			// The ExoticFishing
			fish.EffectActions = new int[]{ 12 };
			fish.EffectSounds = new int[0];
			fish.EffectCounts = new int[]{ 1 };
			fish.EffectDelay = TimeSpan.Zero;
			fish.EffectSoundDelay = TimeSpan.FromSeconds( 4.0 );

			fish.NoResourcesMessage = 503172; // The fish don't seem to be biting here.
			fish.FailMessage = 503171; // You fish a while, but fail to catch anything.
			fish.TimedOutOfRangeMessage = 500976; // You need to be closer to the water to fish!
			fish.OutOfRangeMessage = 500976; // You need to be closer to the water to fish!
			fish.PackFullMessage = 503176; // You do not have room in your backpack for a fish.
			fish.ToolBrokeMessage = 503174; // You broke your ExoticFishing pole.

			res = new HarvestResource[]
				{
					new HarvestResource( 00.0, 00.0, 100.0, 1043297, typeof( Fish ) ),
                    new HarvestResource(90.0, 10.1, 101.0, "You pull up a butterfly fish!", typeof( Butterflyfish ) ),
                    new HarvestResource(80.0, 20.1, 101.0, "You pull up a baroness butterfly fish!", typeof( BaronessButterflyfish ) ),
                    new HarvestResource(70.0, 80.1, 101.0, "You pull up a copperbanded butterfly fish!", typeof( CopperbandedButterflyfish ) ),
                    new HarvestResource(100.0, 80.1, 101.0, "You pull up an albino angel fish!", typeof( AlbinoAngelfish ) ),
                    new HarvestResource(100.0, 90.0, 101.0, "You pull up an angel fish!", typeof( Angelfish ) )
				};

			veins = new HarvestVein[]
				{
					new HarvestVein( 20.0, 0.0, res[0], null ),
                    new HarvestVein( 20.0, 0.0, res[1], null ), //butterfly 
                    new HarvestVein( 20.0, 0.0, res[2], null ), //baroness
                    new HarvestVein( 20.0, 0.0, res[3], null ), //copper
                    new HarvestVein( 10.0, 0.0, res[4], null ), //albino
                    new HarvestVein( 10.0, 0.0, res[5], null ) //angel
				};

			fish.Resources = res;
			fish.Veins = veins;

			m_Definition = fish;
			Definitions.Add( fish );
			#endregion
		}
		private Lumberjacking()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

			#region Lumberjacking
			HarvestDefinition lumber = new HarvestDefinition();

			// Resource banks are every 4x3 tiles
			lumber.BankWidth = 4;
			lumber.BankHeight = 3;

			// Every bank holds from 20 to 45 logs
			lumber.MinTotal = 20;
			lumber.MaxTotal = 45;

			// A resource bank will respawn its content every 20 to 30 minutes
			lumber.MinRespawn = TimeSpan.FromMinutes( 20.0 );
			lumber.MaxRespawn = TimeSpan.FromMinutes( 30.0 );

			// Skill checking is done on the Lumberjacking skill
			lumber.Skill = SkillName.Lumberjacking;

			// Set the list of harvestable tiles
			lumber.Tiles = m_TreeTiles;

			// Players must be within 2 tiles to harvest
			lumber.MaxRange = 2;

			// Ten logs per harvest action
			lumber.ConsumedPerHarvest = 10;
			lumber.ConsumedPerFeluccaHarvest = 20;

			// The chopping effect
			lumber.EffectActions = new int[]{ 13 };
			lumber.EffectSounds = new int[]{ 0x13E };
			lumber.EffectCounts = new int[]{ 1, 2, 2, 2, 3 };
			lumber.EffectDelay = TimeSpan.FromSeconds( 1.6 );
			lumber.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

			lumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
			lumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
			lumber.OutOfRangeMessage = 500446; // That is too far away.
			lumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
			lumber.ToolBrokeMessage = 500499; // You broke your axe.

			res = new HarvestResource[]
				{
					new HarvestResource( 00.0, 00.0, 100.0, 500498, typeof( Log ) )
				};

			veins = new HarvestVein[]
				{
					new HarvestVein( 100.0, 0.0, res[0], null )
				};

			lumber.Resources = res;
			lumber.Veins = veins;

			m_Definition = lumber;
			Definitions.Add( lumber );
			#endregion
		}
Beispiel #36
0
        private TreasureHunting()
        {
            HarvestResource[] res;
            HarvestVein[] veins;

            #region TreasureHunting for treasures and trinkets
            HarvestDefinition treasuresAndTrinkets = m_treasuresAndTrinkets = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            treasuresAndTrinkets.BankWidth = 8;
            treasuresAndTrinkets.BankHeight = 8;

            // Every bank holds from 10 to 34 ore
            treasuresAndTrinkets.MinTotal = 0;
            treasuresAndTrinkets.MaxTotal = 2;

            // A resource bank will respawn its content every 1 hour
            treasuresAndTrinkets.MinRespawn = TimeSpan.FromHours( 1.0 );
            treasuresAndTrinkets.MaxRespawn = TimeSpan.FromHours( 1.0 );

            // Skill checking is done on the Mining skill
            treasuresAndTrinkets.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            treasuresAndTrinkets.Tiles = m_grassAndDirtTiles;

            // Players must be within 2 tiles to harvest
            treasuresAndTrinkets.MaxRange = 2;

            // One ore per harvest action
            treasuresAndTrinkets.ConsumedPerHarvest = 1;
            treasuresAndTrinkets.ConsumedPerFeluccaHarvest = 1;

            // The digging effect
            treasuresAndTrinkets.EffectActions = new int[]{ 11 };
            treasuresAndTrinkets.EffectSounds = new int[]{ 0x125, 0x126 };
            treasuresAndTrinkets.EffectCounts = new int[]{ 1 };
            treasuresAndTrinkets.EffectDelay = TimeSpan.FromSeconds( 1.6 );
            treasuresAndTrinkets.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

            treasuresAndTrinkets.NoResourcesMessage = "You have already dug enough in this area.";
            treasuresAndTrinkets.DoubleHarvestMessage = "Someone has beaten you to the loot.";
            treasuresAndTrinkets.TimedOutOfRangeMessage = "You have moved too far away to continue digging.";
            treasuresAndTrinkets.OutOfRangeMessage = 500446; // That is too far away.
            treasuresAndTrinkets.FailMessage = "You dig into the ground, but find nothing interesting.";
            treasuresAndTrinkets.PackFullMessage = "Your pack is full, so you leave the finds behind.";
            treasuresAndTrinkets.ToolBrokeMessage = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
                {
                    // Required skill, min skill, max skill, message, type(s)
                    new HarvestResource( 00.0, 00.0, 00.0, "You didn't find anything useful.", typeof( FertileDirt ) ),
                    new HarvestResource( 00.0, 00.0, 00.0, "You found a seed.", typeof( Seed ) )
                };

            veins = new HarvestVein[]
                {
                    // Chance, fallback chance, type, fallback type
                    new HarvestVein( 90.0, 00.0, res[0], null ),
                    new HarvestVein( 10.0, 00.0, res[1], null ) // Seed
                };

            treasuresAndTrinkets.Resources = res;
            treasuresAndTrinkets.Veins = veins;

            treasuresAndTrinkets.BonusResources = new BonusHarvestResource[] { };

            treasuresAndTrinkets.RandomizeVeins = true;

            Definitions.Add( treasuresAndTrinkets );
            #endregion
        }
Beispiel #37
0
		public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
		{
			base.OnHarvestFinished( from, tool, def, vein, bank, resource, harvested );

			if( tool is YewAxe && def == m_Definition && 0.10 >= Utility.RandomDouble() )
			{
				HarvestResource res = vein.PrimaryResource;

				if( res == resource )
				{
					try
					{
						Map map = from.Map;

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

						BaseCreature spawned = Activator.CreateInstance( typeof( Reaper ) ) as BaseCreature;

						if( spawned != null )
						{
							int offset = Utility.Random( 4 ) * 2;

							for( int i = 0; i < m_Offsets.Length; i++ )
							{
								int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
								int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
								int z = (map.CanSpawnMobile( x, y, from.Z ) ? from.Z : map.GetAverageZ( x, y ));

								if( !map.CanSpawnMobile( x, y, z ) )
								{
									x = from.X;
									y = from.Y;
									z = from.Z;
								}

								if( map.CanSpawnMobile( x, y, z ) )
								{
									spawned.OnBeforeSpawn( new Point3D( x, y, z ), map );
									spawned.MoveToWorld( new Point3D( x, y, z ), map );
									spawned.Combatant = from;

									from.SendMessage( "You have awoken a spirit tree!" );
									break;
								}
							}
						}
					}
					catch { }
				}
			}
		}
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            base.OnHarvestFinished(from, tool, def, vein, bank, resource, harvested);

            if (Core.ML)
                from.RevealingAction();
        }
Beispiel #39
0
        public override HarvestVein MutateVein(Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein)
        {
            if (tool is GargoylesPickaxe && def == m_OreAndStone)
            {
                int veinIndex = Array.IndexOf(def.Veins, vein);

                if (veinIndex >= 0 && veinIndex < (def.Veins.Length - 1))
                {
                    return(def.Veins[veinIndex + 1]);
                }
            }

            return(base.MutateVein(from, tool, def, bank, toHarvest, vein));
        }
Beispiel #40
0
 public override HarvestVein MutateVein(Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein)
 {
     return(base.MutateVein(from, tool, def, bank, toHarvest, vein));
 }
Beispiel #41
0
        private Fishing()
        {
            HarvestResource[] res;
            HarvestVein[] veins;

            #region Fishing
            HarvestDefinition fish = new HarvestDefinition();

            fish.PlaceAtFeetIfFull = true;

            // Resource banks are every 8x8 tiles
            fish.BankWidth = 8;
            fish.BankHeight = 8;

            fish.MinTotal = 0;
            fish.MaxTotal = 10;

            fish.MinRespawn = TimeSpan.FromMinutes( 10.0 );
            fish.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

            // Skill checking is done on the Fishing skill
            fish.Skill = SkillName.Fishing;

            // Set the list of harvestable tiles
            fish.Tiles = m_WaterTiles;
            fish.RangedTiles = true;

            // Players must be within 4 tiles to harvest
            fish.MaxRange = 5;

            // One fish per harvest action
            fish.ConsumedPerHarvest = 1;
            fish.ConsumedPerFeluccaHarvest = 1;

            // The fishing
            fish.EffectActions = new int[]{ 12 };
            fish.EffectSounds = new int[0];
            fish.EffectCounts = new int[]{ 1 };
            fish.EffectDelay = TimeSpan.Zero;
            fish.EffectSoundDelay = TimeSpan.FromSeconds( 8.0 );

            fish.NoResourcesMessage = 503172; // The fish don't seem to be biting here.
            fish.FailMessage = 503171; // You fish a while, but fail to catch anything.
            fish.TimedOutOfRangeMessage = 500976; // You need to be closer to the water to fish!
            fish.OutOfRangeMessage = 500976; // You need to be closer to the water to fish!
            //fish.PackFullMessage = 503176; // You do not have room in your backpack for a fish.
            fish.ToolBrokeMessage = 503174; // You broke your fishing pole.

            res = new HarvestResource[]
                {
                    new HarvestResource( 00.0, 00.0, 100.0, 1043297, typeof( Fish ) )
                };

            veins = new HarvestVein[]
                {
                    new HarvestVein( 100.0, 0.0, res[0], null )
                };

            fish.Resources = res;
            fish.Veins = veins;

            m_Definition = fish;
            Definitions.Add( fish );
            #endregion
        }
Beispiel #42
0
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            if (tool is GargoylesPickaxe && def == m_OreAndStone && 0.1 > Utility.RandomDouble())
            {
                HarvestResource res = vein.PrimaryResource;

                if (res == resource && res.Types.Length >= 3)
                {
                    try
                    {
                        Map map = from.Map;

                        if (map == null)
                        {
                            return;
                        }

                        BaseCreature spawned = Activator.CreateInstance(res.Types[2], new object[] { 25 }) as BaseCreature;

                        if (spawned != null)
                        {
                            int offset = Utility.Random(8) * 2;

                            for (int i = 0; i < m_Offsets.Length; i += 2)
                            {
                                int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
                                int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

                                if (map.CanSpawnMobile(x, y, from.Z))
                                {
                                    spawned.MoveToWorld(new Point3D(x, y, from.Z), map);
                                    spawned.Combatant = from;
                                    return;
                                }
                                else
                                {
                                    int z = map.GetAverageZ(x, y);

                                    if (map.CanSpawnMobile(x, y, z))
                                    {
                                        spawned.MoveToWorld(new Point3D(x, y, z), map);
                                        spawned.Combatant = from;
                                        return;
                                    }
                                }
                            }

                            spawned.MoveToWorld(from.Location, from.Map);
                            spawned.Combatant = from;
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }
Beispiel #43
0
 public override HarvestVein MutateVein( Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein )
 {
     return base.MutateVein( from, tool, def, bank, toHarvest, vein );
 }
Beispiel #44
0
        private Mining()
        {
            HarvestResource[] res;
            HarvestVein[]     veins;

            #region Mining for ore and stone
            HarvestDefinition oreAndStone = m_OreAndStone = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            oreAndStone.BankWidth  = 8;
            oreAndStone.BankHeight = 8;

            // Every bank holds from 10 to 34 ore
            oreAndStone.MinTotal = 10;
            oreAndStone.MaxTotal = 34;

            // A resource bank will respawn its content every 10 to 20 minutes
            oreAndStone.MinRespawn = TimeSpan.FromMinutes(5.0);
            oreAndStone.MaxRespawn = TimeSpan.FromMinutes(10.0);

            // Skill checking is done on the Mining skill
            oreAndStone.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            oreAndStone.Tiles = m_MountainAndCaveTiles;

            // Players must be within 2 tiles to harvest
            oreAndStone.MaxRange = 2;

            // One ore per harvest action
            oreAndStone.ConsumedPerHarvest        = 1;
            oreAndStone.ConsumedPerFeluccaHarvest = 2;

            // The digging effect
            oreAndStone.EffectActions    = new int[] { 11 };
            oreAndStone.EffectSounds     = new int[] { 0x125, 0x126 };
            oreAndStone.EffectCounts     = new int[] { 1 };
            oreAndStone.EffectDelay      = TimeSpan.FromSeconds(1.6);
            oreAndStone.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            oreAndStone.NoResourcesMessage     = 503040;  // There is no metal here to mine.
            oreAndStone.DoubleHarvestMessage   = 503042;  // Someone has gotten to the metal before you.
            oreAndStone.TimedOutOfRangeMessage = 503041;  // You have moved too far away to continue mining.
            oreAndStone.OutOfRangeMessage      = 500446;  // That is too far away.
            oreAndStone.FailMessage            = 503043;  // You loosen some rocks but fail to find any useable ore.
            oreAndStone.PackFullMessage        = 1010481; // Your backpack is full, so the ore you mined is lost.
            oreAndStone.ToolBrokeMessage       = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 100.0, 1007072, typeof(IronOre), typeof(Granite)),
                new HarvestResource(40.0, 25.0, 105.0, 1007073, typeof(DullCopperOre), typeof(DullCopperGranite), typeof(DullCopperElemental)),
                new HarvestResource(45.0, 27.5, 107.5, 1007074, typeof(ShadowIronOre), typeof(ShadowIronGranite), typeof(ShadowIronElemental)),
                new HarvestResource(50.0, 30.0, 110.0, 1007075, typeof(CopperOre), typeof(CopperGranite), typeof(CopperElemental)),
                new HarvestResource(55.0, 32.5, 112.5, 1007076, typeof(BronzeOre), typeof(BronzeGranite), typeof(BronzeElemental)),
                new HarvestResource(60.0, 35.0, 115.0, 1007077, typeof(GoldOre), typeof(GoldGranite), typeof(GoldenElemental)),
                new HarvestResource(65.0, 37.5, 117.5, 1007078, typeof(AgapiteOre), typeof(AgapiteGranite), typeof(AgapiteElemental)),
                new HarvestResource(70.0, 40.0, 120.0, 1007079, typeof(VeriteOre), typeof(VeriteGranite), typeof(VeriteElemental)),
                new HarvestResource(75.0, 42.5, 122.5, 1007080, typeof(ValoriteOre), typeof(ValoriteGranite), typeof(ValoriteElemental)),
                new HarvestResource(80.0, 45.0, 125.0, "You dig some silver ore and put it in your backpack", typeof(SilverOre), typeof(SilverGranite), typeof(SilverElemental)),
                new HarvestResource(85.0, 47.5, 127.5, "You dig some platinum ore and put it in your backpack", typeof(PlatinumOre), typeof(PlatinumGranite), typeof(PlatinumElemental)),
                new HarvestResource(90.0, 50.0, 130.0, "You dig some mythril ore and put it in your backpack", typeof(MythrilOre), typeof(MythrilGranite), typeof(MythrilElemental)),
                new HarvestResource(95.0, 52.5, 132.5, "You dig some obsidian ore and put it in your backpack", typeof(ObsidianOre), typeof(ObsidianGranite), typeof(ObsidianElemental)),
                new HarvestResource(100.0, 55.0, 135.0, "You dig some jade ore and put it in your backpack", typeof(JadeOre), typeof(JadeGranite), typeof(JadeElemental)),
                new HarvestResource(105.0, 57.5, 137.5, "You dig some moonstone ore and put it in your backpack", typeof(MoonstoneOre), typeof(MoonstoneGranite), typeof(MoonstoneElemental)),
                new HarvestResource(110.0, 60.0, 140.0, "You dig some sunstone ore and put it in your backpack", typeof(SunstoneOre), typeof(SunstoneGranite), typeof(SunstoneElemental)),
                new HarvestResource(115.0, 62.5, 142.5, "You dig some bloodstone ore and put it in your backpack", typeof(BloodstoneOre), typeof(BloodstoneGranite), typeof(BloodstoneElemental))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(21.2, 0.0, res[0], null),                             // Iron
                new HarvestVein(10.2, 0.5, res[1], res[0]),                           // Dull Copper
                new HarvestVein(09.8, 0.5, res[2], res[0]),                           // Shadow Iron
                new HarvestVein(06.8, 0.5, res[3], res[0]),                           // Copper
                new HarvestVein(06.4, 0.5, res[4], res[0]),                           // Bronze
                new HarvestVein(06.0, 0.5, res[5], res[0]),                           // Gold
                new HarvestVein(05.6, 0.5, res[6], res[0]),                           // Agapite
                new HarvestVein(05.2, 0.5, res[7], res[0]),                           // Verite
                new HarvestVein(04.8, 0.5, res[8], res[0]),                           // Valorite
                new HarvestVein(04.4, 0.5, res[9], res[0]),                           // Silver
                new HarvestVein(04.0, 0.5, res[10], res[0]),                          // Platinum
                new HarvestVein(03.6, 0.5, res[11], res[0]),                          // Mythril
                new HarvestVein(03.2, 0.5, res[12], res[0]),                          // Obsidian
                new HarvestVein(02.8, 0.5, res[13], res[0]),                          // Jade
                new HarvestVein(02.4, 0.5, res[14], res[0]),                          // Moonstone
                new HarvestVein(02.0, 0.5, res[15], res[0]),                          // Sunstone
                new HarvestVein(01.6, 0.5, res[16], res[0])                           // Bloodstone
            };

            oreAndStone.Resources = res;
            oreAndStone.Veins     = veins;

            Definitions.Add(oreAndStone);
            #endregion

            #region Mining for sand
            HarvestDefinition sand = m_Sand = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            sand.BankWidth  = 8;
            sand.BankHeight = 8;

            // Every bank holds from 6 to 12 sand
            sand.MinTotal = 6;
            sand.MaxTotal = 12;

            // A resource bank will respawn its content every 10 to 20 minutes
            sand.MinRespawn = TimeSpan.FromMinutes(10.0);
            sand.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Mining skill
            sand.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            sand.Tiles = m_SandTiles;

            // Players must be within 2 tiles to harvest
            sand.MaxRange = 2;

            // One sand per harvest action
            sand.ConsumedPerHarvest        = 1;
            sand.ConsumedPerFeluccaHarvest = 1;

            // The digging effect
            sand.EffectActions    = new int[] { 11 };
            sand.EffectSounds     = new int[] { 0x125, 0x126 };
            sand.EffectCounts     = new int[] { 6 };
            sand.EffectDelay      = TimeSpan.FromSeconds(1.6);
            sand.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            sand.NoResourcesMessage     = 1044629;  // There is no sand here to mine.
            sand.DoubleHarvestMessage   = 1044629;  // There is no sand here to mine.
            sand.TimedOutOfRangeMessage = 503041;   // You have moved too far away to continue mining.
            sand.OutOfRangeMessage      = 500446;   // That is too far away.
            sand.FailMessage            = 1044630;  // You dig for a while but fail to find any of sufficient quality for glassblowing.
            sand.PackFullMessage        = 1044632;  // Your backpack can't hold the sand, and it is lost!
            sand.ToolBrokeMessage       = 1044038;  // You have worn out your tool!

            res = new HarvestResource[]
            {
                new HarvestResource(100.0, 70.0, 400.0, 1044631, typeof(Sand))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(100.0, 0.0, res[0], null)
            };

            sand.Resources = res;
            sand.Veins     = veins;

            Definitions.Add(sand);
            #endregion
        }
        private Fishing()
        {
            HarvestResource[] res;
            HarvestVein[] veins;

            #region Fishing
            HarvestDefinition fish = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            fish.BankWidth = 8;
            fish.BankHeight = 8;

            // Every bank holds from 5 to 15 fish
            fish.MinTotal = 5;
            fish.MaxTotal = 15;

            // A resource bank will respawn its content every 10 to 20 minutes
            fish.MinRespawn = TimeSpan.FromMinutes(10.0);
            fish.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Fishing skill
            fish.Skill = SkillName.Fishing;

            // Set the list of harvestable tiles
            fish.Tiles = m_WaterTiles;
            fish.RangedTiles = true;

            // Players must be within 4 tiles to harvest
            fish.MaxRange = 4;

            // One fish per harvest action
            fish.ConsumedPerHarvest = 1;
            fish.ConsumedPerFeluccaHarvest = 1;

            // The fishing
            fish.EffectActions = new int[] { 12 };
            fish.EffectSounds = new int[0];
            fish.EffectCounts = new int[] { 1 };
            fish.EffectDelay = TimeSpan.Zero;
            fish.EffectSoundDelay = TimeSpan.FromSeconds(8.0);

            fish.NoResourcesMessage = 503172; // The fish don't seem to be biting here.
            fish.FailMessage = 503171; // You fish a while, but fail to catch anything.
            fish.TimedOutOfRangeMessage = 500976; // You need to be closer to the water to fish!
            fish.OutOfRangeMessage = 500976; // You need to be closer to the water to fish!
            fish.PackFullMessage = 503176; // You do not have room in your backpack for a fish.
            fish.ToolBrokeMessage = 503174; // You broke your fishing pole.

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 100.0, 1043297, typeof(Fish))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(100.0, 0.0, res[0], null)
            };

            fish.Resources = res;
            fish.Veins = veins;

            if (Core.ML)
            {
                fish.BonusResources = new BonusHarvestResource[]
                {
                    new BonusHarvestResource(0, 99.4, null, null), //set to same chance as mining ml gems
                    new BonusHarvestResource(80.0, .6, 1072597, typeof(WhitePearl))
                };
            }

            this.m_Definition = fish;
            this.Definitions.Add(fish);
            #endregion
        }
Beispiel #46
0
        public virtual void FinishHarvesting(Mobile from, Item tool, HarvestDefinition def, object toHarvest, object locked)
        {
            from.EndAction(locked);

            if (!CheckHarvest(from, tool))
            {
                return;
            }

            int     tileID;
            Map     map;
            Point3D loc;

            if (!GetHarvestDetails(from, tool, toHarvest, out tileID, out map, out loc))
            {
                OnBadHarvestTarget(from, tool, toHarvest);
                return;
            }
            else if (!def.Validate(tileID))
            {
                OnBadHarvestTarget(from, tool, toHarvest);
                return;
            }

            if (!CheckRange(from, tool, def, map, loc, true))
            {
                return;
            }
            else if (!CheckResources(from, tool, def, map, loc, true))
            {
                return;
            }
            else if (!CheckHarvest(from, tool, def, toHarvest))
            {
                return;
            }

            if (SpecialHarvest(from, tool, def, map, loc))
            {
                return;
            }

            HarvestBank bank = def.GetBank(map, loc.X, loc.Y);

            if (bank == null)
            {
                return;
            }

            HarvestVein vein = bank.Vein;

            if (vein != null)
            {
                vein = MutateVein(from, tool, def, bank, toHarvest, vein);
            }

            if (vein == null)
            {
                return;
            }

            HarvestResource primary  = vein.PrimaryResource;
            HarvestResource fallback = vein.FallbackResource;
            HarvestResource resource = MutateResource(from, tool, def, map, loc, vein, primary, fallback);

            double skillBase  = from.Skills[def.Skill].Base;
            double skillValue = from.Skills[def.Skill].Value;

            Type type = null;

            if (skillBase >= resource.ReqSkill && from.CheckSkill(def.Skill, resource.MinSkill, resource.MaxSkill))
            {
                type = GetResourceType(from, tool, def, map, loc, resource);

                if (type != null)
                {
                    type = MutateType(type, from, tool, def, map, loc, resource);
                }

                if (type != null)
                {
                    Item item = Construct(type, from);

                    if (item == null)
                    {
                        type = null;
                    }
                    else
                    {
                        //The whole harvest system is kludgy and I'm sure this is just adding to it.
                        if (item.Stackable)
                        {
                            int  amount        = def.ConsumedPerHarvest;
                            int  feluccaAmount = def.ConsumedPerFeluccaHarvest;
                            bool inFelucca     = (map == Map.Felucca);

                            if (inFelucca && bank.Current >= feluccaAmount)
                            {
                                item.Amount = feluccaAmount;
                            }
                            else
                            {
                                item.Amount = amount;
                            }
                        }

                        bank.Consume(item.Amount, from);

                        if (Give(from, item, def.PlaceAtFeetIfFull))
                        {
                            SendSuccessTo(from, item, resource);
                        }
                        else
                        {
                            SendPackFullTo(from, item, def, resource);
                            item.Delete();
                        }

                        BonusHarvestResource bonus = def.GetBonusResource();

                        if (bonus != null && bonus.Type != null && skillBase >= bonus.ReqSkill)
                        {
                            Item bonusItem = Construct(bonus.Type, from);

                            if (Give(from, bonusItem, true))                                    //Bonuses always allow placing at feet, even if pack is full irregrdless of def
                            {
                                bonus.SendSuccessTo(from);
                            }
                            else
                            {
                                item.Delete();
                            }
                        }

                        if (tool is IUsesRemaining)
                        {
                            IUsesRemaining toolWithUses = (IUsesRemaining)tool;

                            toolWithUses.ShowUsesRemaining = true;

                            if (toolWithUses.UsesRemaining > 0)
                            {
                                --toolWithUses.UsesRemaining;
                            }

                            if (toolWithUses.UsesRemaining < 1)
                            {
                                tool.Delete();
                                def.SendMessageTo(from, def.ToolBrokeMessage);
                            }
                        }
                    }
                }
            }

            if (type == null)
            {
                def.SendMessageTo(from, def.FailMessage);
            }

            OnHarvestFinished(from, tool, def, vein, bank, resource, toHarvest);
        }
Beispiel #47
0
                public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
                {
                    HarvestResource res = vein.PrimaryResource;

                    if (res == resource && res.Types.Length >= 3)
                    {
                        try
                        {
                            Map map = from.Map;

                            if (map == null)
                                return;
                        }
                        catch
                        {
                        }
                    }
                }
Beispiel #48
0
 public virtual void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
 {
 }
Beispiel #49
0
		public override HarvestVein MutateVein( Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein )
		{
			if ( tool is GargoylesPickaxe && def == m_OreAndStone )
			{
				int veinIndex = Array.IndexOf( def.Veins, vein );

				if ( veinIndex >= 0 && veinIndex < (def.Veins.Length - 1) )
					return def.Veins[veinIndex + 1];
			}

			return base.MutateVein( from, tool, def, bank, toHarvest, vein );
		}
Beispiel #50
0
 public virtual HarvestVein MutateVein(Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein)
 {
     return(vein);
 }
Beispiel #51
0
		private Mining()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

			#region Mining for ore and stone
			HarvestDefinition oreAndStone = m_OreAndStone = new HarvestDefinition();

			// Resource banks are every 8x8 tiles
			oreAndStone.BankWidth = 8;
			oreAndStone.BankHeight = 8;

			// Every bank holds from 10 to 34 ore
			oreAndStone.MinTotal = 10;
			oreAndStone.MaxTotal = 34;

			// A resource bank will respawn its content every 10 to 20 minutes
			oreAndStone.MinRespawn = TimeSpan.FromMinutes( 10.0 );
			oreAndStone.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

			// Skill checking is done on the Mining skill
			oreAndStone.Skill = SkillName.Mining;

			// Set the list of harvestable tiles
			oreAndStone.Tiles = m_MountainAndCaveTiles;

			// Players must be within 2 tiles to harvest
			oreAndStone.MaxRange = 2;

			// One ore per harvest action
			oreAndStone.ConsumedPerHarvest = 1;
			oreAndStone.ConsumedPerFeluccaHarvest = 2;

			// The digging effect
			oreAndStone.EffectActions = new int[]{ 11 };
			oreAndStone.EffectSounds = new int[]{ 0x125, 0x126 };
			oreAndStone.EffectCounts = new int[]{ 1 };
			oreAndStone.EffectDelay = TimeSpan.FromSeconds( 1.6 );
			oreAndStone.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

			oreAndStone.NoResourcesMessage = 503040; // There is no metal here to mine.
			oreAndStone.DoubleHarvestMessage = 503042; // Someone has gotten to the metal before you.
			oreAndStone.TimedOutOfRangeMessage = 503041; // You have moved too far away to continue mining.
			oreAndStone.OutOfRangeMessage = 500446; // That is too far away.
			oreAndStone.FailMessage = 503043; // You loosen some rocks but fail to find any useable ore.
			oreAndStone.PackFullMessage = 1010481; // Your backpack is full, so the ore you mined is lost.
			oreAndStone.ToolBrokeMessage = 1044038; // You have worn out your tool!

			res = new HarvestResource[]
				{
					new HarvestResource( 00.0, 00.0, 100.0, 1007072, typeof( IronOre ),			typeof( Granite ) ),
					new HarvestResource( 65.0, 25.0, 105.0, 1007073, typeof( DullCopperOre ),	typeof( DullCopperGranite ),	typeof( DullCopperElemental ) ),
					new HarvestResource( 70.0, 30.0, 110.0, 1007074, typeof( ShadowIronOre ),	typeof( ShadowIronGranite ),	typeof( ShadowIronElemental ) ),
					new HarvestResource( 75.0, 35.0, 115.0, 1007075, typeof( CopperOre ),		typeof( CopperGranite ),		typeof( CopperElemental ) ),
					new HarvestResource( 80.0, 40.0, 120.0, 1007076, typeof( BronzeOre ),		typeof( BronzeGranite ),		typeof( BronzeElemental ) ),
					new HarvestResource( 85.0, 45.0, 125.0, 1007077, typeof( GoldOre ),			typeof( GoldGranite ),			typeof( GoldenElemental ) ),
					new HarvestResource( 90.0, 50.0, 130.0, 1007078, typeof( AgapiteOre ),		typeof( AgapiteGranite ),		typeof( AgapiteElemental ) ),
					new HarvestResource( 95.0, 55.0, 135.0, 1007079, typeof( VeriteOre ),		typeof( VeriteGranite ),		typeof( VeriteElemental ) ),
					new HarvestResource( 99.0, 59.0, 139.0, 1007080, typeof( ValoriteOre ),		typeof( ValoriteGranite ),		typeof( ValoriteElemental ) )
				};

			veins = new HarvestVein[]
				{
					new HarvestVein( 49.6, 0.0, res[0], null   ), // Iron
					new HarvestVein( 11.2, 0.5, res[1], res[0] ), // Dull Copper
					new HarvestVein( 09.8, 0.5, res[2], res[0] ), // Shadow Iron
					new HarvestVein( 08.4, 0.5, res[3], res[0] ), // Copper
					new HarvestVein( 07.0, 0.5, res[4], res[0] ), // Bronze
					new HarvestVein( 05.6, 0.5, res[5], res[0] ), // Gold
					new HarvestVein( 04.2, 0.5, res[6], res[0] ), // Agapite
					new HarvestVein( 02.8, 0.5, res[7], res[0] ), // Verite
					new HarvestVein( 01.4, 0.5, res[8], res[0] )  // Valorite
				};

			oreAndStone.Resources = res;
			oreAndStone.Veins = veins;

			if ( Core.ML )
			{
				oreAndStone.BonusResources = new BonusHarvestResource[]
				{
					new BonusHarvestResource( 0, 99.8998, null, null ),	//Nothing	//Note: Rounded the below to .0167 instead of 1/6th of a %.  Close enough
					new BonusHarvestResource( 100, .0167, 1072562, typeof( BlueDiamond ) ),
					new BonusHarvestResource( 100, .0167, 1072567, typeof( DarkSapphire ) ),
					new BonusHarvestResource( 100, .0167, 1072570, typeof( EcruCitrine ) ),
					new BonusHarvestResource( 100, .0167, 1072564, typeof( FireRuby ) ),
					new BonusHarvestResource( 100, .0167, 1072566, typeof( PerfectEmerald ) ),
					new BonusHarvestResource( 100, .0167, 1072568, typeof( Turquoise ) )
				};
			}

			oreAndStone.RaceBonus = Core.ML;
			oreAndStone.RandomizeVeins = Core.ML;

			Definitions.Add( oreAndStone );
			#endregion

			#region Mining for sand
			HarvestDefinition sand = m_Sand = new HarvestDefinition();

			// Resource banks are every 8x8 tiles
			sand.BankWidth = 8;
			sand.BankHeight = 8;

			// Every bank holds from 6 to 12 sand
			sand.MinTotal = 6;
			sand.MaxTotal = 12;

			// A resource bank will respawn its content every 10 to 20 minutes
			sand.MinRespawn = TimeSpan.FromMinutes( 10.0 );
			sand.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

			// Skill checking is done on the Mining skill
			sand.Skill = SkillName.Mining;

			// Set the list of harvestable tiles
			sand.Tiles = m_SandTiles;

			// Players must be within 2 tiles to harvest
			sand.MaxRange = 2;

			// One sand per harvest action
			sand.ConsumedPerHarvest = 1;
			sand.ConsumedPerFeluccaHarvest = 1;

			// The digging effect
			sand.EffectActions = new int[]{ 11 };
			sand.EffectSounds = new int[]{ 0x125, 0x126 };
			sand.EffectCounts = new int[]{ 6 };
			sand.EffectDelay = TimeSpan.FromSeconds( 1.6 );
			sand.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

			sand.NoResourcesMessage = 1044629; // There is no sand here to mine.
			sand.DoubleHarvestMessage = 1044629; // There is no sand here to mine.
			sand.TimedOutOfRangeMessage = 503041; // You have moved too far away to continue mining.
			sand.OutOfRangeMessage = 500446; // That is too far away.
			sand.FailMessage = 1044630; // You dig for a while but fail to find any of sufficient quality for glassblowing.
			sand.PackFullMessage = 1044632; // Your backpack can't hold the sand, and it is lost!
			sand.ToolBrokeMessage = 1044038; // You have worn out your tool!

			res = new HarvestResource[]
				{
					new HarvestResource( 100.0, 70.0, 400.0, 1044631, typeof( Sand ) )
				};

			veins = new HarvestVein[]
				{
					new HarvestVein( 100.0, 0.0, res[0], null )
				};

			sand.Resources = res;
			sand.Veins = veins;

			Definitions.Add( sand );
			#endregion
		}
Beispiel #52
0
        public virtual HarvestResource MutateResource(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestVein vein, HarvestResource primary, HarvestResource fallback)
        {
            if (vein.ChanceToFallback > Utility.RandomDouble())
            {
                return(fallback);
            }

            double skillValue = from.Skills[def.Skill].Value;

            if (fallback != null && (skillValue < primary.ReqSkill || skillValue < primary.MinSkill))
            {
                return(fallback);
            }

            return(primary);
        }
Beispiel #53
0
		public virtual void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
		{
		}
Beispiel #54
0
        private DeathHarvest()
        {
            HarvestResource[] res;
            HarvestVein[] veins;

            #region Harvesting graves
            HarvestDefinition gravesAndMounds = this.m_GravesAndMounds = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            gravesAndMounds.BankWidth = 8;
            gravesAndMounds.BankHeight = 8;

            // Every bank holds from 10 to 34 ore
            gravesAndMounds.MinTotal = 10;
            gravesAndMounds.MaxTotal = 34;

            // A resource bank will respawn its content every 10 to 20 minutes
            gravesAndMounds.MinRespawn = TimeSpan.FromMinutes(10.0);
            gravesAndMounds.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Mining skill
            gravesAndMounds.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            gravesAndMounds.Tiles = m_GravesAndMoundsTiles;

            // Players must be within 2 tiles to harvest
            gravesAndMounds.MaxRange = 2;

            // One ore per harvest action
            gravesAndMounds.ConsumedPerHarvest = 1;
            gravesAndMounds.ConsumedPerFeluccaHarvest = 2;

            // The digging effect
            gravesAndMounds.EffectActions = new int[] { 11 };
            gravesAndMounds.EffectSounds = new int[] { 0x125, 0x126 };
            gravesAndMounds.EffectCounts = new int[] { 1 };
            gravesAndMounds.EffectDelay = TimeSpan.FromSeconds(1.6);
            gravesAndMounds.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            gravesAndMounds.NoResourcesMessage = 503040; // There is no metal here to mine.
            gravesAndMounds.DoubleHarvestMessage = 503042; // Someone has gotten to the metal before you.
            gravesAndMounds.TimedOutOfRangeMessage = 503041; // You have moved too far away to continue mining.
            gravesAndMounds.OutOfRangeMessage = 500446; // That is too far away.
            gravesAndMounds.FailMessage = 503043; // You loosen some rocks but fail to find any useable ore.
            gravesAndMounds.PackFullMessage = 1010481; // Your backpack is full, so the ore you mined is lost.
            gravesAndMounds.ToolBrokeMessage = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
            {
                new HarvestResource(00.0, 00.0, 100.0, 1007072, typeof(IronOre), typeof(Granite)),
                new HarvestResource(65.0, 25.0, 105.0, 1007073, typeof(DullCopperOre),	typeof(DullCopperGranite), typeof(DullCopperElemental)),
                new HarvestResource(70.0, 30.0, 110.0, 1007074, typeof(ShadowIronOre),	typeof(ShadowIronGranite), typeof(ShadowIronElemental)),
                new HarvestResource(75.0, 35.0, 115.0, 1007075, typeof(CopperOre), typeof(CopperGranite), typeof(CopperElemental)),
                new HarvestResource(80.0, 40.0, 120.0, 1007076, typeof(BronzeOre), typeof(BronzeGranite), typeof(BronzeElemental)),
                new HarvestResource(85.0, 45.0, 125.0, 1007077, typeof(GoldOre), typeof(GoldGranite), typeof(GoldenElemental)),
                new HarvestResource(90.0, 50.0, 130.0, 1007078, typeof(AgapiteOre), typeof(AgapiteGranite), typeof(AgapiteElemental)),
                new HarvestResource(95.0, 55.0, 135.0, 1007079, typeof(VeriteOre), typeof(VeriteGranite), typeof(VeriteElemental)),
                new HarvestResource(99.0, 59.0, 139.0, 1007080, typeof(ValoriteOre), typeof(ValoriteGranite), typeof(ValoriteElemental))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(49.6, 0.0, res[0], null), // Iron
                new HarvestVein(11.2, 0.5, res[1], res[0]), // Dull Copper
                new HarvestVein(09.8, 0.5, res[2], res[0]), // Shadow Iron
                new HarvestVein(08.4, 0.5, res[3], res[0]), // Copper
                new HarvestVein(07.0, 0.5, res[4], res[0]), // Bronze
                new HarvestVein(05.6, 0.5, res[5], res[0]), // Gold
                new HarvestVein(04.2, 0.5, res[6], res[0]), // Agapite
                new HarvestVein(02.8, 0.5, res[7], res[0]), // Verite
                new HarvestVein(01.4, 0.5, res[8], res[0])// Valorite
            };

            gravesAndMounds.Resources = res;
            gravesAndMounds.Veins = veins;

            if (Core.ML)
            {
                gravesAndMounds.BonusResources = new BonusHarvestResource[]
                {
                    new BonusHarvestResource(0, 99.4, null, null), //Nothing
                    new BonusHarvestResource(100, .1, 1072562, typeof(BlueDiamond)),
                    new BonusHarvestResource(100, .1, 1072567, typeof(DarkSapphire)),
                    new BonusHarvestResource(100, .1, 1072570, typeof(EcruCitrine)),
                    new BonusHarvestResource(100, .1, 1072564, typeof(FireRuby)),
                    new BonusHarvestResource(100, .1, 1072566, typeof(PerfectEmerald)),
                    new BonusHarvestResource(100, .1, 1072568, typeof(Turquoise))
                };
            }

            gravesAndMounds.RaceBonus = Core.ML;
            gravesAndMounds.RandomizeVeins = Core.ML;

            this.Definitions.Add(gravesAndMounds);
            #endregion

            #region Mining for sand
            HarvestDefinition tombsAndCoffins = this.m_TombsAndCoffins = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            tombsAndCoffins.BankWidth = 8;
            tombsAndCoffins.BankHeight = 8;

            // Every bank holds from 6 to 12 
            tombsAndCoffins.MinTotal = 6;
            tombsAndCoffins.MaxTotal = 12;

            // A resource bank will respawn its content every 10 to 20 minutes
            tombsAndCoffins.MinRespawn = TimeSpan.FromMinutes(10.0);
            tombsAndCoffins.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Mining skill
            tombsAndCoffins.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            tombsAndCoffins.Tiles = m_TombsAndCoffinsTiles;

            // Players must be within 2 tiles to harvest
            tombsAndCoffins.MaxRange = 2;

            // One tombsAndCoffins per harvest action
            tombsAndCoffins.ConsumedPerHarvest = 1;
            tombsAndCoffins.ConsumedPerFeluccaHarvest = 1;

            // The digging effect
            tombsAndCoffins.EffectActions = new int[] { 11 };
            tombsAndCoffins.EffectSounds = new int[] { 0x125, 0x126 };
            tombsAndCoffins.EffectCounts = new int[] { 6 };
            tombsAndCoffins.EffectDelay = TimeSpan.FromSeconds(1.6);
            tombsAndCoffins.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            tombsAndCoffins.NoResourcesMessage = 1044629; // There is no tombsAndCoffins here to mine.
            tombsAndCoffins.DoubleHarvestMessage = 1044629; // There is no tombsAndCoffins here to mine.
            tombsAndCoffins.TimedOutOfRangeMessage = 503041; // You have moved too far away to continue mining.
            tombsAndCoffins.OutOfRangeMessage = 500446; // That is too far away.
            tombsAndCoffins.FailMessage = 1044630; // You dig for a while but fail to find any of sufficient quality for glassblowing.
            tombsAndCoffins.PackFullMessage = 1044632; // Your backpack can't hold the tombsAndCoffins, and it is lost!
            tombsAndCoffins.ToolBrokeMessage = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
            {
                new HarvestResource(100.0, 70.0, 400.0, 1044631, typeof(Sand))
            };

            veins = new HarvestVein[]
            {
                new HarvestVein(100.0, 0.0, res[0], null)
            };

            tombsAndCoffins.Resources = res;
            tombsAndCoffins.Veins = veins;

            this.Definitions.Add(tombsAndCoffins);
            #endregion
        }
Beispiel #55
0
		public virtual HarvestResource MutateResource( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestVein vein, HarvestResource primary, HarvestResource fallback )
		{
			bool racialBonus = (def.RaceBonus && from.Race == Race.Elf );

			if( vein.ChanceToFallback > (Utility.RandomDouble() + (racialBonus ? .20 : 0)) )
				return fallback;

			double skillValue = from.Skills[def.Skill].Value;

			if ( fallback != null && (skillValue < primary.ReqSkill || skillValue < primary.MinSkill) )
				return fallback;

			return primary;
		}
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            base.OnHarvestFinished(from, tool, def, vein, bank, resource, harvested);

            from.RevealingAction();
            from.NextSkillTime = Core.TickCount + (int)(SkillCooldown.FishingCooldown * 1000);
        }