Пример #1
0
        /// <summary>
        /// Gets the current mana of the group member at the specified position within the group.
        /// </summary>
        /// <param name="groupPosition">Zero-indexed position within the group.</param>
        /// <returns>The current mana of the group member at the specified position.</returns>
        public uint GetCurrent(int groupPosition)
        {
            var address = TkAddresses.Group.Mana.Current;
            var offsets = address.Offsets.AddPositionOffset(groupPosition, TkAddresses.Group.PositionOffset);

            return(_classMemory.Read <uint>(address.BaseAddress, offsets));
        }
Пример #2
0
        /// <summary>
        /// Gets the X-coordinate of the NPC's or player's pixel position on the screen.
        /// </summary>
        /// <param name="entityIndex">The index of the NPC or player within the list of entities in the application's memory.</param>
        /// <returns>The X-coordinate of the NPC's or player's pixel position on the screen.</returns>
        public int GetX(int entityIndex)
        {
            var address = TkAddresses.Entity.Pixels.X;
            var offsets = address.Offsets.AddPositionOffset(entityIndex, TkAddresses.Entity.PositionOffset);

            return(_classMemory.Read <int>(address.BaseAddress, offsets));
        }
Пример #3
0
        /// <summary>
        /// Gets the direction in which an NPC or player is facing.
        /// </summary>
        /// <param name="entityIndex">The index of the NPC or player within the list of entities in the application's memory.</param>
        /// <returns>The direction in which an NPC or player is facing.</returns>
        public FacingDirection GetFacingDirection(int entityIndex)
        {
            var address = TkAddresses.Entity.Direction;
            var offsets = address.Offsets.AddPositionOffset(entityIndex, TkAddresses.Entity.PositionOffset);

            return((FacingDirection)_classMemory.Read <short>(address.BaseAddress, offsets));
        }
Пример #4
0
        /// <summary>
        /// Gets the current quantity of the item at the specified position within a player's item inventory.
        /// </summary>
        /// <param name="inventoryPosition">The zero-indexed position of the item within the player's item inventory.</param>
        /// <returns>The current quantity of the item.</returns>

        public int GetQuantity(int inventoryPosition)
        {
            var address = TkAddresses.Self.Inventory.Quantity;
            var offsets = address.Offsets.AddPositionOffset(inventoryPosition, TkAddresses.Self.Inventory.PositionOffset);

            return(_classMemory.Read <int>(address.BaseAddress, offsets));
        }
Пример #5
0
 /// <summary>
 /// Initializes data specific to the player.
 /// </summary>
 /// <param name="classMemory">The application memory for the player's game client.</param>
 public TkSelf(ClassMemory classMemory)
 {
     _classMemory = classMemory;
     Mana         = new SelfMana(_classMemory);
     Name         = _classMemory.ReadString(TkAddresses.Self.Name, Constants.DefaultEncoding);
     Path         = _classMemory.ReadString(TkAddresses.Self.Path, Constants.DefaultEncoding);
     Uid          = _classMemory.Read <uint>(TkAddresses.Self.Uid);
     Vita         = new SelfVita(_classMemory);
 }