Пример #1
0
        public static Bitmap GetFace(MemoryData face)
        {
            int    faceId  = face.IntVal + 1;
            Bitmap faceimg = (Bitmap)(Properties.ResourceBigFace.ResourceManager.GetObject("_1_" + faceId));

            return(faceimg);
        }
Пример #2
0
 public static void SetState(MemoryData stateItem, RoleState state)
 {
     if (state == RoleState.has)
     {
         stateItem.HexVal = "0x0b";
     }
     else
     {
         stateItem.HexVal = "0x00";
     }
 }
Пример #3
0
 public static void SetEquip(MemoryData item, ItemEquip equip)
 {
     if (equip == ItemEquip.Equip)
     {
         item.HexVal = "0x40";
     }
     else
     {
         item.HexVal = "0x00";
     }
 }
Пример #4
0
 public static void SetMoved(MemoryData moveItem, RoleMoved moveType)
 {
     if (moveType == RoleMoved.Moved)
     {
         moveItem.HexVal = "0x80";
     }
     else
     {
         moveItem.HexVal = "0x00";
     }
 }
Пример #5
0
        public static ItemEquip GetEquip(MemoryData itemState)
        {
            switch (itemState.HexVal.PadLeft(2, '0'))
            {
            case "00":
                return(ItemEquip.Unequip);

            case "40":
                return(ItemEquip.Equip);

            default:
                return(ItemEquip.Non);
            }
        }
Пример #6
0
 public static RoleMoved GetMoved(MemoryData moveItem)
 {
     if (moveItem.HexVal == "0x80")
     {
         return(RoleMoved.Moved);
     }
     else if (moveItem.HexVal == "0x00")
     {
         return(RoleMoved.NotMove);
     }
     else
     {
         return(RoleMoved.NotMove);
     }
 }
Пример #7
0
        private bool WriteOneProperty(TextBox pData, MemoryData pMemory)
        {
            bool WriteSuccess = false;

            if (pData.Text != pMemory.Value)
            {
                WriteSuccess = Win32Lib.WriteMemory(pMemory.Address, int.Parse(pData.Text), pMemory.ByteCount);
                if (WriteSuccess == false)
                {
                    MessageBox.Show("写入失败");
                    return(false);
                }
            }
            return(true);
        }
Пример #8
0
 public static RoleState GetState(MemoryData stateItem)
 {
     if (stateItem.IntVal == 128)
     {
         return(RoleState.has);
     }
     else if (stateItem.IntVal == 0)
     {
         return(RoleState.non);
     }
     else
     {
         return(RoleState.non);
     }
 }
Пример #9
0
        private void IniItem(MemoryData pItem, int pByteCount)
        {
            if (_offSet != 0)
            {
                pItem.Address = Win32Lib.GetMoveAddress(_startAddress, _offSet);
            }
            else
            {
                pItem.Address = _startAddress;
            }

            pItem.ByteCount = pByteCount;

            _offSet += pByteCount;
        }
Пример #10
0
        private void SetItem(CheckBox stateChkBox, TextBox itemTextBox, MemoryData stateMemory, MemoryData itemMemory)
        {
            ItemEquip equip = RoleLib.GetEquip(stateMemory);

            stateChkBox.Checked = equip == ItemEquip.Equip;
            if (equip != ItemEquip.Non)
            {
                itemTextBox.Text = RoleLib.GetItem(itemMemory).Name;
                itemTextBox.Tag  = itemMemory.HexVal;
            }
            else
            {
                itemTextBox.Text = "";
                itemTextBox.Tag  = null;
            }
        }
Пример #11
0
        private bool WriteAction(CheckBox pData, MemoryData pMemory)
        {
            bool WriteSuccess = false;

            if (pData.Checked != (RoleLib.GetState(pMemory) == RoleState.has))
            {
                int lState = pData.Checked ? GlobalConst.Acion_Moved : GlobalConst.Acion_nonMoved;
                WriteSuccess = Win32Lib.WriteMemory(pMemory.Address, lState, 1);
                if (WriteSuccess == false)
                {
                    MessageBox.Show("写入失败");
                    return(false);
                }
            }
            return(true);
        }
Пример #12
0
        public static RoleCamp GetCamp(MemoryData camp)
        {
            switch (camp.HexVal.PadLeft(2, '0'))
            {
            case "00":
                return(RoleCamp.Enemy);

            case "01":
                return(RoleCamp.NPC);

            case "02":
                return(RoleCamp.Ally);

            default:
                return(RoleCamp.Enemy);
            }
        }
