Advertisement
RNNCode

BountiesTracking

Mar 23rd, 2024 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 18.49 KB | None | 0 0
  1. using System;
  2. using Turbo.Plugins.Default;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using SharpDX.DirectInput;
  6.  
  7. namespace Turbo.Plugins.RNN
  8. {
  9.     public class BountiesTracking : BasePlugin, IKeyEventHandler, INewAreaHandler, IInGameTopPainter
  10.     {
  11.         public float xpos { get; set; } = 0;
  12.         public float ypos { get; set; } = 0;
  13.         private float x  { get; set; } = 0;
  14.         private float y  { get; set; } = 0;
  15.         private bool fixLoad  {get; set; } = true;
  16.  
  17.         private IFont DefaultFont { get; set; }
  18.         private IFont DefaultFontm { get; set; }
  19.         private IFont DefaultFontmTown { get; set; }
  20.         private IFont DefaultFontmBoss { get; set; }
  21.         private IFont SpecialFontm { get; set; }
  22.  
  23.         private IFont GrisFont { get; set; }
  24.         private IFont VerdeFont { get; set; }
  25.         private IFont OrangeFont { get; set; }
  26.         private IFont RojoFont { get; set; }
  27.         private IFont SelecFont { get; set; }
  28.  
  29.         private IFont BossFont { get; set; }
  30.         private IFont BossGoFont { get; set; }
  31.         private IFont BossWaitFont { get; set; }
  32.         private IFont ChestFont { get; set; }
  33.  
  34.         private IBrush BrushTown { get; set; }
  35.         private IBrush BrushShadow { get; set; }
  36.  
  37.         private Dictionary<uint, Tuple<string,string>> QuestBosses { get; set; }
  38.         private Dictionary<uint, int> ActFix { get; set; }
  39.         private List<uint> Chests100_Sno { get; set; }
  40.         private List<uint> EspecialMap { get; set; }
  41.  
  42.         private bool BTr_On { get; set; } = false;
  43.         private int BossActive { get; set; } = 0;
  44.         public bool TurnOffWhenNewGameStarts { get; set; }
  45.  
  46.         public IKeyEvent ToggleKeyEvent { get; set; }
  47.         public Key Hot_Key
  48.         {
  49.             get { return ToggleKeyEvent.Key; }
  50.             set { ToggleKeyEvent = Hud.Input.CreateKeyEvent(true, value, false, false, false); }
  51.         }
  52.  
  53.         public int [] OrderActs { get; set; }
  54.         public bool PlayerInTownGray { get; set; }
  55.         public bool MeInRiftOFF { get; set; }
  56.  
  57.         private bool[] HCache { get; set; } = new bool[] { false, false, false, false, false, false };
  58.         private List<int> HCacheList { get; set; } = new List<int>();
  59.         private bool once { get; set; }
  60.         private int nCache { get; set; } = 0;
  61.         private float OffsetA { get; set; } = 0f;
  62.         private float OffsetB { get; set; } = 0f;
  63.         private float OffsetH { get; set; } = 0f;
  64.         private float pH { get; set; } = 1.1f;
  65.         private int MyIndex { get; set; } = -1;
  66.         private QuestState[] stateRewards { get; set; } = new QuestState[6];
  67.         private uint[] QuestHoradric { get; set; } = new uint[] { 0, 356988, 356994, 356996, 356999, 357001 };
  68.  
  69.         private TopLabelDecorator BTtimersDecorator { get; set; }
  70.  
  71.         public BountiesTracking()
  72.         {
  73.             Enabled = true;
  74.         }
  75.  
  76.         public override void Load(IController hud) {
  77.             base.Load(hud);
  78.             Order = 31002;
  79.  
  80.             xpos = 0.90f;
  81.             ypos = 0.79f;
  82.             Hot_Key = Key.F7;
  83.             OrderActs = new int[] { 2, 4, 1, 3, 5 };  // Orden en el que hay que completar los bosses para que todos los jugadores lo sigan.
  84.             MeInRiftOFF = true;
  85.             TurnOffWhenNewGameStarts = false;
  86.  
  87.             PlayerInTownGray = true;
  88.  
  89.             DefaultFont = Hud.Render.CreateFont("tahoma", 8f, 255, 190, 155, 115, false, false, 250, 0, 0, 0, true);
  90.             DefaultFontm = Hud.Render.CreateFont("tahoma", 7f, 200, 190, 155, 115, false, false, 250, 0, 0, 0, true);
  91.             DefaultFontmTown = Hud.Render.CreateFont("tahoma", 7f, 220, 135, 130, 125, false, false, 250, 0, 0, 0, true);
  92.             DefaultFontmBoss = Hud.Render.CreateFont("tahoma", 7f, 220, 255, 128, 0, false, false, 250, 0, 0, 0, true);
  93.             SpecialFontm = Hud.Render.CreateFont("tahoma", 7f, 50, 250, 250, 250, false, false, true);
  94.             VerdeFont = Hud.Render.CreateFont("tahoma", 8f, 250, 0, 250, 0, false, false, 250, 0, 0, 0, true);
  95.             OrangeFont = Hud.Render.CreateFont("tahoma", 8f, 250, 255, 128, 0, false, false, 250, 0, 0, 0, true);
  96.             RojoFont = Hud.Render.CreateFont("tahoma", 8f, 250, 255, 0, 0, false, false, 250, 0, 0, 0, true);
  97.             GrisFont = Hud.Render.CreateFont("tahoma", 8f, 255, 128, 128, 128, false, false, 250, 0, 0, 0, true);
  98.  
  99.             BossGoFont = Hud.Render.CreateFont("tahoma", 7f, 250, 0, 250, 0, true, true, 160, 0, 0, 0, true);
  100.             BossWaitFont = Hud.Render.CreateFont("tahoma", 7f, 250, 255, 0, 0, true, true, 160, 0, 0, 0, true);
  101.             BossFont = Hud.Render.CreateFont("tahoma", 7f, 250, 0, 150, 0, true, true, 160, 0, 0, 0, true);
  102.             ChestFont = Hud.Render.CreateFont("tahoma", 7f, 250, 255, 128, 0, true, true, 160, 0, 0, 0, true);
  103.  
  104.             BrushTown = hud.Render.CreateBrush(255, 255, 128, 0, 5);
  105.             BrushShadow = Hud.Render.CreateBrush(150, 0, 0, 0, (BrushTown.StrokeWidth < 0) ? BrushTown.StrokeWidth - 1: BrushTown.StrokeWidth + 1);
  106.  
  107.             // SnoQuest.Sno de contratos en los que aparece un cofre y hay que matar 100 monstruos en 60 seg.
  108.             Chests100_Sno = new List<uint>
  109.             {
  110.                     365381, 369789, 369944, 375191, 375201,               //1
  111.                     369800, 375257, 375261, 464596, 464598, 466835,       //2
  112.                     369825, 436269, 447218,                               //3
  113.                     369878, 409897, 467798, 470608, 470561,               //4
  114.                     375268, 375275, 375278, 375348, 445139, 445158        //5
  115.             };
  116.             EspecialMap = new List<uint>
  117.             {
  118.                 //  288482, 288684, 288686, 288797, 288799, 288801, 288803, 288809, 288812, 288813, // Rift, GRift level 1-10 . Finalmente usaré la doble comprobación con 288482
  119.                     434650,          // Cow
  120.                     257116, 256767, 256106, 256742, 374239, // Ubers
  121.                     409094,   //  Chupivilla
  122.                     380773,380774,  // Vault
  123.                     483058,483085// Vault Ancient
  124.                     488740, 488741, 488742, 488743, 488745, 488746, 488767, 488770, 488799, 488800, 488870, 488871, 488872, 488873, 488874, // Visions
  125.                     486520 // Nigthmares
  126.             };
  127.  
  128.             // (SnoArea.Sno,act) para conocer el acto al que pertenecen los mapas nuevos, al parecer no tienen asociado un acto en TH
  129.             ActFix = new Dictionary<uint, int>
  130.             {
  131.                 {445426, 1}, //1
  132.                 {63666,  2}, {456638, 2}, {460671, 2}, {464092, 2}, {464830, 2}, {465885, 2}, {467383, 2}, //2
  133.                 {444307, 3}, {445762, 3}, //3
  134.                 {444396, 4}, {445792, 4}, {446367, 4}, {446550, 4}, {448011, 4}, {448039, 4},  //4
  135.                 {464063, 4}, {464065, 4}, {464066, 4},
  136.                 {464810, 4}, {464820, 4}, {464821, 4}, {464822, 4}, {464857, 4}, {464858, 4},  // 464821 and 464821 ¿fix Turbo.Sno.Dll?
  137.                 {464865, 4}, {464867, 4}, {464868, 4}, {464870, 4}, {464871, 4}, {464873, 4},
  138.                 {464874, 4}, {464875, 4}, {464882, 4}, {464886, 4}, {464889, 4}, {464890, 4},
  139.                 {464940, 4}, {464941, 4}, {464942, 4}, {464943, 4}, {464944, 4},
  140.                 {475854, 4}, {475856, 4},
  141.                 {448391, 5}, {448368, 5}, {448375, 5}, {448398, 5}, {448404,5},  {448411,5}, //5
  142.             };
  143.  
  144.             // SnoQuest.Sno de los Contratos en los que nos piden Matar a un Boss
  145.             QuestBosses = new Dictionary<uint, Tuple<string,string>>
  146.             {
  147.                 {347032, new Tuple<string,string>("Butcher",               "|90881|")}, {345528, new Tuple<string,string>("Araneae",   "|62726|")}, //1
  148.                 {361234, new Tuple<string,string>("Sk. King",              "|19789|")},
  149.                 {347656, new Tuple<string,string>("Kulle",                 "|60194|")}, {358353, new Tuple<string,string>("Belial",    "|60757|")}, //2
  150.                 {347558, new Tuple<string,string>("Maghda",               "|195268|")}, {474066, new Tuple<string,string>("Vidian",   "|467383|")},
  151.                 {346166, new Tuple<string,string>("Ghom",                 "|111232|")}, {349242, new Tuple<string,string>("A. Beast", "|112580|")}, //3
  152.                 {349244, new Tuple<string,string>("Azmodan",              "|111516|")}, {349224, new Tuple<string,string>("Cydaea",   "|119656|")},
  153.                 {361421, new Tuple<string,string>("Izual",                "|215396|")}, {349262, new Tuple<string,string>("Rakanoth", "|143648|")}, //4
  154.                 {349288, new Tuple<string,string>("Diablo", "|109563|215235|153669|")},
  155.                 {359915, new Tuple<string,string>("Adria",                "|287220|")}, {359927, new Tuple<string,string>("Malthael", "|330576|")}, //5
  156.                 {359919, new Tuple<string,string>("Urzael",               "|308487|")},
  157.             };
  158.  
  159.             BTtimersDecorator = new TopLabelDecorator(Hud)
  160.             {
  161.                 TextFont = Hud.Render.CreateFont("tahoma", 6, 180, 255, 255, 0, false, false, false),
  162.                 BackgroundTexture1 = Hud.Texture.ButtonTextureGray,
  163.                 BackgroundTexture2 = Hud.Texture.BackgroundTextureGreen,
  164.                 BackgroundTextureOpacity1 = 0.20f,
  165.                 BackgroundTextureOpacity2 = 0.20f,
  166.                 TextFunc = () => "?",
  167.                 HintFunc = () => BTtimers(),
  168.             };
  169.         }
  170.  
  171.         public void OnNewArea(bool newGame, ISnoArea area)
  172.         {
  173.             if (newGame || (MyIndex != Hud.Game.Me.Index) )   // Fix partialment the newGame limitation
  174.             {
  175.                 MyIndex = Hud.Game.Me.Index;
  176.                 if (TurnOffWhenNewGameStarts)
  177.                 {
  178.                     BTr_On = false;
  179.                     BossActive = 0;
  180.                 }
  181.                 once = true;
  182.             }
  183.         }
  184.  
  185.         public void OnKeyEvent(IKeyEvent keyEvent)
  186.         {
  187.             if (keyEvent.IsPressed && ToggleKeyEvent.Matches(keyEvent))   {  BTr_On = !BTr_On;  if (BTr_On == false)  BossActive = 0 ; }
  188.         }
  189.  
  190.         public string BTtimers()
  191.         {
  192.             long[,] createdon = new long[,] { {0,long.MaxValue,0},{0,long.MaxValue,0},{0,long.MaxValue,0},{0,long.MaxValue,0},{0,long.MaxValue,0},{0,long.MaxValue,0} };
  193.             foreach (var quest in Hud.Game.Quests.Where(quest => quest.SnoQuest.Type == QuestType.Bounty))
  194.             {
  195.                 var acto = quest.SnoQuest.SnoAct.Index ;
  196.                 if (quest.StartedOn.ElapsedMilliseconds > createdon[acto,0])
  197.                 {
  198.                     createdon[acto,0] = (long) quest.StartedOn.ElapsedMilliseconds ;
  199.                     if (createdon[acto,0] > createdon[0,0]) {   createdon[0,0] = createdon[acto,0]; }
  200.                 }
  201.  
  202.                 if (quest.State == QuestState.completed)
  203.                 {
  204.                     createdon[acto,2] = createdon[acto,2] + 1;
  205.                     if (createdon[acto,2] == 5) { createdon[0,2] = createdon[0,2] + 1; }
  206.                     if (quest.CompletedOn.ElapsedMilliseconds < createdon[acto,1])
  207.                     {
  208.                         createdon[acto,1] = (long) quest.CompletedOn.ElapsedMilliseconds;
  209.                         if (createdon[acto,1] < createdon[0,1]) { createdon[0,1] = createdon[acto,1]; }
  210.                     }
  211.  
  212.                 }
  213.             }
  214.             string texto = string.Empty; long t = 0;
  215.             for (var i = 0; i < 6; i++)
  216.             {
  217.                     if ((createdon[i,2] == 5) && (createdon[i,0] != 0)) { t = (createdon[i,0] - createdon[i,1]) / 1000; }
  218.                     else { t = createdon[i,0] / 1000; }
  219.                     if (i == 0) { texto = String.Format("# [{0:0}:{1:00}]", (int) (t / 60), t % 60);  }
  220.                     else {  texto = String.Format("{0}\n{1})  {2:0}:{3:00}", texto, i, (int) (t / 60), t % 60); }
  221.             }
  222.             return texto;
  223.         }
  224.  
  225.         private void GetRewards()
  226.         {
  227.             var n = 0;
  228.             for (var i = 1; i < 6; i++)
  229.             {
  230.                 var quest = Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == QuestHoradric[i]);
  231.                 if (quest == null) stateRewards[i] = QuestState.none;
  232.                 else
  233.                 {
  234.                     stateRewards[i] = quest.State;
  235.                     if (quest.State == QuestState.completed) n++;
  236.                 }
  237.             }
  238.             stateRewards[0] = (n == 5)? QuestState.completed : QuestState.none;
  239.         }
  240.  
  241.         public void PaintTopInGame(ClipState clipState)   // public enum ClipState { BeforeClip, Inventory, AfterClip }
  242.         {
  243.             if (Hud.Render.UiHidden) return;
  244.             if (Hud.Game.IsInGame && BTr_On)
  245.             {
  246.                 if (fixLoad)
  247.                 {
  248.                     x = Hud.Window.Size.Width * xpos;
  249.                     y = Hud.Window.Size.Height * ypos;
  250.                     int l = 0; uint found = 0;
  251.                     foreach(var qb in QuestBosses)
  252.                     {
  253.                         if (qb.Value.Item1.Length > l)  { l = qb.Value.Item1.Length; found = qb.Key; }
  254.                     }
  255.                     OffsetB = VerdeFont.GetTextLayout(QuestBosses[found].Item1).Metrics.Width;
  256.                     OffsetA = DefaultFont.GetTextLayout("[A5] 5 (+5)").Metrics.Width;
  257.                     OffsetH = DefaultFont.GetTextLayout("[]").Metrics.Height * pH;
  258.                     fixLoad = false;
  259.                 }
  260.  
  261.                 if (clipState == ClipState.BeforeClip)
  262.                 {
  263.                     GetRewards();
  264.                     if ( MeInRiftOFF && ((Hud.Game.Me.SnoArea.HostAreaSno == 288482) || (Hud.Game.Me.SnoArea.Sno == 288482)) )  { BossActive = 0; return; }
  265.                     int [,] Cont_B = new int [6,2] { {0,0},{0,0},{0,0},{0,0},{0,0},{0,0}  };
  266.                     string [] Bosses = new string [6] { " ----" ," ----"," ----"," ----"," ----"," ----" };
  267.                     int [] Bosses_State = new int [6] { 3,3,3,3,3,3 };
  268.                     int [] Chests100_State = new int [6] { 0,0,0,0,0,0 };
  269.                     string BossMap = string.Empty;
  270.  
  271.                     foreach (var quest in Hud.Game.Quests.Where(quest => quest.SnoQuest.Type == QuestType.Bounty))
  272.                     {
  273.                         var acto = quest.SnoQuest.SnoAct.Index ;
  274.                         if (quest.State == QuestState.completed)  { Cont_B[acto,0] =  Cont_B[acto,0] + 1 ; Cont_B[0,0] =  Cont_B[0,0] + 1 ;  }
  275.                         else if (quest.State == QuestState.started)    { Cont_B[acto,1] =  Cont_B[acto,1] + 1 ; Cont_B[0,1] =  Cont_B[0,1] + 1 ; }
  276.                         if (QuestBosses.ContainsKey(quest.SnoQuest.Sno))
  277.                         {
  278.                             Bosses[acto] = QuestBosses[quest.SnoQuest.Sno].Item1;
  279.                             BossMap += QuestBosses[quest.SnoQuest.Sno].Item2;
  280.                             Bosses_State[acto] = (quest.State == QuestState.completed)? 2 : ( (quest.State == QuestState.started)? 1 : 0 ) ;
  281.                         }
  282.                         else if (Chests100_Sno.Contains(quest.SnoQuest.Sno))
  283.                         {
  284.                             Chests100_State[acto] = (quest.State == QuestState.completed)? 1 : ( (quest.State == QuestState.started)? 3 : 2 ) ;
  285.                         }
  286.                     }
  287.  
  288.                     if ((Cont_B[0,0] == 25))
  289.                     {
  290.                         if (stateRewards[0] == QuestState.completed)    { VerdeFont.DrawText(VerdeFont.GetTextLayout("! Bounties  Completed !"), x  , y );  }
  291.                         else { OrangeFont.DrawText(OrangeFont.GetTextLayout("! Bounties  Completed !"), x  , y );  }
  292.                     }
  293.                     else { DefaultFont.DrawText(DefaultFont.GetTextLayout( (25 - Cont_B[0,0]) + " Remaining  (" + Cont_B[0,1] + " Started)"), x  , y ); }
  294.                     BTtimersDecorator.Paint(x + OffsetA * 2.3f, y + 1, Hud.Window.Size.Width * 0.012f, Hud.Window.Size.Width * 0.01f, HorizontalAlign.Center);
  295.                     int activo = 0 ;
  296.                     foreach (int i in OrderActs)
  297.                     {
  298.                         if (Bosses_State[i] < 2) { activo = i;  break; }
  299.                     }
  300.  
  301.                     BossActive = activo;
  302.                     var players = Hud.Game.Players;
  303.                     string [] Players_Act = new string [6] {string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty};
  304.                     string [] Players_ActTown = new string [6] {string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty};
  305.                     string [] Players_Boss = new string [6] {string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty};
  306.  
  307.                     foreach (var player in players)
  308.                     {
  309.                         if ((player.SnoArea.HostAreaSno == 288482) || (player.SnoArea.Sno == 288482) ) continue;
  310.                         if (EspecialMap.Contains(player.SnoArea.Sno))
  311.                         {
  312.                             Players_ActTown[0] +=  player.BattleTagAbovePortrait + " ";
  313.                         }
  314.                         else
  315.                         {
  316.                             int acto = player.SnoArea.Act;
  317.                             if ( (acto > 0) || (ActFix.TryGetValue(player.SnoArea.Sno, out acto)) )
  318.                             {
  319.                                 if (player.IsInTown && PlayerInTownGray)
  320.                                 {
  321.                                     Players_ActTown[acto] += player.BattleTagAbovePortrait + " ";
  322.                                 }
  323.                                 else if (( Bosses_State[acto] == 1) && BossMap.Contains("|" + player.SnoArea.Sno + "|") )
  324.                                 {
  325.                                     Players_Boss[acto] += player.BattleTagAbovePortrait + " ";
  326.                                 }
  327.                                 else
  328.                                 {
  329.                                     Players_Act[acto] += player.BattleTagAbovePortrait + " ";
  330.                                 }
  331.                             }
  332.                             else
  333.                             {
  334.                                 DefaultFont.DrawText(DefaultFont.GetTextLayout("Fix: " + player.BattleTagAbovePortrait + "-" + player.SnoArea.Sno ), Hud.Window.Size.Width * 0.93f, Hud.Window.Size.Height * 0.97f);
  335.                             }
  336.                         }
  337.                     }
  338.                     if (Players_ActTown[0] != string.Empty)
  339.                     {
  340.                         var t = SpecialFontm.GetTextLayout(Players_ActTown[0]);
  341.                         SpecialFontm.DrawText(t, x - t.Metrics.Width - t.Metrics.Height , y + 1);
  342.                     }
  343.                     for (int j = 1; j < 6; j++)
  344.                     {
  345.                         var texto = string.Format("{0}  {1} (+{2}) ",(stateRewards[j] == QuestState.completed)? "[A" + j + "]": " A" + j + (Cont_B[j,0] == 5 ? "!":" "),Cont_B[j,0],Cont_B[j,1] );
  346.                         DefaultFont.DrawText(DefaultFont.GetTextLayout(texto), x  , (y) + j * OffsetH );
  347.                         SelecFont = (Bosses_State[j] > 1)? GrisFont: (activo == j)? VerdeFont : RojoFont ;
  348.                         SelecFont.DrawText(SelecFont.GetTextLayout(Bosses[j]), x + OffsetA + OffsetH , (y) + j * OffsetH );
  349.                         if (Bosses_State[j] == 1) { SelecFont.DrawText(SelecFont.GetTextLayout("🡄"), x + OffsetA + OffsetB + 1.6f * OffsetH, (y) + j * OffsetH ); }
  350.                         var pos = x - DefaultFontmTown.GetTextLayout("-").Metrics.Width;
  351.                         if (Players_ActTown[j] != string.Empty)
  352.                         {
  353.                             pos -= DefaultFontmTown.GetTextLayout("-" + Players_ActTown[j]).Metrics.Width;
  354.                             DefaultFontmTown.DrawText(DefaultFontmTown.GetTextLayout(Players_ActTown[j]), pos , y + (float) j * OffsetH + 1);
  355.                         }
  356.                         if (Players_Boss[j] != string.Empty)
  357.                         {
  358.                             pos -= DefaultFontmBoss.GetTextLayout("-" + Players_Boss[j]).Metrics.Width;
  359.                             DefaultFontmBoss.DrawText(DefaultFontm.GetTextLayout(Players_Boss[j]), pos , y + (float) j * OffsetH + 1);
  360.                         }
  361.                         if (Players_Act[j] != string.Empty)
  362.                         {
  363.                             pos -= DefaultFontm.GetTextLayout("-" + Players_Act[j]).Metrics.Width;
  364.                             DefaultFontm.DrawText(DefaultFontm.GetTextLayout(Players_Act[j]), pos , y + (float) j * OffsetH + 1);
  365.                         }
  366.                         if (Chests100_State[j] > 1)
  367.                         {
  368.                             if (Chests100_State[j] == 3) DefaultFontm.DrawText(DefaultFontm.GetTextLayout("►"), x + OffsetA + OffsetB + 2.6f * OffsetH   , (y) + j * OffsetH );
  369.                             else DefaultFont.DrawText(DefaultFont.GetTextLayout("+"), x + OffsetA + OffsetB + 2.6f * OffsetH  , (y) + (float) j * OffsetH );
  370.                         }
  371.                     }
  372.                 }
  373.                 else if (clipState == ClipState.AfterClip)
  374.                 {
  375.                     if (!Hud.Render.WorldMapUiElement.Visible || Hud.Render.ActMapUiElement.Visible) return;
  376.                     if (Hud.Game.ActMapCurrentAct == BountyAct.None) return;
  377.                     var w = 220 * Hud.Window.HeightUiRatio;  var h = 100 * Hud.Window.HeightUiRatio;
  378.                     foreach (var waypoint in Hud.Game.ActMapWaypoints.Where(x => x.BountyAct == Hud.Game.ActMapCurrentAct))
  379.                     {
  380.                         var x = Hud.Render.WorldMapUiElement.Rectangle.X + waypoint.CoordinateOnMapUiElement.X * Hud.Window.HeightUiRatio;
  381.                         var y = Hud.Render.WorldMapUiElement.Rectangle.Y + waypoint.CoordinateOnMapUiElement.Y * Hud.Window.HeightUiRatio;
  382.                         if (waypoint.TargetSnoArea.IsTown)
  383.                         {
  384.                             BrushShadow.DrawEllipse(x + w * 0.5f, y + h * 0.3f, h * 0.20f ,h * 0.20f );
  385.                             BrushTown.DrawEllipse(x + w * 0.5f, y + h * 0.3f, h * 0.20f ,h * 0.20f );
  386.                         }
  387.  
  388.                         var quest = Hud.Game.Bounties.FirstOrDefault(q => q.SnoQuest.BountySnoArea == waypoint.TargetSnoArea);
  389.                         if ((quest != null) && quest.State != QuestState.completed)
  390.                         {
  391.                             if (QuestBosses.ContainsKey(quest.SnoQuest.Sno)) SelecFont = (BossActive == 0)? BossFont:(BossActive == quest.SnoQuest.SnoAct.Index)? BossGoFont:BossWaitFont ;
  392.                             else if (Chests100_Sno.Contains(quest.SnoQuest.Sno)) SelecFont = ChestFont;
  393.                             else continue;
  394.                             var layout = SelecFont.GetTextLayout(quest.SnoQuest.NameLocalized) ;
  395.                             SelecFont.DrawText(layout, x + (w - layout.Metrics.Width) / 2, y + (float)Math.Ceiling(h * 0.32f));
  396.                         }
  397.                     }
  398.                 }
  399.             }
  400.         }
  401.     }
  402. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement