ServUO Version
Publish Unknown
Ultima Expansion
None
is there a way to check for a playermobile inside that method?

i know how to check the parent mobile, but the custom property will only show up if the player is wearing the armor

BaseArmor.cs
C#:
public override void GetProperties( ObjectPropertyList list )
        {
            base.GetProperties( list );
 
Thank you very much juzzver, i had to do it in a different way (im using Runuo) so the ''Mobile m'' part was giving me a small error

C#:
  if ( RootParentEntity is Mobile )
              {
             Mobile holder = (Mobile)this.RootParent;
     
            XmlValue tanke = (XmlValue)XmlAttach.FindAttachment(holder, typeof(XmlValue), "attach test");
          if(holder != null)
                {
                if (tanke != null)
                   list.Add(1070722, "<BASEFONT COLOR=#00FF00>[Green prop]<BASEFONT COLOR=#FFFFFF>");
                   else
                   list.Add(1070722, "<BASEFONT COLOR=#DC143C>[Red prop]<BASEFONT COLOR=#FFFFFF>");
              }

That works, the prop appears GREEN if player has attach test it appears RED if it doesnt





So how to check for the attach test attachment if the RootParentEntity is null? lets say the item is on the floor


how to make the prop appear green for players hovering the mouse over the item (item on the floor) if they have the attach test attachment?
 
Last edited:
C#:
// item not in a container or not equipped == item on the ground
if ( this.ParentEntity == null ) 
{
  XmlValue tanke = (XmlValue)XmlAttach.FindAttachment(holder, typeof(XmlValue), "attach test");

         if ( tanke != null )
            {
                 // send green props
            }
}
 
i had to do it in a different way (im using Runuo) so the ''Mobile m'' part was giving me a small error
On this note, edit the RunUO csproj files and change the target framework to 4.8
Edit ScriptCompiler.cs and add this line inside the GetCompilerOptions method:
Code:
AppendCompilerOption(ref sb, "/langversion:7.3");
Now you can compile using .net 4.8 syntax.
 
Back