Example #1
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip || !ShowInTown && Hud.Game.Me.IsInTown || OnlyInGR && Hud.Game.SpecialArea != SpecialArea.GreaterRift)
            {
                return;
            }
            if (_size <= 0)
            {
                _size = HudWidth * SizeRatio;
            }

            var xPos = HudWidth * StartXPos;

            foreach (var player in Hud.Game.Players.OrderBy(p => p.HeroId))
            {
                if (player.IsMe && !ShowSelf || !player.IsMe && ShowOnlyMe)
                {
                    continue;
                }
                var found     = false;
                var firstIter = true;
                foreach (var i in _skillOrder)
                {
                    var skill = player.Powers.SkillSlots[i];
                    if (skill == null || !WatchedSnos.Contains(skill.SnoPower.Sno))
                    {
                        continue;
                    }
                    found = true;
                    if (firstIter)
                    {
                        var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + "\n(" + _classShorts[player.HeroClassDefinition.HeroClass] + ")");
                        ClassFont.DrawText(layout, xPos - (layout.Metrics.Width * 0.1f), HudHeight * StartYPos);
                        firstIter = false;
                    }

                    var rect = new RectangleF(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                    SkillPainter.Paint(skill, rect);
                    xPos += _size * 1.1f;
                }
                if (found)
                {
                    xPos += _size * 1.1f;
                }
            }
        }
