Hello there!

I've been messing around with the attachments, since it seems like a great way to put some modification without touching the playermobile.cs .

I tried XmlHue, XmlAddFame, etc. and all of those works.

But XmlTitle don't really work.

I attached the XmlTitle to a player and the Title doesn't change on the paderdoll, same thing with NPCs.

Am I missing something?

ai.imgur.com_8f8kEg0.png
 
Add them using an Xmlspawner, like this:
Code:
orc/Name/Mork/ATTACH/XmlTitle,title,the orc

The construction is like this:
XmlTitle(string name, string title, double expiresin)

ATTACH/XmlTitle,title,Bomber,30
The above means the title would expire in 30 minutes.

The 'name' of the attachment isn't really important unless you plan on adding multiple XmlTitle attachments and you want to keep them separate (in general if you add an attachment with the same type and name as an existing one, then it will replace the existing one).

To use this attachment you need to make the following mod to the AddNameProperties method in Playermobile.cs


Code:
public override void AddNameProperties(ObjectPropertyList list)
        {
            base.AddNameProperties(list);

           XmlTitle.AddTitles(this, list);
        }

and if you want to apply it to creatures, you need to make this mod to the AddNameProperties method in basecreature.cs

Code:
public override void AddNameProperties(ObjectPropertyList list)
        {
            base.AddNameProperties(list);

           XmlTitle.AddTitles(this, list);

            if (Controlled && Commandable)
            {
                if (Summoned)
                    list.Add(1049646); // (summoned)
                else if (IsBonded)	//Intentional difference (showing ONLY bonded when bonded instead of bonded & tame)
                    list.Add(1049608); // (bonded)
                else
                    list.Add(502006); // (tame)
            }
        }
 
xmltitleproblem2.png Is not working for me
im pretty sure i installed it the right way, what can be causing the issue?

Im using


** XmlSpawner2
** version 3.24
** updated 2/11/08


Code:
 public override void AddNameProperties(ObjectPropertyList list)
        {
            base.AddNameProperties(list);

             //XmlTitle//////
         XmlTitle.AddTitles(this, list);
            /////////////////
            if (Core.ML)
            {
                if (DisplayWeight)
                    list.Add(TotalWeight == 1 ? 1072788 : 1072789, TotalWeight.ToString()); // Weight: ~1_WEIGHT~ stones

                if (m_ControlOrder == OrderType.Guard)
                    list.Add(1080078); // guarding
            }
               
            if (Summoned && !IsAnimatedDead && !IsNecroFamiliar && !(this is Clone))
                list.Add(1049646); // (summoned)
            else if (Controlled && Commandable)
            {
                if (IsBonded)    //Intentional difference (showing ONLY bonded when bonded instead of bonded & tame)
                    list.Add(1049608); // (bonded)
                else
                    list.Add(502006); // (tame)
            }
        }
 
I don't know what @TAChuck had to fix to get it working, but I'm guessing it's likely the same thing you are experiencing @sahisahi

Just for the sake of argument, can you try this:
Code:
 Orc/Name/Mork/Title/the Orc

I want to make sure titles are working for you to begin with ;)
 
Yes Titles work , the xmltitle attach doesnt.

My xmlspawner folder doesnt had the xmltitle addon, i downloaded it from somewhere

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

namespace Server.Engines.XmlSpawner2
{
    public class XmlTitle : XmlAttachment
    {
        private string m_Title = null;// title string

        // a serial constructor is REQUIRED
        public XmlTitle(ASerial serial)
            : base(serial)
        {
        }

        [Attachable]
        public XmlTitle(string name)
        {
            this.Name = name;
            this.Title = String.Empty;
        }

        [Attachable]
        public XmlTitle(string name, string title)
        {
            this.Name = name;
            this.Title = title;
        }

        [Attachable]
        public XmlTitle(string name, string title, double expiresin)
        {
            this.Name = name;
            this.Title = title;
            this.Expiration = TimeSpan.FromMinutes(expiresin);
        }

        [CommandProperty(AccessLevel.GameMaster)]
        public string Title
        {
            get
            {
                return this.m_Title;
            }
            set
            {
                this.m_Title = value;
                // change the title
                if (this.AttachedTo is Mobile)
                {
                    ((Mobile)this.AttachedTo).InvalidateProperties();
                }
                if (this.AttachedTo is Item)
                {
                    ((Item)this.AttachedTo).InvalidateProperties();
                }
            }
        }
        public static void AddTitles(object o, ObjectPropertyList list)
        {
            ArrayList alist = XmlAttach.FindAttachments(o, typeof(XmlTitle));

            if (alist != null && alist.Count > 0)
            {
                string titlestring = null;
                bool hastitle = false;
                foreach (XmlTitle t in alist)
                {
                    if (t == null || t.Deleted)
                        continue;

                    if (hastitle)
                    {
                        titlestring += '\n';
                    }
                    titlestring += Utility.FixHtml(t.Title);
                    hastitle = true;
                }
                if (hastitle)
                    list.Add(1070722, "<BASEFONT COLOR=#E6CC80>{0}<BASEFONT COLOR=#FFFFFF>", titlestring);
            }
        }

