コード例 #1
0
 public override void Run()
 {
     if (ObjectManager.FreeBagSlots > 3)
     {
         StockadesContainer.done = false;
         Calls.DoString("ResetInstances();");
         StockadesContainer.doOncePerRun = true;
         Ingame.Tele(StockadesContainer.posZoneIn1, 60, true);
         Ingame.setCoords(StockadesContainer.posZoneIn2);
         while (StockadesContainer.isOutside && ObjectManager.FreeBagSlots > 3 && !Ingame.IsDc())
         {
             Thread.CurrentThread.Join(10);
         }
     }
     else
     {
         if (ObjectManager.isGhost)
         {
             Ingame.Tele(spiritHealerPos, 5, false);
             spiritHealer = ObjectManager.GetUnitByName("Spirit Healer");
             if (spiritHealer.baseAdd != 0)
             {
                 Calls.OnRightClickUnit(spiritHealer.baseAdd, 0);
                 Thread.CurrentThread.Join(250);
                 while (ObjectManager.isGhost && !Ingame.IsDc())
                 {
                     Calls.OnRightClickUnit(spiritHealer.baseAdd, 0);
                     Thread.CurrentThread.Join(500);
                     Calls.DoString("AcceptXPLoss();");
                     Thread.CurrentThread.Join(500);
                 }
             }
         }
         else
         {
             Ingame.Tele(StockadesContainer.posVendor, 60, false);
             vendor = ObjectManager.GetUnitByName(StockadesContainer.nameVendor);
             if (vendor.baseAdd != 0)
             {
                 Calls.OnRightClickUnit(vendor.baseAdd, 1);
                 if (Ingame.IsVendorFrameOpen())
                 {
                     Ingame.SellAll();
                 }
             }
         }
     }
 }
コード例 #2
0
        public override void Run()
        {
            if (Calls.MovementIsOnly(0x0))
            {
                if (!locationSaved)
                {
                    curPoint      = new Objects.Location(ObjectManager.PlayerObject.Pos.x, ObjectManager.PlayerObject.Pos.y, ObjectManager.PlayerObject.Pos.z);
                    locationSaved = true;
                    IsVendoring   = true;
                    failCounter   = 0;
                    failCounter2  = 0;
                }
                else
                {
                    if (Data.VendorLocation.differenceToPlayer() > 2)
                    {
                        if (ObjectManager.playerClass == (uint)Constants.Offsets.classIds.Warlock || ObjectManager.playerClass == (uint)Constants.Offsets.classIds.Hunter)
                        {
                            if (Ingame.GotPet())
                            {
                                Ingame.DismissPet();
                            }
                            else
                            {
                                Ingame.Tele(Data.VendorLocation, 60, false);
                            }
                        }
                        else
                        {
                            Ingame.Tele(Data.VendorLocation, 60, false);
                        }
                    }
                    else
                    {
                        if (ObjectManager.playerClass == (byte)Constants.Offsets.classIds.Druid)
                        {
                            SpellManager.CheckSpells();
                            if (Ingame.druidIsBear())
                            {
                                Ingame.Cast("Bear Form", false);
                            }
                            if (Ingame.druidIsCat())
                            {
                                Ingame.Cast("Cat Form", false);
                            }
                            Ingame.CastFinal();
                        }

                        if (Ingame.IsVendorFrameOpen())
                        {
                            Ingame.SellAllBut(Data.ProtectedItems);

                            cTimer waitTimer = new cTimer(1000);
                            while (!waitTimer.IsReady())
                            {
                                Thread.CurrentThread.Join(100);
                            }
                            failCounter2 = failCounter2 + 1;

                            if (Data.gotVendor && ObjectManager.FreeBagSlots <= Data.LeaveFreeSlots)
                            {
                                if (failCounter2 >= 20)
                                {
                                    GoBack();
                                }
                            }
                            else
                            {
                                GoBack();
                            }
                        }
                        else
                        {
                            Objects.UnitObject tmpObj = ObjectManager.GetUnitByName(Data.VendorName);
                            if (tmpObj.baseAdd != 0)
                            {
                                Calls.OnRightClickUnit(tmpObj.baseAdd, 1);
                            }
                            else
                            {
                                failCounter = failCounter + 1;
                            }

                            cTimer waitTimer = new cTimer(1000);
                            while (!waitTimer.IsReady())
                            {
                                Thread.CurrentThread.Join(100);
                            }

                            if (failCounter >= 6)
                            {
                                GoBack();
                            }
                        }
                    }
                }
            }
            else
            {
                Calls.StopRunning();
            }
        }