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


C# WoWUnit.ShortGuid方法代码示例

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


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

示例1: On_Cast


//.........这里部分代码省略.........
                else if (StyxWoW.Me.GotAlivePet && Me.Pet.IsDead == false)
                {
                    FTWLogger.log("cast tank-only spell {0} on pet", spell.Name);
                    if (SpellManager.CanCast(spell, Me.Pet))
                    {
                        FTWLogger.log("nope - failed cancast check.");
                        retval = SpellManager.Cast(spell, Me.Pet);
                    }
                }
                else
                    retval = false;
            }
            else if (spell.IsAreaSpell() == false)
            {
                // Most normal spells
                if (spell.IsSelfOnlySpell)
                    retval = SpellManager.Cast(spell);
                else
                    retval = SpellManager.Cast(spell, target);

                // Post-spell processing
                if (spellname == "Feign Death")
                {
                    while (Me.HasAura("Feign Death"))
                    {
                        List<WoWUnit> mobs = (List<WoWUnit>)FTWCoreUnits.GetNearbyUnfriendlyUnits();
                        if (mobs.Count == 0 && StyxWoW.Me.HealthPercent > 95)
                            break;
                        Thread.Sleep(10);
                    }
                }
            }
            else
            {
                // Area spell
                WoWPoint loc;

                if (spell.IsSelfOnlySpell && !spell.Name.EndsWith(" Trap"))
                    loc = StyxWoW.Me.Location;
                else
                    loc = target.Location;
                retval = SpellManager.Cast(spell);
                DateTime stoptime = DateTime.Now.AddMilliseconds(500);
                while (DateTime.Now < stoptime)
                {
                    if (StyxWoW.Me.CurrentPendingCursorSpell != null)
                        break;
                    Thread.Sleep(10);
                }
                SpellManager.ClickRemoteLocation(loc);
                stoptime = DateTime.Now.AddMilliseconds(500);
                while (DateTime.Now < stoptime)
                {
                    // Clear target spell, if one is up
                    if (StyxWoW.Me.CurrentPendingCursorSpell == null)
                        break;
                    Thread.Sleep(10);
                }
                // Clear target spell, if one is up
                if (StyxWoW.Me.CurrentPendingCursorSpell != null)
                    Lua.DoString("SpellStopTargeting()");

            }

            // Add current spell to CastOnce dictionary
            if (castonce == true)
                FTWProps.CastOnce[spellname + target.Guid.ToString()] = DateTime.Now.AddSeconds(FTWProps.CastOnceTime);

            // Wait until spell starts casting
            if (spell.CastTime > 0)
            {
                DateTime dt = DateTime.Now.AddSeconds(1.5);
                while (DateTime.Now < dt && !StyxWoW.Me.IsCasting && !StyxWoW.Me.IsChanneling)
                    Thread.Sleep(10);
            }

            // Save spell cooldown
            if (retval == true)
            {
                FTWLogger.log("    {0} {1} on {2} {3} health {4:0} dist {5:0.0} aggro {6} {7} (addscount {8})", firstpart, spellname, target.SafeName(), target.ShortGuid(), target.HealthPercent, target.DistanceCalc(), (int)target.ThreatInfo.ThreatStatus, target.ThreatInfo.ThreatStatus, FTWProps.adds.Count);
                FTWCoreStatus.SaveCooldown(spellname);
                FTWProps.MovementCooldown = DateTime.Now.Add(TimeSpan.FromMilliseconds(Math.Min(1500, spell.CastTime)));
                FTWProps.not_in_los_attempts = 0;
            }
            else
            {
                FTWLogger.log(Color.Gray, "  - Couldn't cast spell {0} on {1} {2} at dist {3:0.0}", spellname, target.SafeName(), target.ShortGuid(), target.DistanceCalc());
            }

            if (FTWProps.Stuns.Contains(spellname))
            {
                // Don't attack again for 3 seconds - hb is slow in noticing cc's.
                Blacklist.Add(target.Guid, BlacklistFlags.Combat, TimeSpan.FromSeconds(3));
                if (target.Guid == StyxWoW.Me.CurrentTargetGuid)
                    StyxWoW.Me.ClearTarget();
            }

            MyTimer.Stop(fnname);
            return retval;
        }
开发者ID:psmyth1,项目名称:code-samples,代码行数:101,代码来源:FTWCoreActions.cs


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