        // These are the various ways in which the message attachment can be constructed. 
        // These can be called via the [addatt interface, via scripts, via the spawner ATTACH keyword.
        // Other overloads could be defined to handle other types of arguments
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0);
            // version 0
            writer.Write((string)this.m_Title);
        }

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

            int version = reader.ReadInt();
            // version 0
            this.m_Title = reader.ReadString();
        }

        public override void OnDelete()
        {
            base.OnDelete();

            // remove the title when deleted
            if (this.AttachedTo is Mobile)
            {
                ((Mobile)this.AttachedTo).InvalidateProperties();
            }
            if (this.AttachedTo is Item)
            {
                ((Item)this.AttachedTo).InvalidateProperties();
            }
        }

        public override void OnAttach()
        {
            base.OnAttach();

            // apply the title immediately when attached
            if (this.AttachedTo is Mobile)
            {
                ((Mobile)this.AttachedTo).InvalidateProperties();
            }
            if (this.AttachedTo is Item)
            {
                ((Item)this.AttachedTo).InvalidateProperties();
            }
        }

       /* public override string OnIdentify(Mobile from)
        {
            if (from == null || from.AccessLevel > AccessLevel.Player())
                return null;

            if (this.Expiration > TimeSpan.Zero)
            {
                return String.Format("{2}: Title {0} expires in {1} mins", this.Title, this.Expiration.TotalMinutes, this.Name);
            }
            else
            {
                return String.Format("{1}: Title {0}", this.Title, this.Name);
            }
        }*/
    }
 
Last edited:
The code that is commented out needs to be uncommented. Remove the /* and */ then your XmlTitles should be working fine.
 
xmltitlewut.png Not working, that uncommented method is just to use Item Identification...

What handles the onsingleclick method? might be there the problem, because the attach's get added as u can see in my pics, i added ''Destroyer'' title to a kryss and used Item ID on it
 
Last edited:
That was the only change between your XmlTitle.cs and mine. You might want to go back over the Xmlspawner installation notes (double check the Optional steps) to make sure you didn't miss an edit.
 
Ive made every step correctly, im sure, the step 11, is related to my issue, check my BaseWeapon.cs:

Down theres something uncommented, maybe thats affecting it?


STEP 11: (recommended but not required)
To allow attachment properties on weapons/armor to be automatically displayed in the properties list on mouseover/click, these changes must be made to BaseWeapon.cs (Scripts/Items/Weapons/BaseWeapon.cs), BaseArmor.cs (Scripts/Items/Armor/BaseArmor.cs) and BaseJewel.cs (Scripts/Items/Jewels/BaseJewel.cs) described below. (note, you dont have to make this mod if you dont want to, the spawner and other items will work just fine without it, players just wont automatically see attachment properties on items with attachments).


at the end of the GetProperties method around line 2823 of BaseWeapon.cs change

CODE
if ( m_Hits > 0 && m_MaxHits > 0 )
list.Add( 1060639, "{0}\t{1}", m_Hits, m_MaxHits ); // durability ~1_val~ / ~2_val~


to

CODE
if ( m_Hits > 0 && m_MaxHits > 0 )
list.Add( 1060639, "{0}\t{1}", m_Hits, m_MaxHits ); // durability ~1_val~ / ~2_val~

// mod to display attachment properties
Server.Engines.XmlSpawner2.XmlAttach.AddAttachmentProperties(this, list);



at the end of the GetProperties method around line 1488 of BaseArmor.cs change

CODE
if ( m_HitPoints > 0 && m_MaxHitPoints > 0 )
list.Add( 1060639, "{0}\t{1}", m_HitPoints, m_MaxHitPoints ); // durability ~1_val~ / ~2_val~


to

CODE
if ( m_HitPoints > 0 && m_MaxHitPoints > 0 )
list.Add( 1060639, "{0}\t{1}", m_HitPoints, m_MaxHitPoints ); // durability ~1_val~ / ~2_val~

// mod to display attachment properties
Server.Engines.XmlSpawner2.XmlAttach.AddAttachmentProperties(this, list);


at the end of the GetProperties method around line 226 of BaseJewel.cs change


CODE
base.AddResistanceProperties( list );

to

CODE
base.AddResistanceProperties( list );

// mod to display attachment properties
Server.Engines.XmlSpawner2.XmlAttach.AddAttachmentProperties(this, list);


