ServUO Version
Publish 57
Ultima Expansion
Endless Journey
Sorry had added this question under xmlspawner, in right spot now,my bad.

The system seems to work good except for the Large Taming Bods get corrupted on sever save and when you bring them out of the bodbook. I have looked in LargeTamingBod.cs to see what could be the problem but i dont understand the "self" implementation. Should the "self" be serialized? This script is puzzling. Any Help with this would be appreciated, or if you have a working copy could you give me hints lol.

C#:
using System.Collections.Generic;
namespace Server.Engines.BulkOrders
{
public class LargeTamingBOD : LargeBOD
{
public override BODType BODType { get { return BODType.Taming; } }
[Constructable]
public LargeTamingBOD()
{
int amountMax = Utility.RandomList(10, 15, 20, 20);
Init(this, amountMax);
}
#region GM DEBUG
[Constructable]
public LargeTamingBOD(int amountMax, int index)
{
Init(this, amountMax, index);
}
#endregion
public LargeTamingBOD(int amountMax, LargeBulkEntry[] entries)
{
Init(this, amountMax, entries);
}
public LargeTamingBOD(Serial serial)
: base(serial)
{
}
private static void Init(LargeTamingBOD self, int amountMax)
{
// sync Utility.Random(XXXX) with entries count read via config
Init(self, amountMax, Utility.Random(10));
}
private static void Init(LargeTamingBOD self, int amountMax, int entryIndex)
{
LargeBulkEntry[] entries;
switch (entryIndex)
{
default:
case 0: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.MountsForLarge); break;
case 1: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.HardMountsForLarge); break;
case 2: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.DragonsForLarge); break;
case 3: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.FarmAnimalsForLarge); break;
case 4: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.SpidersForLarge); break;
case 5: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.FelinesForLarge); break;
case 6: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.KaninesForLarge); break;
case 7: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.BearsForLarge); break;
case 8: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.BirdsForLarge); break;
case 9: entries = LargeBulkEntry.ConvertEntries(self, BulkEntryTaming.RodentsForLarge); break;
}
Init(self, amountMax, entries);
}
private static void Init(LargeTamingBOD self, int amountMax, LargeBulkEntry[] entries)
{
self.Hue = 0x1CA;
self.AmountMax = amountMax;
self.Entries = entries;
self.RequireExceptional = false;
self.Material = BulkMaterialType.None;
}
public override int ComputeFame()
{
return TamingRewardCalculator.Instance.ComputeFame(this);
}
public override int ComputeGold()
{
return TamingRewardCalculator.Instance.ComputeGold(this);
}
public override List<Item> ComputeRewards(bool full)
{
List<Item> list = new List<Item>();
RewardGroup rewardGroup = TamingRewardCalculator.Instance.LookupRewards(TamingRewardCalculator.Instance.ComputePoints(this));
if (rewardGroup != null)
{
if (full)
{
 for (int i = 0; i < rewardGroup.Items.Length; ++i)
{
Item item = rewardGroup.Items[i].Construct();
if (item != null)
list.Add(item);
}
}
else
{
RewardItem rewardItem = rewardGroup.AcquireItem();
if (rewardItem != null)
{
Item item = rewardItem.Construct();
if (item != null)
list.Add(item);
}
}
}
return list;
}
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();
}
}
}
 
Update: I put a large bod in book with one large finished and 2 not finished and the large bod comes out with the names. Only when i try to take the large bod out with none done does it not have the listed names to tame. Also still on server restart names disappear.
 
Back