Advertisement
Guest User

FollowerPlugin

a guest
Nov 26th, 2017
840
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.04 KB | None | 0 0
  1. using System.Linq;
  2. using System.Collections.Generic;
  3.  
  4. using Turbo.Plugins.Default;
  5.  
  6. namespace Turbo.Plugins.gjuz
  7. {
  8.     public class FollowerPlugin : BasePlugin, IInGameWorldPainter
  9.     {
  10.         //4482  Hireling_Enchantress    Enchantress
  11.         //52694 Hireling_Scoundrel      Scoundrel
  12.         //52693 Hireling_Templer        Templer
  13.         private readonly uint[] snoIds = new uint[] { 4482, 52693, 52694 };
  14.         public Dictionary<uint, WorldDecoratorCollection> FollowerMapping { get; set; }
  15.        
  16.         public FollowerPlugin()
  17.         {
  18.             Enabled = true;
  19.         }
  20.  
  21.         public override void Load(IController hud)
  22.         {
  23.             base.Load(hud);
  24.            
  25.             FollowerMapping = new Dictionary<uint, WorldDecoratorCollection>();
  26.            
  27.             foreach (uint sno in snoIds)
  28.                 FollowerMapping.Add(sno, createWDC());
  29.         }
  30.        
  31.         private WorldDecoratorCollection createWDC(int a = 220, int r=255, int g=51, int b=153, float strokeWidth_T=3f, float strokeWidth_C=5f, float strokeWidth_S=5f, float radiusM=8f, float radiusG=1f)
  32.         {
  33.             return new WorldDecoratorCollection(
  34.                 new MapShapeDecorator(Hud)
  35.                 {
  36.                     Brush = Hud.Render.CreateBrush(a, r, g, b, strokeWidth_T),
  37.                     ShapePainter = new TriangleShapePainter(Hud),
  38.                     Radius = radiusM
  39.                 },
  40.                 new GroundShapeDecorator(Hud)
  41.                 {
  42.                     Brush = Hud.Render.CreateBrush(a, r, g, b, strokeWidth_S),
  43.                     Radius = radiusG,
  44.                     ShapePainter = WorldStarShapePainter.NewCross(Hud),
  45.                     // RotationTransformator = new CircularRotationTransformator(Hud, 10)
  46.                 },
  47.                 new GroundCircleDecorator(Hud) {
  48.                     Brush = Hud.Render.CreateBrush(a, r, g, b, strokeWidth_C),
  49.                     Radius = radiusG
  50.                 }
  51.             );
  52.         }
  53.        
  54.         public void PaintWorld(WorldLayer layer)
  55.         {
  56.             if (Hud.Game.NumberOfPlayersInGame > 1) return;
  57.            
  58.             foreach (var actor in Hud.Game.Actors.Where(x => snoIds.Contains(x.SnoActor.Sno)))
  59.             {
  60.                 FollowerMapping[actor.SnoActor.Sno].Paint(layer, actor, actor.FloorCoordinate, string.Empty);
  61.             }
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement