示例#1
0
 public InventoryItem[] GetInventoryItems()
 {
     if (InventoryData == null)
     {
         return(new InventoryItem[0]);
     }
     else
     {
         var    result = new InventoryItem[2048];
         byte[] bytes  = InventoryData.ReadBytes(0, 2048 * 0x1C);
         for (int i = 0; i < 2048; i++)
         {
             result[i] = new InventoryItem(bytes, i * 0x1C);
         }
         return(result);
     }
 }
示例#2
0
        /// <summary>
        /// Removes a weapon from the player's inventory
        /// </summary>
        /// <param name="weapon"></param>
        public override void DeleteItem(BlackKnightWeapon weapon)
        {
            InventoryItem[] result = new InventoryItem[0];

            if (Process.Hooked)
            {
                result = new InventoryItem[2048];
                IntPtr    pointer    = pInventoryData.Resolve();
                PHPointer pInventory = Process.CreateChildPointer(pInventoryData, 0, 0x10, 0x3B8);
                byte[]    bytes      = pInventory.ReadBytes(0, 2048 * 0x1C);

                for (int i = 0; i < 2048; i++)
                {
                    result[i] = new InventoryItem(bytes, i * 0x1C);
                    if (result[i].Category == weapon.Category && result[i].ID == weapon.ID)
                    {
                        pInventory.WriteBytes(i * 0x1C, new byte[0x1C]);
                    }
                }
            }
        }
示例#3
0
 public byte[] DumpFollowCam()
 {
     return(ChrFollowCam.ReadBytes(0, 512));
 }