コード例 #1
0
ファイル: Form1.cs プロジェクト: jinopapo/dominion
 public void DrawStart(List<string> l)
 {
     START.Visible = false;
     pictureBox1.Visible = false;
     card = l;
     Player[0] = new Me(this, Dis);
     for (var i = 1; i < 4; i++)
     {
         Player[i] = new Enemy(this, i, Dis);
     }
     setSupply(l);
     Refresh();
     for (var i = 1; i < 4; i++)
     {
         Player[i].setFirstDeck();
         Player[i].DrawCard(5);
     }
     Player[0].setFirstDeck();
     Player[0].DrawCard(5);
     Player[0].ChangeTurn();
     for (int i = 0; i < 4; i++)
     {
         int k = 0;
         for (int j = i;k!=3 ; j++)
         {
             if(j==4)
             {
                 j = 0;
             }
             if (i != j)
             {
                 Player[i].SetEnemy(Player[j]);
                 k++;
             }
         }
     }
 }
コード例 #2
0
ファイル: Deck.cs プロジェクト: jinopapo/dominion
        public Deck(Me p,List<PlayCard> f,List<PlayCard> l)
        {
            me = p;
            Field = f;
            Hand = l;
            Click += new EventHandler(CardClick);
            this.pictureBox2 = new PictureBox();
            this.DeckCount = new Label();

            this.Controls.Add(this.pictureBox2);
            this.Image = global::dominion.Properties.Resources.back;
            this.Location = new System.Drawing.Point(100, 540);
            this.Name = "deck";
            this.Size = new System.Drawing.Size(70, 110);
            this.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.TabIndex = 8;
            this.TabStop = false;
            this.Visible = true;

            this.pictureBox2.BackColor = System.Drawing.Color.Transparent;
            this.pictureBox2.Controls.Add(this.DeckCount);
            this.pictureBox2.Image = global::dominion.Properties.Resources.カウンター;
            this.pictureBox2.Location = new System.Drawing.Point(40, 0);
            this.pictureBox2.Name = "pictureBox2";
            this.pictureBox2.Size = new System.Drawing.Size(30, 30);
            this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.pictureBox2.TabIndex = 11;
            this.pictureBox2.TabStop = false;

            this.DeckCount.AutoSize = true;
            this.DeckCount.BackColor = System.Drawing.Color.Transparent;
            this.DeckCount.Location = new System.Drawing.Point(7, 9);
            this.DeckCount.Name = "deckCount";
            this.DeckCount.Size = new System.Drawing.Size(11, 12);
            this.DeckCount.TabIndex = 12;
            this.DeckCount.Text = "0";
        }
        private Composite UtilityBehavior_InteractWithMob(WoWUnitDelegate unitToInteract)
        {
            return(new PrioritySelector(interactUnitContext => unitToInteract(interactUnitContext),
                                        new Decorator(interactUnitContext => IsViable((WoWUnit)interactUnitContext),
                                                      new PrioritySelector(
                                                          // Show user which unit we're going after...
                                                          new Decorator(interactUnitContext => Me.CurrentTarget != (WoWUnit)interactUnitContext,
                                                                        new Action(interactUnitContext => { ((WoWUnit)interactUnitContext).Target(); })),

                                                          // If not within interact range, move closer...
                                                          new Decorator(interactUnitContext => !((WoWUnit)interactUnitContext).WithinInteractRange,
                                                                        new ActionRunCoroutine(
                                                                            interactUnitContext => UtilityCoroutine.MoveTo(
                                                                                ((WoWUnit)interactUnitContext).Location,
                                                                                "to interact with " + ((WoWUnit)interactUnitContext).SafeName))),

                                                          new Decorator(interactUnitContext => Me.IsMoving,
                                                                        new Action(interactUnitContext => { WoWMovement.MoveStop(); })),
                                                          new Decorator(interactUnitContext => !Me.IsFacing((WoWUnit)interactUnitContext),
                                                                        new Action(interactUnitContext => { Me.SetFacing((WoWUnit)interactUnitContext); })),

                                                          // Blindly interact...
                                                          // Ideally, we would blacklist the unit if the interact failed.  However, the HB API
                                                          // provides no CanInteract() method (or equivalent) to make this determination.
                                                          new Action(interactUnitContext =>
            {
                QBCLog.DeveloperInfo("Interacting with {0}", ((WoWUnit)interactUnitContext).SafeName);
                ((WoWUnit)interactUnitContext).Interact();
                return RunStatus.Failure;
            }),
                                                          new Wait(TimeSpan.FromMilliseconds(1000), context => false, new ActionAlwaysSucceed())
                                                          ))));
        }
コード例 #4
0
        private static Composite CreateDiagnosticOutputBehavior(string context = null)
        {
            if (!SingularSettings.Debug)
            {
                return(new ActionAlwaysFail());
            }

            if (context == null)
            {
                context = Dynamics.CompositeBuilder.CurrentBehaviorType.ToString();
            }

            context = "<<" + context + ">>";

            return(new ThrottlePasses(
                       1, TimeSpan.FromSeconds(1.5), RunStatus.Failure,
                       new Action(ret =>
            {
                string log;
                log = string.Format(context + " h={0:F1}%/r={1:F1}%, stance={2}, Enrage={3} Coloss={4} MortStrk={5}",
                                    Me.HealthPercent,
                                    Me.Shapeshift,
                                    Me.ActiveAuras.ContainsKey("Enrage"),
                                    (int)Spell.GetSpellCooldown("Colossus Smash", -1).TotalMilliseconds,
                                    (int)Spell.GetSpellCooldown("Mortal Strike", -1).TotalMilliseconds
                                    );

                WoWUnit target = Me.CurrentTarget;
                if (target != null)
                {
                    log += string.Format(", th={0:F1}%, dist={1:F1}, inmelee={2}, face={3}, loss={4}, dead={5} secs, flying={6}",
                                         target.HealthPercent,
                                         target.Distance,
                                         target.IsWithinMeleeRange.ToYN(),
                                         Me.IsSafelyFacing(target).ToYN(),
                                         target.InLineOfSpellSight.ToYN(),
                                         target.TimeToDeath(),
                                         target.IsFlying.ToYN()
                                         );
                }

                int mobc;
                bool avoidaoe;
                int mobcc;

                if (scenario == null)
                {
                    mobc = 0;
                    avoidaoe = false;
                    mobcc = 0;
                }
                else
                {
                    mobc = scenario.MobCount;
                    avoidaoe = scenario.AvoidAOE;
                    mobcc = scenario.Mobs == null ? 0 : scenario.Mobs.Count();
                }

                log += string.Format(
                    "cdcs={0:F2}, cdms={1:F2}, mobs={2}, avoidaoe={3}, enemies={4}",
                    CooldownColossusSmash,
                    CooldownMortalStrike,
                    mobc,
                    avoidaoe.ToYN(),
                    mobcc
                    );

                Logger.WriteDebug(Color.AntiqueWhite, log);
                return RunStatus.Failure;
            })
                       ));
        }
