当前位置: 首页>>代码示例>>C#>>正文


C# WoWUnit.Face方法代码示例

本文整理汇总了C#中WoWUnit.Face方法的典型用法代码示例。如果您正苦于以下问题:C# WoWUnit.Face方法的具体用法?C# WoWUnit.Face怎么用?C# WoWUnit.Face使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WoWUnit的用法示例。


在下文中一共展示了WoWUnit.Face方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AvoidFrontal

        public static void AvoidFrontal(WoWUnit npcID, int radius, int range)
        {
            // npcName: NPC ID number, radius: (how wide is the cone in deg) 0 is safely behind, range: Range of the spell
            if (!StyxWoW.Me.IsFacing(npcID)) { npcID.Face(); }

            var rotation = GetPositive(npcID.RotationDegrees);
            var invertRotation = GetInvert(rotation);
            var move = GetPositive(StyxWoW.Me.RotationDegrees) > invertRotation ? WoWMovement.MovementDirection.StrafeRight : WoWMovement.MovementDirection.StrafeLeft;

            while (npcID.Distance2D <= range && npcID.IsCasting && ((radius == 0 && !StyxWoW.Me.IsSafelyBehind(npcID)) ||
                  (radius != 0 && npcID.IsSafelyFacing(StyxWoW.Me, radius)) || npcID.Distance2D <= 2)) {
                WoWMovement.Move(move);
                npcID.Face();
            }
            WoWMovement.MoveStop();
        }
开发者ID:TaiGel,项目名称:akna-hb,代码行数:16,代码来源:AvoidCasts.cs

示例2: Face

 public static void Face(WoWUnit mob)
 {
     DateTime stoptime = DateTime.Now.AddSeconds(1);
     if (StyxWoW.Me.Location == mob.Location)
     {
         KeyboardManager.PressKey((char)Keys.Back);
         Thread.Sleep(50);
         KeyboardManager.ReleaseKey((char)Keys.Back);
         return;
     }
     while (!StyxWoW.Me.IsSafelyFacing(mob) && DateTime.Now < stoptime)
     {
         FTWLogger.debug(Color.Violet, "Facing {0}", mob.SafeName());
         mob.Face();
         Thread.Sleep(10);
     }
 }
开发者ID:psmyth1,项目名称:code-samples,代码行数:17,代码来源:FTWCoreMovement.cs

示例3: Face

 private void Face(WoWUnit tar)
 {
     if (Styx.BotManager.Current.Name != "LazyRaider")
     {
         tar.Face();
     }
 }
开发者ID:Borgsen,项目名称:celisuis-honorbuddy-pack,代码行数:7,代码来源:EzRetv2.cs

示例4: CastSafe

        // ------------ Spell Functions
        public static bool CastSafe(string spellName, WoWUnit Unit, bool wait)
        {
            bool SpellSuccess = false;
            if (Me.IsCasting)
            {
                Logging.Write("Rarekiller Part Spells: I was already Casting");
                return false;
            }
            if (!SpellManager.HasSpell(spellName))
            {
                Logging.Write("Rarekiller Part Spells: I don't have Spell {0}", spellName);
                return false;
            }

            if (SpellManager.HasSpell(spellName) && !Me.IsCasting)
            {
                if (SpellManager.Spells[spellName].CastTime > 1)
                    WoWMovement.MoveStop();
                Unit.Target();
                Thread.Sleep(100);
                Unit.Face();
                Thread.Sleep(150);

                while (SpellManager.GlobalCooldown)
                {
                    Thread.Sleep(10);
                }

                if (!SpellManager.CanCast(spellName))
                {
                    Logging.Write("Rarekiller Part Spells: cannot cast spell '{0}' yet - cd={1}, gcd={2}, casting={3} ",
                        SpellManager.Spells[spellName].Name,
                        SpellManager.Spells[spellName].Cooldown,
                        SpellManager.GlobalCooldown,
                        Me.IsCasting
                        );
                    return false;
                }

                SpellSuccess = SpellManager.Cast(spellName);

                Thread.Sleep(200);

                //if (SpellManager.GlobalCooldown || Me.IsCasting)
                //	SpellSuccess = true;
                if (SpellSuccess)
                    Logging.Write("Rarekiller Part Spells: * {0}.", spellName);
                if (wait)
                {
                    while (SpellManager.GlobalCooldown || Me.IsCasting)
                    {
                        Thread.Sleep(100);
                    }
                }

                Logging.Write("Rarekiller Part Spells: Spell successfull? {0}.", SpellSuccess);
                return SpellSuccess;
            }

            Logging.Write("Rarekiller Part Spells: Can't cast {0}.", spellName);
            return false;
        }
