Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Mod TriunesWillPlugin (Added Oculus) , Original : https://www.ownedcore.com/forums/diablo-3/turbohud/turbohud-community-plugins/797748-int-extended-triuneswillplugin.html
- // Ground Decorators & Timers for Triune's Will circles from Season 18 buff.
- using Turbo.Plugins.Default;
- using System.Linq;
- namespace Turbo.Plugins.RNN
- {
- public class TriunesWillPluginMOD : BasePlugin, IInGameWorldPainter
- {
- public WorldDecoratorCollection LoveDecorator { get; set; }
- public WorldDecoratorCollection DeterminationDecorator { get; set; }
- public WorldDecoratorCollection CreationDecorator { get; set; }
- public WorldDecoratorCollection OculusDecorator { get; set; }
- public WorldDecoratorCollection LoveInsideDecorator { get; set; }
- public WorldDecoratorCollection DeterminationInsideDecorator { get; set; }
- public WorldDecoratorCollection CreationInsideDecorator { get; set; }
- public WorldDecoratorCollection OculusInsideDecorator { get; set; }
- public bool EnableLove { get; set; }
- public bool EnableDetermination { get; set; }
- public bool EnableCreation { get; set; }
- public bool EnableInsideMarker { get; set; }
- private float _CircleRadius { get; set; } = 0f;
- private float _InsideRadius { get; set; } = 0f;
- public IFont DescriptionText1 { get; set; }
- public IFont DescriptionText2 { get; set; }
- public bool EnableDescription { get; set; }
- public uint snoPower { get; set; } = 488071; // Generic_CommunityBuffDarkAlchemy (Old = 483606)
- public float CircleRadius
- {
- get { return _CircleRadius; }
- set
- {
- if (value == _CircleRadius || value < 9f) // We will not do anything if the user assigns an invalid value, or if this value matches the current one
- return;
- _CircleRadius = value; // We update the value
- InitDecoratorsCircle(); // Redefine Decorators
- }
- }
- public float InsideRadius
- {
- get { return _InsideRadius; }
- set
- {
- if (value == _InsideRadius || value < 1f)
- return;
- _InsideRadius = value;
- InitDecoratorsInside();
- }
- }
- private bool _ReplaceOculusOriginal { get; set; } = false;
- public bool ReplaceOculusOriginal
- {
- get { return _ReplaceOculusOriginal; }
- set
- {
- _ReplaceOculusOriginal = value;
- if (_ReplaceOculusOriginal) Hud.TogglePlugin<OculusPlugin>(false);
- }
- }
- public TriunesWillPluginMOD()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- EnableLove = true; // Damage Circle
- EnableCreation = true; // CDR Circle
- EnableDetermination = true; // RCR Circle
- EnableInsideMarker = true; // Additional Circle Decorator when you are in it
- CircleRadius = 10f; //minimum 9f
- InsideRadius = 10f; //minimum 1f
- ReplaceOculusOriginal = false;
- EnableDescription = true;
- DescriptionText1 = Hud.Render.CreateFont("tahoma", 8f, 255,255,255,255, false, false, 128, 0, 0, 0, true) ;
- DescriptionText2 = Hud.Render.CreateFont("tahoma", 7f, 255,255,255,255, true, false, 128, 0, 0, 0, true) ;
- }
- private void InitDecoratorsCircle()
- {
- LoveDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 255, 0, 128, -2),
- Radius = CircleRadius,
- },
- new GroundLabelDecorator(Hud)
- {
- CountDownFrom = 7,
- TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 255, 96, 255, true, false, 128, 0, 0, 0, true),
- },
- new GroundTimerDecorator(Hud)
- {
- CountDownFrom = 7,
- BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
- BackgroundBrushFill = Hud.Render.CreateBrush(164, 192, 0, 0, 0),
- Radius = 25,
- },
- new MapShapeDecorator(Hud)
- {
- ShapePainter = new CircleShapePainter(Hud),
- Brush = Hud.Render.CreateBrush(255, 255, 0, 128, -1f),
- ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
- Radius = CircleRadius - 1,
- }
- );
- CreationDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 64, 200, 144, -2),
- Radius = CircleRadius,
- },
- new GroundLabelDecorator(Hud)
- {
- CountDownFrom = 7,
- TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 96, 230, 196, true, false, 128, 0, 0, 0, true),
- },
- new GroundTimerDecorator(Hud)
- {
- CountDownFrom = 7,
- BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
- BackgroundBrushFill = Hud.Render.CreateBrush(164, 0, 192, 192, 0),
- Radius = 25,
- },
- new MapShapeDecorator(Hud)
- {
- ShapePainter = new CircleShapePainter(Hud),
- Brush = Hud.Render.CreateBrush(255, 64, 200, 144, -1f),
- ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
- Radius = CircleRadius - 1,
- }
- );
- DeterminationDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 164, 150, 32, -2), // Dark Blue 0, 64, 255
- Radius = CircleRadius,
- },
- new GroundLabelDecorator(Hud)
- {
- CountDownFrom = 7,
- TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 200, 200, 96, true, false, 128, 0, 0, 0, true), // Dark Blue 96, 96, 255
- },
- new GroundTimerDecorator(Hud)
- {
- CountDownFrom = 7,
- BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
- BackgroundBrushFill = Hud.Render.CreateBrush(164, 164, 164, 0, 0), // Dark Blue 0, 0, 192
- Radius = 25,
- },
- new MapShapeDecorator(Hud)
- {
- ShapePainter = new CircleShapePainter(Hud),
- Brush = Hud.Render.CreateBrush(255, 164, 150, 32, -1f),
- ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
- Radius = CircleRadius - 1,
- }
- );
- OculusDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 128, 255, 0, -2),
- Radius = CircleRadius,
- },
- new GroundLabelDecorator(Hud)
- {
- CountDownFrom = 7,
- TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 96, 255, 96, true, false, 128, 0, 0, 0, true),
- },
- new GroundTimerDecorator(Hud)
- {
- CountDownFrom = 7,
- BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
- BackgroundBrushFill = Hud.Render.CreateBrush(200, 0, 192, 0, 0),
- Radius = 25,
- },
- new MapShapeDecorator(Hud)
- {
- ShapePainter = new CircleShapePainter(Hud),
- Brush = Hud.Render.CreateBrush(255, 128, 255, 0, -1f),
- ShadowBrush = Hud.Render.CreateBrush(48, 0, 0, 0, 1),
- Radius = CircleRadius - 1,
- }
- );
- }
- private void InitDecoratorsInside()
- {
- LoveInsideDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 150, 0, 0, -2, SharpDX.Direct2D1.DashStyle.Dash),
- Radius = InsideRadius,
- }
- );
- CreationInsideDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 0, 80, 150, -2, SharpDX.Direct2D1.DashStyle.Dash),
- Radius = InsideRadius,
- }
- );
- DeterminationInsideDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 120, 80, 0, -2, SharpDX.Direct2D1.DashStyle.Dash), // Dark Blue 0, 64, 255
- Radius = InsideRadius,
- }
- );
- OculusInsideDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 0, 140, 0, -2, SharpDX.Direct2D1.DashStyle.Dash),
- Radius = InsideRadius,
- }
- );
- }
- public void PaintWorld(WorldLayer layer)
- {
- if (layer != WorldLayer.Ground) return;
- //if (Hud.Game.IsInTown) return;
- bool Inside = false;
- float CoordX, CoordY;
- if (EnableLove)
- {
- var love = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, snoPower) == 1).OrderBy(d => d.CentralXyDistanceToMe);
- if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(snoPower, 2)) { Inside = true; }
- foreach (var actor in love)
- {
- LoveDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
- LoveDecorator.Paint(WorldLayer.Map, actor, actor.FloorCoordinate, null);
- if (EnableDescription)
- {
- DescriptionText1.DrawText(DescriptionText1.GetTextLayout("DMG"),actor.FloorCoordinate.ToScreenCoordinate().X - 15 ,actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
- Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
- DescriptionText2.DrawText(DescriptionText2.GetTextLayout("D"),CoordX - 5 , CoordY - 8);
- }
- if (Inside) { LoveInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
- }
- }
- if (EnableCreation)
- {
- var creation = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_7_Visual_Effect_None, snoPower) == 1).OrderBy(d => d.CentralXyDistanceToMe);
- if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(snoPower, 8)) { Inside = true; }
- foreach (var actor in creation)
- {
- CreationDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
- CreationDecorator.Paint(WorldLayer.Map, actor, actor.FloorCoordinate, null);
- if (EnableDescription)
- {
- DescriptionText1.DrawText(DescriptionText1.GetTextLayout("CDR"),actor.FloorCoordinate.ToScreenCoordinate().X - 15 ,actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
- Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
- DescriptionText2.DrawText(DescriptionText2.GetTextLayout("C"),CoordX - 5 , CoordY - 8 );
- }
- if (Inside) { CreationInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
- }
- }
- if (EnableDetermination)
- {
- var determination = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_6_Visual_Effect_None, snoPower) == 1).OrderBy(d => d.CentralXyDistanceToMe);
- if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(snoPower, 5) ) { Inside = true; }
- foreach (var actor in determination)
- {
- DeterminationDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
- DeterminationDecorator.Paint(WorldLayer.Map, actor, actor.FloorCoordinate, null);
- if (EnableDescription)
- {
- DescriptionText1.DrawText(DescriptionText1.GetTextLayout("RSR"),actor.FloorCoordinate.ToScreenCoordinate().X - 15 ,actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
- Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
- DescriptionText2.DrawText(DescriptionText2.GetTextLayout("R"),CoordX - 5 , CoordY - 8 );
- }
- if (Inside) { DeterminationInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
- }
- }
- if (ReplaceOculusOriginal)
- {
- var actors = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, 402461) == 1).OrderBy(d => d.CentralXyDistanceToMe);
- if (EnableInsideMarker && Hud.Game.Me.Powers.BuffIsActive(402461, 2)) { Inside = true; }
- foreach (var actor in actors)
- {
- OculusDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
- OculusDecorator.Paint(WorldLayer.Map, actor, actor.FloorCoordinate, null);
- if (EnableDescription)
- {
- DescriptionText1.DrawText(DescriptionText1.GetTextLayout("OCU"),actor.FloorCoordinate.ToScreenCoordinate().X - 15 ,actor.FloorCoordinate.ToScreenCoordinate().Y + 30);
- Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out CoordX, out CoordY);
- DescriptionText2.DrawText(DescriptionText2.GetTextLayout("O"),CoordX - 5 , CoordY - 8 );
- }
- if (Inside) { OculusInsideDecorator.Paint(layer, actor, actor.FloorCoordinate, null); Inside = false; }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement