Exemple #1
0
        public static void RefreshNewGameObjects(Vector2 playerpos, BlackMagic w) {
            GameObject TempObject = new GameObject(Initializer.FirstObject);
            int i = 0;
            newGameObjects.Clear();
            while ((uint)TempObject.BaseAddress != 0 && i < 500) {
                i++;
                TempObject.Unit = new WoWModels.WoWUnit();
                TempObject.Unit.RefreshForRadar(w, TempObject);
                bool shit = false;
                foreach(GameObject go in NearbyGameObjects) {
                    if (go.GUID == TempObject.GUID) {
                        shit = true;
                    }
                }
                if (!shit) {
                    newGameObjects.Add(TempObject);
                }
                try {
                    TempObject = new GameObject(w, (UIntPtr)w.ReadUInt(((uint)TempObject.BaseAddress + (uint)ConstOffsets.ObjectManager.NextObject)));
                }
                catch {
                    break;
                }

            }
            foreach(GameObject ngo in newGameObjects) {
                ngo.Unit.Position = new Vector3(w.ReadFloat((uint)newGameObjects[0].BaseAddress + 0x110), w.ReadFloat((uint)newGameObjects[0].BaseAddress + 0x114), 104);
            }
        }
Exemple #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize() {
            // TODO: Add your initialization logic here
            if (!Initializer.ConnectToGame(out wow, Program.PROCESS_WINDOW_TITLE)) {
                throw new Exception("No compatible Client");
            }
            clientInfo = new WoWGlobal(wow);
            base.Initialize();
            Vector3 beluka = new GameObject(wow, clientInfo.PlayerGUID).Unit.Position;
            PlayerPos = new Vector2(beluka.X, beluka.Y);

            Bellona.EveryoneGetinHere.RefreshNearbyGameObjects(PlayerPos, wow, 500);

            Bellona.EveryoneGetinHere.RefreshNewGameObjects(PlayerPos, wow);

            System.Diagnostics.Debug.WriteLine("LOL");
        }
Exemple #3
0
 public static bool ConnectToGame(out BlackMagic w, string title) {
     w = new BlackMagic();
     try {
         if (!w.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle(title))) {
             return false;
         }
         Console.WriteLine("Process found...");
         uint ObjMgrAddr = w.ReadUInt(w.ReadUInt((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.ObjectManager.CurMgrPointer) + (uint)ConstOffsets.ObjectManager.CurMgrOffset);
         Console.WriteLine("Object Manager found... at x{0:X}",ObjMgrAddr);
         FirstObject = new GameObject(w,(UIntPtr)w.ReadUInt(ObjMgrAddr + (uint)ConstOffsets.ObjectManager.FirstObject));
         Console.WriteLine("First Object found...");
         return true;
         
     }
     catch {
         return false;
     }
 }
Exemple #4
0
        public static void GetEveryObject(ref List<RadarPlayer> players, Vector2 playerpos, BlackMagic w) {
            players.Clear();
            GameObject TempObject = new GameObject(Initializer.FirstObject);
            int i = 0;
            while ((uint)TempObject.BaseAddress != 0 && i < 300) {
                i++;
                TempObject.Unit = new WoWModels.WoWUnit();
                TempObject.Unit.RefreshForRadar(w, TempObject);
                if (Vector3.Distance(TempObject.Unit.Position, new Vector3(playerpos, TempObject.Unit.Position.Z)) < 50) {
                    players.Add(new RadarPlayer(TempObject));
                }
                try {
                    TempObject = new GameObject(w, (UIntPtr)w.ReadUInt(((uint)TempObject.BaseAddress + (uint)ConstOffsets.ObjectManager.NextObject)));
                }
                catch {
                    return;
                }
            }

        }
Exemple #5
0
        public static void RefreshNearbyGameObjects(Vector2 playerpos, BlackMagic w, int threshhold) {
            GameObject TempObject = new GameObject(Initializer.FirstObject);
            int i = 0;
            NearbyGameObjects.Clear();
            while ((uint)TempObject.BaseAddress != 0) {
                i++;
                TempObject.Unit = new WoWModels.WoWUnit();
                TempObject.Unit.RefreshForRadar(w, TempObject);
                //if (Vector3.Distance(TempObject.Unit.Position, new Vector3(playerpos, TempObject.Unit.Position.Z)) < threshhold) {
                NearbyGameObjects.Add(TempObject);
                //}
                try {
                    TempObject = new GameObject(w, (UIntPtr)w.ReadUInt(((uint)TempObject.BaseAddress + (uint)ConstOffsets.ObjectManager.NextObject)));
                }
                catch {
                    break;
                }

            }

        }
Exemple #6
0
 public GameObject(GameObject other) {
     this.BaseAddress = other.BaseAddress;
     this.GUID = other.GUID;
     this.DescriptorArrayAddress = other.DescriptorArrayAddress;
     this.BuffBigArrayAddress = other.BuffBigArrayAddress;
     this.BuffSmallArrayAddress = other.BuffSmallArrayAddress;
     this.Unit = new WoWUnit();
 }
