So I am trying to make dungeon coins which will be obtained from killing certain mobs and looting certain chests in dungeons. I decided to use a sliths eye as the base item. I basically just copied the slithseye.cs file and changed a couple things and renamed it. I worked kind of..

My problem is when a stack of dungeon coins are spawned/looted they appear as "a slith's eye"
But if the dungeon coins are added 1 at a time they appear as "dungeon coins"

How can I make the stack be dungeon coins instead of "a slith's eye"?

Code:
using System;

namespace Server.Items
{
    public class DungeonCoins : Item
    {
        [Constructable]
        public DungeonCoins()
            : this(1)
           
        {
            Name = "Dungeon Coins";
            Hue = 37;
            LootType = LootType.Blessed;
        }

        [Constructable]
        public DungeonCoins(int amount)
            : base(0x5749)
        {
            this.Stackable = true;
            this.Amount = amount;
        }

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

        public override int LabelNumber
        {
            get
            {
                return 1112396;
            }
        }// DungeonCoins
        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();
        }
    }
}
 
It's because when the amount constructor is called, you do not give a name definition to the coins. Shift "Name" to the lower constructor like so.

Code:
       public DungeonCoins()
           : this(1)
          
       {
       }

       [Constructable]
       public DungeonCoins(int amount)
           : base(0x5749)
       {
            Name = "Dungeon Coins";
           this.Stackable = true;
           this.Amount = amount;
            Hue = 37;
            LootType = LootType.Blessed;
       }
 
Or...... Remove this...
Code:
30.        public override int LabelNumber
31.        {
32.            get
33.            {
34.                return 1112396; 
35.            }
36.        }// DungeonCoins
The LabelNumber is giving the name of SlithsEye (the CliLoc). Removing that should do the trick.
 
Or...... Remove this...
Code:
30.        public override int LabelNumber
31.        {
32.            get
33.            {
34.                return 1112396;
35.            }
36.        }// DungeonCoins
The LabelNumber is giving the name of SlithsEye (the CliLoc). Removing that should do the trick.
That should be removed too as it's wrong, but removing that alone won't be enough to fix the problem, because the name "dungeon coins" would never be assigned.
 
Tbh the labelnumber doesnt matter in this case as the Name will be set and therefor the cliloc values doesn't get read anyway :p.
But its useless regardless (in this case) therefor its good to remove it.

Jacks part was right and should be enough ;)
 
Back