示例#1
0
        public void PaintWorld(WorldLayer layer)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            var x = Hud.Window.Size.Width * 0.47f;
            var y = Hud.Window.Size.Height * 0.015f;

            textBuilder.Clear();
            int CursableCount = 0;
            var monsters      = Hud.Game.AliveMonsters.Where(m => m.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 40);

            foreach (var monster in monsters)
            {
                if (monster.CurHealth <= monster.MaxHealth * 0.18)
                {
                    CursableCount++;
                }
            }
            if (CursableCount > 0)
            {
                textBuilder.AppendFormat("Cursable inside");
                textBuilder.AppendLine();
            }
            var layout = RedFont.GetTextLayout(textBuilder.ToString());

            RedFont.DrawText(layout, x, y);
        }
        private void DrawHealthBar(WorldLayer layer, IMonster m, ref float yref)
        {
            var    w      = m.CurHealth * w2 / m.MaxHealth;
            var    per    = LightFont.GetTextLayout((m.CurHealth * 100 / m.MaxHealth).ToString(PercentageDescriptor) + "%");
            var    y      = YPos + py * 8 * yref;
            IBrush cBrush = null;
            IFont  cFont  = null;

            //Brush selection
            switch (m.Rarity)
            {
            case ActorRarity.Boss:
                cBrush = BossBrush;
                break;

            case ActorRarity.Champion:
                cBrush = ChampionBrush;
                break;

            case ActorRarity.Rare:
                cBrush = RareBrush;
                break;

            case ActorRarity.RareMinion:
                cBrush = RareMinionBrush;
                break;

            default:
                cBrush = BackgroundBrush;
                break;
            }

            //Jugger Highlight
            if (JuggernautHighlight && m.Rarity == ActorRarity.Rare && HasAffix(m, MonsterAffix.Juggernaut))
            {
                cFont  = RedFont;
                cBrush = RareJuggerBrush;
            }
            else
            {
                cFont = NameFont;
            }


            //Draw Rectangles
            BackgroundBrush.DrawRectangle(XPos, y, w2, h);
            BorderBrush.DrawRectangle(XPos, y, w2, h);
            cBrush.DrawRectangle(XPos, y, (float)w, h);
            LightFont.DrawText(per, XPos + 8 + w2, y - py);

            //Draw MonsterType
            if (ShowMonsterType)
            {
                var name = cFont.GetTextLayout(m.SnoMonster.NameLocalized);
                cFont.DrawText(name, XPos + 3, y - py);
            }

            //increase linecount
            yref += 1.0f;
        }
示例#3
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            var x = Hud.Window.Size.Width * 0.7f;
            var y = Hud.Window.Size.Height * 0.01f;

            double boneringer = 0;
            var    actors     = Hud.Game.Actors.Where(a => a.SnoActor.Sno == ActorSnoEnum._p6_necro_commandskeletons_d);

            if (actors.Count() > 0)
            {
                boneringer = actors.First().GetAttributeValue(Hud.Sno.Attributes.Multiplicative_Damage_Percent_Bonus, uint.MaxValue);
            }
            if (boneringer >= 2.4)
            {
                textBuilder.Clear();

                var BoneRingerCalc1 = boneringer / 1.5f;      // Command Multiplier
                var BoneRingerCalc2 = BoneRingerCalc1 / 1.6f; // Enforcer Multiplier
                var BoneRingerCalc3 = BoneRingerCalc2 - 1f;
                var BoneRingerTime  = BoneRingerCalc3 * 100f / 30.0;

                textBuilder.AppendFormat("{0:0.00}", BoneRingerTime);
                textBuilder.AppendLine();

                var layout = GreenFont.GetTextLayout(textBuilder.ToString());
                GreenFont.DrawText(layout, x, y);
            }
        }
示例#4
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            watermark.DrawText(watermark.GetTextLayout("pHelper"), 4, Hud.Window.Size.Height * 0.966f);
        }
示例#5
0
        public void Paint(IBuff buff)
        {
            if ((buff == null) || (buff.IconCounts[0] <= 0))
            {
                return;
            }
            var cooldown   = buff.TimeLeftSeconds[1].ToString("F");
            var textLayout = _centreFont.GetTextLayout(cooldown);
            var x          = (_hud.Window.Size.Width - (float)Math.Ceiling(textLayout.Metrics.Width)) / 2;
            var y          = (_hud.Window.Size.Height - textLayout.Metrics.Height) / 2;

            //_centreFont.DrawText(buff.TimeLeftSeconds[1].ToString("F"), x, y);
            _centreFont.DrawText(buff.TimeLeftSeconds.Length.ToString(), x, y);
        }
示例#6
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Game.SpecialArea != SpecialArea.GreaterRift)
            {
                return;
            }
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            var ui = Hud.Render.GreaterRiftBarUiElement;

            if (!ui.Visible)
            {
                return;
            }

            var secondsLeft = (Hud.Game.CurrentTimedEventEndTick - (double)Hud.Game.CurrentGameTick) / 60.0d;
            var percent     = Hud.Game.RiftPercentage;

            if (!(secondsLeft > 0))
            {
                return;
            }

            string text;
            var    _x       = 9000000000 / ui.Rectangle.Width;
            var    currentX = ui.Rectangle.Left + ui.Rectangle.Width / 100.0f * percent;
            var    timeX    = ui.Rectangle.Right - (float)(ui.Rectangle.Width / 900.0f * secondsLeft);
            var    _time    = (currentX - timeX) * _x;

            if (_time <= 0)
            {
                text        = "- " + ValueToString((long)_time, ValueFormat.LongTime);
                currentFont = MalusTimeFont;
            }
            else
            {
                text        = "+ " + ValueToString((long)_time, ValueFormat.LongTime);
                currentFont = BonusTimeFont;
            }

            var textLayout = currentFont.GetTextLayout(text);
            var x          = (float)currentX - textLayout.Metrics.Width / 2;
            var y          = ui.Rectangle.Top - ui.Rectangle.Height * 0.1f - textLayout.Metrics.Height;

            currentFont.DrawText(textLayout, x, y);
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if (!IsGreaterRift)
            {
                return;
            }

            var ui = Hud.Render.GreaterRiftBarUiElement;

            if (ui == null || !ui.Visible)
            {
                return;
            }
            var secondsElapsed = riftQuest.StartedOn.ElapsedMilliseconds;
            var percent        = (float)Hud.Game.RiftPercentage;

            if (secondsElapsed > greaterriftMaxTimeMilliseconds)
            {
                return;
            }

            string text;
            var    _myTime_ms   = percent * 9000f - secondsElapsed - pauseTimer.ElapsedMilliseconds;
            var    _myTime_span = TimeSpan.FromMilliseconds(_myTime_ms);

            if (_myTime_ms <= 0)
            {
                text        = "- " + String.Format(CultureInfo.InvariantCulture, MinutesSecondsFormat, _myTime_span);
                currentFont = MalusTimeFont;
            }
            else
            {
                text        = "+ " + String.Format(CultureInfo.InvariantCulture, MinutesSecondsFormat, _myTime_span);
                currentFont = BonusTimeFont;
            }

            var textLayout = currentFont.GetTextLayout(text);
            var x          = ui.Rectangle.Left + ui.Rectangle.Width / 100.0f * percent - textLayout.Metrics.Width / 2;
            var y          = ui.Rectangle.Top - ui.Rectangle.Height * 0.1f - textLayout.Metrics.Height;

            currentFont.DrawText(textLayout, x, y);
        }
示例#8
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            float x = Hud.Window.Size.Width * 0.75f;
            float y = Hud.Window.Size.Height * 0.01f;

            BKIngame = false;
            foreach (var player in Hud.Game.Players)//others
            {
                if (player.HeroClassDefinition.HeroClass == HeroClass.Necromancer)
                {
                    var Nayrs = player.Powers.GetBuff(476587);
                    if (!(Nayrs == null || !Nayrs.Active))
                    {
                        BKIngame = true;
                        textBuilder.Clear();
                        textBuilder.AppendFormat("{0:0.00}", Nayrs.TimeLeftSeconds[1]);
                        textBuilder.AppendLine();
                        textBuilder.AppendFormat("{0:0.00}", Nayrs.TimeLeftSeconds[2]);
                        textBuilder.AppendLine();
                        textBuilder.AppendFormat("{0:0.00}", Nayrs.TimeLeftSeconds[3]);
                        textBuilder.AppendLine();
                        textBuilder.AppendFormat("{0:0.00}", Nayrs.TimeLeftSeconds[4]);
                        textBuilder.AppendLine();
                        textBuilder.AppendFormat("{0:0.00}", Nayrs.TimeLeftSeconds[5]);
                        textBuilder.AppendLine();
                        textBuilder.AppendFormat("{0:0.00}", Nayrs.TimeLeftSeconds[6]);
                        textBuilder.AppendLine();//rat
                    }
                }
            }

            if (BKIngame)
            {
                var layout = GreenFont.GetTextLayout(textBuilder.ToString());
                GreenFont.DrawText(layout, x, y);
            }
        }
示例#9
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            if (Hud.Game.SpecialArea != SpecialArea.GreaterRift)
            {
                return;
            }
            var  bosses      = Hud.Game.AliveMonsters.Where(m => m.Rarity == ActorRarity.Boss);
            bool BossSpawned = false;

            foreach (IMonster m in bosses)
            {
                BossSpawned = true;
                foreach (var bosstimer in BossTimers)
                {
                    if (m.SnoMonster.NameEnglish == "Ember")
                    {
                        var healthpercent = (m.CurHealth / m.MaxHealth);
                        if (healthpercent > 0.5)
                        {
                            bosstimer.Duration = 7.5;
                        }
                        else
                        {
                            bosstimer.Duration = 4.0;
                        }
                    }
                    else if (m.SnoMonster.NameEnglish == "Stonesinger")
                    {
                        if (bosstimer.Animation == AnimSnoEnum._sandmonsterblack_attack_03_sandwall)
                        {
                            var healthpercent = (m.CurHealth / m.MaxHealth);
                            bosstimer.Duration = 12.0 * healthpercent + 5.5 * (1 - healthpercent);
                        }
                    }
                    else if (m.SnoMonster.NameEnglish == "Bone Warlock")
                    {
                        if (bosstimer.Name == "Wormhole")
                        {
                            bosstimer.Duration = 16.0;
                            var wormhole = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._x1_monsteraffix_teleportmines); // 337109
                            if (wormhole.Count() > 0)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 7)
                                {
                                    //DebugtextBuilder.Append(bosstimer.Name);
                                    //DebugtextBuilder.Append(" ");
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.Timer = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                    }
                    else if (m.SnoMonster.NameEnglish == "Orlash")
                    {
                        if (m.Animation == AnimSnoEnum._terrordemon_generic_cast && bosstimer.Name == "Orlash Summon")
                        {
                            var Clones = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._x1_lr_boss_terrordemon_a_breathminion); // 337109
                            if (Clones.Count() <= 1)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 8)
                                {
                                    //DebugtextBuilder.Append(bosstimer.Name);
                                    //DebugtextBuilder.Append(" ");
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.Timer = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                        else if (m.Animation == AnimSnoEnum._terrordemon_attack_firebreath && bosstimer.Name == "Lightning Breath")
                        {
                            var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                            if (TimeElapsed > 6)
                            {
                                //DebugtextBuilder.Append(bosstimer.Name);
                                //DebugtextBuilder.Append(" ");
                                //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                //DebugtextBuilder.AppendLine();
                                bosstimer.Timer = Hud.Game.CurrentGameTick;
                            }
                        }
                    }
                    else if (m.SnoMonster.NameEnglish == "Bloodmaw")
                    {
                        if (m.Animation == bosstimer.Animation && bosstimer.Animation == AnimSnoEnum._x1_westmarchbrute_attack_02_out)
                        {
                            var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                            if (TimeElapsed > 7)
                            {
                                //DebugtextBuilder.Append(bosstimer.Name);
                                //DebugtextBuilder.Append(" ");
                                //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                //DebugtextBuilder.AppendLine();
                                //DebugtextBuilder.AppendLine();
                            }
                            bosstimer.Timer = Hud.Game.CurrentGameTick;
                        }
                        if (m.Animation == AnimSnoEnum._x1_westmarchbrute_taunt && bosstimer.Animation == AnimSnoEnum._x1_westmarchbrute_attack_02_out)
                        {
                            var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                            if (TimeElapsed > 7)
                            {
                                //DebugtextBuilder.Append(bosstimer.Name);
                                //DebugtextBuilder.Append(" ");
                                //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                //DebugtextBuilder.AppendLine();
                                //DebugtextBuilder.AppendLine();
                            }
                            bosstimer.Timer = Hud.Game.CurrentGameTick;
                        }

                        /*if (m.Animation == bosstimer.Animation && bosstimer.Animation == AnimSnoEnum._x1_westmarchbrute_taunt)
                         * {
                         *  var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                         *  if (TimeElapsed > 4)
                         *  {
                         *      DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                         *      DebugtextBuilder.AppendLine();
                         *      bosstimer.LastTimer = bosstimer.Timer;
                         *      bosstimer.Timer = Hud.Game.CurrentGameTick;
                         *  }
                         * }*/
                    }
                    else if (m.SnoMonster.NameEnglish == "Rime")
                    {
                        if (bosstimer.Name == "Small Fields")
                        {
                            var Circles = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._x1_unique_monster_generic_aoe_dot_cold_10foot); // 337109
                            if (Circles.Count() > 0)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 7)
                                {
                                    //DebugtextBuilder.Append(bosstimer.Name);
                                    //DebugtextBuilder.Append(" ");
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.Timer = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                    }
                    else if (m.SnoMonster.NameEnglish == "Perendi")
                    {
                        if (bosstimer.Animation == 0 && bosstimer.Name == "Cave In")
                        {
                            var Circles = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._x1_lr_boss_malletdemon_fallingrocks);
                            if (Circles.Count() > 0)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 5)
                                {
                                    //DebugtextBuilder.Append(bosstimer.Name);
                                    //DebugtextBuilder.Append(" ");
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.Timer = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                    }
                    else if (m.SnoMonster.NameEnglish == "Blighter")
                    {
                        if (bosstimer.Animation == 0 && bosstimer.Name == "Good Attack")
                        {
                            var Attack = m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_5_Visual_Effect_None, 429291);
                            if (Attack > 0)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 10)
                                {
                                    //DebugtextBuilder.Append(bosstimer.Name);
                                    //DebugtextBuilder.Append(" ");
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.Timer = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                        else if (bosstimer.Animation == 0 && bosstimer.Name == "Bad Attack")
                        {
                            var Attack = m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_5_Visual_Effect_None, 309921);
                            if (Attack > 0)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 10)
                                {
                                    //DebugtextBuilder.Append(bosstimer.Name);
                                    //DebugtextBuilder.Append(" ");
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.Timer = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                        else if (bosstimer.Animation == 0 && bosstimer.Name == "Line Attack")
                        {
                            var Attack = m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_5_Visual_Effect_None, 429077);
                            if (Attack > 0)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 10)
                                {
                                    //DebugtextBuilder.Append(bosstimer.Name);
                                    //DebugtextBuilder.Append(" ");
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.Timer = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                    }
                    else if (m.SnoMonster.NameEnglish == "Man Carver")
                    {
                        if (bosstimer.Name == "Ground Effect")
                        {
                            var Circles = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._x1_unique_monster_generic_aoe_dot_fire_10foot);
                            if (Circles.Count() > 0)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 15)
                                {
                                    //DebugtextBuilder.Append(bosstimer.Name);
                                    //DebugtextBuilder.Append(" ");
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.Timer = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                        else if (bosstimer.Name == "Heavy Smash")
                        {
                            if (m.Animation == AnimSnoEnum._butcher_attack_05_telegraph)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 6)
                                {
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.LastTimer = bosstimer.Timer;
                                    bosstimer.Timer     = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                    }
                    else if (m.SnoMonster.NameEnglish == "Erethon")
                    {
                        if (bosstimer.Name == "Poison Circle")
                        {
                            var Circles = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy);
                            if (Circles.Count() > 0)
                            {
                                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                                if (TimeElapsed > 7)
                                {
                                    //DebugtextBuilder.Append(bosstimer.Name);
                                    //DebugtextBuilder.Append(" ");
                                    //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                                    //DebugtextBuilder.AppendLine();
                                    bosstimer.Timer = Hud.Game.CurrentGameTick;
                                }
                            }
                        }
                    }
                    else if (m.SnoMonster.NameEnglish == "Raiziel")
                    {
                        if (m.Animation == AnimSnoEnum._x1_sniperangel_firebomb_01)
                        {
                            var healthpercent = (m.CurHealth / m.MaxHealth);
                            if (healthpercent > 0.75)
                            {
                                bosstimer.Duration = 7.5;
                            }
                            else
                            {
                                bosstimer.Duration = 4.0;
                            }
                        }
                    }

                    if (m.Animation == bosstimer.Animation && bosstimer.Animation != 0)
                    {
                        var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                        if (TimeElapsed > 4)
                        {
                            //DebugtextBuilder.Append(bosstimer.Name);
                            //DebugtextBuilder.Append(" ");
                            //DebugtextBuilder.Append((Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d);
                            //DebugtextBuilder.AppendLine();
                            bosstimer.LastTimer = bosstimer.Timer;
                            bosstimer.Timer     = Hud.Game.CurrentGameTick;
                        }
                    }
                }
            }
            if (!BossSpawned)
            {
                return;
            }
            float ydelta = Hud.Window.Size.Height * 0.03f;
            int   i      = 0;

            foreach (var bosstimer in BossTimers)
            {
                var TimeElapsed = (Hud.Game.CurrentGameTick - bosstimer.Timer) / 60.0d;
                if (TimeElapsed > 0 && TimeElapsed < 120.0d)
                {
                    textBuilder.Clear();
                    textBuilder.AppendFormat("{0:0}", TimeElapsed);

                    if (TimeElapsed > bosstimer.Duration)
                    {
                        TimeElapsed = bosstimer.Duration;
                    }

                    float x     = Hud.Window.Size.Width * 0.14f;
                    float y     = Hud.Window.Size.Height * 0.05f;
                    float sizex = Hud.Window.Size.Width * 0.16f;
                    float sizey = Hud.Window.Size.Height * 0.02f;
                    float textx = Hud.Window.Size.Width * (0.14f + 0.498f - 0.42f);
                    float texty = Hud.Window.Size.Height * (0.05f + 0.111f - 0.11f);

                    y     += i * ydelta;
                    texty += i * ydelta;

                    BackgroundBrush.DrawRectangle(x, y, sizex, sizey);
                    BarBrush.DrawRectangle(x, y, sizex * (float)(TimeElapsed / bosstimer.Duration), sizey);
                    //BorderBrush.DrawLine(x, y, x + sizex, y, 0.6f);
                    BorderBrush.DrawLine(x + sizex, y, x + sizex, y + sizey, BorderSize);
                    //BorderBrush.DrawLine(x, y + sizey, x + sizex, y + sizey, BorderSize);
                    //BorderBrush.DrawLine(x, y, x, y + sizey, 0.6f);

                    var layout = GreenFont.GetTextLayout(textBuilder.ToString());
                    GreenFont.DrawText(layout, textx, texty);

                    textBuilder.Clear();
                    textBuilder.Append(bosstimer.Name);

                    var layout2 = GreenFont.GetTextLayout(textBuilder.ToString());
                    GreenFont.DrawText(layout2, x, texty);


                    //var layout3 = GreenFont.GetTextLayout(DebugtextBuilder.ToString());
                    //GreenFont.DrawText(layout3, Hud.Window.Size.Width * 0.35f, Hud.Window.Size.Height * (0.05f + 0.111f - 0.11f));
                    i++;
                }
            }
        }
