Trying to get AddProperties to work, created an attachment and did [addatt in game but nothing happens.
Am I missing something?
Am I missing something?
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Mobiles;
namespace Server.Engines.XmlSpawner2
{
public class TMapDecoderXmlAtt : XmlAttachment
{
[Attachable]
public TMapDecoderXmlAtt() {}
public TMapDecoderXmlAtt(ASerial serial) : base(serial){}
public override void Serialize(GenericWriter writer) {
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader) {
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void OnAttach()
{
base.OnAttach();
if (this.AttachedTo is Item)
{
((Item)this.AttachedTo).InvalidateProperties();
Item o = (Item)((Item)this.AttachedTo);
//TMapDecoderXmlAtt alist = (TMapDecoderXmlAtt)XmlAttach.FindAttachment(o, typeof(TMapDecoderXmlAtt));
//alist.AddProperties( o.ObjectPropertyList );
}
}
public override void AddProperties(ObjectPropertyList list)
{
base.AddProperties(list);
if (AttachedTo is Item)
{
//((Item)AttachedTo).GetProperties(list);
list.Add("Map:{0}",((TreasureMap)AttachedTo).ChestMap);
list.Add("{0}",((TreasureMap)AttachedTo).ChestLocation);
}
}
}
}