Example #2
0
        public void PaintTopInGamePartyCooldownsPlugin(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip || !ShowInTown && Hud.Game.Me.IsInTown || OnlyInGR && Hud.Game.SpecialArea != SpecialArea.GreaterRift)
            {
                return;
            }
            if (_size <= 0)
            {
                _size = HudWidth * SizeRatio;
            }

            var xPos = HudWidth * StartXPos;

            foreach (var player in Hud.Game.Players.OrderBy(p => p.HeroId))
            {
                // if (player.IsMe && !ShowSelf || !player.IsMe && ShowOnlyMe) continue;
                var foundCarrySkill     = false;
                var flagIsFirstIterator = true;
                foreach (var i in _skillOrder)
                {
                    double archonCooldown = 0;
                    double archonTimeLeft = 0;
                    var    skill          = player.Powers.SkillSlots[i];
                    if (skill == null || !WatchedSnos.Contains(skill.SnoPower.Sno))
                    {
                        continue;
                    }
                    foundCarrySkill = true;
                    if (skill != null && skill.SnoPower.Sno == 134872)
                    {
                        archonCooldown = (skill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60.0d;
                        var archonBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Archon.Sno);
                        if (archonBuff != null)
                        {
                            archonTimeLeft = archonBuff.TimeLeftSeconds[2];
                            if (archonCooldown < 0)
                            {
                                if (skill.Rune == 3.0)
                                {
                                    archonCooldown = skill.CalculateCooldown(100) - 20 + archonTimeLeft;
                                }
                                else
                                {
                                    archonCooldown = skill.CalculateCooldown(120) - 20 + archonTimeLeft;
                                }
                                if (archonTimeLeft == 0)
                                {
                                    archonCooldown = 0;
                                }
                            }
                        }
                    }
                    if (flagIsFirstIterator)
                    {
                        var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + "\n(" + ((IsZDPS(player)) ? "Z" : "") + _classShortName[player.HeroClassDefinition.HeroClass] + ")");
                        ClassFont.DrawText(layout, xPos - (layout.Metrics.Width * 0.1f), HudHeight * StartYPos);
                        flagIsFirstIterator = false;
                    }
                    if (skill != null && skill.SnoPower.Sno != 134872)
                    {
                        var rect = new SharpDX.RectangleF(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                        SkillPainter.Paint(skill, rect);
                    }
                    else if (skill != null && skill.SnoPower.Sno == 134872)
                    {
                        foreach (var iicon in Hud.Sno.SnoPowers.Wizard_Archon.Icons)
                        {
                            var Texture = Hud.Texture.GetTexture(iicon.TextureId);
                            if (Texture != null)
                            {
                                Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                            }
                            if (archonCooldown > 0.0)
                            {
                                var layout = ClassFont.GetTextLayout(archonCooldown.ToString("0.0") + "s");
                                ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2);
                            }
                        }
                    }
                    xPos += _size * 1.1f;
                }
                switch (player.HeroClassDefinition.HeroClass)
                {
                case HeroClass.WitchDoctor:
                    var wdCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Sno);
                    if (wdCheatDeathBuff != null)
                    {
                        if (wdCheatDeathBuff.TimeLeftSeconds[1] > 0.0)
                        {
                            var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Icons[1].TextureId);
                            if (Texture != null)
                            {
                                Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                            }

                            var layout = ClassFont.GetTextLayout(wdCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s");
                            ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2);
                            xPos += _size * 1.1f;
                        }
                    }
                    break;

                case HeroClass.Crusader:
                    var crusaderCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Crusader_Passive_Indestructible.Sno);
                    if (crusaderCheatDeathBuff != null)
                    {
                        if (crusaderCheatDeathBuff.TimeLeftSeconds[1] > 0.0)
                        {
                            var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Crusader_Passive_Indestructible.Icons[1].TextureId);
                            if (Texture != null)
                            {
                                Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                            }

                            var layout = ClassFont.GetTextLayout(crusaderCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s");
                            ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2);
                            xPos += _size * 1.1f;
                        }
                    }
                    break;

                case HeroClass.Barbarian:
                    var barbarCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Barbarian_Passive_NervesOfSteel.Sno);
                    if (barbarCheatDeathBuff != null)
                    {
                        if (barbarCheatDeathBuff.TimeLeftSeconds[1] > 0.0)
                        {
                            var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Barbarian_Passive_NervesOfSteel.Icons[1].TextureId);
                            if (Texture != null)
                            {
                                Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                            }

                            var layout = ClassFont.GetTextLayout(barbarCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s");
                            ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2);
                            xPos += _size * 1.1f;
                        }
                    }
                    break;

                case HeroClass.Monk:
                    var monkCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Monk_Passive_NearDeathExperience.Sno);
                    if (monkCheatDeathBuff != null)
                    {
                        if (monkCheatDeathBuff.TimeLeftSeconds[1] > 0.0)
                        {
                            var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Monk_Passive_NearDeathExperience.Icons[1].TextureId);
                            if (Texture != null)
                            {
                                Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                            }

                            var layout = ClassFont.GetTextLayout(monkCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s");
                            ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2);
                            xPos += _size * 1.1f;
                        }
                    }
                    break;

                case HeroClass.Necromancer:
                    var necCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Sno);
                    if (necCheatDeathBuff != null)
                    {
                        if (necCheatDeathBuff.TimeLeftSeconds[1] > 0.0)
                        {
                            var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Icons[1].TextureId);
                            if (Texture != null)
                            {
                                Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                            }

                            var layout = ClassFont.GetTextLayout(necCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s");
                            ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2);
                            xPos += _size * 1.1f;
                        }
                    }
                    break;

                case HeroClass.DemonHunter:
                    var dhCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.DemonHunter_Passive_Awareness.Sno);
                    if (dhCheatDeathBuff != null)
                    {
                        if (dhCheatDeathBuff.TimeLeftSeconds[1] > 0.0)
                        {
                            var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.DemonHunter_Passive_Awareness.Icons[1].TextureId);
                            if (Texture != null)
                            {
                                Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                            }

                            var layout = ClassFont.GetTextLayout(dhCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s");
                            ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2);
                            xPos += _size * 1.1f;
                        }
                    }
                    break;

                case HeroClass.Wizard:
                    var wizCheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Sno);
                    if (wizCheatDeathBuff != null)
                    {
                        if (wizCheatDeathBuff.TimeLeftSeconds[1] > 0.0)
                        {
                            var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Icons[1].TextureId);
                            if (Texture != null)
                            {
                                Texture.Draw(xPos, HudHeight * (StartYPos + 0.03f), _size, _size);
                            }

                            var layout = ClassFont.GetTextLayout(wizCheatDeathBuff.TimeLeftSeconds[1].ToString("0.0") + "s");
                            ClassFont.DrawText(layout, xPos, HudHeight * (StartYPos + 0.03f) + _size / 2);
                            xPos += _size * 1.1f;
                        }
                    }
                    break;
                }
                if (foundCarrySkill)
                {
                    xPos += _size * 1.1f;
                }
            }
        }
        public void DrawStackCount(IPlayer player)
        {
            if (!player.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 0))
            {
                return;
            }
            int count = Hud.Game.AliveMonsters.Count(m => m.SnoMonster.Priority == MonsterPriority.boss);

            if (count == 0)
            {
                return;
            }

            var uiBar   = Hud.Render.MonsterHpBarUiElement;
            var monster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1;

            if ((monster == null) || (uiBar == null) || (monster.SnoMonster.Priority != MonsterPriority.boss))
            {
                return;
            }
            int HitnRng = 1;
            int _count  = 0;

            _count = Hud.Game.AliveMonsters.Count(m => (player.FloorCoordinate.XYZDistanceTo(m.FloorCoordinate)) <= 10);
            if (_count < 1)
            {
                _count = 1;
            }
            Random rng;

            rng     = new Random(Hud.Game.CurrentGameTick);
            HitnRng = rng.Next(1, _count);

            var w = uiBar.Rectangle.Height * 2;
            var h = uiBar.Rectangle.Height;
            var x = uiBar.Rectangle.Right + uiBar.Rectangle.Height * 5;
            var y = uiBar.Rectangle.Y + uiBar.Rectangle.Height * 0.3f;

            var bgTex = Hud.Texture.GetTexture(3166997520);
            var tex   = Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.Unique_Gem_018_x1);
            var rect  = new RectangleF(uiBar.Rectangle.Right + uiBar.Rectangle.Height * 5f + xPos, uiBar.Rectangle.Y - uiBar.Rectangle.Height * 1.5f / 6, uiBar.Rectangle.Height * 1.5f, uiBar.Rectangle.Height * 1.5f);

            var index = player.PortraitIndex;

            if (player.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 2))
            {
                if (!cooling[index])
                {
                    cooling[index] = true;
                    if (HitnRng == 1)
                    {
                        StackCount[index]++;
                    }
                }
            }
            else
            {
                cooling[index] = false;
            }

            StackCountDecorator.TextFunc = () => StackCount[index].ToString();
            StackBrush.DrawRectangle(rect);
            bgTex.Draw(rect.Left, rect.Top, rect.Width, rect.Height);
            tex.Draw(rect.Left, rect.Top, rect.Width, rect.Height);
            var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + "\n(" + classShorts[player.HeroClassDefinition.HeroClass] + ")");

            if (DrawClassOnIcons || Hud.Window.CursorInsideRect(rect.X, rect.Y, rect.Width, rect.Height))
            {
                ClassFont.DrawText(layout, x - (layout.Metrics.Width * 0.1f) + xPos, y - h * 3);
            }
            StackCountDecorator.Paint(x + xPos, y, w, h, HorizontalAlign.Center);
            xPos += rect.Width + h;
        }
