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


C# Creature.isAlive方法代码示例

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


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

示例1: DoRotation

        private void DoRotation(Creature targeCreature)
        {
            while (GetGroupStatus("GhostRider"))
            {
                try
                {
                    if (!me.isAlive()) return; // if i am dead just return, its pointless to do anything else.

                    if (getAggroMobs(getMount()).Count > 0)
                        targeCreature = getAggroMobs(getMount()).First();
                            //TODO: if our mount is under attack defend it.  Unsummon it ? toggle?

                    if (!targeCreature.isAlive() || !isAttackable(targeCreature))
                    {
                        if (getAggroMobs(me).Count == 0 && getAggroMobs(getMount()).Count == 0)
                            //my target is dead and no one is attacking me or mount => return
                            return;
                        if (getAggroMobs(getMount()).Count > 0) //otherwise get my mount attacker or my attacker
                            targeCreature = getAggroMobs(getMount()).First();
                        if (getAggroMobs(me).Count > 0)
                            targeCreature = getAggroMobs(me).First();
                    }


                    int a = 0;
                    while (!SetTarget(targeCreature) && GetGroupStatus("GhostRider"))
                    {
                        Thread.Sleep(50);
                        a++;
                        if (a < 20) continue;
                        PlaySound("enemy.wav");
                        SetGroupStatus("GhostRider", false);
                            //after 20 loops sound an alarm, exit the loop && stop the plugin
                    }

                    // one of these might throw an ex but the result is the same - retrun  

                    // Be careful with spelling
                    // SKILLS NEED TO BE ORDERED BY IMPORTANCE
                    // IE: 1st : Heal cond: me.hp <33f
                    // use: UseSkillIf if you need a  

                    //HEAL
                    if (UseSkillIf("Enervate", (me.hpp < 50)))
                    {
                        Log("Enervate " + me.hpp, "GhRider");
                        MySleep(100, 300);
                        if (UseSkillIf("Earthen Grip", (me.hpp < 50)))
                        {
                            Log("Earthen " + me.hpp, "GhRider");
                        }
                        continue;
                    }
                    UseRegenItems();
                    UseSkillIf("Absorb Lifeforce", (me.hpp < 66));

                    //CLEAN DEBUF


                    //FIGHT
                    //if (angle(me.target, me) > 45 && angle(me.target, me) < 315)


                    if (getAggroMobs(me).Count > 1 && TargetsWithin(8) > 1 && me.hpp < 75) //AOE First id i am not 100%
                    {
                        if (UseSkillIf("Summon Crows",
                            UseSkillIf("Hell Spear", skillCooldown("Summon Crows") == 0L)))
                            continue;
                        if (UseSkillIf("Searing Rain",
                            UseSkillIf("Freezing Earth", skillCooldown("Searing Rain") == 0L)))
                            continue;
                    }

                    if (UseSkillIf("Hell Spear",
                        (((targeCreature.hpp >= 33) && (me.hpp < 66)) || (getAggroMobs(me).Count > 1)) &&
                        (me.dist(me.target) <= 8) //only if in range
                        ))
                    {
                        UseSkillIf("Summon Crows", (getAggroMobs(me).Count > 1) || (me.hpp < 50));
                        UseSkillIf("Arc Lightning", (getAggroMobs(me).Count == 1));
                    }

                    UseSkillIf("Mana Force", me.hpp < 75 && me.dist(me.target) <= 5);
                    UseSkillIf("Freezing Arrow",targeCreature.hpp >= 33);
                    UseSkillIf("Insidious Whisper", me.dist(me.target) <= 8);

                    UseSkillIf("Freezing Earth",
                        (((targeCreature.hpp >= 33) && (me.hpp < 66)) || (getAggroMobs(me).Count > 1)) &&
                        (me.dist(me.target) <= 8)); //only if in range

                    //Do FA-Fb-Fb-Fb OR Fb-Fb-Fb if FA is inCoolDown Try to combo with ^ skill
                    UseSkillIf("Flamebolt",
                        UseSkillIf("Flamebolt",
                            UseSkillIf("Flamebolt",
                                (skillCooldown("Freezing Arrow") > 0L 
                                 || targeCreature.hpp < 33 
                                 || UseSkillIf("Freezing Arrow", targeCreature.hpp >= 33)))));

                    //BUFF     //While fighting??  
                    UseSkillIf("Insulating Lens", (buffTime("Insulating Lens (Rank 3)") == 0 && me.hpp < 66));
//.........这里部分代码省略.........
开发者ID:Tensorr,项目名称:Ghost-Rider,代码行数:101,代码来源:GhostRider.cs


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