Esempio n. 1
0
        public void ItemsNull(
            Hero Hero,
            string ParticleName,
            string AbilityTexturName,
            Vector3 Position)
        {
            try
            {
                var HeroNull = Hero == null;

                var DangerousItems = Dangerous.DangerousItemList.Contains(AbilityTexturName);

                if (MenuManager.ItemsItem.Value &&
                    (HeroNull ||
                     Hero.Team != MyHero.Team &&
                     (!Hero.IsVisible ||
                      MenuManager.DangerousItemsItem.Value &&
                      DangerousItems)))
                {
                    var HeroTexturName = HeroNull
                        ? "default"
                        : Hero.Name.Substring("npc_dota_hero_".Length);

                    var HeroName = HeroNull
                        ? CultureInfo.CurrentCulture.TextInfo.
                                   ToTitleCase(AbilityTexturName.Substring("item_".Length).Replace("_", " "))
                        : Hero.GetDisplayName();

                    var Vector3 = HeroNull ? new Vector3(255, 0, 0) : Colors.Vector3ToID[Hero.Player.Id] * 255;

                    var HeroColor = Color.FromArgb((int)Vector3.X, (int)Vector3.Y, (int)Vector3.Z);

                    if (MenuManager.DangerousItemsMSG.Value &&
                        DangerousItems)
                    {
                        MessageCreator.MessageItemCreator(
                            HeroTexturName,
                            AbilityTexturName.Substring("item_".Length),
                            Game.GameTime);
                    }

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

                    DrawHelper.Draw(
                        Hero,
                        ParticleName,
                        AbilityTexturName,
                        HeroTexturName,
                        HeroName,
                        HeroColor,
                        Position);
                }
            }
            catch (Exception)
            {
                //ignore
            }
        }
Esempio n. 2
0
        public void Teleport(
            Hero Hero,
            Vector3 Position,
            string AbilityTexturName,
            Vector3 ParticleColor,
            bool End)
        {
            try
            {
                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;

                var Team = Hero.Team == MyHero.Team;

                if (!Team && MenuManager.TeleportEnemyItem ||
                    Team && MenuManager.TeleportAllyItem)
                {
                    if (!Team && End)
                    {
                        MessageCreator.MessageItemCreator(
                            Hero.Name.Substring("npc_dota_hero_".Length),
                            "tpscroll",
                            Game.GameTime);

                        SoundPlayer.Play("default");
                    }

                    GlobalMiniMap.MiniMapList.Add(new GlobalMiniMap.MiniMap(
                                                      End,
                                                      true,
                                                      "TP",
                                                      Position.WorldToMinimap(),
                                                      Hero.GetDisplayName(),
                                                      HeroColor));

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

                    if (!Team)
                    {
                        GlobalWorld.WorldList.Add(new GlobalWorld.World(
                                                      "TP",
                                                      Position,
                                                      Hero.Name.Substring("npc_dota_hero_".Length),
                                                      AbilityTexturName));

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