Example #4
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            var xPos  = HudWidth * StartXPos;
            var index = 0;

            foreach (var player in Hud.Game.Players.OrderBy(p => p.HeroClassDefinition.HeroClass))
            {
                var foundCarrySkill     = false;
                var flagIsFirstIterator = true;
                var yPos = HudHeight * StartYPos;

                foreach (var skill in player.Powers.UsedSkills.OrderBy(p => p.SnoPower.Sno))
                {
                    if (skill == null || !WatchedSnos.Contains(skill.SnoPower.Sno))
                    {
                        continue;
                    }

                    foundCarrySkill = true;
                    if (flagIsFirstIterator)
                    {
                        var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + _classShortName[player.HeroClassDefinition.HeroClass]);
                        ClassFont.DrawText(layout, xPos, yPos);
                        flagIsFirstIterator = false;
                        yPos += 0.035f * HudHeight;
                    }

                    var rect = new SharpDX.RectangleF(xPos, yPos, _size, _size);
                    SkillPainter.Paint(skill, rect);
                    yPos += _size * 1.1f;
                }

                var CheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Sno);
                switch (player.HeroClassDefinition.HeroClass)
                {
                case HeroClass.Necromancer: CheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Sno); break;

                case HeroClass.Wizard: CheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Sno); break;
                }

                if (CheatDeathBuff != null && CheatDeathBuff.TimeLeftSeconds[1] > 0.0)
                {
                    if (flagIsFirstIterator)
                    {
                        var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + _classShortName[player.HeroClassDefinition.HeroClass]);
                        ClassFont.DrawText(layout, xPos, yPos);
                        foundCarrySkill = true;
                        yPos           += 0.03f * HudHeight;
                    }
                    var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Icons[1].TextureId);
                    switch (player.HeroClassDefinition.HeroClass)
                    {
                    case HeroClass.Necromancer: Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Icons[1].TextureId); break;

                    case HeroClass.Wizard: Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Icons[1].TextureId); break;
                    }
                    if (Texture != null)
                    {
                        Texture.Draw(xPos, yPos, _size, _size);
                    }
                    var layout2 = ClassFont.GetTextLayout(CheatDeathBuff.TimeLeftSeconds[1].ToString("0"));
                    ClassFont.DrawText(layout2, xPos + (_size - (float)Math.Ceiling(layout2.Metrics.Width)) / 2, yPos + (_size - layout2.Metrics.Height) / 2);
                }

                if (foundCarrySkill)
                {
                    xPos += _size * 2.5f;
                }
                index++;
            }
        }