- ServUO Version
- Publish Unknown
- Ultima Expansion
- Mondain's Legacy
I have a Quest on my RunUO version 2.0 Server (that I downloaded a few years ago) to obtain 'Music Scrolls' for a 'Music Box'. The quest has a chance to drop one of 51 songs and players have fun trying to collect them all.
My problem is, the music scrolls are not 'Stackable' so players end up with countless duplicates that become a pain to store and organize. So far I have been unable to script the files involved to make the scrolls 'Stack'.
1) I have checked the graphic in TileData.mul and the Stack flags are set properly.
2) I have edited the 'Song Scroll' files trying to make them 'Stackable' but the usual approach does not work. They just don't want to 'Stack'.
Can someone in the community please take a look at this problem and help me find a solution?
Here is the MusicBoxTrack.cs file I have:
and . . Here is a sample of one of the Music Scroll files I have edited trying to make it 'Stackable':
On the surface (to me) this should work but it doesn't. Can anyone see why?
Many thanks for taking the time to look at this.
My problem is, the music scrolls are not 'Stackable' so players end up with countless duplicates that become a pain to store and organize. So far I have been unable to script the files involved to make the scrolls 'Stack'.
1) I have checked the graphic in TileData.mul and the Stack flags are set properly.
2) I have edited the 'Song Scroll' files trying to make them 'Stackable' but the usual approach does not work. They just don't want to 'Stack'.
Can someone in the community please take a look at this problem and help me find a solution?
Here is the MusicBoxTrack.cs file I have:
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Gumps;
using Server.ContextMenus;
using Server.Network;
using Server.Mobiles;
using Server.Items;
namespace Server.Items.MusicBox
{
public class MusicBoxTrack : Item
{
private int m_Track;
public int Track { get { return m_Track; } set { m_Track = value; InvalidateProperties(); } }
private MusicName m_Song;
public MusicName Song { get { return m_Song; } set { m_Song = value; InvalidateProperties(); } }
public override int LabelNumber { get { return m_Track; } }
public MusicBoxTrack( int track )
: base(0x2830)
{
m_Track = track;
Name = "Organ Song Track";
Weight = 1.0;
}
public MusicBoxTrack(Serial s)
: base(s)
{
}
public override void OnDoubleClick(Mobile from)
{
from.SendLocalizedMessage(LabelNumber);
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write((int)m_Track);
writer.Write((int)m_Song);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
m_Track = reader.ReadInt();
m_Song = (MusicName)reader.ReadInt();
}
}
}
and . . Here is a sample of one of the Music Scroll files I have edited trying to make it 'Stackable':
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Gumps;
using Server.ContextMenus;
using Server.Network;
using Server.Mobiles;
using Server.Items;
namespace Server.Items.MusicBox
{
public class DeathTuneSong : MusicBoxTrack
{
[Constructable]
public DeathTuneSong() : this( 1 )
{
}
[Constructable]
public DeathTuneSong( int amount )
: base(1075171)
{
Stackable = true;
Amount = amount;
Song = MusicName.Death;
//Name = "Death Tune";
}
public DeathTuneSong(Serial s)
: base(s)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
On the surface (to me) this should work but it doesn't. Can anyone see why?
Many thanks for taking the time to look at this.