Beispiel #1
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team != this.ownerTeam)
                {
                    return;
                }

                if (!(sender is Hero))
                {
                    return;
                }

                if (modifier.Name != "modifier_truesight" && modifier.Name != "modifier_item_dustofappearance")
                {
                    return;
                }

                if (this.effects.ContainsKey(sender.Handle))
                {
                    return;
                }

                var effect = ParticleManager.CreateParticle("particles/items2_fx/ward_true_sight.vpcf", ParticleAttachment.CenterFollow, sender);
                this.effects.Add(sender.Handle, effect);
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #2
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team != this.OwnerTeam)
                {
                    return;
                }

                if (modifier.Name != "modifier_bounty_hunter_track")
                {
                    return;
                }

                var effect = ParticleManager.CreateParticle(
                    "particles/econ/items/bounty_hunter/bounty_hunter_hunters_hoard/bounty_hunter_hoard_shield.vpcf",
                    ParticleAttachment.OverheadFollow,
                    sender);

                this.effects.Add(sender.Handle, effect);
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #3
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            var modifier = e.Modifier;

            if (modifier.Name != "modifier_kunkka_torrent_thinker")
            {
                return;
            }

            UpdateManager.BeginInvoke(() =>
            {
                try
                {
                    if (!modifier.IsValid)
                    {
                        return;
                    }

                    if (!modifier.IsHidden || modifier.Team != this.Owner.Team || modifier.Owner?.Owner?.Handle != this.Owner.Handle)
                    {
                        return;
                    }

                    this.torrent.Modifier = modifier;
                }
                catch (Exception ex)
                {
                    Logger.Error(ex, (EntityManager9.Abilities.Count(x => this.Owner.Equals(x.Owner))).ToString());
                }
            });
        }
Beispiel #4
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team == this.OwnerTeam)
                {
                    return;
                }

                if (modifier.Name != "modifier_kunkka_torrent_thinker")
                {
                    return;
                }

                var effect = ParticleManager.CreateParticle(
                    "particles/econ/items/kunkka/divine_anchor/hero_kunkka_dafx_skills/kunkka_spell_torrent_bubbles_fxset.vpcf",
                    sender.Position);
                effect.Release();
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #5
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team == this.OwnerTeam)
                {
                    return;
                }

                if (modifier.Name != "modifier_slark_dark_pact")
                {
                    return;
                }

                this.unit = EntityManager9.GetUnit(sender.Handle);
                if (this.unit == null)
                {
                    return;
                }

                this.effect = ParticleManager.CreateParticle(
                    "particles/units/heroes/hero_slark/slark_dark_pact_start.vpcf",
                    ParticleAttachment.AbsOriginFollow,
                    sender);

                ModifierManager.ModifierRemoved += this.OnModifierRemoved;
                this.handler.IsEnabled           = true;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #6
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team != this.OwnerTeam)
                {
                    return;
                }

                if (modifier.Name != "modifier_sniper_assassinate")
                {
                    return;
                }

                var effect = ParticleManager.CreateParticle(
                    "particles/units/heroes/hero_sniper/sniper_crosshair.vpcf",
                    ParticleAttachment.OverheadFollow,
                    sender);

                this.effects.Add(sender.Handle, effect);
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #7
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifer = e.Modifier;
                var sender  = modifer.Owner;
                if (sender.Team == this.OwnerTeam)
                {
                    return;
                }

                if (modifer.Name != "modifier_leshrac_split_earth_thinker")
                {
                    return;
                }

                var effect = ParticleManager.CreateParticle("particles/units/heroes/hero_leshrac/leshrac_split_projected.vpcf", sender.Position);
                effect.SetControlPoint(1, this.radius);

                effect.Release();
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #8
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team != this.OwnerTeam)
                {
                    return;
                }

                if (modifier.Name != "modifier_tusk_snowball_target")
                {
                    return;
                }

                this.effect = ParticleManager.CreateParticle(
                    "particles/units/heroes/hero_tusk/tusk_snowball_target.vpcf",
                    ParticleAttachment.OverheadFollow,
                    sender);

                ModifierManager.ModifierRemoved += this.OnModifierRemoved;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #9
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            var modifier = e.Modifier;

            if (modifier.Name != "modifier_pudge_meat_hook")
            {
                return;
            }

            UpdateManager.BeginInvoke(() =>
            {
                try
                {
                    if (!modifier.IsValid || modifier.Owner.Handle != this.Owner.Handle)
                    {
                        return;
                    }

                    this.sleeper.Sleep(2f);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                }
            });
        }
Beispiel #10
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            var modifier = e.Modifier;

            if (modifier.Name != "modifier_ember_spirit_sleight_of_fist_caster")
            {
                return;
            }

            UpdateManager.BeginInvoke(() =>
            {
                try
                {
                    if (modifier.Owner.Handle != this.Owner.HeroHandle)
                    {
                        return;
                    }

                    this.useChains = true;
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                }
            });
        }