示例#10
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            float x = Hud.Window.Size.Width * 0.7f;
            float y = Hud.Window.Size.Height * 0.01f;

            textBuilder.Clear();
            WizIngame = false;
            foreach (var player in Hud.Game.Players)
            {
                if (player.HeroClassDefinition.HeroClass == HeroClass.Wizard)
                {
                    WizIngame = true;
                    foreach (var i in _skillOrder)
                    {
                        var skill = player.Powers.SkillSlots[i];
                        if (skill == null || skill.SnoPower.Sno != 134872)
                        {
                            continue;                                                //Archon
                        }
                        Cooldown = (skill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60.0d;

                        var buff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Archon.Sno);
                        if (buff != null)
                        {
                            ArchonTimeLeft = buff.TimeLeftSeconds[2];
                        }
                        if (Cooldown < 0)
                        {
                            if (skill.Rune == 3.0)
                            {
                                Cooldown = skill.CalculateCooldown(100) - 20 + ArchonTimeLeft;
                            }
                            else
                            {
                                Cooldown = skill.CalculateCooldown(120) - 20 + ArchonTimeLeft;
                            }


                            if (ArchonTimeLeft == 0)
                            {
                                Cooldown = 0;
                            }
                        }
                        textBuilder.AppendFormat("{0:0.00}", Cooldown);
                    }
                }
            }

            if (WizIngame)
            {
                if (ArchonTimeLeft == 0)
                {
                    var layout = RedFont.GetTextLayout(textBuilder.ToString());
                    RedFont.DrawText(layout, x, y);
                }
                else
                {
                    var layout = GreenFont.GetTextLayout(textBuilder.ToString());
                    GreenFont.DrawText(layout, x, y);
                }
            }
        }
