using System;
using Server;
using Server.Items;
using Server.Network;
using Server.Targeting;
namespace Server.Engines.Harvest
{
public class Lumberjacking : HarvestSystem
{
private static Lumberjacking m_System;
public static Lumberjacking System
{
get
{
if (m_System == null)
m_System = new Lumberjacking();
return m_System;
}
}
private HarvestDefinition m_Plain, m_Oak, m_Ash, m_Yew, m_Bloodwood, m_Heartwood, m_Frostwood;
public HarvestDefinition Plain
{
get{ return m_Plain; }
}
public HarvestDefinition Oak
{
get { return m_Oak; }
}
public HarvestDefinition Ash
{
get { return m_Ash; }
}
public HarvestDefinition Yew
{
get { return m_Yew; }
}
public HarvestDefinition Bloodwood
{
get { return m_Bloodwood; }
}
public HarvestDefinition Heartwood
{
get { return m_Heartwood; }
}
public HarvestDefinition Frostwood
{
get { return m_Frostwood; }
}
private Lumberjacking()
{
HarvestResource[] res;
HarvestVein[] veins;
#region PlainLumberjacking
HarvestDefinition plainlumber = m_Plain = new HarvestDefinition();
// Resource banks are every 4x3 tiles
plainlumber.BankWidth = 4;
plainlumber.BankHeight = 3;
// Every bank holds from 20 to 45 logs
plainlumber.MinTotal = 20;
plainlumber.MaxTotal = 45;
// A resource bank will respawn its content every 20 to 30 minutes
plainlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
plainlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
// Skill checking is done on the Lumberjacking skill
plainlumber.Skill = SkillName.Lumberjacking;
// Set the list of harvestable tiles
plainlumber.Tiles = m_PlainTree;
// Players must be within 2 tiles to harvest
plainlumber.MaxRange = 2;
// Ten logs per harvest action
plainlumber.ConsumedPerHarvest = 10;
plainlumber.ConsumedPerFeluccaHarvest = 10;//20
// The chopping effect
plainlumber.EffectActions = new int[] { 13 };
plainlumber.EffectSounds = new int[] { 0x13E };
plainlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
plainlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
plainlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
plainlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
plainlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
plainlumber.OutOfRangeMessage = 500446; // That is too far away.
plainlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
plainlumber.ToolBrokeMessage = 500499; // You broke your axe.
res = new HarvestResource[]
{
new HarvestResource(00.0, 00.0, 100.0, 1072540, typeof(Log)),
};
veins = new HarvestVein[]
{
new HarvestVein(100.0, 0.0, res[0], null), // Ordinary Logs
};
plainlumber.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))
};
plainlumber.Resources = res;
plainlumber.Veins = veins;
this.Definitions.Add(plainlumber);
#endregion
#region OakLumberjacking
HarvestDefinition oaklumber = m_Oak = new HarvestDefinition();
// Resource banks are every 4x3 tiles
oaklumber.BankWidth = 4;
oaklumber.BankHeight = 3;
// Every bank holds from 20 to 45 logs
oaklumber.MinTotal = 20;
oaklumber.MaxTotal = 45;
// A resource bank will respawn its content every 20 to 30 minutes
oaklumber.MinRespawn = TimeSpan.FromMinutes(20.0);
oaklumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
// Skill checking is done on the Lumberjacking skill
oaklumber.Skill = SkillName.Lumberjacking;
// Set the list of harvestable tiles
oaklumber.Tiles = m_OakTree;
// Players must be within 2 tiles to harvest
oaklumber.MaxRange = 2;
// Ten logs per harvest action
oaklumber.ConsumedPerHarvest = 10;
oaklumber.ConsumedPerFeluccaHarvest = 10;//20
// The chopping effect
oaklumber.EffectActions = new int[] { 13 };
oaklumber.EffectSounds = new int[] { 0x13E };
oaklumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
oaklumber.EffectDelay = TimeSpan.FromSeconds(1.6);
oaklumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
oaklumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
oaklumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
oaklumber.OutOfRangeMessage = 500446; // That is too far away.
oaklumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
oaklumber.ToolBrokeMessage = 500499; // You broke your axe.
res = new HarvestResource[]
{
new HarvestResource(00.0, 00.0, 100.0, 1072540, typeof(Log)),
};
veins = new HarvestVein[]
{
new HarvestVein(100.0, 0.0, res[0], null), // Ordinary Logs
};
oaklumber.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))
};
oaklumber.Resources = res;
oaklumber.Veins = veins;
this.Definitions.Add(oaklumber);
#endregion
#region AshLumberjacking
HarvestDefinition ashlumber = m_Ash = new HarvestDefinition();
// Resource banks are every 4x3 tiles
ashlumber.BankWidth = 4;
ashlumber.BankHeight = 3;
// Every bank holds from 20 to 45 logs
ashlumber.MinTotal = 20;
ashlumber.MaxTotal = 45;
// A resource bank will respawn its content every 20 to 30 minutes
ashlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
ashlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
// Skill checking is done on the Lumberjacking skill
ashlumber.Skill = SkillName.Lumberjacking;
// Set the list of harvestable tiles
ashlumber.Tiles = m_AshTree;
// Players must be within 2 tiles to harvest
ashlumber.MaxRange = 2;
// Ten logs per harvest action
ashlumber.ConsumedPerHarvest = 10;
ashlumber.ConsumedPerFeluccaHarvest = 10;//20
// The chopping effect
ashlumber.EffectActions = new int[] { 13 };
ashlumber.EffectSounds = new int[] { 0x13E };
ashlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
ashlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
ashlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
ashlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
ashlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
ashlumber.OutOfRangeMessage = 500446; // That is too far away.
ashlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
ashlumber.ToolBrokeMessage = 500499; // You broke your axe.
res = new HarvestResource[]
{
new HarvestResource(80.0, 40.0, 120.0, 1072542, typeof(AshLog)),
};
veins = new HarvestVein[]
{
new HarvestVein(100.0, 0.5, res[2], res[0]), // Ash
};
ashlumber.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))
};
ashlumber.Resources = res;
ashlumber.Veins = veins;
this.Definitions.Add(ashlumber);
#endregion
#region YewLumberjacking
HarvestDefinition yewlumber = m_Yew = new HarvestDefinition();
// Resource banks are every 4x3 tiles
yewlumber.BankWidth = 4;
yewlumber.BankHeight = 3;
// Every bank holds from 20 to 45 logs
yewlumber.MinTotal = 20;
yewlumber.MaxTotal = 45;
// A resource bank will respawn its content every 20 to 30 minutes
yewlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
yewlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
// Skill checking is done on the Lumberjacking skill
yewlumber.Skill = SkillName.Lumberjacking;
// Set the list of harvestable tiles
yewlumber.Tiles = m_YewTree;
// Players must be within 2 tiles to harvest
yewlumber.MaxRange = 2;
// Ten logs per harvest action
yewlumber.ConsumedPerHarvest = 10;
yewlumber.ConsumedPerFeluccaHarvest = 10;//20
// The chopping effect
yewlumber.EffectActions = new int[] { 13 };
yewlumber.EffectSounds = new int[] { 0x13E };
yewlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
yewlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
yewlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
yewlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
yewlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
yewlumber.OutOfRangeMessage = 500446; // That is too far away.
yewlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
yewlumber.ToolBrokeMessage = 500499; // You broke your axe.
res = new HarvestResource[]
{
new HarvestResource(95.0, 55.0, 135.0, 1072543, typeof(YewLog)),
};
veins = new HarvestVein[]
{
new HarvestVein(05.0, 0.5, res[3], res[0]), // Yew
};
yewlumber.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))
};
yewlumber.Resources = res;
yewlumber.Veins = veins;
this.Definitions.Add(yewlumber);
#endregion
#region HeartwoodLumberjacking
HarvestDefinition heartwoodlumber = m_Heartwood = new HarvestDefinition();
// Resource banks are every 4x3 tiles
heartwoodlumber.BankWidth = 4;
heartwoodlumber.BankHeight = 3;
// Every bank holds from 20 to 45 logs
heartwoodlumber.MinTotal = 20;
heartwoodlumber.MaxTotal = 45;
// A resource bank will respawn its content every 20 to 30 minutes
heartwoodlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
heartwoodlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
// Skill checking is done on the Lumberjacking skill
heartwoodlumber.Skill = SkillName.Lumberjacking;
// Set the list of harvestable tiles
heartwoodlumber.Tiles = m_HeartwoodTree;
// Players must be within 2 tiles to harvest
heartwoodlumber.MaxRange = 2;
// Ten logs per harvest action
heartwoodlumber.ConsumedPerHarvest = 10;
heartwoodlumber.ConsumedPerFeluccaHarvest = 10;//20
// The chopping effect
heartwoodlumber.EffectActions = new int[] { 13 };
heartwoodlumber.EffectSounds = new int[] { 0x13E };
heartwoodlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
heartwoodlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
heartwoodlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
heartwoodlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
heartwoodlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
heartwoodlumber.OutOfRangeMessage = 500446; // That is too far away.
heartwoodlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
heartwoodlumber.ToolBrokeMessage = 500499; // You broke your axe.
res = new HarvestResource[]
{
new HarvestResource(100.0, 60.0, 140.0, 1072544, typeof(HeartwoodLog)),
};
veins = new HarvestVein[]
{
new HarvestVein(03.0, 0.5, res[4], res[0]), // Heartwood
};
heartwoodlumber.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))
};
heartwoodlumber.Resources = res;
heartwoodlumber.Veins = veins;
this.Definitions.Add(heartwoodlumber);
#endregion
#region BloodwoodLumberjacking
HarvestDefinition bloodwoodlumber = m_Bloodwood = new HarvestDefinition();
// Resource banks are every 4x3 tiles
bloodwoodlumber.BankWidth = 4;
bloodwoodlumber.BankHeight = 3;
// Every bank holds from 20 to 45 logs
bloodwoodlumber.MinTotal = 20;
bloodwoodlumber.MaxTotal = 45;
// A resource bank will respawn its content every 20 to 30 minutes
bloodwoodlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
bloodwoodlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
// Skill checking is done on the Lumberjacking skill
bloodwoodlumber.Skill = SkillName.Lumberjacking;
// Set the list of harvestable tiles
bloodwoodlumber.Tiles = m_BloodwoodTree;
// Players must be within 2 tiles to harvest
bloodwoodlumber.MaxRange = 2;
// Ten logs per harvest action
bloodwoodlumber.ConsumedPerHarvest = 10;
bloodwoodlumber.ConsumedPerFeluccaHarvest = 10;//20
// The chopping effect
bloodwoodlumber.EffectActions = new int[] { 13 };
bloodwoodlumber.EffectSounds = new int[] { 0x13E };
bloodwoodlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
bloodwoodlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
bloodwoodlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
bloodwoodlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
bloodwoodlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
bloodwoodlumber.OutOfRangeMessage = 500446; // That is too far away.
bloodwoodlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
bloodwoodlumber.ToolBrokeMessage = 500499; // You broke your axe.
res = new HarvestResource[]
{
new HarvestResource(100.0, 60.0, 140.0, 1072545, typeof(BloodwoodLog)),
};
veins = new HarvestVein[]
{
new HarvestVein(02.0, 0.5, res[5], res[0]), // Bloodwood
};
bloodwoodlumber.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))
};
bloodwoodlumber.Resources = res;
bloodwoodlumber.Veins = veins;
this.Definitions.Add(bloodwoodlumber);
#endregion
#region FrostwoodLumberjacking
HarvestDefinition frostwoodlumber = m_Frostwood = new HarvestDefinition();
// Resource banks are every 4x3 tiles
frostwoodlumber.BankWidth = 4;
frostwoodlumber.BankHeight = 3;
// Every bank holds from 20 to 45 logs
frostwoodlumber.MinTotal = 20;
frostwoodlumber.MaxTotal = 45;
// A resource bank will respawn its content every 20 to 30 minutes
frostwoodlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
frostwoodlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
// Skill checking is done on the Lumberjacking skill
frostwoodlumber.Skill = SkillName.Lumberjacking;
// Set the list of harvestable tiles
frostwoodlumber.Tiles = m_FrostwoodTree;
// Players must be within 2 tiles to harvest
frostwoodlumber.MaxRange = 2;
// Ten logs per harvest action
frostwoodlumber.ConsumedPerHarvest = 10;
frostwoodlumber.ConsumedPerFeluccaHarvest = 10;//20
// The chopping effect
frostwoodlumber.EffectActions = new int[] { 13 };
frostwoodlumber.EffectSounds = new int[] { 0x13E };
frostwoodlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
frostwoodlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
frostwoodlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
frostwoodlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
frostwoodlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
frostwoodlumber.OutOfRangeMessage = 500446; // That is too far away.
frostwoodlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
frostwoodlumber.ToolBrokeMessage = 500499; // You broke your axe.
res = new HarvestResource[]
{
new HarvestResource(100.0, 60.0, 140.0, 1072546, typeof(FrostwoodLog)),
};
veins = new HarvestVein[]
{
new HarvestVein(01.0, 0.5, res[6], res[0]), // Frostwood
};
frostwoodlumber.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))
};
frostwoodlumber.Resources = res;
frostwoodlumber.Veins = veins;
this.Definitions.Add(frostwoodlumber);
#endregion
}
#region added
public override Type GetResourceType( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource )
{
return base.GetResourceType( from, tool, def, map, loc, resource );
}
#endregion added
public override bool CheckHarvest( Mobile from, Item tool )
{
if ( !base.CheckHarvest( from, tool ) )
return false;
if ( tool.Parent != from )
{
from.SendLocalizedMessage(500487); // The axe must be equipped for any serious wood chopping.
return false;
}
return true;
}
public override bool CheckHarvest(Mobile from, Item tool, HarvestDefinition def, object toHarvest)
{
if (!base.CheckHarvest(from, tool, def, toHarvest))
return false;
if (tool.Parent != from)
{
from.SendLocalizedMessage(500487); // The axe must be equipped for any serious wood chopping.
return false;
}
return true;
}
public override void OnBadHarvestTarget(Mobile from, Item tool, object toHarvest)
{
if (toHarvest is Mobile)
((Mobile)toHarvest).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500450, from.NetState); // You can only skin dead creatures.
else if (toHarvest is Item)
((Item)toHarvest).LabelTo(from, 500464); // Use this on corpses to carve away meat and hide
else if (toHarvest is Targeting.StaticTarget || toHarvest is Targeting.LandTarget)
from.SendLocalizedMessage(500489); // You can't use an axe on that.
else
from.SendLocalizedMessage(1005213); // You can't do that
}
public override void OnHarvestStarted(Mobile from, Item tool, HarvestDefinition def, object toHarvest)
{
base.OnHarvestStarted(from, tool, def, toHarvest);
if (Core.ML)
from.RevealingAction();
}
#region Plain list
private static readonly int[] m_PlainTree = new int[]
{
0x0C9E, 0x0CC9, 0x0CCA, 0x0CCB, 0x0CCC, 0x0CCD,
0x0CD0, 0x0CD3, 0x0CD6, 0x0CD8, 0x0CE0, 0x0CE3,
0x0CE6, 0x0CF8, 0x0CFB, 0x0CFE, 0x0D01, 0x0D41,
0x0D42, 0x0D43, 0x0D44, 0x0D57, 0x0D58, 0x0D59,
0x0D5A, 0x0D5B, 0x0D6E, 0x0D6F, 0x0D70, 0x0D71,
0x0D72, 0x0D84, 0x0D85, 0x0D86, 0x0D94, 0x0D98,
0x0D9C, 0x0DA0, 0x0Da4, 0x0DA8
};
#endregion
#region Oak list
private static readonly int[] m_OakTree = new int[]
{
0x0CDA, 0x0CDD, 0x224C, 0x224D
};
#endregion
#region Ash list
private static readonly int[] m_AshTree = new int[]
{
0x0000
};
#endregion
#region Yew list
private static readonly int[] m_YewTree = new int[]
{
0x12B5, 0x12B6, 0x12B7, 0x12B8, 0x12B9, 0x12BA,
0x12BB, 0x12BC, 0x12BD
};
#endregion
#region Bloodwood list
private static readonly int[] m_BloodwoodTree = new int[]
{
0x0000
};
#endregion
#region Heartwood list
private static readonly int[] m_HeartwoodTree = new int[]
{
0x0000
};
#endregion
#region Frostwood list
private static readonly int[] m_FrostwoodTree = new int[]
{
0x0000
};
#endregion
}
}