Esempio n. 1
0
        private void OnInt64PropertyChanged(Entity sender, Int64PropertyChangeEventArgs args)
        {
            if (args.OldValue.Equals(args.NewValue))
            {
                return;
            }

            var menu = mainMenu.OnChangeMenu.Int64;

            if (!menu.Enabled || menu.HeroesOnly && !(sender is Hero))
            {
                return;
            }

            const Color       Color = Color.Cyan;
            const Logger.Type Type  = Logger.Type.Int64;

            logger.Write("Int64 property changed", Type, Color, true);
            logger.Write("Sender name: " + sender.Name, Type, Color);
            logger.Write("Sender classID: " + sender.ClassId, Type, Color);
            if (sender.Owner != null)
            {
                logger.Write("Owner Name: " + sender.Owner.Name, Type, Color);
                logger.Write("Owner classID: " + sender.Owner.ClassId, Type, Color);
            }
            logger.Write("Property name: " + args.PropertyName, Type, Color);
            logger.Write("Property values: " + args.OldValue + " => " + args.NewValue, Type, Color);
            logger.EmptyLine();
        }
Esempio n. 2
0
 private void Entity_OnInt64PropertyChange(Entity sender, Int64PropertyChangeEventArgs args)
 {
     if (!(sender is Hero))
     {
         return;
     }
     Debugging.WriteLine("64 - {0}: {1}", sender.Name, args.PropertyName);
 }
Esempio n. 3
0
        //public async void OnUpdate(EventArgs args)
        //{
        //    if (processing || sleeper.Sleeping || !Game.IsInGame)
        //    {
        //        return;
        //    }

        //    processing = true;

        //    foreach (var unit in ObjectManager.GetEntitiesParallel<Unit>()
        //        .Where(
        //            x => !(x is Building) && x.IsValid && x.IsAlive && x.IsSpawned && (!x.IsIllusion || x.HasModifiers(
        //                                                                                   new[]
        //                                                                                   {
        //                                                                                       "modifier_arc_warden_tempest_double",
        //                                                                                       "modifier_vengefulspirit_hybrid_special",
        //                                                                                       "modifier_morph_hybrid_special"
        //                                                                                   },
        //                                                                                   false))))
        //    {
        //        var abilities = new List<Ability>();

        //        try
        //        {
        //            abilities.AddRange(unit.Spellbook.Spells.ToList());

        //            if (unit.HasInventory)
        //            {
        //                abilities.AddRange(unit.Inventory.Items);
        //            }
        //        }
        //        catch
        //        {
        //            continue;
        //        }

        //        foreach (var ability in abilities.Where(
        //            x => x.IsValid && !addedAbilities.Contains(x.Handle) && x.Level > 0))
        //        {
        //            if (unit.Equals(Hero))
        //            {
        //                var abilityName = ability.Name;

        //                Func<Ability, UsableAbility> func;
        //                if (allyAbilitiesData.CounterAbilities.TryGetValue(abilityName, out func))
        //                {
        //                    Menu.UsableAbilities.AddAbility(abilityName, AbilityType.Counter);
        //                    UsableAbilities.Add(func.Invoke(ability));
        //                }
        //                if (allyAbilitiesData.DisableAbilities.TryGetValue(abilityName, out func))
        //                {
        //                    Menu.UsableAbilities.AddAbility(abilityName, AbilityType.Disable);
        //                    UsableAbilities.Add(func.Invoke(ability));
        //                }
        //                if (allyAbilitiesData.BlinkAbilities.TryGetValue(abilityName, out func))
        //                {
        //                    Menu.UsableAbilities.AddAbility(abilityName, AbilityType.Blink);
        //                    UsableAbilities.Add(func.Invoke(ability));
        //                }
        //            }
        //            else if (unit.Team != HeroTeam || ability.ClassId
        //                     == ClassId.CDOTA_Ability_FacelessVoid_Chronosphere)
        //            {
        //                Func<Ability, EvadableAbility> func;
        //                if (enemyAbilitiesData.EvadableAbilities.TryGetValue(ability.Name, out func))
        //                {
        //                    var evadableAbility = func.Invoke(ability);

        //                    if (Menu.Debug.FastAbilityAdd)
        //                    {
        //                        Menu.EnemiesSettings.AddAbility(evadableAbility);
        //                    }
        //                    else
        //                    {
        //                        await Menu.EnemiesSettings.AddAbility(evadableAbility);
        //                    }

        //                    EvadableAbilities.Add(evadableAbility);
        //                }
        //            }

        //            addedAbilities.Add(ability.Handle);
        //        }
        //    }

        //    sleeper.Sleep(3000);
        //    processing = false;
        //}

        private void EntityOnOnInt64PropertyChange(Entity sender, Int64PropertyChangeEventArgs args)
        {
            if (args.OldValue != 0 || args.NewValue != 1 || args.PropertyName != "m_iIsControllableByPlayer64")
            {
                return;
            }

            if (sender.Team == HeroTeam && sender is Creep)
            {
                EvadableAbilities.RemoveAll(x => x.OwnerHandle == sender.Handle);
            }
        }
Esempio n. 4
0
        private static void OnInt64PropertyChange(Entity sender, Int64PropertyChangeEventArgs args)
        {
            if (args.NewValue == args.OldValue)
            {
                return;
            }

            if (args.PropertyName == "m_iIsControllableByPlayer64")
            {
                UpdateManager.BeginInvoke(() => EntityManager9.ChangeEntityControl(sender));
            }
        }
Esempio n. 5
0
        private bool IsValid(Entity sender, Int64PropertyChangeEventArgs args)
        {
            if (args.OldValue.Equals(args.NewValue))
            {
                return(false);
            }

            if (this.heroesOnly && !(sender is Hero) && !(sender.Owner is Hero))
            {
                return(false);
            }

            return(true);
        }
 // Token: 0x060003BB RID: 955 RVA: 0x0001D3F4 File Offset: 0x0001B5F4
 private void OnInt64PropertyChange(Entity sender, Int64PropertyChangeEventArgs args)
 {
     if (args.NewValue == args.OldValue)
     {
         return;
     }
     try
     {
         string propertyName = args.PropertyName;
         if (propertyName == "m_iIsControllableByPlayer64")
         {
             UpdateManager.BeginInvoke(delegate
             {
                 EntityManager9.ChangeEntityControl(sender);
             }, 0);
         }
     }
     catch (Exception exception)
     {
         Logger.Error(exception, null);
     }
 }
Esempio n. 7
0
        private void OnInt64PropertyChange(Entity sender, Int64PropertyChangeEventArgs args)
        {
            if (!this.IsValid(sender, args))
            {
                return;
            }

            var item = new LogItem(LogType.Int64, Color.Cyan, "Int64 changed");

            item.AddLine("Property name: " + args.PropertyName, args.PropertyName);
            item.AddLine("Property values: " + args.OldValue + " => " + args.NewValue, args.NewValue);
            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);
            if (sender.Owner is Unit)
            {
                item.AddLine("Owner name: " + sender.Owner.Name, sender.Owner.Name);
                item.AddLine("Owner network name: " + sender.Owner.NetworkName, sender.Owner.NetworkName);
                item.AddLine("Owner classID: " + sender.Owner.ClassId, sender.Owner.ClassId);
            }

            this.log.Display(item);
        }
Esempio n. 8
0
 private void OnInt64PropertyChange(Entity sender, Int64PropertyChangeEventArgs args)
 {
     Messenger <Int64PropertyChangeEventArgs> .Publish(args);
 }