示例#11
0
        private void DrawHealthBar(WorldLayer layer, IMonster m, ref float yref)
        {
            if (m.Rarity == ActorRarity.RareMinion && !ShowRareMinions)
            {
                return;                                                             //no minions
            }
            if (m.SummonerAcdDynamicId != 0)
            {
                return;                                                             //no clones
            }
            var    w      = m.CurHealth * w2 / m.MaxHealth;
            var    per    = LightFont.GetTextLayout((m.CurHealth * 100 / m.MaxHealth).ToString(PercentageDescriptor) + "%");
            var    y      = YPos + py * 8 * yref;
            IBrush cBrush = null;
            IFont  cFont  = null;

            //Brush selection
            switch (m.Rarity)
            {
            case ActorRarity.Boss:
                cBrush = BossBrush;
                break;

            case ActorRarity.Champion:
                cBrush = ChampionBrush;
                break;

            case ActorRarity.Rare:
                cBrush = RareBrush;
                break;

            case ActorRarity.RareMinion:
                cBrush = RareMinionBrush;
                break;

            default:
                cBrush = BackgroundBrush;
                break;
            }

            //Jugger Highlight
            if (JuggernautHighlight && m.Rarity == ActorRarity.Rare && HasAffix(m, MonsterAffix.Juggernaut))
            {
                cFont  = RedFont;
                cBrush = RareJuggerBrush;
            }
            else
            {
                cFont = NameFont;
            }

            //Missing Highlight
            if (MissingHighlight && (m.Rarity == ActorRarity.Champion || m.Rarity == ActorRarity.Rare) && !m.IsOnScreen)
            {
                var missing = RedFont.GetTextLayout("⚠");
                RedFont.DrawText(missing, XPos - 17, y - py);
            }

            //Circle Non-Clones and Boss
            //if (CircleNonIllusion && m.SummonerAcdDynamicId == 0 && HasAffix(m, MonsterAffix.Illusionist) || m.Rarity == ActorRarity.Boss && ShowBossHitBox)
            //        HitBoxDecorator.Paint(layer, m, m.FloorCoordinate, string.Empty);

            //Show Debuffs on Monster
            if (ShowDebuffAndCC)
            {
                string textDebuff = null;
                if (m.Locust)
                {
                    textDebuff += (textDebuff == null ? "" : ", ") + "Locust";
                }
                //if (m.Palmed) textDebuff += (textDebuff == null ? "" : ", ") + "Palm";
                if (m.Haunted)
                {
                    textDebuff += (textDebuff == null ? "" : ", ") + "Haunt";
                }
                if (m.MarkedForDeath)
                {
                    textDebuff += (textDebuff == null ? "" : ", ") + "Mark";
                }
                if (m.Strongarmed)
                {
                    textDebuff += (textDebuff == null ? "" : ", ") + "Strongarm";
                }
                string textCC = null;
                //if (m.Frozen) textCC += (textCC == null ? "" : ", ") + "Frozen";
                //if (m.Chilled) textCC += (textCC == null ? "" : ", ") + "Chill";
                //if (m.Slow) textCC += (textCC == null ? "" : ", ") + "Slow";
                //if (m.Stunned) textCC += (textCC == null ? "" : ", ") + "Stun";
                if (m.Invulnerable)
                {
                    textCC += (textCC == null ? "" : ", ") + "Invulnerable";
                }
                //if (m.Blind) textCC += (textCC == null ? "" : ", ") + "Blind";
                var d = LightFont.GetTextLayout(textDebuff + (textDebuff != null && textCC != null ? " | " : "") + textCC);
                LightFont.DrawText(d, XPos + 65 + w2, y - py);
            }

            //Draw Rectangles
            BackgroundBrush.DrawRectangle(XPos, y, w2, h);
            BorderBrush.DrawRectangle(XPos, y, w2, h);
            cBrush.DrawRectangle(XPos, y, (float)w, h);
            LightFont.DrawText(per, XPos + 8 + w2, y - py);

            //Draw MonsterType
            if (ShowMonsterType)
            {
                var name = cFont.GetTextLayout(m.SnoMonster.NameLocalized);
                cFont.DrawText(name, XPos + 3, y - py);
            }

            //increase linecount
            yref += 1.0f;
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            var inRift = Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift;
            var inGR   = Hud.Game.SpecialArea == SpecialArea.GreaterRift;

            if (DefaultTextFont == null)
            {
                return;
            }

            double totalMonsterRiftProgression = 0;
            double TrashMonsterRiftProgression = 0;
            double EliteProgression            = 0;
            double RareMinionProgression       = 0;
            double RiftGlobeProgression        = 0;

            int monstersCount   = 0;
            int EliteCount      = 0;
            int RareMinionCount = 0;
            int ElitePackCount  = 0;
            // locust
            int locustCount      = 0;
            int ElitelocustCount = 0;
            // haunted
            int hauntedCount      = 0;
            int ElitehauntedCount = 0;
            //Palmed
            int palmedCount      = 0;
            int ElitepalmedCount = 0;
            //Phoenixed
            int phoenixedCount      = 0;
            int ElitephoenixedCount = 0;
            //Strongarmed Obsolete
            int strongarmedCount      = 0;
            int ElitestrongarmedCount = 0;
            int KrysbinCount          = 0;
            int EliteKrysbinCount     = 0;
            //Cursed
            int CursedCount      = 0;
            int EliteCursedCount = 0;
            //Piranhas
            int PiranhasCount      = 0;
            int ElitePiranhasCount = 0;

            float XPos        = Hud.Window.Size.Width * XWidth;
            float YPos        = Hud.Window.Size.Height * YHeight;
            var   Allmonsters = Hud.Game.AliveMonsters;
            var   bleedCount  = Allmonsters.Where(m => m.Bleeding && m.NormalizedXyDistanceToMe <= 20).ToList().Count;
            var   monsters    = Allmonsters.Where(m => ((m.SummonerAcdDynamicId == 0 && m.IsElite) || !m.IsElite) && m.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard);
            Dictionary <IMonster, string> eliteGroup = new Dictionary <IMonster, string>();

            foreach (var monster in monsters)
            {
                var Elite = monster.Rarity == ActorRarity.Rare || monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss;
                monstersCount++;
                if (isKrysbin(monster) && ShowKrysbinCount)
                {
                    KrysbinCount++;
                }
                if (!monster.IsElite)
                {
                    if (inRift)
                    {
                        TrashMonsterRiftProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                    }
                }
                else
                {
                    if (monster.Rarity == ActorRarity.RareMinion)
                    {
                        RareMinionCount++;
                        if (inRift)
                        {
                            RareMinionProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                        }
                    }
                    else
                    {
                        if (isKrysbin(monster) && ShowKrysbinCount)
                        {
                            EliteKrysbinCount++;
                        }
                        if (monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss)
                        {
                            EliteCount++;
                            ElitePackCount++;
                        }

                        if (monster.Rarity == ActorRarity.Champion)
                        {
                            EliteCount++;
                            eliteGroup.Add(monster, String.Join(", ", monster.AffixSnoList));
                            if (inRift)
                            {
                                EliteProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                            }
                        }

                        if (monster.Rarity == ActorRarity.Rare)
                        {
                            EliteCount++;
                            ElitePackCount++;
                            if (inRift)
                            {
                                EliteProgression += 4 * 1.15d;
                                EliteProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                            }
                        }
                    }
                }
                if (monster.Locust && ShowLlocustCount)
                {
                    locustCount++;
                    if (Elite)
                    {
                        ElitelocustCount++;
                    }
                }
                if (monster.Haunted && ShowHauntedCount)
                {
                    hauntedCount++;
                    if (Elite)
                    {
                        ElitehauntedCount++;
                    }
                }
                if (monster.Palmed && ShowPalmedCount)
                {
                    palmedCount++;
                    if (Elite)
                    {
                        ElitepalmedCount++;
                    }
                }
                if (monster.Piranhas && ShowPiranhasCount)
                {
                    PiranhasCount++;
                    if (Elite)
                    {
                        ElitePiranhasCount++;
                    }
                }
                if (monster.Cursed && ShowCursedCount)
                {
                    CursedCount++;
                    if (Elite)
                    {
                        EliteCursedCount++;
                    }
                }
                if (monster.Phoenixed && ShowPhoenixedCount)
                {
                    phoenixedCount++;
                    if (Elite)
                    {
                        ElitephoenixedCount++;
                    }
                }
                if (monster.Strongarmed && ShowStrongarmedCount)
                {
                    strongarmedCount++;
                    if (Elite)
                    {
                        ElitestrongarmedCount++;
                    }
                }
            }
            Dictionary <IMonster, string> eliteGroup1 = eliteGroup.OrderBy(p => p.Value).ToDictionary(p => p.Key, o => o.Value);

            if (monstersCount == 0)
            {
                return;
            }
            var actors = Hud.Game.Actors.Where(x => x.SnoActor.Kind == ActorKind.RiftOrb);

            foreach (var actor in actors)
            {
                RiftGlobeProgression += 1.15d;
            }
            string preStr = null;

            foreach (var elite in eliteGroup1)
            {
                if (elite.Key.Rarity == ActorRarity.Champion)
                {
                    if (preStr != elite.Value)
                    {
                        EliteProgression += 3 * 1.15f;
                        ElitePackCount++;
                    }
                    preStr = elite.Value;
                }
            }
            textBuilder.Clear();
            if (ShowMonstersCount)
            {
                textBuilder.AppendFormat("{0} 码怪物总数: {1}", currentYard, monstersCount);
                textBuilder.AppendLine();
                if (EliteCount > 0)
                {
                    textBuilder.AppendFormat("精英: {0} 只({1}组)", EliteCount, ElitePackCount);
                }
                if (RareMinionCount > 0)
                {
                    textBuilder.AppendFormat("爪牙: {0} 只", RareMinionCount);
                }
                textBuilder.AppendLine();
                textBuilder.AppendLine();
            }

            if (inRift)
            {
                totalMonsterRiftProgression = TrashMonsterRiftProgression + EliteProgression + RareMinionProgression + RiftGlobeProgression;
                long totalTime      = (long)totalMonsterRiftProgression * 90000000;
                long TrashTime      = (long)TrashMonsterRiftProgression * 90000000;
                long EliteTime      = (long)EliteProgression * 90000000;
                long RareMinionTime = (long)RareMinionProgression * 90000000;
                long RiftGlobeTime  = (long)RiftGlobeProgression * 90000000;
                if (totalMonsterRiftProgression > 0 && ShowTotalProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("总进度: {0}% = {1}", totalMonsterRiftProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)totalTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("总进度: {0}%", totalMonsterRiftProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }

                if (TrashMonsterRiftProgression > 0 && ShowTrashProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("白怪进度: {0}% = {1}", TrashMonsterRiftProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)TrashTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("白怪进度: {0}%", TrashMonsterRiftProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (EliteProgression > 0 && ShowEliteProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("精英进度: {0}% = {1}", EliteProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)EliteTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("精英进度: {0}%", EliteProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (RareMinionProgression > 0 && ShowRareMinionProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("爪牙进度: {0}% = {1}", RareMinionProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)RareMinionTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("爪牙进度: {0}%", RareMinionProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (RiftGlobeProgression > 0 && ShowRiftGlobeProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("进度球进度: {0}% = {1}", RiftGlobeProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)RiftGlobeTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("进度球进度: {0}%", RiftGlobeProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                textBuilder.AppendLine();
            }
            if (locustCount > 0 && ShowLlocustCount)
            {
                textBuilder.AppendFormat("感染虫群: {0}/{1}", locustCount, monstersCount);
                if (ElitelocustCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitelocustCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (hauntedCount > 0 && ShowHauntedCount)
            {
                textBuilder.AppendFormat("感染蚀魂: {0}/{1}", hauntedCount, monstersCount);
                if (ElitehauntedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitehauntedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (CursedCount > 0 && ShowCursedCount)
            {
                textBuilder.AppendFormat("被诅咒: {0}/{1}", CursedCount, monstersCount);
                if (ElitehauntedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", EliteCursedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (PiranhasCount > 0 && ShowPiranhasCount)
            {
                textBuilder.AppendFormat("食人鱼: {0}/{1}", PiranhasCount, monstersCount);
                if (ElitehauntedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitePiranhasCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (palmedCount > 0 && ShowPalmedCount)
            {
                textBuilder.AppendFormat("爆裂掌: {0}/{1}", palmedCount, monstersCount);
                if (ElitepalmedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitepalmedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (phoenixedCount > 0 && ShowPhoenixedCount)
            {
                textBuilder.AppendFormat("点燃: {0}/{1}", phoenixedCount, monstersCount);
                if (ElitephoenixedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitephoenixedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (strongarmedCount > 0 && ShowStrongarmedCount)
            {
                textBuilder.AppendFormat("力士增伤: {0}/{1}", strongarmedCount, monstersCount);
                if (ElitestrongarmedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitestrongarmedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (KrysbinCount > 0 && ShowKrysbinCount)
            {
                textBuilder.AppendFormat("克利斯宾: {0}/{1}", KrysbinCount, monstersCount);
                if (EliteKrysbinCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", EliteKrysbinCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (ShowPainEnhancerCount && Hud.Game.Me.Powers.UsedLegendaryGems.PainEnhancerPrimary?.Active == true)
            {
                if (bleedCount > 0)
                {
                    textBuilder.AppendLine();
                    textBuilder.AppendFormat("增痛宝石: 20码内{0}个怪流血", bleedCount);
                    textBuilder.AppendLine();
                    textBuilder.AppendFormat("攻速加成: {0}%", bleedCount * 3);
                    textBuilder.AppendLine();
                }
            }

            if (totalMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100 || TrashMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
            {
                if (totalMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
                {
                    currentFont = OrangeTextFont;
                }
                if (TrashMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
                {
                    currentFont = RedTextFont;
                }
            }
            else
            {
                currentFont = DefaultTextFont;
            }
            var layout = currentFont.GetTextLayout(textBuilder.ToString());

            currentFont.DrawText(layout, XPos, YPos);
        }
示例#13
0
        public void PaintTopInGame(ClipState clipState)
        {
            bool   IPOnCooldown              = false;
            bool   WarCryOnCooldown          = false;
            float  NecroDistance             = 0.0f;
            float  WizDistance               = 0.0f;
            float  MonkDistance              = 0.0f;
            float  ChargeBarbDistance        = 0.0f;
            float  Rat1Distance              = 0.0f;
            float  Rat2Distance              = 0.0f;
            bool   Active                    = false;
            bool   FalterOnCooldown          = false;
            bool   BerserkerOnCooldown       = false;
            bool   ImBarb                    = false;
            bool   ImWizard                  = false;
            bool   ImMonk                    = false;
            bool   ImNecro                   = false;
            bool   EpiphanyOnCooldown        = false;
            bool   MantraOfHealingOnCooldown = false;
            bool   WarCryBuffActive          = false;
            bool   BerserkerBuffActive       = false;
            bool   EpiphanyBuffActive        = false;
            bool   LotDOnCooldown            = false;
            bool   LotDBuffActive            = false;
            bool   SprintOnCooldown          = false;
            bool   SprintBuffActive          = false;
            bool   WizardIngame              = false;
            bool   MonkIngame                = false;
            int    NecrosIngame              = 0;
            bool   BarbIngame                = false;
            bool   RecastSweepingWind        = false;
            bool   BohOnCooldown             = false;
            bool   BoneArmorAlmostRunningOut = false;
            bool   BoneArmorOnCooldown       = false;
            bool   ConventionLight           = false;
            bool   ConventionArcane          = false;
            bool   ConventionCold            = false;
            bool   ConventionFire            = false;
            bool   ConventionPhysical        = false;
            bool   ConventionHoly            = false;
            bool   BlackholeBuffActive       = false;
            bool   StormArmorOnCooldown      = false;
            bool   StormArmorBuffActive      = false;
            bool   MagicWeaponOnCooldown     = false;
            bool   MagicWeaponBuffActive     = false;
            bool   BossIsSpawned             = false;
            bool   NatBuffActive             = false;
            bool   ImDh                      = false;
            bool   ImSader                   = false;
            bool   VengeanceBuffActive       = false;
            bool   VengeanceOnCooldown       = false;
            bool   RainOfVengeanceOnCooldown = false;
            bool   PreparationOnCooldown     = false;
            bool   ChilanikBuff              = false;
            bool   BarbHasValidActor         = false;
            int    NumberOfSkeleMages        = 0;
            bool   EliteInRange              = false;
            bool   SimBuffActive             = false;
            bool   SimOnCooldown             = false;
            bool   DontCastSim               = false;
            bool   CastSimInChanneling       = false;
            bool   InARift                   = false;
            bool   ImZnec                    = false;
            bool   ArchonBuffActive          = false;
            bool   ArcaneBlastOnCooldown     = false;
            bool   ExplosiveBlastOnCooldown  = false;
            bool   BloodNovaOnCooldown       = false;
            bool   Rat1Dead                  = false;
            bool   Rat2Dead                  = false;
            double SimCD                     = 120.0d;
            bool   PartyIsBuffable           = true;
            bool   ChannelingAfterDelay      = false;

            bool CastIp                        = false;
            bool CastWc                        = false;
            bool CastFalter                    = false;
            bool CastBerserker                 = false;
            bool CastSprint                    = false;
            bool CastEpiphany                  = false;
            bool CastMantraHealing             = false;
            bool CastSweepingWind              = false;
            bool CastBoh                       = false;
            bool CastMantraConviction          = false;
            bool CastLotd                      = false;
            bool CastBoneArmor                 = false;
            bool CastPotion                    = false;
            bool CastStormArmor                = false;
            bool CastMagicWeapon               = false;
            bool CastVengeance                 = false;
            bool CastRainOfVengeance           = false;
            bool CastPreparation               = false;
            bool CastSkeleMages                = false;
            bool CastSim                       = false;
            bool ForceMove                     = false;
            bool CastArcaneBlast               = false;
            bool CastExplosiveBlast            = false;
            bool CastBloodNova                 = false;
            bool CastAkarat                    = false;
            bool CastIronSkin                  = false;
            bool CastLaw                       = false;
            bool CastBattleRage                = false;
            bool CastCOTA                      = false;
            bool AkaratOnCooldown              = false;
            bool IronSkinOnCooldown            = false;
            bool LawOnCooldown                 = false;
            bool AkaratIsActive                = false;
            bool IronSkinIsActive              = false;
            bool BattleRageIsActive            = false;
            bool COTAIsActive                  = false; // Call of the ancients
            bool COTAOnCooldown                = false;
            bool CastShieldGlareJudgment       = false;
            bool ShieldGlareJudgmentEquipped   = false;
            bool ShieldGlareJudgmentOnCooldown = false;
            bool FistOfHeavensEquipped         = false;
            bool RecastFistOfHeavens           = false;
            bool CastFistOfHeavens             = false;


            bool IpEquipped               = false;
            bool WcEquipped               = false;
            bool FalterEquipped           = false;
            bool BerserkerEquipped        = false;
            bool SprintEquipped           = false;
            bool EpiphanyEquipped         = false;
            bool MantraHealingEquipped    = false;
            bool SweepingWindEquipped     = false;
            bool BohEquipped              = false;
            bool MantraConvictionEquipped = false;
            bool LotdEquipped             = false;
            bool BoneArmorEquipped        = false;
            bool StormArmorEquipped       = false;
            bool MagicWeaponEquipped      = false;
            bool VengeanceEquipped        = false;
            bool RainOfVengeanceEquipped  = false;
            bool PreparationEquipped      = false;
            bool SkeleMagesEquipped       = false;
            bool SimEquipped              = false;
            bool ArchonEquipped           = false;
            bool ExplosiveBlastEquippped  = false;
            bool BloodNovaEquipped        = false;
            bool AkaratEquipped           = false;
            bool IronSkinEquipped         = false;
            bool LawEquipped              = false;
            bool BattleRageEquipped       = false;
            bool COTAEquipped             = false;

            IWorldCoordinate MyPosition         = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate WizPosition        = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate MonkPosition       = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate NecroPosition      = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate ChargeBarbPosition = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate Rat1Position       = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate Rat2Position       = Hud.Game.Players.First().FloorCoordinate;

            BossIsSpawned = (Hud.Game.AliveMonsters.Count(m => m.SnoMonster.Priority == MonsterPriority.boss) > 0);

            int Range15Enemies = 0;
            int Range25Enemies = 0;
            int Range75Enemies = 0;

            var monsters2 = Hud.Game.AliveMonsters.Where(m => ((m.SummonerAcdDynamicId == 0 && m.IsElite) || !m.IsElite));

            foreach (var monster in monsters2)
            {
                if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 15)
                {
                    Range15Enemies++;
                }
                if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 25)
                {
                    Range25Enemies++;
                }
                if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 75)
                {
                    Range75Enemies++;
                }


                if ((monster.Rarity == ActorRarity.Unique) ||
                    (monster.Rarity == ActorRarity.Champion) ||
                    (monster.Rarity == ActorRarity.Rare) ||
                    (monster.SnoMonster.Priority == MonsterPriority.boss) ||
                    (monster.SnoActor.Sno == ActorSnoEnum._x1_pand_ext_ordnance_tower_shock_a))//shocktower
                {
                    if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 70)
                    {
                        EliteInRange = true;
                    }
                }
            }

            foreach (var player in Hud.Game.Players)//me
            {
                if (!player.IsMe)
                {
                    continue;
                }
                MyPosition = player.FloorCoordinate;

                foreach (var i in _skillOrder)
                {
                    var skill = player.Powers.SkillSlots[i];
                    if (skill == null)
                    {
                        continue;
                    }
                    //barb
                    if (skill.SnoPower.Sno == 79528)//Barbarian_IgnorePain
                    {
                        IPOnCooldown = skill.IsOnCooldown;
                        IpEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 375483)// Barbarian_WarCry
                    {
                        WarCryBuffActive = skill.BuffIsActive;
                        WarCryOnCooldown = skill.IsOnCooldown;
                        WcEquipped       = true;
                        var buff = player.Powers.GetBuff(318821); //ChilaniksChain 318821 - ItemPassive_Unique_Ring_639_x1
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        ChilanikBuff = buff.TimeLeftSeconds[1] > 0.0;
                    }
                    if (skill.SnoPower.Sno == 79077)// Barbarian_ThreateningShout
                    {
                        FalterOnCooldown = skill.IsOnCooldown;
                        FalterEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 79607)// Barbarian_WrathOfTheBerserker
                    {
                        BerserkerBuffActive = skill.BuffIsActive;
                        BerserkerOnCooldown = skill.IsOnCooldown;
                        BerserkerEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 78551)// Barbarian_Sprint
                    {
                        SprintOnCooldown = skill.IsOnCooldown;
                        SprintEquipped   = true;

                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        SprintBuffActive = buff.TimeLeftSeconds[0] > 2.0;
                    }
                    if (skill.SnoPower.Sno == 79076)// Barbarian_BattleRage
                    {
                        BattleRageEquipped = true;

                        BattleRageIsActive = skill.BuffIsActive;
                    }
                    if (skill.SnoPower.Sno == 80049)// Barbarian_CallOfTheAncients
                    {
                        COTAOnCooldown = skill.IsOnCooldown;
                        COTAEquipped   = true;

                        COTAIsActive = skill.BuffIsActive;
                    }

                    //monk
                    if (skill.SnoPower.Sno == 312307)//Monk_Epiphany
                    {
                        EpiphanyEquipped   = true;
                        EpiphanyOnCooldown = skill.IsOnCooldown;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        EpiphanyBuffActive = buff.TimeLeftSeconds[0] > 0.5;
                    }
                    if (skill.SnoPower.Sno == 373143)//Monk_MantraOfHealing
                    {
                        MantraOfHealingOnCooldown = skill.IsOnCooldown;
                        MantraHealingEquipped     = true;
                    }

                    if (skill.SnoPower.Sno == 96090)//Monk_SweepingWind
                    {
                        SweepingWindEquipped = true;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            RecastSweepingWind = true;
                            continue;
                        }
                        RecastSweepingWind = skill.Buff.TimeLeftSeconds[0] < 1.0;
                    }

                    if (skill.SnoPower.Sno == 69130)//Monk_BreathOfHeaven
                    {
                        BohOnCooldown = skill.IsOnCooldown;
                        BohEquipped   = true;
                    }

                    if (skill.SnoPower.Sno == 375088)//Monk_MantraOfConviction
                    {
                        MantraConvictionEquipped = true;
                    }

                    //wizard
                    if (skill.SnoPower.Sno == 74499)//Wizard_StormArmor
                    {
                        StormArmorBuffActive = skill.BuffIsActive;
                        StormArmorOnCooldown = skill.IsOnCooldown;
                        StormArmorEquipped   = true;
                    }

                    if (skill.SnoPower.Sno == 76108)//Wizard_MagicWeapon
                    {
                        MagicWeaponBuffActive = skill.BuffIsActive;
                        MagicWeaponOnCooldown = skill.IsOnCooldown;
                        MagicWeaponEquipped   = true;
                    }

                    if (skill.SnoPower.Sno == 134872)//Wizard_Archon
                    {
                        var buff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Archon.Sno);
                        if (buff != null)
                        {
                            ArchonBuffActive = buff.TimeLeftSeconds[2] > 0.1;
                        }
                        ArchonEquipped = true;
                    }

                    if (skill.SnoPower.Sno == 87525)//Wizard_ExplosiveBlast { get; } // 87525
                    {
                        ExplosiveBlastOnCooldown = skill.IsOnCooldown;
                        ExplosiveBlastEquippped  = true;
                    }

                    if (i == 2)
                    {
                        ArcaneBlastOnCooldown = skill.IsOnCooldown;
                    }

                    /*if (skill.SnoPower.Sno == 392885 || skill.SnoPower.Sno == 167355)//Wizard_ArchonArcaneBlastLightning Wizard_ArchonArcaneBlast
                     * {
                     *  ArcaneBlastOnCooldown = skill.IsOnCooldown;
                     * }*/


                    //necro
                    if (skill.SnoPower.Sno == 466857)//Necromancer_BoneArmor
                    {
                        BoneArmorOnCooldown = skill.IsOnCooldown;
                        BoneArmorEquipped   = true;
                        if (skill.Buff != null)
                        {
                            BoneArmorAlmostRunningOut = skill.Buff.TimeLeftSeconds[0] < 30.0;
                        }
                    }
                    if (skill.SnoPower.Sno == 465839)                    //Necromancer_LandOfTheDead { get; }
                    {
                        //LotDBuffActive = skill.BuffIsActive;
                        LotDOnCooldown = skill.IsOnCooldown;
                        LotdEquipped   = true;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        LotDBuffActive = buff.TimeLeftSeconds[0] > 0.5;
                    }

                    if (skill.SnoPower.Sno == 462089)//Necromancer_SkeletalMage { get; }
                    {
                        SkeleMagesEquipped = true;
                        HashSet <ActorSnoEnum> SkeletonMageActorSNOs = new HashSet <ActorSnoEnum>
                        {
                            ActorSnoEnum._p6_necro_skeletonmage_a,                                                                            // Skeleton Mage - No Rune
                            ActorSnoEnum._p6_necro_skeletonmage_b,                                                                            // Skeleton Mage - Gift of Death
                            ActorSnoEnum._p6_necro_skeletonmage_e,                                                                            // Skeleton Mage - Contamination
                            ActorSnoEnum._p6_necro_skeletonmage_f_archer,                                                                     // Skeleton Mage - Archer
                            ActorSnoEnum._p6_necro_skeletonmage_c,                                                                            // Skeleton Mage - Singularity
                            ActorSnoEnum._p6_necro_skeletonmage_d                                                                             // Skeleton Mage - Life Support
                        };
                        var SkeletonMageActors = Hud.Game.Actors.Where(EachActor => SkeletonMageActorSNOs.Contains(EachActor.SnoActor.Sno) && // Find out which are skeleton mages actors
                                                                       EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId);             // Then find out if they are summoned by the player
                        NumberOfSkeleMages = SkeletonMageActors.Count();                                                                      // And then count how many are found
                    }

                    if (skill.SnoPower.Sno == 465350)//Necromancer_Simulacrum { get; }
                    {
                        SimOnCooldown = skill.IsOnCooldown;
                        SimEquipped   = true;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        SimBuffActive = buff.TimeLeftSeconds[0] > 0.0;
                    }

                    if (skill.SnoPower.Sno == 462243)//Necromancer_DeathNova { get; } // 462243
                    {
                        BloodNovaOnCooldown = skill.IsOnCooldown;
                        BloodNovaEquipped   = true;
                    }

                    //dh
                    if (skill.SnoPower.Sno == 302846)//DemonHunter_Vengeance { get; }
                    {
                        VengeanceOnCooldown = skill.IsOnCooldown;
                        VengeanceEquipped   = true;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        VengeanceBuffActive = buff.TimeLeftSeconds[0] > 0.5;
                    }
                    if (skill.SnoPower.Sno == 130831)//DemonHunter_RainOfVengeance { get; }
                    {
                        RainOfVengeanceOnCooldown = skill.IsOnCooldown;
                        RainOfVengeanceEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 129212)//DemonHunter_Preparation { get; }
                    {
                        PreparationOnCooldown = skill.IsOnCooldown;
                        PreparationEquipped   = true;
                    }

                    // crus
                    if (skill.SnoPower.Sno == 269032) // Crusader_AkaratsChampion
                    {
                        AkaratIsActive   = skill.BuffIsActive;
                        AkaratOnCooldown = skill.IsOnCooldown;
                        AkaratEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 291804) // Crusader_IronSkin
                    {
                        IronSkinIsActive   = skill.BuffIsActive;
                        IronSkinOnCooldown = skill.IsOnCooldown;
                        IronSkinEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 342279 || skill.SnoPower.Sno == 342280 || skill.SnoPower.Sno == 342281) // Crusader_LawsOfHope || Crusader_LawsOfJustice || Crusader_LawsOfValor
                    {
                        LawOnCooldown = skill.IsOnCooldown;
                        LawEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 239218) // Fist of heavens
                    {
                        FistOfHeavensEquipped = true;
                        var power = player.Powers.GetBuff(483643);
                        if (power != null)
                        {
                            if (power.IconCounts[1] < 3 || power.TimeLeftSeconds[1] <= 0.8)
                            {
                                RecastFistOfHeavens = true;
                            }
                        }
                        // var power = Hud.Game.Me.Powers.AllBuffs.FirstOrDefault(curr => curr.SnoPower.Sno == 483643 && curr.TimeLeftSeconds[1] > 0);
                    }
                    if (skill.SnoPower.Sno == 268530 || skill.SnoPower.Sno == 267600) // shield glare OR judgment
                    {
                        ShieldGlareJudgmentEquipped   = true;
                        ShieldGlareJudgmentOnCooldown = skill.IsOnCooldown;
                    }
                }
            }

            int RatsFound = 0;

            foreach (var player in Hud.Game.Players)//others
            {
                if (player.HeroClassDefinition.HeroClass == HeroClass.Barbarian)
                {
                    if (player.IsMe)
                    {
                        ImBarb = true;
                    }
                    else
                    {
                        BarbIngame        = true;
                        BarbHasValidActor = player.HasValidActor;
                        var EfficaciousToxin = player.Powers.GetBuff(403461);
                        if (EfficaciousToxin == null || !EfficaciousToxin.Active)
                        {
                            //chargebarb
                            ChargeBarbPosition = player.FloorCoordinate;
                        }
                        else
                        {
                            //zbarb
                        }
                    }
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.Wizard)
                {
                    if (player.IsMe)
                    {
                        ImWizard = true;
                        IBuff ConventionBuff = player.Powers.GetBuff(430674);
                        if ((ConventionBuff == null) || (ConventionBuff.IconCounts[0] <= 0))
                        {
                            continue;
                        }

                        ConventionLight  = ConventionBuff.IconCounts[5] != 0;
                        ConventionArcane = ConventionBuff.IconCounts[1] != 0;
                        ConventionCold   = ConventionBuff.IconCounts[2] != 0;
                        ConventionFire   = ConventionBuff.IconCounts[3] != 0;

                        IBuff BlackholeBuff = player.Powers.GetBuff(243141);
                        if (BlackholeBuff == null)
                        {
                            continue;
                        }
                        if (BlackholeBuff.IconCounts[5] <= 0)
                        {
                            continue;
                        }

                        BlackholeBuffActive = (BlackholeBuff.TimeLeftSeconds[5] > 3.5);
                    }
                    else
                    {
                        WizPosition  = player.FloorCoordinate;
                        WizardIngame = true;
                    }

                    var LoadingBuff = player.Powers.GetBuff(212032);
                    if (!(LoadingBuff == null || !LoadingBuff.Active))
                    {
                        PartyIsBuffable = false;
                    }
                    var GhostedBuff = player.Powers.GetBuff(224639);
                    if (!(GhostedBuff == null || !GhostedBuff.Active))
                    {
                        PartyIsBuffable = false;
                    }
                    var InvulBuff = player.Powers.GetBuff(439438);
                    if (!(InvulBuff == null || !InvulBuff.Active))
                    {
                        PartyIsBuffable = false;
                    }
                    var UntargetableDuringBuff = player.Powers.GetBuff(30582);
                    if (!(UntargetableDuringBuff == null || !UntargetableDuringBuff.Active))
                    {
                        PartyIsBuffable = false;
                    }
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.Monk)
                {
                    if (player.IsMe)
                    {
                        ImMonk = true;
                    }
                    else
                    {
                        MonkPosition = player.FloorCoordinate;
                        MonkIngame   = true;
                    }
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.Necromancer)
                {
                    var EfficaciousToxin = player.Powers.GetBuff(403461);
                    if (EfficaciousToxin == null || !EfficaciousToxin.Active)
                    {
                        //rat
                        if (player.IsMe)
                        {
                            ImZnec  = false;
                            ImNecro = true;
                        }
                        else
                        {
                            if (RatsFound == 0)
                            {
                                Rat1Dead     = player.IsDead;
                                Rat1Position = player.FloorCoordinate;
                                RatsFound    = 1;
                            }
                            else if (RatsFound == 1)
                            {
                                Rat2Dead     = player.IsDead;
                                Rat2Position = player.FloorCoordinate;
                                RatsFound    = 2;
                            }
                            NecroPosition = player.FloorCoordinate;
                        }
                    }
                    else
                    {
                        //znec
                        if (player.IsMe)
                        {
                            ImZnec  = true;
                            ImNecro = true;
                        }
                    }

                    foreach (var i in _skillOrder)
                    {
                        var skill = player.Powers.SkillSlots[i];
                        if (skill.SnoPower.Sno == 465350)//Necromancer_Simulacrum { get; }
                        {
                            var CurrentSimCD = skill.CalculateCooldown(120);
                            if (CurrentSimCD < SimCD)
                            {
                                SimCD = CurrentSimCD;
                            }
                            break;
                        }
                    }

                    NecrosIngame++;
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.DemonHunter)
                {
                    if (player.IsMe)
                    {
                        ImDh = true;
                        IBuff NatBuff = player.Powers.GetBuff(434964);
                        if (NatBuff == null)
                        {
                            continue;
                        }
                        NatBuffActive = (NatBuff.TimeLeftSeconds[1] > 0.5);
                    }
                    else
                    {
                        //
                    }
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.Crusader)
                {
                    if (player.IsMe)
                    {
                        ImSader = true;
                        IBuff ConventionBuff = player.Powers.GetBuff(430674);
                        if ((ConventionBuff == null) || (ConventionBuff.IconCounts[0] <= 0))
                        {
                            continue;
                        }

                        var coelen = ConventionBuff.IconCounts.Count();
                        ConventionFire     = ConventionBuff.IconCounts[3] != 0;
                        ConventionHoly     = ConventionBuff.IconCounts[4] != 0;
                        ConventionLight    = ConventionBuff.IconCounts[5] != 0;
                        ConventionPhysical = ConventionBuff.IconCounts[6] != 0;
                    }
                    else
                    {
                        //
                    }
                }
            }

            WizDistance        = WizPosition.XYDistanceTo(MyPosition);
            MonkDistance       = MonkPosition.XYDistanceTo(MyPosition);
            NecroDistance      = NecroPosition.XYDistanceTo(MyPosition);
            ChargeBarbDistance = ChargeBarbPosition.XYDistanceTo(MyPosition);
            Rat1Distance       = Rat1Position.XYDistanceTo(MyPosition);
            Rat2Distance       = Rat2Position.XYDistanceTo(MyPosition);

            var Channelingbuff = Hud.Game.Me.Powers.GetBuff(266258);

            if ((Channelingbuff != null) && (Channelingbuff.IconCounts[0] > 0))
            {
                CastSimInChanneling  = (Channelingbuff.TimeLeftSeconds[0] < 2.0d) || (Channelingbuff.TimeLeftSeconds[0] > 28.0d);
                ChannelingAfterDelay = Channelingbuff.TimeLeftSeconds[0] < 28.0d;
            }

            var  TargetedMonster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1;
            bool EliteTargeted   = false;

            if (TargetedMonster != null)
            {
                //EliteTargeted = TargetedMonster.IsElite;
                EliteTargeted = (TargetedMonster.Rarity == ActorRarity.Unique) ||
                                (TargetedMonster.Rarity == ActorRarity.Champion) ||
                                (TargetedMonster.Rarity == ActorRarity.Rare) ||
                                (TargetedMonster.SnoMonster.Priority == MonsterPriority.boss) ||
                                (TargetedMonster.SnoActor.Sno == ActorSnoEnum._x1_pand_ext_ordnance_tower_shock_a);//shocktower
            }


            InARift = (Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift);

            Active = true;
            Active = Active && Hud.Game.IsInGame;
            Active = Active && !Hud.Game.IsLoading;
            Active = Active && !Hud.Game.IsInTown;
            Active = Active && !Hud.Game.Me.IsDead;
            Active = Active && !Hud.Render.UiHidden;
            Active = Active && Hud.Game.MapMode == MapMode.Minimap;
            Active = Active && (Hud.Game.Me.AnimationState != AcdAnimationState.CastingPortal && Hud.Game.Me.AnimationState != AcdAnimationState.Dead);

            bool GRGuardianIsDead = false;
            var  riftQuest        = Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 337492) ??
                                    Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 382695);

            if (riftQuest != null)
            {
                if (Hud.Game.Monsters.Any(m => m.Rarity == ActorRarity.Boss && !m.IsAlive))
                {
                    GRGuardianIsDead = true;
                }
                else
                {
                    GRGuardianIsDead = (riftQuest.QuestStepId == 34 || riftQuest.QuestStepId == 46);
                };
            }

            Active = Active && !GRGuardianIsDead;


            double Cooldown           = (Hud.Game.Me.Powers.HealthPotionSkill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60d;
            bool   PotionIsOnCooldown = Cooldown <= 30 && Cooldown >= 0 ? true : false;

            bool WizInIpRange;

            if (WizardIngame && MonkIngame)//metas
            {
                if ((WizPosition.XYDistanceTo(MonkPosition) > 50) || !MonkIngame)
                {
                    WizInIpRange = (WizDistance <= 45);
                }
                else
                {
                    WizInIpRange = (Math.Max(WizDistance, MonkDistance) <= 45);
                }

                CastIp = !IPOnCooldown && IpEquipped && PartyIsBuffable && (!BossIsSpawned && WizInIpRange ||
                                                                            BossIsSpawned && (NecroDistance <= 45));
                CastFalter = FalterEquipped && !FalterOnCooldown && (!BossIsSpawned && (WizDistance <= 20) ||
                                                                     BossIsSpawned);
                CastWc = WcEquipped && !WarCryOnCooldown && PartyIsBuffable && (!ChilanikBuff || NecroDistance <= 100);
            }
            else if (NecrosIngame == 3)//rats
            {
                CastIp = !IPOnCooldown && IpEquipped && PartyIsBuffable;
                if (!Rat1Dead)
                {
                    CastIp = CastIp && (Rat1Distance <= 45);
                }
                if (!Rat2Dead)
                {
                    CastIp = CastIp && (Rat2Distance <= 45);
                }
                CastFalter = FalterEquipped && !FalterOnCooldown;
                CastWc     = WcEquipped && !WarCryOnCooldown && PartyIsBuffable;
            }
            else
            {
                CastIp     = !IPOnCooldown && IpEquipped && PartyIsBuffable && (Hud.Game.NumberOfPlayersInGame == (Hud.Game.Players.Where(p => p.CentralXyDistanceToMe <= 45)).Count());
                CastFalter = FalterEquipped && !FalterOnCooldown;
                CastWc     = (WcEquipped && !WarCryOnCooldown && PartyIsBuffable && (!ChilanikBuff || (Hud.Game.NumberOfPlayersInGame == (Hud.Game.Players.Where(p => p.CentralXyDistanceToMe <= 45)).Count())));
            }



            CastBerserker        = BerserkerEquipped && !BerserkerOnCooldown && !BerserkerBuffActive;
            CastSprint           = SprintEquipped && !SprintOnCooldown && Hud.Game.Me.Stats.ResourceCurFury >= 20 && !SprintBuffActive;
            CastBattleRage       = BattleRageEquipped && Hud.Game.Me.Stats.ResourceCurFury >= 20 && !BattleRageIsActive;
            CastCOTA             = COTAEquipped && !COTAOnCooldown && !COTAIsActive;
            CastEpiphany         = EpiphanyEquipped && !EpiphanyOnCooldown && !EpiphanyBuffActive;
            CastMantraHealing    = MantraHealingEquipped && !MantraOfHealingOnCooldown && Hud.Game.Me.Stats.ResourceCurSpirit >= (0.3 * Hud.Game.Me.Stats.ResourceMaxSpirit) && (Range75Enemies >= 1);
            CastSweepingWind     = SweepingWindEquipped && RecastSweepingWind && Hud.Game.Me.Stats.ResourceCurSpirit >= (Hud.Game.Me.Stats.ResourceMaxSpirit / 2.0);
            CastBoh              = BohEquipped && !BohOnCooldown && ((Hud.Game.SpecialArea == SpecialArea.Rift) || BarbIngame && (ChargeBarbDistance <= 12) && BarbHasValidActor);
            CastMantraConviction = MantraConvictionEquipped && Hud.Game.Me.Stats.ResourceCurSpirit >= (Hud.Game.Me.Stats.ResourceMaxSpirit / 2.0);
            CastLotd             = LotdEquipped && !LotDOnCooldown && !LotDBuffActive && (Range75Enemies >= 1);
            //CastBoneArmor = BoneArmorEquipped && (((BoneArmorAlmostRunningOut && (Range25Enemies >= 1)) ||
            //                  (!BoneArmorAlmostRunningOut && (Range25Enemies >= 5))) &&
            //                  !BoneArmorOnCooldown);
            CastBoneArmor = BoneArmorEquipped && (Range25Enemies >= 1) && !BoneArmorOnCooldown;

            DontCastSim = (((Hud.Game.CurrentTimedEventEndTick - (double)Hud.Game.CurrentGameTick) / 60.0d) > (900.0d - SimCD * 0.4)) || ChannelingAfterDelay;
            if (Hud.Game.SpecialArea == SpecialArea.Rift)
            {
                DontCastSim = false;
            }

            CastSim             = InARift && SimEquipped && !SimOnCooldown && (!(Hud.Game.Me.Stats.ResourceMaxEssence > 450) || CastSimInChanneling);//have sim because of reservoir
            CastPotion          = Hud.Game.Me.Defense.HealthCur <= (Hud.Game.Me.Defense.HealthMax * 0.35) && !PotionIsOnCooldown;
            CastStormArmor      = !ArchonBuffActive && StormArmorEquipped && !StormArmorOnCooldown && !StormArmorBuffActive;
            CastMagicWeapon     = !ArchonBuffActive && MagicWeaponEquipped && !MagicWeaponOnCooldown && !MagicWeaponBuffActive;
            CastVengeance       = VengeanceEquipped && !VengeanceOnCooldown && !VengeanceBuffActive;
            CastRainOfVengeance = RainOfVengeanceEquipped && !RainOfVengeanceOnCooldown && !NatBuffActive;
            CastPreparation     = PreparationEquipped && !PreparationOnCooldown && !(Hud.Game.Me.Stats.ResourceCurDiscipline >= (Hud.Game.Me.Stats.ResourceMaxDiscipline - 30));
            ForceMove           = InARift && !ImZnec && (Hud.Game.Me.AnimationState == AcdAnimationState.Idle || Hud.Game.Me.AnimationState == AcdAnimationState.Casting);
            CastArcaneBlast     = ArchonBuffActive && ArchonEquipped && !ArcaneBlastOnCooldown && (Range15Enemies > 0);
            CastExplosiveBlast  = !ArchonBuffActive && ExplosiveBlastEquippped && !ExplosiveBlastOnCooldown && Hud.Game.Me.Stats.ResourceCurArcane >= (Hud.Game.Me.Stats.ResourceMaxArcane / 3.0);
            CastBloodNova       = /*InARift && */ BloodNovaEquipped && !BloodNovaOnCooldown && (Hud.Game.Me.Stats.ResourceCurEssence >= (Hud.Game.Me.Stats.ResourceMaxEssence / 3.0)) && (Range25Enemies >= 1);

            CastAkarat              = AkaratEquipped && !AkaratOnCooldown && !AkaratIsActive;
            CastIronSkin            = IronSkinEquipped && !IronSkinOnCooldown && !IronSkinIsActive;
            CastLaw                 = LawEquipped && !LawOnCooldown;
            CastFistOfHeavens       = FistOfHeavensEquipped && RecastFistOfHeavens;
            CastShieldGlareJudgment = ShieldGlareJudgmentEquipped && !ShieldGlareJudgmentOnCooldown;



            if (BossIsSpawned || Hud.Game.SpecialArea == SpecialArea.Rift)
            {
                CastSkeleMages = InARift && SkeleMagesEquipped && (Hud.Game.Me.Stats.ResourceCurEssence >= (Hud.Game.Me.Stats.ResourceMaxEssence * 0.95)) && (NumberOfSkeleMages < 10);
            }
            else
            {
                CastSkeleMages = InARift && SkeleMagesEquipped && (Hud.Game.Me.Stats.ResourceCurEssence >= (Hud.Game.Me.Stats.ResourceMaxEssence * 0.95)) && (EliteInRange && EliteTargeted || (!EliteInRange) && (NumberOfSkeleMages < 10));
            }

            var bitArray = new BitArray(8);

            bitArray.Set(0, true);
            bitArray.Set(1, Active);
            bitArray.Set(2, ImBarb);
            bitArray.Set(3, ImMonk);
            bitArray.Set(4, ImWizard);
            bitArray.Set(5, ImNecro);
            bitArray.Set(6, ImDh);

            bitArray.CopyTo(Bytes, 0);


            bitArray.Set(0, true);
            bitArray.Set(1, ConventionLight);
            bitArray.Set(2, ConventionArcane);
            bitArray.Set(3, ConventionCold);
            bitArray.Set(4, ConventionFire);
            bitArray.Set(5, BlackholeBuffActive);
            bitArray.Set(6, CastArcaneBlast);
            bitArray.Set(7, false);

            bitArray.CopyTo(Bytes, 1);


            bitArray.Set(0, true);
            bitArray.Set(1, InARift);
            bitArray.Set(2, WarCryBuffActive);
            bitArray.Set(3, BerserkerBuffActive);
            bitArray.Set(4, EpiphanyBuffActive);
            bitArray.Set(5, ImSader);
            bitArray.Set(6, LotDBuffActive);

            bitArray.CopyTo(Bytes, 2);


            bitArray.Set(0, true);
            bitArray.Set(1, CastIp);
            bitArray.Set(2, CastSim);
            bitArray.Set(3, DontCastSim);
            bitArray.Set(4, CastFalter);
            bitArray.Set(5, CastBerserker);
            bitArray.Set(6, CastSprint);

            bitArray.CopyTo(Bytes, 3);


            bitArray.Set(0, true);
            bitArray.Set(1, CastWc);
            bitArray.Set(2, CastMantraHealing);
            bitArray.Set(3, CastSweepingWind);
            bitArray.Set(4, CastBoh);
            bitArray.Set(5, CastMantraConviction);
            bitArray.Set(6, CastLotd);

            bitArray.CopyTo(Bytes, 4);


            bitArray.Set(0, true);
            bitArray.Set(1, CastPotion);
            bitArray.Set(2, CastStormArmor);
            bitArray.Set(3, CastMagicWeapon);
            bitArray.Set(4, CastVengeance);
            bitArray.Set(5, CastRainOfVengeance);
            bitArray.Set(6, CastPreparation);

            bitArray.CopyTo(Bytes, 5);


            bitArray.Set(0, true);
            bitArray.Set(1, ForceMove);
            bitArray.Set(2, CastFistOfHeavens);
            bitArray.Set(3, CastShieldGlareJudgment);
            bitArray.Set(4, CastAkarat);
            bitArray.Set(5, CastIronSkin);
            bitArray.Set(6, CastLaw);

            bitArray.CopyTo(Bytes, 6);


            bitArray.Set(0, true);
            bitArray.Set(1, CastBattleRage);
            bitArray.Set(2, CastCOTA);
            bitArray.Set(3, CastEpiphany);
            bitArray.Set(4, CastBoneArmor);
            bitArray.Set(5, ConventionHoly);
            bitArray.Set(6, ConventionPhysical);

            bitArray.CopyTo(Bytes, 7);


            if (!arraysAreEqual(Bytes, oldBytes))
            {
                try {
                    Clipboard.SetText(ByteArrayToString(Bytes));
                    Bytes.CopyTo(oldBytes, 0);
                } catch (Exception e) {
                    Hud.Debug(e.ToString());
                }
            }


            // Hud.Debug("akarat: " + CastAkarat + " iron skin: " + CastIronSkin + " cast law: " + CastLaw);


            System.Threading.Thread.Sleep(5);

            if (Hud.Render.UiHidden)
            {
                return;
            }
            float x = -Hud.Window.Size.Width * 0.001f;
            float y = Hud.Window.Size.Height * 0.965f;

            logoDecorator.Paint(x, y, 30.0f, 30.0f, HorizontalAlign.Center);

            if (Show)
            {
                float XPos = Hud.Window.Size.Width * 0.01f;
                float YPos = Hud.Window.Size.Height * 0.665f;
                textBuilder.Clear();

                Active = true;
                Active = Active && Hud.Game.IsInGame;
                Active = Active && !Hud.Game.IsPaused;
                Active = Active && !Hud.Game.IsLoading;
                Active = Active && !Hud.Game.IsInTown;
                Active = Active && !Hud.Game.Me.IsDead;
                Active = Active && !Hud.Render.UiHidden;
                Active = Active && Hud.Game.MapMode == MapMode.Minimap;
                Active = Active && (Hud.Game.Me.AnimationState != AcdAnimationState.CastingPortal && Hud.Game.Me.AnimationState != AcdAnimationState.Dead);
                Active = Active && (Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift);

                textBuilder.AppendFormat("IsInGame: {0}", Hud.Game.IsInGame);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("IsPaused: {0}", Hud.Game.IsPaused);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("IsLoading: {0}", Hud.Game.IsLoading);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("IsDead: {0}", Hud.Game.Me.IsDead);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("UiHidden: {0}", Hud.Render.UiHidden);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("Minimap: {0}", Hud.Game.MapMode == MapMode.Minimap);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("dead or portal: {0}", (Hud.Game.Me.AnimationState != AcdAnimationState.CastingPortal && Hud.Game.Me.AnimationState != AcdAnimationState.Dead));
                textBuilder.AppendLine();
                textBuilder.AppendFormat("in rift: {0}", (Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift));
                textBuilder.AppendLine();
                textBuilder.AppendFormat("current COE is on: {0}", ConventionPhysical);
                textBuilder.AppendLine();

                var layout = Font.GetTextLayout(textBuilder.ToString());
                Font.DrawText(layout, XPos, YPos);
            }
        }
示例#14
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if (Hud.Render.UiHidden)
            {
                return;
            }
            if (Hud.Game.SpecialArea != SpecialArea.GreaterRift)
            {
                return;
            }
            float x = Hud.Window.Size.Width * 0.8f;
            float y = Hud.Window.Size.Height * 0.07f;

            textBuilder.Clear();

            //Mob Type
            HashSet <string> MonstersOnTheScreen = new HashSet <string>();

            var monsters = Hud.Game.AliveMonsters.Where(m => (!m.IsElite));

            foreach (var monster in monsters)
            {
                if (monster.Rarity == ActorRarity.Normal)
                {
                    MonstersOnTheScreen.Add(monster.SnoMonster.NameEnglish);
                }
            }

            var BadMonsters = new List <string>
            {
                "Shock Tower", "Hell Bringer", "Blazing Swordwielder", "Bloated Corpse", "Spiderling"
            };

            foreach (string monstername in BadMonsters)
            {
                if (MonstersOnTheScreen.Contains(monstername))
                {
                    MonstersOnTheScreen.Remove(monstername);
                }
            }
            //DEBUG
            if (Show)
            {
                foreach (string monstername in MonstersOnTheScreen)
                {
                    textBuilder.AppendFormat("{0}", monstername);
                    textBuilder.AppendLine();
                }
                textBuilder.AppendLine();
            }
            List <MonsterSet> MatchingMonsterSets = new List <MonsterSet>();

            foreach (MonsterSet monsterset in MonsterSetList)
            {
                MatchingMonsterSets.Add(new MonsterSet(monsterset.Name, monsterset.Monsters));
            }


            List <MonsterSet> RemoveList = new List <MonsterSet>();

            foreach (string monster in MonstersOnTheScreen)
            {
                foreach (MonsterSet monsterset in MatchingMonsterSets)//see if the monster fits the monsterset
                {
                    //if monster is not in the monsterset delete the monsterset
                    if (!monsterset.Monsters.Contains(monster))
                    {
                        RemoveList.Add(monsterset);
                    }
                }
                foreach (MonsterSet monsterset in RemoveList)
                {
                    MatchingMonsterSets.Remove(monsterset);
                }
            }



            HashSet <string> ScenesOnTheScreen = new HashSet <string>();

            /*var actors = Hud.Game.Actors;
             * foreach (var actor in actors)
             * {
             *  if (actor == null)continue;
             *  if (actor.Scene == null)continue;
             *  if (actor.Scene.SnoScene == null)continue;
             *  ScenesOnTheScreen.Add(actor.Scene.SnoScene.Code);
             * }*/

            if (Hud.Game.Me.Scene != null)
            {
                ScenesOnTheScreen.Add(Hud.Game.Me.Scene.SnoScene.Code);
            }

            var BadMaps = new List <string>
            {
            };

            foreach (string mapname in BadMaps)
            {
                if (ScenesOnTheScreen.Contains(mapname))
                {
                    ScenesOnTheScreen.Remove(mapname);
                }
            }
            //DEBUG

            List <MapName> MatchingMapNames = new List <MapName>();

            foreach (MapName mapset in MapNameList)
            {
                MatchingMapNames.Add(new MapName(mapset.Name, mapset.Scenes));
            }


            List <MapName> RemoveListMap = new List <MapName>();

            foreach (var Scene in ScenesOnTheScreen)
            {
                foreach (MapName mapset in MatchingMapNames)//see if the Scene fits the Map
                {
                    //if Scene is not in the Map delete the Map
                    if (!mapset.Scenes.Contains(Scene))
                    {
                        RemoveListMap.Add(mapset);
                    }
                }
                foreach (MapName mapset in RemoveListMap)
                {
                    MatchingMapNames.Remove(mapset);
                }
            }

            foreach (string Scene in ScenesOnTheScreen)
            {
                bool found = false;
                foreach (MapName Map in MapNameList)
                {
                    if (Map.Scenes.Contains(Scene))
                    {
                        found = true;
                    }
                }
                if (found)
                {
                    if (Show)
                    {
                        textBuilder.AppendFormat("{0}", Scene);
                        textBuilder.AppendLine();
                    }
                }
                else
                {
                    if (Show)
                    {
                        textBuilder.AppendFormat("NEW SCENE");
                        textBuilder.AppendLine();
                        textBuilder.AppendFormat("{0}", Scene);
                        textBuilder.AppendLine();
                    }
                    if (LastMap != null)
                    {
                        SceneDebug.Add(LastMap);
                    }
                    SceneDebug.Add(Scene);
                }
            }
            textBuilder.AppendLine();

            foreach (MapName map in MatchingMapNames)
            {
                textBuilder.AppendFormat("{0}", map.Name);
                textBuilder.AppendLine();
                LastMap = map.Name;
            }
            textBuilder.AppendLine();



            if (MatchingMonsterSets.Count == 1)
            {
                foreach (MonsterSet monsterset in MatchingMonsterSets)
                {
                    textBuilder.AppendFormat("{0}", monsterset.Name);
                    textBuilder.AppendLine();
                }
            }
            else if (MatchingMonsterSets.Count < 20)
            {
                foreach (MonsterSet monsterset in MatchingMonsterSets)
                {
                    textBuilder.AppendFormat("{0}", monsterset.Name);
                    textBuilder.AppendLine();
                }
            }

            var layout = GreenFont.GetTextLayout(textBuilder.ToString());

            GreenFont.DrawText(layout, x, y);
        }
示例#15
0
        public void PaintTopInGame(ClipState clipState)
        {
            bool  IPOnCooldown              = false;
            bool  WarCryOnCooldown          = false;
            float NecroDistance             = 0.0f;
            float WizDistance               = 0.0f;
            float MonkDistance              = 0.0f;
            float ChargeBarbDistance        = 0.0f;
            bool  Active                    = false;
            bool  FalterOnCooldown          = false;
            bool  BerserkerOnCooldown       = false;
            bool  ImBarb                    = false;
            bool  ImWizard                  = false;
            bool  ImMonk                    = false;
            bool  ImNecro                   = false;
            bool  EpiphanyOnCooldown        = false;
            bool  MantraOfHealingOnCooldown = false;
            bool  WarCryBuffActive          = false;
            bool  BerserkerBuffActive       = false;
            bool  EpiphanyBuffActive        = false;
            bool  LotDOnCooldown            = false;
            bool  LotDBuffActive            = false;
            bool  SprintOnCooldown          = false;
            bool  SprintBuffActive          = false;
            bool  WizardIngame              = false;
            bool  MonkIngame                = false;
            bool  NecroIngame               = false;
            bool  BarbIngame                = false;
            bool  RecastSweepingWind        = false;
            bool  BohOnCooldown             = false;
            bool  BoneArmorAlmostRunningOut = false;
            bool  BoneArmorOnCooldown       = false;
            bool  ConventionLight           = false;
            bool  ConventionArcane          = false;
            bool  ConventionCold            = false;
            bool  ConventionFire            = false;
            bool  BlackholeBuffActive       = false;
            bool  StormArmorOnCooldown      = false;
            bool  StormArmorBuffActive      = false;
            bool  MagicWeaponOnCooldown     = false;
            bool  MagicWeaponBuffActive     = false;
            bool  BossIsSpawned             = false;
            bool  NatBuffActive             = false;
            bool  ImDh                      = false;
            bool  ImSader                   = false;
            bool  VengeanceBuffActive       = false;
            bool  VengeanceOnCooldown       = false;
            bool  RainOfVengeanceOnCooldown = false;
            bool  PreparationOnCooldown     = false;
            bool  ChilanikBuff              = false;
            bool  BarbHasValidActor         = false;
            int   NumberOfSkeleMages        = 0;
            bool  EliteInRange              = false;
            bool  SimBuffActive             = false;
            bool  SimOnCooldown             = false;
            bool  RiftJustStarted           = false;
            bool  ChannelingRunningOut      = false;
            bool  InARift                   = false;
            bool  ImZnec                    = false;
            bool  ArchonBuffActive          = false;
            bool  ArcaneBlastOnCooldown     = false;

            bool CastIp               = false;
            bool CastWc               = false;
            bool CastFalter           = false;
            bool CastBerserker        = false;
            bool CastSprint           = false;
            bool CastEpiphany         = false;
            bool CastMantraHealing    = false;
            bool CastSweepingWind     = false;
            bool CastBoh              = false;
            bool CastMantraConviction = false;
            bool CastLotd             = false;
            bool CastBoneArmor        = false;
            bool CastPotion           = false;
            bool CastStormArmor       = false;
            bool CastMagicWeapon      = false;
            bool CastVengeance        = false;
            bool CastRainOfVengeance  = false;
            bool CastPreparation      = false;
            bool CastSkeleMages       = false;
            bool CastSim              = false;
            bool ForceMove            = false;
            bool CastArcaneBlast      = false;


            bool IpEquipped               = false;
            bool WcEquipped               = false;
            bool FalterEquipped           = false;
            bool BerserkerEquipped        = false;
            bool SprintEquipped           = false;
            bool EpiphanyEquipped         = false;
            bool MantraHealingEquipped    = false;
            bool SweepingWindEquipped     = false;
            bool BohEquipped              = false;
            bool MantraConvictionEquipped = false;
            bool LotdEquipped             = false;
            bool BoneArmorEquipped        = false;
            bool StormArmorEquipped       = false;
            bool MagicWeaponEquipped      = false;
            bool VengeanceEquipped        = false;
            bool RainOfVengeanceEquipped  = false;
            bool PreparationEquipped      = false;
            bool SkeleMagesEquipped       = false;
            bool SimEquipped              = false;
            bool ArchonEquipped           = false;


            IWorldCoordinate MyPosition         = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate WizPosition        = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate MonkPosition       = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate NecroPosition      = Hud.Game.Players.First().FloorCoordinate;
            IWorldCoordinate ChargeBarbPosition = Hud.Game.Players.First().FloorCoordinate;

            BossIsSpawned = (Hud.Game.AliveMonsters.Count(m => m.SnoMonster.Priority == MonsterPriority.boss) > 0);

            int Range15Enemies = 0;
            int Range25Enemies = 0;
            int Range75Enemies = 0;

            var monsters2 = Hud.Game.AliveMonsters.Where(m => ((m.SummonerAcdDynamicId == 0 && m.IsElite) || !m.IsElite));

            foreach (var monster in monsters2)
            {
                if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 15)
                {
                    Range15Enemies++;
                }
                if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 25)
                {
                    Range25Enemies++;
                }
                if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 75)
                {
                    Range75Enemies++;
                }


                if ((monster.Rarity == ActorRarity.Unique) ||
                    (monster.Rarity == ActorRarity.Champion) ||
                    (monster.Rarity == ActorRarity.Rare) ||
                    (monster.SnoMonster.Priority == MonsterPriority.boss) ||
                    (monster.SnoActor.Sno == ActorSnoEnum._x1_pand_ext_ordnance_tower_shock_a))//shocktower
                {
                    if (monster.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= 70)
                    {
                        EliteInRange = true;
                    }
                }
            }

            foreach (var player in Hud.Game.Players)//me
            {
                if (!player.IsMe)
                {
                    continue;
                }
                MyPosition = player.FloorCoordinate;

                foreach (var i in _skillOrder)
                {
                    var skill = player.Powers.SkillSlots[i];
                    if (skill == null)
                    {
                        continue;
                    }
                    //barb
                    if (skill.SnoPower.Sno == 79528)//Barbarian_IgnorePain
                    {
                        IPOnCooldown = skill.IsOnCooldown;
                        IpEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 375483)// Barbarian_WarCry
                    {
                        WarCryBuffActive = skill.BuffIsActive;
                        WarCryOnCooldown = skill.IsOnCooldown;
                        WcEquipped       = true;
                        var buff = player.Powers.GetBuff(318821); //ChilaniksChain 318821 - ItemPassive_Unique_Ring_639_x1
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        ChilanikBuff = buff.TimeLeftSeconds[1] > 0.0;
                    }
                    if (skill.SnoPower.Sno == 79077)// Barbarian_ThreateningShout
                    {
                        FalterOnCooldown = skill.IsOnCooldown;
                        FalterEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 79607)// Barbarian_WrathOfTheBerserker
                    {
                        BerserkerBuffActive = skill.BuffIsActive;
                        BerserkerOnCooldown = skill.IsOnCooldown;
                        BerserkerEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 78551)// Barbarian_Sprint
                    {
                        SprintBuffActive = skill.BuffIsActive;
                        SprintOnCooldown = skill.IsOnCooldown;
                        SprintEquipped   = true;
                    }

                    //monk
                    if (skill.SnoPower.Sno == 312307)//Monk_Epiphany
                    {
                        EpiphanyEquipped   = true;
                        EpiphanyOnCooldown = skill.IsOnCooldown;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        EpiphanyBuffActive = buff.TimeLeftSeconds[0] > 0.5;
                    }
                    if (skill.SnoPower.Sno == 373143)//Monk_MantraOfHealing
                    {
                        MantraOfHealingOnCooldown = skill.IsOnCooldown;
                        MantraHealingEquipped     = true;
                    }

                    if (skill.SnoPower.Sno == 96090)//Monk_SweepingWind
                    {
                        SweepingWindEquipped = true;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            RecastSweepingWind = true;
                            continue;
                        }
                        RecastSweepingWind = skill.Buff.TimeLeftSeconds[0] < 1.0;
                    }

                    if (skill.SnoPower.Sno == 69130)//Monk_BreathOfHeaven
                    {
                        BohOnCooldown = skill.IsOnCooldown;
                        BohEquipped   = true;
                    }

                    if (skill.SnoPower.Sno == 375088)//Monk_MantraOfConviction
                    {
                        MantraConvictionEquipped = true;
                    }

                    //wizard
                    if (skill.SnoPower.Sno == 74499)//Wizard_StormArmor
                    {
                        StormArmorBuffActive = skill.BuffIsActive;
                        StormArmorOnCooldown = skill.IsOnCooldown;
                        StormArmorEquipped   = true;
                    }

                    if (skill.SnoPower.Sno == 76108)//Wizard_MagicWeapon
                    {
                        MagicWeaponBuffActive = skill.BuffIsActive;
                        MagicWeaponOnCooldown = skill.IsOnCooldown;
                        MagicWeaponEquipped   = true;
                    }

                    if (skill.SnoPower.Sno == 134872)//Wizard_Archon
                    {
                        var buff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Archon.Sno);
                        if (buff != null)
                        {
                            ArchonBuffActive = buff.TimeLeftSeconds[2] > 0.1;
                        }

                        var skill2 = player.Powers.SkillSlots[2];
                        ArcaneBlastOnCooldown = skill2.IsOnCooldown;
                        ArchonEquipped        = true;
                    }


                    //necro
                    if (skill.SnoPower.Sno == 466857)//Necromancer_BoneArmor
                    {
                        BoneArmorOnCooldown = skill.IsOnCooldown;
                        BoneArmorEquipped   = true;
                        if (skill.Buff != null)
                        {
                            BoneArmorAlmostRunningOut = skill.Buff.TimeLeftSeconds[0] < 30.0;
                        }
                    }
                    if (skill.SnoPower.Sno == 465839)                    //Necromancer_LandOfTheDead { get; }
                    {
                        //LotDBuffActive = skill.BuffIsActive;
                        LotDOnCooldown = skill.IsOnCooldown;
                        LotdEquipped   = true;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        LotDBuffActive = buff.TimeLeftSeconds[0] > 0.5;
                    }

                    if (skill.SnoPower.Sno == 462089)//Necromancer_SkeletalMage { get; }
                    {
                        SkeleMagesEquipped = true;
                        HashSet <ActorSnoEnum> SkeletonMageActorSNOs = new HashSet <ActorSnoEnum>
                        {
                            ActorSnoEnum._p6_necro_skeletonmage_a,                                                                            // Skeleton Mage - No Rune
                            ActorSnoEnum._p6_necro_skeletonmage_b,                                                                            // Skeleton Mage - Gift of Death
                            ActorSnoEnum._p6_necro_skeletonmage_e,                                                                            // Skeleton Mage - Contamination
                            ActorSnoEnum._p6_necro_skeletonmage_f_archer,                                                                     // Skeleton Mage - Archer
                            ActorSnoEnum._p6_necro_skeletonmage_c,                                                                            // Skeleton Mage - Singularity
                            ActorSnoEnum._p6_necro_skeletonmage_d                                                                             // Skeleton Mage - Life Support
                        };
                        var SkeletonMageActors = Hud.Game.Actors.Where(EachActor => SkeletonMageActorSNOs.Contains(EachActor.SnoActor.Sno) && // Find out which are skeleton mages actors
                                                                       EachActor.SummonerAcdDynamicId == Hud.Game.Me.SummonerId);             // Then find out if they are summoned by the player
                        NumberOfSkeleMages = SkeletonMageActors.Count();                                                                      // And then count how many are found
                    }

                    if (skill.SnoPower.Sno == 465350)//Necromancer_Simulacrum { get; }
                    {
                        SimOnCooldown = skill.IsOnCooldown;
                        SimEquipped   = true;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        SimBuffActive = buff.TimeLeftSeconds[0] > 0.0;
                    }


                    //dh
                    if (skill.SnoPower.Sno == 302846)//DemonHunter_Vengeance { get; }
                    {
                        VengeanceOnCooldown = skill.IsOnCooldown;
                        VengeanceEquipped   = true;
                        var buff = skill.Buff;
                        if ((buff == null) || (buff.IconCounts[0] <= 0))
                        {
                            continue;
                        }
                        VengeanceBuffActive = buff.TimeLeftSeconds[0] > 0.5;
                    }
                    if (skill.SnoPower.Sno == 130831)//DemonHunter_RainOfVengeance { get; }
                    {
                        RainOfVengeanceOnCooldown = skill.IsOnCooldown;
                        RainOfVengeanceEquipped   = true;
                    }
                    if (skill.SnoPower.Sno == 129212)//DemonHunter_Preparation { get; }
                    {
                        PreparationOnCooldown = skill.IsOnCooldown;
                        PreparationEquipped   = true;
                    }
                }
            }

            foreach (var player in Hud.Game.Players)//others
            {
                if (player.HeroClassDefinition.HeroClass == HeroClass.Barbarian)
                {
                    if (player.IsMe)
                    {
                        ImBarb = true;
                    }
                    else
                    {
                        BarbIngame        = true;
                        BarbHasValidActor = player.HasValidActor;
                        var EfficaciousToxin = player.Powers.GetBuff(403461);
                        if (EfficaciousToxin == null || !EfficaciousToxin.Active)
                        {
                            //chargebarb
                            ChargeBarbPosition = player.FloorCoordinate;
                        }
                        else
                        {
                            //zbarb
                        }
                    }
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.Wizard)
                {
                    if (player.IsMe)
                    {
                        ImWizard = true;
                        IBuff ConventionBuff = player.Powers.GetBuff(430674);
                        if ((ConventionBuff == null) || (ConventionBuff.IconCounts[0] <= 0))
                        {
                            continue;
                        }

                        ConventionLight  = ConventionBuff.IconCounts[5] != 0;
                        ConventionArcane = ConventionBuff.IconCounts[1] != 0;
                        ConventionCold   = ConventionBuff.IconCounts[2] != 0;
                        ConventionFire   = ConventionBuff.IconCounts[3] != 0;

                        IBuff BlackholeBuff = player.Powers.GetBuff(243141);
                        if (BlackholeBuff == null)
                        {
                            continue;
                        }
                        if (BlackholeBuff.IconCounts[5] <= 0)
                        {
                            continue;
                        }

                        BlackholeBuffActive = (BlackholeBuff.TimeLeftSeconds[5] > 3.5);
                    }
                    else
                    {
                        WizPosition  = player.FloorCoordinate;
                        WizardIngame = true;
                    }
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.Monk)
                {
                    if (player.IsMe)
                    {
                        ImMonk = true;
                    }
                    else
                    {
                        MonkPosition = player.FloorCoordinate;
                        MonkIngame   = true;
                    }
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.Necromancer)
                {
                    if (player.IsMe)
                    {
                        ImNecro = true;

                        var EfficaciousToxin = player.Powers.GetBuff(403461);
                        if (EfficaciousToxin == null || !EfficaciousToxin.Active)
                        {
                            //rat
                            ImZnec = false;
                        }
                        else
                        {
                            //znec
                            ImZnec = true;
                        }
                    }
                    else
                    {
                        NecroPosition = player.FloorCoordinate;
                        NecroIngame   = player.HasValidActor;
                    }
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.DemonHunter)
                {
                    if (player.IsMe)
                    {
                        ImDh = true;
                        IBuff NatBuff = player.Powers.GetBuff(434964);
                        if (NatBuff == null)
                        {
                            continue;
                        }
                        NatBuffActive = (NatBuff.TimeLeftSeconds[1] > 0.5);
                    }
                    else
                    {
                        //
                    }
                }
                if (player.HeroClassDefinition.HeroClass == HeroClass.Crusader)
                {
                    if (player.IsMe)
                    {
                        ImSader = true;
                    }
                    else
                    {
                        //
                    }
                }
            }

            WizDistance        = WizPosition.XYDistanceTo(MyPosition);
            MonkDistance       = MonkPosition.XYDistanceTo(MyPosition);
            NecroDistance      = NecroPosition.XYDistanceTo(MyPosition);
            ChargeBarbDistance = ChargeBarbPosition.XYDistanceTo(MyPosition);

            var Channelingbuff = Hud.Game.Me.Powers.GetBuff(266258);

            if ((Channelingbuff != null) && (Channelingbuff.IconCounts[0] > 0))
            {
                ChannelingRunningOut = (Channelingbuff.TimeLeftSeconds[0] < 2.0d);
            }

            var  TargetedMonster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1;
            bool EliteTargeted   = false;

            if (TargetedMonster != null)
            {
                //EliteTargeted = TargetedMonster.IsElite;
                EliteTargeted = (TargetedMonster.Rarity == ActorRarity.Unique) ||
                                (TargetedMonster.Rarity == ActorRarity.Champion) ||
                                (TargetedMonster.Rarity == ActorRarity.Rare) ||
                                (TargetedMonster.SnoMonster.Priority == MonsterPriority.boss) ||
                                (TargetedMonster.SnoActor.Sno == ActorSnoEnum._x1_pand_ext_ordnance_tower_shock_a);//shocktower
            }


            InARift = (Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift);
            Active  = true;
            Active  = Active && Hud.Game.IsInGame;
            Active  = Active && !Hud.Game.IsLoading;
            Active  = Active && !Hud.Game.IsInTown;
            Active  = Active && !Hud.Game.Me.IsDead;
            Active  = Active && !Hud.Render.UiHidden;
            Active  = Active && Hud.Game.MapMode == MapMode.Minimap;
            Active  = Active && (Hud.Game.Me.AnimationState != AcdAnimationState.CastingPortal && Hud.Game.Me.AnimationState != AcdAnimationState.Dead);

            bool GRGuardianIsDead = false;
            var  riftQuest        = Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 337492) ??
                                    Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 382695);

            if (riftQuest != null)
            {
                if (Hud.Game.Monsters.Any(m => m.Rarity == ActorRarity.Boss && !m.IsAlive))
                {
                    GRGuardianIsDead = true;
                }
                else
                {
                    GRGuardianIsDead = (riftQuest.QuestStepId == 34 || riftQuest.QuestStepId == 46);
                };
            }

            Active = Active && !GRGuardianIsDead;


            double Cooldown           = (Hud.Game.Me.Powers.HealthPotionSkill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60d;
            bool   PotionIsOnCooldown = Cooldown <= 30 && Cooldown >= 0 ? true : false;

            bool WizInIpRange;

            if (WizardIngame && MonkIngame)
            {
                if ((WizPosition.XYDistanceTo(MonkPosition) > 50) || !MonkIngame)
                {
                    WizInIpRange = (WizDistance <= 45);
                }
                else
                {
                    WizInIpRange = (Math.Max(WizDistance, MonkDistance) <= 45);
                }

                CastIp = !IPOnCooldown && IpEquipped && (!BossIsSpawned && WizInIpRange ||
                                                         BossIsSpawned && (NecroDistance <= 45));
                CastFalter = FalterEquipped && !FalterOnCooldown && (!BossIsSpawned && (WizDistance <= 20) ||
                                                                     BossIsSpawned);
                CastWc = WcEquipped && !WarCryOnCooldown && (!ChilanikBuff || NecroDistance <= 100);
            }
            else
            {
                CastIp     = !IPOnCooldown && IpEquipped && (Hud.Game.NumberOfPlayersInGame == (Hud.Game.Players.Where(p => p.CentralXyDistanceToMe <= 45)).Count());
                CastFalter = FalterEquipped && !FalterOnCooldown;
                CastWc     = (WcEquipped && !WarCryOnCooldown && (!ChilanikBuff || (Hud.Game.NumberOfPlayersInGame == (Hud.Game.Players.Where(p => p.CentralXyDistanceToMe <= 45)).Count())));
            }



            CastBerserker        = BerserkerEquipped && !BerserkerOnCooldown && !BerserkerBuffActive;
            CastSprint           = SprintEquipped && !SprintOnCooldown && Hud.Game.Me.Stats.ResourceCurFury >= (Hud.Game.Me.Stats.ResourceMaxFury / 2.0) && !SprintBuffActive;
            CastEpiphany         = EpiphanyEquipped && !EpiphanyOnCooldown && !EpiphanyBuffActive;
            CastMantraHealing    = MantraHealingEquipped && !MantraOfHealingOnCooldown && Hud.Game.Me.Stats.ResourceCurSpirit >= (Hud.Game.Me.Stats.ResourceMaxSpirit / 2.0);
            CastSweepingWind     = SweepingWindEquipped && RecastSweepingWind && Hud.Game.Me.Stats.ResourceCurSpirit >= (Hud.Game.Me.Stats.ResourceMaxSpirit / 2.0);
            CastBoh              = BohEquipped && !BohOnCooldown && ((Hud.Game.SpecialArea == SpecialArea.Rift) || BarbIngame && (ChargeBarbDistance <= 12) && BarbHasValidActor);
            CastMantraConviction = MantraConvictionEquipped && Hud.Game.Me.Stats.ResourceCurSpirit >= (Hud.Game.Me.Stats.ResourceMaxSpirit / 2.0);
            CastLotd             = LotdEquipped && !LotDOnCooldown && !LotDBuffActive && (Range75Enemies >= 1);
            //CastBoneArmor = BoneArmorEquipped && (((BoneArmorAlmostRunningOut && (Range25Enemies >= 1)) ||
            //                  (!BoneArmorAlmostRunningOut && (Range25Enemies >= 5))) &&
            //                  !BoneArmorOnCooldown);
            CastBoneArmor       = BoneArmorEquipped && (Range25Enemies >= 1) && !BoneArmorOnCooldown;
            RiftJustStarted     = (((Hud.Game.CurrentTimedEventEndTick - (double)Hud.Game.CurrentGameTick) / 60.0d) > 890.0d);
            CastSim             = InARift && SimEquipped && !SimOnCooldown && (!(Hud.Game.Me.Stats.ResourceMaxEssence > 450) || ChannelingRunningOut);//have sim because of reservoir
            CastPotion          = Hud.Game.Me.Defense.HealthCur <= (Hud.Game.Me.Defense.HealthMax * 0.35) && !PotionIsOnCooldown;
            CastStormArmor      = StormArmorEquipped && !StormArmorOnCooldown && !StormArmorBuffActive;
            CastMagicWeapon     = MagicWeaponEquipped && !MagicWeaponOnCooldown && !MagicWeaponBuffActive;
            CastVengeance       = VengeanceEquipped && !VengeanceOnCooldown && !VengeanceBuffActive;
            CastRainOfVengeance = RainOfVengeanceEquipped && !RainOfVengeanceOnCooldown && !NatBuffActive;
            CastPreparation     = PreparationEquipped && !PreparationOnCooldown && !(Hud.Game.Me.Stats.ResourceCurDiscipline >= (Hud.Game.Me.Stats.ResourceMaxDiscipline - 30));
            ForceMove           = InARift && !ImZnec && (Hud.Game.Me.AnimationState == AcdAnimationState.Idle || Hud.Game.Me.AnimationState == AcdAnimationState.Casting);
            CastArcaneBlast     = ArchonBuffActive && ArchonEquipped && !ArcaneBlastOnCooldown && (Range15Enemies > 0);

            CastSkeleMages = InARift && SkeleMagesEquipped && (Hud.Game.Me.Stats.ResourceCurEssence >= Hud.Game.Me.Stats.ResourceMaxEssence * 0.95) && (EliteInRange && EliteTargeted || !EliteInRange && (NumberOfSkeleMages < 10));
            Byte[] Bytes = new Byte[8];

            Bytes[0] = Set(Bytes[0], 0, true);
            Bytes[0] = Set(Bytes[0], 1, Active);
            Bytes[0] = Set(Bytes[0], 2, ImBarb);
            Bytes[0] = Set(Bytes[0], 3, ImMonk);
            Bytes[0] = Set(Bytes[0], 4, ImWizard);
            Bytes[0] = Set(Bytes[0], 5, ImNecro);
            Bytes[0] = Set(Bytes[0], 6, ImDh);
            Bytes[0] = Set(Bytes[0], 7, ImSader);

            Bytes[1] = Set(Bytes[1], 0, true);
            Bytes[1] = Set(Bytes[1], 1, ConventionLight);
            Bytes[1] = Set(Bytes[1], 2, ConventionArcane);
            Bytes[1] = Set(Bytes[1], 3, ConventionCold);
            Bytes[1] = Set(Bytes[1], 4, ConventionFire);
            Bytes[1] = Set(Bytes[1], 5, BlackholeBuffActive);
            Bytes[1] = Set(Bytes[1], 6, CastArcaneBlast);
            Bytes[1] = Set(Bytes[1], 7, false);

            Bytes[2] = Set(Bytes[2], 0, true);
            Bytes[2] = Set(Bytes[2], 1, CastIp);
            Bytes[2] = Set(Bytes[2], 2, WarCryBuffActive);
            Bytes[2] = Set(Bytes[2], 3, BerserkerBuffActive);
            Bytes[2] = Set(Bytes[2], 4, EpiphanyBuffActive);
            Bytes[2] = Set(Bytes[2], 5, LotDOnCooldown);
            Bytes[2] = Set(Bytes[2], 6, LotDBuffActive);
            Bytes[2] = Set(Bytes[2], 7, Hud.Game.Me.Stats.ResourceCurFury >= (Hud.Game.Me.Stats.ResourceMaxFury / 2.0));

            Bytes[3] = Set(Bytes[3], 0, true);
            Bytes[3] = Set(Bytes[3], 1, CastIp);
            Bytes[3] = Set(Bytes[3], 2, CastSim);
            Bytes[3] = Set(Bytes[3], 3, RiftJustStarted);
            Bytes[3] = Set(Bytes[3], 4, CastFalter);
            Bytes[3] = Set(Bytes[3], 5, CastBerserker);
            Bytes[3] = Set(Bytes[3], 6, CastSprint);
            Bytes[3] = Set(Bytes[3], 7, CastEpiphany);

            Bytes[4] = Set(Bytes[4], 0, true);
            Bytes[4] = Set(Bytes[4], 1, CastWc);
            Bytes[4] = Set(Bytes[4], 2, CastMantraHealing);
            Bytes[4] = Set(Bytes[4], 3, CastSweepingWind);
            Bytes[4] = Set(Bytes[4], 4, CastBoh);
            Bytes[4] = Set(Bytes[4], 5, CastMantraConviction);
            Bytes[4] = Set(Bytes[4], 6, CastLotd);
            Bytes[4] = Set(Bytes[4], 7, CastBoneArmor);

            Bytes[5] = Set(Bytes[5], 0, true);
            Bytes[5] = Set(Bytes[5], 1, CastPotion);
            Bytes[5] = Set(Bytes[5], 2, CastStormArmor);
            Bytes[5] = Set(Bytes[5], 3, CastMagicWeapon);
            Bytes[5] = Set(Bytes[5], 4, CastVengeance);
            Bytes[5] = Set(Bytes[5], 5, CastRainOfVengeance);
            Bytes[5] = Set(Bytes[5], 6, CastPreparation);
            Bytes[5] = Set(Bytes[5], 7, CastSkeleMages);

            Bytes[6] = Set(Bytes[6], 0, true);
            Bytes[6] = Set(Bytes[6], 1, ForceMove);

            Bytes[7] = Set(Bytes[7], 0, true);

            if (Enabled)
            {
                stream.Write(Bytes, 0, Bytes.Length);
            }
            System.Threading.Thread.Sleep(2);

            if (Hud.Render.UiHidden)
            {
                return;
            }
            float x = -Hud.Window.Size.Width * 0.001f;
            float y = Hud.Window.Size.Height * 0.965f;

            logoDecorator.Paint(x, y, 30.0f, 30.0f, HorizontalAlign.Center);

            if (Show)
            {
                float XPos = Hud.Window.Size.Width * 0.01f;
                float YPos = Hud.Window.Size.Height * 0.665f;
                textBuilder.Clear();

                Active = true;
                Active = Active && Hud.Game.IsInGame;
                Active = Active && !Hud.Game.IsPaused;
                Active = Active && !Hud.Game.IsLoading;
                Active = Active && !Hud.Game.IsInTown;
                Active = Active && !Hud.Game.Me.IsDead;
                Active = Active && !Hud.Render.UiHidden;
                Active = Active && Hud.Game.MapMode == MapMode.Minimap;
                Active = Active && (Hud.Game.Me.AnimationState != AcdAnimationState.CastingPortal && Hud.Game.Me.AnimationState != AcdAnimationState.Dead);
                Active = Active && (Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift);

                textBuilder.AppendFormat("IsInGame: {0}", Hud.Game.IsInGame);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("IsPaused: {0}", Hud.Game.IsPaused);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("IsLoading: {0}", Hud.Game.IsLoading);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("IsDead: {0}", Hud.Game.Me.IsDead);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("UiHidden: {0}", Hud.Render.UiHidden);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("Minimap: {0}", Hud.Game.MapMode == MapMode.Minimap);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("dead or portal: {0}", (Hud.Game.Me.AnimationState != AcdAnimationState.CastingPortal && Hud.Game.Me.AnimationState != AcdAnimationState.Dead));
                textBuilder.AppendLine();
                textBuilder.AppendFormat("in rift: {0}", (Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift));
                textBuilder.AppendLine();



                var layout = Font.GetTextLayout(textBuilder.ToString());
                Font.DrawText(layout, XPos, YPos);
            }
        }
示例#16
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            var inRift = Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift;
            var inGR   = Hud.Game.SpecialArea == SpecialArea.GreaterRift;

            if (DefaultTextFont == null)
            {
                return;
            }

            double totalMonsterRiftProgression = 0;
            double TrashMonsterRiftProgression = 0;
            double EliteProgression            = 0;
            double RareMinionProgression       = 0;
            double RiftGlobeProgression        = 0;
            double curseHealth = 0;

            double[] CondiAdjustment = new double[] { 0, 0, 0, 0, 0, 0, 0 };

            int monstersCount   = 0;
            int EliteCount      = 0;
            int RareMinionCount = 0;
            int ElitePackCount  = 0;
            // Frailty
            int FrailtyCount      = 0;
            int EliteFrailtyCount = 0;
            // Leech
            int LeechCount      = 0;
            int EliteLeechCount = 0;
            // Decrepify
            int DecrepifyCount      = 0;
            int EliteDecrepifyCount = 0;

            float XPos = Hud.Window.Size.Width * XWidth;
            float YPos = Hud.Window.Size.Height * YHeight;

            var monsters = Hud.Game.AliveMonsters.Where(m => ((m.SummonerAcdDynamicId == 0 && m.IsElite) || !m.IsElite) && m.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard);
            Dictionary <IMonster, string> eliteGroup = new Dictionary <IMonster, string>();

            foreach (var monster in monsters)
            {
                var Elite = monster.Rarity == ActorRarity.Rare || monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss;
                monstersCount++;

                if (inRift)
                {
                    double monsterHP = monster.CurHealth;
                    var    curse     = monster.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471845);//471845	1	power: Frailty
                    if (curse == 1)
                    {
                        monsterHP -= monster.MaxHealth * 0.15;
                    }
                    if (monsterHP <= 0)
                    {
                        monsterHP = 0;
                    }
                    curseHealth += monsterHP;

                    //if there are less than 7 enemies artificially increase the health to compensate less ticks on condi
                    for (int k = 0; k < 7; k++)
                    {
                        if (monsterHP > CondiAdjustment[k])
                        {
                            for (int j = 6; j > k; j--)
                            {
                                CondiAdjustment[j] = CondiAdjustment[j - 1];
                            }
                            CondiAdjustment[k] = monsterHP;
                            break;
                        }
                    }
                }

                if (!monster.IsElite)
                {
                    if (inRift)
                    {
                        TrashMonsterRiftProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                    }
                }
                else
                {
                    if (monster.Rarity == ActorRarity.RareMinion)
                    {
                        RareMinionCount++;
                        if (inRift)
                        {
                            RareMinionProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                        }
                    }
                    else
                    {
                        if (monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss)
                        {
                            EliteCount++;
                            ElitePackCount++;
                        }

                        if (monster.Rarity == ActorRarity.Champion)
                        {
                            EliteCount++;
                            eliteGroup.Add(monster, String.Join(", ", monster.AffixSnoList));
                            if (inRift)
                            {
                                EliteProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                            }
                        }

                        if (monster.Rarity == ActorRarity.Rare)
                        {
                            EliteCount++;
                            ElitePackCount++;
                            if (inRift)
                            {
                                EliteProgression += 4 * 1.15d;
                                EliteProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                            }
                        }
                    }
                }
                var test = monster.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471845);//471845	1	power: Frailty
                if (test == -1)
                {
                    if (ShowCursedCount)
                    {
                        FrailtyCount++;
                        if (Elite)
                        {
                            EliteFrailtyCount++;
                        }
                    }
                }
                test = monster.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471869);//471869	1	power: Leech
                if (test == -1)
                {
                    if (ShowCursedCount)
                    {
                        LeechCount++;
                        if (Elite)
                        {
                            EliteLeechCount++;
                        }
                    }
                }
                test = monster.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471738);//471738	1	power: Decrepify
                if (test == -1)
                {
                    if (ShowCursedCount)
                    {
                        DecrepifyCount++;
                        if (Elite)
                        {
                            EliteDecrepifyCount++;
                        }
                    }
                }
            }
            Dictionary <IMonster, string> eliteGroup1 = eliteGroup.OrderBy(p => p.Value).ToDictionary(p => p.Key, o => o.Value);
            //if (monstersCount == 0) return;
            var actors = Hud.Game.Actors.Where(x => x.SnoActor.Kind == ActorKind.RiftOrb);

            foreach (var actor in actors)
            {
                RiftGlobeProgression += 1.15d;
            }
            string preStr = null;

            foreach (var elite in eliteGroup1)
            {
                if (elite.Key.Rarity == ActorRarity.Champion)
                {
                    if (preStr != elite.Value)
                    {
                        EliteProgression += 3 * 1.15f;
                        ElitePackCount++;
                    }
                    preStr = elite.Value;
                }
            }
            textBuilder.Clear();
            if (ShowMonstersCount && !inRift)
            {
                textBuilder.AppendFormat("Monsters: {0}", monstersCount);
                textBuilder.AppendLine();
                if (EliteCount > 0)
                {
                    textBuilder.AppendFormat("Elite: {0}(Pack: {1})", EliteCount, ElitePackCount);
                }
                if (RareMinionCount > 0)
                {
                    textBuilder.AppendFormat("Minion: {0}", RareMinionCount);
                }
                textBuilder.AppendLine();
            }

            if (inRift)
            {
                totalMonsterRiftProgression = TrashMonsterRiftProgression + EliteProgression + RareMinionProgression + RiftGlobeProgression;
                long totalTime      = (long)totalMonsterRiftProgression * 90000000;
                long TrashTime      = (long)TrashMonsterRiftProgression * 90000000;
                long EliteTime      = (long)EliteProgression * 90000000;
                long RareMinionTime = (long)RareMinionProgression * 90000000;
                long RiftGlobeTime  = (long)RiftGlobeProgression * 90000000;



                if (ShowMonstersCount)
                {
                    textBuilder.AppendFormat("Monsters: {0} TotalRP: {1}%", monstersCount, (totalMonsterRiftProgression + Hud.Game.RiftPercentage).ToString("f2"));
                    textBuilder.AppendLine();
                    if (EliteCount > 0)
                    {
                        textBuilder.AppendFormat("Elite: {0}(Pack: {1})", EliteCount, ElitePackCount);
                    }
                    if (RareMinionCount > 0)
                    {
                        textBuilder.AppendFormat("Minion: {0}", RareMinionCount);
                    }
                    textBuilder.AppendLine();
                }

                if (totalMonsterRiftProgression > 0 && ShowTotalProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("TotalRP: {0}% = {1}", totalMonsterRiftProgression.ToString("f2"), ValueToString((long)totalTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("TotalRP: {0}%", totalMonsterRiftProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }

                if (TrashMonsterRiftProgression > 0 && ShowTrashProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("TrashRP: {0}% = {1}", TrashMonsterRiftProgression.ToString("f2"), ValueToString((long)TrashTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("TrashRP: {0}%", TrashMonsterRiftProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (EliteProgression > 0 && ShowEliteProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("EliteRP: {0}% = {1}", EliteProgression.ToString("f2"), ValueToString((long)EliteTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("EliteRP: {0}%", EliteProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (RareMinionProgression > 0 && ShowRareMinionProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("MinionRP: {0}% = {1}", RareMinionProgression.ToString("f2"), ValueToString((long)RareMinionTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("MinionRP: {0}%", RareMinionProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (RiftGlobeProgression > 0 && ShowRiftGlobeProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("GlobeRP: {0}% = {1}", RiftGlobeProgression.ToString("f2"), ValueToString((long)RiftGlobeTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("GlobeRP: {0}%", RiftGlobeProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
            }
            if (ShowCursedCount)
            {
                textBuilder.AppendFormat("Not Cursed: F{0}({1}) L{2}({3}) D{4}({5})", FrailtyCount, EliteFrailtyCount, LeechCount, EliteLeechCount, DecrepifyCount, EliteDecrepifyCount);
                textBuilder.AppendLine();
            }

            double condiDamage = 610248.7;

            if (Hud.Game.Me.InGreaterRift)
            {
                //adjust condi damage if you have <7 targets
                for (int i = 0; i < 6; i++)
                {
                    CondiAdjustment[i] = CondiAdjustment[i] - CondiAdjustment[i + 1];
                }
                for (int i = 0; i < 6; i++)
                {
                    curseHealth += CondiAdjustment[i] * (6 - i);
                }
                condiDamage *= 1463698.8;
                condiDamage /= Math.Pow(1.17, 90);
                condiDamage *= Math.Pow(1.17, Hud.Game.Me.InGreaterRiftRank);
                condiDamage *= 0.4;

                curseHealth /= condiDamage;
                curseHealth /= 2;
                curseHealth /= 4;
                curseHealth /= 7;
            }


            textBuilder.AppendFormat("condi: {0:0.00}", curseHealth);
            textBuilder.AppendLine();

            //DEBUG
            //DEBUG
            //HexingPantsOfMrYan { get; } // 318817 - ItemPassive_Unique_Ring_635_x1
            var buff = Hud.Game.Me.Powers.GetBuff(318817);

            if ((buff != null) && (buff.IconCounts[0] > 0))
            {
                textBuilder.AppendFormat("Hexing: {0}", buff.IconCounts[1]);
                textBuilder.AppendLine();
            }

            int[] _skillOrder = { 2, 3, 4, 5, 0, 1 };
            foreach (var player in Hud.Game.Players)//others
            {
                if (player.HeroClassDefinition.HeroClass == HeroClass.Wizard)
                {
                    foreach (var i in _skillOrder)
                    {
                        var skill = player.Powers.SkillSlots[i];
                        if (skill == null || skill.SnoPower.Sno != 134872)
                        {
                            continue;                                                //Archon
                        }
                        textBuilder.AppendFormat("{0:0.00}", skill.Rune);
                    }
                }
            }


            if (totalMonsterRiftProgression >= (100.0d - 5.83d) - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100 || totalMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100 || TrashMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
            {
                if (totalMonsterRiftProgression >= (100.0d - 5.83d) - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
                {
                    currentFont = GreenTextFont;
                }
                if (totalMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
                {
                    currentFont = OrangeTextFont;
                }
                if (TrashMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
                {
                    currentFont = RedTextFont;
                }
            }
            else
            {
                currentFont = DefaultTextFont;
            }
            var layout = currentFont.GetTextLayout(textBuilder.ToString());

            currentFont.DrawText(layout, XPos, YPos);
        }
示例#17
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            float x          = Hud.Window.Size.Width * 0.42f;
            float y          = Hud.Window.Size.Height * 0.11f;
            float sizex      = Hud.Window.Size.Width * 0.16f;
            float sizey      = Hud.Window.Size.Height * 0.02f;
            float textx      = Hud.Window.Size.Width * 0.498f;
            float texty      = Hud.Window.Size.Height * 0.111f;
            float MeteorOcux = Hud.Window.Size.Width * 0.505f;
            float MeteorOcuy = Hud.Window.Size.Height * 0.131f;
            float Meteorx    = Hud.Window.Size.Width * 0.421f;
            float Meteory    = Hud.Window.Size.Height * 0.131f;

            textBuilder.Clear();

            var ATleft = (ArchonLeft - Hud.Game.CurrentGameTick) / 60.0d;

            WizIngame = false;
            foreach (var player in Hud.Game.Players)
            {
                if (player.HeroClassDefinition.HeroClass == HeroClass.Wizard)
                {
                    WizIngame = true;
                    foreach (var i in _skillOrder)
                    {
                        var skill = player.Powers.SkillSlots[i];
                        if (skill == null || skill.SnoPower.Sno != 134872)
                        {
                            continue;                                                //Archon
                        }
                        Cooldown = (skill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60.0d;

                        var buff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Archon.Sno);
                        if (buff != null)
                        {
                            ArchonTimeLeft = buff.TimeLeftSeconds[2];
                            if (player.HasValidActor && buff.TimeLeftSeconds[2] > 0.0)
                            {
                                ArchonLeft = Hud.Game.CurrentGameTick + ArchonTimeLeft * 60.0d;
                            }
                        }
                        ATleft = (ArchonLeft - Hud.Game.CurrentGameTick) / 60.0d;
                        if (ATleft > 0)
                        {
                            textBuilder.AppendFormat("{0:0}", ATleft);
                        }
                        else
                        {
                            textBuilder.AppendFormat("{0:0}", 12.0 + ATleft);
                        }
                        // DEBUG

                        /*
                         * textBuilder.AppendLine();
                         * textBuilder.AppendFormat("{0:0.00}", ATleft);
                         * textBuilder.AppendLine();
                         * textBuilder.AppendFormat("{0:0.00}", ArchonLeft);*/
                    }
                }
            }

            if (WizIngame)
            {
                if (ATleft <= 0.0)       //outside
                {
                    if (ATleft >= -12.0) //not bugged
                    {
                        BackgroundBrush.DrawRectangle(x, y, sizex, sizey);
                        TimerOutsideBrush.DrawRectangle(x, y, sizex * (float)((12.0 + ATleft) / 12.0), sizey);
                        BorderBrush.DrawLine(x, y, x + sizex, y, 0.6f);
                        BorderBrush.DrawLine(x + sizex, y, x + sizex, y + sizey, BorderSize);
                        BorderBrush.DrawLine(x, y + sizey, x + sizex, y + sizey, BorderSize);
                        BorderBrush.DrawLine(x, y, x, y + sizey, 0.6f);

                        Hud.Texture.GetTexture(Hud.Sno.GetSnoPower(69190).NormalIconTextureId).Draw(MeteorOcux, MeteorOcuy, 28.0f, 28.0f); //Wizard_Meteor { get; } // 69190
                        Hud.Texture.GetTexture(Hud.Sno.GetSnoPower(69190).NormalIconTextureId).Draw(Meteorx, Meteory, 28.0f, 28.0f);       //Wizard_Meteor { get; } // 69190
                    }
                    var layout = RedFont.GetTextLayout(textBuilder.ToString());
                    RedFont.DrawText(layout, textx, texty);
                }
                else//in archon
                {
                    if (ATleft <= 20)//not bugged
                    {
                        BackgroundBrush.DrawRectangle(x, y, sizex, sizey);
                        if (ATleft >= 5.0)
                        {
                            TimerArchonBrush.DrawRectangle(x, y, sizex * (float)(ATleft / 20.0), sizey);
                        }
                        else
                        {
                            TimerArchonWarningBrush.DrawRectangle(x, y, sizex * (float)(ATleft / 20.0), sizey);
                        }
                        BorderBrush.DrawLine(x, y, x + sizex, y, 0.6f);
                        BorderBrush.DrawLine(x + sizex, y, x + sizex, y + sizey, BorderSize);
                        BorderBrush.DrawLine(x, y + sizey, x + sizex, y + sizey, BorderSize);
                        BorderBrush.DrawLine(x, y, x, y + sizey, 0.6f);
                    }
                    var layout = GreenFont.GetTextLayout(textBuilder.ToString());
                    GreenFont.DrawText(layout, textx, texty);
                }
            }
        }
示例#18
0
        private float AfijosColores(MonsterAffix afijo, float coordx, float coordy)
        {
            ColorA = null;
            switch (afijo)
            {
            case MonsterAffix.Frozen:
                ColorA = AzulFFontA;
                break;

            case MonsterAffix.FrozenPulse:
                ColorA = Azul1;
                break;

            case MonsterAffix.Wormhole:
                ColorA = RojoFontA;
                break;

            case MonsterAffix.Illusionist:
                ColorA = VerdeCFontA;
                break;

            case MonsterAffix.Juggernaut:
                ColorA = JugFontA;
                break;

            case MonsterAffix.Waller:
                ColorA = MarronFontA;
                break;

            case MonsterAffix.Arcane:
                ColorA = MoradoFontA;
                break;

            case MonsterAffix.HealthLink:
                ColorA = AzulFontA;
                break;

            case MonsterAffix.Thunderstorm:
                ColorA = AmarilloFontA;
                break;

            case MonsterAffix.Shielding:
                ColorA = GrisFontA;
                break;

            case MonsterAffix.Desecrator:
                ColorA = Rosa1;
                break;

            case MonsterAffix.Molten:
                ColorA = Red1;
                break;

            case MonsterAffix.FireChains:
                ColorA = Red2;
                break;

            case MonsterAffix.Teleporter:
                ColorA = TeleportFontA;
                break;

            case MonsterAffix.Mortar:
                ColorA = GrisFontA;
                break;

            case MonsterAffix.Poison:
                ColorA = Verde2;
                break;

            case MonsterAffix.Plagued:
                ColorA = Verde1;
                break;

            case MonsterAffix.Horde:
                ColorA = HordaFontA;
                break;

            case MonsterAffix.Electrified:
                ColorA = Amarelo1;
                break;

            default:
                ColorA = LightFont;
                break;
            }
            var d = ColorA.GetTextLayout(DisplayAffix[afijo]);

            ColorA.DrawText(d, coordx, coordy);
            return(coordx + LightFont.GetTextLayout("-").Metrics.Width + d.Metrics.Width);
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            float x = Hud.Window.Size.Width * 0.8f;
            float y = Hud.Window.Size.Height * 0.01f;

            textBuilder.Clear();

            HashSet <string> MonstersOnTheScreen = new HashSet <string>();

            var monsters = Hud.Game.AliveMonsters.Where(m => (!m.IsElite));

            foreach (var monster in monsters)
            {
                if (monster.Rarity == ActorRarity.Normal)
                {
                    MonstersOnTheScreen.Add(monster.SnoMonster.NameEnglish);
                }
            }

            var BadMonsters = new List <string>
            {
                "Shock Tower", "Hell Bringer", "Blazing Swordwielder", "Bloated Corpse", "Spiderling"
            };

            foreach (string monstername in BadMonsters)
            {
                if (MonstersOnTheScreen.Contains(monstername))
                {
                    MonstersOnTheScreen.Remove(monstername);
                }
            }
            //DEBUG
            if (Show)
            {
                foreach (string monstername in MonstersOnTheScreen)
                {
                    textBuilder.AppendFormat("{0}", monstername);
                    textBuilder.AppendLine();
                }
                textBuilder.AppendLine();
            }
            List <MonsterSet> MatchingMonsterSets = new List <MonsterSet>();

            foreach (MonsterSet monsterset in MonsterSetList)
            {
                MatchingMonsterSets.Add(new MonsterSet(monsterset.Name, monsterset.Monsters));
            }


            List <MonsterSet> RemoveList = new List <MonsterSet>();

            foreach (string monster in MonstersOnTheScreen)
            {
                foreach (MonsterSet monsterset in MatchingMonsterSets)//see if the monster fits the monsterset
                {
                    //if monster is not in the monsterset delete the monsterset
                    if (!monsterset.Monsters.Contains(monster))
                    {
                        RemoveList.Add(monsterset);
                    }
                }
                foreach (MonsterSet monsterset in RemoveList)
                {
                    MatchingMonsterSets.Remove(monsterset);
                }
            }
            if (MatchingMonsterSets.Count < 20)
            {
                foreach (MonsterSet monsterset in MatchingMonsterSets)
                {
                    textBuilder.AppendFormat("{0}", monsterset.Name);
                    textBuilder.AppendLine();
                }
            }

            var layout = WhiteFont.GetTextLayout(textBuilder.ToString());

            WhiteFont.DrawText(layout, x, y);
        }
示例#20
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            var inRift = Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift;
            var inGR   = Hud.Game.SpecialArea == SpecialArea.GreaterRift;

            if (DefaultTextFont == null)
            {
                return;
            }

            double totalMonsterRiftProgression = 0;
            double TrashMonsterRiftProgression = 0;
            double EliteProgression            = 0;
            double RareMinionProgression       = 0;
            double RiftGlobeProgression        = 0;

            int monstersCount   = 0;
            int minMonsterCount = 0;
            int sytherCount     = 0;
            int EliteCount      = 0;
            int RareMinionCount = 0;
            int ElitePackCount  = 0;
            // locust
            int locustCount      = 0;
            int ElitelocustCount = 0;
            // haunted
            int hauntedCount      = 0;
            int ElitehauntedCount = 0;
            //Palmed
            int palmedCount      = 0;
            int ElitepalmedCount = 0;
            //Phoenixed BUG? http://turbohud.freeforums.net/thread/3945/monster-phoenixed
            int phoenixedCount      = 0;
            int ElitephoenixedCount = 0;
            //Strongarmed Obsolete
            int   strongarmedCount      = 0;
            int   ElitestrongarmedCount = 0;
            int   ddalHealth            = 30;
            float XPos = Hud.Window.Size.Width * XWidth;
            float YPos = Hud.Window.Size.Height * YHeight;

            var monsters = Hud.Game.AliveMonsters.Where(m => ((m.SummonerAcdDynamicId == 0 && m.IsElite) || !m.IsElite) && m.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard);
            Dictionary <IMonster, string> eliteGroup = new Dictionary <IMonster, string>();

            foreach (var monster in monsters)
            {
                var Elite = monster.Rarity == ActorRarity.Rare || monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss;
                monstersCount++;
                if (!monster.IsElite)
                {
                    if (inRift)
                    {
                        TrashMonsterRiftProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                        var health = monster.CurHealth / (monster.MaxHealth / 100.0f);
                        if (health < ddalHealth)
                        {
                            minMonsterCount++;
                        }

                        if (health < 15)
                        {
                            sytherCount++;
                        }
                    }
                }
                else
                {
                    if (monster.Rarity == ActorRarity.RareMinion)
                    {
                        RareMinionCount++;
                        if (inRift)
                        {
                            RareMinionProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                        }
                    }
                    else
                    {
                        if (monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss)
                        {
                            EliteCount++;
                            ElitePackCount++;
                        }

                        if (monster.Rarity == ActorRarity.Champion)
                        {
                            EliteCount++;
                            eliteGroup.Add(monster, String.Join(", ", monster.AffixSnoList));
                            if (inRift)
                            {
                                EliteProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                            }
                        }

                        if (monster.Rarity == ActorRarity.Rare)
                        {
                            EliteCount++;
                            ElitePackCount++;
                            if (inRift)
                            {
                                EliteProgression += 4 * 1.15d;
                                EliteProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                            }
                        }
                    }
                }
                if (monster.Locust && ShowLlocustCount)
                {
                    locustCount++;
                    if (Elite)
                    {
                        ElitelocustCount++;
                    }
                }
                if (monster.Haunted && ShowHauntedCount)
                {
                    hauntedCount++;
                    if (Elite)
                    {
                        ElitehauntedCount++;
                    }
                }
                if (monster.Palmed && ShowPalmedCount)
                {
                    palmedCount++;
                    if (Elite)
                    {
                        ElitepalmedCount++;
                    }
                }
                if (monster.Phoenixed && ShowPhoenixedCount)
                {
                    phoenixedCount++;
                    if (Elite)
                    {
                        ElitephoenixedCount++;
                    }
                }
                if (monster.Strongarmed && ShowStrongarmedCount)
                {
                    strongarmedCount++;
                    if (Elite)
                    {
                        ElitestrongarmedCount++;
                    }
                }
            }
            Dictionary <IMonster, string> eliteGroup1 = eliteGroup.OrderBy(p => p.Value).ToDictionary(p => p.Key, o => o.Value);
            var actors = Hud.Game.Actors.Where(x => x.SnoActor.Kind == ActorKind.RiftOrb);

            foreach (var actor in actors)
            {
                RiftGlobeProgression += 1.15d;
            }
            string preStr = null;

            foreach (var elite in eliteGroup1)
            {
                if (elite.Key.Rarity == ActorRarity.Champion)
                {
                    if (preStr != elite.Value)
                    {
                        EliteProgression += 3 * 1.15f;
                        ElitePackCount++;
                    }
                    preStr = elite.Value;
                }
            }
            textBuilder.Clear();
            if (inRift)
            {
                textBuilder.AppendFormat("{0} 야드, 개체수 : {1}", currentYard, monstersCount);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("정예: {0}({1}무리)", EliteCount, ElitePackCount);
                textBuilder.AppendFormat(", 하수인: {0}", RareMinionCount);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("잡몹: {0}", monstersCount - EliteCount - RareMinionCount);
                textBuilder.AppendLine();
                textBuilder.AppendFormat("딸피 30퍼미만: {0}", minMonsterCount);
                textBuilder.AppendFormat(", 낫질 다이: {0}", sytherCount);
                textBuilder.AppendLine();
                textBuilder.AppendLine();
            }

            if (inRift)
            {
                totalMonsterRiftProgression = TrashMonsterRiftProgression + EliteProgression + RareMinionProgression + RiftGlobeProgression;
                long   totalTime      = (long)totalMonsterRiftProgression * 90000000;
                long   TrashTime      = (long)TrashMonsterRiftProgression * 90000000;
                long   EliteTime      = (long)EliteProgression * 90000000;
                long   RareMinionTime = (long)RareMinionProgression * 90000000;
                long   RiftGlobeTime  = (long)RiftGlobeProgression * 90000000;
                double percent        = Hud.Game.RiftPercentage + totalMonsterRiftProgression;

                if (inRift)
                {
                    textBuilder.AppendFormat("===게이지===");
                    textBuilder.AppendLine();
                    if (inRift)
                    {
                        textBuilder.AppendFormat("합산 게이지: {0}%", percent.ToString("f2"));
                        textBuilder.AppendLine();
                        textBuilder.AppendFormat("현화면 게이지: {0}%", totalMonsterRiftProgression.ToString("f2"));
                    }
                    else
                    {
                        textBuilder.AppendFormat("게이지: {0}%", totalMonsterRiftProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }

                if (inRift)
                {
                    if (inRift)
                    {
                        textBuilder.AppendFormat("잡몹: {0}%", TrashMonsterRiftProgression.ToString("f2"));
                    }
                    else
                    {
                        textBuilder.AppendFormat("잡몹: {0}%", TrashMonsterRiftProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (inRift)
                {
                    if (inRift)
                    {
                        textBuilder.AppendFormat("정예: {0}%", EliteProgression.ToString("f2"));
                    }
                    else
                    {
                        textBuilder.AppendFormat("정예: {0}%", EliteProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (inRift)
                {
                    if (inRift)
                    {
                        textBuilder.AppendFormat("하수인: {0}%", RareMinionProgression.ToString("f2"));
                    }
                    else
                    {
                        textBuilder.AppendFormat("하수인: {0}%", RareMinionProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (RiftGlobeProgression > 0 && ShowRiftGlobeProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("구슬: {0}%", RiftGlobeProgression.ToString("f2"));
                    }
                    else
                    {
                        textBuilder.AppendFormat("구슬: {0}%", RiftGlobeProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }

                textBuilder.AppendLine();
            }

            if (inRift)
            {
                //textBuilder.AppendFormat("메뚜기: {0}/{1}", locustCount, monstersCount);
                if (ElitelocustCount > 0)
                {
                    textBuilder.AppendFormat(" (정예: {0}/{1})", ElitelocustCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (inRift)
            {
                //textBuilder.AppendFormat("혼출: {0}/{1}", hauntedCount, monstersCount);
                if (ElitehauntedCount > 0)
                {
                    textBuilder.AppendFormat(" (정예: {0}/{1})", ElitehauntedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }

            if (palmedCount > 0 && ShowPalmedCount)
            {
                textBuilder.AppendFormat("폭장: {0}/{1}", palmedCount, monstersCount);
                if (ElitepalmedCount > 0)
                {
                    textBuilder.AppendFormat(" (정예: {0}/{1})", ElitepalmedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (phoenixedCount > 0 && ShowPhoenixedCount)
            {
                textBuilder.AppendFormat("Phoenixed: {0}/{1}", phoenixedCount, monstersCount);
                if (ElitephoenixedCount > 0)
                {
                    textBuilder.AppendFormat(" (Elite: {0}/{1})", ElitephoenixedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (strongarmedCount > 0 && ShowStrongarmedCount)
            {
                textBuilder.AppendFormat("팔씨름: {0}/{1}", strongarmedCount, monstersCount);
                if (ElitestrongarmedCount > 0)
                {
                    textBuilder.AppendFormat(" (Elite: {0}/{1})", ElitestrongarmedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }

            if (totalMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100 || TrashMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
            {
                if (totalMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
                {
                    currentFont = OrangeTextFont;
                }
                if (TrashMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
                {
                    currentFont = RedTextFont;
                }
            }
            else
            {
                currentFont = DefaultTextFont;
            }


            var layout = currentFont.GetTextLayout(textBuilder.ToString());

            currentFont.DrawText(layout, XPos, YPos);
        }
示例#21
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            float x = Hud.Window.Size.Width * 0.7f;
            float y = Hud.Window.Size.Height * 0.01f;

            ZnecIngame = false;
            foreach (var player in Hud.Game.Players)//others
            {
                if (player.HeroClassDefinition.HeroClass == HeroClass.Necromancer)
                {
                    var EfficaciousToxin = player.Powers.GetBuff(403461);
                    if (EfficaciousToxin == null || !EfficaciousToxin.Active)
                    {
                        //rat
                    }
                    else
                    {
                        //znec
                        ZnecIngame = true;
                        foreach (var i in _skillOrder)
                        {
                            var skill = player.Powers.SkillSlots[i];
                            if (skill == null || skill.SnoPower.Sno != 465839)
                            {
                                continue;                                                //, //Land of the Dead
                            }
                            Cooldown = (skill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60.0d;
                            if (Cooldown < 0)
                            {
                                Cooldown = 0;
                            }
                            SkillCooldown = skill.CalculateCooldown(120);
                            Cooldown      = Cooldown / SkillCooldown;
                            var buff = skill.Buff;
                            if ((buff == null) || (buff.IconCounts[0] <= 0))
                            {
                                LandTimeLeft = 0;
                            }
                            else
                            {
                                LandTimeLeft = (buff.TimeLeftSeconds[0]) / 10.0d;
                            }
                        }
                    }
                }
            }

            double score = (LandTimeLeft - Cooldown);

            score *= 10;
            textBuilder.Clear();
            textBuilder.AppendFormat("{0:0.00}", score);
            textBuilder.AppendLine();
            textBuilder.AppendFormat("{0:0.00}", LandTimeLeft * 10.0d);
            if (ZnecIngame)
            {
                if (LandTimeLeft == 0)
                {
                    var layout = RedFont.GetTextLayout(textBuilder.ToString());
                    RedFont.DrawText(layout, x, y);
                }
                else if (LandTimeLeft >= Cooldown)
                {
                    var layout = GreenFont.GetTextLayout(textBuilder.ToString());
                    GreenFont.DrawText(layout, x, y);
                }
                else if (LandTimeLeft < Cooldown)
                {
                    var layout = YellowFont.GetTextLayout(textBuilder.ToString());
                    YellowFont.DrawText(layout, x, y);
                }
            }
        }
示例#22
0
 public SharpDX.DirectWrite.TextMetrics GetTextMetrics(string text)
 {
     return(TextFont.GetTextLayout(text).Metrics);
 }