Beispiel #1
0
 public static void packetHandler(string packet)
 {
     string[] strArray = packet.Split(new char[] { '|' });
     if (strArray[0] == "LOGIN")
     {
         setupClientWindow();
         setupHero(Module1.mainDir + "hero.dll");
         setupMoreClient();
     }
     if (strArray[0] == "SEL")
     {
         mainFunctions.log("Selected ship: " + strArray[1]);
         DOShip expression = mainFunctions.getShipByID(Conversions.ToInteger(strArray[1]));
         if (Information.IsNothing(expression))
         {
             NPCShip ship2 = mainFunctions.getNPCByID(Conversions.ToInteger(strArray[1]));
             sendPacket("0|N|" + Conversions.ToString(ship2.getUserID()) + "|" + Conversions.ToString(ship2.getShipType()) + "|" + Conversions.ToString(ship2.getHP()) + "|" + Conversions.ToString(ship2.getMaxHP()) + "|" + Conversions.ToString(ship2.getSHD()) + "|" + Conversions.ToString(ship2.getMaxSHD()) + "|0");
         }
         else
         {
             sendPacket("0|N|" + Conversions.ToString(expression.getUserID()) + "|" + Conversions.ToString(expression.getShipType()) + "|" + Conversions.ToString(expression.getHP()) + "|" + Conversions.ToString(expression.getMaxHP()) + "|" + Conversions.ToString(expression.getSHD()) + "|" + Conversions.ToString(expression.getMaxSHD()) + "|" + Conversions.ToString(expression.getCloaked()));
         }
     }
     if (strArray[0] == "a")
     {
         mainFunctions.log("Attacking ship: " + strArray[1]);
         if (Information.IsNothing(mainFunctions.getShipByID(Conversions.ToInteger(strArray[1]))))
         {
             NPCShip ship4 = mainFunctions.getNPCByID(Conversions.ToInteger(strArray[1]));
             Attack_Module.attackingNPC(Conversions.ToInteger(strArray[1]));
         }
         Module1.mainHero.setLaserAttacking(true);
     }
     if (strArray[0] == "1")
     {
         Module1.mainHero.setPosX(Conversions.ToInteger(strArray[1]));
         Module1.mainHero.setPosY(Conversions.ToInteger(strArray[2]));
     }
     if (strArray[0] == "u")
     {
         Module1.mainHero.setAmmoType(Conversions.ToInteger(strArray[1]));
         mainFunctions.log("Hero's ammo is now: " + Conversions.ToString(Module1.mainHero.getAmmoType()));
     }
     if (strArray[0] == "G")
     {
         Module1.mainHero.setLaserAttacking(false);
     }
     if (strArray[0] == "S")
     {
         if (strArray[1] == "SMB")
         {
             if (sbombCooldown)
             {
                 mainFunctions.log("wait... sbmb cooling...");
                 return;
             }
             sendPacket("0|n|SMB|" + Conversions.ToString(Module1.mainHero.getID()));
             Mine_Module.heroSbombd(Module1.mainHero.getPosX(), Module1.mainHero.getPosY());
             mainFunctions.log("Hero set off Sbomb...");
         }
         else if (strArray[1] == "ISH")
         {
             if (instaCooldown)
             {
                 mainFunctions.log("Wait... Insta cooling...");
                 return;
             }
             sendPacket("0|n|ISH|" + Conversions.ToString(Module1.mainHero.getID()));
             if (heroInsta)
             {
                 return;
             }
             new Thread(new ThreadStart(Mine_Module.heroInstad)).Start();
             mainFunctions.log("Hero set off Insta Shield...");
         }
         else if (strArray[1] == "EMP")
         {
             if (empCooldown)
             {
                 mainFunctions.log("Wait... EMP cooling...");
                 return;
             }
             sendPacket("0|n|EMP|" + Conversions.ToString(Module1.mainHero.getID()));
             if (heroEMP)
             {
                 return;
             }
             new Thread(new ThreadStart(Mine_Module.heroEMPd)).Start();
             mainFunctions.log("Hero set off EMP...");
         }
     }
     if (strArray[0] == "d")
     {
         Module1.mainHero.setRocketType(Conversions.ToInteger(strArray[1]));
         mainFunctions.log("Hero's rocket ammo is now: " + strArray[1]);
     }
     if (strArray[0] == "l")
     {
     }
     if (strArray[0] == "j")
     {
         Portal portal = Portal_Module.getCurPortal(Module1.mainHero.getPosX(), Module1.mainHero.getPosY());
         if (!Information.IsNothing(portal))
         {
             heroJumping = true;
             sendPacket("0|U|99|" + Conversions.ToString(portal.getID()));
             mainFunctions.log("Sent jumping thingy...");
             Thread.Sleep(0xbb8);
             mainFunctions.log("Jump should be done now...");
             Module1.mainHero.setMapID(Portal_Module.getNewMap(portal.getID()));
             Vector vector = Portal_Module.getHeroPos(portal.getID());
             Module1.mainHero.setPosX((int)Math.Round(vector.x));
             Module1.mainHero.setPosY((int)Math.Round(vector.y));
             string text = "0|I|" + Conversions.ToString(Module1.mainHero.getID()) + "|" + Module1.mainHero.getUsername() + "|" + Conversions.ToString(Module1.mainHero.getShipID()) + "|" + Conversions.ToString(Module1.mainHero.getSpeed()) + "|" + Conversions.ToString(Module1.mainHero.getShield()) + "|" + Conversions.ToString(Module1.mainHero.getMaxShield()) + "|" + Conversions.ToString(Module1.mainHero.getHP()) + "|" + Conversions.ToString(Module1.mainHero.getMaxHP()) + "|" + Conversions.ToString(Module1.mainHero.getCargo()) + "|" + Conversions.ToString(Module1.mainHero.getMaxCargo()) + "|" + Conversions.ToString(Module1.mainHero.getPosX()) + "|" + Conversions.ToString(Module1.mainHero.getPosY()) + "|" + Conversions.ToString(Module1.mainHero.getMapID()) + "|" + Conversions.ToString(Module1.mainHero.getCompany()) + "|" + Conversions.ToString(Module1.mainHero.getClanID()) + "|" + Conversions.ToString(Module1.mainHero.getMaxLaserAmmo()) + "|" + Conversions.ToString(Module1.mainHero.getMaxRocketAmmo()) + "|" + Conversions.ToString(Module1.mainHero.getExpansionID()) + "|" + Conversions.ToString(Convert.ToInt32(Module1.mainHero.getPremium())) + "|" + Conversions.ToString(Module1.mainHero.getExperience()) + "|" + Conversions.ToString(Module1.mainHero.getHonor()) + "|" + Conversions.ToString(Module1.mainHero.getLevel()) + "|" + Conversions.ToString(Module1.mainHero.getCredits()) + "|" + Conversions.ToString(Module1.mainHero.getUridium()) + "|" + Conversions.ToString(Module1.mainHero.getJackpot()) + "|" + Conversions.ToString(Module1.mainHero.getAdmin()) + "|" + Module1.mainHero.getClan() + "|" + Conversions.ToString(Module1.mainHero.getGalaxyGatesDone()) + "|" + Conversions.ToString(Convert.ToInt32(Module1.mainHero.getCloaked())) + "|0";
             MyProject.Computer.FileSystem.WriteAllText(@"C:\DO_Hacks\hero.dll", text, false);
             string str = Conversions.ToString(Module1.mainHero.getLaserAmmo1()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo2()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo3()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo4()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo5()) + "|" + Conversions.ToString(Module1.mainHero.getLaserAmmo6());
             MyProject.Computer.FileSystem.WriteAllText(@"C:\DO_Hacks\hero_laserammo.dll", str, false);
             string str2 = Conversions.ToString(Module1.mainHero.getRocketAmmo1()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo2()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo3()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo4()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo5()) + "|0|0|" + Conversions.ToString(Module1.mainHero.getRocketAmmo6()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo7()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo8()) + "|" + Conversions.ToString(Module1.mainHero.getRocketAmmo9()) + "|0|0|0";
             MyProject.Computer.FileSystem.WriteAllText(@"C:\DO_Hacks\hero_rocketammo.dll", str2, false);
             mainFunctions.log("Saved Hero...");
             setupHero(Module1.mainDir + "hero.dll");
             setupMoreClient();
             heroJumping = false;
         }
         else
         {
             mainFunctions.log("not close enough to portal...");
         }
     }
 }
