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


C# Hero.AghanimState方法代码示例

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


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

示例1: CalculateDamage


//.........这里部分代码省略.........
                        damageDictionary[ability] = bonusDamage;
                    }
                    outgoingDamage = target.DamageTaken(
                        bonusDamage,
                        DamageType.Magical,
                        source,
                        data.MagicImmunityPierce);
                    if (source.Distance2D(target) < radiusMax)
                    {
                        outgoingDamage *= 2;
                    }
                    break;
                case "nyx_assassin_mana_burn":
                    var intMultiplier = ability.GetAbilityData("float_multiplier");
                    var hero = target as Hero;
                    outgoingDamage = target.ManaBurnDamageTaken(
                        hero.TotalIntelligence * intMultiplier,
                        1,
                        DamageType.Magical,
                        source);
                    break;
                case "riki_blink_strike":
                    var damage = ability.GetAbilityData(data.DamageString);
                    var backstab = source.Spellbook.SpellE;
                    var agiMultiplier = backstab.GetAbilityData("damage_multiplier");
                    var blinkdamage = target.DamageTaken(damage, DamageType.Magical, source, data.MagicImmunityPierce);
                    outgoingDamage = blinkdamage
                                     + target.DamageTaken(
                                         agiMultiplier * source.TotalAgility
                                         + (source.MinimumDamage + source.BonusDamage),
                                         DamageType.Physical,
                                         source,
                                         data.MagicImmunityPierce);
                    break;
                case "undying_soul_rip":
                    var radius = ability.GetAbilityData("radius");
                    var nearUnits =
                        ObjectMgr.GetEntities<Unit>()
                            .Where(
                                x =>
                                (x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane
                                 || x.ClassID == ClassID.CDOTA_BaseNPC_Creep
                                 || x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral
                                 || x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege
                                 || x.ClassID == ClassID.CDOTA_BaseNPC_Creature
                                 || x.ClassID == ClassID.CDOTA_BaseNPC_Invoker_Forged_Spirit
                                 || x.ClassID == ClassID.CDOTA_Unit_Undying_Zombie
                                 || x.ClassID == ClassID.CDOTA_BaseNPC_Warlock_Golem
                                 || (x is Hero
                                     && (x.Team == source.Team
                                         || (x.Team == source.GetEnemyTeam() && !x.IsMagicImmune())))) && x.IsAlive
                                && x.IsVisible && x.Distance2D(source) < (radius + x.HullRadius));
                    var damagePerUnit = ability.GetAbilityData("damage_per_unit");
                    var maxUnits = ability.GetAbilityData("max_units");
                    outgoingDamage = Math.Min(nearUnits.Count(), maxUnits) * damagePerUnit;
                    outgoingDamage = target.DamageTaken(
                        outgoingDamage,
                        DamageType.Magical,
                        source,
                        data.MagicImmunityPierce);
                    break;
                default:
                    var damageString = data.DamageString;
                    if (damageString == null)
                    {
                        outgoingDamage =
                            Convert.ToSingle(
                                Game.FindKeyValues(name + "/AbilityDamage", KeyValueSource.Ability)
                                    .StringValue.Split(' ')[level - 1]);
                    }
                    else
                    {
                        if (data.SpellLevel != null)
                        {
                            var spellLevel = source.FindSpell(data.SpellLevel);
                            level = spellLevel.Level;
                        }
                        if (source.AghanimState() && data.DamageScepterString != null)
                        {
                            outgoingDamage = ability.GetAbilityData(data.DamageScepterString, level);
                        }
                        else
                        {
                            outgoingDamage = ability.GetAbilityData(damageString, level);
                        }

                        if (data.DamageMultiplier > 0)
                        {
                            outgoingDamage = outgoingDamage * data.DamageMultiplier;
                        }
                        outgoingDamage = target.DamageTaken(
                            outgoingDamage,
                            GetDamageType(ability),
                            source,
                            data.MagicImmunityPierce);
                    }
                    break;
            }
            return outgoingDamage;
        }
开发者ID:MarkHC,项目名称:Ensage.Common,代码行数:101,代码来源:AbilityDamage.cs