开发者ID:Asphodan,项目名称:Alphabuddy,代码行数:63,代码来源:RarekillerSpells.cs

示例5: FaceTarget

        /// <summary>
        ///     (Non-Blocking) Attempts to face the specified target.
        /// </summary>
        /// <returns>Returns true if we are able to safely face the target</returns>
        public static async Task FaceTarget(WoWUnit target, Func<bool> conditionCheck = null)
        {
            if (conditionCheck != null && !conditionCheck())
                return;

            target.Face();
            await CommonCoroutines.SleepForLagDuration();
        }
开发者ID:Lbniese,项目名称:PawsPremium,代码行数:12,代码来源:MovementHelper.cs

示例6: Routine

        public static void Routine(WoWUnit _unit)
        {
            while (_unit != null && _unit.IsAlive && !StyxWoW.Me.IsSwimming && _unit.Distance <= CharacterSettings.Instance.PullDistance && !StyxWoW.Me.Mounted)
            {
                WoWSpell AutoAtack = WoWSpell.FromId(6603);

                #region PALDIN
                if (StyxWoW.Me.Class == WoWClass.Paladin)
                {
                    TreeRoot.StatusText = "CritterKillSquad: slay node ...";
                    WoWUnit AOEunit = BotCKS.getNode(_unit, 9, 2);
                    WoWSpell Weihe = WoWSpell.FromId(26573);
                    WoWSpell HammerDR = WoWSpell.FromId(53595);
                    WoWSpell HZorn = WoWSpell.FromId(2812);
                    WoWSpell KStoß = WoWSpell.FromId(35395);
                    WoWSpell GSturm = WoWSpell.FromId(53385);
                    WoWSpell SiegelDW = WoWSpell.FromId(31801);
                    WoWSpell Richturteil = WoWSpell.FromId(20271);

                    // need buff?
                    if (SpellManager.HasSpell(SiegelDW.Id) && !StyxWoW.Me.HasAura(SiegelDW.Name) && !Styx.StyxWoW.GlobalCooldown)
                    {
                        TreeRoot.StatusText = "CritterKillSquad: need buff " + SiegelDW.Name + " ...";
                        BotCKS.slog("need buff " + SiegelDW.Name);
                        SiegelDW.Cast();
                        Thread.Sleep(BotCKS.ran.Next(400, 800));
                    }

                    if (AOEunit != null)
                    {
                        if (AOEunit.Distance >= 3)
                        {
                            MoveToNode(AOEunit, 3);
                        }

                        TreeRoot.StatusText = "CritterKillSquad: search for best " + Weihe.Name + " point ...";
                        if (SpellManager.HasSpell(GSturm) && !GSturm.Cooldown && !Styx.StyxWoW.GlobalCooldown && StyxWoW.Me.HolyPowerPercent > 0)
                        {
                            TreeRoot.StatusText = "CritterKillSquad: cast " + GSturm.Name + " on ≈ " + BotCKS.AOEcount + " " + AOEunit.Name;
                            BotCKS.slog("Cast " + GSturm.Name + " on ≈ " + BotCKS.AOEcount + " " + AOEunit.Name);
                            GSturm.Cast();

                        }
                        else if (SpellManager.HasSpell(HammerDR) && !HammerDR.Cooldown && !Styx.StyxWoW.GlobalCooldown)
                        {
                            if (AOEunit.Distance >= 3)
                                MoveToNode(AOEunit, 3);

                            if (!StyxWoW.Me.GotTarget || !StyxWoW.Me.CurrentTarget.IsAlive || StyxWoW.Me.CurrentTarget != AOEunit)
                            {
                                TreeRoot.StatusText = "CritterKillSquad: face " + AOEunit.Name + " ...";
                                AOEunit.Target();
                                AOEunit.Face();
                                Thread.Sleep(BotCKS.ran.Next(200, 500));
                            }
                            TreeRoot.StatusText = "CritterKillSquad: Cast " + HammerDR.Name + " on ≈ " + BotCKS.AOEcount + " " + AOEunit.Name;
                            BotCKS.slog("Cast " + HammerDR.Name + " on ≈ " + BotCKS.AOEcount + " " + AOEunit.Name);
                            HammerDR.Cast();
                            StyxWoW.Me.ClearTarget();
                        }
                        else if (SpellManager.HasSpell(Weihe) && !Weihe.Cooldown && !Styx.StyxWoW.GlobalCooldown)
                        {
                            TreeRoot.StatusText = "CritterKillSquad: cast " + Weihe.Name + " on ≈ " + BotCKS.AOEcount + " " + AOEunit.Name;
                            BotCKS.slog("Cast " + Weihe.Name + " on ≈ " + BotCKS.AOEcount + " " + AOEunit.Name);
                            Weihe.Cast();
                        }
                        else if (SpellManager.HasSpell(HZorn) && !HZorn.Cooldown && !Styx.StyxWoW.GlobalCooldown)
                        {
                            TreeRoot.StatusText = "CritterKillSquad: Cast " + HZorn.Name + " on ≈ " + BotCKS.AOEcount + " " + AOEunit.Name;
                            BotCKS.slog("Cast " + HZorn.Name + " on ≈ " + BotCKS.AOEcount + " " + AOEunit.Name);
                            HZorn.Cast();
                        }
                        else
                        {
                            TreeRoot.StatusText = "CritterKillSquad: [WAIT] " + Weihe.Name + " & " + HammerDR.Name + " & " + HZorn.Name + " on cooldown ...";
                            Thread.Sleep(300);
                            //continue;
                        }
                        Thread.Sleep(BotCKS.ran.Next(200, 700));
                    }
                    else if (SpellManager.HasSpell(KStoß.Id) && !Styx.StyxWoW.GlobalCooldown && !KStoß.Cooldown)
                    {
                        if (_unit.Distance >= 3)
                            MoveToNode(_unit, 3);

                        TreeRoot.StatusText = "CritterKillSquad: Cast " + KStoß.Name + " ...";
                        BotCKS.slog("Cast " + KStoß.Name);

                        if (!StyxWoW.Me.GotTarget || !StyxWoW.Me.CurrentTarget.IsAlive || StyxWoW.Me.CurrentTarget != _unit)
                        {
                            TreeRoot.StatusText = "CritterKillSquad: face " + _unit.Name + " ...";
                            _unit.Target();
                            _unit.Face();
                            Thread.Sleep(BotCKS.ran.Next(200, 500));
                        }

                        KStoß.Cast();
                        Thread.Sleep(BotCKS.ran.Next(950, 1200));
                        StyxWoW.Me.ClearTarget();
                    }
//.........这里部分代码省略.........
开发者ID:nikolascoppi,项目名称:jwyles-scripts,代码行数:101,代码来源:CritterKillSquad_1.0.7.cs

示例7: Face

 private void Face(WoWUnit tar)
 {
     if (Manual)
     {
         tar.Face();
     }
 }
开发者ID:rhoninsk,项目名称:novas-addons,代码行数:7,代码来源:EzArms.cs

示例8: AvoidEnemyCast

        /// <summary>
        /// this behavior will move the bot StrafeRight/StrafeLeft only if enemy is casting and we needed to move!
        /// Credits to BarryDurex.
        /// </summary>
        /// <param name="EnemyAttackRadius">EnemyAttackRadius or 0 for move Behind</param>
        public static void AvoidEnemyCast(WoWUnit Unit, float EnemyAttackRadius, float SaveDistance)
        {
            if (!StyxWoW.Me.IsFacing(Unit)) { Unit.Face(); Thread.Sleep(300); }

            float BehemothRotation = getPositive(Unit.RotationDegrees);
            float invertEnemyRotation = getInvert(BehemothRotation);

            WoWMovement.MovementDirection move = WoWMovement.MovementDirection.None;

            if (getPositive(StyxWoW.Me.RotationDegrees) > invertEnemyRotation) { move = WoWMovement.MovementDirection.StrafeRight; } else { move = WoWMovement.MovementDirection.StrafeLeft; }

            while (Unit.Distance2D <= SaveDistance && Unit.IsCasting && ((EnemyAttackRadius == 0 && !StyxWoW.Me.IsSafelyBehind(Unit)) ||
                (EnemyAttackRadius != 0 && Unit.IsSafelyFacing(StyxWoW.Me, EnemyAttackRadius)) || Unit.Distance2D <= 2)) {
                WoWMovement.Move(move);
                Unit.Face();
            }
            WoWMovement.MoveStop();
        }
开发者ID:timglide,项目名称:hb-plugins,代码行数:23,代码来源:WaitForDebuff.cs


注:本文中的WoWUnit.Face方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。