Code:
public override void GetProperties( ObjectPropertyList list )
        {
            base.GetProperties( list );
///////////////////////
            XmlTitle.AddTitles(this, list);
    /////////        ///////
            if ( m_Crafter != null )
                list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~

            #region Factions
            if ( m_FactionState != null )
                list.Add( 1041350 ); // faction item
            #endregion

            if ( m_AosSkillBonuses != null )
                m_AosSkillBonuses.GetProperties( list );

            if ( m_Quality == WeaponQuality.Exceptional )
                list.Add( 1060636 ); // exceptional

            if( RequiredRace == Race.Elf )
                list.Add( 1075086 ); // Elves Only

            if ( ArtifactRarity > 0 )
                list.Add( 1061078, ArtifactRarity.ToString() ); // artifact rarity ~1_val~

            if ( this is IUsesRemaining && ((IUsesRemaining)this).ShowUsesRemaining )
                list.Add( 1060584, ((IUsesRemaining)this).UsesRemaining.ToString() ); // uses remaining: ~1_val~

            if ( m_Poison != null && m_PoisonCharges > 0 )
                list.Add( 1062412 + m_Poison.Level, m_PoisonCharges.ToString() );

            if( m_Slayer != SlayerName.None )
            {
                SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer );
                if( entry != null )
                    list.Add( entry.Title );
            }

            if( m_Slayer2 != SlayerName.None )
            {
                SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer2 );
                if( entry != null )
                    list.Add( entry.Title );
            }

            base.AddResistanceProperties( list );

            int prop;

            if (Core.ML && this is BaseRanged && ((BaseRanged)this).Balanced)
                list.Add(1072792); // Balanced

            //if ( (prop = m_AosWeaponAttributes.UseBestSkill) != 0 )
            //    list.Add( 1060400 ); // use best weapon skill

            if ( (prop = (GetDamageBonus() + m_AosAttributes.WeaponDamage)) != 0 )
                list.Add( 1060401, prop.ToString() ); // damage increase ~1_val~%

            if ( (prop = m_AosAttributes.DefendChance) != 0 )
                list.Add( 1060408, prop.ToString() ); // defense chance increase ~1_val~%

            if ( (prop = m_AosAttributes.EnhancePotions) != 0 )
                list.Add( 1060411, prop.ToString() ); // enhance potions ~1_val~%

            if ( (prop = m_AosAttributes.CastRecovery) != 0 )
                list.Add( 1060412, prop.ToString() ); // faster cast recovery ~1_val~

            if ( (prop = m_AosAttributes.CastSpeed) != 0 )
                list.Add( 1060413, prop.ToString() ); // faster casting ~1_val~

            if ( (prop = (GetHitChanceBonus() + m_AosAttributes.AttackChance)) != 0 )
                list.Add( 1060415, prop.ToString() ); // hit chance increase ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitColdArea) != 0 )
                list.Add( 1060416, prop.ToString() ); // hit cold area ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitDispel) != 0 )
                list.Add( 1060417, prop.ToString() ); // hit dispel ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitEnergyArea) != 0 )
                list.Add( 1060418, prop.ToString() ); // hit energy area ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitFireArea) != 0 )
                list.Add( 1060419, prop.ToString() ); // hit fire area ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitFireball) != 0 )
                list.Add( 1060420, prop.ToString() ); // hit fireball ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitHarm) != 0 )
                list.Add( 1060421, prop.ToString() ); // hit harm ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitLeechHits) != 0 )
                list.Add( 1060422, prop.ToString() ); // hit life leech ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitLightning) != 0 )
                list.Add( 1060423, prop.ToString() ); // hit lightning ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitLowerAttack) != 0 )
                list.Add( 1060424, prop.ToString() ); // hit lower attack ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitLowerDefend) != 0 )
                list.Add( 1060425, prop.ToString() ); // hit lower defense ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitMagicArrow) != 0 )
                list.Add( 1060426, prop.ToString() ); // hit magic arrow ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitLeechMana) != 0 )
                list.Add( 1060427, prop.ToString() ); // hit mana leech ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitPhysicalArea) != 0 )
                list.Add( 1060428, prop.ToString() ); // hit physical area ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitPoisonArea) != 0 )
                list.Add( 1060429, prop.ToString() ); // hit poison area ~1_val~%

            if ( (prop = m_AosWeaponAttributes.HitLeechStam) != 0 )
                list.Add( 1060430, prop.ToString() ); // hit stamina leech ~1_val~%

            if (ImmolatingWeaponSpell.IsImmolating(this))
                list.Add(1111917); // Immolated

            if (Core.ML && this is BaseRanged && (prop = ((BaseRanged)this).Velocity) != 0)
                list.Add(1072793, prop.ToString()); // Velocity ~1_val~%

            if ( (prop = m_AosAttributes.BonusDex) != 0 )
                list.Add( 1060409, prop.ToString() ); // dexterity bonus ~1_val~

            if ( (prop = m_AosAttributes.BonusHits) != 0 )
                list.Add( 1060431, prop.ToString() ); // hit point increase ~1_val~

            if ( (prop = m_AosAttributes.BonusInt) != 0 )
                list.Add( 1060432, prop.ToString() ); // intelligence bonus ~1_val~

            if ( (prop = m_AosAttributes.LowerManaCost) != 0 )
                list.Add( 1060433, prop.ToString() ); // lower mana cost ~1_val~%

            if ( (prop = m_AosAttributes.LowerRegCost) != 0 )
                list.Add( 1060434, prop.ToString() ); // lower reagent cost ~1_val~%

            if ( (prop = GetLowerStatReq()) != 0 )
                list.Add( 1060435, prop.ToString() ); // lower requirements ~1_val~%

            if ( (prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0 )
                list.Add( 1060436, prop.ToString() ); // luck ~1_val~

            if ( (prop = m_AosWeaponAttributes.MageWeapon) != 0 )
                list.Add( 1060438, (30 - prop).ToString() ); // mage weapon -~1_val~ skill

            if ( (prop = m_AosAttributes.BonusMana) != 0 )
                list.Add( 1060439, prop.ToString() ); // mana increase ~1_val~

            if ( (prop = m_AosAttributes.RegenMana) != 0 )
                list.Add( 1060440, prop.ToString() ); // mana regeneration ~1_val~

            //if ( (prop = m_AosAttributes.NightSight) != 0 )
            //    list.Add( 1060441 ); // night sight

            if ( (prop = m_AosAttributes.ReflectPhysical) != 0 )
                list.Add( 1060442, prop.ToString() ); // reflect physical damage ~1_val~%

            if ( (prop = m_AosAttributes.RegenStam) != 0 )
                list.Add( 1060443, prop.ToString() ); // stamina regeneration ~1_val~

            if ( (prop = m_AosAttributes.RegenHits) != 0 )
                list.Add( 1060444, prop.ToString() ); // hit point regeneration ~1_val~

            if ( (prop = m_AosWeaponAttributes.SelfRepair) != 0 )
                list.Add( 1060450, prop.ToString() ); // self repair ~1_val~

            //if ( (prop = m_AosAttributes.SpellChanneling) != 0 )
            //    list.Add( 1060482 ); // spell channeling

            if ( (prop = m_AosAttributes.SpellDamage) != 0 )
                list.Add( 1060483, prop.ToString() ); // spell damage increase ~1_val~%

            if ( (prop = m_AosAttributes.BonusStam) != 0 )
                list.Add( 1060484, prop.ToString() ); // stamina increase ~1_val~

            if ( (prop = m_AosAttributes.BonusStr) != 0 )
                list.Add( 1060485, prop.ToString() ); // strength bonus ~1_val~

            if ( (prop = m_AosAttributes.WeaponSpeed) != 0 )
                list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~%

            int phys, fire, cold, pois, nrgy, chaos, direct;

            GetDamageTypes(null, out phys, out fire, out cold, out pois, out nrgy, out chaos, out direct);

            if ( phys != 0 )
                list.Add( 1060403, phys.ToString() ); // physical damage ~1_val~%

            if ( fire != 0 )
                list.Add( 1060405, fire.ToString() ); // fire damage ~1_val~%

            if ( cold != 0 )
                list.Add( 1060404, cold.ToString() ); // cold damage ~1_val~%

            if ( pois != 0 )
                list.Add( 1060406, pois.ToString() ); // poison damage ~1_val~%

            if ( nrgy != 0 )
                list.Add( 1060407, nrgy.ToString() ); // energy damage ~1_val~%

            if (Core.ML && chaos != 0)
                list.Add(1072846, chaos.ToString()); // chaos damage ~1_val~%

            if (Core.ML && direct != 0)
                list.Add(1079978, direct.ToString()); // Direct Damage: ~1_PERCENT~%

            list.Add( 1061168, "{0}\t{1}", MinDamage.ToString(), MaxDamage.ToString() ); // weapon damage ~1_val~ - ~2_val~
        
            if (Core.ML)
                list.Add(1061167, String.Format("{0}s", Speed)); // weapon speed ~1_val~
            else
                list.Add(1061167, Speed.ToString());

            if ( MaxRange > 1 )
                list.Add( 1061169, MaxRange.ToString() ); // range ~1_val~

            int strReq = AOS.Scale( StrRequirement, 100 - GetLowerStatReq() );

            if ( strReq > 0 )
                list.Add( 1061170, strReq.ToString() ); // strength requirement ~1_val~

            if ( Layer == Layer.TwoHanded )
                list.Add( 1061171 ); // two-handed weapon
            else
                list.Add( 1061824 ); // one-handed weapon

            if ( Core.SE || m_AosWeaponAttributes.UseBestSkill == 0 )
            {
                switch ( Skill )
                {
                    case SkillName.Swords:  list.Add( 1061172 ); break; // skill required: swordsmanship
                    case SkillName.Macing:  list.Add( 1061173 ); break; // skill required: mace fighting
                    case SkillName.Fencing: list.Add( 1061174 ); break; // skill required: fencing
                    case SkillName.Archery: list.Add( 1061175 ); break; // skill required: archery
                }
            }

            if ( m_Hits >= 0 && m_MaxHits > 0 )
                list.Add( 1060639, "{0}\t{1}", m_Hits, m_MaxHits ); // durability ~1_val~ / ~2_val~
            // mod to display attachment properties
            Server.Engines.XmlSpawner2.XmlAttach.AddAttachmentProperties(this, list);
        }

        public override void OnDoubleClick(Mobile from)
        {
            if (!Sphere.EquipOnDouble(from, this))
                return;

            base.OnDoubleClick(from);
        }

        //Edit
        public override void OnSingleClick(Mobile from)
        {
           LabelTo(from, Sphere.ComputeName(this));

           //List<EquipInfoAttribute> attrs = new List<EquipInfoAttribute>();

            //if (DisplayLootType)
            //{
            //    if (LootType == LootType.Blessed)
            //        attrs.Add(new EquipInfoAttribute(1038021)); // blessed
            //    else if (LootType == LootType.Cursed)
            //        attrs.Add(new EquipInfoAttribute(1049643)); // cursed
            //}

            //#region Factions
            //if (m_FactionState != null)
            //    attrs.Add(new EquipInfoAttribute(1041350)); // faction item
            //#endregion

            //if (m_Quality == WeaponQuality.Exceptional)
            //    attrs.Add(new EquipInfoAttribute(1018305 - (int)m_Quality));

            //if (m_Identified || from.AccessLevel >= AccessLevel.GameMaster)
            //{
            //    if (m_Slayer != SlayerName.None)
            //    {
            //        SlayerEntry entry = SlayerGroup.GetEntryByName(m_Slayer);
            //        if (entry != null)
            //            attrs.Add(new EquipInfoAttribute(entry.Title));
            //    }

            //    if (m_Slayer2 != SlayerName.None)
            //    {
            //        SlayerEntry entry = SlayerGroup.GetEntryByName(m_Slayer2);
            //        if (entry != null)
            //            attrs.Add(new EquipInfoAttribute(entry.Title));
            //    }

            //    if (m_DurabilityLevel != WeaponDurabilityLevel.Regular)
            //        attrs.Add(new EquipInfoAttribute(1038000 + (int)m_DurabilityLevel));

            //    if (m_DamageLevel != WeaponDamageLevel.Regular)
            //        attrs.Add(new EquipInfoAttribute(1038015 + (int)m_DamageLevel));

            //    if (m_AccuracyLevel != WeaponAccuracyLevel.Regular)
            //        attrs.Add(new EquipInfoAttribute(1038010 + (int)m_AccuracyLevel));
            //}
            //else if (m_Slayer != SlayerName.None || m_Slayer2 != SlayerName.None || m_DurabilityLevel != WeaponDurabilityLevel.Regular || m_DamageLevel != WeaponDamageLevel.Regular || m_AccuracyLevel != WeaponAccuracyLevel.Regular)
            //    attrs.Add(new EquipInfoAttribute(1038000)); // Unidentified

           // if (m_Poison != null && m_PoisonCharges > 0)
            //   attrs.Add(new EquipInfoAttribute(1017383, m_PoisonCharges));

            //int number;

            //if (Name == null)
            //{
            //    number = LabelNumber;
            //}
            //else
            //{
            //    this.LabelTo(from, Name);
            //    number = 1041000;
            //}

            //if (attrs.Count == 0 && Crafter == null && Name != null)
            //    return;

            //EquipmentInfo eqInfo = new EquipmentInfo(number, m_Crafter, false, attrs.ToArray());

            //from.Send(new DisplayEquipmentInfo(this, eqInfo));
        }
 
