public void PaintWorld(WorldLayer layer)
        {
            //  if (Hud.Game.SpecialArea != SpecialArea.GreaterRift) return ;

            var bosses = Hud.Game.AliveMonsters.Where(m => m.Rarity == ActorRarity.Boss);

            foreach (IMonster monster in bosses)
            {
                if (monster.SummonerAcdDynamicId != 0)
                {
                    continue;
                }
                if (BossList.Contains(monster.SnoMonster.NameLocalized) || BossList.Contains(monster.SnoMonster.NameEnglish))
                {
                    BossDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.Animation.ToString());

                    var TmpAnime = monster.Animation.ToString();
                    if (CurrentAnime == null || CurrentAnime != TmpAnime)
                    {
                        CurrentAnime = TmpAnime;
                        var writelog = "\t" + monster.SnoMonster.NameLocalized + "\t" + TmpAnime;
                        Hud.TextLog.Log("BossAnimeLog", writelog, true, true);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void PaintWorld(WorldLayer layer)
        {
            var inRift = Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift;

            var monsters = Hud.Game.AliveMonsters;

            foreach (var monster in monsters)
            {
                if (HideOnIllusions && (monster.SummonerAcdDynamicId != 0) && (monster.Rarity == ActorRarity.RareMinion))
                {
                    continue;
                }

                // trash
                if (!inRift && !monster.Invisible && !monster.IsElite && (monster.SnoMonster.Priority != MonsterPriority.goblin) && (monster.SnoMonster.Priority != MonsterPriority.boss) && (monster.SnoMonster.Priority != MonsterPriority.keywarden))
                {
                    TrashDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if (monster.Invisible)
                {
                    InvisibleDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if (monster.Rarity == ActorRarity.Champion)
                {
                    EliteChampionDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if (monster.Rarity == ActorRarity.RareMinion)
                {
                    EliteMinionDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if (monster.Rarity == ActorRarity.Rare)
                {
                    EliteLeaderDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if ((monster.Rarity == ActorRarity.Unique) && (monster.SnoMonster.Priority < MonsterPriority.keywarden))
                {
                    EliteUniqueDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if (monster.SnoMonster.Priority == MonsterPriority.keywarden)
                {
                    KeywardenDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if (monster.SnoMonster.Priority == MonsterPriority.boss)
                {
                    BossDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }
            }
        }
Ejemplo n.º 3
0
        public void PaintWorld(WorldLayer layer)
        {
            var monster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1;

            if (monster == null)
            {
                return;
            }
            if (monster.SummonerAcdDynamicId != 0 && monster.IsElite)
            {
                return;
            }
            if (!monster.Invisible && !monster.IsElite && (monster.SnoMonster.Priority != MonsterPriority.goblin) && (monster.SnoMonster.Priority != MonsterPriority.boss) && (monster.SnoMonster.Priority != MonsterPriority.keywarden))
            {
                TrashDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
            }
            if (monster.Rarity == ActorRarity.Unique)
            {
                UniqueDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
            }
            if (monster.SnoMonster.Priority == MonsterPriority.boss)
            {
                BossDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
            }
            if (monster.Rarity == ActorRarity.Champion)
            {
                ChampionDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
            }
            if (monster.Rarity == ActorRarity.RareMinion)
            {
                RareMinionDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
            }
            if (monster.Rarity == ActorRarity.Rare)
            {
                RareDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
            }
            if ((monster.Rarity == ActorRarity.Unique) && (monster.SnoMonster.Priority < MonsterPriority.keywarden))
            {
                UniqueDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
            }
            if (monster.SnoMonster.Priority == MonsterPriority.boss)
            {
                BossDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
            }
        }
Ejemplo n.º 4
0
        public void PaintWorld(WorldLayer layer)
        {
            DistYards = 0;
            bool FirstQuestMarker = true;
            var  Actors           = Hud.Game.Actors.Where(a => a.SnoActor.Sno == 432770 || a.SnoActor.Sno == 430733 || a.SnoActor.Sno == 432885 || a.SnoActor.Sno == 433051 ||
                                                          a.SnoActor.Sno == 432259 || a.SnoActor.Sno == 433246 || a.SnoActor.Sno == 433385 || a.SnoActor.Sno == 433295 || a.SnoActor.Sno == 433316 ||
                                                          a.SnoActor.Sno == 434366 || a.SnoActor.Sno == 433124 || a.SnoActor.Sno == 433184 || a.SnoActor.Sno == 433402 || a.SnoActor.Sno == 432331 ||
                                                          a.SnoActor.Sno == 435703);

            if (!Actors.Any())
            {
                FirstQuestMarker = true;
            }
            foreach (var Actor in Actors)
            {
                if (Actor == null)
                {
                    continue;
                }
                if (Actor.FloorCoordinate == null)
                {
                    continue;
                }
                if (Actor.IsDisabled || Actor.IsOperated)
                {
                    continue;
                }

                uint   ThatQuest = 0;
                string Name      = string.Empty;
                switch (Actor.SnoActor.Sno)
                {
                case 432770: Name = "Royal Cocoon"; ThatQuest = 432784; break;

                case 430733: Name = "Captured Villager"; ThatQuest = 430723; break;

                case 432885: Name = "Ancient Device"; ThatQuest = 433025; break;

                case 433051: Name = "Caldeum Villager"; ThatQuest = 433053; break;

                case 435703: Name = "Captured Barbarian"; ThatQuest = 436280; break;

                case 432259: Name = "Triune Monument"; ThatQuest = 432293;  break;

                case 433246: Name = "Death Orb"; ThatQuest = 433256; break;

                case 433385: Name = "Catapult Winch"; ThatQuest = 433392; break;

                case 433295: Name = "Demon Gate"; ThatQuest = 433309; break;

                case 433316: Name = "Death Prison"; ThatQuest = 433339; break;

                case 434366: Name = "Tortured Wortham Militia"; ThatQuest = 434378; break;

                case 433184: Name = "Captured Guard"; ThatQuest = 433217; break;

                case 433124: Name = "Bone Cage"; ThatQuest = 433099; break;

                case 433402: Name = "Hell Portal"; ThatQuest = 433422; break;

                case 432331: Name = "Captured Iron Wolf"; ThatQuest = 432334; break;

                default:  Name = string.Empty;  break;
                }
                var quest = Hud.Game.Bounties.FirstOrDefault(x => x.SnoQuest.Sno == ThatQuest);
                if ((quest != null) && quest.State != QuestState.completed)
                {
                    QuestDecorator.Paint(layer, null, Actor.FloorCoordinate, Name);
                    FirstQuestMarker = false;
                }
            }

            // modified Xenthalon's AdvancedMarkerPlugin
            var markers = Hud.Game.Markers.OrderBy(i => Hud.Game.Me.FloorCoordinate.XYDistanceTo(i.FloorCoordinate));

            if (markers != null)
            {
                foreach (var marker in markers)
                {
                    if (marker == null)
                    {
                        continue;
                    }
                    if (marker.FloorCoordinate == null)
                    {
                        continue;
                    }
                    if (marker.Name == null)
                    {
                        continue;
                    }

                    var OnScreen = marker.FloorCoordinate.IsOnScreen(1);
                    QuestDecorator.ToggleDecorators <GroundLabelDecorator>(!OnScreen); // do not display ground labels when the marker is on the screen
                    KeywardenDecorator.ToggleDecorators <GroundLabelDecorator>(!OnScreen);
                    BossDecorator.ToggleDecorators <GroundLabelDecorator>(!OnScreen);

                    if (marker.SnoQuest != null && FirstQuestMarker)
                    {
                        DistYards = (int)(marker.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate));
                        QuestDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                        FirstQuestMarker = false;
                    }
                    else if (marker.SnoActor != null)
                    {
                        if (marker.SnoActor.Code.Contains("_Boss_"))
                        {
                            BossDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                        }
                        else if (marker.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) < 500)
                        {
                            KeywardenDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                        }
                    }
                }
            }


            if (Hud.Game.NumberOfPlayersInGame == 1)
            {
                NameOther3 = string.Empty; Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther3 = string.Empty; StrengthBuff3 = 0;
                NameOther2 = string.Empty; Other2 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther2 = string.Empty; StrengthBuff2 = 0;
                NameOther1 = string.Empty; Other1 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther1 = string.Empty; StrengthBuff1 = 0;
                return;
            }


            // Pools of reflection
            if (Pools)
            {
                var PoolsOfReflection = Hud.Game.Shrines.Where(p => !p.IsDisabled && !p.IsOperated && p.Type == ShrineType.PoolOfReflection);
                //var PoolsOfReflection = Hud.Game.Actors.Where(x => !x.IsDisabled && !x.IsOperated && x.SnoActor.Sno == 373463);

                foreach (var PoolOfReflection in PoolsOfReflection)
                {
                    PoolDecorator.Paint(layer, null, PoolOfReflection.FloorCoordinate, PoolOfReflection.SnoActor.NameLocalized);
                }
            }


            // Strengh in numbers buff indicator
            int StrengthBuff = StrengthBuff1 + StrengthBuff2 + StrengthBuff3;

            if (StrengthBuff != 0 && !Hud.Game.Me.IsDead)
            {
                StrengthBuffText = "+" + StrengthBuff + "%";
                var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.minimap_dialog_backgroundScreen.minimap_dialog_pve.BoostWrapper.BoostsDifficultyStackPanel.clock").Rectangle;
                StrengthBuffDecorator.Paint(uiRect.Left - uiRect.Width * 1.14f, uiRect.Top + uiRect.Height * 1f, uiRect.Width, uiRect.Height, HorizontalAlign.Right);
            }

            // Thread between players
            var players = Hud.Game.Players.Where(player => !player.IsMe).OrderBy(player => player.PortraitIndex);

            if (players != null)
            {
                foreach (var player in players)
                {
                    if (player == null)
                    {
                        continue;
                    }
                    else if (player.BattleTagAbovePortrait == null)
                    {
                        continue;
                    }
                    else if (player.FloorCoordinate == null)
                    {
                        continue;
                    }
                    else if (player.SnoArea == null)
                    {
                        continue;
                    }
                    else if (player.SnoArea.NameEnglish == null)
                    {
                        continue;
                    }
                    else if (double.IsNaN(player.NormalizedXyDistanceToMe))
                    {
                        continue;
                    }
                    else if (player.PortraitIndex == 1)
                    {
                        NameOther1 = player.BattleTagAbovePortrait; RealOther1 = player.FloorCoordinate; AreaOther1 = player.SnoArea.NameEnglish;
                        if (Hud.Game.NumberOfPlayersInGame == 2)
                        {
                            NameOther3 = string.Empty;
                        }
                        Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther3 = string.Empty; StrengthBuff3 = 0; NameOther2 = string.Empty; Other2 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther2 = string.Empty; StrengthBuff2 = 0;
                        if (Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno)
                        {
                            Other1 = player.FloorCoordinate;
                            if (player.NormalizedXyDistanceToMe <= 186 && !player.IsDead)
                            {
                                StrengthBuff1 = 10;
                            }
                            else
                            {
                                StrengthBuff1 = 0;
                            }
                        }
                        else
                        {
                            Other1 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); StrengthBuff1 = 0;
                        }
                    }

                    else if (player.PortraitIndex == 2)
                    {
                        NameOther2 = player.BattleTagAbovePortrait; RealOther2 = player.FloorCoordinate; AreaOther2 = player.SnoArea.NameEnglish;
                        if (Hud.Game.NumberOfPlayersInGame == 3)
                        {
                            NameOther3 = string.Empty;
                        }
                        Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther3 = string.Empty; StrengthBuff3 = 0;
                        if (Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno)
                        {
                            Other2 = player.FloorCoordinate;
                            if (player.NormalizedXyDistanceToMe <= 186 && !player.IsDead)
                            {
                                StrengthBuff2 = 10;
                            }
                            else
                            {
                                StrengthBuff2 = 0;
                            }
                        }
                        else
                        {
                            Other2 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); StrengthBuff2 = 0;
                        }
                    }

                    else if (player.PortraitIndex == 3)
                    {
                        NameOther3 = player.BattleTagAbovePortrait; RealOther3 = player.FloorCoordinate; AreaOther3 = player.SnoArea.NameEnglish;
                        if (Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno)
                        {
                            Other3 = player.FloorCoordinate;
                            if (player.NormalizedXyDistanceToMe <= 186 && !player.IsDead)
                            {
                                StrengthBuff3 = 10;
                            }
                            else
                            {
                                StrengthBuff3 = 0;
                            }
                        }
                        else
                        {
                            Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); StrengthBuff3 = 0;
                        }
                    }
                }
            }

            float Other1OnMapX, Other1OnMapY, Other2OnMapX, Other2OnMapY, Other3OnMapX, Other3OnMapY;

            Hud.Render.GetMinimapCoordinates(Other1.X, Other1.Y, out Other1OnMapX, out Other1OnMapY);
            Hud.Render.GetMinimapCoordinates(Other2.X, Other2.Y, out Other2OnMapX, out Other2OnMapY);
            Hud.Render.GetMinimapCoordinates(Other3.X, Other3.Y, out Other3OnMapX, out Other3OnMapY);

            if (!Hud.Game.IsInTown && ThreadBetweenPlayers)
            {
                WhiteBrush.DrawLine(Other1OnMapX, Other1OnMapY, Other2OnMapX, Other2OnMapY);
                WhiteBrush.DrawLine(Other1OnMapX, Other1OnMapY, Other3OnMapX, Other3OnMapY);
                WhiteBrush.DrawLine(Other3OnMapX, Other3OnMapY, Other2OnMapX, Other2OnMapY);
            }

            // banners
            var banners = Hud.Game.Banners;

            if (banners != null)
            {
                foreach (var banner in banners)
                {
                    if (banner == null || banner.FloorCoordinate == null || !banner.FloorCoordinate.IsValid)
                    {
                        continue;
                    }
                    if (!BannersList.ContainsKey(banner.FloorCoordinate))
                    {
                        BannersList.Add(banner.FloorCoordinate, Hud.Game.CurrentRealTimeMilliseconds);
                    }
                }
            }

            float DistOther1;
            float DistOther2;
            float DistOther3;
            float ZDistOther1;
            float ZDistOther2;
            float ZDistOther3;
            float DistMe;
            float ZDistMe;

            if (BannersList != null)
            {
                foreach (var ListedBanner in BannersList.Where(b => Hud.Game.CurrentRealTimeMilliseconds < b.Value + 30000).OrderBy(b => b.Value).Take(5))
                {
                    var    BanCoord  = ListedBanner.Key;
                    long   Timeleft  = ((ListedBanner.Value + (BannerTimeSeconds * 1000) - Hud.Game.CurrentRealTimeMilliseconds) / 1000);
                    string Countdown = " " + Timeleft.ToString("f0") + "s";


                    var onScreen = BanCoord.IsOnScreen();
                    if (onScreen)
                    {
                        BannerDecorator.ToggleDecorators <GroundLabelDecorator>(false);
                    }
                    else
                    {
                        BannerDecorator.ToggleDecorators <GroundLabelDecorator>(true);
                    }


                    if (RealOther1 != null && Hud.Game.NumberOfPlayersInGame >= 2)
                    {
                        DistOther1 = RealOther1.XYDistanceTo(BanCoord); ZDistOther1 = RealOther1.ZDiffTo(BanCoord);
                    }
                    else
                    {
                        DistOther1 = float.MaxValue; ZDistOther1 = float.MaxValue;
                    }
                    if (RealOther2 != null && Hud.Game.NumberOfPlayersInGame >= 3)
                    {
                        DistOther2 = RealOther2.XYDistanceTo(BanCoord); ZDistOther2 = RealOther2.ZDiffTo(BanCoord);
                    }
                    else
                    {
                        DistOther2 = float.MaxValue; ZDistOther2 = float.MaxValue;
                    }
                    if (RealOther3 != null && Hud.Game.NumberOfPlayersInGame == 4)
                    {
                        DistOther3 = RealOther3.XYDistanceTo(BanCoord); ZDistOther3 = RealOther3.ZDiffTo(BanCoord);
                    }
                    else
                    {
                        DistOther3 = float.MaxValue; ZDistOther3 = float.MaxValue;
                    }
                    DistMe  = Hud.Game.Me.FloorCoordinate.XYDistanceTo(BanCoord);
                    ZDistMe = Hud.Game.Me.FloorCoordinate.ZDiffTo(BanCoord);

                    string NearestPlayer = string.Empty;
                    string BannerArea    = string.Empty;

                    if (!BannersAreas.ContainsKey(BanCoord))
                    {
                        if (DistOther1 < DistOther2 && DistOther1 < DistOther3 && DistOther1 < DistMe && DistOther1 < 200f && ZDistOther1 < 6f && NameOther1 != null)
                        {
                            NearestPlayer = "banner near " + NameOther1; BannerArea = AreaOther1;
                        }
                        else if (DistOther2 < DistOther1 && DistOther2 < DistOther3 && DistOther2 < DistMe && DistOther2 < 200f && ZDistOther2 < 6f && NameOther2 != null)
                        {
                            NearestPlayer = "banner near " + NameOther2; BannerArea = AreaOther2;
                        }
                        else if (DistOther3 < DistOther1 && DistOther3 < DistOther2 && DistOther3 < DistMe && DistOther3 < 200f && ZDistOther3 < 6f && NameOther3 != null)
                        {
                            NearestPlayer = "banner near " + NameOther3; BannerArea = AreaOther3;
                        }
                        else
                        {
                            NearestPlayer = "banner"; BannerArea = Hud.Game.Me.SnoArea.NameEnglish;
                        }
                    }
                    else
                    {
                        if (DistOther1 < DistOther2 && DistOther1 < DistOther3 && DistOther1 < DistMe && DistOther1 < 200f && ZDistOther1 < 6f && BannersAreas[BanCoord] == AreaOther1 && NameOther1 != null)
                        {
                            NearestPlayer = "banner near " + NameOther1;
                        }
                        else if (DistOther2 < DistOther1 && DistOther2 < DistOther3 && DistOther2 < DistMe && DistOther2 < 200f && ZDistOther2 < 6f && BannersAreas[BanCoord] == AreaOther2 && NameOther2 != null)
                        {
                            NearestPlayer = "banner near " + NameOther2;
                        }
                        else if (DistOther3 < DistOther1 && DistOther3 < DistOther2 && DistOther3 < DistMe && DistOther3 < 200f && ZDistOther3 < 6f && BannersAreas[BanCoord] == AreaOther3 && NameOther3 != null)
                        {
                            NearestPlayer = "banner near " + NameOther3;
                        }
                        else
                        {
                            NearestPlayer = "banner";
                        }
                    }

                    string RealBannerArea = string.Empty;
                    if (!BannersAreas.ContainsKey(BanCoord))
                    {
                        BannersAreas.Add(BanCoord, BannerArea);
                    }
                    else
                    {
                        RealBannerArea = BannersAreas[BanCoord];
                    }
                    bool SameArea = false;
                    if (Hud.Game.Me.SnoArea.NameEnglish == RealBannerArea)
                    {
                        SameArea = true;
                    }
                    else
                    {
                        SameArea = false;
                    }
                    if (!SameArea || Hud.Game.Me.IsInTown)
                    {
                        BannerDecorator.ToggleDecorators <MapShapeDecorator>(false);
                    }
                    else if (SameArea)
                    {
                        BannerDecorator.ToggleDecorators <MapShapeDecorator>(true);
                    }

                    if (NearestPlayer == "banner near ")
                    {
                        NearestPlayer = "banner";
                    }
                    if (RealBannerArea.Contains("[TEMP]"))
                    {
                        RealBannerArea = RealBannerArea.Replace("[TEMP]", string.Empty).Trim();
                    }
                    if (RealBannerArea.Contains("Loot Run"))
                    {
                        RealBannerArea = RealBannerArea.Replace("Loot Run", "Rift").Trim();
                    }

                    if (NearestPlayer != null && RealBannerArea != string.Empty)
                    {
                        if (SameArea)
                        {
                            BannerDecorator.Paint(layer, null, BanCoord, NearestPlayer + Countdown);
                        }
                        else if (NearestPlayer != "banner")
                        {
                            BannerDecorator.Paint(layer, null, BanCoord, NearestPlayer + " in " + RealBannerArea + Environment.NewLine + "teleport!" + Countdown);
                        }
                        else
                        {
                            BannerDecorator.Paint(layer, null, BanCoord, NearestPlayer + " in " + RealBannerArea + Countdown);
                        }
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public void DrawEliteCirclePlugin(WorldLayer layer)
        {
            bool flagNeedShowSteadyAimYard = false;

            if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.DemonHunter)
            {
                var dhSteadyAimBuff = Hud.Game.Me.Powers.GetBuff(Hud.Sno.SnoPowers.DemonHunter_Passive_SteadyAim.Sno);
                if (dhSteadyAimBuff != null)
                {
                    flagNeedShowSteadyAimYard = true;
                }

                //??
            }



            var alivemonsters = Hud.Game.AliveMonsters;
            var goblins       = Hud.Game.AliveMonsters.Where(x => x.SnoMonster.Priority == MonsterPriority.goblin);

            foreach (var monster in goblins)
            {
                GoblinDecorator.Paint(layer, monster, monster.FloorCoordinate, null);
            }
            List <IMonster> monstersElite = new List <IMonster>();

            foreach (var monster in alivemonsters)
            {
                if (monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Rare)
                {
                    monstersElite.Add(monster);
                }
                if (monster.Rarity == ActorRarity.Unique)
                {
                    UniqueDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }

                if (monster.Rarity == ActorRarity.Boss)
                {
                    BossDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                }
            }
            foreach (var monster in monstersElite)
            {
                if (monster.SummonerAcdDynamicId == 0)
                {
                    var currentMonsterHealthPercent = monster.CurHealth * 100.0 / monster.MaxHealth;

                    bool flagIsNotJuggernaut = true;
                    foreach (var snoMonsterAffix in monster.AffixSnoList)
                    {
                        string affixName = null;
                        affixName = snoMonsterAffix.NameLocalized;
                        if (snoMonsterAffix.Affix == MonsterAffix.Juggernaut)
                        {
                            flagIsNotJuggernaut = false;
                        }
                    }
                    if (monster.Rarity == ActorRarity.Rare)
                    {
                        if (flagIsNotJuggernaut)
                        {
                            RareDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                        }
                        else
                        {
                            JuggernautDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                        }
                    }
                    if (monster.Rarity == ActorRarity.Champion)
                    {
                        ChampionDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
                    }

                    var monsterScreenCoordinate = monster.FloorCoordinate.ToScreenCoordinate();

                    if (IsGuardianAlive())
                    {
                        if (flagNeedShowSteadyAimYard)
                        {
                            string yardStr = monster.NormalizedXyDistanceToMe.ToString("0") + "Yard";
                            EliteHealthDecorator.TextFunc = () => yardStr;
                            EliteHealthDecorator.Paint(monsterScreenCoordinate.X, monsterScreenCoordinate.Y - EliteHealthBlockSize, EliteHealthBlockSize, EliteHealthBlockSize, HorizontalAlign.Center);
                        }
                    }
                    else
                    {
                        if (currentMonsterHealthPercent < 40.0)
                        {
                            string monsterHealthPercentStr = "HP:" + currentMonsterHealthPercent.ToString("0.0") + "%";
                            EliteHealthDecorator.TextFunc = () => monsterHealthPercentStr;
                            EliteHealthDecorator.Paint(monsterScreenCoordinate.X, monsterScreenCoordinate.Y - EliteHealthBlockSize, EliteHealthBlockSize, EliteHealthBlockSize, HorizontalAlign.Center);
                        }
                    }
                    if (currentMonsterHealthPercent < 20.0)
                    {
                        Hud.Render.CreateBrush(192, 255, 255, 55, -1).DrawLine(monsterScreenCoordinate.X, monsterScreenCoordinate.Y, Hud.Game.Me.ScreenCoordinate.X, Hud.Game.Me.ScreenCoordinate.Y + 60, 1.0f);
                    }
                }
            }

            bool StrickenActive = false;

            foreach (var StrickenLocation in Hud.Game.Items.Where(x => x.Location == ItemLocation.LeftRing || x.Location == ItemLocation.RightRing || x.Location == ItemLocation.Neck))
            {
                if (StrickenLocation.SocketCount != 1 || StrickenLocation.ItemsInSocket == null)
                {
                    continue;
                }
                var Stricken = StrickenLocation.ItemsInSocket.FirstOrDefault();
                if (Stricken == null)
                {
                    continue;
                }
                if (Stricken.SnoItem.Sno == 3249948847)
                {
                    StrickenActive = true; break;
                }
                else
                {
                    continue;
                }
            }
            if (StrickenActive)
            {
                var Texture = Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.Unique_Gem_018_x1);
                foreach (var monster in monstersElite)
                {
                    if (monster.IsAlive)
                    {
                        var monsterScreenCoordinate = monster.FloorCoordinate.ToScreenCoordinate();
                        Tuple <double, int> valuesOut;
                        if (StrickenMonsterStatus.TryGetValue(monster.AcdId, out valuesOut))
                        {
                            double monHealth  = monster.CurHealth;
                            double prevHealth = valuesOut.Item1;
                            int    prevStacks = valuesOut.Item2;

                            if (prevHealth > monHealth && Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 2) && StrickenMonsterCount == 0 && !StrickenInCooldown)
                            {
                                int Stacks = (int)(prevStacks + 1);
                                Tuple <double, int> updateValues = new Tuple <double, int>(monster.CurHealth, Stacks);
                                StrickenMonsterStatus[monster.AcdId] = updateValues;
                                StrickenMonsterCount++;
                                StrickenInCooldown = true;
                            }

                            else if (!Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 2) && StrickenInCooldown)
                            {
                                StrickenInCooldown   = false;
                                StrickenMonsterCount = 0;
                                if (prevHealth > monHealth)
                                {
                                    int Stacks = (int)(prevStacks);
                                    Tuple <double, int> updateValues = new Tuple <double, int>(monster.CurHealth, Stacks);
                                    StrickenMonsterStatus[monster.AcdId] = updateValues;
                                }
                            }
                            if (prevStacks > 0)
                            {
                                Texture.Draw(monsterScreenCoordinate.X, monsterScreenCoordinate.Y, StrickenPropSquare, StrickenPropSquare);
                                StrickenStackDecorator.TextFunc = () => prevStacks.ToString();
                                StrickenStackDecorator.Paint(monsterScreenCoordinate.X, monsterScreenCoordinate.Y, StrickenPropSquare, StrickenPropSquare, HorizontalAlign.Center);
                            }
                        }
                        else
                        {
                            Tuple <double, int> valuesIn = new Tuple <double, int>(monster.CurHealth, (int)(0));
                            StrickenMonsterStatus.Add(monster.AcdId, valuesIn);
                        }
                    }
                    else
                    {
                        StrickenMonsterStatus.Remove(monster.AcdId);
                    }
                }
            }


            var shrines = Hud.Game.Shrines.Where(s => (s.Type == ShrineType.PoolOfReflection || s.Type == ShrineType.BanditShrine));

            foreach (var shrine in shrines)
            {
                if (shrine.IsDisabled == false && shrine.IsOperated == false)
                {
                    var monsterScreenCoordinate = shrine.FloorCoordinate.ToScreenCoordinate();
                    Hud.Render.CreateBrush(192, 255, 255, 55, -1).DrawLine(monsterScreenCoordinate.X, monsterScreenCoordinate.Y, Hud.Game.Me.ScreenCoordinate.X, Hud.Game.Me.ScreenCoordinate.Y + 60, 1.0f);
                }
            }

            double minDistanceToMe = 999999.0;
            var    oculusActors    = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, Hud.Sno.SnoPowers.OculusRing.Sno) == 1);

            foreach (var actor in oculusActors)
            {
                if (minDistanceToMe > actor.NormalizedXyDistanceToMe)
                {
                    minDistanceToMe = actor.NormalizedXyDistanceToMe;
                }
            }
            foreach (var actor in oculusActors)
            {
                if (minDistanceToMe == actor.NormalizedXyDistanceToMe && actor.NormalizedXyDistanceToMe < 100)
                {
                    var actorScreenCoordinate = actor.FloorCoordinate.ToScreenCoordinate();
                    Hud.Render.CreateBrush(192, 234, 60, 83, -1).DrawLine(actorScreenCoordinate.X, actorScreenCoordinate.Y, Hud.Game.Me.ScreenCoordinate.X, Hud.Game.Me.ScreenCoordinate.Y + 60, 1.0f);


                    //  StrickenStackDecorator.TextFunc = () => ("(" + (int)(actorScreenCoordinate.X) + "," + (int)(actorScreenCoordinate.Y) + ")");
                    //  StrickenStackDecorator.Paint(actorScreenCoordinate.X, actorScreenCoordinate.Y, StrickenPropSquare, StrickenPropSquare, HorizontalAlign.Center);
                }
            }


            foreach (var actor in Hud.Game.Actors)
            {
                switch (actor.SnoActor.Sno)
                {
                case ActorSnoEnum._x1_monsteraffix_teleportmines:
                    if (actor.NormalizedXyDistanceToMe <= 6)
                    {
                        WormholeWarningDecorator.Paint(layer, actor, actor.FloorCoordinate, "Wormhole!");
                    }
                    else
                    {
                        WormholeDecorator.Paint(layer, actor, actor.FloorCoordinate, "Wormhole");
                    }
                    break;
                }
            }



            monstersElite.Clear();
        }
Ejemplo n.º 6
0
        public void PaintWorld(WorldLayer layer)
        {
            DistYards = 0;
            var firstQuestMarker = true;
            var actors           = Hud.Game.Actors.Where(a => _actorList.Contains(a.SnoActor.Sno));

            foreach (var Actor in actors)
            {
                if (Actor == null)
                {
                    continue;
                }
                if (Actor.FloorCoordinate == null)
                {
                    continue;
                }
                if (Actor.IsDisabled || Actor.IsOperated)
                {
                    continue;
                }

                uint   ThatQuest = 0;
                string Name      = string.Empty;
                switch (Actor.SnoActor.Sno)
                {
                case ActorSnoEnum._px_spidercaves_camp_cocoon /*432770*/: Name = "Royal Cocoon"; ThatQuest = 432784; break;

                case ActorSnoEnum._px_wilderness_camp_templarprisoners /*430733*/: Name = "Captured Villager"; ThatQuest = 430723; break;

                case ActorSnoEnum._a2dun_zolt_ibstone_a_portalroulette_mini /*432885*/: Name = "Ancient Device"; ThatQuest = 433025; break;

                case ActorSnoEnum._px_caout_cage_bountycamp /*433051*/: Name = "Caldeum Villager"; ThatQuest = 433053; break;

                case ActorSnoEnum._px_ruins_frost_camp_cage /*435703*/: Name = "Captured Barbarian"; ThatQuest = 436280; break;

                case ActorSnoEnum._px_highlands_camp_resurgentcult_totem /*432259*/: Name = "Triune Monument"; ThatQuest = 432293; break;

                case ActorSnoEnum._px_bounty_death_orb_little /*433246*/: Name = "Death Orb"; ThatQuest = 433256; break;

                case ActorSnoEnum._px_bounty_ramparts_camp_switch /*433385*/: Name = "Catapult Winch"; ThatQuest = 433392; break;

                case ActorSnoEnum._px_bounty_camp_azmodan_fight_spawner /*433295*/: Name = "Demon Gate"; ThatQuest = 433309; break;

                case ActorSnoEnum._x1_westm_necro_jar_of_souls_camp_graveyard /*433316*/: Name = "Death Prison"; ThatQuest = 433339; break;

                case ActorSnoEnum._px_leorics_camp_worthammilitia_ex /*434366*/: Name = "Tortured Wortham Militia"; ThatQuest = 434378; break;

                case ActorSnoEnum._px_bridge_camp_lostpatrol /*433184*/: Name = "Captured Guard"; ThatQuest = 433217; break;

                case ActorSnoEnum._px_bounty_camp_trappedangels /*433124*/: Name = "Bone Cage"; ThatQuest = 433099; break;

                case ActorSnoEnum._px_bounty_camp_hellportals_frame /*433402*/: Name = "Hell Portal"; ThatQuest = 433422; break;

                case ActorSnoEnum._px_oasis_camp_ironwolves /*432331*/: Name = "Captured Iron Wolf"; ThatQuest = 432334; break;

                default: Name = string.Empty; break;
                }
                var quest = Hud.Game.Bounties.FirstOrDefault(x => x.SnoQuest.Sno == ThatQuest);
                if ((quest != null) && quest.State != QuestState.completed)
                {
                    QuestDecorator.Paint(layer, null, Actor.FloorCoordinate, Name);
                    firstQuestMarker = false;
                }
            }

            // Pools of reflection
            if (Pools)
            {
                var PoolsOfReflection = Hud.Game.Shrines.Where(p => !p.IsDisabled && !p.IsOperated && p.Type == ShrineType.PoolOfReflection);

                foreach (var PoolOfReflection in PoolsOfReflection)
                {
                    PoolDecorator.Paint(layer, null, PoolOfReflection.FloorCoordinate, PoolOfReflection.SnoActor.NameLocalized);
                }
            }

            // modified Xenthalon's AdvancedMarkerPlugin
            var markers = Hud.Game.Markers.OrderBy(i => Hud.Game.Me.FloorCoordinate.XYDistanceTo(i.FloorCoordinate));

            if (markers != null)
            {
                foreach (var marker in markers)
                {
                    if (marker == null)
                    {
                        continue;
                    }
                    if (marker.FloorCoordinate == null)
                    {
                        continue;
                    }
                    if (marker.Name == null)
                    {
                        continue;
                    }

                    var OnScreen = marker.FloorCoordinate.IsOnScreen(1);
                    QuestDecorator.ToggleDecorators <GroundLabelDecorator>(!OnScreen); // do not display ground labels when the marker is on the screen
                    KeywardenDecorator.ToggleDecorators <GroundLabelDecorator>(!OnScreen);
                    BossDecorator.ToggleDecorators <GroundLabelDecorator>(!OnScreen);

                    if (marker.SnoQuest != null && firstQuestMarker)
                    {
                        DistYards = (int)(marker.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate));
                        QuestDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                        firstQuestMarker = false;
                    }
                    else if (marker.SnoActor != null)
                    {
                        if (marker.SnoActor.Code.Contains("_Boss_"))
                        {
                            BossDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                        }
                        else if (marker.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) < 500)
                        {
                            KeywardenDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
                        }
                    }
                }
            }

            if (Hud.Game.NumberOfPlayersInGame == 1)
            {
                NameOther3 = string.Empty; Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther3 = string.Empty;
                NameOther2 = string.Empty; Other2 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther2 = string.Empty;
                NameOther1 = string.Empty; Other1 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther1 = string.Empty;
                return;
            }

            // Strengh in numbers buff indicator
            var SiNBuff      = Hud.Game.Me.Powers.GetBuff(258199);
            int StrengthBuff = SiNBuff.IconCounts[0] * 10;

            if (StrengthBuff != 0 && !Hud.Game.Me.IsDead)
            {
                StrengthBuffText = "+" + StrengthBuff + "%";
                var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.minimap_dialog_backgroundScreen.minimap_dialog_pve.BoostWrapper.BoostsDifficultyStackPanel.clock").Rectangle;
                if (Hud.Game.Me.Hero.Seasonal)
                {
                    StrengthBuffDecorator.Paint(uiRect.Left - uiRect.Width * 1.14f, uiRect.Top + uiRect.Height * 1f, uiRect.Width, uiRect.Height, HorizontalAlign.Right);
                }
                else
                {
                    StrengthBuffDecorator.Paint(uiRect.Left - uiRect.Width * 0.96f, uiRect.Top + uiRect.Height * 1f, uiRect.Width, uiRect.Height, HorizontalAlign.Right);
                }
            }

            // Thread between players
            var players = Hud.Game.Players.Where(player => !player.IsMe).OrderBy(player => player.PortraitIndex);

            if (players != null)
            {
                foreach (var player in players)
                {
                    if (player == null)
                    {
                        continue;
                    }
                    else if (player.BattleTagAbovePortrait == null)
                    {
                        continue;
                    }
                    else if (player.FloorCoordinate == null)
                    {
                        continue;
                    }
                    else if (player.SnoArea == null)
                    {
                        continue;
                    }
                    else if (player.SnoArea.NameEnglish == null)
                    {
                        continue;
                    }
                    else if (double.IsNaN(player.NormalizedXyDistanceToMe))
                    {
                        continue;
                    }
                    else if (player.PortraitIndex == 1)
                    {
                        NameOther1 = player.BattleTagAbovePortrait; RealOther1 = player.FloorCoordinate; AreaOther1 = player.SnoArea.NameEnglish;
                        if (Hud.Game.NumberOfPlayersInGame == 2)
                        {
                            NameOther3 = string.Empty;
                        }
                        Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther3 = string.Empty; NameOther2 = string.Empty; Other2 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther2 = string.Empty;
                        if (Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && player.CoordinateKnown)
                        {
                            Other1 = player.FloorCoordinate;
                        }
                        else
                        {
                            Other1 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate);
                        }
                    }
                    else if (player.PortraitIndex == 2)
                    {
                        NameOther2 = player.BattleTagAbovePortrait; RealOther2 = player.FloorCoordinate; AreaOther2 = player.SnoArea.NameEnglish;
                        if (Hud.Game.NumberOfPlayersInGame == 3)
                        {
                            NameOther3 = string.Empty;
                        }
                        Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate); AreaOther3 = string.Empty;
                        if (Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && player.CoordinateKnown)
                        {
                            Other2 = player.FloorCoordinate;
                        }
                        else
                        {
                            Other2 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate);
                        }
                    }
                    else if (player.PortraitIndex == 3)
                    {
                        NameOther3 = player.BattleTagAbovePortrait; RealOther3 = player.FloorCoordinate; AreaOther3 = player.SnoArea.NameEnglish;
                        if (Hud.Game.Me.SnoArea.Sno == player.SnoArea.Sno && player.CoordinateKnown)
                        {
                            Other3 = player.FloorCoordinate;
                        }
                        else
                        {
                            Other3 = Hud.Window.CreateWorldCoordinate(Hud.Game.Me.FloorCoordinate);
                        }
                    }
                }
            }

            Hud.Render.GetMinimapCoordinates(Other1.X, Other1.Y, out float Other1OnMapX, out float Other1OnMapY);
            Hud.Render.GetMinimapCoordinates(Other2.X, Other2.Y, out float Other2OnMapX, out float Other2OnMapY);
            Hud.Render.GetMinimapCoordinates(Other3.X, Other3.Y, out float Other3OnMapX, out float Other3OnMapY);

            if (!Hud.Game.IsInTown && ThreadBetweenPlayers)
            {
                WhiteBrush.DrawLine(Other1OnMapX, Other1OnMapY, Other2OnMapX, Other2OnMapY);
                WhiteBrush.DrawLine(Other1OnMapX, Other1OnMapY, Other3OnMapX, Other3OnMapY);
                WhiteBrush.DrawLine(Other3OnMapX, Other3OnMapY, Other2OnMapX, Other2OnMapY);
            }

            // banners
            var banners = Hud.Game.Banners;

            if (banners != null)
            {
                foreach (var banner in banners)
                {
                    if (banner == null || banner.FloorCoordinate == null || !banner.FloorCoordinate.IsValid)
                    {
                        continue;
                    }
                    if (!BannersList.ContainsKey(banner.FloorCoordinate))
                    {
                        BannersList.Add(banner.FloorCoordinate, Hud.Game.CurrentRealTimeMilliseconds);
                    }
                }
            }

            float DistOther1;
            float DistOther2;
            float DistOther3;
            float ZDistOther1;
            float ZDistOther2;
            float ZDistOther3;
            float DistMe;
            float ZDistMe;

            if (BannersList != null)
            {
                foreach (var ListedBanner in BannersList.Where(b => Hud.Game.CurrentRealTimeMilliseconds < b.Value + 30000).OrderBy(b => b.Value).Take(5))
                {
                    var    BanCoord  = ListedBanner.Key;
                    long   Timeleft  = ((ListedBanner.Value + (BannerTimeSeconds * 1000) - Hud.Game.CurrentRealTimeMilliseconds) / 1000);
                    string Countdown = " " + Timeleft.ToString("f0") + "s";

                    var onScreen = BanCoord.IsOnScreen();
                    if (onScreen)
                    {
                        BannerDecorator.ToggleDecorators <GroundLabelDecorator>(false);
                    }
                    else
                    {
                        BannerDecorator.ToggleDecorators <GroundLabelDecorator>(true);
                    }

                    if (RealOther1 != null && Hud.Game.NumberOfPlayersInGame >= 2)
                    {
                        DistOther1 = RealOther1.XYDistanceTo(BanCoord); ZDistOther1 = RealOther1.ZDiffTo(BanCoord);
                    }
                    else
                    {
                        DistOther1 = float.MaxValue; ZDistOther1 = float.MaxValue;
                    }
                    if (RealOther2 != null && Hud.Game.NumberOfPlayersInGame >= 3)
                    {
                        DistOther2 = RealOther2.XYDistanceTo(BanCoord); ZDistOther2 = RealOther2.ZDiffTo(BanCoord);
                    }
                    else
                    {
                        DistOther2 = float.MaxValue; ZDistOther2 = float.MaxValue;
                    }
                    if (RealOther3 != null && Hud.Game.NumberOfPlayersInGame == 4)
                    {
                        DistOther3 = RealOther3.XYDistanceTo(BanCoord); ZDistOther3 = RealOther3.ZDiffTo(BanCoord);
                    }
                    else
                    {
                        DistOther3 = float.MaxValue; ZDistOther3 = float.MaxValue;
                    }
                    DistMe  = Hud.Game.Me.FloorCoordinate.XYDistanceTo(BanCoord);
                    ZDistMe = Hud.Game.Me.FloorCoordinate.ZDiffTo(BanCoord);

                    string NearestPlayer = string.Empty;
                    string BannerArea    = string.Empty;

                    if (!BannersAreas.ContainsKey(BanCoord))
                    {
                        if (DistOther1 < DistOther2 && DistOther1 < DistOther3 && DistOther1 < DistMe && DistOther1 < 200f && ZDistOther1 < 6f && NameOther1 != null)
                        {
                            NearestPlayer = "banner near " + NameOther1; BannerArea = AreaOther1;
                        }
                        else if (DistOther2 < DistOther1 && DistOther2 < DistOther3 && DistOther2 < DistMe && DistOther2 < 200f && ZDistOther2 < 6f && NameOther2 != null)
                        {
                            NearestPlayer = "banner near " + NameOther2; BannerArea = AreaOther2;
                        }
                        else if (DistOther3 < DistOther1 && DistOther3 < DistOther2 && DistOther3 < DistMe && DistOther3 < 200f && ZDistOther3 < 6f && NameOther3 != null)
                        {
                            NearestPlayer = "banner near " + NameOther3; BannerArea = AreaOther3;
                        }
                        else
                        {
                            NearestPlayer = "banner"; BannerArea = Hud.Game.Me.SnoArea.NameEnglish;
                        }
                    }
                    else
                    {
                        if (DistOther1 < DistOther2 && DistOther1 < DistOther3 && DistOther1 < DistMe && DistOther1 < 200f && ZDistOther1 < 6f && BannersAreas[BanCoord] == AreaOther1 && NameOther1 != null)
                        {
                            NearestPlayer = "banner near " + NameOther1;
                        }
                        else if (DistOther2 < DistOther1 && DistOther2 < DistOther3 && DistOther2 < DistMe && DistOther2 < 200f && ZDistOther2 < 6f && BannersAreas[BanCoord] == AreaOther2 && NameOther2 != null)
                        {
                            NearestPlayer = "banner near " + NameOther2;
                        }
                        else if (DistOther3 < DistOther1 && DistOther3 < DistOther2 && DistOther3 < DistMe && DistOther3 < 200f && ZDistOther3 < 6f && BannersAreas[BanCoord] == AreaOther3 && NameOther3 != null)
                        {
                            NearestPlayer = "banner near " + NameOther3;
                        }
                        else
                        {
                            NearestPlayer = "banner";
                        }
                    }

                    string RealBannerArea = string.Empty;
                    if (!BannersAreas.ContainsKey(BanCoord))
                    {
                        BannersAreas.Add(BanCoord, BannerArea);
                    }
                    else
                    {
                        RealBannerArea = BannersAreas[BanCoord];
                    }
                    bool SameArea = false;
                    if (Hud.Game.Me.SnoArea.NameEnglish == RealBannerArea)
                    {
                        SameArea = true;
                    }
                    else
                    {
                        SameArea = false;
                    }
                    if (!SameArea || Hud.Game.Me.IsInTown)
                    {
                        BannerDecorator.ToggleDecorators <MapShapeDecorator>(false);
                    }
                    else if (SameArea)
                    {
                        BannerDecorator.ToggleDecorators <MapShapeDecorator>(true);
                    }

                    if (NearestPlayer == "banner near ")
                    {
                        NearestPlayer = "banner";
                    }
                    if (RealBannerArea.Contains("[TEMP]"))
                    {
                        RealBannerArea = RealBannerArea.Replace("[TEMP]", string.Empty).Trim();
                    }
                    if (RealBannerArea.Contains("Loot Run"))
                    {
                        RealBannerArea = RealBannerArea.Replace("Loot Run", "Rift").Trim();
                    }

                    if (NearestPlayer != null && RealBannerArea != string.Empty)
                    {
                        if (SameArea)
                        {
                            BannerDecorator.Paint(layer, null, BanCoord, NearestPlayer + Countdown);
                        }
                        else if (NearestPlayer != "banner")
                        {
                            BannerDecorator.Paint(layer, null, BanCoord, NearestPlayer + " in " + RealBannerArea + Environment.NewLine + "teleport!" + Countdown);
                        }
                        else
                        {
                            BannerDecorator.Paint(layer, null, BanCoord, NearestPlayer + " in " + RealBannerArea + Countdown);
                        }
                    }
                }
            }
        }