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


C# WoWUnit类代码示例

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


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

示例1: LogCast

 public static void LogCast(string sname, WoWUnit unit, double health, double dist)
 {
     if (unit.IsMe)
         Logger.Write("Casting {0} on Me @ {1:F1}%", sname, health);
     else
         Logger.Write("Casting {0} on {1} @ {2:F1}% at {3:F1} yds", sname, unit.SafeName(), health, dist);
 }
开发者ID:superkhung,项目名称:SingularMod3,代码行数:7,代码来源:Spell.cs

示例2: WillChainHealHop

        /// <summary>
        /// WillChainHealHop()
        /// Tests whether casting Chain Lightning on 'healTarget' results in a minimum 
        /// of 2 hops (3 people healed.) 
        /// </summary>
        /// <param name="healTarget"></param>
        /// <returns></returns>
        public static bool WillChainHealHop(WoWUnit healTarget)
        {
            double threshhold = SingularSettings.Instance.Shaman.RAF_ChainHeal_Health;

            if (healTarget == null)
                return false;

            var t = (from o in ObjectManager.ObjectList
                     where o is WoWPlayer && healTarget.Location.Distance(o.Location) < 12
                     let p = o.ToPlayer()
                     where p != null
                           && p.IsHorde == StyxWoW.Me.IsHorde
                           && !p.IsPet
                           && p != healTarget
                           && p.IsAlive
                           && p.HealthPercent < threshhold
                     let c = (from oo in ObjectManager.ObjectList
                              where oo is WoWPlayer && p.Location.Distance(oo.Location) < 12
                              let pp = oo.ToPlayer()
                              where pp != null
                                    && pp.IsHorde == p.IsHorde
                                    && !pp.IsPet
                                    && pp.IsAlive
                                    && pp.HealthPercent < threshhold
                              select pp).Count()
                     orderby c descending, p.Distance ascending
                     select new { Player = p, Count = c }).FirstOrDefault();

            if (t == null || t.Count < 3)
                return false;
            return true;
        }
开发者ID:naacra,项目名称:wowhbbotcracked,代码行数:39,代码来源:Shaman.cs

示例3: CastIfHasBuff

 public bool CastIfHasBuff(WoWGlobal wowinfo, WoWUnit unit) {
     if (unit.HasBuff(this.ID)) {
         this.SendCast();
         return true;
     }
     return false;
 }
开发者ID:Marteen21,项目名称:Radar,代码行数:7,代码来源:Spell.cs

示例4: ActualMaxRange

 /// <summary>
 ///  Returns maximum spell range based on hitbox of unit. 
 /// </summary>
 /// <param name="spell"></param>
 /// <param name="unit"></param>
 /// <returns>Maximum spell range</returns>
 public static float ActualMaxRange(this WoWSpell spell, WoWUnit unit)
 {
     if (spell.MaxRange == 0)
         return 0;
     // 0.3 margin for error
     return unit != null ? spell.MaxRange + unit.CombatReach + 1f : spell.MaxRange;
 }
开发者ID:Asphodan,项目名称:Alphabuddy,代码行数:13,代码来源:Spell.cs

示例5: formatslog

 private void formatslog(string type, string reason, string spell, WoWUnit target)
 {
     System.Drawing.Color textcolor;
     switch (type)
     {
         case "Heal":
             textcolor = Color.Green;
             break;
         case "Cleanse":
             textcolor = Color.Magenta;
             break;
         case "Buff":
             textcolor = Color.Brown;
             break;
         case "OhShit":
             textcolor = Color.Red;
             break;
         case "Mana":
             textcolor = Color.Blue;
             break;
         case "DPS":
             textcolor = Color.Violet;
             break;
         case "Utility":
             textcolor = Color.Orange;
             break;
         default:
             textcolor = Color.Black;
             break;
     }
     slog(textcolor, reason + ": casting {0} on {1} at distance {2} with type {3} at hp {4}", spell, privacyname(target), Round(target.Distance), type, Round(target.HealthPercent));
 }
开发者ID:Borgsen,项目名称:celisuis-honorbuddy-pack,代码行数:32,代码来源:Helpers.cs

示例6: ValidUnit

        static bool ValidUnit(WoWUnit p)
        {
            if (IgnoreMobs.Contains(p.Entry))
                return false;

            // Ignore shit we can't select/attack
            if (!p.CanSelect || !p.Attackable)
                return false;

            // Ignore friendlies!
            if (p.IsFriendly)
                return false;

            // Duh
            if (p.Dead)
                return false;

            // Dummies/bosses are valid by default. Period.
            if (p.IsTrainingDummy() || p.IsBoss())
                return true;

            // If its a pet, lets ignore it please.
            if (p.IsPet || p.OwnedByRoot != null)
                return false;

            // And ignore critters/non-combat pets
            if (p.IsNonCombatPet || p.IsCritter)
                return false;

            return true;
        }
开发者ID:killingzor,项目名称:pqrotation-profiles,代码行数:31,代码来源:Unit.cs

