1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Specific Woods from Specific Trees

Discussion in 'Script Support' started by Hank, Nov 21, 2013.

  1. Hank
    Offline

    Hank Active Member

    Joined:
    Nov 14, 2013
    Messages:
    972
    Likes Received:
    152
    I want to modify the distro Lumberjacking and harvest system to be able to allow for specific wood to be harvested from it's corresponding tree static type. I couldn't not find this on any of the forums.
    For example Oak trees producing only Oak wood.

    In advance, Thank you for your time!
    ps. I'm not asking for someone to do it for me, just suggest where i should begin.

    Edit:
    I have figured out what i need to do(I think), I just now have to piece it all together.

    Mental outline:
    make a list of the statics of the trees in a if, elseif, else style so when the player succeeds at harvesting it can check which list contains the static the player harvested from and return the appropriate resource.

    I figured I'd share the list of trees (7.0.18.0) since i just spent 15 minutes putting it together.
    List of Trees

    0x0C9E (3230) o'hii tree
    0x0CA8 (3240) small banana tree
    0x0CAA (3242) banana tree
    0x0CAB (3243) banana tree (stump?)
    0x0CC9 (3273) spider tree
    0x0CCA (3274) tree
    0x0CCB (3275) tree
    0x0CCC (3276) tree
    0x0CCD (3277) tree
    0x0CD0 (3280) tree
    0x0CD3 (3283) tree
    0x0CD6 (3286) Cedar tree
    0x0CD8 (3288) Cedar tree
    0x0CDA (3290) oak tree
    0x0CDD (3293) oak tree
    0x0CE0 (3296) walnut tree
    0x0CE3 (3299) walnut tree
    0x0CE6 (3302) willow tree
    0x0CF3 (3315) fallen log
    0x0CF4 (3316) fallen log
    0x0CF5 (3317) fallen log
    0x0CF6 (3318) fallen log
    0x0CF7 (3319) fallen log
    0x0CF8 (3320) cypress tree
    0x0CFB (3323) cypress tree
    0x0CFE (3326) cypress tree
    0x0D01 (3329) cypress tree
    0x0D37 (3383) yucca
    0x0D38 (3384) yucca
    0x0D41 (3393) tree (tall)
    0x0D42 (3394) tree (tall)
    0x0D43 (3395) tree (tall)
    0x0D44 (3396) tree (tall)
    0x0D57 (3415) tree (tall)
    0x0D58 (3416) tree (tall)
    0x0D59 (3417) tree (tall)
    0x0D5A (3418) tree (tall)
    0x0D5B (3419) tree (tall)
    0x0D6E (3438) tree (tall)
    0x0D6F (3439) tree (tall)
    0x0D70 (3440) tree (tall)
    0x0D71 (3441) tree (tall)
    0x0D72 (3442) tree (tall)
    0x0D84 (3460) tree (tall)
    0x0D85 (3461) tree (tall)
    0x0D86 (3462) tree (tall)
    0x0D94 (3476) apple tree
    0x0D98 (3480) apple tree
    0x0D9C (3484) peach tree
    0x0DA0 (3488) peach tree
    0x0Da4 (3492) pear tree
    0x0DA8 (3496) pear tree
    0x0DAC (3500) tree stump (palm)
    0x0DAD (3501) tree stump (palm)
    0x12B5 (4789) Yew tree
    0x12B6 (4790) Yew tree
    0x12B7 (4791) Yew tree
    0x12B8 (4792) Yew tree
    0x12B9 (4793) Yew tree
    0x12BA (4794) Yew tree
    0x12BB (4795) Yew tree
    0x12BC (4796) Yew tree
    0x12BD (4797) Yew tree
    0x224A (8778) willow tree (hued?)
    0x224B (8779) willow tree (hued?)
    0x224C (8780) oak tree
    0x224D (8781) oak tree (hued?)
    0x2476 (9334) cherry tree
    0x2477 (9335) cherry tree
    0x247D (9341) maple tree
    0x247E (9342) maple tree
    0x26ED (9965) plum tree
    0x26EE (9966) plum tree

    note: How distro lumberjacking : harvest system works you need to add 0x3FFF to each hex value for these to be used in lumberjacking.cs

    Edit:
    I have not given up on this project, i am working on a custom resource system but have also been bogged down with real life matters. No ETA on another update.
     
    #1 Hank, Nov 21, 2013
    Last edited: Jan 10, 2014
    • Like Like x 2
  2. Hank
    Offline

    Hank Active Member

    Joined:
    Nov 14, 2013
    Messages:
    972
    Likes Received:
    152
    Edit: I decided to hide this post behind a spoiler because i'm ashamed to have even posted such trash
    Spoiler

    I gave up on my inital Mental outline and decided to take an easier route but i have run into a snag.

    Here is what my custom Lumberjacking.cs script looks like
    Code (C#):
    1. using System;
    2. using Server;
    3. using Server.Items;
    4. using Server.Network;
    5. using Server.Targeting;
    6.  
    7. namespace Server.Engines.Harvest
    8. {
    9.     public class Lumberjacking : HarvestSystem
    10.     {
    11.         private static Lumberjacking m_System;
    12.  
    13.         public static Lumberjacking System
    14.         {
    15.             get
    16.             {
    17.                 if (m_System == null)
    18.                     m_System = new Lumberjacking();
    19.  
    20.                 return m_System;
    21.             }
    22.         }
    23.  
    24. private HarvestDefinition m_Plain, m_Oak, m_Ash, m_Yew, m_Bloodwood, m_Heartwood, m_Frostwood;
    25.  
    26.         public HarvestDefinition Plain
    27.         {
    28.             get{ return m_Plain; }
    29.         }
    30.  
    31.         public HarvestDefinition Oak
    32.         {
    33.             get { return m_Oak; }
    34.         }
    35.         public HarvestDefinition Ash
    36.         {
    37.             get { return m_Ash; }
    38.         }
    39.         public HarvestDefinition Yew
    40.         {
    41.             get { return m_Yew; }
    42.         }
    43.         public HarvestDefinition Bloodwood
    44.         {
    45.             get { return m_Bloodwood; }
    46.         }
    47.         public HarvestDefinition Heartwood
    48.         {
    49.             get { return m_Heartwood; }
    50.         }
    51.         public HarvestDefinition Frostwood
    52.         {
    53.             get { return m_Frostwood; }
    54.         }
    55.  
    56.         private Lumberjacking()
    57.         {
    58.             HarvestResource[] res;
    59.             HarvestVein[] veins;
    60.  
    61.             #region PlainLumberjacking
    62.             HarvestDefinition plainlumber = m_Plain = new HarvestDefinition();
    63.  
    64.             // Resource banks are every 4x3 tiles
    65.             plainlumber.BankWidth = 4;
    66.             plainlumber.BankHeight = 3;
    67.  
    68.             // Every bank holds from 20 to 45 logs
    69.             plainlumber.MinTotal = 20;
    70.             plainlumber.MaxTotal = 45;
    71.  
    72.             // A resource bank will respawn its content every 20 to 30 minutes
    73.             plainlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
    74.             plainlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
    75.  
    76.             // Skill checking is done on the Lumberjacking skill
    77.             plainlumber.Skill = SkillName.Lumberjacking;
    78.  
    79.             // Set the list of harvestable tiles
    80.             plainlumber.Tiles = m_PlainTree;
    81.  
    82.             // Players must be within 2 tiles to harvest
    83.             plainlumber.MaxRange = 2;
    84.  
    85.             // Ten logs per harvest action
    86.             plainlumber.ConsumedPerHarvest = 10;
    87.             plainlumber.ConsumedPerFeluccaHarvest = 10;//20
    88.  
    89.             // The chopping effect
    90.             plainlumber.EffectActions = new int[] { 13 };
    91.             plainlumber.EffectSounds = new int[] { 0x13E };
    92.             plainlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
    93.             plainlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
    94.             plainlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
    95.  
    96.             plainlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
    97.             plainlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
    98.             plainlumber.OutOfRangeMessage = 500446; // That is too far away.
    99.             plainlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
    100.             plainlumber.ToolBrokeMessage = 500499; // You broke your axe.
    101.  
    102.                 res = new HarvestResource[]
    103.                 {
    104.                 new HarvestResource(00.0, 00.0, 100.0, 1072540, typeof(Log)),
    105.                 };
    106.  
    107.                 veins = new HarvestVein[]
    108.                 {
    109.                 new HarvestVein(100.0, 0.0, res[0], null), // Ordinary Logs
    110.                 };
    111.  
    112.                 plainlumber.BonusResources = new BonusHarvestResource[]
    113.                 {
    114.                     new BonusHarvestResource(0, 83.9, null, null), //Nothing
    115.                     new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
    116.                     new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
    117.                     new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
    118.                     new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
    119.                     new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
    120.                 };
    121.  
    122.             plainlumber.Resources = res;
    123.             plainlumber.Veins = veins;
    124.  
    125.  
    126.             this.Definitions.Add(plainlumber);
    127.             #endregion
    128.  
    129.             #region OakLumberjacking
    130.             HarvestDefinition oaklumber = m_Oak = new HarvestDefinition();
    131.  
    132.             // Resource banks are every 4x3 tiles
    133.             oaklumber.BankWidth = 4;
    134.             oaklumber.BankHeight = 3;
    135.  
    136.             // Every bank holds from 20 to 45 logs
    137.             oaklumber.MinTotal = 20;
    138.             oaklumber.MaxTotal = 45;
    139.  
    140.             // A resource bank will respawn its content every 20 to 30 minutes
    141.             oaklumber.MinRespawn = TimeSpan.FromMinutes(20.0);
    142.             oaklumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
    143.  
    144.             // Skill checking is done on the Lumberjacking skill
    145.             oaklumber.Skill = SkillName.Lumberjacking;
    146.  
    147.             // Set the list of harvestable tiles
    148.             oaklumber.Tiles = m_OakTree;
    149.  
    150.             // Players must be within 2 tiles to harvest
    151.             oaklumber.MaxRange = 2;
    152.  
    153.             // Ten logs per harvest action
    154.             oaklumber.ConsumedPerHarvest = 10;
    155.             oaklumber.ConsumedPerFeluccaHarvest = 10;//20
    156.  
    157.             // The chopping effect
    158.             oaklumber.EffectActions = new int[] { 13 };
    159.             oaklumber.EffectSounds = new int[] { 0x13E };
    160.             oaklumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
    161.             oaklumber.EffectDelay = TimeSpan.FromSeconds(1.6);
    162.             oaklumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
    163.  
    164.             oaklumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
    165.             oaklumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
    166.             oaklumber.OutOfRangeMessage = 500446; // That is too far away.
    167.             oaklumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
    168.             oaklumber.ToolBrokeMessage = 500499; // You broke your axe.
    169.  
    170.             res = new HarvestResource[]
    171.                 {
    172.             new HarvestResource(00.0, 00.0, 100.0, 1072540, typeof(Log)),
    173.             };
    174.  
    175.             veins = new HarvestVein[]
    176.             {
    177.             new HarvestVein(100.0, 0.0, res[0], null), // Ordinary Logs
    178.             };
    179.  
    180.             oaklumber.BonusResources = new BonusHarvestResource[]
    181.                 {
    182.                     new BonusHarvestResource(0, 83.9, null, null), //Nothing
    183.                     new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
    184.                     new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
    185.                     new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
    186.                     new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
    187.                     new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
    188.                 };
    189.  
    190.             oaklumber.Resources = res;
    191.             oaklumber.Veins = veins;
    192.  
    193.             this.Definitions.Add(oaklumber);
    194.             #endregion
    195.  
    196.             #region AshLumberjacking
    197.             HarvestDefinition ashlumber = m_Ash = new HarvestDefinition();
    198.  
    199.             // Resource banks are every 4x3 tiles
    200.             ashlumber.BankWidth = 4;
    201.             ashlumber.BankHeight = 3;
    202.  
    203.             // Every bank holds from 20 to 45 logs
    204.             ashlumber.MinTotal = 20;
    205.             ashlumber.MaxTotal = 45;
    206.  
    207.             // A resource bank will respawn its content every 20 to 30 minutes
    208.             ashlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
    209.             ashlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
    210.  
    211.             // Skill checking is done on the Lumberjacking skill
    212.             ashlumber.Skill = SkillName.Lumberjacking;
    213.  
    214.             // Set the list of harvestable tiles
    215.             ashlumber.Tiles = m_AshTree;
    216.  
    217.             // Players must be within 2 tiles to harvest
    218.             ashlumber.MaxRange = 2;
    219.  
    220.             // Ten logs per harvest action
    221.             ashlumber.ConsumedPerHarvest = 10;
    222.             ashlumber.ConsumedPerFeluccaHarvest = 10;//20
    223.  
    224.             // The chopping effect
    225.             ashlumber.EffectActions = new int[] { 13 };
    226.             ashlumber.EffectSounds = new int[] { 0x13E };
    227.             ashlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
    228.             ashlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
    229.             ashlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
    230.  
    231.             ashlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
    232.             ashlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
    233.             ashlumber.OutOfRangeMessage = 500446; // That is too far away.
    234.             ashlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
    235.             ashlumber.ToolBrokeMessage = 500499; // You broke your axe.
    236.  
    237.             res = new HarvestResource[]
    238.                 {
    239.             new HarvestResource(80.0, 40.0, 120.0, 1072542, typeof(AshLog)),
    240.             };
    241.  
    242.             veins = new HarvestVein[]
    243.             {
    244.             new HarvestVein(100.0, 0.5, res[2], res[0]), // Ash
    245.             };
    246.  
    247.             ashlumber.BonusResources = new BonusHarvestResource[]
    248.                 {
    249.                     new BonusHarvestResource(0, 83.9, null, null), //Nothing
    250.                     new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
    251.                     new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
    252.                     new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
    253.                     new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
    254.                     new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
    255.                 };
    256.  
    257.             ashlumber.Resources = res;
    258.             ashlumber.Veins = veins;
    259.  
    260.             this.Definitions.Add(ashlumber);
    261.             #endregion
    262.  
    263.             #region YewLumberjacking
    264.             HarvestDefinition yewlumber = m_Yew = new HarvestDefinition();
    265.  
    266.             // Resource banks are every 4x3 tiles
    267.             yewlumber.BankWidth = 4;
    268.             yewlumber.BankHeight = 3;
    269.  
    270.             // Every bank holds from 20 to 45 logs
    271.             yewlumber.MinTotal = 20;
    272.             yewlumber.MaxTotal = 45;
    273.  
    274.             // A resource bank will respawn its content every 20 to 30 minutes
    275.             yewlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
    276.             yewlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
    277.  
    278.             // Skill checking is done on the Lumberjacking skill
    279.             yewlumber.Skill = SkillName.Lumberjacking;
    280.  
    281.             // Set the list of harvestable tiles
    282.             yewlumber.Tiles = m_YewTree;
    283.  
    284.             // Players must be within 2 tiles to harvest
    285.             yewlumber.MaxRange = 2;
    286.  
    287.             // Ten logs per harvest action
    288.             yewlumber.ConsumedPerHarvest = 10;
    289.             yewlumber.ConsumedPerFeluccaHarvest = 10;//20
    290.  
    291.             // The chopping effect
    292.             yewlumber.EffectActions = new int[] { 13 };
    293.             yewlumber.EffectSounds = new int[] { 0x13E };
    294.             yewlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
    295.             yewlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
    296.             yewlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
    297.  
    298.             yewlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
    299.             yewlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
    300.             yewlumber.OutOfRangeMessage = 500446; // That is too far away.
    301.             yewlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
    302.             yewlumber.ToolBrokeMessage = 500499; // You broke your axe.
    303.  
    304.             res = new HarvestResource[]
    305.                 {
    306.             new HarvestResource(95.0, 55.0, 135.0, 1072543, typeof(YewLog)),
    307.             };
    308.  
    309.             veins = new HarvestVein[]
    310.             {
    311.             new HarvestVein(05.0, 0.5, res[3], res[0]), // Yew
    312.             };
    313.  
    314.             yewlumber.BonusResources = new BonusHarvestResource[]
    315.                 {
    316.                     new BonusHarvestResource(0, 83.9, null, null), //Nothing
    317.                     new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
    318.                     new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
    319.                     new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
    320.                     new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
    321.                     new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
    322.                 };
    323.  
    324.             yewlumber.Resources = res;
    325.             yewlumber.Veins = veins;
    326.  
    327.             this.Definitions.Add(yewlumber);
    328.             #endregion
    329.  
    330.             #region HeartwoodLumberjacking
    331.             HarvestDefinition heartwoodlumber = m_Heartwood = new HarvestDefinition();
    332.  
    333.             // Resource banks are every 4x3 tiles
    334.             heartwoodlumber.BankWidth = 4;
    335.             heartwoodlumber.BankHeight = 3;
    336.  
    337.             // Every bank holds from 20 to 45 logs
    338.             heartwoodlumber.MinTotal = 20;
    339.             heartwoodlumber.MaxTotal = 45;
    340.  
    341.             // A resource bank will respawn its content every 20 to 30 minutes
    342.             heartwoodlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
    343.             heartwoodlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
    344.  
    345.             // Skill checking is done on the Lumberjacking skill
    346.             heartwoodlumber.Skill = SkillName.Lumberjacking;
    347.  
    348.             // Set the list of harvestable tiles
    349.             heartwoodlumber.Tiles = m_HeartwoodTree;
    350.  
    351.             // Players must be within 2 tiles to harvest
    352.             heartwoodlumber.MaxRange = 2;
    353.  
    354.             // Ten logs per harvest action
    355.             heartwoodlumber.ConsumedPerHarvest = 10;
    356.             heartwoodlumber.ConsumedPerFeluccaHarvest = 10;//20
    357.  
    358.             // The chopping effect
    359.             heartwoodlumber.EffectActions = new int[] { 13 };
    360.             heartwoodlumber.EffectSounds = new int[] { 0x13E };
    361.             heartwoodlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
    362.             heartwoodlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
    363.             heartwoodlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
    364.  
    365.             heartwoodlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
    366.             heartwoodlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
    367.             heartwoodlumber.OutOfRangeMessage = 500446; // That is too far away.
    368.             heartwoodlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
    369.             heartwoodlumber.ToolBrokeMessage = 500499; // You broke your axe.
    370.  
    371.             res = new HarvestResource[]
    372.                 {
    373.             new HarvestResource(100.0, 60.0, 140.0, 1072544, typeof(HeartwoodLog)),
    374.             };
    375.  
    376.             veins = new HarvestVein[]
    377.             {
    378.             new HarvestVein(03.0, 0.5, res[4], res[0]), // Heartwood
    379.             };
    380.  
    381.             heartwoodlumber.BonusResources = new BonusHarvestResource[]
    382.                 {
    383.                     new BonusHarvestResource(0, 83.9, null, null), //Nothing
    384.                     new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
    385.                     new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
    386.                     new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
    387.                     new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
    388.                     new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
    389.                 };
    390.  
    391.             heartwoodlumber.Resources = res;
    392.             heartwoodlumber.Veins = veins;
    393.  
    394.             this.Definitions.Add(heartwoodlumber);
    395.             #endregion
    396.  
    397.             #region BloodwoodLumberjacking
    398.             HarvestDefinition bloodwoodlumber = m_Bloodwood = new HarvestDefinition();
    399.  
    400.             // Resource banks are every 4x3 tiles
    401.             bloodwoodlumber.BankWidth = 4;
    402.             bloodwoodlumber.BankHeight = 3;
    403.  
    404.             // Every bank holds from 20 to 45 logs
    405.             bloodwoodlumber.MinTotal = 20;
    406.             bloodwoodlumber.MaxTotal = 45;
    407.  
    408.             // A resource bank will respawn its content every 20 to 30 minutes
    409.             bloodwoodlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
    410.             bloodwoodlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
    411.  
    412.             // Skill checking is done on the Lumberjacking skill
    413.             bloodwoodlumber.Skill = SkillName.Lumberjacking;
    414.  
    415.             // Set the list of harvestable tiles
    416.             bloodwoodlumber.Tiles = m_BloodwoodTree;
    417.  
    418.             // Players must be within 2 tiles to harvest
    419.             bloodwoodlumber.MaxRange = 2;
    420.  
    421.             // Ten logs per harvest action
    422.             bloodwoodlumber.ConsumedPerHarvest = 10;
    423.             bloodwoodlumber.ConsumedPerFeluccaHarvest = 10;//20
    424.  
    425.             // The chopping effect
    426.             bloodwoodlumber.EffectActions = new int[] { 13 };
    427.             bloodwoodlumber.EffectSounds = new int[] { 0x13E };
    428.             bloodwoodlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
    429.             bloodwoodlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
    430.             bloodwoodlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
    431.  
    432.             bloodwoodlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
    433.             bloodwoodlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
    434.             bloodwoodlumber.OutOfRangeMessage = 500446; // That is too far away.
    435.             bloodwoodlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
    436.             bloodwoodlumber.ToolBrokeMessage = 500499; // You broke your axe.
    437.  
    438.             res = new HarvestResource[]
    439.                 {
    440.             new HarvestResource(100.0, 60.0, 140.0, 1072545, typeof(BloodwoodLog)),
    441.             };
    442.  
    443.             veins = new HarvestVein[]
    444.             {
    445.             new HarvestVein(02.0, 0.5, res[5], res[0]), // Bloodwood
    446.             };
    447.  
    448.             bloodwoodlumber.BonusResources = new BonusHarvestResource[]
    449.                 {
    450.                     new BonusHarvestResource(0, 83.9, null, null), //Nothing
    451.                     new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
    452.                     new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
    453.                     new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
    454.                     new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
    455.                     new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
    456.                 };
    457.  
    458.             bloodwoodlumber.Resources = res;
    459.             bloodwoodlumber.Veins = veins;
    460.  
    461.             this.Definitions.Add(bloodwoodlumber);
    462.             #endregion
    463.  
    464.             #region FrostwoodLumberjacking
    465.             HarvestDefinition frostwoodlumber = m_Frostwood = new HarvestDefinition();
    466.  
    467.             // Resource banks are every 4x3 tiles
    468.             frostwoodlumber.BankWidth = 4;
    469.             frostwoodlumber.BankHeight = 3;
    470.  
    471.             // Every bank holds from 20 to 45 logs
    472.             frostwoodlumber.MinTotal = 20;
    473.             frostwoodlumber.MaxTotal = 45;
    474.  
    475.             // A resource bank will respawn its content every 20 to 30 minutes
    476.             frostwoodlumber.MinRespawn = TimeSpan.FromMinutes(20.0);
    477.             frostwoodlumber.MaxRespawn = TimeSpan.FromMinutes(30.0);
    478.  
    479.             // Skill checking is done on the Lumberjacking skill
    480.             frostwoodlumber.Skill = SkillName.Lumberjacking;
    481.  
    482.             // Set the list of harvestable tiles
    483.             frostwoodlumber.Tiles = m_FrostwoodTree;
    484.  
    485.             // Players must be within 2 tiles to harvest
    486.             frostwoodlumber.MaxRange = 2;
    487.  
    488.             // Ten logs per harvest action
    489.             frostwoodlumber.ConsumedPerHarvest = 10;
    490.             frostwoodlumber.ConsumedPerFeluccaHarvest = 10;//20
    491.  
    492.             // The chopping effect
    493.             frostwoodlumber.EffectActions = new int[] { 13 };
    494.             frostwoodlumber.EffectSounds = new int[] { 0x13E };
    495.             frostwoodlumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
    496.             frostwoodlumber.EffectDelay = TimeSpan.FromSeconds(1.6);
    497.             frostwoodlumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);
    498.  
    499.             frostwoodlumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
    500.             frostwoodlumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
    501.             frostwoodlumber.OutOfRangeMessage = 500446; // That is too far away.
    502.             frostwoodlumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
    503.             frostwoodlumber.ToolBrokeMessage = 500499; // You broke your axe.
    504.  
    505.             res = new HarvestResource[]
    506.                 {
    507.             new HarvestResource(100.0, 60.0, 140.0, 1072546, typeof(FrostwoodLog)),
    508.             };
    509.  
    510.             veins = new HarvestVein[]
    511.             {
    512.             new HarvestVein(01.0, 0.5, res[6], res[0]), // Frostwood
    513.             };
    514.  
    515.             frostwoodlumber.BonusResources = new BonusHarvestResource[]
    516.                 {
    517.                     new BonusHarvestResource(0, 83.9, null, null), //Nothing
    518.                     new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
    519.                     new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
    520.                     new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
    521.                     new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
    522.                     new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
    523.                 };
    524.  
    525.             frostwoodlumber.Resources = res;
    526.             frostwoodlumber.Veins = veins;
    527.  
    528.             this.Definitions.Add(frostwoodlumber);
    529.             #endregion
    530.             }
    531.  
    532.             #region added
    533.         public override Type GetResourceType( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource )
    534.         {
    535.             return base.GetResourceType( from, tool, def, map, loc, resource );
    536.         }
    537.            #endregion added
    538.  
    539.         public override bool CheckHarvest( Mobile from, Item tool )
    540.         {
    541.             if ( !base.CheckHarvest( from, tool ) )
    542.                 return false;
    543.  
    544.             if ( tool.Parent != from )
    545.             {
    546.                 from.SendLocalizedMessage(500487); // The axe must be equipped for any serious wood chopping.
    547.                 return false;
    548.             }
    549.  
    550.             return true;
    551.         }
    552.  
    553.         public override bool CheckHarvest(Mobile from, Item tool, HarvestDefinition def, object toHarvest)
    554.         {
    555.             if (!base.CheckHarvest(from, tool, def, toHarvest))
    556.                 return false;
    557.  
    558.             if (tool.Parent != from)
    559.             {
    560.                 from.SendLocalizedMessage(500487); // The axe must be equipped for any serious wood chopping.
    561.                 return false;
    562.             }
    563.  
    564.             return true;
    565.         }
    566.  
    567.         public override void OnBadHarvestTarget(Mobile from, Item tool, object toHarvest)
    568.         {
    569.             if (toHarvest is Mobile)
    570.                 ((Mobile)toHarvest).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500450, from.NetState); // You can only skin dead creatures.
    571.             else if (toHarvest is Item)
    572.                 ((Item)toHarvest).LabelTo(from, 500464); // Use this on corpses to carve away meat and hide
    573.             else if (toHarvest is Targeting.StaticTarget || toHarvest is Targeting.LandTarget)
    574.                 from.SendLocalizedMessage(500489); // You can't use an axe on that.
    575.             else
    576.                 from.SendLocalizedMessage(1005213); // You can't do that
    577.         }
    578.  
    579.         public override void OnHarvestStarted(Mobile from, Item tool, HarvestDefinition def, object toHarvest)
    580.         {
    581.             base.OnHarvestStarted(from, tool, def, toHarvest);
    582.  
    583.             if (Core.ML)
    584.                 from.RevealingAction();
    585.         }
    586.  
    587.         #region Plain list
    588.         private static readonly int[] m_PlainTree = new int[]
    589.         {
    590.             0x0C9E, 0x0CC9, 0x0CCA, 0x0CCB, 0x0CCC, 0x0CCD,
    591.             0x0CD0, 0x0CD3, 0x0CD6, 0x0CD8, 0x0CE0, 0x0CE3,
    592.             0x0CE6, 0x0CF8, 0x0CFB, 0x0CFE, 0x0D01, 0x0D41,
    593.             0x0D42, 0x0D43, 0x0D44, 0x0D57, 0x0D58, 0x0D59,
    594.             0x0D5A, 0x0D5B, 0x0D6E, 0x0D6F, 0x0D70, 0x0D71,
    595.             0x0D72, 0x0D84, 0x0D85, 0x0D86, 0x0D94, 0x0D98,
    596.             0x0D9C, 0x0DA0, 0x0Da4, 0x0DA8
    597.         };
    598.         #endregion
    599.  
    600.         #region Oak list
    601.         private static readonly int[] m_OakTree = new int[]
    602.         {
    603.             0x0CDA, 0x0CDD, 0x224C, 0x224D
    604.         };
    605.         #endregion
    606.  
    607.         #region Ash list
    608.         private static readonly int[] m_AshTree = new int[]
    609.         {
    610.             0x0000
    611.         };
    612.         #endregion
    613.  
    614.         #region Yew list
    615.         private static readonly int[] m_YewTree = new int[]
    616.         {
    617.             0x12B5, 0x12B6, 0x12B7, 0x12B8, 0x12B9, 0x12BA,
    618.             0x12BB, 0x12BC, 0x12BD
    619.         };
    620.         #endregion
    621.  
    622.         #region Bloodwood list
    623.         private static readonly int[] m_BloodwoodTree = new int[]
    624.         {
    625.             0x0000
    626.         };
    627.         #endregion
    628.  
    629.         #region Heartwood list
    630.         private static readonly int[] m_HeartwoodTree = new int[]
    631.         {
    632.             0x0000
    633.         };
    634.         #endregion
    635.  
    636.         #region Frostwood list
    637.         private static readonly int[] m_FrostwoodTree = new int[]
    638.         {
    639.             0x0000
    640.         };
    641.         #endregion
    642.  
    643. }
    644. }
    The snag is that I get this error.
    Code (C#):
    1. Errors:
    2. + Targets/BladedItemTarget.cs:
    3.     CS1061: Line 76: 'Server.Engines.Harvest.Lumberjacking' does not contain a d
    4. efinition for 'Definition' and no extension method 'Definition' accepting a firs
    5. t argument of type 'Server.Engines.Harvest.Lumberjacking' could be found (are yo
    6. u missing a using directive or an assembly reference?)
    Which makes sense because I removed/changed public HarvestDefinition Definition.
    I just don't know how to fix it.

    So then over in BladedItemTarget.cs This is the line.
    Code (C#):
    1. HarvestDefinition def = Lumberjacking.System.Definition;
     
    #2 Hank, Nov 22, 2013
    Last edited: Jan 10, 2014
  3. Dian
    Offline

    Dian Active Member

    Joined:
    Nov 7, 2013
    Messages:
    628
    Likes Received:
    58
    I did what you are trying to do years ago.. I think I left it out at some point while updating to a newer version of RunUO.. but I will see if I can find it, and what changes I made to achieve this. Its been a long time ago, so I cant be certain how in depth I went, but I do know I made trees give the corresponding wood resource at least.

    I'll let you know, but dont stop progress just waiting on me.
     
  4. Hank
    Offline

    Hank Active Member

    Joined:
    Nov 14, 2013
    Messages:
    972
    Likes Received:
    152
    I know that doing it this 'easier' way is not very "pro" code wise. If it turns out I have to make multiple edits to multiple distro files I will find a better way to do it that's for sure.
    I never stop working on a project until it's complete or I am dead tired. Thanks for your time Dian.

    Edit:
    I'm thinking about making my own custom harvest system. i'm sick of look at the distro's ugly heap of meh! Then i could do anything i wanted.
     
    #4 Hank, Nov 22, 2013
    Last edited: Nov 22, 2013
  5. Insanity
    Offline

    Insanity Active Member

    Joined:
    Mar 2, 2013
    Messages:
    276
    Likes Received:
    61
    Take a look at Dougan's attempt at a rewrite. Good place to start. Can find it by checking out an old revision that had it.
     
  6. GendR
    Offline

    GendR New Member

    Joined:
    Sep 13, 2016
    Messages:
    23
    Likes Received:
    1
    Hi, I'm currently trying to update my Lumberjack and Mining scripts and am curious as to what you mean by "add 0x3FFF to each hex value"? I noticed when adding "0x0CD6" it causes my server not to initiate. I'm assuming it has something to do with that "0x3FFF" but am confused =/
     
  7. demented
    Offline

    demented Active Member

    Joined:
    Jun 5, 2014
    Messages:
    326
    Likes Received:
    31
    Code (C#):
    1.  
    2.         #region Tile lists
    3.         private static readonly int[] m_TreeTiles = new int[]
    4.         {
    5.             0x4CCA, 0x4CCB, 0x4CCC, 0x4CCD, 0x4CD0, 0x4CD3, 0x4CD6, 0x4CD8,
    6.             0x4CDA, 0x4CDD, 0x4CE0, 0x4CE3, 0x4CE6, 0x4CF8, 0x4CFB, 0x4CFE,
    7.             0x4D01, 0x4D41, 0x4D42, 0x4D43, 0x4D44, 0x4D57, 0x4D58, 0x4D59,
    8.             0x4D5A, 0x4D5B, 0x4D6E, 0x4D6F, 0x4D70, 0x4D71, 0x4D72, 0x4D84,
    9.             0x4D85, 0x4D86, 0x52B5, 0x52B6, 0x52B7, 0x52B8, 0x52B9, 0x52BA,
    10.             0x52BB, 0x52BC, 0x52BD,
    11.             0x4CCE, 0x4CCF, 0x4CD1, 0x4CD2, 0x4CD4, 0x4CD5, 0x4CD7, 0x4CD9,
    12.             0x4CDB, 0x4CDC, 0x4CDE, 0x4CDF, 0x4CE1, 0x4CE2, 0x4CE4, 0x4CE5,
    13.             0x4CE7, 0x4CE8, 0x4CF9, 0x4CFA, 0x4CFC, 0x4CFD, 0x4CFF, 0x4D00,
    14.             0x4D02, 0x4D03, 0x4D45, 0x4D46, 0x4D47, 0x4D48, 0x4D49, 0x4D4A,
    15.             0x4D4B, 0x4D4C, 0x4D4D, 0x4D4E, 0x4D4F, 0x4D50, 0x4D51, 0x4D52,
    16.             0x4D53, 0x4D5C, 0x4D5D, 0x4D5E, 0x4D5F, 0x4D60, 0x4D61, 0x4D62,
    17.             0x4D63, 0x4D64, 0x4D65, 0x4D66, 0x4D67, 0x4D68, 0x4D69, 0x4D73,
    18.             0x4D74, 0x4D75, 0x4D76, 0x4D77, 0x4D78, 0x4D79, 0x4D7A, 0x4D7B,
    19.             0x4D7C, 0x4D7D, 0x4D7E, 0x4D7F, 0x4D87, 0x4D88, 0x4D89, 0x4D8A,
    20.             0x4D8B, 0x4D8C, 0x4D8D, 0x4D8E, 0x4D8F, 0x4D90, 0x4D95, 0x4D96,
    21.             0x4D97, 0x4D99, 0x4D9A, 0x4D9B, 0x4D9D, 0x4D9E, 0x4D9F, 0x4DA1,
    22.             0x4DA2, 0x4DA3, 0x4DA5, 0x4DA6, 0x4DA7, 0x4DA9, 0x4DAA, 0x4DAB,
    23.             0x52BE, 0x52BF, 0x52C0, 0x52C1, 0x52C2, 0x52C3, 0x52C4, 0x52C5,
    24.             0x52C6, 0x52C7
    25.         };
    26.         #endregion
    27.     }
    28.  
     
  8. GendR
    Offline

    GendR New Member

    Joined:
    Sep 13, 2016
    Messages:
    23
    Likes Received:
    1
    still tells me I can't use an axe on that for any tree I target... wondering if it doesn't have something to do with my custom map?

    so I redownloaded and setup ServUO and got a different client. Still cannot use any axe to chop a tree?
     
    #8 GendR, Feb 3, 2017
    Last edited: Feb 3, 2017
Similar Threads: Specific Woods
Forum Title Date
Script Support Adding specific properties to custom crafting resources Jul 29, 2017
ServUO Discussion Spawning Specific Facets or Regions Sep 12, 2016
Script Support Command to delete all of a specific item? Jul 15, 2016
Archived Bug Reports All players start with 720 skill cap. Should not be veteran age specific anymore. Feb 10, 2016
Script Support Added a item with specific properties inside a bad? May 23, 2015
Script Support Question about referencing a specific faction Apr 22, 2015
Tutorials RunUO/ServUO specific coding documentation Apr 11, 2015