コード例 #5
0
        public static Composite CreateArmsCombatNormal()
        {
            return(new PrioritySelector(
                       Helpers.Common.EnsureReadyToAttackFromMelee(),

                       Spell.WaitForCast(),

                       Common.CheckIfWeShouldCancelBladestorm(),
                       new Decorator(
                           ret => !Spell.IsGlobalCooldown(),

                           new PrioritySelector(

                               SingularRoutine.MoveBehaviorInlineToCombat(BehaviorType.Heal),
                               SingularRoutine.MoveBehaviorInlineToCombat(BehaviorType.CombatBuffs),

                               CreateDiagnosticOutputBehavior("Combat"),

                               Movement.WaitForFacing(),
                               Movement.WaitForLineOfSpellSight(),

                               Helpers.Common.CreateInterruptBehavior(),
                               Common.CreateSpellReflectBehavior(),

                               Common.CreateVictoryRushBehavior(),

                               // special "in combat" pull logic for mobs not tagged and out of melee range
                               Common.CreateWarriorCombatPullMore(),

                               Common.CreateExecuteOnSuddenDeath(),

                               CreateArmsAoeCombat(ret => Unit.NearbyUnfriendlyUnits.Count(u => u.SpellDistance() < (Common.DistanceWindAndThunder(8)))),

                               // Noxxic
                               //----------------
                               new Decorator(
                                   ret => Me.GotTarget(), // execute
                                   new PrioritySelector(
                                       new Decorator(
                                           ret => Target.HealthPercent < 20 && Unit.UnfriendlyUnits(8).Count() < 5,
                                           new PrioritySelector(
                                               Spell.Cast("BladeStorm", ret => Spell.UseAOE && Me.HasAura("Battle Cry") && (NumTier20Pieces >= 4 || StyxWoW.Me.Inventory.Equipped.Head.ItemInfo.Guid == 151823)),
                                               Spell.Cast("Colossus Smash", ret => !Me.HasAura("Shattered Defenses") && !Me.HasAura("Battle Cry")),
                                               Spell.Cast("Warbreaker", ret => Spell.UseAOE && Spell.GetSpellCooldown("Mortal Strike").TotalSeconds < 1 && !Me.HasAura("Shattered Defenses") && Target.GetAuraByName("Executioner's Precision").stackCount == 2),
                                               Spell.Cast("Rend", ret => Spell.UseAOE && DebuffRend < 5 && Spell.GetSpellCooldown("Battle Cry").TotalSeconds < 2 && Spell.GetSpellCooldown("Bladestorm").TotalSeconds < 2),
                                               Spell.Cast("Ravager", ret => Spell.UseAOE && Spell.GetSpellCooldown("Battle Cry").TotalSeconds < 1 && DebuffColossusSmash >= 6),
                                               Spell.Cast("Mortal Strike", ret => Target.GetAuraByName("Executioner's Precision").stackCount == 2 && Me.HasAura("Shattered Defenses")),
                                               Spell.Cast("Execute", ret => !Me.HasAura("Shattered Defenses") || Me.CurrentRage >= 40 || Common.HasTalent(WarriorTalents.Dauntless) && Me.CurrentRage >= 36),
                                               Spell.Cast("BladeStorm", ret => Spell.UseAOE && NumTier20Pieces <= 4),
                                               new ActionAlwaysFail()
                                               )
                                           ),
                                       new PrioritySelector( //normal
                                           Spell.Cast("Bladestorm", ret => Spell.UseAOE && Me.HasAura("Battle Cry") && (NumTier20Pieces >= 4 || StyxWoW.Me.Inventory.Equipped.Head.ItemInfo.Guid == 151823)),
                                           Spell.Cast("Colossus Smash", ret => !Me.HasAura("Shattered Defenses")),
                                           Spell.Cast("Warbreaker", ret => Spell.UseAOE && (Common.HasTalent(WarriorTalents.FervorOfBattle) && DebuffColossusSmash < 1) || (!Common.HasTalent(WarriorTalents.FervorOfBattle) && (Me.HasAura("Stone Heart") || CooldownMortalStrike < 1) && !Me.HasAura("Shattered Defenses"))),
                                           Spell.Cast("Rend", ret => DebuffRend <= 1 || Spell.UseAOE && DebuffRend < 5 && Spell.GetSpellCooldown("Battle Cry").TotalSeconds < 2 && Spell.GetSpellCooldown("Bladestorm").TotalSeconds < 2),
                                           Spell.Cast("Ravager", ret => Spell.UseAOE && Spell.GetSpellCooldown("Battle Cry").TotalSeconds < 1 && (DebuffColossusSmash >= 6)),
                                           Spell.Cast("Execute", ret => Me.HasAura("Stone Heart")),
                                           Spell.Cast("Mortal Strike", ret => Target.GetAuraByName("Executioner's Precision").stackCount == 0 || Me.HasAura("Shattered Defenses")),
                                           Spell.Cast("Rend", ret => Target.GetAuraByName("Rend").TimeLeft() < Target.GetAuraByName("Rend").Duration * .3),
                                           Spell.Cast("Whirlwind", ret => Unit.UnfriendlyUnits(8).Count() > 1 || Common.HasTalent(WarriorTalents.FervorOfBattle)),
                                           Spell.Cast("Slam", ret => !Common.HasTalent(WarriorTalents.FervorOfBattle) && (Me.CurrentRage >= 52 || !Common.HasTalent(WarriorTalents.Rend) || !Common.HasTalent(WarriorTalents.Ravager))),
                                           Spell.Cast("BladeStorm", ret => Spell.UseAOE && NumTier20Pieces <= 4)
                                           )
                                       )
                                   ),
                               Common.CreateChargeBehavior(),
                               Common.CreateAttackFlyingOrUnreachableMobs()
                               )
                           )
                       ));
        }
コード例 #6
0
ファイル: RayCast_t1.cs プロジェクト: SpaceAngelRu/SeScripts
        public void Main(string argument)
        {
            //            if (rotor == null)
            //            {
            //                return;
            //            }

            //            MatrixD m = MatrixD.Identity;
            //
            var grid = this.Me.CubeGrid;
            //
            //            var dd = grid.GetCubeBlock()
            //
            //
            var min = grid.Min;
            var max = grid.Max;
            //
            var size         = max - min + Vector3I.One;
            var sizeInMeters = size * grid.GridSize;

            //
            if (camera.CanScan(SCAN_DISTANCE))
            {
                info = camera.Raycast(SCAN_DISTANCE, PITCH, YAW);
            }

            var dist = Vector3.Distance(Me.GetPosition(), info.Position);

            sb.Clear();
            sb.Append($"dist: {dist}");
            sb.AppendLine();
            sb.Append($"sizeInMeters: {sizeInMeters}");
            sb.AppendLine();

            if (rotor != null)
            {
                sb.Append($"angel: {rotor.Angle}");
                sb.AppendLine();
            }

            //            Quaternion qu;
            //            rotor.Orientation.GetQuaternion(out qu);
            //
            //            Vector3 axis;
            //            float angle;
            //            qu.GetAxisAngle(out axis, out angle);
            //
            //            sb.Append($"axis: {axis}");
            //            sb.AppendLine();
            //
            //            sb.Append($"angle: {angle}");
            //            sb.AppendLine();

            //            sb.Append($"min: {grid.GridSize}");
            //            sb.AppendLine();
            //            sb.Append($"Grid size: {size}");
            //            sb.AppendLine();
            //            sb.Append($"Grid volume: {size.Volume()}");
            //            sb.AppendLine();
            //            sb.Append($"Size: {sizeInMeters} m^3");
            //            sb.AppendLine();
            //            sb.Append($"Volume: {sizeInMeters} m^3");
            //            sb.AppendLine();
            //            sb.Append($"blocks: {blocks.Count}");
            //            sb.AppendLine();
            //            sb.Append("EntityID: " + info.EntityId);
            //            sb.AppendLine();
            //            sb.Append("Name: " + info.Name);
            //            sb.AppendLine();
            //            sb.Append("Type: " + info.Type);
            //            sb.AppendLine();
            //            sb.Append("Velocity: " + info.Velocity.ToString("0.000"));
            //            sb.AppendLine();
            //            sb.Append("Relationship: " + info.Relationship);
            //            sb.AppendLine();
            //            sb.Append("Size: " + info.BoundingBox.Size.ToString("0.000"));
            //            sb.AppendLine();
            //            sb.Append("Position: " + info.Position.ToString("0.000"));

            if (info.HitPosition.HasValue)
            {
                //                sb.AppendLine();
                //                sb.Append("Hit: " + info.HitPosition.Value.ToString("0.000"));
                //                sb.AppendLine();
                //                sb.Append("Distance: " + Vector3D.Distance(camera.GetPosition(), info.HitPosition.Value).ToString("0.00"));
            }

            sb.AppendLine();
            sb.Append("Range: " + camera.AvailableScanRange.ToString());

            PrintForAllTerminals(sb.ToString());
        }
