Beispiel #1
0
        public void Process()
        {
            if (WowControl.LoadedWP != wow.Location)
            {
                WowControl.WP = WowControl.LoadWaypoints(wow.Location);
            }
            if (wow.BattlefieldInstanceExpiration != 0)
            {
                WowControl.Sleep(2000);
                wow.Read();
                WowControl.UpdateStatus("Leaving BG.");
                wow.GoTo(0, 0, 0, 0, 3);                //Stop
                WowControl.Command("script LeaveBattlefield()");
                WowControl.WaitTime = DateTime.Now.AddSeconds(30);
                return;
            }
            switch (wow.BgStatus)
            {
            case 0:                    //Not queued
                if ((DateTime.Now - LastTime).TotalMilliseconds > 20000)
                {
                    if ((DateTime.Now - WowControl.LocationChangeTime).TotalSeconds >= 60)
                    {
                        WowControl.UpdateStatus("Joining BG queue.");
                    }
                    LastTime = DateTime.Now;
                    WowControl.btn('H');
                    WowControl.btn('H');
                    WowControl.Sleep(1000);
                    WowControl.Command("script JoinBattlefield(1)");
                    WowControl.WaitTime = DateTime.Now.AddSeconds(5);
                }
                break;

            case 1:                    //Waiting
                if (wow.Objects[0].IsInCombat != 0)
                {
                    Abilities.UseAbilities(wow, "");
                }
                //WowControl.UpdateStatus("Waiting BG.");
                break;

            case 2:                    //Confirm
                if ((DateTime.Now - LastTime).TotalMilliseconds > 5000)
                {
                    WowControl.UpdateStatus("Joining BG.");
                    LastTime = DateTime.Now;
                    WowControl.Command("script  AcceptBattlefieldPort(1,1)");
                    WowControl.WaitTime = DateTime.Now.AddSeconds(20);
                    return;
                }
                break;

            case 3:                    //In BG
                if (wow.Objects[0].Health == 1)
                {
                    StuckTimes = 0;
                    CurrentWP  = GetClosestWP(WowControl.WP);
                    WowControl.BadObjects.Clear();
                    WowControl.UpdateStatus("Waiting for ressurect.");
                    wow.GoTo(0, 0, 0, 0, 3);                            //Stop and waiting for ressurect
                    Abilities.Ability[] Temp = Abilities.BindingsList.ToArray();
                    Abilities.BindingsList.Clear();
                    for (int i = 0; i < Temp.Length; i++)
                    {
                        Temp[i].Try = 0;
                        Abilities.BindingsList.Add(Temp[i]);
                    }
                    RessurectTime = DateTime.Now;
                    return;
                }
                if (wow.Objects[0].Health == 0)
                {
                    WowControl.BadObjects.Clear();
                    WowControl.Sleep(2000);
                    RessurectTime = DateTime.Now;
                    StuckTimes    = 0;
                    WowControl.UpdateStatus("Releasing spirit.");
                    if ((DateTime.Now - LastTime).TotalMilliseconds > 5000)
                    {
                        LastTime = DateTime.Now;
                        WowControl.Command("script  RepopMe()");
                        WowControl.WaitTime = DateTime.Now.AddSeconds(5);
                    }
                    return;
                }
                Abilities.UseAbilities(wow, "Bg");
                if (Abilities.AbilityStatus != "Casting")
                {
                    if (Moving() == true)
                    {
                        return;
                    }
                }
                break;
            }
        }