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:
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?
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());
}
}
}
}