Exemple #7
0
 public static bool HPMin(ref GameObject minimum, GameObject next) {
     if (next.GUID == 0 || minimum.unit.GetHealthPercent() < next.Unit.GetHealthPercent()) {
         return false;
     }
     else{
         minimum = next;
         return true;
     }
 }
Exemple #8
0
        public GameObject(BlackMagic w, UInt64 guid) {
            try {
                this.GUID = guid;
                if (this.GUID != 0) {
                    GameObject TempObject = new GameObject(Initializer.FirstObject);
                    while ((uint)TempObject.BaseAddress != 0) {
                        if (TempObject.GUID == this.GUID) {
                            this.BaseAddress = TempObject.BaseAddress;
                            this.GUID = TempObject.GUID;
                            this.DescriptorArrayAddress = TempObject.DescriptorArrayAddress;
                            this.BuffBigArrayAddress = TempObject.BuffBigArrayAddress;
                            this.BuffSmallArrayAddress = TempObject.BuffSmallArrayAddress;
                            this.MovementArrayAddress = (UIntPtr)w.ReadUInt((uint)this.BaseAddress + (uint)ConstOffsets.ObjectManager.LocalMovementArray);
                            this.RefreshUnit(w);
                            return;
                        }
                        else {
                            TempObject = new GameObject(w, (UIntPtr)w.ReadUInt(((uint)TempObject.BaseAddress + (uint)ConstOffsets.ObjectManager.NextObject)));
                        }
                    }
                    //Program.WowPrinter.Print(new Error(String.Format("Couldnt Find Gameobject with GUID 0x{0:X16}", guid)));
                }
                this.Unit = new WoWUnit();

            }
            catch {
                this.Unit = new WoWUnit();
                //Program.WowPrinter.Print(ConstStrings.GameObjectConstructorError);
            }
        }
Exemple #9
0
 public static void RefreshObjectMangaer(BlackMagic w) {
     uint ObjMgrAddr = w.ReadUInt(w.ReadUInt((uint)w.MainModule.BaseAddress + (uint)ConstOffsets.ObjectManager.CurMgrPointer) + (uint)ConstOffsets.ObjectManager.CurMgrOffset);
     FirstObject = new GameObject(w, (UIntPtr)w.ReadUInt(ObjMgrAddr + (uint)ConstOffsets.ObjectManager.FirstObject));
 }
Exemple #10
0
        private void RefreshBuffs(BlackMagic w, GameObject go) {
            this.Buffs.Clear();
            if (this.AddressofTheBuffs == BuffStorage.Unkown) {
                if ((uint)go.BuffBigArrayAddress >= (uint)w.MainModule.BaseAddress) {
                    this.AddressofTheBuffs = BuffStorage.BigArray;
                }
                else {
                    this.AddressofTheBuffs = BuffStorage.SmallArray;
                }
            }
            while (true) {
                if (FillBuffsList(w, go)) {
                    break;
                }
            }


        }
Exemple #11
0
        public bool RefreshForRadar(BlackMagic w, GameObject go) {
            try {
                this.WowClass = (WoWClass)w.ReadByte((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Class8);

                this.position.X = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.X);
                this.position.Y = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.Y);
                this.position.Z = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.Z);
                float temprot = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.Rotation);

                if (temprot > Math.PI) {
                    this.Rotation = -(2 * Math.PI - temprot);
                }
                else {
                    this.Rotation = temprot;
                }
                return true;
            }
            catch {
                return false;
            }

        }