Beispiel #11
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team == this.OwnerTeam)
                {
                    return;
                }

                if (modifier.Name != "modifier_lina_light_strike_array")
                {
                    return;
                }

                var effect = ParticleManager.CreateParticle("particles/econ/items/lina/lina_ti7/light_strike_array_pre_ti7.vpcf", sender.Position);
                effect.SetControlPoint(1, this.radius);

                effect.Release();
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #12
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team == this.OwnerTeam)
                {
                    return;
                }

                if (modifier.Name != "modifier_invoker_sun_strike")
                {
                    return;
                }

                var effect = ParticleManager.CreateParticle(
                    "particles/econ/items/invoker/invoker_apex/invoker_sun_strike_team_immortal1.vpcf",
                    sender.Position);
                effect.Release();
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #13
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Handle != this.owner.HeroHandle)
                {
                    return;
                }

                var name = modifier.Name;

                if (name == "modifier_morphling_replicate_manager")
                {
                    this.morphedAbilities.Add(new ReplicateTimer(modifier.RemainingTime));
                    RendererManager.Draw += this.OnDraw;
                }
                else if (name == "modifier_morphling_replicate")
                {
                    this.isMorphed = true;
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #14
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            var modifier = e.Modifier;
            var sender   = modifier.Owner;

            try
            {
                if (sender.Team != this.owner.Team || modifier.IsHidden || !this.denyModifiers.Contains(modifier.Name))
                {
                    return;
                }

                var unit = EntityManager9.GetUnit(sender.Handle);
                if (unit == null || unit.IsMyHero || unit.IsIllusion || !unit.IsHero)
                {
                    return;
                }

                this.units[unit]       = null;
                this.handler.IsEnabled = true;
            }
            catch (Exception ex)
            {
                Logger.Error(ex, sender);
            }
        }
Beispiel #15
0
        private async void UnitOnModifierAdded(ModifierAddedEventArgs e)
        {
            if (e.IsCollection)
            {
                return;
            }

            await Task.Delay(1);

            var modifier = e.Modifier;

            if (!this.IsValid(modifier))
            {
                return;
            }

            var item = new LogItem(LogType.Modifier, Color.LightGreen, "Modifier added");

            item.AddLine("Name: " + modifier.Name, modifier.Name);
            item.AddLine("Texture name: " + modifier.TextureName, modifier.TextureName);
            item.AddLine("Elapsed time: " + modifier.ElapsedTime, modifier.ElapsedTime);
            item.AddLine("Remaining time: " + modifier.RemainingTime, modifier.RemainingTime);

            var sender = modifier.Owner;

            item.AddLine("Sender name: " + sender.Name, sender.Name);
            item.AddLine("Sender network name: " + sender.NetworkName, sender.NetworkName);
            item.AddLine("Sender classID: " + sender.ClassId, sender.ClassId);

            this.log.Display(item);
        }
Beispiel #16
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            var modifier = e.Modifier;

            if (modifier.Name != "modifier_invoker_ghost_walk_enemy")
            {
                return;
            }

            UpdateManager.BeginInvoke(() =>
            {
                try
                {
                    if (!modifier.IsDebuff)
                    {
                        return;
                    }

                    var sender = modifier.Owner;
                    if (sender.Team != this.Owner.Team)
                    {
                        return;
                    }

                    var ghostWalk = EntityManager9.Abilities.FirstOrDefault(x => x.Id == AbilityId.invoker_ghost_walk && !x.Owner.IsAlly(this.Owner));
                    if (ghostWalk == null)
                    {
                        return;
                    }

                    UpdateManager.BeginInvoke(
                        async() =>
                    {
                        if (!modifier.IsValid)
                        {
                            return;
                        }

                        while (modifier.IsValid)
                        {
                            if (this.ForceUse(ghostWalk.Owner, sender.Position, 0.8f))
                            {
                                break;
                            }

                            await Task.Delay(300);
                        }
                    });
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                }
            });
        }
Beispiel #17
0
        private void OnModifierManagerModifierAdded(ModifierAddedEventArgs e)
        {
            var owner = e.Modifier.Owner;

            if (owner is not Unit unit || unit.IsEnemy(LocalHero) || e.Modifier.Name != "modifier_truesight")
            {
                return;
            }

            ParticleAdd(EntityManager.GetEntityByHandle(unit.Handle));
        }
Beispiel #18
0
 private void OnModifierAdded(ModifierAddedEventArgs e)
 {
     try
     {
         var modifier = e.Modifier;
         this.CheckModifier(modifier.Owner.Handle, modifier, true);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
     }
 }
