示例#1
0
        private void OnTimedEvent()
        {
            //Check Rune
            var time = Math.Round(Game.GameTime) + 10;

            if (((time % 120) == 0 || (time % 300) == 0) &&
                MenuManager.OtherItem.Value.IsEnabled("rune_bounty") &&
                Utils.SleepCheck("check_rune"))
            {
                MessageCreator.MessageCheckRuneCreator(null);
                SoundPlayer.Play("check_rune");

                Utils.Sleep(2000, "check_rune");
            }

            //Hand of Midas
            var Midas = MyHero.Inventory.Items.FirstOrDefault(x => x.Name.Contains("item_hand_of_midas"));

            if (Midas != null &&
                Math.Round(Midas.Cooldown) == 5 &&
                MenuManager.OtherItem.Value.IsEnabled("item_hand_of_midas") &&
                Utils.SleepCheck("use_midas"))
            {
                MessageCreator.MessageUseMidasCreator(null);
                SoundPlayer.Play("use_midas");

                Utils.Sleep(2000, "use_midas");
            }

            if (Roshan_Dead &&
                MenuManager.OtherItem.Value.IsEnabled("roshan_halloween_levels"))
            {
                var roshan = EntityManager <Unit> .Entities.Any(
                    x =>
                    x.Name == "npc_dota_roshan" &&
                    x.IsAlive);

                Roshan_Respawn_Time += 1;

                //Roshan MB Alive
                if (Roshan_Respawn_Time == 485)
                {
                    MessageCreator.MessageRoshanMBAliveCreator(null);
                    SoundPlayer.Play("roshan_mb_alive");
                }

                //Roshan Alive
                if (roshan || Roshan_Respawn_Time == 665)
                {
                    MessageCreator.MessageRoshanAliveCreator(null);
                    SoundPlayer.Play("roshan_alive");

                    Roshan_Respawn_Time = 0;
                    Roshan_Dead         = false;
                }
            }
        }
示例#2
0
        public Others(
            MenuManager menumanager,
            Unit myhero,
            MessageCreator messagecreator,
            SoundPlayer soundplayer)
        {
            MenuManager    = menumanager;
            MyHero         = myhero;
            MessageCreator = messagecreator;
            SoundPlayer    = soundplayer;

            Game.OnFireEvent += OnGameEvent;
            UpdateManager.Subscribe(OnTimedEvent, 1000);
        }
示例#3
0
 public Modifiers(
     MenuManager menumanager,
     Unit myhero,
     Dangerous dangerous,
     MessageCreator messagecreator,
     SoundPlayer soundplayer,
     Colors colors,
     GlobalMiniMap globalminimap,
     GlobalWorld globalworld)
 {
     MenuManager    = menumanager;
     MyHero         = myhero;
     Dangerous      = dangerous;
     MessageCreator = messagecreator;
     SoundPlayer    = soundplayer;
     Colors         = colors;
     GlobalMiniMap  = globalminimap;
     GlobalWorld    = globalworld;
 }
示例#4
0
        public void ModifierAlly(Unit sender, ModifierChangedEventArgs args)
        {
            if (MenuManager.SpellsItem.Value)
            {
                var HeroTexturName = sender.Name.Substring("npc_dota_hero_".Length);
                var HeroName       = sender.GetDisplayName();
                var Hero           = sender as Hero;
                var TextureName    = args.Modifier.TextureName;
                var Vector3        = Colors.Vector3ToID[Hero.Player.Id] * 255;
                var HeroColor      = Color.FromArgb((int)Vector3.X, (int)Vector3.Y, (int)Vector3.Z);
                var DangerousSpell = Dangerous.DangerousSpellList.Contains(TextureName);
                var GameTime       = Game.GameTime;

                if (Utils.SleepCheck(HeroTexturName))
                {
                    if (MenuManager.DangerousSpellsMSG.Value &&
                        DangerousSpell)
                    {
                        MessageCreator.MessageAllyCreator(
                            HeroTexturName,
                            TextureName,
                            GameTime);
                    }

                    if (MenuManager.DangerousSpellsSound.Value &&
                        DangerousSpell)
                    {
                        try
                        {
                            SoundPlayer.Play(TextureName);
                        }
                        catch
                        {
                            SoundPlayer.Play("default");
                        }
                    }

                    Utils.Sleep(5000, HeroTexturName);
                }

                GlobalMiniMap.MiniMapList.RemoveAll(
                    x =>
                    x.GetHeroName.Contains(HeroName));

                GlobalMiniMap.MiniMapList.Add(new GlobalMiniMap.MiniMap(
                                                  true,
                                                  false,
                                                  "",
                                                  sender.Position.WorldToMinimap(),
                                                  HeroName,
                                                  HeroColor));

                UpdateManager.BeginInvoke(
                    () =>
                {
                    GlobalMiniMap.MiniMapList.RemoveAll(
                        x =>
                        x.GetRemoveTime == GameTime);
                },
                    MenuManager.TimerItem.Value * 1000);

                GlobalWorld.WorldList.RemoveAll(
                    x =>
                    x.GetHeroTexturName.Contains(HeroTexturName));

                GlobalWorld.WorldList.Add(new GlobalWorld.World(
                                              "",
                                              sender.Position,
                                              HeroTexturName,
                                              TextureName));

                UpdateManager.BeginInvoke(
                    () =>
                {
                    GlobalWorld.WorldList.RemoveAll(
                        x =>
                        x.GetRemoveTime == GameTime);
                },
                    MenuManager.TimerItem.Value * 1000);
            }
        }