Exemple #12
0
        public void Refresh(BlackMagic w, GameObject go) {
            try {
                this.WowClass = (WoWClass)w.ReadByte((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Class8);
                this.Shapeshift = (ShapeshiftForm)w.ReadByte((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.ShapeShift);
                this.Role = Role.Unknown;

                this.Level = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Level);
                this.Health = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Health);
                this.MaxHealth = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.MaxHealth);
                this.Power = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Power);
                this.MaxPower = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.MaxPower);
                this.SecondaryPower = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.SecondaryPower);
                this.MovingInfo = new MovementFlags(w.ReadByte((uint)go.MovementArrayAddress + (uint)ConstOffsets.Movements.IsMoving8));
                this.HolyPower = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.HolyPower);
                this.Faction = w.ReadUInt((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.Faction);
                this.TargetGUID = w.ReadUInt64((uint)go.DescriptorArrayAddress + (uint)ConstOffsets.Descriptors.TargetGUID);
                //byte temp = w.ReadByte((uint)go.BuffSmallArrayAddress + (uint)ConstOffsets.Descriptors.IsinCombat);
                this.IsInCombat = (w.ReadByte((w.ReadUInt((uint)go.BaseAddress + (uint)ConstOffsets.Movements.IsinCombatOffset1)) + (uint)ConstOffsets.Movements.IsinCombatOffset2+2)& 0x8)!=0;
                this.position.X = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.X);
                this.position.Y = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.Y);
                this.position.Z = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.Z);

                this.CastingSpellID = w.ReadUInt((uint)go.BaseAddress + (uint)ConstOffsets.CastingInfo.IsCasting);
                this.ChannelingSpellID = w.ReadUInt((uint)go.BaseAddress + (uint)ConstOffsets.CastingInfo.ChanneledCasting);
                this.BalancePower = w.ReadInt((uint)go.BaseAddress + (uint)ConstOffsets.CastingInfo.BalancePower);
                //this.BalanceStance = (BalanceFlag)(w.ReadByte((uint)go.BaseAddress + (uint)ConstOffsets.CastingInfo.BalanceState) & 0x01);
                float temprot = w.ReadFloat((uint)go.BaseAddress + (uint)ConstOffsets.Positions.Rotation);

                if (temprot > Math.PI) {
                    this.Rotation = -(2 * Math.PI - temprot);
                }
                else {
                    this.Rotation = temprot;
                }
                this.RefreshBuffs(w, go);
            }
            catch {

            }

            //this.Position = new Vector3(x,y,z);
        }
Exemple #13
0
 public WoWUnit(BlackMagic w, GameObject go) {
     this.Refresh(w, go);
 }
Exemple #14
0
 public RadarPlayer(GameObject go, int rot) : base(new Vector2(go.Unit.Position.X, go.Unit.Position.Y), (float)rot, go.Unit.WowClass) {
     selected = true;
 }
Exemple #15
0
 public RadarPlayer(GameObject go) : base(new Vector2(go.Unit.Position.X,go.Unit.Position.Y), (float)go.Unit.Rotation, go.Unit.WowClass) {
     selected = true;
 }
Exemple #16
0
 /// <summary>
 /// Allows the game to run logic such as updating the world,
 /// checking for collisions, gathering input, and playing audio.
 /// </summary>
 /// <param name="gameTime">Provides a snapshot of timing values.</param>
 protected override void Update(GameTime gameTime) {
     // Allows the game to exit
     if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) {
         this.Exit();
     }
     SelectionBoxRefresh();
     if ((gameTime.TotalGameTime - this.gyula) > TimeSpan.FromMilliseconds(750)) {
         this.gyula = gameTime.TotalGameTime;
         //Bellona.EveryoneGetinHere.RefreshNearbyGameObjects(PlayerPos, wow, 50);
         Bellona.EveryoneGetinHere.RefreshNewGameObjects(PlayerPos, wow);
     }
     if ((gameTime.TotalGameTime - this.bela) > TimeSpan.FromMilliseconds(125)) {
         this.bela = gameTime.TotalGameTime;
         WoWRaid wr = new WoWRaid(wow);
         Vector3 beluka = new GameObject(wow, clientInfo.PlayerGUID).Unit.Position;
         PlayerPos = new Vector2(beluka.X, beluka.Y);
         Console.WriteLine(Bellona.EveryoneGetinHere.NearbyGameObjects.Count + " " + Bellona.EveryoneGetinHere.newGameObjects.Count);
         unitsToDraw.Clear();
         foreach (GameObject go in Bellona.EveryoneGetinHere.NearbyGameObjects) {
             go.Unit.RefreshForRadar(wow, go);
             unitsToDraw.Add(new RadarPlayer(go));
         }
         spellsToDraw.Clear();
         foreach (GameObject go in Bellona.EveryoneGetinHere.newGameObjects) {
             spellsToDraw.Add(new RadarPlayer(go,0));
         }
     }
     base.Update(gameTime);
 }
Exemple #17
0
 private bool FillBuffsList(BlackMagic w, GameObject go) {
     uint addr = 0;
     uint i = 0;
     uint temp = 1;
     switch (this.AddressofTheBuffs) {
         case BuffStorage.Unkown:
             throw new NullReferenceException();
         case BuffStorage.SmallArray:
             addr = (uint)go.BuffSmallArrayAddress;
             break;
         case BuffStorage.BigArray:
             addr = (uint)go.BuffBigArrayAddress;
             break;
     }
     try {
         while (temp != 0 && temp < 121820) {
             temp = w.ReadUInt(addr + (0x08 * i));
             i++;
             if (temp != 0 && temp < 121820) {
                 this.Buffs.Add(temp);
             }
         }
         return true;
     }
     catch {
         switch (this.AddressofTheBuffs) {
             case BuffStorage.Unkown:
                 throw new NullReferenceException();
             case BuffStorage.SmallArray:
                 this.AddressofTheBuffs = BuffStorage.Unkown;
                 break;
             case BuffStorage.BigArray:
                 this.AddressofTheBuffs = BuffStorage.SmallArray;
                 break;
         }
         return false;
     }
 }