示例2: Kill

        private static void Kill(Hero me, Ability ability, IReadOnlyList<double> damage, uint spellTargetType, uint? range = null, bool lsblock = true, bool piercesSpellImmunity = false, bool smartKill = false, bool complexKill = false, IReadOnlyList<double> adamage = null)
        {
            if (ability.Level > 0)
            {
                double normalDamage;
                if (adamage == null)
                    normalDamage = damage[(int) ability.Level];
                else
                    normalDamage = me.AghanimState() ? damage[(int) ability.Level] : adamage[(int) ability.Level];

                var spellDamageType = ability.DamageType;
                var spellRange = range ?? (ability.CastRange + 50);
                var spellCastPoint = (float)(ability.GetCastPoint() + Game.AvgPing / 1000);

                var enemies = ObjectMgr.GetEntities<Hero>().Where(enemy => enemy.Team == me.GetEnemyTeam() && !enemy.IsIllusion() && enemy.IsVisible && enemy.IsAlive && enemy.Health > 0).ToList();
                foreach (var enemy in enemies)
                {
                    double spellDamage;
                    if (complexKill)
                        spellDamage = GetComplexDamage(ability.Level, enemy, me, normalDamage);
                    else if (smartKill)
                        spellDamage = GetSmartDamage(ability.Level, me, damage);
                    else
                        spellDamage = normalDamage;

                    var damageDone = enemy.DamageTaken((float)spellDamage, spellDamageType, me, piercesSpellImmunity);

                    if (me.ClassID == ClassID.CDOTA_Unit_Hero_Axe)
                        damageDone = (float) spellDamage;

                    float damageNeeded;

                    if (!HeroDamageDictionary.TryGetValue(enemy, out damageNeeded))
                    {
                        damageNeeded = enemy.Health - damageDone + spellCastPoint * enemy.HealthRegeneration + MorphMustDie(enemy, spellCastPoint);
                        HeroDamageDictionary.Add(enemy, damageNeeded);
                        HeroSpellDictionary.Add(enemy, ability);
                    }
                    else
                    {
                        HeroDamageDictionary.Remove(enemy);
                        HeroSpellDictionary.Remove(enemy);
                        damageNeeded = enemy.Health - damageDone + spellCastPoint * enemy.HealthRegeneration + MorphMustDie(enemy, spellCastPoint);
                        HeroDamageDictionary.Add(enemy, damageNeeded);
                        HeroSpellDictionary.Add(enemy, ability);
                    }

                    if (_killstealEnabled && !me.IsChanneling())
                    {
                        if (damageNeeded < 0 && me.Distance2D(enemy) < spellRange && MeCanSurvive(enemy, me, ability, damageDone))
                        {
                            switch (spellTargetType)
                            {
                                case 1:
                                    CastSpell(ability, enemy, me, lsblock);
                                    break;
                                case 2:
                                    CastSpell(ability, enemy.Position, me, lsblock);
                                    break;
                                case 3:
                                    if (ability.CanBeCasted() && me.CanCast())
                                        ability.UseAbility();
                                    break;
                            }
                            break;
                        }
                    }
                }
            }
        }
开发者ID:YukinoAguria,项目名称:ensagesharp,代码行数:70,代码来源:Program.cs

