ScriptVisitor submitted a new resource:

FS ATS inspired, full native system integrated Animal Taming BODs with reward XML configurator - System integrated Taming BODs

Provide a native, system integrated Animal Taming BODs system with XML configurable rewards.

Credits
The system itself is inspired by RoninGT (RoninGT) FS-ATS with Taming BODs and the contributors around this system.
  • Some example rewards are based on his code (WoodenHorseStatue, PetPowerScroll)
  • The list of tameable animals, the grouping and small / large bod distribution has been widely adopted
...

Read more about this resource...
 
The largetamingbods get corrupted when you take them out of the bulk order book. heres the line i need to figure out,

case BODType.Taming: bod = new LargeTamingBOD(m_AmountMax, ReconstructEntries()); break;

it only gives the amount you have and no name of what you need. Hope someone can help me out.
If you need the whole script let me know.
 
I have managed to merge in the latest ServUO master.

The largetamingbods get corrupted when you take them out of the bulk order book. heres the line i need to figure out,

case BODType.Taming: bod = new LargeTamingBOD(m_AmountMax, ReconstructEntries()); break;

it only gives the amount you have and no name of what you need. Hope someone can help me out.
If you need the whole script let me know.
There seems to be a problem when deserializing Large Bulk.
I fixed it this way.
The code may be a little different since it is merged into the latest ServUO branch.

Scripts\Services\BulkOrders\LargeBODs\LargeBulkEntry.cs
import:
using Server.Mobiles;
using static Server.Engines.BulkOrders.BulkEntryTaming;

LargeBulkEntry class:
        public LargeBulkEntry(LargeBOD owner, GenericReader reader, int version)

        {

            m_Owner = owner;

            m_Amount = reader.ReadInt();

            Type type = null;

            string stringType = reader.ReadString();

            if (stringType != null)

                type = ScriptCompiler.FindTypeByFullName(stringType);

            int number = reader.ReadInt();

            int graphic = reader.ReadInt();

            int hue = reader.ReadInt();

            if (type?.BaseType == typeof(BaseCreature) || type?.BaseType == typeof(BaseMount))

                if (number != 0)

                    m_Details = new SmallTamingBulkEntry(type, number, graphic, version == 0 ? 0 : hue);

                else

                    m_Details = new SmallTamingBulkEntry(type, type.Name, graphic, version == 0 ? 0 : hue);

            else

                m_Details = new SmallBulkEntry(type, number, graphic, version == 0 ? 0 : hue);

        }

Scripts\Services\BulkOrders\Books
BOBLargeEntry class:
        private LargeBulkEntry[] ReconstructEntries()
        {
            LargeBulkEntry[] entries = new LargeBulkEntry[m_Entries.Length];

            for (int i = 0; i < m_Entries.Length; ++i)
            {
                Type type = m_Entries[i].ItemType;
                int number = m_Entries[i].Number;
                int graphic = m_Entries[i].Graphic;
                int hue = m_Entries[i].Hue;

                SmallBulkEntry details = null;

                if (type?.BaseType == typeof(BaseCreature) || type?.BaseType == typeof(BaseMount))
                    if (number != 0)
                        details = new SmallTamingBulkEntry(type, number, graphic, hue);
                    else
                        details = new SmallTamingBulkEntry(type, type.Name, graphic, hue);
                else
                    details = new SmallBulkEntry(type, number, graphic, hue);

                entries[i] = new LargeBulkEntry(null, details)
                {
                    Amount = m_Entries[i].AmountCur
                };
            }
 

Attachments

  • LargeBulkEntry.cs
    8.9 KB · Views: 4
  • BOBLargeEntry.cs
    6 KB · Views: 4
Last edited:
Back