Exemplo n.º 1
0
        /// <summary>
        /// Gets the name and quantity of the item at the specified position within a player's item inventory.
        /// The format used is a more consistent approximation of the format used in-game for 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 name and quantity of the item in a more consistent approximation of the format used in-game for a
        /// player's item inventory.</returns>
        public string GetDisplayName(int inventoryPosition)
        {
            var address = TkAddresses.Self.Inventory.DisplayName;
            var offsets = address.Offsets.AddPositionOffset(inventoryPosition, TkAddresses.Self.Inventory.PositionOffset);

            return(_classMemory.ReadString(address.BaseAddress, offsets, Constants.DefaultEncoding));
        }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the name of the group member at the specified position within the group.
        /// </summary>
        /// <param name="groupPosition">Zero-indexed position within the group.</param>
        /// <returns>The name of the group member at the specified position.</returns>
        public string GetName(int groupPosition)
        {
            var address = TkAddresses.Group.Name;
            var offsets = address.Offsets.AddPositionOffset(groupPosition, TkAddresses.Group.PositionOffset);

            return(_classMemory.ReadString(address.BaseAddress, offsets, Constants.DefaultEncoding));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the name of the NPC or player. If the entity is an NPC, there will be no value for its name.
        /// </summary>
        /// <param name="entityIndex">The index of the NPC or player within the list of entities in the application's memory.</param>
        /// <returns>The name of the NPC or player.</returns>
        public string GetName(int entityIndex)
        {
            var address = TkAddresses.Entity.Name;
            var offsets = address.Offsets.AddPositionOffset(entityIndex, TkAddresses.Entity.PositionOffset);

            return(_classMemory.ReadString(address.BaseAddress, offsets, Constants.DefaultEncoding));
        }