示例3: CalculateMaximumDamageOutput

        public static int CalculateMaximumDamageOutput(Hero me, Hero enemy)
        {
            try
            {
                var hook = me.Spellbook.Spell1;
                var rot = me.Spellbook.SpellW;
                var dismember = me.Spellbook.SpellR;
                var urn = me.FindItem("item_urn_of_shadows");
                var dagon = me.GetDagon();
                var eblade = me.FindItem("item_ethereal_blade");
                var Damage = 0;
                var theoreticalMana = me.Mana;
                var resis = 1 - enemy.MagicDamageResist;

                if (hook != null)
                    if (hook.Level > 0 && theoreticalMana - hook.ManaCost >= 0 && hook.AbilityState == AbilityState.Ready)
                    {
                        if (me.AghanimState())
                            Damage += (int)hook.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter").GetValue(hook.Level - 1);
                        else
                        Damage += (int)hook.AbilityData.FirstOrDefault(x => x.Name == "#AbilityDamage").GetValue(hook.Level - 1);
                        theoreticalMana -= hook.ManaCost;
                    }
                if (eblade != null)
                {
                    int dmg = (int)(((me.TotalStrength  + 75) * 2) * resis);
                    if (Variables.AetherLens)
                        dmg = (int)(dmg * 1.08);
                    theoreticalMana -= eblade.ManaCost;
                    Damage += dmg;
                   // Print.Info(dmg.ToString());
                }
                if (dismember != null && rot != null)
                {

                    if (dismember.Level > 0 && theoreticalMana - dismember.ManaCost >= 0 && dismember.AbilityState == AbilityState.Ready)
                    {
                        if (rot.Level > 0)
                        {
                            var rotDPS = (int)rot.AbilityData.FirstOrDefault(x => x.Name == "#AbilityDamage").GetValue(rot.Level - 1);
                            var totalDmgAfterResis = (rotDPS * 3) * resis;
                            if (Variables.AetherLens)
                                totalDmgAfterResis = (float)(totalDmgAfterResis * 1.08);
                            Damage += (int)totalDmgAfterResis;

                        }
                        var ultiDamage = dismember.AbilityData.FirstOrDefault(x => x.Name == "dismember_damage").GetValue(dismember.Level - 1);
                        if (me.AghanimState())
                        {
                            //ultiDamage += (float)(me.TotalStrength * (0.2 + (dismember.Level * 0.10)));

                            var scepterDamage = ultiDamage + (me.TotalStrength * (0.2 + (dismember.Level * 0.10)));//ultiDamage + (me.TotalStrength * dismember.AbilityData.FirstOrDefault(x => x.Name == "strength_damage_scepter").GetValue(dismember.Level - 1));
                            var totalDamageAfterResis = scepterDamage * resis;
                            if (Variables.AetherLens)
                                totalDamageAfterResis = (float)(totalDamageAfterResis * 1.08);
                            ultiDamage = (float)totalDamageAfterResis * 3;
                        }
                        else
                        {
                            var damagePerTickAfterResis = ultiDamage * resis;
                            if (Variables.AetherLens)
                                damagePerTickAfterResis = (float)(damagePerTickAfterResis * 1.08);
                            ultiDamage = damagePerTickAfterResis * 3;
                        }
                        Damage += (int)ultiDamage;
                        theoreticalMana -= dismember.ManaCost;
                    }
                    if (urn != null)
                        if (urn.CurrentCharges > 0)
                            Damage += 100;
                    if (dagon != null)
                        if (dagon != null && theoreticalMana - dagon.ManaCost >= 0 && dagon.AbilityState == AbilityState.Ready)
                        {
                            var dagonDamageAfterResis = (int)dagon.AbilityData.FirstOrDefault(x => x.Name == "damage").GetValue(dagon.Level - 1) * resis;
                            if (Variables.AetherLens)
                                dagonDamageAfterResis = (float)(dagonDamageAfterResis * 1.08);
                            Damage += (int)dagonDamageAfterResis;

                            theoreticalMana -= dagon.ManaCost;
                        }
                }
                if (eblade != null)
                    return (int)(Damage * 1.4);
                else
                    return Damage;

            }
            catch (Exception ex)
            {
                Print.Error("DAMAGE: " + ex.Message);
                return 0;
            }
        }
开发者ID:NadeHouse,项目名称:Pudge-Plus,代码行数:93,代码来源:HookHandler.cs

