Beispiel #1
0
 public Boolean IsGood()
 {
     if (id > 0 && (lvl < CHR.GetClass <FairyFactory>().GOODNEES + 10 || (P2 - P1 < CHR.GetClass <FairyFactory>().GOODNEES&& lvl < 100)))
     {
         return(true);
     }
     return(false);
 }
Beispiel #2
0
        public void OpenItem()
        {
            //CHR.GetClass<Inventory>().Load();
            ItemInventory UI = CHR.GetClass <Inventory>().GetFirstById(item);

            if (UI == null)
            {
                return;
            }
            UI.Use();
            Utils.RandomDelay(delay * 1000 - 300, (delay + 1) * 1000 + 300);
            OpenItem();
        }
Beispiel #3
0
        public void GetPrizeBag()
        {
            if (CHR.GetClass <Inventory>().GetFreeCount() < 1)
            {
                return;
            }
            Packet P = new Packet(CHR.HNDL, "C0-00-3A-15-00-00-0C-00-00-00-00-A4-20-1A-00-00-00-00-00-00-00-00");

            P.CopyR(CHR.ID, 14, 4);
            P.CopyR(CHR.ID, 18, 4);
            P.Send();
            Utils.RandomDelay();
        }
Beispiel #4
0
 public void MoveAllBeastsToStore()
 {
     CHR.GetClass <GUI>().Click("Win_HomePetMain", "Btn_Storage");
     CHR.GetClass <Inventory>().Load();
     foreach (ItemInventory i in CHR.GetClass <Inventory>().IL)
     {
         if (i.id >= Beast.ITEM_BASE + Beast.MIN_ITEM && i.id <= Beast.ITEM_BASE + Beast.MAX_ITEM)
         {
             ItemBeast.FromItem(i).PutToBI();
         }
     }
     CHR.GetClass <GUI>().Click("Win_HomePetMain", "Btn_Storage");
 }
Beispiel #5
0
 public void LoadFairiesFromInventory()
 {
     CHR.GetClass <Inventory>().Load();
     FL.Clear();
     foreach (ItemInventory i in CHR.GetClass <Inventory>().IL)
     {
         if (i.id == 0 || i.ptr == 0 || i.type != 41)
         {
             continue;
         }
         FL.Add(ItemFairy.LoadInvFairy(i));
     }
 }
Beispiel #6
0
        public void GetReward()
        {
            int RN = BeastReward.GetRewardNumber(Points, Reward);

            if (RN < 1 || CHR.GetClass <Inventory>().GetFreeCount() < 1)
            {
                return;
            }
            Packet P = new Packet(CHR.HNDL, "C0-00-3B-15-00-00-10-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00");

            P.CopyR(CHR.ID, 14, 4);
            P.CopyR(CHR.ID, 18, 4);
            P.CopyR(RN, 22, 4);
            P.Send();
            Utils.RandomDelay();
        }
Beispiel #7
0
        public ItemFairy SelectFairyForEnchance()
        {
            if (GetEquiped().id > 0)
            {
                int IP = CHR.GetClass <Inventory>().GetFirstFreePlace();
                if (IP > 0)
                {
                    ItemInventory.Equip(CHR.HNDL, IP, 0x17);
                }
            }
            Thread.Sleep(2000);
            LoadFairiesFromInventory();
            ItemFairy BEST  = new ItemFairy(CHR);
            ItemFairy WORST = new ItemFairy(CHR);

            BEST.P1  = 0;
            BEST.P2  = 1;
            WORST.P1 = 1;
            WORST.P2 = 1;
            int count = 0;

            foreach (ItemFairy FI in FL)
            {
                if (FI.IsGood())
                {
                    if (FI.lvl < 10)
                    {
                        ItemInventory.Equip(CHR.HNDL, FI.place, 0x17);
                        return(FI);
                    }
                    BEST  = ((double)FI.P1 / (double)FI.P2 >= (double)BEST.P1 / (double)BEST.P2) ? FI : BEST;
                    WORST = ((double)FI.P1 / (double)FI.P2 < (double)WORST.P1 / (double)WORST.P2) ? FI : WORST;
                    count++;
                }
            }
            if (count == 0)
            {
                return(new ItemFairy(CHR));
            }
            BEST = BEST.id == 0 ? WORST : BEST;
            Boolean RA = RAS.Analize();

            (RA ? WORST : BEST).Equip(0x17);
            return(RA ? WORST : BEST);
        }
Beispiel #8
0
 public void OpenAllBags()
 {
     if (!OpenBags)
     {
         return;
     }
     CHR.GetClass <Inventory>().Load();
     while (CHR.GetClass <Inventory>().HasItemsFromList(BagsId))
     {
         foreach (ItemInventory i in CHR.GetClass <Inventory>().IL)
         {
             if (BagsId.Contains(i.id))
             {
                 i.Use();
             }
         }
         Utils.RandomDelay(3500, 4500);
         MoveAllBeastsToStore();
     }
 }
Beispiel #9
0
        public void Run()
        {
            IsRun = true;

            /*CHR.EnterHome();
             * CHR.WND.WaitForWindow("Win_Chat", 20, false);
             * Utils.RandomDelay();*/
            LoadMine();
            Utils.RandomDelay();
            if (GamesRemain < 1 || Points > PointLimit)
            {
                return;
            }
            OpenBattle();
            Utils.RandomDelay();
            int EC = GetRandomEnemyCommander();

            SelectEnemy(EC);
            Utils.RandomDelay();
            LoadEnemy();
            Utils.RandomDelay();
            Beast[] BB = AnalizeEnemy();
            Utils.RandomDelay();
            StartBattle(BB, EC);
            Utils.RandomDelay();
            if (SkipBattles)
            {
                if (CHR.GetClass <GUI>().WaitForCurrentWindow("Win_HomePetPrepare", 10))
                {
                    CHR.GetClass <GUI>().Click("Win_HomePetPrepare", "Btn_Skip");
                }
            }
            if (CHR.GetClass <GUI>().WaitForCurrentWindow("Win_HomePetFirstAward", SkipBattles ? 10 : 60))
            {
                GetPrizeBag();
                CHR.GetClass <GUI>().Click("Win_HomePetFirstAward", "Btn_Close");
            }
            Run();
            THH.SelfStop("BeastBattle:" + CHR.Name);
            IsRun = false;
        }
Beispiel #10
0
        public void LoadInventory()
        {
            CHR.GetClass <GUI>().Click("Win_HomePetMain", "Btn_Storage");
            BIL.Clear();
            int rr  = -1;
            int BIB = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_InventoryBegin"));
            int BIE = Memory.RD(CHR.HNDL, MBO + OFS.GetInt("BS_InventoryEnd"));

            while (BIB < BIE)
            {
                byte[] buffer = new byte[OFS.GetInt("BS_InventoryItemSize")];
                EF.ReadProcessMemory(CHR.HNDL, BIB, buffer, buffer.Length, ref rr);
                int[] oa = new int[buffer.Length / 4];
                Buffer.BlockCopy(buffer, 0, oa, 0, buffer.Length);
                ItemBeast NBI = new ItemBeast(CHR);
                NBI.id    = oa[OFS.GetInt("BS_BI_ID") / 4];
                NBI.count = oa[OFS.GetInt("BS_BI_Count") / 4];
                BIL.Add(NBI.id, NBI);
                BIB += OFS.GetInt("BS_InventoryItemSize");
            }
            CHR.GetClass <GUI>().Click("Win_HomePetMain", "Btn_Storage");
        }