Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Versión adaptada a Movable plugins system: https://www.ownedcore.com/forums/showthread.php?t=908809&p=4231469#post4231469
- using Turbo.Plugins.Default;
- using System;
- using System.Globalization;
- using System.Linq;
- using System.Collections.Generic;
- using SharpDX;
- using SharpDX.Direct2D1;
- using System.Drawing;
- using System.Windows.Forms;
- using Turbo.Plugins.Razor.Movable;
- namespace Turbo.Plugins.RNN
- {
- public class BuildsIconsAndCoe : BasePlugin, ICustomizer, INewAreaHandler, IMovable //, IInGameTopPainter
- {
- private Dictionary<HeroClass,List<int>> AllBonusElements { get; set; }
- private int[] IndexToBonus { get; set; } = new int[8] { 7, 5, 3, 1, 6, 2, 0, 4 }; // Index: 1 = Arcane, 2 = Cold, 3 = Fire, 4 = Holy, 5 = Lightning, 6 = Physical, 7 = Poison // index to bonus { -, 5, 3, 1, 6, 2, 0, 4 };
- private int[] BonusToIndex { get; set; } = new int[7] { 6, 3, 5, 2, 7, 1, 4 }; // Bonus: 0 = Physical, 1 = Fire, 2 = Lightning, 3 = Cold, 4 = Poison, 5 = Arcane, 6 = Holy // bonus to index { 6, 3, 5, 2, 7, 1, 4};
- private Dictionary<uint,int> SelectElement { get; set; } = new Dictionary<uint,int>();
- public enum ElementNoRune { None = 0, Arcane = 1, Cold = 2, Fire = 3, Holy = 4, Lightning = 5, Physical = 6, Poison = 7 }
- private long LastClick { get; set; } = 0;
- public delegate IPlayerSkill SkillFunc(IPlayer player);
- public Dictionary<SkillFunc, ElementNoRune> SkillDefaultElement { get; set; } = new Dictionary<SkillFunc, ElementNoRune>();
- private int Ticks0 { get; set; } = 0;
- private int Count0 { get; set; } = 0;
- private float SizeIconWidth { get; set; } = 0;
- private float SizeIconHeight { get; set; } = 0;
- private SharpDX.DirectWrite.TextLayout layout { get; set; } = null;
- private IFont FontAS { get; set; }
- private IFont FontWhite { get; set; }
- private IFont FontGray { get; set; }
- private IFont FontGreen { get; set; }
- private IFont FontYellow { get; set; }
- private IFont FontOrange { get; set; }
- private IFont FontBlue { get; set; }
- private IFont FontDefault { get; set; } = null;
- private IFont FontNames { get; set; }
- private IFont FontLocust { get; set; }
- private IFont FontFury { get; set; }
- private IFont FontStacks { get; set; }
- private IFont FontTimeLeft { get; set; }
- private IFont FontTimeLeft2 { get; set; }
- private IFont FontStacksRed { get; set; }
- private IBrush TimeLeftClockBrush { get; set; }
- private IBrush BrushBlack { get; set; }
- private IBrush BrushGreen { get; set; }
- private IBrush BrushRed { get; set; }
- private IBrush BrushYellow { get; set; }
- private IBrush BrushOrange { get; set; }
- private IBrush BrushBlue { get; set; }
- private IBrush BrushDefault { get; set; }
- private IFont FontCounter { get; set; }
- private IFont FontExpl { get; set; }
- private IFont FontLimit { get; set; }
- private IFont FontLimit2 { get; set; }
- private IFont FontAlly { get; set; }
- private float _SizeMultiplier { get; set; }
- public float SizeMultiplier
- {
- get { return _SizeMultiplier; }
- set
- {
- if (_SizeMultiplier != value)
- {
- _SizeMultiplier = value;
- FontWhite = Hud.Render.CreateFont("tahoma", 10f * SizeMultiplier, 255, 255, 255, 255, true, false, 255, 0, 0, 0, true);
- FontGray = Hud.Render.CreateFont("tahoma", 10f * SizeMultiplier, 235, 235, 235, 235, true, false, 255, 0, 0, 0, true);
- FontGreen = Hud.Render.CreateFont("tahoma", 13f * SizeMultiplier, 255, 0, 255, 0, true, false, 255, 0, 0, 0, true);
- FontYellow = Hud.Render.CreateFont("tahoma", 13f * SizeMultiplier, 255, 255, 255, 0, true, false, 255, 0, 0, 0, true);
- FontOrange = Hud.Render.CreateFont("tahoma", 13f * SizeMultiplier, 255, 255, 150, 0, true, false, 255, 0, 0, 0, true);
- FontBlue = Hud.Render.CreateFont("tahoma", 7f * SizeMultiplier, 255, 50, 150, 250, true, false, 255, 0, 0, 0, true);
- FontNames = Hud.Render.CreateFont("tahoma", 8f * SizeMultiplier, 235, 235, 235, 235, false, false, 255, 0, 0, 0, true);
- FontStacks = Hud.Render.CreateFont("tahoma", 10f * SizeMultiplier, 255, 255, 255, 0, true, false, 255, 0, 0, 0, true);
- FontStacksRed = Hud.Render.CreateFont("tahoma", 10f * SizeMultiplier, 255, 255, 0, 0, true, false, 160, 0, 0, 0, true);
- FontTimeLeft = Hud.Render.CreateFont("tahoma", 10f * SizeMultiplier, 255, 0, 255, 0, true, false, 255, 0, 0, 0, true);
- FontTimeLeft2 = Hud.Render.CreateFont("tahoma", 7f * SizeMultiplier, 255, 0, 255, 0, true, false, 255, 0, 0, 0, true);
- FontCounter = Hud.Render.CreateFont("tahoma", 8f * SizeMultiplier, 255, 0, 255, 0, true, false, 160, 0, 0, 0, true);
- FontLimit = Hud.Render.CreateFont("tahoma", 8f * SizeMultiplier, 255, 255, 220, 100, true, false, 160, 0, 0, 0, true);
- FontExpl = Hud.Render.CreateFont("tahoma", 9f * SizeMultiplier, 255, 50, 150, 255, true, false, 160, 0, 0, 0, true);
- FontLimit2 = Hud.Render.CreateFont("tahoma", 8f * SizeMultiplier, 255, 255, 100, 50, true, false, 160, 0, 0, 0, true);
- FontLocust = Hud.Render.CreateFont("tahoma", 9f * SizeMultiplier, 255, 255, 255, 255, false, false, 255, 0, 0, 0, true);
- FontAS = Hud.Render.CreateFont("tahoma", 6f * SizeMultiplier, 255, 255, 255, 255, false, false, 255, 0, 0, 0, true);
- FontFury = Hud.Render.CreateFont("Tahoma", 9f * SizeMultiplier , 255, 220, 150,255, true, false, 255, 0, 0, 0, true);
- FontAlly = Hud.Render.CreateFont("tahoma", 9f * SizeMultiplier, 255, 255, 220, 25, true, false, 255, 0, 0, 0, true);
- }
- }
- }
- public float Xpor { get; set; }
- public float Ypor { get; set; }
- public bool ShowCoe { get; set; }
- public bool OnlyGR { get; set; }
- public bool OnlyMe { get; set; } = false;
- public bool ShowMe { get; set; }
- public bool ShowOthers { get; set; }
- public float Opacity { get; set; }
- public bool InactiveRedFrame { get; set; }
- public bool ShowNames { get; set; }
- public int ProgressBarWidth { get; set; } = 2;
- public bool ShowBonusDamageInTown { get; set; }
- public bool SkillsWithJordanOnly { get; set; }
- public bool SymbolCooldown { get; set; }
- public bool Nayr { get; set; }
- public bool BoneSpear { get; set; }
- public bool Singularity { get; set; }
- public bool ShowEssenceMages { get; set; }
- public float EssenceLimit { get; set; }
- public bool SpiritBarrage { get; set; }
- public bool ShowGlobes { get; set; }
- public bool ShowSoulHarvest { get; set; }
- public bool ShowBigBadVoodoo { get; set; }
- public bool ShowSpiritWalk { get; set; }
- public bool ShowLocust { get; set; }
- public bool ShowHaunted { get; set; }
- public int YardsLocustHaunt { get; set; }
- public float SBWarning { get; set; }
- public bool ThornsBomb { get; set; }
- public bool ValorFotH { get; set; }
- public bool SteedCharge { get; set; }
- public bool FlailCharge { get; set; }
- public bool Akarat { get; set; }
- public bool Inna { get; set; }
- public bool MantraSalvation { get; set; }
- public bool AllyAmount { get; set; }
- public bool SpiritGuards { get; set; }
- public bool Lefebvre { get; set; }
- public bool FlyingDragon { get; set; }
- public bool Fenix { get; set; }
- private Dictionary<uint,int> Phantasms { get;set; } = new Dictionary<uint,int>();
- private HashSet<ActorSnoEnum> ZombieDogSno = new HashSet<ActorSnoEnum>
- {
- ActorSnoEnum._wd_zombiedog, // 51353 //2 rune
- ActorSnoEnum._wd_zombiedogrune_fire, // 103215 //4 rune
- ActorSnoEnum._wd_zombiedogrune_healthglobe, // 105763 //0 rune
- ActorSnoEnum._wd_zombiedogrune_healthlink, // 110959 //3 rune
- ActorSnoEnum._wd_zombiedogrune_lifesteal, // 103235 //5 rune
- ActorSnoEnum._wd_zombiedogrune_poison, // 103217 //1 rune
- };
- private HashSet<ActorSnoEnum> MagesSno = new HashSet<ActorSnoEnum>
- {
- ActorSnoEnum._p6_necro_skeletonmage_b,
- ActorSnoEnum._p6_necro_skeletonmage_e,
- ActorSnoEnum._p6_necro_skeletonmage_f_archer,
- ActorSnoEnum._p6_necro_skeletonmage_c,
- ActorSnoEnum._p6_necro_skeletonmage_d,
- };
- private HashSet<ActorSnoEnum> AllySno = new HashSet<ActorSnoEnum>
- {
- ActorSnoEnum._monk_male_mystically, // 169904,
- ActorSnoEnum._monk_male_mystically_alabaster, // 169905
- ActorSnoEnum._monk_male_mystically_crimson, // 169906
- ActorSnoEnum._monk_male_mystically_indigo, // 169907
- ActorSnoEnum._monk_male_mystically_golden, // 169908
- ActorSnoEnum._monk_male_mystically_obsidian, // 169909
- ActorSnoEnum._monk_male_mystically_alabaster_v2, // 485723
- ActorSnoEnum._monk_female_mystically, // 123885
- ActorSnoEnum._monk_female_mystically_alabaster, // 169891
- ActorSnoEnum._monk_female_mystically_crimson, // 168878
- ActorSnoEnum._monk_female_mystically_indigo, // 169890
- ActorSnoEnum._monk_female_mystically_golden, // 169123
- ActorSnoEnum._monk_female_mystically_obsidian, // 169077
- ActorSnoEnum._monk_female_mystically_alabaster_v2, // 485722
- ActorSnoEnum._x1_monk_female_mysticallymini_crimson, // 367774
- //ActorSnoEnum._x1_projectile_mystically_runec_boulder, // 363935
- //ActorSnoEnum._monk_mysticallyrune_fire_shadowblur_crits, // 170972
- };
- public BuildsIconsAndCoe()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- Order = 30001;
- /* Necro */
- Nayr = true; // Enable Icons Build Nayr
- BoneSpear = true; // Enable Icons Build Bone Spear (Set Bonus 6)
- Singularity = true; // Enable Icons Build Singularity
- ShowEssenceMages = true; // Show amount of essence with which the mages are summoned
- EssenceLimit = 0.66f; // 0f .. 0.95f . When the essence is below this value it will be colored orange (Green if it is at maximum and in another case yellow)
- /* WitchDoctor */
- SpiritBarrage = true; // Enable Icons Build Spirit Barrage
- SBWarning = 2.0f; // 9.0f...0f Text will take the color yellow when it reaches this value
- ShowGlobes = true; // Health Globes Counter (floor)
- ShowSoulHarvest = true; // Show SoulHarvest icon
- ShowBigBadVoodoo = false; // Show Big Bad Voodoo icon
- ShowSpiritWalk = false; // Show Spirit Walk icon
- ShowLocust = false; // Locust Affected Monster Counters (Total \n Elites) at distance = YardsLocustHaunt
- ShowHaunted = false; // Haunted Affected Monster Counters (Total \n Elites) at distance = YardsLocustHaunt
- YardsLocustHaunt = 40; // Yards for Monsters Counters (Locust and Haunted)
- /* Crusader */
- ThornsBomb = true; // Enable Icons Build Thorns Bomb (Invoker set 2 items + belt of the Trove)
- ValorFotH = true; // Enable Icons Build Valor - Fist of the Heaven
- SteedCharge = true; // Show Steed Charge icon
- FlailCharge = true; // Show Flail of the Charge (Bonus 2) icon
- Akarat = true; // Show Icon Akarat´s Champion
- /* Wizard */
- Fenix = true; // Enable Icons Build Fenix (4 Items Set)
- /* Monk */
- Inna = true; // Enable Icons Build Inna (6 Items Set)
- MantraSalvation = true; // Show Mantra of Salvation Icon
- AllyAmount = true; // Show amount of mystical allies
- SpiritGuards = true; // Show Bracers Spirit Guards icon
- Lefebvre = true; // Show Shoulders Lefebvre´s Soliloquy icon
- FlyingDragon = true; // Show Flying Dragon icon
- /* Common */
- ShowMe = true; // Show for my character
- ShowOthers = true; // Show for others character
- ShowNames = true; // Show players names
- OnlyGR = false; // Show in GR only
- Xpor = 0.71f; // To set the x coordinate of the icon
- Ypor = 0.10f; // To set the y coordinate of the icon
- SizeMultiplier = 0.75f; // Size multiplier for icons
- Opacity = 0.75f; // 0f..1f Opacity for icon texture
- ShowCoe = true; // Show COE status
- InactiveRedFrame = false; // Inactive elements (coe) are shown in red (active in yellow)
- ProgressBarWidth = 2; // Width progressbar Coe (pixels)
- SymbolCooldown = false; // Symbol "✔️"
- ShowBonusDamageInTown = false; // Enable Displaying Elemental Damage Bonuses in Town
- SkillsWithJordanOnly = false; // The configured skills will be applied only if you have the Jordan equipped
- TimeLeftClockBrush = Hud.Render.CreateBrush(220, 0, 0, 0, 0);
- BrushBlack = Hud.Render.CreateBrush(255, 80, 80, 80, 0);
- BrushGreen = Hud.Render.CreateBrush(255, 0, 255 , 0, 0);
- BrushYellow = Hud.Render.CreateBrush(255, 255, 255 , 0, 0);
- BrushOrange = Hud.Render.CreateBrush(255, 255, 185 , 0, 0);
- BrushBlue = Hud.Render.CreateBrush(255, 50, 150 , 250, 0);
- AllBonusElements = new Dictionary<HeroClass, List<int>> // 1 = Arcane, 2 = Cold, 3 = Fire, 4 = Holy, 5 = Lightning, 6 = Physical, 7 = Poison
- {
- { HeroClass.Necromancer, new List<int>{2,6,7} },
- { HeroClass.Barbarian, new List<int>{2,3,5,6} },
- { HeroClass.DemonHunter, new List<int>{2,3,5,6} },
- { HeroClass.Wizard, new List<int>{1,2,3,5} },
- { HeroClass.WitchDoctor, new List<int>{2,3,6,7} },
- { HeroClass.Crusader, new List<int>{3,4,5,6} },
- { HeroClass.Monk, new List<int>{2,3,4,5,6} },
- };
- }
- public void Customize()
- {
- var OpacityBrush = (int) (Opacity * 255);
- BrushRed = Hud.Render.CreateBrush(OpacityBrush, 255, 50 , 50, 0);
- if ((SBWarning < 0f) || (SBWarning > 9f)) { SBWarning = 2; }
- if (EssenceLimit < 0 || EssenceLimit > 0.95 ) { EssenceLimit = 0.66f; }
- }
- public void OnNewArea(bool newGame, ISnoArea area)
- {
- if (newGame)
- {
- Phantasms.Clear();
- }
- }
- private void DrawTimeLeftClock(SharpDX.RectangleF rect, double elapsed, double timeLeft) // plugins\Default\BuffLists\Painter\BuffPainter.cs
- {
- if ((timeLeft > 0) && (elapsed >= 0) && (TimeLeftClockBrush != null))
- {
- var endAngle = Convert.ToInt32(360.0d / (timeLeft + elapsed) * elapsed);
- var startAngle = 0;
- TimeLeftClockBrush.Opacity = 1 - (float)(0.5f / (timeLeft + elapsed) * elapsed);
- var rad = rect.Width * 0.45f;
- using (var pg = Hud.Render.CreateGeometry())
- {
- using (var gs = pg.Open())
- {
- gs.BeginFigure(rect.Center, FigureBegin.Filled);
- for (var angle = startAngle; angle <= endAngle; angle++)
- {
- var mx = rad * (float)Math.Cos((angle - 90) * Math.PI / 180.0f);
- var my = rad * (float)Math.Sin((angle - 90) * Math.PI / 180.0f);
- var vec = new Vector2(rect.Center.X + mx, rect.Center.Y + my);
- gs.AddLine(vec);
- }
- gs.EndFigure(FigureEnd.Closed);
- gs.Close();
- }
- TimeLeftClockBrush.DrawGeometry(pg);
- }
- }
- }
- public void DrawIconBuff(float x, float y, float width, float height, uint idtexture, int stacks, double timeleft, double elapsed, double timeleft2 = 0)
- {
- Hud.Texture.GetTexture(idtexture).Draw(x, y, width, height, Opacity);
- Hud.Texture.BuffFrameTexture.Draw(x, y, width, height, Opacity);
- if (timeleft > 0)
- {
- DrawTimeLeftClock(new SharpDX.RectangleF(x, y , width, height), elapsed , timeleft);
- layout = FontTimeLeft.GetTextLayout(timeleft.ToString( (timeleft < 1)? "F1" : "F0") );
- FontTimeLeft.DrawText(layout, x + ((width - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((height - (float)Math.Ceiling(layout.Metrics.Height))/14.0f) );
- if (timeleft2 > 0)
- {
- layout = FontTimeLeft2.GetTextLayout(timeleft2.ToString((timeleft2 < 1)? "F1" : "F0") );
- FontTimeLeft2.DrawText(layout, x + ((width - (float)Math.Ceiling(layout.Metrics.Width))/5.0f), y + ((height - (float)Math.Ceiling(layout.Metrics.Height))/1.1f) );
- }
- }
- layout = FontStacks.GetTextLayout( stacks.ToString() );
- (stacks == 0?FontStacksRed:FontStacks).DrawText(layout, x + ((width - (float)Math.Ceiling(layout.Metrics.Width))/1.15f), y + ((height - (float)Math.Ceiling(layout.Metrics.Height))/1.05f) );
- }
- public void DrawIconSkill(float x, float y, float width, float height, IPlayerSkill skill, int index = 1, double fix = 0)
- {
- Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId).Draw(x, y, width, height, Opacity);
- double timeleft = 0;
- if (skill.Buff != null) // 465839
- {
- Hud.Texture.BuffFrameTexture.Draw(x, y, width, height, Opacity);
- timeleft = skill.Buff.TimeLeftSeconds[index] - fix;
- }
- else
- {
- if (skill.SnoPower.Sno == 362102) Hud.Texture.BuffFrameTexture.Draw(x, y, width, height, Opacity);
- else Hud.Texture.DebuffFrameTexture.Draw(x, y, width, height, Opacity);
- }
- if (skill.CooldownFinishTick > Hud.Game.CurrentGameTick)
- {
- double remaining = (skill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60.0d;
- double elapsed = (Hud.Game.CurrentGameTick - skill.CooldownStartTick) / 60.0d;
- DrawTimeLeftClock(new SharpDX.RectangleF(x, y , width, height), elapsed , remaining);
- layout = FontWhite.GetTextLayout( remaining.ToString( (remaining < 1)? "F1":"F0" ) );
- }
- else { layout = FontWhite.GetTextLayout(SymbolCooldown?"✔️":""); }
- FontWhite.DrawText(layout, x + ((width - (float)Math.Ceiling(layout.Metrics.Width))/1.25f), y + ((height - (float)Math.Ceiling(layout.Metrics.Height))/1.1f) );
- if (timeleft > 0)
- {
- layout = FontTimeLeft.GetTextLayout(timeleft.ToString( (timeleft < 1)? "F1" : "F0") );
- FontTimeLeft.DrawText(layout, x + ((width - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((height - (float)Math.Ceiling(layout.Metrics.Height))/14.0f) );
- }
- }
- public void OnRegister(MovableController mover)
- {
- if (this.Enabled == false) return;
- SizeIconWidth = Hud.Texture.BuffFrameTexture.Width * Hud.Window.Size.Height/1200.0f * SizeMultiplier;
- SizeIconHeight = Hud.Texture.BuffFrameTexture.Height * Hud.Window.Size.Height/1200.0f * SizeMultiplier;
- mover.CreateArea(
- this,
- "Bars", //area name
- new System.Drawing.RectangleF(
- Hud.Window.Size.Width * Xpor, Hud.Window.Size.Height * Ypor, SizeIconWidth * 5, FontNames.GetTextLayout("").Metrics.Height + 1 + ProgressBarWidth + SizeIconHeight * 2
- ), //position + dimensions
- true, //enabled at start?
- true, //save changes to config file?
- ResizeMode.Off, //resizable?
- ClipState.BeforeClip
- );
- }
- public void PaintArea(MovableController mover, MovableArea area, float deltaX = 0, float deltaY = 0)
- {
- if (!Hud.Game.IsInGame) return;
- if (OnlyGR && !Hud.Game.Me.InGreaterRift) return;
- var players = Hud.Game.Players.Where( p => p.IsMe?ShowMe:(ShowOthers && p.HasValidActor) ).OrderBy(p => p.PortraitIndex);
- if (players.Any())
- {
- var y = area.Rectangle.Y + deltaY ;
- foreach(var player in players)
- {
- var x = area.Rectangle.X + deltaX;
- if (player.HeroClassDefinition.HeroClass == HeroClass.Necromancer)
- {
- IPlayerSkill skill = player.Powers.UsedNecromancerPowers.SkeletalMage; // 462089
- var build = false;
- if (BoneSpear && player.Powers.BuffIsActive(484303)) // Bonut 6 set
- {
- build = true;
- if (ShowNames) { layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait); FontNames.DrawText(layout,x + 1,y ); y += layout.Metrics.Height + 1; }
- if (player.Powers.BuffIsActive(478534)) // Dayntee Equipped
- {
- Hud.Texture.InventoryLegendaryBackgroundLarge.Draw(x,y,SizeIconWidth,SizeIconHeight,Opacity);
- Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.P61_Unique_Belt_01).Draw(x,y,SizeIconWidth,SizeIconHeight,Opacity);
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- var n = Hud.Game.AliveMonsters.Where(m => m.Cursed).Count();
- layout = FontStacks.GetTextLayout(n.ToString());
- ((n > 0)?FontStacks:FontStacksRed).DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/1.20f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.05f) );
- if (player.Powers.BuffIsActive(478534,1))
- {
- layout = FontTimeLeft.GetTextLayout("✔️"); // Dayntee Buff
- FontTimeLeft.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/5f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/14f) );
- }
- x += SizeIconWidth;
- }
- }
- else if (Singularity && ((skill != null) && (skill?.Rune == 1 || player.Powers.BuffIsActive(484311))) ) // Singularity
- {
- build = true;
- if (ShowNames) { layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait); FontNames.DrawText(layout,x + 1,y ); y += layout.Metrics.Height + 1; }
- if (skill.Buff != null)
- {
- var stacks = ( (skill.Buff.IconCounts[6] == 1) && (skill.Buff.TimeLeftSeconds[5] == 0) )? 0:skill.Buff.IconCounts[6];
- if (stacks == 0)
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,skill.SnoPower.NormalIconTextureId,0, 0, 0 );
- }
- else
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,skill.SnoPower.NormalIconTextureId,stacks,skill.Buff.TimeLeftSeconds[5],skill.Buff.TimeElapsedSeconds[5],skill.Buff.TimeLeftSeconds[6]);
- }
- }
- else
- {
- Hud.Texture.GetTexture(265393923).Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity); // skill.SnoPower.NormalIconTextureId
- Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- }
- x += SizeIconWidth;
- if (ShowEssenceMages /*&& player.Powers.BuffIsActive(475247)*/) // Nailuj
- {
- Hud.Texture.GetTexture(265393923).Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- var mages = Hud.Game.Actors.Where(a => MagesSno.Contains(a.SnoActor.Sno) && a.SummonerAcdDynamicId == player.SummonerId);
- if (mages.Any())
- {
- double removegem = (player.Powers.BuffIsActive(403466))? 100d/(100d + player.GetAttributeValue(Hud.Sno.Attributes.Item_Power_Passive,403466) * 10d): 1;
- var resmax = ((player.Powers.UsedNecromancerPowers.Simulacrum == null) || player.Powers.BuffIsActive(465350))? player.Stats.ResourceMaxPri: player.Stats.ResourceMaxPri * 2;
- var c = 1;
- foreach (var MagesGroup in mages.GroupBy(a => (int)(a.GetAttributeValue(Hud.Sno.Attributes.Multiplicative_Damage_Percent_Bonus, 1048575) * removegem / 0.03d)).OrderBy(g => g.Key))
- {
- if (MagesGroup.FirstOrDefault().GetAttributeValue(Hud.Sno.Attributes.Multiplicative_Damage_Percent_Bonus, 1048575) == 1) continue;
- FontDefault = (MagesGroup.Key > resmax - 3)? FontCounter: (MagesGroup.Key < resmax * EssenceLimit)?FontLimit2:FontLimit ;
- var layout = FontDefault.GetTextLayout( String.Format("{0,-3} {1,2}",MagesGroup.Key ,MagesGroup.Count()) );
- FontDefault.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.5f), y + (layout.Metrics.Height * 0.91f * (c - 1)) );
- if (++c > 3) break;
- }
- }
- x += SizeIconWidth;
- }
- }
- if (Nayr && player.Powers.BuffIsActive(476587)) // Nayr
- {
- if (!build)
- {
- build = true;
- if (ShowNames) { layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait); FontNames.DrawText(layout,x + 1,y ); y += layout.Metrics.Height + 1; }
- }
- var buff = player.Powers.GetBuff(476587);
- if (buff != null)
- {
- var c = buff.IconCounts[7];
- if (c > 0)
- {
- int j = 7; double timeleft = 0; double timeleft2 = 15;
- for (var i = 1; i < 7; i++)
- {
- var t = buff.TimeLeftSeconds[i];
- if (t > 0)
- {
- if (t > timeleft) { j = i; timeleft = t; }
- if (t < timeleft2) { timeleft2 = t; }
- }
- }
- if (Hud.Game.Me.Powers.UsedNecromancerPowers.Revive != null) { timeleft2 = buff.TimeLeftSeconds[1 + (int) Hud.Game.Me.Powers.UsedNecromancerPowers.Revive.Key]; }
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,2831437924, c, buff.TimeLeftSeconds[j], buff.TimeElapsedSeconds[j],(c > 1)?timeleft2:0 );
- }
- else { DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,2831437924, 0, 0, 0); }
- }
- x += SizeIconWidth;
- }
- if (build)
- {
- skill = player.Powers.UsedNecromancerPowers.LandOfTheDead; // 465839
- if (skill != null)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill, 0); // index 0
- x += SizeIconWidth;
- }
- skill = player.Powers.UsedNecromancerPowers.Simulacrum; // 465350
- if (skill != null)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill, 1); // index 1 , para averiguar el timeleft
- if (player.Powers.BuffIsActive(465350) && player.Powers.BuffIsActive(484309))
- {
- layout = FontTimeLeft.GetTextLayout("∞");
- FontTimeLeft.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/14.0f) );
- }
- x += SizeIconWidth;
- }
- skill = player.Powers.UsedNecromancerPowers.BoneArmor; // 466857
- if (skill != null)
- {
- if (skill.Buff != null)
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,skill.SnoPower.NormalIconTextureId,skill.Buff.IconCounts[0],skill.Buff.TimeLeftSeconds[0], skill.Buff.TimeElapsedSeconds[0] );
- }
- else
- {
- Hud.Texture.GetTexture(436563001).Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- }
- x += SizeIconWidth;
- }
- if (player.Powers.BuffIsActive(475251)) // Bloodtide Blade
- {
- Hud.Texture.InventoryLegendaryBackgroundLarge.Draw(x,y,SizeIconWidth,SizeIconHeight,Opacity);
- Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.P65_Unique_Scythe2H_02).Draw(x,y,SizeIconWidth,SizeIconHeight,Opacity);
- if (Math.Abs(Hud.Game.CurrentGameTick - Ticks0) > 20)
- {
- Count0 = Hud.Game.AliveMonsters.Where(m => m.FloorCoordinate.XYDistanceTo(player.FloorCoordinate) <= 25).Count();
- Ticks0 = Hud.Game.CurrentGameTick;
- }
- layout = FontTimeLeft.GetTextLayout( Count0.ToString() );
- FontStacks.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/2.0f) );
- x += SizeIconWidth;
- }
- }
- else continue;
- }
- else if (player.HeroClassDefinition.HeroClass == HeroClass.WitchDoctor)
- {
- IPlayerSkill skill = player.Powers.UsedWitchDoctorPowers.SpiritBarrage; // 108506
- if ( (skill != null) && (skill.Rune == 2 || player.Powers.BuffIsActive(484270)))
- {
- if (!SpiritBarrage) continue;
- { // Simple bloque
- if (ShowNames) { layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait); FontNames.DrawText(layout,x + 1,y ); y += layout.Metrics.Height + 1; }
- var actors = Hud.Game.Actors.Where(a => a.SnoActor.Sno == ActorSnoEnum._wd_spiritbarragerune_aoe_ghostmodel && (a.SummonerAcdDynamicId == player.SummonerId));
- Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId).Draw(x, y, SizeIconWidth , SizeIconHeight, Opacity); // TextureId 1117784160
- int total = actors.Count();
- if (total > 0)
- {
- foreach(var a in actors)
- {
- if (!Phantasms.ContainsKey(a.AnnId)) { Phantasms[a.AnnId] = a.CreatedAtInGameTick; }
- }
- actors = actors.OrderByDescending(a => Phantasms[a.AnnId]);
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- var c = 0;
- foreach (var actor in actors)
- {
- if (++c > 3) break;
- var t = (player.Powers.BuffIsActive(484270)?10:5) - (Hud.Game.CurrentGameTick - Phantasms[actor.AnnId]) / 60f;
- if (t <= 0)
- {
- var layout = FontExpl.GetTextLayout("🞴");
- FontExpl.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/8.0f), y + (layout.Metrics.Height * 0.68f * (c - 1)) );
- }
- else
- {
- FontDefault = (t > SBWarning)? FontCounter:FontLimit;
- var layout = FontDefault.GetTextLayout( String.Format("{0:0}",(int) (t + 0.90)) ); // Redondeará a X si es menor a X.10
- FontDefault.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/7.0f), y + (layout.Metrics.Height * 0.90f * (c - 1)) );
- }
- }
- }
- else { Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity); }
- layout = FontStacks.GetTextLayout(total.ToString());
- (total == 0?FontStacksRed:FontStacks).DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/1.15f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.05f) );
- layout = FontAS.GetTextLayout(player.Offense.AttackSpeed.ToString("F2", CultureInfo.InvariantCulture));
- FontAS.DrawText(layout,x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/1.24f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/7.0f) );
- x += SizeIconWidth;
- }
- if (ShowSoulHarvest)
- {
- skill = player.Powers.UsedWitchDoctorPowers.SoulHarvest;
- if (skill != null)
- {
- if (skill.Buff != null) // 67616
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,skill.SnoPower.NormalIconTextureId,skill.Buff.IconCounts[0],skill.Buff.TimeLeftSeconds[0],skill.Buff.TimeElapsedSeconds[0] );
- }
- else
- {
- Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity); // skill.SnoPower.NormalIconTextureId = 2196086897
- Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- }
- x += SizeIconWidth;
- }
- }
- if (ShowLocust)
- {
- skill = player.Powers.UsedWitchDoctorPowers.LocustSwarm;
- if ( (skill != null) || player.Powers.BuffIsActive(423238) )
- {
- Hud.Texture.GetTexture(1465459957).Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity); // skill.SnoPower.NormalIconTextureId = 1465459957
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- var m = Hud.Game.AliveMonsters.Where(a => a.FloorCoordinate.XYDistanceTo(player.FloorCoordinate) <= YardsLocustHaunt);
- var mLc = m.Where(a => a.Locust).Count();
- if (mLc > 0)
- {
- var mc = m.Count();
- var e = m.Where(a => (a.Rarity == ActorRarity.Champion || a.Rarity == ActorRarity.Rare || a.Rarity == ActorRarity.Boss) && (a.SummonerAcdDynamicId == 0) );
- var ec = e.Count();
- if (mc > ec)
- {
- layout = FontLocust.GetTextLayout( mLc.ToString() + "|" + mc.ToString());
- FontLocust.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/6.0f) );
- }
- if (ec > 0)
- {
- var eLc = e.Where(a => a.Locust).Count();
- layout = FontLocust.GetTextLayout( eLc.ToString() + "|" + ec.ToString());
- FontLocust.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.20f) );
- }
- }
- x += SizeIconWidth;
- }
- }
- if (ShowHaunted)
- {
- skill = player.Powers.UsedWitchDoctorPowers.Haunt;
- if (skill != null)
- {
- Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId).Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity); // skill.SnoPower.NormalIconTextureId =
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- var m = Hud.Game.AliveMonsters.Where(a => a.FloorCoordinate.XYDistanceTo(player.FloorCoordinate) <= YardsLocustHaunt);
- var mHc = m.Where(a => a.Haunted).Count();
- if (mHc > 0)
- {
- var mc = m.Count();
- var e = m.Where(a => (a.Rarity == ActorRarity.Champion || a.Rarity == ActorRarity.Rare || a.Rarity == ActorRarity.Boss) && (a.SummonerAcdDynamicId == 0) );
- var ec = e.Count();
- if (mc > ec)
- {
- layout = FontLocust.GetTextLayout( mHc.ToString() + "|" + mc.ToString());
- FontLocust.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/6.0f) );
- }
- if (ec > 0)
- {
- var eHc = e.Where(a => a.Haunted).Count();
- layout = FontLocust.GetTextLayout( eHc.ToString() + "|" + ec.ToString());
- FontLocust.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.20f) );
- }
- }
- x += SizeIconWidth;
- }
- }
- if (ShowBigBadVoodoo)
- {
- skill = player.Powers.UsedWitchDoctorPowers.BigBadVoodoo;
- if (skill != null)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill, 4); // index 4 , para averiguar el timeleft
- x += SizeIconWidth;
- }
- }
- if (ShowSpiritWalk) // 106237
- {
- skill = player.Powers.UsedWitchDoctorPowers.SpiritWalk;
- if (skill != null)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill, 0); // index, para averiguar el timeleft
- x += SizeIconWidth;
- }
- }
- skill = player.Powers.UsedWitchDoctorPowers.Sacrifice; // 102572 - Sacrifice
- if ( (skill != null) && (skill.Rune == 0) )
- {
- if (skill.Buff != null)
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,skill.SnoPower.NormalIconTextureId,skill.Buff.IconCounts[0],skill.Buff.TimeLeftSeconds[0],skill.Buff.TimeElapsedSeconds[0] );
- }
- else
- {
- Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity); // skill.SnoPower.NormalIconTextureId =
- Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- }
- var n = Hud.Game.Actors.Where(a => ZombieDogSno.Contains(a.SnoActor.Sno) && (a.SummonerAcdDynamicId == player.SummonerId)).Count();
- if (n > 0)
- {
- layout = FontWhite.GetTextLayout(n.ToString());
- FontWhite.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/7.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.05f) );
- }
- x += SizeIconWidth;
- }
- if (player.Powers.UsedPassives.Any(p => p.Sno == Hud.Sno.SnoPowers.WitchDoctor_Passive_GruesomeFeast.Sno)) // 208594
- {
- IBuff buff = player.Powers.GetBuff(208594);
- if (buff != null) // Hud.Sno.SnoPowers.WitchDoctor_Passive_GruesomeFeast.NormalIconTextureId = 1591242582
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,1591242582,buff.IconCounts[1],buff.TimeLeftSeconds[1],buff.TimeElapsedSeconds[1] );
- }
- else
- {
- Hud.Texture.GetTexture(1591242582).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- }
- x += SizeIconWidth;
- if (ShowGlobes)
- {
- var n = Hud.Game.Actors.Where(a => a.SnoActor.Kind == ActorKind.HealthGlobe).Count();
- if (n > 0)
- {
- layout = FontWhite.GetTextLayout(n.ToString());
- var w = (n < 10)? layout.Metrics.Width + 1:(layout.Metrics.Width/2 + 2);
- BrushRed.DrawEllipse(x + SizeIconWidth / 2 , y + SizeIconHeight / 2 , w , w );
- FontWhite.DrawText(layout,x + (SizeIconWidth - layout.Metrics.Width) / 2 , y + (SizeIconHeight - layout.Metrics.Height) / 2 - 1 );
- }
- }
- }
- }
- else continue;
- }
- else if (player.HeroClassDefinition.HeroClass == HeroClass.Crusader)
- {
- if (ThornsBomb && player.Powers.BuffIsActive(445829) && player.Powers.BuffIsActive(423235))
- {
- if (ShowNames) { layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait); FontNames.DrawText(layout,x + 1,y ); y += layout.Metrics.Height + 1; }
- IBuff buff = player.Powers.GetBuff(445829);
- if (buff != null)
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,2503653692,buff.IconCounts[1],buff.TimeLeftSeconds[1],buff.TimeElapsedSeconds[1] );
- }
- x += SizeIconWidth;
- }
- else if (ValorFotH && player.Powers.BuffIsActive(483655))
- {
- if (ShowNames) { layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait); FontNames.DrawText(layout,x + 1,y ); y += layout.Metrics.Height + 1; }
- IBuff buff = player.Powers.GetBuff(483655);
- if (buff != null)
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,3114805186,buff.IconCounts[1],buff.TimeLeftSeconds[1],buff.TimeElapsedSeconds[1] );
- if (player.Powers.UsedCrusaderPowers.HeavensFury != null && (player.Powers.GetBuff(483643) != null))
- {
- layout = FontFury.GetTextLayout(player.Powers.GetBuff(483643).IconCounts[1].ToString());
- FontFury.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.11f) );
- }
- }
- x += SizeIconWidth;
- }
- else if (ValorFotH && player.Powers.BuffIsActive(483643))
- {
- IBuff buff = Hud.Game.Me.Powers.GetBuff(483655);
- if (buff != null)
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,3114805186,buff.IconCounts[1],buff.TimeLeftSeconds[1],buff.TimeElapsedSeconds[1] );
- }
- else
- {
- Hud.Texture.GetTexture(3114805186).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- }
- if (player.Powers.UsedCrusaderPowers.HeavensFury != null)
- {
- buff = player.Powers.GetBuff(483643);
- if (buff != null)
- {
- layout = FontFury.GetTextLayout(buff.IconCounts[1].ToString());
- FontFury.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.11f) );
- }
- }
- x += SizeIconWidth;
- }
- else continue;
- IPlayerSkill skill = player.Powers.UsedCrusaderPowers.SteedCharge; // 243853
- if (skill != null)
- {
- if (SteedCharge)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill, 0);
- x += SizeIconWidth;
- }
- if (FlailCharge && player.Powers.BuffIsActive(447291))
- {
- IBuff buff = player.Powers.GetBuff(447291);
- if (buff != null)
- {
- Hud.Texture.InventorySetBackgroundLarge.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.P4_Unique_Flail_2H_Set_01_x1).Draw(x + SizeIconWidth/6, y, SizeIconWidth * 0.55f, SizeIconHeight, Opacity);
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- var timeleft = buff.TimeLeftSeconds[1]; var stacks = (buff.IconCounts[1] == 1 || skill.Buff?.IconCounts[0] == 1)?400:0;
- if (timeleft > 0)
- {
- layout = FontTimeLeft.GetTextLayout(timeleft.ToString( (timeleft < 1)? "F1" : "F0") );
- FontTimeLeft.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/14.0f) );
- }
- layout = FontStacks.GetTextLayout( stacks.ToString());
- (stacks == 0?FontStacksRed:FontStacks).DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/1.25f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.05f) );
- }
- x += SizeIconWidth;
- }
- }
- if (Akarat)
- {
- skill = player.Powers.UsedCrusaderPowers.AkaratsChampion; // 269032
- if (skill != null)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill, 1); // index 1, para averiguar el timeleft
- x += SizeIconWidth;
- }
- }
- }
- else if (player.HeroClassDefinition.HeroClass == HeroClass.Wizard)
- {
- if (Fenix && player.Powers.BuffIsActive(485549) && player.Powers.UsedWizardPowers.SpectralBlade != null) // 485549 set-4 , 445814 set-6
- {
- if (ShowNames) { layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait); FontNames.DrawText(layout,x + 1,y ); y += layout.Metrics.Height + 1; }
- IBuff buff = player.Powers.GetBuff(485549); // 485549 set-4 . Combustion
- IPlayerSkill skill = player.Powers.UsedWizardPowers.SpectralBlade; // 98027 - SpectralBlade
- //if (skill != null)
- {
- if (skill.Buff != null)
- {
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,skill.SnoPower.NormalIconTextureId,skill.Buff.IconCounts[4],skill.Buff.TimeLeftSeconds[4],skill.Buff.TimeElapsedSeconds[4] );
- }
- else
- {
- Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity); // skill.SnoPower.NormalIconTextureId =
- Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- }
- x += SizeIconWidth;
- }
- if (buff != null)
- {
- Hud.Texture.GetTexture(1714727035).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- skill = player.Powers.UsedWizardPowers.Disintegrate;
- ((skill == null)?Hud.Texture.DebuffFrameTexture:Hud.Texture.BuffFrameTexture).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- int stacks = buff.IconCounts[3];
- layout = FontStacks.GetTextLayout(stacks.ToString());
- (stacks == 0?FontStacksRed:FontStacks).DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/1.25f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.05f) );
- }
- x += SizeIconWidth;
- skill = player.Powers.UsedWizardPowers.MirrorImage; // 98027 - MirrorImage
- if (skill != null)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill, 0, 1.5); // index 0, para averiguar el timeleft . Debo restar 1.5s (death)
- layout = FontFury.GetTextLayout( skill.Buff != null? skill.Buff.IconCounts[6].ToString():"" );
- FontFury.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/7.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.1f) );
- x += SizeIconWidth;
- }
- if (player.Powers.UsedPassives.Any(p => p.Sno == Hud.Sno.SnoPowers.Wizard_Passive_UnwaveringWill.Sno)) // 298038 - UnwaveringWill
- {
- Hud.Texture.GetTexture(859252908).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity); // Hud.Sno.SnoPowers.Wizard_Passive_UnwaveringWill.NormalIconTextureId = 859252908
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- if (player.Powers.BuffIsActive(298038,1))
- {
- layout = FontTimeLeft.GetTextLayout("✔️");
- FontTimeLeft.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/2.0f) );
- }
- else
- {
- layout = FontStacksRed.GetTextLayout("X️");
- FontStacksRed.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/2.0f) );
- }
- x += SizeIconWidth;
- }
- }
- else continue;
- }
- else if (player.HeroClassDefinition.HeroClass == HeroClass.Monk)
- {
- if (Inna && player.Powers.BuffIsActive(449252)) // set inna bonus 6
- {
- if (ShowNames) { layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait); FontNames.DrawText(layout,x + 1,y ); y += layout.Metrics.Height + 1; }
- IPlayerSkill skill = player.Powers.UsedMonkPowers.WayOfTheHundredFists;
- if (skill != null && (skill.Rune == 3 || skill.Rune == 2) )
- {
- if (skill.Buff != null)
- {
- var i = (skill.Rune == 3)?4:1;
- DrawIconBuff(x,y,SizeIconWidth,SizeIconHeight,skill.SnoPower.NormalIconTextureId,skill.Buff.IconCounts[i],skill.Buff.TimeLeftSeconds[i],skill.Buff.TimeElapsedSeconds[i] );
- }
- else
- {
- Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity); // skill.SnoPower.NormalIconTextureId =
- Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- }
- x += SizeIconWidth;
- }
- if (player.Powers.BuffIsActive(440569)) // Shenlong: 440568 equipped , 440569 bonus
- {
- var buff = player.Powers.GetBuff(440569);
- if (buff != null)
- {
- Hud.Texture.GetTexture(buff.SnoPower.Icons[1].TextureId).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- FontDefault = (buff.IconCounts[1] == 1)? FontStacks : FontTimeLeft ;
- }
- else { FontDefault = FontTimeLeft; }
- layout = FontAlly.GetTextLayout(player.Stats.ResourcePctPri.ToString("F0") + "﹪" );
- FontDefault.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/1.2f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/2.4f) );
- //layout = FontAS.GetTextLayout(player.Stats.ResourceCurPri.ToString("F0") );
- //FontNames.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/1.3f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.1f) );
- x += SizeIconWidth;
- }
- skill = player.Powers.UsedMonkPowers.MysticAlly;
- if (skill != null)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill); // skill.Buff == null , no timeleft
- if (AllyAmount)
- {
- var Ally = Hud.Game.Actors.Where(a => AllySno.Contains(a.SnoActor.Sno) && a.SummonerAcdDynamicId == player.SummonerId);
- var AllyHide = Ally.Where(a => a.GetAttributeValueAsUInt(Hud.Sno.Attributes.Hidden, 1048575) == 1);
- int AllyHideCount = AllyHide.Count();
- int AllyMiniCount = 0;
- if (skill.Rune == 0)
- {
- AllyMiniCount = Ally.Where(a => a.SnoActor.Sno == ActorSnoEnum._x1_monk_female_mysticallymini_crimson ).Count();
- layout = FontLimit2.GetTextLayout( AllyMiniCount.ToString());
- FontLimit2.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/7.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.1f) );
- }
- else
- {
- if (AllyHide.Any())
- {
- var ao = AllyHide.Where(t => t.GetAttributeValueAsUInt(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_B, 485709) != 1).OrderBy(a => a.CreatedAtInGameTick).FirstOrDefault();
- if (ao != null)
- {
- layout = FontNames.GetTextLayout( ((Hud.Game.CurrentGameTick - ao.CreatedAtInGameTick)/60f).ToString("F0") );
- //FontAS.DrawText(layout, x + ((SizeIconWidth - layout.Metrics.Width)/2.0f), y + ((SizeIconHeight - layout.Metrics.Height)/2.0f) );
- FontNames.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/7.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.1f) );
- }
- }
- }
- layout = FontAlly.GetTextLayout( (Ally.Count() - AllyMiniCount).ToString());
- FontAlly.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/12.0f) );
- layout = FontNames.GetTextLayout(AllyHideCount.ToString());
- FontNames.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/1.2f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/10.0f) );
- }
- x += SizeIconWidth;
- }
- skill = player.Powers.UsedMonkPowers.Serenity;
- if (skill != null)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill,0); // timeleft 0
- x += SizeIconWidth;
- }
- skill = player.Powers.UsedMonkPowers.Epiphany;
- if (skill != null)
- {
- DrawIconSkill(x,y,SizeIconWidth,SizeIconHeight,skill,0); // timeleft 0
- x += SizeIconWidth;
- }
- if (MantraSalvation)
- {
- skill = player.Powers.UsedMonkPowers.MantraOfSalvation; // 375049 -> 375050
- if (skill != null)
- {
- Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId).Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- IBuff buff = player.Powers.GetBuff(375050);
- if (buff != null)
- {
- var timeleft = buff.TimeLeftSeconds[1];
- if (timeleft > 0)
- {
- layout = FontTimeLeft.GetTextLayout(timeleft.ToString( (timeleft < 1)? "F1" : "F0") );
- FontTimeLeft.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/14.0f) );
- }
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- }
- else
- {
- Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- }
- x += SizeIconWidth;
- }
- }
- if (FlyingDragon)
- {
- if (player.Powers.BuffIsActive(246562)) // Dragón Volador
- {
- var buff = player.Powers.GetBuff(246562);
- if (buff != null)
- {
- Hud.Texture.InventoryLegendaryBackgroundLarge.Draw(x,y,SizeIconWidth,SizeIconHeight,Opacity);
- Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.Unique_CombatStaff_2H_009_x1).Draw(x, y, SizeIconWidth, SizeIconHeight, 1.0f);
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth,SizeIconHeight, Opacity);
- var timeleft = buff.TimeLeftSeconds[1];
- if (timeleft > 0)
- {
- layout = FontTimeLeft.GetTextLayout(timeleft.ToString( (timeleft < 1)? "F1" : "F0") );
- FontTimeLeft.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/14.0f) );
- }
- else
- {
- layout = FontStacksRed.GetTextLayout("X️");
- FontStacksRed.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/2.0f) );
- }
- }
- x += SizeIconWidth;
- }
- }
- if (SpiritGuards)
- {
- if (player.Powers.BuffIsActive(430289)) // Bracers Spirit Guards
- {
- var buff = player.Powers.GetBuff(430289);
- if (buff != null)
- {
- Hud.Texture.GetTexture(buff.SnoPower.Icons[1].TextureId).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- var timeleft = buff.TimeLeftSeconds[1];
- if (timeleft > 0)
- {
- layout = FontTimeLeft.GetTextLayout(timeleft.ToString( (timeleft < 1)? "F1" : "F0") );
- FontTimeLeft.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/14.0f) );
- }
- }
- x += SizeIconWidth;
- }
- }
- if (Lefebvre)
- {
- if (player.Powers.BuffIsActive(449236)) // Bracers Spirit Guards
- {
- Hud.Texture.InventoryLegendaryBackgroundLarge.Draw(x,y,SizeIconWidth,SizeIconHeight,Opacity); // Hud.Texture.InventoryLegendaryBackgroundSmall / Hud.Texture.InventoryLegendaryBackgroundLarge
- Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.P4_Unique_Shoulder_101).Draw(x + SizeIconWidth/4,y,SizeIconWidth/2,SizeIconHeight,Opacity);
- var buff = player.Powers.GetBuff(223473);
- if (buff != null)
- {
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- var timeleft = buff.TimeLeftSeconds[0];
- if (timeleft > 0)
- {
- layout = FontTimeLeft.GetTextLayout(timeleft.ToString( (timeleft < 1)? "F1" : "F0") );
- FontTimeLeft.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/14.0f) );
- }
- }
- else
- {
- Hud.Texture.DebuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- }
- x += SizeIconWidth;
- }
- }
- }
- else continue;
- }
- else continue;
- x = area.Rectangle.X + deltaX; y += SizeIconHeight;
- if (ShowCoe && (player.Powers.GetBuff(Hud.Sno.SnoPowers.ConventionOfElements.Sno) != null) ) // 430674
- {
- var BuffCoE = player.Powers.GetBuff(430674);
- var HeroBonusElements = AllBonusElements[player.HeroClassDefinition.HeroClass];
- var BonusCount = HeroBonusElements.Count;
- var ActiveElement = -1; var BestElement = -1; double MaxBonus = -1; string ActiveLetter = string.Empty;
- for(var k = BonusCount - 1; k > -1 ; k--)
- {
- var index = HeroBonusElements[k];
- if (BuffCoE.IconCounts[index] > 0) { ActiveElement = index; }
- var bonus = player.Offense.ElementalDamageBonus[IndexToBonus[index]];
- if (bonus > MaxBonus)
- {
- MaxBonus = bonus;
- BestElement = index;
- ActiveLetter = "B";
- }
- else if (bonus == MaxBonus) ActiveLetter = "";
- }
- if ((ActiveElement != -1) && (BestElement != -1) )
- {
- if (SelectElement.TryGetValue(player.HeroId, out var sindex) && sindex != int.MaxValue)
- {
- ActiveLetter = "M";
- BestElement = sindex;
- }
- else if (!SkillsWithJordanOnly || player.Powers.BuffIsActive(Hud.Sno.SnoPowers.StoneOfJordan.Sno)) // 484282 - P69_ItemPassive_Unique_Ring_001
- {
- foreach(var data in SkillDefaultElement)
- {
- var skill = data.Key(player);
- if (skill != null)
- {
- if (skill.Rune != 255 || HeroBonusElements.Contains((int) data.Value))
- {
- BestElement = (skill.Rune == 255)? (int) data.Value : BonusToIndex[skill.ElementalType];
- ActiveLetter = "S";
- }
- else if (data.Value == ElementNoRune.None) continue; // None (continue) o bad index (break)
- break;
- }
- }
- }
- for (var l = 0; l < BonusCount; l++)
- {
- if (HeroBonusElements[BonusCount - 1] != BestElement)
- {
- HeroBonusElements.Insert(0,HeroBonusElements[BonusCount - 1]);
- HeroBonusElements.RemoveAt(BonusCount);
- }
- else { break; }
- }
- y += ProgressBarWidth;
- foreach(var index in HeroBonusElements)
- {
- Hud.Texture.GetTexture(BuffCoE.SnoPower.Icons[index].TextureId).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- double s = 0; bool best = false;
- if (index == ActiveElement)
- {
- s = BuffCoE.TimeLeftSeconds[index];
- if (index == BestElement)
- {
- FontDefault = FontGreen; BrushDefault = BrushGreen;
- best = true;
- }
- else { FontDefault = FontGray; }
- DrawTimeLeftClock(new SharpDX.RectangleF(x, y , SizeIconWidth, SizeIconHeight), BuffCoE.TimeElapsedSeconds[index], BuffCoE.TimeLeftSeconds[index]);
- Hud.Texture.BuffFrameTexture.Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- }
- else
- {
- if (index == BestElement)
- {
- best = true;
- s = (BonusCount - HeroBonusElements.IndexOf(ActiveElement) - 1) * 4 - BuffCoE.TimeElapsedSeconds[ActiveElement] ;
- if ( s > ((BonusCount - 1) * 2) ) { FontDefault = FontOrange; BrushDefault = BrushOrange; }
- else { FontDefault = FontYellow; BrushDefault = BrushYellow; }
- }
- (InactiveRedFrame?Hud.Texture.DebuffFrameTexture:Hud.Texture.BuffFrameTexture).Draw(x, y, SizeIconWidth, SizeIconHeight, Opacity);
- }
- if (Hud.Window.CursorInsideRect(x, y, SizeIconWidth, SizeIconHeight) && Hud.Input.IsKeyDown(Keys.Menu) && (Hud.Game.CurrentRealTimeMilliseconds - LastClick > 1000))
- {
- if (Hud.Input.IsKeyDown(Keys.LButton))
- {
- if (Hud.Game.IsInTown)
- {
- SelectElement[player.HeroId] = (SelectElement.TryGetValue(player.HeroId,out var findex) && findex == index)? int.MaxValue : index;
- LastClick = Hud.Game.CurrentRealTimeMilliseconds;
- return;
- }
- }
- }
- if (Hud.Game.IsInTown)
- {
- if (ShowBonusDamageInTown)
- {
- layout = FontBlue.GetTextLayout(Math.Round(player.Offense.ElementalDamageBonus[IndexToBonus[index]] * 100).ToString());
- FontBlue.DrawText(layout, x + (SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/6f , y + (SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.05f );
- }
- if (best)
- {
- layout = FontBlue.GetTextLayout(ActiveLetter);
- FontBlue.DrawText(layout, x + (SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/1.16f , y + (SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/1.05f );
- }
- }
- if (s > 0)
- {
- //layout = FontDefault.GetTextLayout(s.ToString( (s < 1)? "F1" : "F0") );
- layout = FontDefault.GetTextLayout( (s < 1)? s.ToString("F1") : String.Format("{0:0}",(int) (s + 0.80)) ); // Redondeará a X si es menor a X.20
- FontDefault.DrawText(layout, x + ((SizeIconWidth - (float)Math.Ceiling(layout.Metrics.Width))/2.0f), y + ((SizeIconHeight - (float)Math.Ceiling(layout.Metrics.Height))/2.0f));
- }
- x += SizeIconWidth;
- }
- BrushBlack.DrawRectangle(x , y, - SizeIconWidth * BonusCount, - ProgressBarWidth);
- var t = (float) ( SizeIconWidth * (BonusCount - HeroBonusElements.IndexOf(ActiveElement) - BuffCoE.TimeElapsedSeconds[ActiveElement] / 4) );
- if (t > 0) BrushDefault.DrawRectangle(x, y, - t , - ProgressBarWidth);
- y = y + SizeIconHeight;
- }
- }
- y += SizeIconHeight * (ShowNames?0.1f:0.4f);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment