public void MoveAllBeastsToStore()
 {
     CHR.INV.Load();
     foreach (Item i in CHR.INV.IL)
     {
         if (i.id >= Beast.ITEM_BASE + Beast.MIN_ITEM && i.id <= Beast.ITEM_BASE + Beast.MAX_ITEM)
         {
             BeastItem.FromItem(i).PutToBI();
         }
     }
 }
        public void LoadInventory()
        {
            BIL.Clear();
            int rr  = -1;
            int BIB = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_InventoryBegin"));
            int BIE = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_InventoryEnd"));

            while (BIB < BIE)
            {
                byte[] buffer = new byte[OFS.GetInt("BS_InventoryItemSize")];
                EF.ReadProcessMemory(CHR.HNDL, BIB, buffer, buffer.Length, ref rr);
                int[] oa = new int[buffer.Length / 4];
                Buffer.BlockCopy(buffer, 0, oa, 0, buffer.Length);
                BeastItem NBI = new BeastItem(CHR);
                NBI.id    = oa[OFS.GetInt("BS_BI_ID") / 4];
                NBI.count = oa[OFS.GetInt("BS_BI_Count") / 4];
                BIL.Add(NBI.id, NBI);
                BIB += OFS.GetInt("BS_InventoryItemSize");
            }
        }
Exemple #3
0
 public static BeastItem FromItem(Item i)
 {
     BeastItem bi = new BeastItem(i.CHR); bi.id = i.id; bi.count = i.count; return(bi);
 }