⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gameobjects.cs

📁 EBot source for the popular MMORPG World of Warcraft
💻 CS
📖 第 1 页 / 共 3 页
字号:
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
            return 0;
        }

        public static object Offset()
        {
            try
            {
                if (Main.NeedInject == 0)
                {
                    PlayerBase = Main.wow.ReadInt((uint) (Main.wow.ReadInt((uint) (Main.wow.ReadInt((uint) Offsets.PlayerBase1) + Offsets.PlayerBase2)) + Offsets.PlayerBase3));
                    byte[] data = new byte[0x100];
                    byte[] buffer3 = new byte[0x100];
                    mem.Peek((int) Main.wow.ProcessHandle, Offsets.ObjMgr1, data);
                    int num = BitConverter.ToInt32(data, 0);
                    mem.Peek((int) Main.wow.ProcessHandle, num + Offsets.ObjMgr2, buffer3);
                    s_curMgr = BitConverter.ToInt32(buffer3, 0);
                    byte[] buffer = new byte[0x100];
                    mem.Peek((int) Main.wow.ProcessHandle, s_curMgr + 0xac, buffer);
                    curObj = BitConverter.ToInt32(buffer, 0);
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
            return 0;
        }

        public static object PetInfo()
        {
            try
            {
                if (Main.NeedInject == 0)
                {
                    Offset();
                    int num3 = 0;
                    int curObj = GameObjects.curObj;
                    int min = 0;
                    int max = 0;
                    int num9 = 0;
                    int num13 = 0;
                    int num14 = 0;
                    int num5 = Conversions.ToInteger(func.ReadInt32(Offsets.PlayerTargetGUID));
                    int num4 = 0;
                    while (GameObjects.curObj != 0)
                    {
                        if (Conversions.ToInteger(func.ReadInt32(GameObjects.curObj + 20)).ToString() == "3")
                        {
                            int num6 = Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(GameObjects.curObj + 8), Offsets.UnitFaction))));
                            long num8 = Conversions.ToLong(func.ReadInt32(GameObjects.curObj + 0x30));
                            string str = Conversions.ToString(func.ReadASCIIString(Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(GameObjects.curObj + Offsets.UnitName1), Offsets.UnitName2))))));
                            min = Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(GameObjects.curObj + 8), Offsets.UnitHealth))));
                            max = Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(GameObjects.curObj + 8), Offsets.UnitMaxHealth))));
                            num9 = Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(GameObjects.curObj + 8), Offsets.UnitLevel))));
                            num13 = Conversions.ToInteger(func.ReadSingle(GameObjects.curObj + Offsets.UnitPos, 0));
                            num14 = Conversions.ToInteger(func.ReadSingle(GameObjects.curObj + Offsets.UnitPos, 4));
                            int num12 = Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(GameObjects.curObj + 8), Offsets.UnitTarget))));
                            if (Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(GameObjects.curObj + 8), Offsets.UnitSummonedBy)))) == Main.PlayerGUID)
                            {
                                MyProject.Forms.Main.PetHealthBar.Value = Conversions.ToInteger(func.percentdecimal(min, max));
                                MyProject.Forms.Main.PetHealth.Text = min.ToString() + " / " + max.ToString();
                                Main.pethealthamount = min;
                                num4 = 1;
                                Main.havepet = 1;
                            }
                            else if (num4 == 0)
                            {
                                Main.havepet = 0;
                            }
                        }
                        num3 = Conversions.ToInteger(func.ReadInt32(GameObjects.curObj + 60));
                        if (num3 == GameObjects.curObj)
                        {
                            break;
                        }
                        GameObjects.curObj = num3;
                    }
                    GameObjects.curObj = curObj;
                    if (Main.havepet == 0)
                    {
                        MyProject.Forms.Main.PetHealth.Text = "- - - / - - -";
                        MyProject.Forms.Main.PetHealthBar.Value = 0;
                        Main.pethealthamount = 0;
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
            return 0;
        }

        public static object PlayerCastSpellId()
        {
            int num = 0;
            try
            {
                if (Main.NeedInject == 0)
                {
                    Offset();
                    num = Main.wow.ReadInt(Conversions.ToUInteger(Operators.AddObject(PlayerBase, Offsets.PlayerObjCastSpellId)));
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
            return num;
        }

        public static object PlayerGUID()
        {
            try
            {
                if (Main.NeedInject == 0)
                {
                    Offset();
                    Main.PlayerGUID = Main.wow.ReadInt((uint) (s_curMgr + 0xc0));
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
            return 0;
        }

        public static object PlayerInfo()
        {
            try
            {
                if (Main.NeedInject == 0)
                {
                    object obj4;
                    object obj6;
                    PlayerGUID();
                    Offset();
                    if (Main.wow.ReadInt((uint) Offsets.UnlockLUA) != 0)
                    {
                        Main.wow.WriteInt((uint) Offsets.UnlockLUA, 0);
                    }
                    int min = 0;
                    int max = 0;
                    int num8 = 0;
                    float num2 = Conversions.ToSingle(func.ReadSingle(PlayerBase + Offsets.PlayerObjX, 0));
                    float num3 = Conversions.ToSingle(func.ReadSingle(PlayerBase + Offsets.PlayerObjX, 4));
                    float num4 = Conversions.ToSingle(func.ReadSingle(PlayerBase + Offsets.PlayerObjX, 8));
                    float num5 = Conversions.ToSingle(func.ReadSingle(PlayerBase + Offsets.PlayerObjR, 0));
                    min = Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.UnitHealth))));
                    max = Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.UnitMaxHealth))));
                    num8 = Conversions.ToInteger(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.UnitLevel))));
                    object objectValue = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerExp))));
                    object obj5 = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerMaxExp))));
                    if (MyProject.Forms.Config.Classes.Text == "Rogue")
                    {
                        obj4 = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerObjEnergie))));
                        obj6 = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerObjMaxEnergie))));
                    }
                    else if (MyProject.Forms.Config.Classes.Text == "Warrior")
                    {
                        obj4 = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerObjRage))));
                        obj6 = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerObjMaxRage))));
                    }
                    else if (MyProject.Forms.Config.Classes.Text == "DeathKnight")
                    {
                        obj4 = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerObjRunic))));
                        obj6 = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerObjMaxRunic))));
                    }
                    else
                    {
                        obj4 = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerObjMana))));
                        obj6 = RuntimeHelpers.GetObjectValue(func.ReadInt32(Conversions.ToInteger(Operators.AddObject(func.ReadInt32(PlayerBase + 8), Offsets.PlayerObjMaxMana))));
                    }
                    MyProject.Forms.Main.Label15.Text = Math.Round((double) num2).ToString();
                    MyProject.Forms.Main.Label16.Text = Math.Round((double) num3).ToString();
                    MyProject.Forms.Main.Label17.Text = Math.Round((double) num4).ToString();
                    MyProject.Forms.Main.Label18.Text = Conversions.ToString(Math.Round((double) ((Conversions.ToDouble(num5.ToString()) * 180.0) / 3.1415926535897931)));
                    MyProject.Forms.Main.PlayerHealthBar.Value = Conversions.ToInteger(func.percentdecimal(min, max));
                    MyProject.Forms.Main.PlayerHealth.Text = min.ToString();
                    MyProject.Forms.Main.PlayerLevel.Text = num8.ToString();
                    MyProject.Forms.Main.PlayerExpBar.Value = Conversions.ToInteger(func.percentdecimal(RuntimeHelpers.GetObjectValue(objectValue), RuntimeHelpers.GetObjectValue(obj5)));
                    MyProject.Forms.Main.PlayerManaBar.Value = Conversions.ToInteger(func.percentdecimal(RuntimeHelpers.GetObjectValue(obj4), RuntimeHelpers.GetObjectValue(obj6)));
                    MyProject.Forms.Main.PlayerExp.Text = objectValue.ToString();
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                func.logmsg("[ERROR] Unable to retrieve player info");
                ProjectData.ClearProjectError();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -