public void SetAbility(AbilityType type, bool setTo = true) { IntPtr abilities = (IntPtr)PlayerUberStateGroup.Read <ulong>(Program, 0xb8, 0x0, 0x18, 0x30, 0x10, 0x18); //.Count int count = Program.Read <int>(abilities, 0x18); //.Items abilities = (IntPtr)Program.Read <ulong>(abilities, 0x10); byte[] data = Program.Read(abilities + 0x20, count * 0x8); for (int i = 0; i < count; i++) { //.Items[i] Ability ability = Program.Read <Ability>((IntPtr)BitConverter.ToUInt64(data, i * 0x8), 0x10); if (ability.Type == type) { ability.HasAbility = (byte)(setTo ? 1 : 0); Program.Write((IntPtr)BitConverter.ToUInt64(data, i * 0x8), ability.ToBytes(), 0x10); if (AbilityToEquip.ContainsKey(type)) { SetInvItem(AbilityToEquip[type], setTo); } return; } } }
public static EquipmentType?Equip(this AbilityType t) => AbilityToEquip.Get(t);