Last edited:
If Item Identification has been altered on your shard, that is likely the issue, but you can try uncommenting that code you see in your BaseWeapon.cs, under the OnSingleClick method.
 
You mean this one?:

Code:
LabelTo(from, Sphere.ComputeName(this));

And i doubt my item id might be the problem since attachs are supposed to show up by just clicking the item, right?

Code:
using System;
using Server.Mobiles;
using Server.Targeting;

namespace Server.Items
{
    public class ItemIdentification
    {
        public static void Initialize()
        {
            SkillInfo.Table[(int)SkillName.ItemID].Callback = OnUse;
        }

        public static TimeSpan OnUse( Mobile from )
        {
            if (from.BeginAction(typeof(IAction)))
            {
                from.SendLocalizedMessage(500343); // What do you wish to appraise and identify?
                from.Target = new InternalTarget();
            }
            else
                from.SendAsciiMessage("You must wait to perform another action.");

            return TimeSpan.Zero;
        }

        [PlayerVendorTarget]
        private class InternalTarget : Target, IAction
        {
            public InternalTarget() :  base ( 8, false, TargetFlags.None )
            {
                AllowNonlocal = true;
            }

            protected override void OnTarget( Mobile from, object o )
            {
                bool releaseLock = true;

                if (o is Item)
                {
                    releaseLock = false;
                    new InternalTimer(from, o as Item).Start();
                }
                else if (o is Mobile)
                    from.SendAsciiMessage("Eso no es un objeto!");
                else
                    from.SendAsciiMessage("No estas muy seguro..."); // You are not certain...

                //allows the identify skill to reveal attachments
                Server.Engines.XmlSpawner2.XmlAttach.RevealAttachments(from, o);

                if (releaseLock && from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
            }

            #region TargetFailed

            protected override void OnCantSeeTarget(Mobile from, object targeted)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnCantSeeTarget(from, targeted);
            }