示例4: CalculateDamage

        /// <summary>
        ///     Calculates damage from given ability on given target
        /// </summary>
        /// <param name="ability"></param>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="minusArmor"></param>
        /// <param name="minusDamageResistancePerc"></param>
        /// <param name="minusMagicResistancePerc"></param>
        /// <param name="minusHealth"></param>
        /// <returns></returns>
        public static float CalculateDamage(
            Ability ability, 
            Hero source, 
            Unit target, 
            double minusArmor = 0d, 
            double minusDamageResistancePerc = 0d, 
            double minusMagicResistancePerc = 0d, 
            float minusHealth = 0f)
        {
            var name = ability.StoredName();
            var level = ability.Level;
            if (ability.AbilityType.HasFlag(AbilityType.Ultimate) && level > 0 && source.AghanimState())
            {
                level += 1;
            }

            AbilityInfo data;
            if (!DataDictionary.TryGetValue(ability, out data))
            {
                data = AbilityDatabase.Find(name);
                if (data != null && data.IsNuke)
                {
                    DataDictionary.Add(ability, data);
                }
            }

            // var data = AbilityDatabase.Find(name);
            if (data == null || !data.IsNuke)
            {
                return 0;
            }

            var outgoingDamage = 0f;
            float bonusDamage = 0;
            Hero hero;
            double multi;
            float tempDmg;
            switch (name)
            {
                case "ember_spirit_sleight_of_fist":
                    outgoingDamage = source.MinimumDamage + source.BonusDamage;
                    if (!DamageDictionary.TryGetValue(ability, out bonusDamage))
                    {
                        bonusDamage = ability.GetAbilityData(data.BonusDamageString);
                        outgoingDamage += bonusDamage;
                        DamageDictionary.Add(ability, bonusDamage);
                        LevelDictionary.Add(ability, level);
                    }
                    else if (LevelDictionary[ability] != level)
                    {
                        LevelDictionary[ability] = level;
                        bonusDamage = ability.GetAbilityData(data.BonusDamageString);
                        DamageDictionary[ability] = bonusDamage;
                        outgoingDamage += bonusDamage;
                    }
                    else
                    {
                        outgoingDamage += bonusDamage;
                    }

                    outgoingDamage = target.DamageTaken(
                        outgoingDamage, 
                        DamageType.Physical, 
                        source, 
                        true, 
                        minusMagicResistancePerc: minusMagicResistancePerc);
                    break;
                case "doom_bringer_lvl_death":
                    if (!DamageDictionary.TryGetValue(ability, out tempDmg))
                    {
                        tempDmg = ability.GetAbilityData(data.DamageString);
                        DamageDictionary.Add(ability, tempDmg);
                        LevelDictionary.Add(ability, level);
                    }
                    else if (LevelDictionary[ability] != level)
                    {
                        LevelDictionary[ability] = level;
                        tempDmg = ability.GetAbilityData(data.DamageString);
                        DamageDictionary[ability] = tempDmg;
                    }

                    var multiplier = ability.GetAbilityData("lvl_bonus_multiple");
                    bonusDamage = ability.GetAbilityData("lvl_bonus_damage");
                    var levelc = target.Level / multiplier;
                    if (levelc == Math.Floor(levelc) || target.Level == 25)
                    {
                        tempDmg += target.MaximumHealth * (bonusDamage / 100);
                    }

//.........这里部分代码省略.........
开发者ID:nbIxMaN,项目名称:Ensage.Common,代码行数:101,代码来源:AbilityDamage.cs

示例5: RunScript


//.........这里部分代码省略.........
                                    units[i].Spellbook.SpellR.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.SpellR.UseAbility();
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                            }
                            else if (units[i].ClassID == ClassID.CDOTA_Unit_Brewmaster_PrimalStorm)
                            {
                                if (e.Position.Distance2D(units[i].Position) < 700 &&
                                    units[i].Spellbook.SpellQ.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.SpellQ.UseAbility(e.Position);
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                                if (e.Position.Distance2D(units[i].Position) < 900 &&
                                    units[i].Spellbook.SpellE.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.SpellE.UseAbility();
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                                if (e.Position.Distance2D(units[i].Position) < 850 &&
                                    units[i].Spellbook.SpellR.CanBeCasted() &&
                                    Utils.SleepCheck(units[i].Handle.ToString()))
                                {
                                    units[i].Spellbook.SpellR.UseAbility(e);
                                    Utils.Sleep(400, units[i].Handle.ToString());
                                }
                            }
                            else if (units[i].ClassID == ClassID.CDOTA_Unit_SpiritBear)
                            {
                                if ((!me.AghanimState() && me.Position.Distance2D(units[i]) <= 1200) || me.AghanimState())
                                {
                                    abyssal = units[i].FindItem("item_abyssal_blade");

                                    mjollnir = units[i].FindItem("item_mjollnir");

                                    boots = units[i].FindItem("item_phase_boots");

                                    midas = units[i].FindItem("item_hand_of_midas");

                                    mom = units[i].FindItem("item_mask_of_madness");

                                    medall = units[i].FindItem("item_medallion_of_courage") ?? units[i].FindItem("item_solar_crest");

                                    if (boots != null && e.Position.Distance2D(units[i].Position) < 1550 && boots.CanBeCasted() &&
                                        Utils.SleepCheck(units[i].Handle.ToString()))
                                    {
                                        boots.UseAbility();
                                        Utils.Sleep(350, units[i].Handle.ToString());
                                    }
                                    if (mjollnir != null && e.Position.Distance2D(units[i].Position) < 525 && mjollnir.CanBeCasted() &&
                                        Utils.SleepCheck(units[i].Handle.ToString()))
                                    {
                                        mjollnir.UseAbility(units[i]);
                                        Utils.Sleep(350, units[i].Handle.ToString());
                                    }
                                    if (medall != null && e.Position.Distance2D(units[i].Position) < 525 && medall.CanBeCasted() &&
                                       Utils.SleepCheck(units[i].Handle.ToString()))
                                    {
                                        medall.UseAbility(e);
                                        Utils.Sleep(350, units[i].Handle.ToString());
                                    }
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:66,代码来源:CreepControl.cs

示例6: Game_OnUpdate

        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectManager.LocalHero;

            if (!Game.IsInGame || Game.IsWatchingGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Pugna) return;
            if (!Menu.Item("enabled").IsActive())
                return;
            e = me.ClosestToMouseTarget(2000);
            if (e == null) return;

            //spell
            Q = me.Spellbook.SpellQ;

            W = me.Spellbook.SpellW;

            E = me.Spellbook.SpellE;

            R = me.Spellbook.SpellR;

            // Item
            ethereal = me.FindItem("item_ethereal_blade");

            sheep = e.ClassID == ClassID.CDOTA_Unit_Hero_Tidehunter ? null : me.FindItem("item_sheepstick");

            vail = me.FindItem("item_veil_of_discord");

            cheese = me.FindItem("item_cheese");

            ghost = me.FindItem("item_ghost");

            orchid = me.FindItem("item_orchid");

            atos = me.FindItem("item_rod_of_atos");

            soulring = me.FindItem("item_soul_ring");

            arcane = me.FindItem("item_arcane_boots");

            blink = me.FindItem("item_blink");

            shiva = me.FindItem("item_shivas_guard");

            dagon = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon"));
            //var ModifRod = e.Modifiers.Any(y => y.Name == "modifier_rod_of_atos_debuff");
            var stoneModif = e.Modifiers.Any(y => y.Name == "modifier_medusa_stone_gaze_stone");
            Active = Game.IsKeyDown(Menu.Item("keyBind").GetValue<KeyBind>().Key);

            if (Active && me.IsAlive && e.IsAlive && Utils.SleepCheck("Active"))
            {
                var noBlade = e.Modifiers.Any(y => y.Name == "modifier_item_blade_mail_reflect");

                if (stoneModif) return;
                if (R.IsInAbilityPhase || me.Modifiers.Any(y => y.Name == "modifier_pugna_life_drain")) return;
                if (e.IsVisible && me.Distance2D(e) <= 2300 && !noBlade)
                {
                    if ((!me.IsChanneling() && !me.AghanimState()) || (me.AghanimState() && Menu.Item("agh").IsActive()))
                    {
                        if ( // atos Blade
                            atos != null
                            && atos.CanBeCasted()
                            && me.CanCast()
                            && !e.IsLinkensProtected()
                            && !e.IsMagicImmune()
                            && Utils.SleepCheck("atos")
                            && me.Distance2D(e) <= 2000
                            )
                        {
                            atos.UseAbility(e);
                            Utils.Sleep(250, "atos");
                        } // atos Item end
                        float angle = me.FindAngleBetween(e.Position, true);
                        Vector3 pos = new Vector3((float)(e.Position.X - 350 * Math.Cos(angle)), (float)(e.Position.Y - 350 * Math.Sin(angle)), 0);
                        if (
                            blink != null
                            && Q.CanBeCasted()
                            && me.CanCast()
                            && blink.CanBeCasted()
                            && me.Distance2D(e) >= 590
                            && me.Distance2D(pos) <= 1190
                            && Utils.SleepCheck("blink")
                            )
                        {
                            blink.UseAbility(pos);
                            Utils.Sleep(250, "blink");
                        }
                        if (
                            W != null
                            && W.CanBeCasted()
                            && (Q.CanBeCasted()
                            || R.CanBeCasted())
                            && me.CanCast()
                            && Menu.Item("Skills").GetValue<AbilityToggler>().IsEnabled(W.Name)
                            && me.Distance2D(e) < 1400
                            && Utils.SleepCheck("W")
                            )
                        {
                            W.UseAbility(e);
                            Utils.Sleep(200, "W");
                        }

//.........这里部分代码省略.........
开发者ID:VickTheRock,项目名称:ReworkAllScripts,代码行数:101,代码来源:Program.cs

示例7: Game_OnUpdate

        private static void Game_OnUpdate(EventArgs args)
        {
            if (!loaded)
            {
                me = ObjectMgr.LocalHero;
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Techies)
                {
                    return;
                }
                loaded = true;
                remoteMines = me.Spellbook.SpellR;
                suicideAttack = me.Spellbook.SpellE;
                landMines = me.Spellbook.SpellQ;
                forceStaff = null;
                //enemyHeroes = null;
                players = null;
                remoteMinesDb = new Dictionary<Unit, float>();
                heroTopPanel = new Dictionary<ClassID, double[]>();
                landMinesHeroDmg = new Dictionary<ClassID, double>();
                suicideHeroDmg = new Dictionary<ClassID, float>();
                enabledHeroes = new Dictionary<ClassID, bool>();
                var screenSize = new Vector2(Drawing.Width, Drawing.Height);
                monitor = screenSize.X / 1280;
                if (me.AghanimState())
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(remoteMines.Level - 1);
                    }
                }
                else
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage");
                    if (firstOrDefault != null)
                    {
                        remoteMinesDmg = firstOrDefault.GetValue(remoteMines.Level - 1);
                    }
                }
                foreach (var bomb in
                    ObjectMgr.GetEntities<Unit>()
                        .Where(
                            x =>
                            x.ClassID == ClassID.CDOTA_NPC_TechiesMines && x.Spellbook.Spell1 != null
                            && x.Spellbook.Spell1.IsValid && x.Spellbook.Spell1.CanBeCasted() && x.IsAlive)
                        .Where(bomb => !remoteMinesDb.ContainsKey(bomb)))
                {
                    remoteMinesDb.Add(bomb, remoteMinesDmg);
                }
                //enemyHeroes =
                //    ObjectMgr.GetEntities<Hero>()
                //        .Where(x => x != null && x.IsValid && x.Team == me.GetEnemyTeam() && !x.IsIllusion);
                players =
                    ObjectMgr.GetEntities<Player>()
                        .Where(x => x != null && x.Hero != null && x.Hero.Team == me.GetEnemyTeam());
                Game.PrintMessage(
                    "<font face='Tahoma'><font color='#993311'>#TECHIES</font> by MOON<font color='#ff9900'>ES</font> loaded!</font> ",
                    MessageType.LogMessage);
            }
            if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Techies)
            {
                loaded = false;
                return;
            }

            if (Game.IsPaused)
            {
                return;
            }

            if (forceStaff == null && Menu.Item("useForceStaff").GetValue<bool>())
            {
                forceStaff = me.Inventory.Items.FirstOrDefault(x => x.ClassID == ClassID.CDOTA_Item_ForceStaff);
            }

            var suicideLevel = suicideAttack.Level;

            if (suicideAttackLevel != suicideLevel)
            {
                var firstOrDefault = suicideAttack.AbilityData.FirstOrDefault(x => x.Name == "damage");
                if (firstOrDefault != null)
                {
                    suicideAttackDmg = firstOrDefault.GetValue(suicideLevel - 1);
                }
                var abilityData = suicideAttack.AbilityData.FirstOrDefault(x => x.Name == "small_radius");
                if (abilityData != null)
                {
                    suicideAttackRadius = abilityData.Value;
                }
                suicideAttackLevel = suicideLevel;
            }

            var bombLevel = remoteMines.Level;

            if (remoteMinesLevel != bombLevel)
            {
                if (me.AghanimState())
                {
                    var firstOrDefault = remoteMines.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter");
                    if (firstOrDefault != null)
//.........这里部分代码省略.........
开发者ID:xzyxzy,项目名称:EnsageSharp-1,代码行数:101,代码来源:Techies.cs

示例8: Game_OnUpdate


//.........这里部分代码省略.........
                        {
                            if (target.Position.Distance2D(Ward.Position) < 700 &&
                                Utils.SleepCheck(Ward.Handle.ToString()))
                            {
                                Ward.Attack(target);
                                Utils.Sleep(350, Ward.Handle.ToString());
                            }
                        }
                    }
                    if (me.ClassID == ClassID.CDOTA_Unit_Hero_ShadowShaman)
                    {
                        var SerpentWard = ObjectManager.GetEntities<Unit>().Where(x => (x.ClassID == ClassID.CDOTA_BaseNPC_ShadowShaman_SerpentWard)
                        && x.IsAlive && x.IsControllable).ToList();
                        if (SerpentWard != null)
                        {
                            for (int i = 0; i < SerpentWard.Count(); i++)
                            {
                                if (target.Position.Distance2D(SerpentWard[i].Position) < 650 &&
                                    Utils.SleepCheck(SerpentWard[i].Handle.ToString()))
                                {
                                    SerpentWard[i].Attack(target);
                                    Utils.Sleep(700, SerpentWard[i].Handle.ToString());
                                }
                            }
                        }
                    }

                    if (me.ClassID == ClassID.CDOTA_Unit_Hero_LoneDruid)
                    {
                        var spiritbear = ObjectManager.GetEntities<Unit>().FirstOrDefault(x => (x.ClassID == ClassID.CDOTA_Unit_SpiritBear)
                           && x.IsAlive && x.IsControllable);
                        if (spiritbear != null)
                        {
                            if ((!me.AghanimState() && me.Position.Distance2D(spiritbear) <= 1200) || me.AghanimState())
                            {
                                abyssal = spiritbear.FindItem("item_abyssal_blade");

                                mjollnir = spiritbear.FindItem("item_mjollnir");

                                boots = spiritbear.FindItem("item_phase_boots");

                                midas = spiritbear.FindItem("item_hand_of_midas");

                                mom = spiritbear.FindItem("item_mask_of_madness");

                                medall = spiritbear.FindItem("item_medallion_of_courage") ?? spiritbear.FindItem("item_solar_crest");

                                if (boots != null && target.Position.Distance2D(spiritbear.Position) < 1550 && boots.CanBeCasted() &&
                                    Utils.SleepCheck(spiritbear.Handle.ToString()))
                                {
                                    boots.UseAbility();
                                    Utils.Sleep(350, spiritbear.Handle.ToString());
                                }
                                if (mjollnir != null && target.Position.Distance2D(spiritbear.Position) < 525 && mjollnir.CanBeCasted() &&
                                    Utils.SleepCheck(spiritbear.Handle.ToString()))
                                {
                                    mjollnir.UseAbility(spiritbear);
                                    Utils.Sleep(350, spiritbear.Handle.ToString());
                                }

                                if (medall != null && target.Position.Distance2D(spiritbear.Position) < 525 && medall.CanBeCasted() &&
                                   Utils.SleepCheck(spiritbear.Handle.ToString()))
                                {
                                    medall.UseAbility(target);
                                    Utils.Sleep(350, spiritbear.Handle.ToString());
                                }
开发者ID:Rulfy,项目名称:ReworkAllScripts,代码行数:67,代码来源:Program.cs


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