Beispiel #1
0
        //GLocation StuckLocation = null;

        public StuckDetecter(PPather pather, int stuckSensitivity, int abortSensitivity)
        {
            this.Me               = GContext.Main.Me;
            this.Context          = GContext.Main;
            this.stuckSensitivity = stuckSensitivity;
            this.abortSensitivity = abortSensitivity;
            this.mover            = PPather.mover;
            firstStuckCheck       = true;
        }
Beispiel #2
0
 private void addRez(GPlayerSelf cible, Bot b2)
 {
     foreach (Bot b in Bots)
     {
         if (b.Healer)
         {
             b.addRezTarget(cible.GUID, b2);
         }
     }
 }
Beispiel #3
0
 private void addHeal(GPlayerSelf cible)
 {
     foreach (Bot b in Bots)
     {
         if (b.Healer)
         {
             b.addHealTarget(cible.GUID);
         }
     }
 }
Beispiel #4
0
 private void InjectToWoW()
 {
     ObjectList = new GObjectList(pid.ToInt32());
     //Get LocalPlayer
     localPlayer = ObjectList.LocalPlayer;
     //Load move
     move                 = new GMovement(ObjectList, this);
     move.sendtext       += new StringStatutTransfertEventHandler(SendConsole);
     Objectlist.sendtext += new StringStatutTransfertEventHandler(SendConsole);
 }
Beispiel #5
0
 public MoveAlonger(PPather pather, Path path)
 {
     this.Context = GContext.Main;
     this.Me      = Context.Me;
     this.path    = path;
     this.world   = PPather.world;
     mover        = PPather.mover;
     sd           = new StuckDetecter(pather, 1, 2);
     prev         = null;
     current      = path.GetFirst();
     next         = path.GetSecond();
 }
Beispiel #6
0
 public EasyMover(PPather pather, Location target, bool GiveUpIfStuck,
                  bool GiveUpIfUnsafe)
 {
     this.target         = target;
     this.Me             = GContext.Main.Me;
     this.Context        = GContext.Main;
     this.world          = PPather.world;
     mover               = PPather.mover;
     this.GiveUpIfStuck  = GiveUpIfStuck;
     this.GiveUpIfUnsafe = GiveUpIfUnsafe;
     this.pather         = pather;
 }
Beispiel #7
0
			public bool moveTowardsFacing(GPlayerSelf Me,
				GLocation to,
				double distance,
				GLocation facing)
			{
				bool moving = false;
				double d = Me.Location.GetDistanceTo(to);
				if (d > distance)
				{
					int dir = GetLocationDirection(to);
					if (dir != 0) moving |= true;
					if (dir == 1 || dir == 3 || dir == 0) { StrafeLeft(false); StrafeRight(false); };
					if (dir == 2 || dir == 4 || dir == 0) { Forwards(false); Backwards(false); };
					if (dir == 1) Forwards(true);
					if (dir == 2) StrafeRight(true);
					if (dir == 3) Backwards(true);
					if (dir == 4) StrafeLeft(true);
				}
				else
				{
					StrafeLeft(false);
					StrafeRight(false);
					Forwards(false);
					Backwards(false);
				}
				double bearing = Me.GetHeadingDelta(facing);
				if (bearing < -PI / 8)
				{
					moving |= true;
					RotateLeft(true);
				}
				else if (bearing > PI / 8)
				{
					moving |= true;
					RotateRight(true);
				}
				else
					StopRotate();

				return moving;
			}
Beispiel #8
0
			public StuckDetecter(GPlayerSelf Me, GContext Context,
			int stuckSensitivity, int abortSensitivity)
			{
				this.Me = Me;
				this.Context = Context;
				this.stuckSensitivity = stuckSensitivity;
				this.abortSensitivity = abortSensitivity;
			}
Beispiel #9
0
        public override bool Do()
        {
            GPlayerSelf Me = GContext.Main.Me;

            Helpers.Mount.Dismount();
            ppather.Face(monster);

            if (monster.SetAsTarget(false))
            {
                GUnit         target = monster;
                GCombatResult res;
                do
                {
                    ppather.UnBlacklist(target);
                    ppather.TargetIs(target);
                    target.TouchHealthDrop();
                    ppather.StartCombat();
                    res = ppather.KillTarget(target, Me.IsInCombat);
                    PPather.WriteLine("Kill result is: " + res);
                    if (res == GCombatResult.Bugged || res == GCombatResult.OtherPlayerTag)
                    {
                        // TODO make sure to wait out evaders that are attackign us, they usually stop after a few seconds
                        if (res == GCombatResult.Bugged)
                        {
                            GSpellTimer t = new GSpellTimer(3000);
                            while (Me.IsInCombat && !t.IsReadySlow)
                            {
                                ;
                            }
                        }
                        ppather.Blacklist(target);
                    }
                    if (res == GCombatResult.Died)
                    {
                        return(true);                        // sigh
                    }
                    if (res == GCombatResult.Success ||
                        res == GCombatResult.SuccessWithAdd)
                    {
                        ppather.Killed(target);
                    }

                    if (res == GCombatResult.SuccessWithAdd)
                    {
                        target = Me.Target;
                    }
                    else
                    {
                        target.Refresh(true);
                        Thread.Sleep(100);

                        // wait for combat flag to expire unless we have attackers
                        {
                            GSpellTimer t = new GSpellTimer(2000);
                            while (Me.IsInCombat && GObjectList.GetNearestAttacker(0) == null && !t.IsReadySlow)
                            {
                                ;
                            }
                            //PPather.WriteLine("t: " + (2000 - t.TicksLeft));
                        }
                        if (ppather.IsItSafeAt(null, GContext.Main.Me) && !Me.IsInCombat)
                        {
                            if (GContext.Main.Me.Target != null)
                            {
                                GContext.Main.ClearTarget();
                            }
                            ppather.Rest();
                        }
                    }
                } while (res == GCombatResult.SuccessWithAdd && target != null);
            }
            else
            {
                PPather.WriteLine("!Warning:Can not target monster " + monster.Name);
                ppather.Blacklist(monster);
            }

            return(true);            // !?!?
        }
Beispiel #10
0
        public bool moveTowardsFacing(GPlayerSelf Me, GLocation to, double distance, GLocation facing)
        {
            bool   moving = false;
            double d      = Me.Location.GetDistanceTo(to);

            if (d > distance)
            {
                int dir = GetLocationDirection(to);
                if (dir != 0)
                {
                    moving |= true;
                }
                if (dir == 1 || dir == 3 || dir == 0)
                {
                    StrafeLeft(false);
                    StrafeRight(false);
                }
                ;
                if (dir == 2 || dir == 4 || dir == 0)
                {
                    Forwards(false);
                    Backwards(false);
                }
                ;
                if (dir == 1)
                {
                    Forwards(true);
                }
                if (dir == 2)
                {
                    StrafeRight(true);
                }
                if (dir == 3)
                {
                    Backwards(true);
                }
                if (dir == 4)
                {
                    StrafeLeft(true);
                }
                //PPather.WriteLine("Move dir: " + dir);
            }
            else
            {
                //PPather.WriteLine("Move is close");
                StrafeLeft(false);
                StrafeRight(false);
                Forwards(false);
                Backwards(false);
            }
            double bearing = Me.GetHeadingDelta(facing);

            if (bearing < -PI / 8)
            {
                moving |= true;
                RotateLeft(true);
            }
            else if (bearing > PI / 8)
            {
                moving |= true;
                RotateRight(true);
            }
            else
            {
                StopRotate();
            }

            return(moving);
        }