コード例 #1
0
        public override void Update(IMemoryApi memoryApi, IOffsetList offsetList)
        {
            base.Update(memoryApi, offsetList);

            if (memoryApi.Read(DescriptorAddress + WowObjectDescriptor.EndOffset, out WowDynobjectDescriptor objPtr) &&
                memoryApi.Read(IntPtr.Add(BaseAddress, (int)offsetList.WowDynobjectPosition), out Vector3 position))
            {
                Caster   = objPtr.Caster;
                Radius   = objPtr.Radius;
                SpellId  = objPtr.SpellId;
                Position = position;
            }
        }
コード例 #2
0
ファイル: WowObject335a.cs プロジェクト: fargo315/AmeisenBotX
 public virtual void Update(IMemoryApi memoryApi, IOffsetList offsetList)
 {
     if (DescriptorAddress != IntPtr.Zero && memoryApi.Read(DescriptorAddress, out WowObjectDescriptor obj))
     {
         RawObject = obj;
     }
 }
コード例 #3
0
        public override void Update(IMemoryApi memoryApi, IOffsetList offsetList)
        {
            base.Update(memoryApi, offsetList);

            if (!memoryApi.Read(DescriptorAddress + WowObjectDescriptor.EndOffset,
                                out WowItemDescriptor objPtr))
            {
                return;
            }

            Count = objPtr.StackCount;
            Owner = objPtr.Owner;

            ItemEnchantments = new List <ItemEnchantment>
            {
                objPtr.Enchantment1,
                objPtr.Enchantment2,
                objPtr.Enchantment3,
                objPtr.Enchantment4,
                objPtr.Enchantment5,
                objPtr.Enchantment6,
                objPtr.Enchantment7,
                objPtr.Enchantment8,
                objPtr.Enchantment9,
                objPtr.Enchantment10,
                objPtr.Enchantment11,
                objPtr.Enchantment12,
            };
        }
コード例 #4
0
        public override void Update(IMemoryApi memoryApi, IOffsetList offsetList)
        {
            base.Update(memoryApi, offsetList);

            if (memoryApi.Read(DescriptorAddress + WowObjectDescriptor.EndOffset, out WowGameobjectDescriptor objPtr) &&
                memoryApi.Read(IntPtr.Add(BaseAddress, (int)offsetList.WowGameobjectPosition), out Vector3 position))
            {
                GameObjectType = (WowGameObjectType)objPtr.GameobjectBytes1;
                CreatedBy      = objPtr.CreatedBy;
                Bytes0         = objPtr.GameobjectBytes0;
                DisplayId      = objPtr.DisplayId;
                Faction        = objPtr.Faction;
                Flags          = new(objPtr.Flags);
                Level          = objPtr.Level;
                Position       = position;
            }
        }
コード例 #5
0
ファイル: WowCorpse335a.cs プロジェクト: fargo315/AmeisenBotX
        public override void Update(IMemoryApi memoryApi, IOffsetList offsetList)
        {
            base.Update(memoryApi, offsetList);

            if (memoryApi.Read(DescriptorAddress + WowObjectDescriptor.EndOffset, out WowCorpseDescriptor obj))
            {
                RawWowCorpse = obj;
            }
        }
コード例 #6
0
ファイル: WowPlayer335a.cs プロジェクト: fargo315/AmeisenBotX
        public override string ReadName(IMemoryApi memoryApi, IOffsetList offsetList)
        {
            if (memoryApi.Read(IntPtr.Add(offsetList.NameStore, (int)offsetList.NameMask), out uint nameMask) &&
                memoryApi.Read(IntPtr.Add(offsetList.NameStore, (int)offsetList.NameBase), out uint nameBase))
            {
                uint shortGuid = (uint)Guid & 0xfffffff;
                uint offset    = 12 * (nameMask & shortGuid);

                if (memoryApi.Read(new(nameBase + offset + 8), out uint current) &&
                    memoryApi.Read(new(nameBase + offset), out offset))
                {
                    if ((current & 0x1) == 0x1)
                    {
                        return(string.Empty);
                    }

                    memoryApi.Read(new(current), out uint testGuid);

                    while (testGuid != shortGuid)
                    {
                        memoryApi.Read(new(current + offset + 4), out current);

                        if ((current & 0x1) == 0x1)
                        {
                            return(string.Empty);
                        }

                        memoryApi.Read(new(current), out testGuid);
                    }

                    if (memoryApi.ReadString(new(current + (int)offsetList.NameString), Encoding.UTF8, out string name, 16))
                    {
                        return(name);
                    }
                }
            }

            return(string.Empty);
        }