示例#5
0
        public void Entity(
            Hero Hero,
            EntityEventArgs Args,
            string AbilityTexturName)
        {
            if (Hero == null)
            {
                var HeroTexturName = "default";
                var HeroName       = "Unknown";
                var HeroColor      = Color.Red;
                var GameTime       = Game.GameTime;
                var MinimapPos     = Args.Entity.Position.WorldToMinimap();

                GlobalMiniMap.MiniMapList.RemoveAll(x =>
                                                    x.GetHeroName.Contains(HeroName));

                GlobalMiniMap.MiniMapList.Add(new GlobalMiniMap.MiniMap(
                                                  true,
                                                  false,
                                                  "",
                                                  MinimapPos,
                                                  HeroName,
                                                  HeroColor));

                UpdateManager.BeginInvoke(
                    () =>
                {
                    GlobalMiniMap.MiniMapList.RemoveAll(x =>
                                                        x.GetRemoveTime == GameTime);
                },
                    MenuManager.TimerItem.Value * 1000);

                var WorldPos = Args.Entity.Position;

                GlobalWorld.WorldList.RemoveAll(x =>
                                                x.GetHeroTexturName.Contains(HeroTexturName));

                GlobalWorld.WorldList.Add(new GlobalWorld.World(
                                              "",
                                              WorldPos,
                                              HeroTexturName,
                                              AbilityTexturName));

                UpdateManager.BeginInvoke(
                    () =>
                {
                    GlobalWorld.WorldList.RemoveAll(x =>
                                                    x.GetRemoveTime == GameTime);
                },
                    MenuManager.TimerItem.Value * 1000);

                return;
            }


            try
            {
                var DangerousSpell = Dangerous.DangerousSpellList.Contains(AbilityTexturName);

                if (MenuManager.SpellsItem.Value &&
                    Hero.Team != MyHero.Team &&
                    (!Hero.IsVisible ||
                     MenuManager.DangerousSpellsItem.Value &&
                     DangerousSpell))
                {
                    var HeroTexturName = Hero.Name.Substring("npc_dota_hero_".Length);
                    var HeroName       = Hero.GetDisplayName();
                    var Vector3        = Colors.Vector3ToID[Hero.Player.Id] * 255;
                    var HeroColor      = Color.FromArgb((int)Vector3.X, (int)Vector3.Y, (int)Vector3.Z);
                    var GameTime       = Game.GameTime;

                    if (MenuManager.DangerousSpellsMSG.Value &&
                        DangerousSpell)
                    {
                        MessageCreator.MessageEnemyCreator(
                            HeroTexturName,
                            AbilityTexturName,
                            GameTime);
                    }

                    if (MenuManager.DangerousSpellsSound.Value &&
                        DangerousSpell)
                    {
                        try
                        {
                            SoundPlayer.Play(AbilityTexturName);
                        }
                        catch
                        {
                            SoundPlayer.Play("default");
                        }
                    }

                    GlobalMiniMap.MiniMapList.RemoveAll(
                        x =>
                        x.GetHeroName.Contains(HeroName));

                    GlobalMiniMap.MiniMapList.Add(new GlobalMiniMap.MiniMap(
                                                      true,
                                                      false,
                                                      "",
                                                      Args.Entity.Position.WorldToMinimap(),
                                                      HeroName,
                                                      HeroColor));

                    UpdateManager.BeginInvoke(
                        () =>
                    {
                        GlobalMiniMap.MiniMapList.RemoveAll(
                            x =>
                            x.GetRemoveTime == GameTime);
                    },
                        MenuManager.TimerItem.Value * 1000);

                    GlobalWorld.WorldList.RemoveAll(
                        x =>
                        x.GetHeroTexturName.Contains(HeroTexturName));

                    GlobalWorld.WorldList.Add(new GlobalWorld.World(
                                                  "",
                                                  Args.Entity.Position,
                                                  HeroTexturName,
                                                  AbilityTexturName));

                    UpdateManager.BeginInvoke(
                        () =>
                    {
                        GlobalWorld.WorldList.RemoveAll(
                            x =>
                            x.GetRemoveTime == GameTime);
                    },
                        MenuManager.TimerItem.Value * 1000);
                }
            }
            catch (Exception)
            {
            }
        }