RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Cliloc localized item names problem

Freyd

Sorceror
I realized that items names are set to null and they are showed as a cliloc localized names (for example short pants is 1025422 which is obviously "short pants"). I want to get item name, using a command from that. I prepared a short script:

Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
using Server.Network;
using Server.Commands;

namespace Server.Misc
{
    public class CheckCommand
    {
        public static void Initialize()
        {
            CommandSystem.Register("Check", AccessLevel.Player, new CommandEventHandler(Check_OnCommand));
        }

        [Usage("Check")]
        [Description("Check")]
        public static void Check_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;
            e.Mobile.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(Check_OnTarget));
            e.Mobile.SendMessage("Target");
        }
 
        public static void Check_OnTarget(Mobile from, object targeted)
        {
            if (targeted is BaseClothing)
            {
                BaseClothing targ = (BaseClothing)targeted;
                from.SendMessage("{0}", targ.GetNameString());
            }
        }
    }
}
GetNameString() in BaseClothing is a most usefull code i found so far. But message show it as a number, not as a name. Is there any chance to show it as a name? Or maybe there is so other way to get and show as a message or set it as a string from cliloc?
 

Talow

Sorceror
If you are trying to learn what cliloc are then you can use uofiddler to read them, it has the number and the text that will go with it. If the true goal is to do that in UO I'm sorry I can't help today.
 
Top