sahisahi

Member
Im uisng XMLlevelitems and runuo, im Trying to display Level and experience

this is what i have, not working so far:



Code:
  public override void OnSingleClick(Mobile from)
        {
      
           XmlLevelItem levitem = XmlAttach.FindAttachment(this, typeof(XmlLevelItem)) as XmlLevelItem;
                string name;
              if (levitem != null)
                name = string.Format(  "Level\t{0}", levitem.Level);

when i singleclick it just display the item name
 
if you are trying to make this display on a weapon in base weapon find

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

replace with

Code:
 public override void GetProperties(ObjectPropertyList list)
          {  
         
           base.GetProperties(list);
           // Xml Spawner 2.36c XmlLevelItem - SOF
           XmlLevelItem levitem = XmlAttach.FindAttachment(this, typeof(XmlLevelItem)) as XmlLevelItem;

           if (levitem != null)
           {
               list.Add(1060658, "Level\t{0}", levitem.Level);

           if (LevelItems.DisplayExpProp)
               list.Add(1060659, "Experience\t{0}", levitem.Experience);

           }
          // Xml Spawner 2.36c XmlLevelItem - EOF

This should display the level of the weapon on mouseover.

would be the same for baseclothing, basearmor etc.

Haven't tested this but it should work or be close to it.
 
Thanks

but i have Expansion set to NONE , mouseover wont work. I saw that edit in the txt instructions file. Thats why im trying to add it to the onsingleclick method.

I wonder why this is not working either:



Code:
             XmlLevelItem levitem = XmlAttach.FindAttachment(this, typeof(XmlLevelItem)) as XmlLevelItem;
              
              if (levitem != null)
              {          
               string name = "Level";  
               string named = "Experience";
             
               name += String.Format ("\t{0}", levitem.Level);
               if (LevelItems.DisplayExpProp)
               named += String.Format ("\t{0}", levitem.Experience);
           from.SendAsciiMessage(0x47, " Debug: XmlLevelItem FOUND");
                 }
 
Last edited:
Code:
   LabelTo(from, 1076759, String.Format("Level {0}",levitem.Level)); 
     
                   if (LevelItems.DisplayExpProp)
                   LabelTo(from,1076759,String.Format("Experience {0}",levitem.Experience));

that works, thanks Pyro!
 
Last edited:

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back