コード例 #7
0
ファイル: WowPlayer335a.cs プロジェクト: fargo315/AmeisenBotX
        public override void Update(IMemoryApi memoryApi, IOffsetList offsetList)
        {
            base.Update(memoryApi, offsetList);

            if (memoryApi.Read(DescriptorAddress + WowObjectDescriptor.EndOffset + WowUnitDescriptor.EndOffset, out WowPlayerDescriptor obj))
            {
                RawWowPlayer = obj;

                questlogEntries = new QuestlogEntry[]
                {
                    obj.QuestlogEntry1,
                    obj.QuestlogEntry2,
                    obj.QuestlogEntry3,
                    obj.QuestlogEntry4,
                    obj.QuestlogEntry5,
                    obj.QuestlogEntry6,
                    obj.QuestlogEntry7,
                    obj.QuestlogEntry8,
                    obj.QuestlogEntry9,
                    obj.QuestlogEntry10,
                    obj.QuestlogEntry11,
                    obj.QuestlogEntry12,
                    obj.QuestlogEntry13,
                    obj.QuestlogEntry14,
                    obj.QuestlogEntry15,
                    obj.QuestlogEntry16,
                    obj.QuestlogEntry17,
                    obj.QuestlogEntry18,
                    obj.QuestlogEntry19,
                    obj.QuestlogEntry20,
                    obj.QuestlogEntry21,
                    obj.QuestlogEntry22,
                    obj.QuestlogEntry23,
                    obj.QuestlogEntry24,
                    obj.QuestlogEntry25,
                };

                itemEnchantments = new VisibleItemEnchantment[]
                {
                    obj.VisibleItemEnchantment1,
                    obj.VisibleItemEnchantment2,
                    obj.VisibleItemEnchantment3,
                    obj.VisibleItemEnchantment4,
                    obj.VisibleItemEnchantment5,
                    obj.VisibleItemEnchantment6,
                    obj.VisibleItemEnchantment7,
                    obj.VisibleItemEnchantment8,
                    obj.VisibleItemEnchantment9,
                    obj.VisibleItemEnchantment10,
                    obj.VisibleItemEnchantment11,
                    obj.VisibleItemEnchantment12,
                    obj.VisibleItemEnchantment13,
                    obj.VisibleItemEnchantment14,
                    obj.VisibleItemEnchantment15,
                    obj.VisibleItemEnchantment16,
                    obj.VisibleItemEnchantment17,
                    obj.VisibleItemEnchantment18,
                    obj.VisibleItemEnchantment19,
                };
            }

            if (memoryApi.Read(IntPtr.Add(BaseAddress, (int)offsetList.WowUnitSwimFlags), out uint swimFlags))
            {
                IsSwimming = (swimFlags & 0x200000) != 0;
            }

            if (memoryApi.Read(IntPtr.Add(BaseAddress, (int)offsetList.WowUnitFlyFlagsPointer), out IntPtr flyFlagsPointer) &&
                memoryApi.Read(IntPtr.Add(flyFlagsPointer, (int)offsetList.WowUnitFlyFlags), out uint flyFlags))
            {
                IsFlying = (flyFlags & 0x2000000) != 0;
            }

            if (memoryApi.Read(offsetList.BreathTimer, out int breathTimer))
            {
                IsUnderwater = breathTimer > 0;
            }

            if (memoryApi.Read(offsetList.ComboPoints, out byte comboPoints))
            {
                ComboPoints = comboPoints;
            }

            IsGhost = HasBuffById(8326);
        }