Ejemplo n.º 1
0
        private static uint GetBaseSkill(Enums.SkillLine skill)
        {
            try
            {
                uint descriptorsArray =
                    Memory.WowMemory.Memory.ReadUInt(ObjectManager.ObjectManager.Me.GetBaseAddress +
                                                     Descriptors.StartDescriptors);
                uint addressGD = descriptorsArray + ((uint)Descriptors.PlayerFields.Skill * Descriptors.Multiplicator);
                uint v2        = 0;
                uint id        = 0;
                do
                {
                    short value = Memory.WowMemory.Memory.ReadShort(addressGD + v2);

                    if (value == (int)skill)
                    {
                        break;
                    }
                    ++id;
                    v2 += 2;
                } while (v2 <= 0x200);

                return(id);
            }
            catch (Exception exception)
            {
                Logging.WriteError("GetBaseSkill(Enums.SkillLine skill): " + exception);
            }
            return(0);
        }
Ejemplo n.º 2
0
        public static int GetMaxValue(Enums.SkillLine skill)
        {
            try
            {
                uint id = GetBaseSkill(skill);

                if (id > 0)
                {
                    uint descriptorsArray =
                        Memory.WowMemory.Memory.ReadUInt(ObjectManager.ObjectManager.Me.GetBaseAddress +
                                                         Descriptors.StartDescriptors);
                    uint addressGD = descriptorsArray +
                                     ((uint)Descriptors.PlayerFields.Skill * Descriptors.Multiplicator);
                    return(Memory.WowMemory.Memory.ReadShort(id * 0x2 + addressGD + (uint)Addresses.Player.SkillMaxValue));
                }
                return(0);
            }
            catch (Exception exception)
            {
                Logging.WriteError("GetMaxValue(Enums.SkillLine skill): " + exception);
            }
            return(0);
        }