(RunUO 2.7) Getting Instruments to show Uses Remaining.

librettomafia

Member
Feb 27, 2018
15
0
23
I was wondering what I need to add to make it so musical instruments show remaining uses.
Thank you in advance.
 

Falkor

Well-Known Member
Apr 11, 2018
116
30
wpshard.com
Shard Name
Whispering Pines
My last RunUO is 2.0 (approx. SVN 400) and it already displays uses on instruments within BaseInstrument.cs in this section:

Code:
public override void GetProperties( ObjectPropertyList list )
I'm surprised that it would be missing from later versions.
 
  • Like
Reactions: librettomafia

librettomafia

Member
Feb 27, 2018
15
0
23
is there a way to modify this to get it to show uses remaining?

C#:
        public override void GetProperties( ObjectPropertyList list )
        {
            int oldUses = m_UsesRemaining;
            CheckReplenishUses( false );
 

Falkor

Well-Known Member
Apr 11, 2018
116
30
wpshard.com
Shard Name
Whispering Pines
Adding this line should do it:
Code:
list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~
Here is that whole section from my 2.0 code:

Code:
        public override void GetProperties( ObjectPropertyList list )
        {
            int oldUses = m_UsesRemaining;
            CheckReplenishUses( false );

            base.GetProperties( list );

            if ( m_Crafter != null )
                list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~

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

            list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~

            if( m_ReplenishesCharges )
                list.Add( 1070928 ); // Replenish Charges

            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 );
            }

            if( m_UsesRemaining != oldUses )
                Timer.DelayCall( TimeSpan.Zero, new TimerCallback( InvalidateProperties ) );
        }
 
  • Like
Reactions: librettomafia

librettomafia

Member
Feb 27, 2018
15
0
23
So I have all of those lines, but still nothing, Im wondering if it is because im running a T2A Era shard. I have already modified it to show Properties and I even tested uses remaining by changing expansions and still no results. Btw now using latest ServUO server files.
 

Falkor

Well-Known Member
Apr 11, 2018
116
30
wpshard.com
Shard Name
Whispering Pines
It looks like it has been tried before and doesn't work without sending a later expansion flag.


The display / no display may happen with the client itself based on what expansion it is told the server is running.

Tasanar found a workaround by changing the core script expansion.cs so it disables the fluff but supports item info:

along with an edit to the CurrentExpansion.cs script so that OPLs are displayed.