Jump to content

DB2Reader


Weer36

Recommended Posts

Hello,

It depends on the version of Wow, but in WOTLK by sample :

 

using System.Runtime.InteropServices;
using wManager.Wow.Patchables;

namespace wManager.Wow.Helpers
{
    /// <summary>
    /// Class WoWLock
    /// </summary>
    public class WoWLock
    {
        private readonly LockDbcRecord _lockDbcRecord0;

        private static DBC<LockDbcRecord> _lockDBC;

        private WoWLock(uint id)
        {
            if (_lockDBC == null)
                _lockDBC = new DBC<LockDbcRecord>(0x00AD40F4 - 0x400000);
            _lockDbcRecord0 = _lockDBC.GetRow((int) id);
        }

        /// <summary>
        /// By id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns>WoWLock.</returns>
        public static WoWLock FromId(uint id)
        {
            return new WoWLock(id);
        }

        /// <summary>
        /// Get record.
        /// </summary>
        /// <value>The record.</value>
        public LockDbcRecord Record
        {
            get { return _lockDbcRecord0; }
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct LockDbcRecord
        {
            // 1 + 4*8 = 33 fields
            public uint Id;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public uint[] KeyType;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public uint[] LockType;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public uint[] Skill;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public uint[] Action;
        }
    }
}

Which DB do you want to read?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...