Beispiel #2
0
        public static void heroSbombd(double heroX, double heroY)
        {
            IEnumerator enumerator;

            try
            {
                enumerator = Module1.displayNPCs.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    int     userID = Conversions.ToInteger(enumerator.Current);
                    NPCShip ship   = mainFunctions.getNPCByID(userID);
                    double  num13  = ship.getPosX();
                    double  num14  = ship.getPosY();
                    double  num11  = heroX - num13;
                    double  num12  = heroY - num14;
                    num11 = Math.Abs(num11);
                    num12 = Math.Abs(num12);
                    if ((num11 < 1000.0) && (num12 < 1000.0))
                    {
                        int num17   = ship.getMaxHP();
                        int num16   = ship.getHP();
                        int dmgDone = (int)Math.Round((double)(num17 * 0.2));
                        if (dmgDone > num16)
                        {
                            initConnection.updateAttackLasers(userID, 0, 0, dmgDone);
                            ship.setHP(0);
                            ship.setSHD(0);
                            if (Module1.accessingNPCs)
                            {
                                while (true)
                                {
                                    if (!Module1.accessingNPCs)
                                    {
                                        Module1.accessingNPCs = true;
                                        string str  = "";
                                        string str4 = "";
                                        string str2 = "";
                                        string str3 = "";
                                        Attack_Module.getRewards(ship.getShipType(), ref str, ref str4, ref str2, ref str3);
                                        initConnection.destroyNPC(userID);
                                        mainFunctions.removeNPCByID(userID);
                                        Module1.displayNPCs.Remove(userID);
                                        Attack_Module.NPCDead(Conversions.ToInteger(str), Conversions.ToInteger(str4), Conversions.ToInteger(str2), Conversions.ToInteger(str3));
                                        mainFunctions.log("NPC dead...");
                                        Module1.accessingNPCs = false;
                                        continue;
                                    }
                                }
                            }
                            Module1.accessingNPCs = true;
                            string credits = "";
                            string uridium = "";
                            string ep      = "";
                            string honor   = "";
                            Attack_Module.getRewards(userID, ref credits, ref uridium, ref ep, ref honor);
                            initConnection.destroyNPC(userID);
                            mainFunctions.removeNPCByID(userID);
                            Module1.displayNPCs.Remove(userID);
                            Attack_Module.NPCDead(Conversions.ToInteger(credits), Conversions.ToInteger(uridium), Conversions.ToInteger(ep), Conversions.ToInteger(honor));
                            mainFunctions.log("NPC dead...");
                            Module1.accessingNPCs = false;
                        }
                        else
                        {
                            int attackedHP = num16 - dmgDone;
                            initConnection.updateAttackLasers(userID, attackedHP, ship.getSHD(), dmgDone);
                            ship.setHP(attackedHP);
                        }
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            int num2  = Module1.mainHero.getRocketAmmo1();
            int num3  = Module1.mainHero.getRocketAmmo2();
            int num4  = Module1.mainHero.getRocketAmmo3();
            int num5  = Module1.mainHero.getRocketAmmo4();
            int num6  = Module1.mainHero.getRocketAmmo5();
            int num7  = Module1.mainHero.getRocketAmmo6();
            int num8  = Module1.mainHero.getRocketAmmo7();
            int num9  = Module1.mainHero.getRocketAmmo8();
            int num10 = Module1.mainHero.getRocketAmmo9();

            num8--;
            initConnection.sendPacket("0|3|" + Conversions.ToString(num2) + "|" + Conversions.ToString(num3) + "|" + Conversions.ToString(num4) + "|" + Conversions.ToString(num5) + "|" + Conversions.ToString(num6) + "|0|0|" + Conversions.ToString(num7) + "|" + Conversions.ToString(num8) + "|" + Conversions.ToString(num9) + "|" + Conversions.ToString(num10) + "|0|0|0");
            Module1.mainHero.setRocketAmmo(num2, num3, num4, num5, num6, num7, num8, num9, num10);
            new Thread(new ThreadStart(Mine_Module.heroSbombCooldown)).Start();
        }