ServUO Version
Publish 57
Ultima Expansion
Endless Journey
I was wondering where or how you could add more spawns when using the gargoyle's tools specifically the pickaxe when mining. I have some other creatures I would love to throw into the mix but not sure how to do so, I know in mining.cs there is a location where you can see the elementals but is it as easy as adding to the end of those lines?
 
This is found in mining.cs under OnHarvestFinished function. In the GargoylesPickaxe Check.
So yes. You just need to modify spawn function.
 
I have been able to change it and get them to spawn but the way I changed it makes it to where normal elementals won't spawn I was just using it to test my theory of where to edit it. I am using OWLTR so I changed this line:
C#:
int i_Level = CraftResources.GetIndex(CraftResources.GetFromType(type)) + 1;
to
C#:
int i_Level = CraftResources.GetIndex(CraftResources.GetFromType(type)) + 15;
Which corresponds to my Elementals.cs, so it will spawn the other creatures now but not normal does that make sense?
Also further down there is this line:
C#:
spawned = Activator.CreateInstance(res.Types[2], new object[] { 25 }) as BaseCreature; ;
Which causes the creature to spawn with 25 "ore" in it's pack, I also need to change that to a lower number but only for the additional spawns. It is also spawning an Unknown Item in the pack which I can't find where it's coming from.

Man I hope that all makes sense lol..


Here is an example of what spawns in their pack when they do spawn, if you props the item it says "GraveDigger" if I remove that script and props it again it tells me it's too far away. Super weird, is that normal?
1645924881985.png
 
Last edited:
Fixed the random spawn between elemental and granite ones, fixed that.
C#:
                            int number = Utility.RandomList<int>(1, 15);
                            int i_Level = CraftResources.GetIndex(CraftResources.GetFromType(type)) + number;
Okay figured out where to edit the drops, fixed that.
Changed the drop rates in Elemental.cs in the OWLTR folder.

The unknown item was due to an error in the code for the runic spawns, fixed that.
C#:
                case 15: { PackItem(new Granite(5)); break; }
                case 16: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.DullCopper, 5)); else PackItem(new RunicHammer(CraftResource.DullCopper, 5)); PackItem(new DullCopperGranite(5)); break; }
                case 17: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.ShadowIron, 5)); else PackItem(new RunicHammer(CraftResource.ShadowIron, 5)); PackItem(new ShadowIronGranite(5)); break; }
                case 18: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Copper, 5)); else PackItem(new RunicHammer(CraftResource.Copper, 5)); PackItem(new CopperGranite(5)); break; }
                case 19: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Bronze, 5)); else PackItem(new RunicHammer(CraftResource.Bronze, 5)); PackItem(new BronzeGranite(5)); break; }
                case 20: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Gold, 5)); else PackItem(new RunicHammer(CraftResource.Gold, 5)); PackItem(new GoldGranite(5)); break; break; }
                case 21: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Agapite, 5)); else PackItem(new RunicHammer(CraftResource.Agapite, 5)); PackItem(new AgapiteGranite(5)); break; }
                case 22: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Verite, 5)); else PackItem(new RunicHammer(CraftResource.Verite, 5)); PackItem(new VeriteGranite(5)); break; }
                case 23: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Valorite, 5)); else PackItem(new RunicHammer(CraftResource.Valorite, 5)); PackItem(new ValoriteGranite(5)); break; }
                case 24: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Blaze, 5)); else PackItem(new RunicHammer(CraftResource.Blaze, 5)); PackItem(new BlazeGranite(5)); break; }
                case 25: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Ice, 5)); else PackItem(new RunicHammer(CraftResource.Ice, 5)); PackItem(new IceGranite(5)); break; }
                case 26: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Toxic, 5)); else PackItem(new RunicHammer(CraftResource.Toxic, 5)); PackItem(new ToxicGranite(5)); break; }
                case 27: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Electrum, 5)); else PackItem(new RunicHammer(CraftResource.Electrum, 5)); PackItem(new ElectrumGranite(5)); break; }
                case 28: { if (b_Tinker == true) PackItem(new RunicTinkerTools(CraftResource.Platinum, 5)); else PackItem(new RunicHammer(CraftResource.Platinum, 5)); PackItem(new PlatinumGranite(5)); break; }

Last unknown item is the custom granite so working on that one now.

Fixed the final issue with unknown granite by changing this in Granite.cs:
C#:
    public class PlatinumGranite : BaseGranite
    {
        [Constructable]
        public PlatinumGranite()
            : base(CraftResource.Platinum)
        {
            Name = "Platinum Granite"; //daat99 OWLTR - granite name
        }

        public PlatinumGranite(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
to this:
C#:
    public class PlatinumGranite : BaseGranite
    {
        [Constructable]
        public PlatinumGranite()
            : this(1)
        {
        }

        [Constructable]
        public PlatinumGranite(int amount)
            : base(CraftResource.Platinum)
        {
            Name = "Platinum Granite"; //daat99 OWLTR - granite name
            if (Stackable)
                Amount = amount;
            else
                Amount = 1;
        }

        public PlatinumGranite(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
Seems it just needed some alteration to "spawn" correctly. This was done for all 5 custom ores.
 
Last edited:
Back