コード例 #7
0
 private void StopBtn_Click(object sender, RoutedEventArgs e)
 {
     Me.Stop();
     timer.Stop();
 }
コード例 #8
0
 // Stop payback when position is changed so that you don't get any
 // 'seek-jiggle' as you move the slider
 private void PosSlider_PreviewMouseDown(object sender, MouseButtonEventArgs e)
 {
     posSliderDragging = true;
     Me.Stop();
 }
コード例 #9
0
ファイル: CombatUtils.cs プロジェクト: IgorYunusov/wow-bot
 public static void StopMovement(Me me)
 => AmeisenCore.InteractWithGUID(me.pos, me.Guid, InteractionType.STOP);
コード例 #10
0
ファイル: CombatUtils.cs プロジェクト: IgorYunusov/wow-bot
 /// <summary>
 /// Check if you're able to cast a certain spell at your current position
 /// </summary>
 /// <param name="me">me object</param>
 /// <param name="unitToAttack">unit to attack</param>
 /// <param name="distance">spell distance or something alike</param>
 /// <returns>true/false wether your are or arent in range to cast</returns>
 public static bool IsInRange(Me me, Unit unitToAttack, double distance)
 => Utils.GetDistance(me.pos, unitToAttack.pos) < distance;
コード例 #11
0
ファイル: CombatUtils.cs プロジェクト: IgorYunusov/wow-bot
 /// <summary>
 /// Check for ranged combat facing a specific unit
 /// </summary
 /// <param name="me">you</param>
 /// <param name="unit">target</param>
 /// <returns>wether you're facing the unit or not</returns>
 public static bool IsFacingRanged(Me me, Unit unit, double minRotation = 0.9, double maxRotation = 1.1)
 => Utils.IsFacing(me.pos, me.Rotation, unit.pos, minRotation, maxRotation);
コード例 #12
0
ファイル: CombatUtils.cs プロジェクト: IgorYunusov/wow-bot
 /// <summary>
 /// Check for facing a specific unit
 /// </summary
 /// <param name="me">you</param>
 /// <param name="unit">target</param>
 /// <returns>wether you're facing the unit or not</returns>
 public static bool IsFacingMelee(Me me, Unit unit, double minRotation = 0.6, double maxRotation = 1.4)
 => Utils.IsFacing(me.pos, me.Rotation, unit.pos, minRotation, maxRotation);
コード例 #13
0
ファイル: func.cs プロジェクト: maysam/ParsLogPlot
 Dim TextBrush As New SolidBrush(Me.ForeColor)
 If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
コード例 #14
0
ファイル: func.cs プロジェクト: maysam/ParsLogPlot
 If Not (Me.Items Is Nothing) Then
コード例 #15
0
ファイル: EzRetv2.cs プロジェクト: rhoninsk/novas-addons
        public override void Combat()
        {
            Target = Me.CurrentTarget;


            int Toggle = Lua.GetReturnVal <int>("return Toggle and 0 or 1", 0);

            if (Toggle != 1)
            {
                return;
            }


            if (Target == null || !Target.Attackable)
            {
                return;
            }

            //Lets try some new logic here..lets go for the owner
            else if (Target != null && Target.IsPet && Manual)
            {
                WoWUnit Owner = Target.CreatedByUnit;
                if (Owner != null && Owner.IsValid && Owner.IsAlive)
                {
                    Blacklist.Add(Target, new TimeSpan(0, 0, 5));
                    Logging.Write("Changing targets to pet owner");
                    Target = Owner;
                    TargetUnit(Target);
                }
            }
            //Face the target
            Face(Target);
            //Always try and move ontop of the enemy target
            Move(Target.Location);

            if (Target.Distance < 2 && Manual)
            {
                Navigator.PlayerMover.MoveStop();
            }

            if ((Target.Distance > 30 || !Target.IsAlive) && Me.Combat && Manual)
            {
                Logging.Write(Target.Name + " is currently " + Target.Distance.ToString() + " dropping target");
                Me.ClearTarget();
                SeekTarget();
            }
            else if ((Target.HealthPercent <= 20d || isAuraActive("Avenging Wrath")) && CanCast("Hammer of Wrath"))
            {
                Cast("Hammer of Wrath");
            }
            else if (isAuraActive("The Art of War") && CanCast("Exorcism"))
            {
                Cast("Exorcism");
            }
            else if ((Target.Distance >= 5d || Target.Distance < 15d) && CanCast("Judgement"))
            {
                Cast("Judgement");
                Move(Target.Location);
            }
            else if (Target.Distance < 6)
            {
                foreach (String Ability in EzRetSettings.Instance.Cooldowns)
                {
                    cctc(Ability);
                }

                if (Target.IsCasting && Target.CanInterruptCurrentSpellCast)
                {
                    foreach (String Ability in EzRetSettings.Instance.KickRotation)
                    {
                        //New only use other abilities if rebuke off CD
                        if (!CanCast(Ability))
                        {
                            continue;
                        }
                        if (Ability.Equals("Rebuke"))
                        {
                            Cast("Rebuke");
                        }
                        else
                        {
                            if (Rebuke.CooldownTimeLeft.Seconds > 0 && Rebuke.CooldownTimeLeft.Seconds < 8)
                            {
                                Cast(Ability);
                            }
                        }
                    }
                }
                else if (Me.CurrentHolyPower == 3d || isAuraActive("Divine Purpose"))
                {
                    cctc("Zealotry");
                    if ((!isAuraActive("Inquisition") || Me.ActiveAuras["Inquisition"].TimeLeft.Seconds <= EzRetSettings.Instance.InqRefreshDuration) && !EzRetSettings.Instance.DisableInq)
                    {
                        Cast("Inquisition");
                    }
                    else
                    {
                        cctc("Templar's Verdict");
                    }
                }
                else
                {
                    foreach (String Ability in EzRetSettings.Instance.Rotation)
                    {
                        if (cctc(Ability))
                        {
                            break;
                        }
                    }
                }
                Usetrinkets();
            }
        }
コード例 #16
0
ファイル: Vayne.cs プロジェクト: GermanKingYT/HesaPrivate
        private static void Combo()
        {
            if (ComboOption.UseR && R.IsReady() && ObjectManager.Heroes.Enemies.Count(x => x.IsValidTarget(650)) >= ComboOption.GetSlider("ComboRCount") && Me.HealthPercent <= ComboOption.GetSlider("ComboRHp"))
            {
                R.Cast();
            }

            if (ComboOption.UseE && E.IsReady())
            {
                ELogic();
            }

            if (ComboOption.UseQ && Q.IsReady() && !Me.IsWindingUp)
            {
                if (Me.HasBuff("vayneinquisition") && Me.CountEnemiesInRange(1200) > 0 && Me.CountEnemiesInRange(700) >= 2)
                {
                    var dashPos = GetDashQPos();

                    if (dashPos != Vector3.Zero)
                    {
                        if (Me.CanMoveMent())
                        {
                            Q.Cast(dashPos, true);
                        }
                    }
                }

                /*
                 * if (!ObjectManager.Heroes.Enemies.Exists(x => !x.IsDead && !x.IsZombie && x.IsValidTarget(Me.AttackRange)))
                 * {
                 *  var target = TargetSelector.GetTarget(900, TargetSelector.DamageType.Physical);
                 *  if (target.IsValidTarget())
                 *  {
                 *      if (!Orbwalker.InAutoAttackRange(target) && target.Position.DistanceToMouse() < target.Position.DistanceToPlayer())
                 *      {
                 *          var dashPos = GetDashQPos();
                 *          if (dashPos != Vector3.Zero)
                 *              if (Me.CanMoveMent())
                 *                  Q.Cast(dashPos, true);
                 *      }
                 *
                 *      if (E.IsReady())
                 *      {
                 *          var dashPos = GetDashQPos();
                 *          if (dashPos != Vector3.Zero && CondemnCheck(dashPos, target))
                 *              if (Me.CanMoveMent())
                 *                  Q.Cast(dashPos, true);
                 *      }
                 *  }
                 * }*/
            }
        }