Пример #13
0
        private bool PrecheckOneItem(TextBox txtbox, MemoryData memoryData)
        {
            if (txtbox.Text == "")
            {
                return(true);
            }

            int val      = int.Parse(txtbox.Text);
            int maxValue = memoryData.ByteCount == 1 ? 255 : 65535;

            if (val > maxValue)
            {
                MessageBox.Show("数字太大了,不能超过" + maxValue + "哦", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtbox.Focus();
                return(false);
            }
            return(true);
        }
Пример #14
0
        public static Bitmap[] GetMiniFace(MemoryData face, MemoryData miniface)
        {
            int faceId = face.IntVal;

            int startId = faceId * 12;

            startId += miniface.IntVal * 3 + 1;

            Bitmap minifaceimg1 = (Bitmap)(Properties.ResourceMiniFace.ResourceManager.GetObject("_1_" + startId));

            startId++;
            Bitmap minifaceimg2 = (Bitmap)(Properties.ResourceMiniFace.ResourceManager.GetObject("_1_" + startId));

            startId++;
            Bitmap minifaceimg3 = (Bitmap)(Properties.ResourceMiniFace.ResourceManager.GetObject("_1_" + startId));

            Bitmap[] MiniFaceArray = { minifaceimg1, minifaceimg2, minifaceimg3 };

            return(MiniFaceArray);
        }
Пример #15
0
        private bool WriteOneState(TextBox pData, MemoryData pMemory)
        {
            bool WriteSuccess = false;
            int  formVal      = 0;

            if (!int.TryParse(pData.Text, out formVal))
            {
                formVal = 0;
            }
            if (formVal != pMemory.IntVal)
            {
                WriteSuccess = Win32Lib.WriteMemory(pMemory.Address, formVal, 1);
                if (WriteSuccess == false)
                {
                    MessageBox.Show("写入失败");
                    return(false);
                }
            }
            return(true);
        }
Пример #16
0
        public static RoleVecter GetRoleVecter(MemoryData stateItem)
        {
            // 0x0:下 0x1: 左 0x2:上 0x3:右
            switch (stateItem.HexVal)
            {
            case "0x00":
                return(RoleVecter.down);

            case "0x01":
                return(RoleVecter.left);

            case "0x02":
                return(RoleVecter.up);

            case "0x03":
                return(RoleVecter.right);

            default:
                return(RoleVecter.down);
            }
        }
Пример #17
0
 private void SaveOneItem(CheckBox pUsed, TextBox pItem, MemoryData pMemoryUsed, MemoryData pMemoryItem)
 {
     if (pItem.Text == "")
     {
         Win32Lib.WriteMemory(pMemoryUsed.Address, GlobalConst.Item_nonState, 1);
         Win32Lib.WriteMemory(pMemoryItem.Address, GlobalConst.Item_nonItem, 1);
     }
     else
     {
         ItemInfo item = RoleLib.GetItem(pItem.Text);
         Win32Lib.WriteMemory(pMemoryItem.Address, Convert.ToInt32(item.Code, 16), 1);
         if (pUsed.Checked)
         {
             Win32Lib.WriteMemory(pMemoryUsed.Address, GlobalConst.Item_Equiped, 1);
         }
         else
         {
             Win32Lib.WriteMemory(pMemoryUsed.Address, GlobalConst.Item_nonEquiped, 1);
         }
     }
 }
Пример #18
0
        public static bool WriteOneMagic(string[] magicCodeList, Role role)
        {
            bool WriteSuccess = false;

            MemoryData[] magicInfo = new MemoryData[] { role.M27_法术1, role.M28_法术2, role.M29_法术3, role.M30_法术4, role.M31_法术5 };

            for (int i = 0; i < magicInfo.Length; i++)
            {
                MemoryData magicitem = magicInfo[i];
                string     magicCode = magicCodeList[i];
                if (magicCode != magicitem.Value)
                {
                    WriteSuccess = Win32Lib.WriteMemory(magicitem.Address, int.Parse(magicCode), 1);
                    if (WriteSuccess == false)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Пример #19
0
        public static JobInfo GetJob(MemoryData job)
        {
            JobInfo jobInfo = SettingsLib.JobInfoList.FirstOrDefault(item => item.Code.ToLower().PadLeft(2, '0') == job.HexVal);

            return(jobInfo);
        }
Пример #20
0
        public static ItemInfo GetItem(MemoryData itemState)
        {
            ItemInfo item = SettingsLib.ItemInfoList.FirstOrDefault(ite => ite.Code.ToLower().PadLeft(2, '0') == itemState.HexVal);

            return(item);
        }
Пример #21
0
        public static RoleNameInfo GetRoleName(MemoryData race)
        {
            RoleNameInfo roleNameInfo = SettingsLib.RoleNameInfoList.FirstOrDefault(item => item.Code.ToLower().PadLeft(2, '0') == race.HexVal);

            return(roleNameInfo);
        }
Пример #22
0
 private void SetOneTxtItem(TextBox displayTextBox, MemoryData memoryData)
 {
     displayTextBox.Text = memoryData.Value;
     displayTextBox.Tag  = memoryData;
 }