示例7: CanCastFortitudeOn

 private static bool CanCastFortitudeOn(WoWUnit unit)
 {
     //return !unit.HasAura("Blood Pact") &&
     return !unit.HasAura("Power Word: Fortitude") &&
            !unit.HasAura("Qiraji Fortitude") &&
            !unit.HasAura("Commanding Shout");
 }
开发者ID:Asphodan,项目名称:Alphabuddy,代码行数:7,代码来源:Common.cs

示例8: DoMovement

        private static void DoMovement(WoWUnit Target)
        {
            // Thought i might try add this, just to see if this might catch wow's error
            // prob a longggggggggg shot, but worth the try.
            // -> my thoughts, if theres something to catch, maybe it wont crash wow it self?, but im guessing hb will still cause crash
            try
            {
                // If we are > 2, we need to get closer to them at all costs.
                if (Target.Distance > 2)
                {
                    ClickToMove.MoveTo(Target.Location);
                    return;
                }

                //// If player not moving and we not behind, lets get behind
                //if ((Target.MovementInfo.CurrentSpeed == 0) && (!Target.MeIsSafelyBehind))
                //{
                //    WoWPoint BehindLocation = WoWMathHelper.CalculatePointBehind(Target.Location, Target.Rotation, 1.5f);
                //    ClickToMove.MoveTo(BehindLocation);
                //}

                //// If where behind them and not facing them, Face them
                //if ((Target.MeIsSafelyBehind) && (!Me.IsSafelyFacing(Target)))
                //{
                //    Target.Face();
                //}

            } catch (Exception) { }
        }
开发者ID:rhoninsk,项目名称:novas-addons,代码行数:29,代码来源:Movement.cs

示例9: CastOnTarget

 public override Task<bool> CastOnTarget(WoWUnit target)
 {
     base.Conditions.Clear();
     InitializeBase();
     base.Conditions.Add(_energy);
     base.Conditions.Add(new TargetNotAuraUpCondition(target, Spell));
     return base.CastOnTarget(target);
 }
开发者ID:Joshuahelmle,项目名称:BotA,代码行数:8,代码来源:RevealingStrikeAbility.cs

示例10: CastOnTarget

 public override Task<bool> CastOnTarget(WoWUnit target)
 {
     base.Conditions.Clear();
     InitializeBase();
     Conditions.Add(Energy);
     Conditions.Add(new BooleanCondition(target != null && target.IsWithinMeleeRange));
     return base.CastOnTarget(target);
 }
开发者ID:Joshuahelmle,项目名称:BotA,代码行数:8,代码来源:GougeAbility.cs

示例11: GetCombatTimeLeft

 /// <summary>
 /// Returns the estimated combat time left for this unit. (Time until death)
 /// If the unit is invalid; TimeSpan.MinValue is returned.
 /// </summary>
 /// <param name="u"></param>
 /// <returns></returns>
 public static TimeSpan GetCombatTimeLeft(WoWUnit u)
 {
     if (DpsInfos.ContainsKey(u.Guid))
     {
         return DpsInfos[u.Guid].CombatTimeLeft;
     }
     return TimeSpan.MinValue;
 }
开发者ID:Asphodan,项目名称:Alphabuddy,代码行数:14,代码来源:DpsMeter.cs

示例12: CastOnTarget

 public override Task<bool> CastOnTarget(WoWUnit target)
 {
     Conditions.Clear();
     InitializeBase();
     Conditions.Add(new InMeeleRangeCondition());
     Conditions.Add(new BooleanCondition(Me.ComboPoints <= 2));
     Conditions.Add(new BooleanCondition(SettingsManager.Instance.UseMFD));
     return base.CastOnTarget(target);
 }
开发者ID:Joshuahelmle,项目名称:BotA,代码行数:9,代码来源:MarkedForDeathAbility.cs

示例13: GetDps

 /// <summary>
 /// Returns the current DPS on a specific unit, or -1 if the unit is not currently being tracked, or doesn't exist.
 /// </summary>
 /// <param name="u"></param>
 /// <returns></returns>
 public static double GetDps(WoWUnit u)
 {
     if (DpsInfos.ContainsKey(u.Guid))
     {
         return DpsInfos[u.Guid].CurrentDps;
     }
     // -1 is a fail case.
     return -1;
 }
开发者ID:Asphodan,项目名称:Alphabuddy,代码行数:14,代码来源:DpsMeter.cs

示例14: FindUnit

 public static UnitOracle FindUnit(WoWUnit unit)
 {
     try {
         // CLU.DebugLog(Color.GreenYellow, "[CLU-ORACLE] " + CLU.Version + ": FindUnit [" + unit + "] = [" + unit.Guid + "]");
         return instances[unit.Guid];
     } catch {
         return null;
     }
 }
开发者ID:Asphodan,项目名称:Alphabuddy,代码行数:9,代码来源:UnitOracle.cs

示例15: ReCast

 public override bool ReCast(WoWGlobal wowinfo, WoWUnit unit) {
     if (!unit.HasBuff(this.ID) && !wowinfo.SpellIsPending && wowinfo.HasRunesFor(cost)) {
         this.SendCast();
         return true;
     }
     else {
         return false;
     }
 }
开发者ID:Marteen21,项目名称:Radar,代码行数:9,代码来源:DKRuneSpell.cs


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