Ejemplo n.º 1
0
        private async Task <bool> MainCoroutine()
        {
            if (IsDone)
            {
                return(false);
            }

            var ct = Me.CurrentTarget;

            if (ct == null || ct.DistanceSqr >= 100 * 100)
            {
                var stormtalon = ObjectManager.GetObjectsOfType <WoWUnit>().Where(u => u.Entry == 49683 && u.IsAlive).OrderBy(
                    u => u.DistanceSqr).FirstOrDefault();
                if (stormtalon != null)
                {
                    stormtalon.Target();
                }
                return(true);
            }

            WoWMovement.ClickToMove(ct.Location.RayCast(ct.Rotation, 20));
            var transport = (WoWUnit)StyxWoW.Me.Transport;

            Tripper.Tools.Math.Vector3 v = ct.Location - transport.Location;
            v.Normalize();
            var lua = string.Format(
                "VehicleAimIncrement(({0} - VehicleAimGetAngle())); CastPetAction({1});",
                Math.Asin(v.Z),
                1);

            Lua.DoString(lua);
            return(true);
        }
Ejemplo n.º 2
0
        public void Loopstuff()
        {
            while (true)
            {
                ObjectManager.Update();
                if (Me.IsQuestComplete(QuestId))
                {
                    _isBehaviorDone = true;
                    break;
                }

                try
                {
                    if (!Query.IsInVehicle())
                    {
                        var turret = GetTurret();
                        if (turret != null)
                        {
                            if (turret.DistanceSqr > 5 * 5)
                            {
                                //Navigator.MoveTo(turret.Location);
                            }
                            else
                            {
                                turret.Interact();
                            }
                        }
                        else
                        {
                            QBCLog.Info("Unable to find turret");
                        }
                    }
                    else
                    {
                        if (Me.CurrentTarget != null &&
                            (Me.CurrentTarget.Distance < 60 || Me.CurrentTarget.InLineOfSight))
                        {
                            WoWMovement.ClickToMove(Me.CurrentTarget.Location);
                            //WoWMovement.ClickToMove(Me.CurrentTarget.Location.RayCast(Me.CurrentTarget.Rotation, 20));
                            var x = ObjectManager.GetObjectsOfType <WoWUnit>().FirstOrDefault(z => z.CharmedByUnit == Me);

                            Tripper.Tools.Math.Vector3 v = Me.CurrentTarget.Location - Me.Location;
                            v.Normalize();
                            Lua.DoString(
                                string.Format(
                                    "VehicleAimIncrement(({0} - VehicleAimGetAngle())); CastPetAction(1);CastPetAction(2);",
                                    Math.Asin(v.Z).ToString()));
                        }
                        else
                        {
                            if (!Me.IsQuestObjectiveComplete(QuestId, 1))
                            {
                                if (Marksmen != null)
                                {
                                    Marksmen.Target();
                                }
                            }
                            else if (!Me.IsQuestObjectiveComplete(QuestId, 2))
                            {
                                if (Cannoner != null)
                                {
                                    Cannoner.Target();
                                }
                            }
                            else if (!Me.IsQuestObjectiveComplete(QuestId, 3))
                            {
                                if (Cannon != null)
                                {
                                    Cannon.Target();
                                }
                            }
                        }
                    }
                }
                catch (Exception except)
                {
                    QBCLog.Exception(except);
                }
            }
        }