Here are the two files that work in version 9.0, but there are several things to comment, I write them below:
RiftPlugin1.cs
Code:
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
//using Turbo.Plugins.Default;
//namespace Turbo.Plugins.User
namespace Turbo.Plugins.Default
{
//by ÎÒÏë**²**²
public class RiftPlugin1 : BasePlugin, IInGameTopPainter
{
public IFont GreaterRiftPercentFont { get; set; }
public IFont GreaterRiftTimerFont { get; set; }
public IFont NearMonsterProgressionFont { get; set; }
public RiftPlugin1()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
GreaterRiftPercentFont = Hud.Render.CreateFont("tahoma", 9, 255, 200, 100, 200, true, false, 160, 0, 0, 0, true);
GreaterRiftTimerFont = Hud.Render.CreateFont("tahoma", 9, 255, 180, 147, 109, true, false, 160, 0, 0, 0, true);
NearMonsterProgressionFont = Hud.Render.CreateFont("tahoma", 9, 255, 180, 147, 109, true, false, 160, 0, 0, 0, true);
}
public void PaintTopInGame(ClipState clipState)
{
if (clipState != ClipState.BeforeClip) return;
if ((Hud.Game.SpecialArea != SpecialArea.Rift) && (Hud.Game.SpecialArea != SpecialArea.GreaterRift)) return;
if (Hud.Game.SpecialArea == SpecialArea.GreaterRift)
{
var percent = Hud.Game.RiftPercentage;
//var ui = Hud.Render.NephalemRiftBarUiElement;
var ui = Hud.Render.GreaterRiftBarUiElement;
var uiRect = ui.Rectangle;
if (ui.Visible)
{
//GreaterRiftTimer
var secondsLeft = (Hud.Game.CurrentTimedEventEndTick - (double)Hud.Game.CurrentGameTick) / 60.0d;
if (secondsLeft > 0)
{
var textTimer = ValueToString(((long)(Hud.Game.CurrentTimedEventEndTick - Hud.Game.CurrentGameTick) * 1000 * TimeSpan.TicksPerMillisecond / 60), ValueFormat.LongTime);
var textLayoutTimer = GreaterRiftTimerFont.GetTextLayout(textTimer);
GreaterRiftTimerFont.DrawText(textLayoutTimer, uiRect.Right - (float)(uiRect.Width / 900.0f * secondsLeft) - textLayoutTimer.Metrics.Width / 2, uiRect.Bottom + uiRect.Height * 0.7f);
}
//GreaterRiftPercent
var textpct = percent.ToString("F1", CultureInfo.InvariantCulture) + "%";
var textLayoutpct = GreaterRiftPercentFont.GetTextLayout(textpct);
var x = (float)(uiRect.Left + uiRect.Width / 100.0f * percent) - textLayoutpct.Metrics.Width / 2;
var y = uiRect.Top - uiRect.Height * 0.7f - textLayoutpct.Metrics.Height;
GreaterRiftPercentFont.DrawText(textLayoutpct, x, y);
//NearMonsterProgression and count
if (Hud.Game.CurrentQuestProgress < Hud.Game.MaxQuestProgress)
{
int count30 = 0;
int count80 = 0;
var progression30 = 0f;
var progression80 = 0f;
var eliteMaxHealth = 0.0d;
List<IMonster> eliteGroup = new List<IMonster>();
var monsters = Hud.Game.AliveMonsters;
foreach (var monster in monsters)
{
if (monster.SnoMonster.Priority == MonsterPriority.boss) return;
if (monster.SnoMonster != null)
{
if (monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Rare)
{
if (eliteMaxHealth < monster.MaxHealth) eliteMaxHealth = monster.MaxHealth;
eliteGroup.Add(monster);
}
if (monster.Rarity != ActorRarity.Champion && monster.Rarity != ActorRarity.Rare && monster.NormalizedXyDistanceToMe <= 30)
{
progression30 += monster.SnoMonster.RiftProgression;
count30++;
}
if (monster.NormalizedXyDistanceToMe <= 50 && monster.Rarity != ActorRarity.Champion && monster.Rarity != ActorRarity.Rare)
{
progression80 += monster.SnoMonster.RiftProgression;
count80++;
}
}
}
//remove clone
List<IMonster> eliteGroup1 = new List<IMonster>();
foreach (var elite in eliteGroup)
{
int same = 0;
foreach (var elite1 in eliteGroup)
{
if (elite.MaxHealth == elite1.MaxHealth) same++;
if (same == 2) break;
}
if (same == 2) continue;
if (elite.MaxHealth < eliteMaxHealth / 4) continue;
eliteGroup1.Add(elite);
}
//end
foreach (var monster in eliteGroup1)
{
progression30 += monster.SnoMonster.RiftProgression;
progression80 += monster.SnoMonster.RiftProgression;
}
var totalGlobe = 0f;
var packs = Hud.Game.MonsterPacks;
if (packs.Any())
{
foreach (var pack in packs)
{
if (!pack.MonstersAlive.Any()) continue;
if (pack.IsFullChampionPack) totalGlobe += 3 * 1.15f;
else totalGlobe += 4 * 1.15f;
}
}
var total30 = progression30 / Hud.Game.MaxQuestProgress * 100d;
var total80 = progression80 / Hud.Game.MaxQuestProgress * 100d;
var text30 = total30.ToString("F1") + "% (" + "30yd) " + count30.ToString() + "m";
var textLayout30 = NearMonsterProgressionFont.GetTextLayout(text30);
var x30 = uiRect.Left + (uiRect.Width - textLayout30.Metrics.Width) / 2;
var y30 = uiRect.Top + (uiRect.Height - textLayout30.Metrics.Height) / 2 + 1;
NearMonsterProgressionFont.DrawText(textLayout30, x30, y30);
var uiMinimapRect = Hud.Render.MinimapUiElement.Rectangle;
var x1 = uiMinimapRect.Left;
var y1 = uiMinimapRect.Top;
var text80 = count80.ToString() + "m" + "(50yd) " + total80.ToString("F1") + "%";
if (totalGlobe > 0) text80 += " + " + totalGlobe.ToString("F1") + "%(elite)";
NearMonsterProgressionFont.DrawText(text80, uiMinimapRect.Left, uiMinimapRect.Top, false);
eliteGroup.Clear();
eliteGroup1.Clear();
}
}
}//
}
}
}
RiftPlugin2.cs
Code:
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
//using Turbo.Plugins.Default;
//namespace Turbo.Plugins.User
namespace Turbo.Plugins.Default
{
//by ÎÒÏë**²**²
public class RiftPlugin2 : BasePlugin, IInGameTopPainter
{
public IBrush ProgressionLineBrush { get; set; }
public Dictionary<string, double> ProgressionofShrines { get; set; }
public IFont GreaterRiftFont { get; set; }
public bool flag_wn { get; set; }
public bool flag_dj { get; set; }
public bool flag_jh { get; set; }
public bool flag_hd { get; set; }
public bool flag_js { get; set; }
public RiftPlugin2()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
GreaterRiftFont = Hud.Render.CreateFont("tahoma", 9, 255, 200, 100, 200, false, false, 160, 0, 0, 0, true);
ProgressionLineBrush = Hud.Render.CreateBrush(255, 125, 175, 240, 1f);
ProgressionofShrines = new Dictionary<string, double>();
flag_wn = false;
flag_dj = false;
flag_jh = false;
flag_hd = false;
flag_js = false;
}
public void PaintTopInGame(ClipState clipState)
{
if (clipState != ClipState.BeforeClip) return;
if ((Hud.Game.SpecialArea != SpecialArea.Rift) && (Hud.Game.SpecialArea != SpecialArea.GreaterRift)) return;
if (Hud.Game.SpecialArea == SpecialArea.GreaterRift)
//if (Hud.Game.SpecialArea == SpecialArea.Rift)
{
var percent = Hud.Game.RiftPercentage;
if (percent <= 0)
{
ProgressionofShrines.Clear();
flag_wn = false;
flag_dj = false;
flag_jh = false;
flag_hd = false;
flag_js = false;
return;
}
var ui = Hud.Render.GreaterRiftBarUiElement;
//var ui = Hud.Render.NephalemRiftBarUiElement;
var uiRect = ui.Rectangle;
if (ui.Visible)
{
var shrines = Hud.Game.Shrines;
//if (shrines.Count() <= 0) return;
foreach (var actor in shrines)
{
switch (actor.SnoActor.Sno)
{
case ActorSnoEnum._x1_lr_shrine_damage: //330695
if (flag_wn == false) ProgressionofShrines.Add("Power", percent);
flag_wn = true;
break;
case ActorSnoEnum._x1_lr_shrine_electrified: //330696
case ActorSnoEnum._x1_lr_shrine_electrified_tieredrift: //398654
if (flag_dj == false) ProgressionofShrines.Add("Condi", percent);
flag_dj = true;
break;
case ActorSnoEnum._x1_lr_shrine_infinite_casting: //330697
if (flag_jh == false) ProgressionofShrines.Add("Chan", percent);
flag_jh = true;
break;
case ActorSnoEnum._x1_lr_shrine_invulnerable: //330698
if (flag_hd == false) ProgressionofShrines.Add("Shield", percent);
flag_hd = true;
break;
case ActorSnoEnum._x1_lr_shrine_run_speed: //330699
if (flag_js == false) ProgressionofShrines.Add("Speed", percent);
flag_js = true;
break;
}
}
var x = (float)(uiRect.Left + uiRect.Width / 100.0f * percent);
var py = Hud.Window.Size.Height / 20;
foreach (var pos in ProgressionofShrines)
{
var xPos = (float)(uiRect.Left + uiRect.Width / 100.0f * pos.Value);
ProgressionLineBrush.DrawLine(xPos, uiRect.Bottom, xPos, uiRect.Bottom + py, 0);
var text = pos.Value.ToString("F0") + "%" + "\r\n" + pos.Key;
GreaterRiftFont.DrawText(text, xPos, uiRect.Bottom + py, true);
}
}
}
}
}
}
They are designed to be installed in Plugins\Default, which is a very bad idea, it would be better to place them in Plugins\User. If you decide to make this change you have to modify a couple of lines in both files: you will see that at the beginning they have this:
Code:
//using Turbo.Plugins.Default;
//namespace Turbo.Plugins.User
namespace Turbo.Plugins.Default
change it to
Code:
using Turbo.Plugins.Default;
namespace Turbo.Plugins.User
//namespace Turbo.Plugins.Default
Another thing that has caught my attention is that the RiftPlugin1.cs comes into conflict with the original file RiftPlugin.cs, both show the time and total progress of the Rift. If you want to keep RiftPlugin1.cs, you must disable RiftPlugin.cs