예제 #1
0
        public void SetCharacterEquipment(CharNames charName, byte equipmentEquipmentId,
                                          Func <CharMemLoc, IntPtr> addressSelector)
        {
            CharMemLoc charMemLoc = CharMemLoc.ByName(charName);
            var        bytes      = new[] { equipmentEquipmentId };

            _memoryAccessor.WriteMem(Settings.ProcessName, addressSelector(charMemLoc), bytes);
        }
예제 #2
0
        public byte GetCharacterEquipment(CharNames charName, Func <CharMemLoc, IntPtr> addressSelector)
        {
            CharMemLoc charMemLoc = CharMemLoc.ByName(charName);
            var        bytes      = new byte[1];

            _memoryAccessor.ReadMem(Settings.ProcessName, addressSelector(charMemLoc), bytes);
            return(bytes[0]);
        }
예제 #3
0
        public string GetCharacterName(CharNames charName)
        {
            CharMemLoc cml = CharMemLoc.ByName(charName);

            byte[] bytes = new byte[cml.Name.NumBytes];
            _memoryAccessor.ReadMem(ProcessName, cml.Name.Address, bytes);

            string characterName = bytes.MapFf7BytesToString();

            return(characterName);
        }
예제 #4
0
        public void SetCharacterName(CharNames charName, string newName)
        {
            CharMemLoc cml = CharMemLoc.ByName(charName);

            byte[] bytes = newName.MapStringToFf7Bytes();

            if (_momentAccessor.AtMomentOrLater(charName.AllowNamingAfter))
            {
                _memoryAccessor.WriteMem(ProcessName, cml.Name.Address, bytes);
            }
            _memoryAccessor.WriteMem(ProcessName, cml.StartingName.Address, bytes);
        }
예제 #5
0
        public void RemoveArmletMateria(CharNames charNames, int keep = 0)
        {
            CharMemLoc charMemLoc = CharMemLoc.ByName(charNames);

            byte[] emptyRow = { byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue };

            for (int i = ItemSize * keep; i < charMemLoc.ArmorMateria.NumBytes; i += ItemSize)
            {
                IntPtr address = IntPtr.Add(charMemLoc.ArmorMateria.Address, i);
                var    bytes   = new byte[ItemSize];
                _memory.ReadMem(Settings.ProcessName, address, bytes);
                var materia = new MateriaSlot(bytes);
                AddMateria(materia.MateriaId, materia.Experience);
                _memory.WriteMem(Settings.ProcessName, address, emptyRow);
            }
        }