本文整理汇总了C#中Server.Engines.Harvest.HarvestVein类的典型用法代码示例。如果您正苦于以下问题:C# HarvestVein类的具体用法?C# HarvestVein怎么用?C# HarvestVein使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HarvestVein类属于Server.Engines.Harvest命名空间,在下文中一共展示了HarvestVein类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HarvestBank
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;
}
示例2: HarvestBank
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;
}
示例3: OnHarvestFinished
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;
}
}
*/
}
示例4: Fishing
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
}
示例5: TreasureHunting
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
}
示例6: MutateVein
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 );
}
示例7: Fishing
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
}
示例8: Lumberjacking
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;
//.........这里部分代码省略.........
示例9: OnHarvestFinished
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
{
}
}
}
}
示例10: ClayMining
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
}
示例11: MutateResource
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;
}
示例12: OnHarvestFinished
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 { }
}
}
}
示例13: Lumberjacking
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
}
示例14: NecroReagentGathering
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
}
示例15: Mining
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;
//.........这里部分代码省略.........