Example #1
0
        public D3Actor(MemoryReader memReader, uint ptr, byte[] data)
        {
            this.Pointer   = ptr;
            this.ActorID   = BitConverter.ToInt32(data, 0);
            this.AcdID     = BitConverter.ToUInt32(data, 4);
            this.ModelName = ProcessUtils.AsciiBytesToString(data, 8, 128);
            this.SnoID     = BitConverter.ToInt32(data, 136);
            this.Direction = new Vector2f(data, 152);
            this.Pos1      = new Vector3f(data, 160);
            this.Unk2      = BitConverter.ToSingle(data, 172);
            this.Pos2      = new Vector3f(data, 176);
            this.WorldID   = BitConverter.ToUInt32(data, 216);
            this.Unk3      = BitConverter.ToUInt32(data, 344);

            // ActorCommonData
            if (this.AcdID != Offsets.INVALID)
            {
                uint acdPtr = memReader.IDToPtr(memReader.pACDs, Offsets.SIZEOF_ACD, this.AcdID);
                if (acdPtr != 0 && acdPtr != Offsets.INVALID)
                {
                    this.Acd = new D3ActorCommonData(memReader, acdPtr, memReader.D3.ReadBytes(acdPtr, Offsets.SIZEOF_ACD));
                }
            }

            // MovementInfo
            uint movementPtr = BitConverter.ToUInt32(data, 896);

            if (movementPtr != 0 && movementPtr != Offsets.INVALID)
            {
                this.MovementInfo = new D3MovementInfo(movementPtr, memReader.D3.ReadBytes(movementPtr, Offsets.SIZEOF_MOVEMENTINFO));
            }
        }
Example #2
0
        public D3ActorCommonData(MemoryReader memReader, uint ptr, byte[] data)
        {
            this.Pointer       = ptr;
            this.AcdID         = BitConverter.ToInt32(data, 0);
            this.ModelName     = ProcessUtils.AsciiBytesToString(data, 4, 128);
            this.SnoID         = BitConverter.ToInt32(data, 0x90);
            this.GBType        = BitConverter.ToInt32(data, 0xB0);
            this.GBID          = BitConverter.ToUInt32(data, 0xB4);
            this.Direction     = new Vector2f(data, 0xC8);
            this.Pos1          = new Vector3f(data, 0xD0);
            this.Pos2          = new Vector3f(data, 0xE0);
            this.WorldID       = BitConverter.ToUInt32(data, 0x108);
            this.SceneID       = BitConverter.ToUInt32(data, 0x10C);
            this.OwnerID       = BitConverter.ToInt32(data, 0x110);
            this.Placement     = BitConverter.ToInt32(data, 0x114);
            this.InventoryX    = BitConverter.ToInt32(data, 0x118);
            this.InventoryY    = BitConverter.ToInt32(data, 0x11C);
            this.AttributesID1 = BitConverter.ToUInt32(data, 0x120);
            this.AttributesID2 = BitConverter.ToUInt32(data, 0x124);

            uint attributesPtr1 = memReader.IDToPtr(memReader.pAttributes, Offsets.SIZEOF_ATTRIBUTE, AttributesID1);

            //uint attributesPtr2 = memReader.IDToPtr(memReader.pAttributes, Offsets.SIZEOF_ATTRIBUTE, AttributesID2);

            Attributes = memReader.GetAttributes(attributesPtr1);

            // Merge in any additional attributes (haven't seen any yet in practice)
            //D3AttributeMap attributes2 = memReader.GetAttributes(attributesPtr2);
            //foreach (var kvp in attributes2)
            //    Attributes[kvp.Key] = kvp.Value;
        }
Example #3
0
 public D3UIObject(MemoryReader memReader, uint ptr, byte[] data)
 {
     Pointer  = ptr;
     VTable   = BitConverter.ToUInt32(data, 0);
     Visible  = BitConverter.ToBoolean(data, 0x20);
     ID       = BitConverter.ToInt32(data, 0x28);
     Name     = ProcessUtils.AsciiBytesToString(data, 0x30, 0x200);
     ParentID = BitConverter.ToInt32(data, 0x230);
     //ParentName = ProcessUtils.AsciiBytesToString(data, 0x238, 0x200);
 }