コード例 #17
0
 public void Rollback()
 {
     Me.Rollback();
 }
コード例 #18
0
 private void PauseBtn_Click(object sender, RoutedEventArgs e)
 {
     Me.Pause();
 }
コード例 #19
0
 public void Commit()
 {
     Me.Commit();
 }
コード例 #20
0
 // and start again when you've finished
 private void PosSlider_PreviewMouseUp(object sender, MouseButtonEventArgs e)
 {
     posSliderDragging = false;
     Me.Play();
 }
コード例 #21
0
 public void Dispose()
 {
     DIConnection.currentRef = null;
     Me.Commit();
 }
コード例 #22
0
        public Composite CreateFeralCatCombat()
        {
            // Get us in cat form pl0x
            WantedDruidForm = ShapeshiftForm.Cat;

            return(new PrioritySelector(
                       // Make sure we're in cat form first, period.
                       new Decorator(
                           ret => Me.Shapeshift != WantedDruidForm,
                           CreateSpellCast("Cat Form")),
                       CreateEnsureTarget(),
                       CreateSpellBuffOnSelf("Rejuvenation", ret => !Me.IsInParty && !Me.IsInRaid && Me.HealthPercent < 60),
                       CreateSpellCast("Berserk", ret => Me.Fleeing),
                       CreateSpellCast("Survival Instincts", ret => Me.HealthPercent <= 45),
                       CreateFaceUnit(),
                       CreateAutoAttack(false),
                       CreateSpellCast("Feral Charge (Cat)", ret => Me.CurrentTarget.Distance >= 8 && Me.CurrentTarget.Distance <= 25),
                       CreateSpellCast("Skull Bash (Cat)", ret => Me.CurrentTarget.IsCasting),
                       // Kudos to regecksqt for the dash/stampeding roar logic. Slightly changed for reading purposes.
                       new Decorator(
                           ret =>
                           Me.CurrentTarget.Distance > 5 && Me.Combat &&
                           !Me.CurrentTarget.IsSafelyFacing(Me.Location) &&
                           Me.CurrentTarget.IsMoving && Me.CurrentTarget.MovementInfo.RunSpeed > Me.MovementInfo.RunSpeed,
                           new PrioritySelector(
                               CreateSpellCast("Dash"),
                               CreateSpellCast("Stampeding Roar (Cat)", ret => Me.CurrentEnergy >= 50))),
                       new Decorator(
                           ret => Me.CurrentTarget.Distance <= 5,
                           new PrioritySelector(
                               //new Decorator(
                               //    ret => StyxWoW.Me.IsMoving,
                               //    // We use the player mover, since people can override it. This lets us support their stuff.
                               //    new Action(ret => Navigator.PlayerMover.MoveStop())),

                               CreateSpellCast("Barkskin", ret => NearbyUnfriendlyUnits.Count(u => u.Distance < 5) > 0),
                               CreateSpellCast("Tiger's Fury", ret => Me.CurrentEnergy <= 50),
                               new Decorator(
                                   ret => Me.ComboPoints == 5 || Me.ComboPoints > 2 && Me.CurrentTarget.HealthPercent < 40 && !CurrentTargetIsElite,
                                   new PrioritySelector(
                                       CreateSpellBuffOnSelf("Savage Roar", ret => Me.HealthPercent >= 75),
                                       CreateSpellCast("Maim", ret => !Me.CurrentTarget.Stunned),
                                       CreateSpellCast(
                                           "Rip", ret => !Me.CurrentTarget.HasAura("Rip") || Me.CurrentTarget.GetAuraByName("Rip").CreatorGuid != Me.Guid),
                                       CreateSpellCast("Ferocious Bite"))),
                               // Handle Ravage! proc. Cast from spell ID here. Ignore the SpellManager!
                               new Decorator(
                                   ret => /*IsBehind(Me.CurrentTarget) &&*/ Me.HasAura("Stampede"),
                                   new Action(a => WoWSpell.FromId(81170).Cast())),
                               new Decorator(
                                   ret => !Me.CurrentTarget.HasAura("Mangle") && SpellManager.CanCast("Mangle (Cat)"),
                                   new Action(ret => SpellManager.Cast("Mangle (Cat)"))),
                               CreateSpellCast(
                                   "Rake", ret => !Me.CurrentTarget.HasAura("Rake") || Me.CurrentTarget.GetAuraByName("Rake").CreatorGuid != Me.Guid),
                               CreateSpellCast("Shred", ret => Me.IsBehind(Me.CurrentTarget)),
                               // Don't swipe if we don't have more than 2 people/mobs on us, within range.
                               CreateSpellCast("Swipe (Cat)", ret => NearbyUnfriendlyUnits.Count(u => u.DistanceSqr <= 5 * 5) >= 2),
                               //new ActionLog("Mangle"),
                               CreateSpellCast("Mangle (Cat)"))),
                       CreateSpellBuff("Faerie Fire (Feral)", ret => !Me.HasAura("Prowl")),
                       // We're putting movement at the bottom. Since we want the stuff above, to happen first. If we're out of range, we'll automatically fall
                       // back to here and get within melee range to f**k shit up.
                       CreateMoveToAndFace(4, ret => Me.CurrentTarget)
                       ));
        }
コード例 #23
0
 public static IConnRef startTransaction(ConnectionParams cp)
 {
     Me.Connect(cp);
     return(new ConnRef(Me));
 }
