OP
Xeno

Xeno

Member
ServUO Version
Publish 58
Ultima Expansion
Endless Journey
Is there a way to keep mobs from dropping their armor that they wear? Nothing worse than having to dig through the worthless worn armor to see the loot drops.
 
That is all handled in the loot.cs and lootpack.cs : They technically never drop the items they are equipped, it is a lootpack generated on death with random items from the lists!


In the individual mobs you'll see stuff like this below which is using the fore mentioned loot/lootpacks
Code:
        public override void GenerateLoot()
        {
            AddLoot(LootPack.Average);
            AddLoot(LootPack.Meager);
            AddLoot(LootPack.LowScrolls);
            AddLoot(LootPack.MedScrolls);
            AddLoot(LootPack.RandomLootItem(new System.Type[] { typeof(PainSpikeScroll), typeof(PoisonStrikeScroll), typeof(StrangleScroll), typeof(VengefulSpiritScroll) }, 16.0, 1, false, true));
        }
 
I was meaning the armor that the mobs wear. This puts the item on the mob
AddItem(new BoneLegs());:
but I do not want that to drop on the corpse. I just want him to wear it. Many custom mobs have all of their worn items drop in as loot on death making it more difficult to see the actual drops. I don't want those to drop.
 
In the mob constructor use this:
When i kill the mob,his armor disappear.

C#:
PlateChest chest = new PlateChest();
            chest.Hue = 1345;
            chest.Movable = false;
            AddItem( chest );
           
            PlateArms arms = new PlateArms();
            arms.Hue = 1345;
            arms.Movable = false;
            AddItem( arms );
           
            PlateGloves gloves = new PlateGloves();
            gloves.Hue = 1345;
            gloves.Movable = false;
            AddItem( gloves );
           
            PlateGorget gorget = new PlateGorget();
            gorget.Hue = 1345;
            gorget.Movable = false;
            AddItem( gorget );
           
            PlateLegs legs = new PlateLegs();
            legs.Hue = 1345;
            legs.Movable = false;
            AddItem( legs );

            Cloak cloak = new Cloak();
            cloak.Hue = 1175;
            cloak.Movable = false;
            AddItem( cloak );
           
            Katana weapon = new Katana();
            weapon.Movable = false;
            AddItem( weapon );
           
            Lantern lantern = new Lantern();
            lantern.Movable = false;
            lantern.Ignite();
            AddItem( lantern );          
           
            ThighBoots boots = new ThighBoots();
            boots.Movable = false;
            AddItem( boots );
 
To cut down on typing you can just use
C#:
AddItem(new BoneLegs() { Movable = false });

or if you wanted to hue it ect... just put a comma to change whatever else
C#:
AddItem(new BoneLegs() { Movable = false, Hue = 239, ect..... });
 
I was meaning the armor that the mobs wear. This puts the item on the mob
AddItem(new BoneLegs());:
but I do not want that to drop on the corpse. I just want him to wear it. Many custom mobs have all of their worn items drop in as loot on death making it more difficult to see the actual drops. I don't want those to drop.
My bad, I forgot about those, Lemke and Visam have you covered, follow there advice!
 
C#:
private void DropEquipment()
{
    try
    {
        System.Collections.Generic.List<Item> equipment =
            new System.Collections.Generic.List<Item>();

        for(byte i = 0; i < Server.Items.Layer.LastValid; i++)
        {
            Item item = FindItemOnLayer(Layer[i]);
            item == null ? continue : equipment.Add(item);
        }

        foreach(Item item in equipment)
        {
            DropItem(item);
        }
    }
    catch(Exception exception)
    {
        System.Console.WriteLine(Name + " threw (" + exception.ToString() + ") probably because i'm bad w/ iteration");
    }
}
C#:
public override void OnBeforeDeath()
{
    DropEquipment();
    base.OnBeforeDeath();
}
 
Last edited:

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back