Esempio n. 1
0
 public WoWObject GetTarget(WoWObjectManager manager)
 {
     var targetGuid = Process.Memory.Read<Guid>(Process.Native.MainModule.BaseAddress + _targetIntPtr.ToInt32());
     return manager.EnumVisibleObjects().FirstOrDefault(o => o.Guid == targetGuid);
 }
Esempio n. 2
0
        public WoWObject GetTarget(WoWObjectManager manager)
        {
            var targetGuid = Process.Memory.Read <Guid>(Process.Native.MainModule.BaseAddress + _targetIntPtr.ToInt32());

            return(manager.EnumVisibleObjects().FirstOrDefault(o => o.Guid == targetGuid));
        }
Esempio n. 3
0
        public override void Update()
        {
            if ((Profile == null) || (DataModel == null) || (_process == null))
                return;

            var dataModel = (WoWDataModel) DataModel;

            var objectManager = new WoWObjectManager(_process,
                _pointer.GameAddresses.First(a => a.Description == "ObjectManager").BasePointer);
            var nameCache = new WoWNameCache(_process,
                _pointer.GameAddresses.First(a => a.Description == "NameCache").BasePointer);
            var player = new WoWPlayer(_process,
                _pointer.GameAddresses.First(a => a.Description == "LocalPlayer").BasePointer,
                _pointer.GameAddresses.First(a => a.Description == "TargetGuid").BasePointer, true);

            dataModel.Player = player;
            if (dataModel.Player != null && dataModel.Player.Guid != Guid.Empty)
            {
                dataModel.Player.UpdateDetails(nameCache);
                var target = player.GetTarget(objectManager);
                if (target == null)
                    return;

                dataModel.Target = new WoWUnit(target.Process, target.BaseAddress);
                dataModel.Target.UpdateDetails(nameCache);
            }
            else
            {
                dataModel.Target = null;
            }
        }