            protected override void OnTargetDeleted(Mobile from, object targeted)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnTargetDeleted(from, targeted);
            }

            protected override void OnTargetUntargetable(Mobile from, object targeted)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnTargetUntargetable(from, targeted);
            }

            protected override void OnNonlocalTarget(Mobile from, object targeted)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnNonlocalTarget(from, targeted);
            }

            protected override void OnTargetInSecureTrade(Mobile from, object targeted)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnTargetInSecureTrade(from, targeted);
            }

            protected override void OnTargetNotAccessible(Mobile from, object targeted)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnTargetNotAccessible(from, targeted);
            }

            protected override void OnTargetOutOfLOS(Mobile from, object targeted)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnTargetOutOfLOS(from, targeted);
            }

            protected override void OnTargetOutOfRange(Mobile from, object targeted)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnTargetOutOfRange(from, targeted);
            }

            protected override void OnTargetCancel(Mobile from, TargetCancelType cancelType)
            {
                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
                else
                    from.EndAction(typeof(IAction));

                base.OnTargetCancel(from, cancelType);
            }

            #endregion

            #region IAction Members

            public void AbortAction(Mobile from)
            {
            }

            #endregion
        }

        private class InternalTimer : Timer, IAction
        {
            private readonly Mobile m_From;
            private readonly Item m_Targeted;

            public InternalTimer(Mobile from, Item targeted)
                : base(TimeSpan.FromSeconds(1.0))
            {
                m_From = from;
                m_Targeted = targeted;

                if (from is PlayerMobile)
                    ((PlayerMobile)from).ResetPlayerAction(this);
            }

            protected override void OnTick()
            {
                if (m_Targeted.Deleted)
                    return;

                if (m_From.CheckTargetSkill(SkillName.ItemID, m_Targeted, 0, 100))
                {
                    if (m_Targeted is BaseWeapon)
                    {
                        if (((BaseWeapon)m_Targeted).Identified)
                            m_From.SendAsciiMessage("That is already identified.");
                        else
                            ((BaseWeapon)m_Targeted).Identified = true;
                    }
                    else if (m_Targeted is BaseArmor)
                    {
                        if (((BaseArmor)m_Targeted).Identified)
                            m_From.SendAsciiMessage("That is already identified.");
                        else
                            ((BaseArmor)m_Targeted).Identified = true;
                    }
                    else if (m_Targeted is CustomQuestItem)
                    {
                        CustomQuestItem cqi = m_Targeted as CustomQuestItem;

                        if (!string.IsNullOrEmpty(cqi.HiddenMessage))
                            cqi.LabelTo(m_From, cqi.HiddenMessage);
                    }
                    else
                        m_From.SendAsciiMessage("You already know what kind of item that is.");

                    if (m_Targeted.LootType == LootType.Blessed || m_Targeted.LootType == LootType.Newbied)
                        m_From.SendAsciiMessage("It has a slight magical aura.");
                }
                else
                    m_From.SendLocalizedMessage(500353); // You are not certain...

                if (m_From is PlayerMobile)
                    ((PlayerMobile)m_From).EndPlayerAction();
            }

            #region IAction Members

            public void AbortAction(Mobile from)
            {
                from.SendLocalizedMessage(500353); // You are not certain...

                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();

                Stop();
            }

            #endregion
        }
    }
}