コード例 #24
0
        private void QLogic(Obj_AI_Hero target, bool UseQ1 = false)// SFX Challenger MissFortune QLogic (im so lazy, kappa)
        {
            if (target != null)
            {
                if (target.IsValidTarget(Q.Range))
                {
                    Q.CastOnUnit(target);
                }
                else if (UseQ1 && target.IsValidTarget(QExtend.Range) && target.DistanceToPlayer() > Q.Range)
                {
                    var heroPositions = (from t in HeroManager.Enemies
                                         where t.IsValidTarget(QExtend.Range)
                                         let prediction = Q.GetPrediction(t)
                                                          select new CPrediction.Position(t, prediction.UnitPosition)).Where(
                        t => t.UnitPosition.Distance(Me.Position) < QExtend.Range).ToList();

                    if (heroPositions.Any())
                    {
                        var minions = MinionManager.GetMinions(QExtend.Range, MinionTypes.All, MinionTeam.NotAlly);

                        if (minions.Any(m => m.IsMoving) &&
                            !heroPositions.Any(h => h.Hero.HasBuff("missfortunepassive")))
                        {
                            return;
                        }

                        var outerMinions   = minions.Where(m => m.Distance(Me) > Q.Range).ToList();
                        var innerPositions = minions.Where(m => m.Distance(Me) < Q.Range).ToList();

                        foreach (var minion in innerPositions)
                        {
                            var lMinion  = minion;
                            var coneBuff = new Geometry.Polygon.Sector(
                                minion.Position,
                                Me.Position.Extend(minion.Position, Me.Distance(minion) + Q.Range * 0.5f),
                                (float)(40 * Math.PI / 180), QExtend.Range - Q.Range);
                            var coneNormal = new Geometry.Polygon.Sector(
                                minion.Position,
                                Me.Position.Extend(minion.Position, Me.Distance(minion) + Q.Range * 0.5f),
                                (float)(60 * Math.PI / 180), QExtend.Range - Q.Range);

                            foreach (var enemy in
                                     heroPositions.Where(
                                         m => m.UnitPosition.Distance(lMinion.Position) < QExtend.Range - Q.Range))
                            {
                                if (coneBuff.IsInside(enemy.Hero) && enemy.Hero.HasBuff("missfortunepassive"))
                                {
                                    Q.CastOnUnit(minion);
                                    return;
                                }
                                if (coneNormal.IsInside(enemy.UnitPosition))
                                {
                                    var insideCone =
                                        outerMinions.Where(m => coneNormal.IsInside(m.Position)).ToList();

                                    if (!insideCone.Any() ||
                                        enemy.UnitPosition.Distance(minion.Position) <
                                        insideCone.Select(
                                            m => m.Position.Distance(minion.Position) - m.BoundingRadius)
                                        .DefaultIfEmpty(float.MaxValue)
                                        .Min())
                                    {
                                        Q.CastOnUnit(minion);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #25
0
        protected override Composite CreateBehavior()
        {
            return(_root ?? (_root =
                                 new PrioritySelector(

                                     new Decorator(ret => Me.QuestLog.GetQuestById((uint)QuestId) != null && Me.QuestLog.GetQuestById((uint)QuestId).IsCompleted || MobList.Count == 0 || Me.QuestLog.GetQuestById((uint)QuestId).IsFailed,
                                                   new Sequence(
                                                       new Action(ret => TreeRoot.StatusText = "Finished!"),
                                                       new WaitContinue(120,
                                                                        new Action(delegate
            {
                _isBehaviorDone = true;
                return RunStatus.Success;
            }))
                                                       )),

                                     new Decorator(ret => Me.CurrentTarget != null && Me.CurrentTarget.IsFriendly,
                                                   new Action(ret => Me.ClearTarget())),

                                     new Decorator(
                                         ret => MobList.Count > 0 && MobList[0].IsHostile,
                                         new PrioritySelector(
                                             new Decorator(
                                                 ret => Me.CurrentTarget != MobList[0],
                                                 new Action(ret =>
            {
                MobList[0].Target();
                StyxWoW.SleepForLagDuration();
            })),
                                             new Decorator(
                                                 ret => !Me.Combat,
                                                 new PrioritySelector(
                                                     new Decorator(
                                                         ret => RoutineManager.Current.PullBehavior != null,
                                                         RoutineManager.Current.PullBehavior),
                                                     new Action(ret => RoutineManager.Current.Pull()))))),


                                     new Decorator(
                                         ret => MobList.Count > 0 && (!Me.Combat || Me.CurrentTarget == null || Me.CurrentTarget.Dead) &&
                                         MobList[0].CurrentTarget == null && MobList[0].DistanceSqr > 5f * 5f,
                                         new Sequence(
                                             new Action(ret => TreeRoot.StatusText = "Following Mob - " + MobList[0].Name + " At X: " + MobList[0].X + " Y: " + MobList[0].Y + " Z: " + MobList[0].Z),
                                             new Action(ret => Navigator.MoveTo(MobList[0].Location)),
                                             new Action(ret => Thread.Sleep(100))
                                             )
                                         ),

                                     new Decorator(ret => MobList.Count > 0 && (Me.Combat || MobList[0].Combat),
                                                   new PrioritySelector(
                                                       new Decorator(
                                                           ret => Me.CurrentTarget == null && MobList[0].CurrentTarget != null,
                                                           new Sequence(
                                                               new Action(ret => MobList[0].CurrentTarget.Target()),
                                                               new Action(ret => StyxWoW.SleepForLagDuration()))),
                                                       new Decorator(
                                                           ret => !Me.Combat,
                                                           new PrioritySelector(
                                                               new Decorator(
                                                                   ret => RoutineManager.Current.PullBehavior != null,
                                                                   RoutineManager.Current.PullBehavior),
                                                               new Action(ret => RoutineManager.Current.Pull())))))

                                     )
                             ));
        }
コード例 #26
0
 private static Composite CreateArmsAoeCombat(SimpleIntDelegate aoeCount)
 {
     return(new PrioritySelector( //cleave
                new Decorator(
                    ret => Spell.UseAOE && aoeCount(ret) >= 2 && Common.HasTalent(WarriorTalents.SweepingStrikes),
                    new PrioritySelector(
                        Spell.Cast("Mortal Strike"),
                        Spell.Cast("Execute", ret => Me.HasAura("Stone Heart")),
                        Spell.Cast("Colossus Smash", ret => !Me.HasAura("Shattered Defenses") && !Target.HasAura("Precise Strikes")),
                        Spell.Cast("Warbreaker", ret => !Me.HasAura("Shattered Defenses")),
                        Spell.Cast("Whirlwind", ret => Common.HasTalent(WarriorTalents.FervorOfBattle) && (DebuffColossusSmashUp || (Me.CurrentRage >= Me.MaxRage - 50)) && Me.HasAura("Cleave")),
                        Spell.Cast("Rend", ret => Target.GetAuraByName("Rend").TimeLeft() < Target.GetAuraByName("Rend").Duration * .3),
                        Spell.Cast("Bladestorm"),
                        Spell.Cast("Cleave"),
                        Spell.Cast("Whirlwind", ret => Me.CurrentRage >= 40 || Me.HasAura("Cleave")),
                        new ActionAlwaysFail()
                        )),
                new Decorator( //aoe
                    ret => Spell.UseAOE && aoeCount(ret) >= 5 && Common.HasTalent(WarriorTalents.SweepingStrikes),
                    new PrioritySelector(
                        Spell.Cast("Warbreaker", ret => Spell.GetSpellCooldown("Bladestorm").TotalSeconds < 1 && Spell.GetSpellCooldown("Battle Cry").TotalSeconds < 1),
                        Spell.Cast("Bladestorm", ret => Me.HasAura("Battle Cry") && (NumTier20Pieces >= 4 || StyxWoW.Me.Inventory.Equipped.Head.ItemInfo.Guid == 151823)),
                        Spell.Cast("Colossus Smash", ret => !Me.HasAura("In For The Kill") && Common.HasTalent(WarriorTalents.InForTheKill)),
                        Spell.Cast("Colossus Smash", ret => !DebuffColossusSmashUp && Unit.UnfriendlyUnits(8).Count() <= 10),
                        Spell.Cast("Cleave"),
                        Spell.Cast("Whirlwind", ret => Me.HasAura("Cleave")),
                        Spell.Cast("Whirlwind", ret => Unit.UnfriendlyUnits(8).Count() >= 7),
                        Spell.Cast("Colossus Smash", ret => !Me.HasAura("Shattered Defenses")),
                        Spell.Cast("Execute", ret => Me.HasAura("Stone Heart")),
                        Spell.Cast("Mortal Strike", ret => Me.HasAura("Shattered Defenses") || Target.GetAuraByName("Executioner's Precision").stackCount == 0),
                        Spell.Cast("Rend", ret => Target.GetAuraByName("Rend").TimeLeft() < Target.GetAuraByName("Rend").Duration * .3 && Unit.UnfriendlyUnits(8).Count() <= 3, RendCycleTarget),
                        Spell.Cast("Whirlwind")
                        )
                    )
                ));
 }
コード例 #27
0
 private bool IsInVehicle()
 {
     return
         (Query.IsInVehicle() ||
          Me.HasAura(AuraId_ProxyVehicle));
 }
コード例 #28
0
        private Composite CreateMainBehavior()
        {
            return(new PrioritySelector(

                       // If quest is done, behavior is done...
                       new Decorator(context => IsDone,
                                     new Action(context =>
            {
                _isBehaviorDone = true;
                QBCLog.Info("Finished");
            })),


                       // Stateful Operation:
                       new Switch <StateType_MainBehavior>(context => State_MainBehavior,
                                                           #region State: DEFAULT
                                                           new Action(context => // default case
            {
                QBCLog.MaintenanceError("StateType_MainBehavior({0}) is unhandled", State_MainBehavior);
                TreeRoot.Stop();
                _isBehaviorDone = true;
            }),
                                                           #endregion


                                                           #region State: Dropping Off Victim
                                                           new SwitchArgument <StateType_MainBehavior>(StateType_MainBehavior.DroppingOffVictim,
                                                                                                       new PrioritySelector(
                                                                                                           // If Watchman dropped off, go get another...
                                                                                                           new Decorator(context => !Me.HasAura(AuraId_RescueDrowningWatchman),
                                                                                                                         new Action(context =>
            {
                WoWMovement.MoveStop();
                _currentPath = null;
                SelectedTarget = null;
                State_MainBehavior = StateType_MainBehavior.PathingOutToVictim;
            })),

                                                                                                           // Move to drop off spot...
                                                                                                           new Decorator(context => Me.Location.Distance(PositionToMakeLandfall) > Navigator.PathPrecision,
                                                                                                                         new ActionRunCoroutine(
                                                                                                                             context => UtilityCoroutine.MoveTo(
                                                                                                                                 PositionToMakeLandfall,
                                                                                                                                 "back to shore")))
                                                                                                           )),
                                                           #endregion


                                                           #region State: Pathing Out to Victim
                                                           new SwitchArgument <StateType_MainBehavior>(StateType_MainBehavior.PathingOutToVictim,
                                                                                                       new PrioritySelector(
                                                                                                           // If our selected target is no good, find another...
                                                                                                           new Decorator(context => !IsViableDrowningWatchman(SelectedTarget),
                                                                                                                         new Action(context =>
            {
                QBCLog.Info("Finding new Drowning Watchman to save");
                _currentPath = null;
                SelectedTarget = FindDrowningWatchman();
            })),

                                                                                                           // Show user which target we're after...
                                                                                                           new Decorator(context => Me.CurrentTarget != SelectedTarget,
                                                                                                                         new Action(context => { SelectedTarget.Target(); })),

                                                                                                           // If we don't have a path to victim, find one...
                                                                                                           new Decorator(context => _currentPath == null,
                                                                                                                         new Action(context => { _currentPath = FindPath(Me.Location, SelectedTarget.Location); })),

                                                                                                           // If path completely consumed, we're done...
                                                                                                           new Decorator(context => _currentPath.Count() <= 0,
                                                                                                                         new Action(context => { State_MainBehavior = StateType_MainBehavior.Rescuing; })),

                                                                                                           // If we've arrived at the current waypoint, dequeue it...
                                                                                                           new Decorator(context => Navigator.AtLocation(_currentPath.Peek()),
                                                                                                                         new Action(context => { _currentPath.Dequeue(); })),

                                                                                                           // Follow the prescribed path...
                                                                                                           new ActionRunCoroutine(
                                                                                                               context => UtilityCoroutine.MoveTo(
                                                                                                                   _currentPath.Peek(),
                                                                                                                   "out to Drowned Watcman"))
                                                                                                           )),
                                                           #endregion


                                                           #region State: Rescuing
                                                           new SwitchArgument <StateType_MainBehavior>(StateType_MainBehavior.Rescuing,
                                                                                                       new PrioritySelector(
                                                                                                           // If we've got the Watchman, start heading in...
                                                                                                           new Decorator(context => Me.HasAura(AuraId_RescueDrowningWatchman),
                                                                                                                         new Action(context =>
            {
                _currentPath = null;
                State_MainBehavior = StateType_MainBehavior.PathingIntoShore;
            })),

                                                                                                           // If our selected target is no good, find another...
                                                                                                           new Decorator(context => !IsViableDrowningWatchman(SelectedTarget),
                                                                                                                         new Action(context =>
            {
                _currentPath = null;
                SelectedTarget = null;
                State_MainBehavior = StateType_MainBehavior.PathingOutToVictim;
            })),

                                                                                                           // Go get a fresh Drowning Watchman...
                                                                                                           UtilityBehavior_InteractWithMob(context => SelectedTarget)
                                                                                                           )),
                                                           #endregion


                                                           #region State: Pathing Into Shore
                                                           new SwitchArgument <StateType_MainBehavior>(StateType_MainBehavior.PathingIntoShore,
                                                                                                       new PrioritySelector(
                                                                                                           // If we don't have a path, find the correct one...
                                                                                                           new Decorator(context => _currentPath == null,
                                                                                                                         new Action(context => { _currentPath = FindPath(Me.Location, PositionToMakeLandfall); })),

                                                                                                           // If path completely consumed, we're done...
                                                                                                           new Decorator(context => _currentPath.Count() <= 0,
                                                                                                                         new Action(context => { State_MainBehavior = StateType_MainBehavior.DroppingOffVictim; })),

                                                                                                           // If we've lost the Watchman we rescued, go fetch another...
                                                                                                           new Decorator(context => !Me.HasAura(AuraId_RescueDrowningWatchman),
                                                                                                                         new Action(context =>
            {
                _currentPath = null;
                SelectedTarget = null;
                State_MainBehavior = StateType_MainBehavior.PathingOutToVictim;
            })),

                                                                                                           // If we've arrived at the current waypoint, dequeue it...
                                                                                                           new Decorator(context => Navigator.AtLocation(_currentPath.Peek()),
                                                                                                                         new Action(context => { _currentPath.Dequeue(); })),

                                                                                                           // Follow the prescribed path...
                                                                                                           new ActionRunCoroutine(
                                                                                                               context => UtilityCoroutine.MoveTo(
                                                                                                                   _currentPath.Peek(),
                                                                                                                   "in to drop off Drowned Watchman"))
                                                                                                           ))
                                                           #endregion
                                                           )));
        }
コード例 #29
0
        public void Main(string argument, UpdateType updateSource)
        {
            subsystemManager.UpdateTime();

            if (argument == "descend")
            {
                Mode       = 1;
                lockMatrix = Drive.Controller.WorldMatrix;
            }
            else if (argument == "ascend")
            {
                Mode       = 2;
                lockMatrix = Drive.Controller.WorldMatrix;
            }
            else if (argument == "stop")
            {
                Mode       = 0;
                lockMatrix = MatrixD.Zero;
                Drive.Clear();
            }
            else if (commandLine.TryParse(argument))
            {
                subsystemManager.Command(commandLine.Argument(0), commandLine.Argument(1), commandLine.ArgumentCount > 2 ? commandLine.Argument(2) : null);
            }
            else
            {
                try
                {
                    subsystemManager.Update(updateSource);

                    runs++;
                    if (runs % 5 == 0)
                    {
                        OutputBuilder.Clear();

                        OutputBuilder.Append($"STATUS: ").AppendLine(Mode == 0 ? "STOP" : (Mode == 1 ? "DESC" : "ASCE"));

                        foreach (var screen in Displays)
                        {
                            screen.ContentType = ContentType.TEXT_AND_IMAGE;
                            screen.WriteText(OutputBuilder.ToString());
                        }

                        var destination = new Waypoint();

                        if (Mode == 0)
                        {
                            Drive.Clear();
                        }
                        else if (Mode == 1)
                        {
                            destination.MaxSpeed = DescendSpeed;
                            var gravdir = Cockpit.GetNaturalGravity();
                            if (gravdir == Vector3D.Zero)
                            {
                                gravdir.Normalize();

                                destination.Position = gravdir * 10 + Cockpit.GetPosition();

                                var flatForward = Cockpit.WorldMatrix.Forward - VectorHelpers.VectorProjection(Cockpit.WorldMatrix.Forward, gravdir);
                                flatForward.Normalize();
                                var flatLeft = Cockpit.WorldMatrix.Left - VectorHelpers.VectorProjection(Cockpit.WorldMatrix.Forward, gravdir);
                                flatLeft.Normalize();

                                destination.Direction = flatForward * TrigHelpers.FastCos(0.02 * RotateSpeed) + flatLeft * TrigHelpers.FastSin(0.02 * RotateSpeed);
                            }
                            else
                            {
                                destination.Position    = lockMatrix.Down * 10 + Cockpit.GetPosition();
                                destination.DirectionUp = lockMatrix.Up;

                                var flatForward = Cockpit.WorldMatrix.Forward - VectorHelpers.VectorProjection(Cockpit.WorldMatrix.Forward, lockMatrix.Down);
                                flatForward.Normalize();
                                var flatLeft = Cockpit.WorldMatrix.Left - VectorHelpers.VectorProjection(Cockpit.WorldMatrix.Forward, lockMatrix.Down);
                                flatLeft.Normalize();

                                destination.Direction = flatForward * TrigHelpers.FastCos(0.02 * RotateSpeed) + flatLeft * TrigHelpers.FastSin(0.02 * RotateSpeed);
                            }
                        }
                        else if (Mode == 2)
                        {
                            destination.MaxSpeed = AscendSpeed;
                            if (Drive.Controller == Cockpit)
                            {
                                var gravdir = Cockpit.GetNaturalGravity();
                                gravdir.Normalize();

                                destination.Position = -gravdir * 10 + Cockpit.GetPosition();
                            }
                            else
                            {
                                destination.Position  = lockMatrix.Down * 10 + Cockpit.GetPosition();
                                destination.Direction = lockMatrix.Forward;
                            }
                        }

                        Drive.Move(destination.Position);
                        Drive.Turn(destination.Direction);
                        Drive.Spin(destination.DirectionUp);
                        Drive.SetMaxSpeed(destination.MaxSpeed);
                    }
                }
                catch (Exception e)
                {
                    Me.GetSurface(0).WriteText(e.Message);
                    Me.GetSurface(0).WriteText("\n", true);
                    Me.GetSurface(0).WriteText(e.StackTrace);
                    Me.GetSurface(0).WriteText("\n", true);
                    Me.GetSurface(0).WriteText(e.ToString());
                }
                var s = subsystemManager.GetStatus();
                if (!string.IsNullOrEmpty(s))
                {
                    Echo(s);
                }
                else
                {
                    Echo(((int)subsystemManager.OutputMode).ToString());
                }
            }
        }
コード例 #30
0
        protected override void CombatRotation()
        {
            base.CombatRotation();
            WoWUnit Target = ObjectManager.Target;

            // PARTY Remove Curse
            if (settings.PartyRemoveCurse)
            {
                List <AIOPartyMember> needRemoveCurse = AIOParty.GroupAndRaid
                                                        .FindAll(m => m.InCombatFlagOnly && ToolBox.HasCurseDebuff(m.Name))
                                                        .ToList();
                if (needRemoveCurse.Count > 0 && cast.OnFocusUnit(RemoveCurse, needRemoveCurse[0]))
                {
                    return;
                }
            }

            // Use Mana Stone
            if (Me.ManaPercentage < 20 &&
                _foodManager.UseManaStone())
            {
                return;
            }

            // Evocation
            if (Me.ManaPercentage < 20 &&
                AIORadar.CloseUnitsTargetingMe.Count <= 0 &&
                cast.OnSelf(Evocation))
            {
                Usefuls.WaitIsCasting();
                return;
            }

            // Dragon's Breath
            if (ToolBox.GetNbEnemiesClose(10f) > 2 &&
                cast.OnSelf(DragonsBreath))
            {
                return;
            }

            // Blast Wave
            if (ToolBox.GetNbEnemiesClose(10f) > 2 &&
                cast.OnSelf(BlastWave))
            {
                return;
            }

            // Icy Veins
            if (Target.HealthPercent < 100 &&
                Me.ManaPercentage > 10 &&
                cast.OnSelf(IcyVeins))
            {
                return;
            }

            // Arcane Power
            if (Target.HealthPercent < 100 &&
                Me.ManaPercentage > 10 &&
                cast.OnSelf(ArcanePower))
            {
                return;
            }

            // Presence of Mind
            if (!Me.HaveBuff("Presence of Mind") &&
                Target.HealthPercent < 100 &&
                cast.OnSelf(PresenceOfMind))
            {
                return;
            }
            if (Me.HaveBuff("Presence of Mind"))
            {
                if (cast.OnTarget(Fireball) || cast.OnTarget(Frostbolt))
                {
                    Usefuls.WaitIsCasting();
                    return;
                }
            }

            // Cold Snap
            if (IcyVeins.GetCurrentCooldown > 0 &&
                Me.ManaPercentage > 10 &&
                !Me.HaveBuff(IcyVeins.Name) &&
                cast.OnSelf(ColdSnap))
            {
                return;
            }

            // Scorch first
            int wantedScorchCount      = Target.IsBoss ? 5 : 2;
            int nbScorchDebuffOnTarget = ToolBox.CountDebuff("Fire Vulnerability", "target");

            if (_knowImprovedScorch &&
                (nbScorchDebuffOnTarget < wantedScorchCount) &&
                cast.OnTarget(Scorch))
            {
                return;
            }

            // Scorch renewal
            if (_knowImprovedScorch &&
                (nbScorchDebuffOnTarget >= wantedScorchCount && ToolBox.DeBuffTimeLeft("Fire Vulnerability", "target") < 10) &&
                cast.OnTarget(Scorch))
            {
                Thread.Sleep(1000);
                return;
            }

            // Combustion
            if (!Me.HaveBuff("Combustion") &&
                Combustion.GetCurrentCooldown <= 0 &&
                ToolBox.DeBuffTimeLeft("Fire Vulnerability", "target") > 20 &&
                ToolBox.CountDebuff("Fire Vulnerability", "target") >= wantedScorchCount &&
                cast.OnSelf(Combustion))
            {
                return;
            }

            // Fire Blast
            if (!_knowImprovedScorch &&
                cast.OnTarget(FireBlast))
            {
                return;
            }

            // Fireball
            if (cast.OnTarget(Fireball))
            {
                return;
            }


            // Stop wand if banned
            if (ToolBox.UsingWand() &&
                UnitImmunities.Contains(ObjectManager.Target, "Shoot") &&
                cast.OnTarget(UseWand))
            {
                return;
            }

            // Spell if wand banned
            if (UnitImmunities.Contains(ObjectManager.Target, "Shoot"))
            {
                if (cast.OnTarget(Frostbolt) || cast.OnTarget(Fireball) || cast.OnTarget(ArcaneBlast) || cast.OnTarget(ArcaneMissiles))
                {
                    return;
                }
            }

            // Use Wand
            if (!ToolBox.UsingWand() &&
                _iCanUseWand &&
                !cast.IsBackingUp &&
                !MovementManager.InMovement &&
                cast.OnTarget(UseWand, false))
            {
                return;
            }
        }
コード例 #31
0
        protected override void Pull()
        {
            base.Pull();

            // Pet attack
            if (ObjectManager.Pet.Target != ObjectManager.Me.Target)
            {
                Lua.LuaDoString("PetAttack();", false);
            }

            // Life Tap
            if (Me.HealthPercent > Me.ManaPercentage &&
                !Me.IsMounted &&
                settings.UseLifeTap &&
                cast.OnSelf(LifeTap))
            {
                return;
            }

            // Amplify Curse
            if (!Me.HaveBuff("Amplify Curse") &&
                cast.OnSelf(AmplifyCurse))
            {
                return;
            }

            // Siphon Life
            if (Me.HealthPercent < 90 &&
                settings.UseSiphonLife &&
                !ObjectManager.Target.HaveBuff("Siphon Life") &&
                cast.OnTarget(SiphonLife))
            {
                return;
            }

            // Unstable Affliction
            if (!ObjectManager.Target.HaveBuff("Unstable Affliction") &&
                cast.OnTarget(UnstableAffliction))
            {
                return;
            }

            // Curse of Agony
            if (!ObjectManager.Target.HaveBuff("Curse of Agony") &&
                cast.OnTarget(CurseOfAgony))
            {
                return;
            }

            // Corruption
            if (!ObjectManager.Target.HaveBuff("Corruption") &&
                cast.OnTarget(Corruption))
            {
                return;
            }

            // Immolate
            if (!ObjectManager.Target.HaveBuff("Immolate") &&
                !ObjectManager.Target.HaveBuff("Fire Ward") &&
                !Corruption.KnownSpell &&
                cast.OnTarget(Immolate))
            {
                return;
            }

            // Shadow Bolt
            if (!Immolate.KnownSpell &&
                cast.OnTarget(ShadowBolt))
            {
                return;
            }
        }
コード例 #32
0
ファイル: SpellCastManager.cs プロジェクト: wade1990/PortAIO
        internal static void InitSpellShield(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs Args)
        {
            if (sender == null || !sender.IsEnemy || sender.Type != GameObjectType.AIHeroClient || Args.SData == null ||
                Args.Target == null || !Args.Target.IsMe)
            {
                return;
            }

            if (Menu.GetBool("EShielddogde") && E.IsReady() && Me.CanMoveMent())
            {
                if (Args.SData.Name.Contains("DariusR"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeDariusR"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("GarenQ"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeGarenQ"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("GarenR"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeGarenR"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("IreliaE"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeIreliaE"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("LeeSinR"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeLeeSinR"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("OlafE"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeOlafE"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("RenektonW"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeRenektonW"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("RenektonPreExecute"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgePantheonW"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("RengarQ"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeRengarQ"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("VeigarR"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeVeigarR"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("VolibearW"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeVolibearW"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("XenZhaoThrust3"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeXenZhaoQ3"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }

                if (Args.SData.Name.Contains("attack") && Args.Target.IsMe &&
                    sender.Buffs.Any(
                        buff =>
                        buff.Name == "BlueCardAttack" || buff.Name == "GoldCardAttack" ||
                        buff.Name == "RedCardAttack"))
                {
                    if (E.IsReady() && Menu.GetBool("EDodgeTwistedFateW"))
                    {
                        E.Cast(Me.Position.Extend(Game.CursorPos, E.Range), true);
                    }
                }
            }
        }
コード例 #33
0
        protected override void BuffRotation()
        {
            base.BuffRotation();

            // Life Tap
            if (Me.HealthPercent > Me.ManaPercentage &&
                settings.UseLifeTap &&
                !Me.IsMounted &&
                cast.OnSelf(LifeTap))
            {
                return;
            }

            // Unending Breath
            if (!Me.HaveBuff("Unending Breath") &&
                settings.UseUnendingBreath &&
                cast.OnSelf(UnendingBreath))
            {
                return;
            }

            // Fel Armor
            if (!Me.HaveBuff("Fel Armor") &&
                settings.UseFelArmor &&
                cast.OnSelf(FelArmor))
            {
                return;
            }

            // Demon Armor
            if (!Me.HaveBuff("Demon Skin") &&
                !Me.HaveBuff("Demon Armor") &&
                !Me.HaveBuff("Fel Armor") &&
                cast.OnSelf(DemonArmor))
            {
                return;
            }

            // Demon Skin
            if (!Me.HaveBuff("Demon Skin") &&
                !Me.HaveBuff("Demon Armor") &&
                !Me.HaveBuff("Fel Armor") &&
                cast.OnSelf(DemonSkin))
            {
                return;
            }

            // Soul Link
            if (!Me.HaveBuff("Soul Link") &&
                ObjectManager.Pet.IsAlive &&
                cast.OnSelf(SoulLink))
            {
                return;
            }

            // Health Funnel OOC
            if (ObjectManager.Pet.HealthPercent < 50 &&
                Me.HealthPercent > 40 &&
                ObjectManager.Pet.GetDistance < 19 &&
                !ObjectManager.Pet.InCombatFlagOnly &&
                settings.HealthFunnelOOC)
            {
                Lua.LuaDoString("PetWait();");
                MovementManager.StopMove();
                Fight.StopFight();

                if (WarlockPetAndConsumables.MyWarlockPet().Equals("Voidwalker"))
                {
                    cast.PetSpell("Consume Shadows", false, true);
                }

                if (cast.OnSelf(HealthFunnel))
                {
                    Thread.Sleep(500);
                    Usefuls.WaitIsCasting();
                    Lua.LuaDoString("PetFollow();");
                    return;
                }
                Lua.LuaDoString("PetFollow();");
            }

            // Health Stone
            if (!WarlockPetAndConsumables.HaveHealthstone() &&
                cast.OnSelf(CreateHealthStone))
            {
                return;
            }

            // Create Soul Stone
            if (!WarlockPetAndConsumables.HaveSoulstone() &&
                cast.OnSelf(CreateSoulstone))
            {
                return;
            }

            // Use Soul Stone
            if (!Me.HaveBuff("Soulstone Resurrection") &&
                CreateSoulstone.KnownSpell &&
                ToolBox.HaveOneInList(WarlockPetAndConsumables.SoulStones()) &&
                ToolBox.GetItemCooldown(WarlockPetAndConsumables.SoulStones()) <= 0)
            {
                MovementManager.StopMoveNewThread();
                MovementManager.StopMoveToNewThread();
                Lua.RunMacroText("/target player");
                ToolBox.UseFirstMatchingItem(WarlockPetAndConsumables.SoulStones());
                Usefuls.WaitIsCasting();
                Lua.RunMacroText("/cleartarget");
            }
        }
コード例 #34
0
        public static Me SearchMe()
        {
            using (var db = new PersonContext())
            {
                Me me;
                try
                {
                    me = db.Me.FirstOrDefault();
                }
                catch (Exception)
                {
                    me = new Me();
                }

                return me;
            }
        }
コード例 #35
0
 public ApproachControlLimits(STFReader stf)
 {
     stf.ParseBlock(new STFReader.TokenProcessor[] {
         new STFReader.TokenProcessor("positionmiles", () => { ApproachControlPositionM = Me.FromMi(stf.ReadFloatBlock(STFReader.UNITS.None, 0)); }),
         new STFReader.TokenProcessor("positionkm", () => { ApproachControlPositionM = (stf.ReadFloatBlock(STFReader.UNITS.None, 0) * 1000); }),
         new STFReader.TokenProcessor("positionm", () => { ApproachControlPositionM = stf.ReadFloatBlock(STFReader.UNITS.None, 0); }),
         new STFReader.TokenProcessor("positionyd", () => { ApproachControlPositionM = Me.FromYd(stf.ReadFloatBlock(STFReader.UNITS.None, 0)); }),
         new STFReader.TokenProcessor("speedmph", () => { ApproachControlSpeedMpS = MpS.FromMpH(stf.ReadFloatBlock(STFReader.UNITS.None, 0)); }),
         new STFReader.TokenProcessor("speedkph", () => { ApproachControlSpeedMpS = MpS.FromKpH(stf.ReadFloatBlock(STFReader.UNITS.None, 0)); }),
     });
 }