Beispiel #19
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                if (!modifier.IsValid)
                {
                    return;
                }

                if (!this.data.TryGetValue(modifier.Name, out var type))
                {
                    return;
                }

                if (modifier.IsHidden)
                {
                    if (this.ignoreHiddenAuras || type != ModifierType.Aura)
                    {
                        return;
                    }
                }
                else
                {
                    if (this.ignoreAuras && type == ModifierType.Aura)
                    {
                        return;
                    }

                    if (this.ignoreUnknownTime && type == ModifierType.TemporaryNoTime)
                    {
                        return;
                    }
                }

                var modifierUnit = this.units.Find(x => x.Unit.Handle == modifier.Owner.Handle);
                if (modifierUnit == null)
                {
                    return;
                }

                if (!this.LoadModifierTexture(modifier))
                {
                    return;
                }

                modifierUnit.AddModifier(new DrawableModifier(modifier, type));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #20
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                if (modifier.Name != "modifier_abyssal_underlord_dark_rift")
                {
                    return;
                }

                this.endTime  = this.modifier.DieTime;
                this.duration = this.modifier.Duration;

                RendererManager.Draw += this.OnDraw;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #21
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                if (modifier.Owner.Handle != this.Handle || modifier.Name != "modifier_windrunner_focusfire")
                {
                    return;
                }

                this.FocusFireActive = true;

                ModifierManager.ModifierAdded   -= this.OnModifierAdded;
                ModifierManager.ModifierRemoved += this.OnModifierRemoved;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #22
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                if (modifier.Owner.Handle != this.Owner.Handle || modifier.Name != "modifier_item_hurricane_pike_range")
                {
                    return;
                }

                this.Owner.HurricanePikeTarget = this.pikeTarget;

                ModifierManager.ModifierAdded   -= this.OnModifierAdded;
                ModifierManager.ModifierRemoved += this.OnModifierRemoved;
            }
            catch (Exception ex)
            {
                ModifierManager.ModifierAdded -= this.OnModifierAdded;
                Logger.Error(ex);
            }
        }
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            var modifier = e.Modifier;

            if (modifier.Name != "modifier_item_hurricane_pike_range")
            {
                return;
            }

            UpdateManager.BeginInvoke(() =>
            {
                try
                {
                    if (modifier.Owner.Handle != this.Ability.Owner.Handle)
                    {
                        return;
                    }

                    foreach (var orb in this.Ability.Owner.Abilities.OfType <OrbAbility>())
                    {
                        if (orb.Enabled || !orb.CanBeCasted())
                        {
                            continue;
                        }

                        this.enabledOrbs.Add(orb.Id);
                        orb.Enabled = true;
                    }

                    ModifierManager.ModifierRemoved += this.OnModifierRemoved;
                    ModifierManager.ModifierAdded   -= this.OnModifierAdded;
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                    ModifierManager.ModifierAdded -= this.OnModifierAdded;
                }
            });
        }
Beispiel #24
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team == this.OwnerTeam)
                {
                    return;
                }

                if (modifier.Name != "modifier_life_stealer_infest_effect")
                {
                    return;
                }

                this.effect = ParticleManager.CreateParticle(
                    "particles/units/heroes/hero_life_stealer/life_stealer_infested_unit.vpcf",
                    ParticleAttachment.OverheadFollow,
                    sender);

                if (this.notificationsEnabled && sender is Hero)
                {
                    this.Notificator.PushNotification(
                        new AbilityHeroNotification(
                            nameof(HeroId.npc_dota_hero_life_stealer),
                            nameof(AbilityId.life_stealer_infest),
                            sender.Name));
                }

                ModifierManager.ModifierRemoved += this.OnModifierRemoved;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #25
0
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                var sender   = modifier.Owner;
                if (sender.Team != this.OwnerTeam)
                {
                    return;
                }

                if (modifier.Name != "modifier_spirit_breaker_charge_of_darkness_vision")
                {
                    return;
                }

                this.effect = ParticleManager.CreateParticle(
                    "particles/units/heroes/hero_spirit_breaker/spirit_breaker_charge_target.vpcf",
                    ParticleAttachment.OverheadFollow,
                    sender);

                if (this.notificationsEnabled && sender is Hero)
                {
                    this.Notificator.PushNotification(
                        new AbilityHeroNotification(
                            nameof(HeroId.npc_dota_hero_spirit_breaker),
                            nameof(AbilityId.spirit_breaker_charge_of_darkness),
                            sender.Name));
                }

                ModifierManager.ModifierRemoved += this.OnModifierRemoved;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Beispiel #26