I did uncomment that method, nothing happens when i click a weapon xD, doesnt show anything, obviously :p

This is giving me headache lol
 
Yes sir.

This is the file that compute the weapon names, maybe heres something, can you check it please?


Code:
    public static string ComputeName( Item i )
        {
            if( i is BaseWeapon )
                return ComputeName( ( i as BaseWeapon ) );
            if( i is BaseArmor )
                return ComputeName( ( i as BaseArmor ) );
            if( i is BaseClothing )
                return ComputeName( ( i as BaseClothing ) );
            if (i is BaseInstrument)
                return ComputeName((i as BaseInstrument));
            if (i is SpellScroll)
                return ComputeName((i as SpellScroll));
            if (i is RepairDeed)
                return ComputeName((i as RepairDeed));
            return GenericComputeName( i );
        }

        public static string ComputeName( BaseArmor ba )
        {
            if( ba.IsRenamed && !string.IsNullOrEmpty( ba.Name ) )
                return ba.Name;

            string name;

            if( ba.Name == null )
                name = CliLoc.LocToString( ba.LabelNumber );
            else
                name = ba.Name;

            if (ba.Amount > 1)
                name = name + "s";

            var resource = string.Empty;

            if( ba.Resource != CraftResource.None && ba.Resource != CraftResource.Iron )
                resource = CraftResources.GetName( ba.Resource );

            if ((ba.ProtectionLevel != ArmorProtectionLevel.Regular))// && ba.Resource == CraftResource.Iron )
            //If the armor is magical
            {
                if (ba.Quality == ArmorQuality.Exceptional)
                    name = string.Format("{0} {1} de {2}", "Excepcional", name.ToLower(), CliLoc.LocToString((1038005 + (int)ba.ProtectionLevel)).ToLower());
                else
                    name = string.Format("{0} de {1}", name, CliLoc.LocToString((1038005 + (int) ba.ProtectionLevel)).ToLower());
            }
            else if (ba.Resource == CraftResource.None && ba.ProtectionLevel == ArmorProtectionLevel.Regular)
            //If the armor is not magical and not crafted
            {
                if (ba.Quality == ArmorQuality.Exceptional)
                    name = string.Format("{0} {1}", "Excepcional", name );
            }
            else if (ba.Resource != CraftResource.None)
            {
                //If it's crafted by a player
                if (ba.Crafter != null)
                {
                    if (ba.Quality == ArmorQuality.Exceptional)
                    {
                        if (ba.Resource != CraftResource.Iron)
                            name = string.Format("{0} {1} {2} Crafteado por {3}", "Excepcional", resource.ToLower(), name.ToLower(), ba.Crafter.Name);
                        else
                            name = string.Format("{0} {1} Crafteado por {2}", "Excepcional", name.ToLower(), ba.Crafter.Name);
                    }
                    else if (ba.Resource != CraftResource.Iron)
                        name = string.Format("{0} {1}", resource, name.ToLower());
                    else
                        name = string.Format("{0}", name);
                }
                else
                    if (ba.Quality == ArmorQuality.Exceptional)
                        if (!string.IsNullOrEmpty(resource))
                            name = string.Format("{0} {1} {2}", "Excepcional", resource.ToLower(), name.ToLower());
                        else
                            name = string.Format("{0} {1}", "Excepcional", name.ToLower());
                    else
                        if (!string.IsNullOrEmpty(resource))
                            name = string.Format("{0} {1}", resource, name.ToLower());
                        else
                            name = string.Format(name);
            }

            if (ba.Amount > 1)
                name = ba.Amount + " " + name;

            return name;
        }

        public static string ComputeCustomWeaponName( BaseWeapon bw )
        {
            string name = bw.Name;

            if (bw.Crafter == null)
            {
                if (bw.Quality == WeaponQuality.Exceptional)
                    name = "Excepcional " + bw.Name.ToLower();
            }
            else
            {
                if (bw.Quality == WeaponQuality.Exceptional)
                    name = string.Format("Excepcional {0} Crafteado por {1} ", bw.Name.ToLower(), bw.Crafter.Name);
                else
                    name = string.Format("{0} Crafteado por {1}", bw.Name, bw.Crafter.Name);
            }

            return name;
        }

        public static string ComputeName( BaseWeapon bw )
        {
            if( bw.IsRenamed && !string.IsNullOrEmpty( bw.Name ) )
                return bw.Name;

            string name;

            if( bw.Name == null )
                name = CliLoc.LocToString( bw.LabelNumber );
            else
                name = bw.Name;

            if (bw.Amount > 1)
                name = name + "s";

            var resource = string.Empty;

            if (bw.Slayer != SlayerName.None)
            {
                SlayerEntry entry = SlayerGroup.GetEntryByName(bw.Slayer);
                if (entry != null)
                {
                    string slayername = CliLoc.LocToString( entry.Title );
                    name = slayername + " " + name.ToLower();
                }
            }

            if( bw.Resource != CraftResource.None && bw.Resource != CraftResource.Iron )
                resource = CraftResources.GetName( bw.Resource );

            if ((bw.DamageLevel != WeaponDamageLevel.Regular || bw.AccuracyLevel != WeaponAccuracyLevel.Regular) && bw.Resource == CraftResource.Iron)
            {
                //If the weapon is accurate or magical
                if (bw.DamageLevel != WeaponDamageLevel.Regular && bw.AccuracyLevel != WeaponAccuracyLevel.Regular)
                    name = string.Format("{0} {1} of {2}", ComputeAccuracyLevel(bw), name.ToLower(), CliLoc.LocToString((1038015 + (int) bw.DamageLevel)).ToLower());
                else if (bw.AccuracyLevel != WeaponAccuracyLevel.Regular)
                    name = string.Format("{0} {1}", ComputeAccuracyLevel(bw), name.ToLower());
                else
                    name = string.Format("{0} of {1}", name, CliLoc.LocToString((1038015 + (int) bw.DamageLevel)).ToLower());

                if (bw.Quality == WeaponQuality.Exceptional)
                    name = "Excepcional" + name.ToLower();
            }
            else if (bw.Resource != CraftResource.None)
            {
                //If it's crafted by a player
                if (bw.Crafter != null)
                    if (bw.Quality == WeaponQuality.Exceptional)
                        if (bw.Resource != CraftResource.Iron)
                            name = string.Format("{0} {1} {2} Crafteado por {3}", "Excepcional", resource.ToLower(), name.ToLower(), bw.Crafter.Name);
                        else
                            name = string.Format("{0} {1} Crafteado por {2}", "Excepcional", name.ToLower(), bw.Crafter.Name);
                    else if (bw.Resource != CraftResource.Iron)
                        if (!string.IsNullOrEmpty(resource))
                            name = string.Format("{0} {1} Crafteado por {2}", resource, name.ToLower(), bw.Crafter.Name);
                        else
                            name = string.Format("{0} Crafteado por {1}", name, bw.Crafter.Name);
                    else
                        name = string.Format("{0} Crafteado por {1}", name, bw.Crafter.Name);
                else if (bw.Resource != CraftResource.Iron)
                    if (bw.Quality == WeaponQuality.Exceptional)
                        if (!string.IsNullOrEmpty(resource))
                            name = string.Format("{0} {1} {2}", "Excepcional", resource.ToLower(), name.ToLower());
                        else
                            name = string.Format("{0}, {1}", "Excepcional", name.ToLower());
                    else if (!string.IsNullOrEmpty(resource))
                        name = string.Format("{0} {1}", resource, name.ToLower());
                    else
                        name = string.Format(name);
                else if (bw.Resource == CraftResource.Iron)
                    if (bw.Quality == WeaponQuality.Exceptional)
                        name = string.Format("{0} {1}", "Excepcional", name.ToLower());
            }
            if (bw.Amount > 1)
                name = bw.Amount + " " + name;

            return name;
        }

        public static string ComputeName( BaseClothing bc )
        {
            if( bc.IsRenamed && !string.IsNullOrEmpty( bc.Name ) )
                return bc.Name;

            string name;

            if( bc.Name == null )
                name = CliLoc.LocToString( bc.LabelNumber );
            else
                name = bc.Name;

            if (bc.Amount > 1)
                name = name + "s";

            var resource = string.Empty;

            if( bc.Resource != CraftResource.None && bc.Resource != CraftResource.Iron )
                resource = CraftResources.GetName( bc.Resource );

            if( bc.Crafter != null )
                if( bc.Quality == ClothingQuality.Exceptional )
                    if( bc.Resource != CraftResource.None )
                        name = string.Format( "{0} {1} {2} Crafteado por {3}", "Excepcional", resource.ToLower(), name.ToLower(), bc.Crafter.Name );
                    else
                        name = string.Format( "{0} {1} Crafteado por {2}", "Excepcional", name.ToLower(), bc.Crafter.Name );
                else if( bc.Resource != CraftResource.None )
                    if (!string.IsNullOrEmpty(resource))
                        name = string.Format( "{0} {1} Crafteado por {2}", resource, name.ToLower(), bc.Crafter.Name );
                    else
                        name = string.Format("{0} Crafteado por {1}", name, bc.Crafter.Name);
                else
                    name = string.Format( "{0} Crafteado por {1}", name.ToLower(), bc.Crafter.Name );
            else if( bc.Resource != CraftResource.None )
                if (bc.Quality == ClothingQuality.Exceptional)
                    if (!string.IsNullOrEmpty(resource))
                        name = string.Format( "{0} {1} {2}", "Excepcional", resource.ToLower(), name.ToLower() );
                    else
                        name = string.Format(" {0} {1}", "Excepcional", name.ToLower());
                else
                    if (!string.IsNullOrEmpty(resource))
                        name = string.Format("{0} {1}", resource, name.ToLower());
                    else
                        name = string.Format(name);
            else if (bc.Resource == CraftResource.None)
                if (bc.Quality == ClothingQuality.Exceptional)
                    name = string.Format("{0} {1}", "Excepcional", name.ToLower());

            if (bc.Amount > 1)
                name = bc.Amount + " " + name;

            return name;
        }

        public static string ComputeName(BaseInstrument bi)
        {
            string name;

            if (bi.Name == null)
                name = CliLoc.LocToString(bi.LabelNumber);
            else
                name = bi.Name;

            if (bi.Crafter != null)
                name = string.Format("{0} Crafteado por {1}", name, bi.Crafter.Name);

            return name;
        }

        public static string ComputeName(SpellScroll ss)
        {
            string name = string.IsNullOrEmpty(ss.Name) ? CliLoc.LocToString(ss.LabelNumber) : ss.Name;

            return (name + " scroll");
        }

        public static string ComputeName(RepairDeed rd)
        {
            string name = string.Format("Servicio de reparacion {0} {1} Crafteado por {2}",
                                        CliLoc.LocToString(rd.GetSkillTitle(rd.SkillLevel)).ToLower(),
                                        rd.CrafterSkill().ToLower(),
                                        rd.Crafter != null ? rd.Crafter.Name : "unknown");

            return name;
        }

        public static string GenericComputeName( Item i )
        {
            string name;

            if( i.Name == null )
                name = CliLoc.LocToString( i.LabelNumber );
            else
                name = i.Name;

            return name;
        }

        public static string ComputeAccuracyLevel(BaseWeapon bw)
        {
            string level;
            switch (bw.AccuracyLevel)
            {
                case WeaponAccuracyLevel.Accurate:
                    level = "Accurate";
                    break;

                case WeaponAccuracyLevel.Surpassingly:
                    level = "Surpassingly accurate";
                    break;

                case WeaponAccuracyLevel.Eminently:
                    level = "Eminently accurate";
                    break;

                case WeaponAccuracyLevel.Exceedingly:
                    level = "Exceedingly accurate";
                    break;

                case WeaponAccuracyLevel.Supremely:
                    level = "Supremely accurate";
                    break;

                default:
                    level = "";
                    break;
            }
            return level;
        }

        public static bool CanUse( Mobile from, Item toUse )
        {
            if( from == null || toUse == null )
                return false;

            if( from.Frozen )
                from.SendAsciiMessage( "Estas paralizado y no puedes hacer eso." );
            else if( !toUse.Movable )
                from.SendAsciiMessage( "No puedes usar eso." );
            else if( !toUse.IsChildOf( from.Backpack ) && toUse.Parent != from && !from.InRange( toUse.Location, 4 ) && !toUse.IsChildOf( from.BankBox ) && !from.BankBox.Opened )
                from.SendAsciiMessage( "No puedes alcanzar eso." );
            else if( !from.InLOS( toUse ) && !toUse.IsChildOf( from.BankBox ) && !from.BankBox.Opened )
                from.SendAsciiMessage( "No puedes ver eso." );
            else
                return toUse.CanEquip( from );

            return false;
        }

        public static bool EquipOnDouble( Mobile from, Item toEquip )
        {
            Item toDrop;

            //Can we use it?
            if( !CanUse( from, toEquip ) )
                return false;

            //Is the item equiped already?
            if( from.FindItemOnLayer( toEquip.Layer ) == toEquip )
                return true;

            //Turn towards the item.
            if( toEquip.Parent == null )
                SpellHelper.Turn( from, toEquip );

            if( toEquip.Layer == Layer.TwoHanded )
            {
                //Always drop the 2 handed item, if it exists.
                toDrop = from.FindItemOnLayer( Layer.TwoHanded );
                if( toDrop != null )
                {
                    from.SendAsciiMessage( string.Format( m_DropFormat, ComputeName( toDrop ) ) );
                    from.AddToBackpack( toDrop );
                }

                //All non sheild 2handed need all the hand players.
                if( !( toEquip is BaseArmor ) )
                {
                    toDrop = from.FindItemOnLayer( Layer.FirstValid );
                    if( toDrop != null )
                    {
                        from.SendAsciiMessage( string.Format( m_DropFormat, ComputeName( toDrop ) ) );
                        from.AddToBackpack( toDrop );
                    }

                    toDrop = from.FindItemOnLayer( Layer.OneHanded );
                    if( toDrop != null )
                    {
                        from.SendAsciiMessage( string.Format( m_DropFormat, ComputeName( toDrop ) ) );
                        from.AddToBackpack( toDrop );
                    }
                }
            }
            else if( toEquip.Layer == Layer.OneHanded )
            {
                //All non shield 2 hands use both hands.
                toDrop = from.FindItemOnLayer( Layer.TwoHanded );
                if( toDrop != null && !( toDrop is BaseArmor ) )
                {
                    from.SendAsciiMessage( string.Format( m_DropFormat, ComputeName( toDrop ) ) );
                    from.AddToBackpack( toDrop );
                }

                //Drop first valid.
                toDrop = from.FindItemOnLayer( Layer.FirstValid );
                if( toDrop != null )
                {
                    from.SendAsciiMessage( string.Format( m_DropFormat, ComputeName( toDrop ) ) );
                    from.AddToBackpack( toDrop );
                }

                //Drop onehand.
                toDrop = from.FindItemOnLayer( Layer.OneHanded );
                if( toDrop != null )
                {
                    from.SendAsciiMessage( string.Format( m_DropFormat, ComputeName( toDrop ) ) );
                    from.AddToBackpack( toDrop );
                }
            }
            else if( toEquip.Layer == Layer.FirstValid )
            {
                //Drop first valid.
                toDrop = from.FindItemOnLayer( Layer.FirstValid );
                if( toDrop != null )
                {
                    from.SendAsciiMessage( string.Format( m_DropFormat, ComputeName( toDrop ) ) );
                    from.AddToBackpack( toDrop );
                }

                //Drop onehand.
                toDrop = from.FindItemOnLayer( Layer.OneHanded );
                if( toDrop != null )
                {
                    from.SendAsciiMessage( string.Format( m_DropFormat, ComputeName( toDrop ) ) );
                    from.AddToBackpack( toDrop );
                }
            }
            else
            {
                //Drop the item that's occupying the layer.
                toDrop = from.FindItemOnLayer( toEquip.Layer );
                if( toDrop != null )
                {
                    from.SendAsciiMessage( string.Format( m_DropFormat, ComputeName( toDrop ) ) );
                    from.AddToBackpack( toDrop );
                }
            }
            from.EquipItem(toEquip);
            from.PlaySound(0x57);
            return true;
        }
    }
}
 
That file is overriding the attachment. I bet without it, the titles would display. Hopefully someone else can jump in and give you a better direction for adding the XmlAttachment to this file.
 
Back