public HarvestVein( double veinChance, double chanceToFallback, HarvestResource primaryResource, HarvestResource fallbackResource ) { m_VeinChance = veinChance; m_ChanceToFallback = chanceToFallback; m_PrimaryResource = primaryResource; m_FallbackResource = fallbackResource; }
public HarvestVein(Expansion reqExpansion, double veinChance, double chanceToFallback, HarvestResource primaryResource, HarvestResource fallbackResource ) { ReqExpansion = reqExpansion; VeinChance = veinChance; ChanceToFallback = chanceToFallback; PrimaryResource = primaryResource; FallbackResource = fallbackResource; }
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; } } */ }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { Type newType = type; if (tool is HarvestersAxe axe && axe.Charges > 0 || tool is GargishHarvestersAxe gaxe && gaxe.Charges > 0) { if (type == typeof(Log)) { newType = typeof(Board); } else if (type == typeof(OakLog)) { newType = typeof(OakBoard); } else if (type == typeof(AshLog)) { newType = typeof(AshBoard); } else if (type == typeof(YewLog)) { newType = typeof(YewBoard); } else if (type == typeof(HeartwoodLog)) { newType = typeof(HeartwoodBoard); } else if (type == typeof(BloodwoodLog)) { newType = typeof(BloodwoodBoard); } else if (type == typeof(FrostwoodLog)) { newType = typeof(FrostwoodBoard); } if (newType != type) { if (tool is HarvestersAxe) { ((HarvestersAxe)tool).Charges--; } else if (tool is GargishHarvestersAxe) { ((GargishHarvestersAxe)tool).Charges--; } } } return(newType); }
public virtual void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested) { }
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 }
public virtual void SendPackFullTo( Mobile from, Item item, HarvestDefinition def, HarvestResource resource ) { def.SendMessageTo( from, def.PackFullMessage ); }
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 }
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 }
public override Type GetResourceType(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { #region Void Pool Items HarvestMap hmap = HarvestMap.CheckMapOnHarvest(from, loc, def); if (hmap != null && hmap.Resource >= CraftResource.RegularWood && hmap.Resource <= CraftResource.Frostwood) { hmap.UsesRemaining--; hmap.InvalidateProperties(); CraftResourceInfo info = CraftResources.GetInfo(hmap.Resource); if (info != null) { return(info.ResourceTypes[0]); } } #endregion return(base.GetResourceType(from, tool, def, map, loc, resource)); }
public override Type GetResourceType( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource ) { if ( def == m_treasuresAndTrinkets ) return resource.Types[0]; return base.GetResourceType( from, tool, def, map, loc, resource ); }
public virtual Type GetResourceType(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { if (resource.Types.Length > 0) { return(resource.Types[Utility.Random(resource.Types.Length)]); } return(null); }
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 virtual Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { return(from.Region.GetResource(type)); }
public virtual void SendPackFullTo(Mobile from, Item item, HarvestDefinition def, HarvestResource resource) { def.SendMessageTo(from, def.PackFullMessage); }
public virtual void SendSuccessTo(Mobile from, Item item, HarvestResource resource) { resource.SendSuccessTo(from); }
public override Type MutateType( Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource ) { bool deepWater = SpecialFishingNet.FullValidation( map, loc.X, loc.Y ); double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; for ( int i = 0; i < m_MutateTable.Length; ++i ) { MutateEntry entry = m_MutateTable[i]; if ( !deepWater && entry.m_DeepWater ) continue; if ( skillBase >= entry.m_ReqSkill ) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); if ( chance > Utility.RandomDouble() ) return entry.m_Types[Utility.Random( entry.m_Types.Length )]; } } return type; }
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, 82.0, 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, 01.0, 1072551, typeof(BrilliantAmber)), new BonusHarvestResource(100, 01.0, 1113756, typeof(CrystalShards), Map.TerMur), }; } 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 }
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 GoldPanning() { HarvestResource[] res; HarvestVein[] veins; #region GoldPanning HarvestDefinition nugget = new HarvestDefinition(); // Resource banks are every 8x8 tiles nugget.BankWidth = 8; nugget.BankHeight = 8; // Every bank holds from 5 to 10 nuggets nugget.MinTotal = 5; nugget.MaxTotal = 10; // A resource bank will respawn its content every 10 to 20 minutes nugget.MinRespawn = TimeSpan.FromMinutes(10.0); nugget.MaxRespawn = TimeSpan.FromMinutes(20.0); // Skill checking is done on the Mining skill nugget.Skill = SkillName.Mining; // Set the list of harvestable tiles nugget.Tiles = m_WaterTiles; nugget.RangedTiles = true; // Players must be within 2 tiles to harvest nugget.MaxRange = 2; // One nugget per harvest action nugget.ConsumedPerHarvest = 1; nugget.ConsumedPerFeluccaHarvest = 1; // The panning nugget.EffectActions = new int[] { 32 }; nugget.EffectSounds = new int[0]; nugget.EffectCounts = new int[] { 1 }; nugget.EffectDelay = TimeSpan.Zero; nugget.EffectSoundDelay = TimeSpan.FromSeconds(8.0); nugget.NoResourcesMessage = "There doesn't seem to be any nuggets left here."; // There doesn't seem to be any nuggets left here. nugget.FailMessage = "You pan for a while, but fail to find any nuggets."; // You pan for a while, but fail to find any nuggets. nugget.TimedOutOfRangeMessage = "You need to be closer to the water for panning!"; // You need to be closer to the water for panning! nugget.OutOfRangeMessage = "You need to be closer to the water for panning!"; // You need to be closer to the water for panning! nugget.PackFullMessage = "You dont have room in your pack for another nugget."; // You dont have room in your pack for another nugget. nugget.ToolBrokeMessage = "You wore out your gold pan."; // You wore out your gold pan. res = new HarvestResource[] { new HarvestResource(75.0, 70.0, 125.0, "You put a small gold nugget in your pack.", typeof(SmallGoldNugget)), new HarvestResource(90.0, 75.0, 135.0, "You put a medium gold nugget in your pack.", typeof(MediumGoldNugget)), new HarvestResource(105.0, 90.0, 145.0, "You put a large gold nugget in your pack.", typeof(LargeGoldNugget)) }; veins = new HarvestVein[] { new HarvestVein(70.0, 0.0, res[0], null), new HarvestVein(20.0, 0.5, res[1], res[0]), new HarvestVein(10.0, 0.5, res[2], res[0]) }; nugget.Resources = res; nugget.Veins = veins; if (Core.ML) { nugget.BonusResources = new BonusHarvestResource[] { new BonusHarvestResource(0, 88.0, null, null), //Nothing new BonusHarvestResource(100, 2.0, 1072562, typeof(BlueDiamond)), new BonusHarvestResource(100, 2.0, 1072567, typeof(DarkSapphire)), new BonusHarvestResource(100, 2.0, 1072570, typeof(EcruCitrine)), new BonusHarvestResource(100, 2.0, 1072564, typeof(FireRuby)), new BonusHarvestResource(100, 2.0, 1072566, typeof(PerfectEmerald)), new BonusHarvestResource(100, 2.0, 1072568, typeof(Turquoise)), new BonusHarvestResource(100, 2.0, 1113349, typeof(DelicateScales)), new BonusHarvestResource(100, 2.0, 1026256, typeof(BrilliantAmber)), new BonusHarvestResource(100, 2.0, 1032694, typeof(WhitePearl)) }; } m_Definition = nugget; Definitions.Add(nugget); #endregion }
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 }
public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested) { Map map = from.Map; Point3D loc = from.Location; HarvestResource res = vein.PrimaryResource; if (res == resource) { try { if (from.Karma > -2459) { Titles.AwardKarma(from, -50, true); } if (Utility.RandomMinMax(1, 100) < 3) // CHECK TO SEE IF THEY WERE WITNESSED DIGGING UP A GRAVE 2% { int caught = 1; if (from.Skills[SkillName.Hiding].Value >= 30) { from.SendMessage("Someone passed by, but your stealthiness has avoided you from being seen."); if (from.CheckSkill(SkillName.Stealth, 0, 100)) { caught = 0; } } if (caught > 0) { from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "Someone has spotted you in the distance!", from.NetState); from.SendMessage("You have been reported as a criminal!"); from.Criminal = true; Server.Items.DisguiseTimers.RemoveDisguise(from); } } map = from.Map; if (map == null) { return; } BaseCreature spawned = new Zombie(); switch (Utility.Random(19)) { case 0: spawned = new Zombie(); break; case 1: spawned = new Skeleton(); break; case 2: spawned = new Ghoul(); break; case 3: spawned = new Shade(); break; case 4: spawned = new Spectre(); break; case 5: spawned = new Wraith(); break; case 6: spawned = new BoneKnight(); break; case 7: spawned = new BoneMagi(); break; case 8: spawned = new Ghostly(); break; case 9: spawned = new Lich(); break; case 10: spawned = new LichLord(); break; case 11: spawned = new Mummy(); break; case 12: spawned = new RottingCorpse(); break; case 13: spawned = new Shade(); break; case 14: spawned = new SkeletalKnight(); break; case 15: spawned = new SkeletalWizard(); break; case 16: spawned = new SkeletalMage(); break; case 17: spawned = new Phantom(); break; case 18: spawned = new Vampire(); break; } int nSpiritSpeak = (int)(from.Skills[SkillName.SpiritSpeak].Value / 10); string sSaying = ""; switch (Utility.Random(9)) { case 0: sSaying = "Who has disturbed me!"; break; case 1: sSaying = "You dare steal from my grave?"; break; case 2: sSaying = "Those that take from me will join me!"; break; case 3: sSaying = "Your soul is now mine for the taking!"; break; case 4: sSaying = "Who dares waken me?"; break; case 5: sSaying = "Your life will be extinguished!"; break; case 6: sSaying = "Do you have no respect for the dead?"; break; case 7: sSaying = "I have been waiting to feast off the living!"; break; case 8: sSaying = "Soon you will join my legion of the dead!"; break; } if ((spawned != null) && (Utility.Random(100) > (nSpiritSpeak + 85))) // 10% chance you will get a grave raiser { from.CheckSkill(SkillName.SpiritSpeak, 0, 100); 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.OnBeforeSpawn(new Point3D(x, y, from.Z), map); spawned.Home = new Point3D(x, y, from.Z); spawned.RangeHome = 5; spawned.Title += " [Awakened]"; spawned.MoveToWorld(new Point3D(x, y, from.Z), map); spawned.Say(sSaying); spawned.ControlSlots = 666; // WIZARD ADDED FOR MONSTER CLEANUP spawned.Combatant = from; return; } else { int z = map.GetAverageZ(x, y); if (map.CanSpawnMobile(x, y, z)) { spawned.OnBeforeSpawn(new Point3D(x, y, z), map); spawned.Home = new Point3D(x, y, z); spawned.RangeHome = 5; spawned.Title += " [Awakened]"; spawned.MoveToWorld(new Point3D(x, y, z), map); spawned.Say(sSaying); spawned.ControlSlots = 666; // WIZARD ADDED FOR MONSTER CLEANUP spawned.Combatant = from; return; } } } spawned.OnBeforeSpawn(from.Location, from.Map); spawned.Home = from.Location; spawned.RangeHome = 5; spawned.Title += " [Awakened]"; spawned.MoveToWorld(from.Location, from.Map); spawned.Say(sSaying); spawned.ControlSlots = 666; // WIZARD ADDED FOR MONSTER CLEANUP spawned.Combatant = from; } int digger = (int)(from.Skills[SkillName.Forensics].Value / 10); if ((2 + digger) > Utility.Random(100)) // chance to dig up a box { if (from.CheckSkill(SkillName.Forensics, 0, 125)) { Item chest = new GraveChest(6, from); switch (Utility.Random(10 + digger)) { case 0: chest = new GraveChest(1, from); break; case 1: chest = new GraveChest(1, from); break; case 2: chest = new GraveChest(1, from); break; case 3: chest = new GraveChest(1, from); break; case 4: chest = new GraveChest(1, from); break; case 5: chest = new GraveChest(1, from); break; case 6: chest = new GraveChest(2, from); break; case 7: chest = new GraveChest(2, from); break; case 8: chest = new GraveChest(2, from); break; case 9: chest = new GraveChest(2, from); break; case 10: chest = new GraveChest(2, from); break; case 11: chest = new GraveChest(3, from); break; case 12: chest = new GraveChest(3, from); break; case 13: chest = new GraveChest(3, from); break; case 14: chest = new GraveChest(3, from); break; case 15: chest = new GraveChest(4, from); break; case 16: chest = new GraveChest(4, from); break; case 17: chest = new GraveChest(4, from); break; case 18: chest = new GraveChest(5, from); break; case 19: chest = new GraveChest(5, from); break; } if (chest != null) { chest.MoveToWorld(loc, map); from.SendMessage("you dig up a graveyard chest."); } } } } 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(); }
private GraveRobbing() { HarvestResource[] res; HarvestVein[] veins; #region GraveRobbing HarvestDefinition grave = new HarvestDefinition(); grave.BankWidth = 1; grave.BankHeight = 1; grave.MinTotal = 1; grave.MaxTotal = 3; grave.MinRespawn = TimeSpan.FromMinutes(50.0); grave.MaxRespawn = TimeSpan.FromMinutes(70.0); grave.Skill = SkillName.Forensics; grave.Tiles = m_GraveTiles; grave.MaxRange = 1; grave.ConsumedPerHarvest = 1; grave.ConsumedPerFeluccaHarvest = 1; grave.EffectActions = new int[] { 11 }; grave.EffectSounds = new int[] { 0x125, 0x126 }; grave.EffectCounts = new int[] { 1 }; grave.EffectDelay = TimeSpan.FromSeconds(1.6); grave.EffectSoundDelay = TimeSpan.FromSeconds(0.9); grave.NoResourcesMessage = 501756; // Nothing worth taking.. grave.FailMessage = 501756; // Nothing worth taking grave.OutOfRangeMessage = 500446; // That is too far away. grave.PackFullMessage = 500720; // You don't have enough room in your backpack! grave.ToolBrokeMessage = 1044038; // You broke your tool. res = new HarvestResource[] { new HarvestResource(000.0, 000.0, 150.0, "You put some bones in your backpack", typeof(Bones)), new HarvestResource(000.0, 000.0, 150.0, "You put a rotted arm in your backpack", typeof(LeftArm)), new HarvestResource(000.0, 000.0, 150.0, "You put a rotted arm in your backpack", typeof(RightArm)), new HarvestResource(000.0, 000.0, 150.0, "You put a rotted torso in your backpack", typeof(Torso)), new HarvestResource(000.0, 000.0, 150.0, "You put a rotted leg in your backpack", typeof(LeftLeg)), new HarvestResource(000.0, 000.0, 150.0, "You put a rotted leg in your backpack", typeof(RightLeg)), new HarvestResource(000.0, 000.0, 150.0, "You put a bone in your backpack", typeof(Bone)), new HarvestResource(000.0, 000.0, 150.0, "You put a rib cage in your backpack", typeof(RibCage)), new HarvestResource(000.0, 000.0, 150.0, "You put a pile of bones in your backpack", typeof(BonePile)), new HarvestResource(020.0, 010.0, 150.0, "You put some grave dust in your backpack", typeof(GraveDust)), new HarvestResource(020.0, 010.0, 150.0, "You put some dirt in your backpack", typeof(FertileDirt)), new HarvestResource(050.0, 040.0, 150.0, "You put an unknown liquid in your backpack", typeof(UnknownLiquid)), new HarvestResource(050.0, 040.0, 150.0, "You put some unknown reagents in your backpack", typeof(UnknownReagent)), new HarvestResource(050.0, 040.0, 150.0, "You put an unknown scroll in your backpack", typeof(UnknownScroll)) }; veins = new HarvestVein[] { new HarvestVein(05.0, 0.0, res[0], res[0]), new HarvestVein(05.0, 0.0, res[1], res[0]), new HarvestVein(05.0, 0.0, res[2], res[0]), new HarvestVein(05.0, 0.0, res[3], res[0]), new HarvestVein(05.0, 0.0, res[4], res[0]), new HarvestVein(05.0, 0.0, res[5], res[0]), new HarvestVein(05.0, 0.0, res[6], res[0]), new HarvestVein(05.0, 0.5, res[7], res[0]), new HarvestVein(05.0, 0.5, res[8], res[0]), new HarvestVein(13.0, 0.5, res[9], res[0]), new HarvestVein(12.0, 0.5, res[10], res[0]), new HarvestVein(10.0, 0.5, res[11], res[0]), new HarvestVein(10.0, 0.5, res[12], res[0]), new HarvestVein(10.0, 0.5, res[13], res[0]) }; if (Core.ML) { grave.BonusResources = new BonusHarvestResource[] // cos this is mining after all { new BonusHarvestResource(0, 78.0, null, null), //Nothing new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicVase)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicArts)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicStatue)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicWeapon)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicArmor)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicJewels)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicInstrument)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicScrolls)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicReagent)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicOrbs)), new BonusHarvestResource(60, 2.0, 1074542, typeof(DDRelicBook)) }; } grave.RandomizeVeins = Core.ML; grave.Resources = res; grave.Veins = veins; m_Definition = grave; Definitions.Add(grave); #endregion }
public override void SendSuccessTo( Mobile from, Item item, HarvestResource resource ) { if ( item is BaseGranite ) from.SendLocalizedMessage( 1044606 ); // You carefully extract some workable stone from the ore vein! else base.SendSuccessTo( from, item, resource ); }
private CrystalMining() { HarvestResource[] res; HarvestVein[] veins; HarvestDefinition Crystals = m_Crystals = new HarvestDefinition(); // Resource banks are every 8x8 tiles Crystals.BankWidth = 8; Crystals.BankHeight = 8; // Every bank holds from 10 to 34 ore Crystals.MinTotal = 2; Crystals.MaxTotal = 5; // A resource bank will respawn its content every 10 to 20 minutes Crystals.MinRespawn = TimeSpan.FromMinutes(15.0); Crystals.MaxRespawn = TimeSpan.FromMinutes(30.0); // Skill checking is done on the Mining skill Crystals.Skill = SkillName.Mining; // Set the list of harvestable tiles Crystals.Tiles = m_CrystalTiles; // Players must be within 2 tiles to harvest Crystals.MaxRange = 2; // One ore per harvest action Crystals.ConsumedPerHarvest = 1; Crystals.ConsumedPerFeluccaHarvest = 2; // The digging effect Crystals.EffectActions = new int[] { 11 }; Crystals.EffectSounds = new int[] { 0x125, 0x126 }; Crystals.EffectCounts = new int[] { 1 }; Crystals.EffectDelay = TimeSpan.FromSeconds(1.6); Crystals.EffectSoundDelay = TimeSpan.FromSeconds(0.9); Crystals.NoResourcesMessage = "There are no Crystals here to mine."; // There is no Crystals here to mine. Crystals.DoubleHarvestMessage = "Someone mined to the Crystals before you."; // Someone has gotten to the Crystals before you. Crystals.TimedOutOfRangeMessage = "You have moved too far away to continue Crystal Mining."; // You have moved too far away to continue Gem Mining. Crystals.OutOfRangeMessage = "That Crystal is too far away."; // That is too far away. Crystals.FailMessage = "You loosen some Crystals but fail to find any useable gems."; // You loosen some rocks but fail to find any useable Crystals. Crystals.PackFullMessage = "Your backpack is full, so the gems you Crystal Mined are lost."; // Your backpack is full, so the Crystals you mined is lost. Crystals.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 }; Crystals.Resources = res; Crystals.Veins = veins; if (Core.ML) { Crystals.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(Crystals); }
public virtual void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested ) { }
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) && !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; } 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; Type type = null; if (CheckHarvestSkill(map, loc, from, resource, def)) { 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, tool); if (item == null) { type = null; } else { int amount = def.ConsumedPerHarvest; int feluccaAmount = def.ConsumedPerFeluccaHarvest; if (item is BaseGranite) { feluccaAmount = 3; } //The whole harvest system is kludgy and I'm sure this is just adding to it. if (item.Stackable) { int racialAmount = (int)Math.Ceiling(amount * 1.1); int feluccaRacialAmount = (int)Math.Ceiling(feluccaAmount * 1.1); bool eligableForRacialBonus = (def.RaceBonus && from.Race == Race.Human); bool inFelucca = map == Map.Felucca && !Siege.SiegeShard; if (eligableForRacialBonus && inFelucca && bank.Current >= feluccaRacialAmount && 0.1 > Utility.RandomDouble()) { item.Amount = feluccaRacialAmount; } else if (inFelucca && bank.Current >= feluccaAmount) { item.Amount = feluccaAmount; } else if (eligableForRacialBonus && bank.Current >= racialAmount && 0.1 > Utility.RandomDouble()) { item.Amount = racialAmount; } else { item.Amount = amount; } // Void Pool Rewards item.Amount += WoodsmansTalisman.CheckHarvest(from, type, this); } bank.Consume(amount, from); EventSink.InvokeResourceHarvestSuccess(new ResourceHarvestSuccessEventArgs(from, tool, item, this)); 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) { if (bonus.RequiredMap == null || bonus.RequiredMap == from.Map) { Item bonusItem = Construct(bonus.Type, from, tool); if (Give(from, bonusItem, true)) //Bonuses always allow placing at feet, even if pack is full irregrdless of def { bonus.SendSuccessTo(from); } else { bonusItem.Delete(); } } } } #region High Seas OnToolUsed(from, tool, item != null); #endregion } // Siege rules will take into account axes and polearms used for lumberjacking if (tool is IUsesRemaining && (tool is BaseHarvestTool || tool is Pickaxe || tool is SturdyPickaxe || tool is GargoylesPickaxe || Siege.SiegeShard)) { 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); }
public virtual Type GetResourceType( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource ) { if ( resource.Types.Length > 0 ) return resource.Types[Utility.Random( resource.Types.Length )]; return null; }
public override Type GetResourceType(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { if (def == this.m_OreAndStone) { #region Void Pool Items HarvestMap hmap = HarvestMap.CheckMapOnHarvest(from, loc, def); if (hmap != null && hmap.Resource >= CraftResource.Iron && hmap.Resource <= CraftResource.Valorite) { hmap.UsesRemaining--; hmap.InvalidateProperties(); CraftResourceInfo info = CraftResources.GetInfo(hmap.Resource); if (info != null) return info.ResourceTypes[1]; } #endregion PlayerMobile pm = from as PlayerMobile; if (pm != null && pm.GemMining && pm.ToggleMiningGem && from.Skills[SkillName.Mining].Base >= 100.0 && 0.1 > Utility.RandomDouble()) return Loot.RandomGem().GetType(); if (pm != null && pm.StoneMining && pm.ToggleMiningStone && from.Skills[SkillName.Mining].Base >= 100.0 && 0.15 > Utility.RandomDouble()) return resource.Types[1]; return resource.Types[0]; } return base.GetResourceType(from, tool, def, map, loc, resource); }
public override Type GetResourceType(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { if (def == this.m_OreAndStone) { #region Void Pool Items HarvestMap hmap = HarvestMap.CheckMapOnHarvest(from, loc, def); if (hmap != null && hmap.Resource >= CraftResource.Iron && hmap.Resource <= CraftResource.Valorite) { hmap.UsesRemaining--; hmap.InvalidateProperties(); CraftResourceInfo info = CraftResources.GetInfo(hmap.Resource); if (info != null) { return(info.ResourceTypes[1]); } } #endregion PlayerMobile pm = from as PlayerMobile; if (pm != null && pm.GemMining && pm.ToggleMiningGem && from.Skills[SkillName.Mining].Base >= 100.0 && 0.1 > Utility.RandomDouble()) { return(Loot.GemTypes[Utility.Random(Loot.GemTypes.Length)]); } double chance = tool is RockHammer ? 0.50 : 0.15; if (pm != null && pm.StoneMining && (pm.ToggleMiningStone || pm.ToggleStoneOnly) && from.Skills[SkillName.Mining].Base >= 100.0 && chance > Utility.RandomDouble()) { return(resource.Types[1]); } if (pm != null && pm.ToggleStoneOnly) { return(null); } return(resource.Types[0]); } return(base.GetResourceType(from, tool, def, map, loc, resource)); }
public virtual bool CheckHarvestSkill(Map map, Point3D loc, Mobile from, HarvestResource resource, HarvestDefinition def) { return(from.Skills[def.Skill].Value >= resource.ReqSkill && from.CheckSkill(def.Skill, resource.MinSkill, resource.MaxSkill)); }
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; }
public override Type GetResourceType(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { if (def == m_OreAndStone) { if (from is PlayerMobile && ((PlayerMobile)from).StoneMining && ((PlayerMobile)from).ToggleMiningStone && from.Skills[SkillName.Mining].Base >= 100.0 && 0.1 > Utility.RandomDouble()) { return(resource.Types[1]); } return(resource.Types[0]); } return(base.GetResourceType(from, tool, def, map, loc, resource)); }
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 }
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 { } } } }
public override void SendSuccessTo( Mobile from, Item item, HarvestResource resource ) { if ( item is BigFish ) { from.SendLocalizedMessage( 1042635 ); // Your fishing pole bends as you pull a big fish from the depths! ((BigFish)item).Fisher = from; } else { int number; string name; if ( item is Fish ) { number = 1008124; name = "a fish"; } else if ( item is BaseShoes ) { number = 1008124; name = "a piece of junk"; } else { number = 1043297; if ( (item.ItemData.Flags & TileFlag.ArticleA) != 0 ) name = "a " + item.ItemData.Name; else if ( (item.ItemData.Flags & TileFlag.ArticleAn) != 0 ) name = "an " + item.ItemData.Name; else name = item.ItemData.Name; } if ( number == 1043297 ) from.SendLocalizedMessage( number, name ); else from.SendLocalizedMessage( number, true, name ); } }
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; 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 }
public HarvestVein( double chance, HarvestResource resource ) { Chance = chance; Resource = resource; }
private HerbGathering() { HarvestResource[] res; HarvestVein[] veins; #region HerbGathering HarvestDefinition herb = new HarvestDefinition(); herb.BankWidth = 1; herb.BankHeight = 1; herb.MinTotal = 1; herb.MaxTotal = 3; herb.MinRespawn = TimeSpan.FromMinutes(5.0); herb.MaxRespawn = TimeSpan.FromMinutes(15.0); herb.Skill = SkillName.Cooking; herb.Tiles = m_PlantTiles; herb.MaxRange = 2; herb.ConsumedPerHarvest = 1; herb.ConsumedPerFeluccaHarvest = 1; herb.EffectActions = new int[] { 32 }; herb.EffectSounds = new int[] { 0x4F }; herb.EffectCounts = new int[] { 1, 1, 1, 1, 2 }; herb.EffectDelay = TimeSpan.FromSeconds(0.7); herb.EffectSoundDelay = TimeSpan.FromSeconds(0.7); herb.NoResourcesMessage = "There are no herbs to harvest here."; herb.FailMessage = "You don't manage to gather any herbs."; herb.OutOfRangeMessage = 500446; herb.PackFullMessage = "You can't carry any more!"; herb.ToolBrokeMessage = "You've broken your boline."; res = new HarvestResource[] { new HarvestResource(37.5, 37.5, 37.5, "You put some sage in your backpack.", typeof(Sage)), new HarvestResource(87.5, 87.5, 87.5, "You put some acacia in your backpack.", typeof(Acacia)), new HarvestResource(62.5, 62.5, 62.5, "You put some anise in your backpack.", typeof(Anise)), new HarvestResource(62.5, 62.5, 62.5, "You put some basil in your backpack.", typeof(Basil)), new HarvestResource(62.5, 62.5, 62.5, "You put a bay leaf in your backpack.", typeof(BayLeaf)), new HarvestResource(62.5, 62.5, 62.5, "You put some chamomile in your backpack.", typeof(Chamomile)), new HarvestResource(62.5, 62.5, 62.5, "You put some caraway in your backpack.", typeof(Caraway)), new HarvestResource(62.5, 62.5, 62.5, "You put some cilantro in your backpack.", typeof(Cilantro)), new HarvestResource(62.5, 62.5, 62.5, "You put some cinnamon in your backpack.", typeof(Cinnamon)), new HarvestResource(62.5, 62.5, 62.5, "You put some clove in your backpack.", typeof(Clove)), new HarvestResource(87.5, 87.5, 87.5, "You put some copal in your backpack.", typeof(Copal)), new HarvestResource(62.5, 62.5, 62.5, "You put some coriander in your backpack.", typeof(Coriander)), new HarvestResource(62.5, 62.5, 62.5, "You put some dill in your backpack.", typeof(Dill)), new HarvestResource(87.5, 87.5, 87.5, "You put some dragonsblood in your backpack.", typeof(Dragonsblood)), new HarvestResource(87.5, 87.5, 87.5, "You put some frankincense in your backpack.", typeof(Frankincense)), new HarvestResource(62.5, 62.5, 62.5, "You put some lavender in your backpack.", typeof(Lavender)), new HarvestResource(87.5, 87.5, 87.5, "You put some marjoram in your backpack.", typeof(Marjoram)), new HarvestResource(62.5, 62.5, 62.5, "You put some meadowsweet in your backpack.", typeof(Meadowsweet)), new HarvestResource(37.5, 37.5, 37.5, "You put some mint in your backpack.", typeof(Mint)), new HarvestResource(62.5, 62.5, 62.5, "You put some mugwort in your backpack.", typeof(Mugwort)), new HarvestResource(62.5, 62.5, 62.5, "You put some mustard in your backpack.", typeof(Mustard)), new HarvestResource(87.5, 87.5, 87.5, "You put some myrrh in your backpack.", typeof(Myrrh)), new HarvestResource(62.5, 62.5, 62.5, "You put some olive in your backpack.", typeof(Olive)), new HarvestResource(37.5, 37.5, 37.5, "You put some oregano in your backpack.", typeof(Oregano)), new HarvestResource(87.5, 87.5, 87.5, "You put some orris in your backpack.", typeof(Orris)), new HarvestResource(87.5, 87.5, 87.5, "You put some patchouli in your backpack.", typeof(Patchouli)), new HarvestResource(37.5, 37.5, 37.5, "You put some peppercorn in your backpack.", typeof(Peppercorn)), new HarvestResource(62.5, 62.5, 62.5, "You put some rose in your backpack.", typeof(RoseHerb)), new HarvestResource(62.5, 62.5, 62.5, "You put some rosemary in your backpack.", typeof(Rosemary)), new HarvestResource(62.5, 62.5, 62.5, "You put some saffron in your backpack.", typeof(Saffron)), new HarvestResource(87.5, 87.5, 87.5, "You put some sandelwood in your backpack.", typeof(Sandelwood)), new HarvestResource(62.5, 62.5, 62.5, "You put some slippery elm in your backpack.", typeof(SlipperyElm)), new HarvestResource(37.5, 37.5, 37.5, "You put some thyme in your backpack.", typeof(Thyme)), new HarvestResource(87.5, 87.5, 87.5, "You put some valerian in your backpack.", typeof(Valerian)), new HarvestResource(62.5, 62.5, 62.5, "You put some willow bark in your backpack.", typeof(WillowBark)) }; veins = new HarvestVein[] { new HarvestVein(5.0, 0.0, res[0], null), new HarvestVein(1.5, 0.1, res[1], res[0]), new HarvestVein(3.0, 0.1, res[2], res[0]), new HarvestVein(3.0, 0.1, res[3], res[0]), new HarvestVein(3.0, 0.1, res[4], res[0]), new HarvestVein(3.0, 0.1, res[5], res[0]), new HarvestVein(3.0, 0.1, res[6], res[0]), new HarvestVein(3.0, 0.1, res[7], res[0]), new HarvestVein(3.0, 0.1, res[8], res[0]), new HarvestVein(3.0, 0.1, res[9], res[0]), new HarvestVein(1.5, 0.1, res[10], res[0]), new HarvestVein(3.0, 0.1, res[11], res[0]), new HarvestVein(3.0, 0.1, res[12], res[0]), new HarvestVein(1.5, 0.1, res[13], res[0]), new HarvestVein(1.5, 0.1, res[14], res[0]), new HarvestVein(3.0, 0.1, res[15], res[0]), new HarvestVein(1.5, 0.1, res[16], res[0]), new HarvestVein(3.0, 0.1, res[17], res[0]), new HarvestVein(5.0, 0.1, res[18], res[0]), new HarvestVein(3.0, 0.1, res[19], res[0]), new HarvestVein(3.0, 0.1, res[20], res[0]), new HarvestVein(1.5, 0.1, res[21], res[0]), new HarvestVein(3.0, 0.1, res[22], res[0]), new HarvestVein(5.0, 0.1, res[23], res[0]), new HarvestVein(1.5, 0.1, res[24], res[0]), new HarvestVein(1.5, 0.1, res[25], res[0]), new HarvestVein(5.0, 0.1, res[26], res[0]), new HarvestVein(3.0, 0.1, res[27], res[0]), new HarvestVein(3.0, 0.1, res[28], res[0]), new HarvestVein(3.0, 0.1, res[29], res[0]), new HarvestVein(1.5, 0.1, res[30], res[0]), new HarvestVein(3.0, 0.1, res[31], res[0]), new HarvestVein(5.0, 0.1, res[32], res[0]), new HarvestVein(1.5, 0.1, res[33], res[0]), new HarvestVein(3.0, 0.1, res[34], res[0]), }; herb.Resources = res; herb.Veins = veins; m_Definition = herb; Definitions.Add(herb); #endregion }
public override void SendSuccessTo( Mobile from, Item item, HarvestResource resource ) { base.SendSuccessTo( from, item, resource ); }
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, 25.0, 500498, typeof(Log)), new HarvestResource(20.0, 15.0, 60.0, "You put some Pine logs in your backpack", typeof(PineLog)), new HarvestResource(30.0, 25.0, 70.0, "You put some Cedar logs in your backpack", typeof(CedarLog)), new HarvestResource(40.0, 35.0, 80.0, "You put some Cherry logs in your backpack", typeof(CherryLog)), new HarvestResource(50.0, 45.0, 90.0, "You put some Mahogony logs in your backpack", typeof(MahoganyLog)), new HarvestResource(60.0, 55.0, 100.0, "You put some Oak logs in your backpack", typeof(OakLog)), new HarvestResource(70.0, 65.0, 110.0, "You put some Ash logs in your backpack", typeof(AshLog)), new HarvestResource(80.0, 75.0, 120.0, "You put some Yew logs in your backpack", typeof(YewLog)), new HarvestResource(90.0, 85.0, 130.0, "You put some Heartwood logs in your backpack", typeof(HeartwoodLog)), new HarvestResource(100.0, 95.0, 140.0, "You put some Bloodwood logs in your backpack", typeof(BloodwoodLog)), new HarvestResource(110.0, 105.0, 150.0, "You put some Frostwood logs in your backpack", typeof(FrostwoodLog)) }; veins = new HarvestVein[] { new HarvestVein(20.0, 0.0, res[0], null), new HarvestVein(16.0, 0.5, res[1], res[0]), // Pine new HarvestVein(14.0, 0.5, res[2], res[0]), // Cedar new HarvestVein(11.5, 0.5, res[3], res[0]), // Cherry new HarvestVein(8.5, 0.5, res[4], res[0]), // Mahogony new HarvestVein(7.5, 0.5, res[5], res[0]), // Oak new HarvestVein(6.5, 0.5, res[6], res[0]), // Ash new HarvestVein(5.5, 0.5, res[7], res[0]), // Yew new HarvestVein(4.5, 0.5, res[8], res[0]), // Heartwood new HarvestVein(3.5, 0.5, res[9], res[0]), // Bloodwood new HarvestVein(2.5, 0.5, res[10], res[0]), // Frostwood }; lumber.Resources = res; lumber.Veins = veins; m_Definition = lumber; Definitions.Add(lumber); #endregion }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { bool deepWater = SpecialFishingNet.FullValidation(map, loc.X, loc.Y); bool dungeon = false; Region region = from.Region; if ( region is DungeonRegion ) dungeon = true; double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; if ( FSHSR.HSRTournamentSystem.TournamentRunning() && skillValue > 60.0 ) { double chance = ( skillValue - 60.0 ) / 300; // Default 20% chance at 120 / 13% chance at 100 if ( DateTime.UtcNow.DayOfWeek == FSHSR.HSRTournamentSystem.TournyOne && dungeon == true && chance > Utility.RandomDouble() ) { return typeof( ToxicTrout ); } else if ( DateTime.UtcNow.DayOfWeek == FSHSR.HSRTournamentSystem.TournyTwo && deepWater == true && chance > Utility.RandomDouble() ) { return typeof( CottonCandySwordfish ); } else if ( DateTime.UtcNow.DayOfWeek == FSHSR.HSRTournamentSystem.TournyThree && from.Map == Map.Malas && chance > Utility.RandomDouble() ) { return typeof( MalasMoonfish ); } } for (int i = 0; i < m_MutateTable.Length; ++i) { MutateEntry entry = m_MutateTable[i]; if ( !deepWater && entry.m_DeepWater ) continue; if ( !dungeon && entry.m_RequiresDungeon ) continue; if ( entry.m_RequiredRegion != null && region.Name != entry.m_RequiredRegion ) continue; if ( entry.m_RequiredMap != null && map != entry.m_RequiredMap ) continue; if ( skillBase >= entry.m_ReqSkill ) { double chance = ( skillValue - entry.m_MinSkill ) / ( entry.m_MaxSkill - entry.m_MinSkill ); if (chance > Utility.RandomDouble()) return entry.m_Types[Utility.Random(entry.m_Types.Length)]; } } return type; }
public override Type GetResourceType(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { Type type = FishInfo.GetSpecialItem(from, tool, loc, false); if (type == null) { type = base.GetResourceType(from, tool, def, map, loc, resource); } return(type); }
public override void SendSuccessTo(Mobile from, Item item, HarvestResource resource) { if (item is BigFish) { from.SendLocalizedMessage(1042635); // Your fishing pole bends as you pull a big fish from the depths! ((BigFish)item).Fisher = from; } else if (item is WoodenChest || item is MetalGoldenChest) { from.SendLocalizedMessage(503175); // You pull up a heavy chest from the depths of the ocean! } else { int number; string name; if (item is BaseMagicFish) { number = 1008124; name = "a mess of small fish"; } else if ( item is Fish ) { number = 1008124; name = "a fish"; } else if ( item is BaseHighSeasFish ) { number = 1008124; name = item.Name; } else if (item is BaseShoes) { number = 1008124; name = item.ItemData.Name; } else if (item is TreasureMap) { number = 1008125; name = "a sodden piece of parchment"; } else if (item is MessageInABottle) { number = 1008125; name = "a bottle, with a message in it"; } else if (item is SpecialFishingNet) { number = 1008125; name = "a special fishing net"; // TODO: this is just a guess--what should it really be named? } else { number = 1043297; if ((item.ItemData.Flags & TileFlag.ArticleA) != 0) name = "a " + item.ItemData.Name; else if ((item.ItemData.Flags & TileFlag.ArticleAn) != 0) name = "an " + item.ItemData.Name; else name = item.ItemData.Name; } NetState ns = from.NetState; if (ns == null) return; if (number == 1043297 || ns.HighSeas) from.SendLocalizedMessage(number, name); else from.SendLocalizedMessage(number, true, name); } }
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); } }
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 { } } }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { if (FishInfo.IsRareFish(type)) { return(type); } bool deepWater = IsDeepWater(loc, map); bool junkproof = HasTypeHook(tool, HookType.JunkProof); double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; var table = Siege.SiegeShard ? m_SiegeMutateTable : m_MutateTable; for (int i = 0; i < table.Length; ++i) { MutateEntry entry = m_MutateTable[i]; // RedHerring / MudPuppy if (i == 6 && (from.Region == null || !from.Region.IsPartOf("Underworld"))) { continue; } if (junkproof && i == 5 && 0.80 >= Utility.RandomDouble()) { continue; } if (!deepWater && entry.m_DeepWater) { continue; } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } } } return(type); }
public override Type GetResourceType( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource ) { if ( def == m_OreAndStone ) { PlayerMobile pm = from as PlayerMobile; if ( pm != null && pm.StoneMining && pm.ToggleMiningStone && from.Skills[SkillName.Mining].Base >= 100.0 && 0.1 > Utility.RandomDouble() ) return resource.Types[1]; return resource.Types[0]; } return base.GetResourceType( from, tool, def, map, loc, resource ); }
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.SpecialTiles = m_LavaTiles; 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[] { Core.SA ? 6 : 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, 120.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, 97.0, null, null), //set to same chance as mining ml gems new BonusHarvestResource(80.0, 2.0, 1113764, typeof(DelicateScales)), new BonusHarvestResource(80.0, 1.0, 1072597, typeof(WhitePearl)) }; } this.m_Definition = fish; this.Definitions.Add(fish); #endregion }
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 { } } } }
public override void SendSuccessTo(Mobile from, Item item, HarvestResource resource) { if (item is BigFish) { from.SendLocalizedMessage(1042635); // Your fishing pole bends as you pull a big fish from the depths! ((BigFish)item).Fisher = from; ((BigFish)item).DateCaught = DateTime.Now; } #region Stygian Abyss else if (item is RedHerring) { from.SendLocalizedMessage(1095047, null, 0x23); // You take the Red Herring and put it into your pack. The only thing more surprising than the fact that there is a fish called the Red Herring is the fact that you fished for it! } else if (item is MudPuppy) { from.SendLocalizedMessage(1095064, null, 0x23); // You take the Mud Puppy and put it into your pack. Not surprisingly, it is very muddy. } #endregion else if (item is WoodenChest || item is MetalGoldenChest) { from.SendLocalizedMessage(503175); // You pull up a heavy chest from the depths of the ocean! } else { int number; string name; if (item is BaseMagicFish) { number = 1008124; name = "a mess of small fish"; } else if (item is Fish) { number = 1008124; name = item.ItemData.Name; } else if (item is BaseShoes) { number = 1008124; name = item.ItemData.Name; } else if (item is TreasureMap) { number = 1008125; name = "a sodden piece of parchment"; } else if (item is MessageInABottle) { number = 1008125; name = "a bottle, with a message in it"; } else if (item is SpecialFishingNet) { number = 1008125; name = "a special fishing net"; // TODO: this is just a guess--what should it really be named? } else if (item is BaseHighseasFish) { if (FishInfo.IsRareFish(item.GetType())) { from.SendLocalizedMessage(1043297, "a rare fish"); } else if (item.LabelNumber < 1) { from.SendLocalizedMessage(1043297, "a fish"); } else { from.SendLocalizedMessage(1043297, String.Format("#{0}", item.LabelNumber)); } return; } else if (item.LabelNumber > 0) { from.SendLocalizedMessage(1043297, String.Format("#{0}", item.LabelNumber)); return; } else { number = 1043297; if ((item.ItemData.Flags & TileFlag.ArticleA) != 0) { name = "a " + item.ItemData.Name; } else if ((item.ItemData.Flags & TileFlag.ArticleAn) != 0) { name = "an " + item.ItemData.Name; } else { name = item.ItemData.Name; } } NetState ns = from.NetState; if (ns == null) { return; } if (number == 1043297 || ns.HighSeas) { from.SendLocalizedMessage(number, name); } else { from.SendLocalizedMessage(number, true, name); } } }
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 }
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(); } }
public virtual void SendSuccessTo( Mobile from, Item item, HarvestResource resource ) { resource.SendSuccessTo( from ); }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { bool deepWater = SpecialFishingNet.FullValidation(map, loc.X, loc.Y); double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; for (int i = 0; i < m_MutateTable.Length; ++i) { MutateEntry entry = m_MutateTable[i]; if (!deepWater && entry.m_DeepWater) { continue; } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } } } return(type); }
public virtual Type MutateType( Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource ) { return from.Region.GetResource( type ); }
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; fish.PlaceAtFeetIfFull = true; // 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 = "The fish don't seem to be biting here."; fish.FailMessage = "You fish a while, but fail to catch anything."; fish.TimedOutOfRangeMessage = "You need to be closer to the water to fish!"; fish.OutOfRangeMessage = "You need to be closer to the water to fish!"; fish.PackFullMessage = "You do not have room in your backpack for a fish."; fish.ToolBrokeMessage = "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 }
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 SendSuccessTo(Mobile from, Item item, HarvestResource resource) { if (item is BigFish) { from.SendLocalizedMessage(1042635); // Your fishing pole bends as you pull a big fish from the depths! ((BigFish)item).Fisher = from; } else if (item is WoodenChest || item is MetalGoldenChest) { from.SendLocalizedMessage(503175); // You pull up a heavy chest from the depths of the ocean! } else { int number; string name; if (item is BaseMagicFish) { number = 1008124; name = "a mess of small fish"; } else if (item is Fish) { number = 1008124; name = "a fish"; } else if (item is BaseShoes) { number = 1008124; name = item.ItemData.Name; } else if (item is TreasureMap) { number = 1008125; name = "a sodden piece of parchment"; } else if (item is MessageInABottle) { number = 1008125; name = "a bottle, with a message in it"; } else if (item is SpecialFishingNet) { number = 1008125; name = "a special fishing net"; // TODO: this is just a guess--what should it really be named? } else { number = 1043297; if ((item.ItemData.Flags & TileFlag.ArticleA) != 0) { name = "a " + item.ItemData.Name; } else if ((item.ItemData.Flags & TileFlag.ArticleAn) != 0) { name = "an " + item.ItemData.Name; } else { name = item.ItemData.Name; } } if (number == 1043297) { from.SendLocalizedMessage(number, name); } else { from.SendAsciiMessage(String.Format("You pull out an item : {0}", name)); } //from.SendLocalizedMessage( number, true, name ); } }