0
        private void OnModifierAdded(ModifierAddedEventArgs args)
        {
            try
            {
                var modifier = args.Modifier;
                if (!this.runeModifiers.Contains(modifier.Name))
                {
                    return;
                }

                var sender = modifier.Owner;
                var hero   = this.units.Find(x => x?.Handle == sender.Handle);
                if (hero == null)
                {
                    return;
                }

                hero.AddModifier(modifier);
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Beispiel #27
0
        private void OnModifierAdded(ModifierAddedEventArgs args)
        {
            if (!this.Menu.AbilitySettings.IsCounterEnabled(this.Ability.Name))
            {
                return;
            }

            try
            {
                if (args.Modifier.Owner.Handle != this.Owner.Handle)
                {
                    return;
                }

                var name = args.Modifier.Name;
                if (name == "modifier_bashed" && args.Modifier.Caster is Divine.Roshan)
                {
                    isLastStun         = true;
                    isLastRoshanAttack = true;
                }

                if (name == "modifier_fountain_aura_buff" && this.armlet.Enabled && this.canToggle && !this.toggling.IsSleeping)
                {
                    this.manualDisable = true;
                    this.ActiveAbility.UseAbility(false, true);
                }
                else if (this.selfDot.ContainsKey(name))
                {
                    this.initialDotTimings[name] = GameManager.RawGameTime - args.Modifier.ElapsedTime;
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Beispiel #28
0
 private void OnModifierAdded(ModifierAddedEventArgs e)
 {
     OnModifierChange(e.Modifier);
 }
        private void OnModifierAdded(ModifierAddedEventArgs e)
        {
            try
            {
                var modifier = e.Modifier;
                if (!modifier.IsValid)
                {
                    return;
                }

                var entity = modifier.Owner;

                var unit = entity as Unit;

                var hero   = unit as Hero;
                var isHero = hero != null;

                if (SpiritBreakerCharge.Modifier(unit, modifier, isHero))
                {
                    return;
                }

                if (LifeStealerInfest.Modifier(unit, modifier, isHero))
                {
                    return;
                }

                if (PhantomAssassinBlur.Modifier(unit, modifier))
                {
                    return;
                }

                if (BloodseekerRupture.Modifier(unit, modifier))
                {
                    return;
                }

                if (!PartialMapHackMenu.ModifersItem)
                {
                    return;
                }

                if (!isHero)
                {
                    return;
                }

                var modifierName = modifier.Name;

                if (ModifierDictionaries.Modifiers.TryGetValue(modifierName, out var sleepTime))
                {
                    if (hero.IsAlly(LocalHero))
                    {
                        return;
                    }

                    Modifier(hero, modifier, hero.Position, modifierName, sleepTime);
                    return;
                }

                if (ModifierDictionaries.AllyModifiers.TryGetValue(modifierName, out var heroId))
                {
                    if (hero.IsEnemy(LocalHero))
                    {
                        return;
                    }

                    Modifier(hero, modifier, hero.Position, modifierName, 5000, heroId);
                    return;
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
Beispiel #30
0
        private void OnModifierAdded(ModifierAddedEventArgs args)
        {
            try
            {
                var modifier = args.Modifier;
                var name     = modifier.Name;

                if (this.abilityObstacleModifiers.TryGetValue(name, out var id))
                {
                    if (!(this.evadable.Find(x => x.Ability.Id == id) is IModifierObstacle modifierObstacleAbility))
                    {
                        return;
                    }

                    if (modifier.Owner.Team == this.owner.Team && !modifierObstacleAbility.AllyModifierObstacle)
                    {
                        return;
                    }

                    modifierObstacleAbility.AddModifierObstacle(modifier, (Unit)modifier.Owner);
                    return;
                }

                if (!this.settingsMenu.ModifierCounter || (modifier.IsHidden && !this.forcedHiddenModifiers.Contains(modifier.Name)))
                {
                    return;
                }

                var modifierOwner = EntityManager9.GetUnit(modifier.Owner.Handle);
                if (modifierOwner == null)
                {
                    return;
                }

                if ((!modifierOwner.IsHero || !modifierOwner.IsImportant) && name != "modifier_boots_of_travel_incoming")
                {
                    return;
                }

                var abilityId = this.GetAbilityId(name, modifier.TextureName);
                if (abilityId == null)
                {
                    return;
                }

                //todo can be improved ?
                var ability = this.evadable.Where(x => x.Ability.Id == abilityId.Value)
                              .OfType <IModifierCounter>()
                              .OrderBy(x => x.Owner.Distance(modifierOwner))
                              .FirstOrDefault();

                if (ability?.ModifierCounterEnabled?.IsEnabled != true)
                {
                    return;
                }

                if ((ability.ModifierAllyCounter && !modifierOwner.IsAlly(ability.Owner)) ||
                    (ability.ModifierEnemyCounter && modifierOwner.IsAlly(ability.Owner)))
                {
                    ability.AddModifier(modifier, modifierOwner);
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }