Advertisement
Guest User

CraftersDelightPlugin

a guest
Dec 17th, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 35.92 KB | None | 0 0
  1. // https://github.com/User5981/Resu
  2. // Crafter's Delight Plugin for TurboHUD Version 15/10/2019 05:10
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Threading;
  8. using Turbo.Plugins.Default;
  9.  
  10. namespace Turbo.Plugins.Resu
  11. {
  12.     public class CraftersDelightPlugin : BasePlugin, IInGameWorldPainter, ILootGeneratedHandler, ICustomizer, IInGameTopPainter
  13.     {
  14.         public Dictionary<uint, WorldDecoratorCollection> SnoMapping { get; set; }
  15.         public WorldDecoratorCollection SlainFarmerDecorator { get; set; }
  16.         public WorldDecoratorCollection ancientRankDecorator { get; set; }
  17.         public WorldDecoratorCollection ancientRankSetDecorator { get; set; }
  18.         public WorldDecoratorCollection CountDecorator { get; set; }
  19.         public WorldDecoratorCollection HoradricCacheDecorator { get; set; }
  20.         public WorldDecoratorCollection EquippedDecorator { get; set; }
  21.         public WorldDecoratorCollection NormalDecorator { get; set; }
  22.         public WorldDecoratorCollection MagicDecorator { get; set; }
  23.         public WorldDecoratorCollection RareDecorator { get; set; }
  24.         public bool ShowAncientRank { get; set; }
  25.         public bool SlainFarmers { get; set; }
  26.         public bool DeathsBreath { get; set; }
  27.         public bool VeiledCrystal { get; set; }
  28.         public bool ArcaneDust { get; set; }
  29.         public bool Gems { get; set; }
  30.         public bool ForgottenSoul { get; set; }
  31.         public bool ReusableParts { get; set; }
  32.         public bool GreaterRiftKeystone { get; set; }
  33.         public bool BovineBardiche { get; set; }
  34.         public bool PuzzleRing { get; set; }
  35.         public bool BloodShards { get; set; }
  36.         public bool RamaladnisGift { get; set; }
  37.         public bool Potion { get; set; }
  38.         public bool InfernalMachine { get; set; }
  39.         public bool Bounty { get; set; }
  40.         public bool HellFire { get; set; }
  41.         public bool LegendaryGems { get; set; }
  42.         public bool HoradricCaches { get; set; }
  43.         public long HoradricTimer { get; set; }
  44.         public long NextHoradricSound { get; set; }
  45.         public bool Equipped { get; set; }
  46.         public bool LoreChestsDisplay { get; set; }
  47.         public bool NormalChestsDisplay { get; set; }
  48.         public bool ResplendentChestsDisplay { get; set; }
  49.         public bool GroupGems { get; set; }
  50.         public bool NoobGearMode { get; set; }
  51.         public IBrush EquippedBrush { get; set; }
  52.         private bool init_mapping;
  53.  
  54.         public WorldDecoratorCollection GreaterRiftKeystoneDecorator
  55.         {
  56.             get { return SnoMapping.ContainsKey(2835237830) ? SnoMapping[2835237830] : null; }
  57.             set { SnoMapping[2835237830] = value; }
  58.         }
  59.  
  60.         public CraftersDelightPlugin()
  61.         {
  62.             Enabled = true;
  63.         }
  64.  
  65.         public void Customize()
  66.         {
  67.             Hud.RunOnPlugin<ItemsPlugin>(plugin => plugin.DeathsBreathDecorator.Decorators.Clear());    // turn off Death's Breath on official ItemsPlugin
  68.             Hud.GetPlugin<ItemsPlugin>().LegendaryDecorator.ToggleDecorators<MapShapeDecorator>(false);
  69.             Hud.GetPlugin<ItemsPlugin>().AncientDecorator.ToggleDecorators<MapShapeDecorator>(false);
  70.             Hud.GetPlugin<ItemsPlugin>().PrimalDecorator.ToggleDecorators<MapShapeDecorator>(false);
  71.             Hud.GetPlugin<ItemsPlugin>().SetDecorator.ToggleDecorators<MapShapeDecorator>(false);
  72.             Hud.GetPlugin<ItemsPlugin>().AncientSetDecorator.ToggleDecorators<MapShapeDecorator>(false);
  73.             Hud.GetPlugin<ItemsPlugin>().PrimalSetDecorator.ToggleDecorators<MapShapeDecorator>(false);
  74.             //Hud.TogglePlugin<ChestPlugin>(false);     // disables official ChestPlugin
  75.         }
  76.  
  77.         private void init()
  78.         {
  79.             SnoMapping = new Dictionary<uint, WorldDecoratorCollection>();
  80.             var blackBrush = Hud.Render.CreateBrush(160, 0, 0, 0, 1);
  81.             var whiteBrush = Hud.Render.CreateBrush(160, 255, 255, 255, 1);
  82.             var purpleBrush = Hud.Render.CreateBrush(160, 146, 32, 175, 1);
  83.             var brownBrush = Hud.Render.CreateBrush(160, 91, 22, 12, 1);
  84.             var mudBrush = Hud.Render.CreateBrush(160, 146, 29, 0, 1);
  85.             var BlueGreenBrush = Hud.Render.CreateBrush(160, 14, 215, 195, 1);
  86.             var grayBrush = Hud.Render.CreateBrush(160, 55, 61, 53, 1);
  87.             var orangeBrush = Hud.Render.CreateBrush(160, 255, 232, 113, 1);
  88.             var RoyalBlueBrush = Hud.Render.CreateBrush(160, 65, 105, 255, 1);
  89.             var blackFont = Hud.Render.CreateFont("tahoma", 7, 255, 0, 0, 0, true, false, false);
  90.             var whiteFont = Hud.Render.CreateFont("tahoma", 7, 255, 255, 255, 255, true, false, false);
  91.             var purpleFont = Hud.Render.CreateFont("tahoma", 7, 255, 146, 32, 175, true, false, false);
  92.             var orangeFont = Hud.Render.CreateFont("tahoma", 7, 255, 255, 232, 113, true, false, false);
  93.             var brownFont = Hud.Render.CreateFont("tahoma", 7, 255, 91, 22, 12, true, false, false);
  94.             var mudFont = Hud.Render.CreateFont("tahoma", 7, 255, 146, 29, 0, true, false, false);
  95.             var BlueGreenFont = Hud.Render.CreateFont("tahoma", 7, 255, 14, 215, 195, true, false, false);
  96.             var grayFont = Hud.Render.CreateFont("tahoma", 7, 255, 55, 61, 53, true, false, false);
  97.             var RoyalBlueFont = Hud.Render.CreateFont("tahoma", 7, 255, 65, 105, 255, true, false, false);
  98.  
  99.             // Death Breath => already handled by ItemsPlugin but needed
  100.             if (DeathsBreath) { AddDecorator(2087837753, Hud.Render.CreateBrush(160, 89, 178, 153, 0), whiteBrush, orangeFont); }
  101.  
  102.             // Veiled Crystal
  103.             if (VeiledCrystal) { AddDecorator(3689019703, Hud.Render.CreateBrush(120, 223, 223, 1, 0), brownBrush, brownFont); }
  104.  
  105.             // Arcane Dust
  106.             if (ArcaneDust) { AddDecorator(2709165134, Hud.Render.CreateBrush(160, 105, 105, 254, 0), BlueGreenBrush, BlueGreenFont); }
  107.  
  108.             // Gems
  109.             if (Gems) {
  110.                 AddDecorator(2979276674, Hud.Render.CreateBrush(160, 82, 107, 173, 0), whiteBrush, whiteFont);  // 2979276674 - Imperial Diamond
  111.                 AddDecorator(2979276673, Hud.Render.CreateBrush(160, 82, 107, 173, 0), whiteBrush, whiteFont);  // 2979276673 - Marquise Diamond
  112.                 AddDecorator(3256663689, Hud.Render.CreateBrush(160, 82, 107, 173, 0), whiteBrush, whiteFont);  // 3256663689 - Marquise Diamond
  113.                 AddDecorator(3256663690, Hud.Render.CreateBrush(160, 82, 107, 173, 0), whiteBrush, whiteFont);  // 3256663690 - Imperial Diamond
  114.                 AddDecorator(3256663684, Hud.Render.CreateBrush(160, 82, 107, 173, 0), whiteBrush, whiteFont);  // 3256663684 - Diamond
  115.                 AddDecorator(3256663685, Hud.Render.CreateBrush(160, 82, 107, 173, 0), whiteBrush, whiteFont);  // 3256663685 - Flawless Diamond
  116.                 AddDecorator(3256663686, Hud.Render.CreateBrush(160, 82, 107, 173, 0), whiteBrush, whiteFont);  // 3256663686 - Square Diamond
  117.                 AddDecorator(3256663687, Hud.Render.CreateBrush(160, 82, 107, 173, 0), whiteBrush, whiteFont);  // 3256663687 - Flawless Square Diamond
  118.                 AddDecorator(3256663688, Hud.Render.CreateBrush(160, 82, 107, 173, 0), whiteBrush, whiteFont);  // 3256663688 - Star Diamond
  119.  
  120.                 AddDecorator(3446938396, Hud.Render.CreateBrush(160, 113, 0, 175, 0), whiteBrush, whiteFont);   // 3446938396 - Marquise Amethyst
  121.                 AddDecorator(3446938397, Hud.Render.CreateBrush(160, 113, 0, 175, 0), whiteBrush, whiteFont);   // 3446938397 - Imperial Amethyst
  122.                 AddDecorator(2883100436, Hud.Render.CreateBrush(160, 113, 0, 175, 0), whiteBrush, whiteFont);   // 2883100436 - Marquise Amethyst
  123.                 AddDecorator(2883100437, Hud.Render.CreateBrush(160, 113, 0, 175, 0), whiteBrush, whiteFont);   // 2883100437 - Imperial Amethyst
  124.                 AddDecorator(3446938391, Hud.Render.CreateBrush(160, 113, 0, 175, 0), whiteBrush, whiteFont);   // 3446938391 - Amethyst
  125.                 AddDecorator(3446938392, Hud.Render.CreateBrush(160, 113, 0, 175, 0), whiteBrush, whiteFont);   // 3446938392 - Flawless Amethyst
  126.                 AddDecorator(3446938393, Hud.Render.CreateBrush(160, 113, 0, 175, 0), whiteBrush, whiteFont);   // 3446938393 - Square Amethyst
  127.                 AddDecorator(3446938394, Hud.Render.CreateBrush(160, 113, 0, 175, 0), whiteBrush, whiteFont);   // 3446938394 - Flawless Square Amethyst
  128.                 AddDecorator(3446938395, Hud.Render.CreateBrush(160, 113, 0, 175, 0), whiteBrush, whiteFont);   // 3446938395 - Star Amethyst
  129.  
  130.                 AddDecorator(2838965543, Hud.Render.CreateBrush(160, 14, 167, 12, 0), whiteBrush, whiteFont);   // 2838965543 - Marquise Emerald
  131.                 AddDecorator(2838965544, Hud.Render.CreateBrush(160, 14, 167, 12, 0), whiteBrush, whiteFont);   // 2838965544 - Imperial Emerald
  132.                 AddDecorator(2561578527, Hud.Render.CreateBrush(160, 14, 167, 12, 0), whiteBrush, whiteFont);   // 2561578527 - Marquise Emerald
  133.                 AddDecorator(2561578528, Hud.Render.CreateBrush(160, 14, 167, 12, 0), whiteBrush, whiteFont);   // 2561578528 - Imperial Emerald
  134.                 AddDecorator(2838965538, Hud.Render.CreateBrush(160, 14, 167, 12, 0), whiteBrush, whiteFont);   // 2838965538 - Emerald
  135.                 AddDecorator(2838965539, Hud.Render.CreateBrush(160, 14, 167, 12, 0), whiteBrush, whiteFont);   // 2838965539 - Flawless Emerald
  136.                 AddDecorator(2838965540, Hud.Render.CreateBrush(160, 14, 167, 12, 0), whiteBrush, whiteFont);   // 2838965540 - Square Emerald
  137.                 AddDecorator(2838965541, Hud.Render.CreateBrush(160, 14, 167, 12, 0), whiteBrush, whiteFont);   // 2838965541 - Flawless Square Emerald
  138.                 AddDecorator(2838965542, Hud.Render.CreateBrush(160, 14, 167, 12, 0), whiteBrush, whiteFont);   // 2838965542 - Star Emerald
  139.  
  140.                 AddDecorator(1019190639, Hud.Render.CreateBrush(160, 157, 21, 8, 0), whiteBrush, whiteFont);    // 1019190639 - Marquise Ruby
  141.                 AddDecorator(1019190640, Hud.Render.CreateBrush(160, 157, 21, 8, 0), whiteBrush, whiteFont);    // 1019190640 - Imperial Ruby
  142.                 AddDecorator(1603007847, Hud.Render.CreateBrush(160, 157, 21, 8, 0), whiteBrush, whiteFont);    // 1603007847 - Marquise Ruby
  143.                 AddDecorator(1603007848, Hud.Render.CreateBrush(160, 157, 21, 8, 0), whiteBrush, whiteFont);    // 1603007848 - Imperial Ruby
  144.                 AddDecorator(1603007812, Hud.Render.CreateBrush(160, 157, 21, 8, 0), whiteBrush, whiteFont);    // 1603007812 - Ruby
  145.                 AddDecorator(1603007813, Hud.Render.CreateBrush(160, 157, 21, 8, 0), whiteBrush, whiteFont);    // 1603007813 - Flawless Ruby
  146.                 AddDecorator(1603007816, Hud.Render.CreateBrush(160, 157, 21, 8, 0), whiteBrush, whiteFont);    // 1603007816 - Square Ruby
  147.                 AddDecorator(1603007817, Hud.Render.CreateBrush(160, 157, 21, 8, 0), whiteBrush, whiteFont);    // 1603007817 - Flawless Square Ruby
  148.                 AddDecorator(1603007843, Hud.Render.CreateBrush(160, 157, 21, 8, 0), whiteBrush, whiteFont);    // 1603007843 - Star Ruby
  149.  
  150.                 AddDecorator(4267641563, Hud.Render.CreateBrush(160, 163, 98, 7, 0), whiteBrush, whiteFont);    // 4267641563 - Marquise Topaz
  151.                 AddDecorator(4267641564, Hud.Render.CreateBrush(160, 163, 98, 7, 0), whiteBrush, whiteFont);    // 4267641564 - Imperial Topaz
  152.                 AddDecorator(2058771923, Hud.Render.CreateBrush(160, 163, 98, 7, 0), whiteBrush, whiteFont);    // 2058771923 - Marquise Topaz
  153.                 AddDecorator(2058771924, Hud.Render.CreateBrush(160, 163, 98, 7, 0), whiteBrush, whiteFont);    // 2058771924 - Imperial Topaz
  154.                 AddDecorator(2058771888, Hud.Render.CreateBrush(160, 163, 98, 7, 0), whiteBrush, whiteFont);    // 2058771888 - Topaz
  155.                 AddDecorator(2058771889, Hud.Render.CreateBrush(160, 163, 98, 7, 0), whiteBrush, whiteFont);    // 2058771889 - Flawless Topaz
  156.                 AddDecorator(2058771892, Hud.Render.CreateBrush(160, 163, 98, 7, 0), whiteBrush, whiteFont);    // 2058771892 - Square Topaz
  157.                 AddDecorator(2058771893, Hud.Render.CreateBrush(160, 163, 98, 7, 0), whiteBrush, whiteFont);    // 2058771893 - Flawless Square Topaz
  158.                 AddDecorator(2058771919, Hud.Render.CreateBrush(160, 163, 98, 7, 0), whiteBrush, whiteFont);    // 2058771919 - Star Topaz
  159.             }
  160.             // Forgotten Soul
  161.             if (ForgottenSoul) { AddDecorator(2073430088, Hud.Render.CreateBrush(160, 244, 122, 0, 0), mudBrush, mudFont); }
  162.  
  163.             // Reusable Parts
  164.             if (ReusableParts) { AddDecorator(3931359676, Hud.Render.CreateBrush(160, 193, 186, 102, 0), grayBrush, grayFont); }
  165.  
  166.             // Greater Rift Keystone
  167.             if (GreaterRiftKeystone) { AddDecorator(2835237830, Hud.Render.CreateBrush(180, 0, 0, 0, 0), purpleBrush, purpleFont); }
  168.  
  169.             // Bovine Bardiche
  170.             if (BovineBardiche) { AddDecorator(2346057823); }
  171.  
  172.             // Puzzle Ring
  173.             if (PuzzleRing) { AddDecorator(3106130529); }
  174.  
  175.             // Blood Shards
  176.             if (BloodShards) { AddDecorator(2603730171, Hud.Render.CreateBrush(160, 234, 47, 0, 0), orangeBrush, orangeFont); }
  177.  
  178.             // Ramaladni's Gift
  179.             if (RamaladnisGift) { AddDecorator(1844495708, Hud.Render.CreateBrush(160, 48, 187, 120, 0), orangeBrush, orangeFont); }
  180.  
  181.             // Potions
  182.             if (Potion) {
  183.                 AddDecorator(2276259498, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259498 - Bottomless Potion of the Tower
  184.                 AddDecorator(2276259499, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259499 - Bottomless Potion of the Diamond
  185.                 AddDecorator(2276259500, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259500 - Bottomless Potion of Regeneration
  186.                 AddDecorator(2276259501, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259501 - Bottomless Potion of the Leech
  187.                 AddDecorator(2276259502, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259502 - Bottomless Potion of Mutilation
  188.                 AddDecorator(2276259503, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259503 - Bottomless Potion of Kulle-Aid
  189.                 AddDecorator(2276259504, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259504 - Bottomless Potion of Rejuvenation
  190.                 AddDecorator(510979313, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont);  //  510979313 - Bottomless Potion of Rejuvenation
  191.                 AddDecorator(2276259505, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259505 - Bottomless Potion of Fear
  192.                 AddDecorator(2276259506, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259506 - Bottomless Potion of Amplification
  193.                 AddDecorator(2276259530, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259530 - Bottomless Potion of Chaos
  194.                 AddDecorator(2276259531, Hud.Render.CreateBrush(180, 0, 0, 0, 0), orangeBrush, orangeFont); // 2276259531 - Bottomless Potion of the Unfettered
  195.             }
  196.             // Infernal Machines
  197.             if (InfernalMachine) {
  198.                 AddDecorator(1054965529, Hud.Render.CreateBrush(120, 0, 0, 0, 0), whiteBrush, whiteFont);   // 1054965529 - Infernal Machine of Regret
  199.                 AddDecorator(2788723894, Hud.Render.CreateBrush(120, 0, 0, 0, 0), whiteBrush, whiteFont);   // 2788723894 - Infernal Machine of Putridness
  200.                 AddDecorator(2622355732, Hud.Render.CreateBrush(120, 0, 0, 0, 0), whiteBrush, whiteFont);   // 2622355732 - Infernal Machine of Terror
  201.                 AddDecorator(1458185494, Hud.Render.CreateBrush(120, 0, 0, 0, 0), whiteBrush, whiteFont);   // 1458185494 - Infernal Machine of Fright
  202.             }
  203.             // Bounty Materials
  204.             if (Bounty) {
  205.                 AddDecorator(1948629088, Hud.Render.CreateBrush(120, 146, 32, 175, 0), orangeBrush, orangeFont);    // 1948629088 - Khanduran Rune
  206.                 AddDecorator(1948629089, Hud.Render.CreateBrush(120, 146, 32, 175, 0), orangeBrush, orangeFont);    // 1948629089 - Caldeum Nightshade
  207.                 AddDecorator(1948629090, Hud.Render.CreateBrush(120, 146, 32, 175, 0), orangeBrush, orangeFont);    // 1948629090 - Arreat War Tapestry
  208.                 AddDecorator(1948629091, Hud.Render.CreateBrush(120, 146, 32, 175, 0), orangeBrush, orangeFont);    // 1948629091 - Corrupted Angel Flesh
  209.                 AddDecorator(1948629092, Hud.Render.CreateBrush(120, 146, 32, 175, 0), orangeBrush, orangeFont);    // 1948629092 - Westmarch Holy Water
  210.             }
  211.             // HellFire Materials
  212.             if (HellFire) {
  213.                 AddDecorator(1102953247, Hud.Render.CreateBrush(160, 234, 47, 0, 0), orangeBrush, orangeFont);  // 1102953247 - Leoric's Regret
  214.                 AddDecorator(2029265596, Hud.Render.CreateBrush(160, 234, 47, 0, 0), orangeBrush, orangeFont);  // 2029265596 - Vial of Putridness
  215.                 AddDecorator(2670343450, Hud.Render.CreateBrush(160, 234, 47, 0, 0), orangeBrush, orangeFont);  // 2670343450 - Idol of Terror
  216.                 AddDecorator(3336787100, Hud.Render.CreateBrush(160, 234, 47, 0, 0), orangeBrush, orangeFont);  // 3336787100 - Heart of Fright
  217.             }
  218.             // Legendary Gems
  219.             if (LegendaryGems) {
  220.                 AddDecorator(3248511367, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3248511367 - Bane of the Powerful
  221.                 AddDecorator(3248547304, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3248547304 - Bane of the Trapped
  222.                 AddDecorator(3248583241, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3248583241 - Gem of Ease
  223.                 AddDecorator(3248619178, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3248619178 - Wreath of Lightning
  224.                 AddDecorator(3248655115, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3248655115 - Gem of Efficacious Toxin
  225.                 AddDecorator(3248691052, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3248691052 - Pain Enhancer
  226.                 AddDecorator(3248726989, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3248726989 - Mirinae, Teardrop of the Starweaver
  227.                 AddDecorator(3248762926, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3248762926 - Gogok of Swiftness
  228.                 AddDecorator(3248798863, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3248798863 - Invigorating Gemstone
  229.                 AddDecorator(3249661351, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249661351 - Enforcer
  230.                 AddDecorator(3249697288, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249697288 - Moratorium
  231.                 AddDecorator(3249733225, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249733225 - Zei's Stone of Vengeance
  232.                 AddDecorator(3249769162, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249769162 - Simplicity's Strength
  233.                 AddDecorator(3249805099, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249805099 - Boon of the Hoarder
  234.                 AddDecorator(3249841036, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249841036 - Taeguk
  235.                 AddDecorator(3249876973, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249876973 - Esoteric Alteration
  236.                 AddDecorator(3249912910, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249912910 - Molten Wildebeest's Gizzard
  237.                 AddDecorator(3249948847, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249948847 - Bane of the Stricken
  238.                 AddDecorator(3249984784, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3249984784 - Mutilation Guard
  239.                 AddDecorator(3250847272, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3250847272 - Boyarsky's Chip
  240.                 AddDecorator(3250883209, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3250883209 - Iceblink
  241.                 AddDecorator(3250919146, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3250919146 - Red Soul Shard
  242.                 AddDecorator(3250955083, Hud.Render.CreateBrush(120, 255, 255, 255, 0), RoyalBlueBrush, RoyalBlueFont); // 3250955083 - Legacy of Dreams
  243.             }
  244.  
  245.             init_mapping = true;
  246.         }
  247.  
  248.         public override void Load(IController hud)
  249.         {
  250.             base.Load(hud);
  251.  
  252.             ShowAncientRank = true;
  253.             SlainFarmers = true;
  254.             DeathsBreath = true;
  255.             VeiledCrystal = true;
  256.             ArcaneDust = true;
  257.             Gems = true;
  258.             ForgottenSoul = true;
  259.             ReusableParts = true;
  260.             GreaterRiftKeystone = true;
  261.             BovineBardiche = true;
  262.             PuzzleRing = true;
  263.             BloodShards = true;
  264.             RamaladnisGift = true;
  265.             Potion = true;
  266.             InfernalMachine = true;
  267.             Bounty = true;
  268.             HellFire = true;
  269.             LegendaryGems = true;
  270.             //HoradricCaches = true;
  271.             HoradricCaches = false; // I turned this feature off because I'm also using the "HoradricAlert" plugin by @RNN: https://www.ownedcore.com/forums/showthread.php?t=742086
  272.             Equipped = true;
  273.             //LoreChestsDisplay = true;
  274.             LoreChestsDisplay = false;          // "false;" because, I'm not disabling official "ChestPlugin", and I'm still using it.
  275.             //NormalChestsDisplay = true;
  276.             NormalChestsDisplay = false;        //  "   "   "
  277.             //ResplendentChestsDisplay = true;
  278.             ResplendentChestsDisplay = false;   //  "   "   "
  279.             GroupGems = true;
  280.             NoobGearMode = true;
  281.             HoradricTimer = 0;
  282.             NextHoradricSound = 0;
  283.             //EquippedBrush = Hud.Render.CreateBrush(200, 255, 54, 198, 2, SharpDX.Direct2D1.DashStyle.Solid, SharpDX.Direct2D1.CapStyle.Flat, SharpDX.Direct2D1.CapStyle.Flat);
  284.             EquippedBrush = Hud.Render.CreateBrush(220, 255, 54, 198, 2, SharpDX.Direct2D1.DashStyle.Dash, SharpDX.Direct2D1.CapStyle.Flat, SharpDX.Direct2D1.CapStyle.Flat);
  285.  
  286.             // Slain Farmers (actors)
  287.             SlainFarmerDecorator = new WorldDecoratorCollection(
  288.                 new MapLabelDecorator(Hud) {
  289.                     LabelFont = Hud.Render.CreateFont("tahoma", 5, 255, 146, 29, 0, true, false, true),
  290.                 },
  291.                 new GroundLabelDecorator(Hud) {
  292.                     BackgroundBrush = Hud.Render.CreateBrush(100, 0, 0, 0, 0),
  293.                     BorderBrush = Hud.Render.CreateBrush(160, 146, 29, 0, 1),
  294.                     TextFont = Hud.Render.CreateFont("tahoma", 7, 255, 146, 29, 0, true, false, false)
  295.                 }
  296.             );
  297.  
  298.             // Horadric Cache
  299.             // Reconstructed with partially stolen codes from RNN's "HoradricAlert" plugin! :))) :P
  300.             HoradricCacheDecorator = new WorldDecoratorCollection(
  301.                 new MapTextureDecorator(Hud) {
  302.                     //SnoItem = Hud.Inventory.GetSnoItem(2116952111),
  303.                     SnoItem = Hud.Sno.SnoItems.DoubleBountyBagAct4T16,
  304.                     Texture = Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.DoubleBountyBagAct4T16),
  305.                     //Radius = 0.6f,
  306.                     Radius = 0.7f,
  307.                     RadiusTransformator = new StandardPingRadiusTransformator(Hud, 500) {
  308.                         //RadiusMinimumMultiplier = 0.8f,
  309.                         RadiusMinimumMultiplier = 0.6f,
  310.                     }
  311.                 },
  312.                 new GroundLabelDecorator(Hud) {
  313.                     BackgroundBrush = Hud.Render.CreateBrush(100, 0, 0, 0, 0),
  314.                     BorderBrush = Hud.Render.CreateBrush(160, 255, 255, 255, 1),
  315.                     //TextFont = Hud.Render.CreateFont("tahoma", 7, 160, 255, 255, 255, true, false, false)
  316.                     TextFont = Hud.Render.CreateFont("tahoma", 7, 255, 0, 255, 0, true, false, false)
  317.                 },
  318.                 new MapLabelDecorator(Hud) {
  319.                     LabelFont = Hud.Render.CreateFont("tahoma", 6, 255, 0, 255, 0, true, false, true),
  320.                 }
  321.             );
  322.  
  323.             // Ancient rank
  324.             ancientRankDecorator = new WorldDecoratorCollection(
  325.                 new MapLabelDecorator(Hud) {
  326.                     LabelFont = Hud.Render.CreateFont("tahoma", 7, 255, 255, 255, 255, true, false, false),
  327.                 }
  328.             );
  329.             ancientRankSetDecorator = new WorldDecoratorCollection(
  330.                 new MapLabelDecorator(Hud) {
  331.                     LabelFont = Hud.Render.CreateFont("tahoma", 7, 255, 0, 170, 0, true, false, false),
  332.                 }
  333.             );
  334.  
  335.             // item count minimap
  336.             CountDecorator = new WorldDecoratorCollection(
  337.                 new MapLabelDecorator(Hud) {
  338.                     LabelFont = Hud.Render.CreateFont("tahoma", 7, 255, 255, 255, 255, true, false, 255, 0, 0, 100, true),
  339.                 }
  340.             );
  341.  
  342.             // Equipped item minimap
  343.             EquippedDecorator = new WorldDecoratorCollection(
  344.                 new MapLabelDecorator(Hud) {
  345.                     LabelFont = Hud.Render.CreateFont("tahoma", 7, 255, 255, 255, 255, true, false, true),
  346.                 },
  347.                 new MapShapeDecorator(Hud) {
  348.                     Brush = Hud.Render.CreateBrush(200, 255, 54, 198, 2),
  349.                     ShapePainter = new CircleShapePainter(Hud),
  350.                     Radius = 20,
  351.                 }
  352.             );
  353.  
  354.             NormalDecorator = new WorldDecoratorCollection(
  355.                 new GroundLabelDecorator(Hud) {
  356.                     BackgroundBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
  357.                     BorderBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
  358.                     TextFont = Hud.Render.CreateFont("tahoma", 10, 255, 255, 255, 255, true, false, false)
  359.                 },
  360.                 new MapLabelDecorator(Hud) {
  361.                     LabelFont = Hud.Render.CreateFont("tahoma", 10, 255, 255, 255, 255, true, false, false),
  362.                 }
  363.             );
  364.  
  365.             MagicDecorator = new WorldDecoratorCollection(
  366.                 new GroundLabelDecorator(Hud) {
  367.                     BackgroundBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
  368.                     BorderBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
  369.                     TextFont = Hud.Render.CreateFont("tahoma", 10, 255, 126, 122, 219, true, false, false)
  370.                 },
  371.                 new MapLabelDecorator(Hud) {
  372.                     LabelFont = Hud.Render.CreateFont("tahoma", 10, 255, 126, 122, 219, true, false, false),
  373.                 }
  374.             );
  375.  
  376.             RareDecorator = new WorldDecoratorCollection(
  377.                 new GroundLabelDecorator(Hud) {
  378.                     BackgroundBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
  379.                     BorderBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
  380.                     TextFont = Hud.Render.CreateFont("tahoma", 10, 255, 255, 255, 147, true, false, false)
  381.                 },
  382.                 new MapLabelDecorator(Hud) {
  383.                     LabelFont = Hud.Render.CreateFont("tahoma", 10, 255, 255, 255, 147, true, false, false),
  384.                 }
  385.             );
  386.         }
  387.  
  388.         private void AddDecorator(uint sno)
  389.         {
  390.             SnoMapping.Add(sno, new WorldDecoratorCollection(
  391.                 new MapTextureDecorator(Hud) {
  392.                     SnoItem = Hud.Inventory.GetSnoItem(sno),
  393.                     Radius = 0.47f,
  394.                 }
  395.             ));
  396.         }
  397.  
  398.         private void AddDecorator(uint sno, IBrush bgBrush, IBrush borderBrush, IFont textFont)
  399.         {
  400.             SnoMapping.Add(sno, new WorldDecoratorCollection(
  401.                 new MapTextureDecorator(Hud) {
  402.                     SnoItem = Hud.Inventory.GetSnoItem(sno),
  403.                     Radius = 0.47f,
  404.                 },
  405.                 new GroundLabelDecorator(Hud) {
  406.                     BackgroundBrush = bgBrush,
  407.                     BorderBrush = borderBrush,
  408.                     TextFont = textFont
  409.                 }
  410.             ));
  411.         }
  412.  
  413.         public void OnLootGenerated(IItem item, bool gambled)
  414.         {
  415.             if (!Hud.Sound.IsIngameSoundEnabled) return;
  416.             if (SameAsEquipped(item, true) && Equipped) {
  417.                 var soundPlayer = Hud.Sound.LoadSoundPlayer("Equipped-Drop-By-Resu.wav");
  418.                 ThreadPool.QueueUserWorkItem(state => {
  419.                     try { soundPlayer.PlaySync(); }
  420.                     catch (Exception) { }
  421.                 });
  422.             }
  423.             else if (SameAsArmory(item) && Equipped) {
  424.                 var soundPlayer = Hud.Sound.LoadSoundPlayer("Armory-Drop-By-Resu.wav");
  425.                 ThreadPool.QueueUserWorkItem(state => {
  426.                     try { soundPlayer.PlaySync(); }
  427.                     catch (Exception) { }
  428.                 });
  429.             }
  430.             if (item.AncientRank < 1 ) { }
  431.             else {
  432.                 var soundPlayer = item.AncientRank == 1 ? Hud.Sound.LoadSoundPlayer("Ancient-Drop-By-Resu.wav") : Hud.Sound.LoadSoundPlayer("Primal-Drop-By-Resu.wav");
  433.                 ThreadPool.QueueUserWorkItem(state => {
  434.                     try { soundPlayer.PlaySync(); }
  435.                     catch (Exception) { }
  436.                 });
  437.             }
  438.         }
  439.  
  440.         public void PaintWorld(WorldLayer layer)
  441.         {
  442.             if (!init_mapping) { init(); }
  443.             if (Hud.Render.UiHidden) return;
  444.  
  445.             var itemGroups = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor).GroupBy(item => item.SnoItem.Sno);
  446.  
  447.             if (GroupGems) {
  448.                 itemGroups = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode != "gems").GroupBy(item => item.SnoItem.Sno);
  449.                 var gemGroups = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode == "gems").GroupBy(item => item.SnoItem.MainGroupCode);
  450.  
  451.                 foreach (var items in gemGroups) {
  452.                     var orderedItems = items.OrderBy(i => i.NormalizedXyDistanceToMe);
  453.                     var firstItem = orderedItems.FirstOrDefault();
  454.  
  455.                     if (firstItem == null) continue;
  456.  
  457.                     if (SnoMapping.ContainsKey(firstItem.SnoItem.Sno)) {    // 2979276674
  458.                         var count = orderedItems.Where(i => i.FloorCoordinate.XYDistanceTo(firstItem.FloorCoordinate) < 21).Sum(i => i.Quantity);   // previously .XYDistanceTo(firstItem.FloorCoordinate) <= 40
  459.                         if (count > 1) {
  460.                             var Qtt = " (" + count + ")";
  461.                             SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, "Gems" + Qtt);
  462.                             CountDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, count.ToString());
  463.                         }
  464.                         else {
  465.                             SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized);
  466.                         }
  467.                     }
  468.                 }
  469.             }
  470.  
  471.             foreach (var items in itemGroups) {
  472.                 var orderedItems = items.OrderBy(i => i.NormalizedXyDistanceToMe);
  473.                 var firstItem = orderedItems.FirstOrDefault();
  474.  
  475.                 if (firstItem == null) continue;
  476.  
  477.                 if (SnoMapping.ContainsKey(items.Key)) {
  478.                     var count = orderedItems.Where(i => i.FloorCoordinate.XYDistanceTo(firstItem.FloorCoordinate) < 21).Sum(i => i.Quantity);   // previously .XYDistanceTo(firstItem.FloorCoordinate) <= 40
  479.                     if (count > 1) {
  480.                         var Qtt = " (" + count + ")";
  481.                         SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized + Qtt);
  482.                         CountDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, count.ToString());
  483.                     }
  484.                     else {
  485.                         SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized);
  486.                     }
  487.                 }
  488.  
  489.                 if (!firstItem.IsLegendary && !NoobGearMode) continue;
  490.                 else if (!firstItem.IsLegendary && NoobGearMode && firstItem.Perfection != 0) {
  491.                     if (DisplayItem((byte)firstItem.Quality)) {
  492.                         if (firstItem.IsNormal) { NormalDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, "★"); }
  493.                         else if (firstItem.IsMagic) { MagicDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, "★"); }
  494.                         else if (firstItem.IsRare) { RareDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, "★"); }
  495.                     }
  496.                 }
  497.  
  498.                 foreach (var item in items) {
  499.                     var inKanaiCube = Hud.Game.Me.IsCubed(item.SnoItem);
  500.                     var canKanaiCube = !inKanaiCube && item.SnoItem.CanKanaiCube;
  501.  
  502.                     if (canKanaiCube) {
  503.                         var cubeTexture = Hud.Texture.KanaiCubeTexture;
  504.                         float radius;
  505.                         Hud.Render.GetMinimapCoordinates(item.FloorCoordinate.X, item.FloorCoordinate.Y, out float mapX, out float mapY);
  506.                         var RadiusTransformator = new StandardPingRadiusTransformator(Hud, 500) {
  507.                             RadiusMinimumMultiplier = 0.8f,
  508.                         };
  509.                         radius = 0.9f * Hud.Render.MinimapScale;
  510.                         if (RadiusTransformator != null) {
  511.                             radius = RadiusTransformator.TransformRadius(radius);
  512.                         }
  513.                         var width = cubeTexture.Width * radius;
  514.                         var height = cubeTexture.Height * radius;
  515.                         cubeTexture.Draw(mapX - width / 2, mapY - height / 2, width, height);
  516.                     }
  517.  
  518.                     if (SameAsEquipped(item, false) && Equipped) {
  519.                         EquippedDecorator.Paint(layer, item, item.FloorCoordinate, "E");
  520.                     }
  521.                     else if (SameAsArmory(item) && Equipped) {
  522.                         EquippedDecorator.Paint(layer, item, item.FloorCoordinate, "⚔");
  523.                     }
  524.  
  525.                     if (item.AncientRank < 1 || !ShowAncientRank) continue;
  526.                     var ancientRankText = item.AncientRank == 1 ? "Ancient   ->                     <-   Ancient" : "Primal   ->                     <-   Primal";
  527.  
  528.                     if (item.SetSno != uint.MaxValue) {
  529.                         ancientRankSetDecorator.Paint(layer, item, item.FloorCoordinate, ancientRankText);  // set color
  530.                     }
  531.                     else {
  532.                         ancientRankDecorator.Paint(layer, item, item.FloorCoordinate, ancientRankText);     // legendary color
  533.                     }
  534.                 }
  535.             }
  536.  
  537.             // Slain Farmer
  538.             if (SlainFarmers) {
  539.                 var SlainFarmer = Hud.Game.Actors.Where(x => !x.IsDisabled && !x.IsOperated && x.SnoActor.Sno >= ActorSnoEnum._loottype2_tristramvillager_male_a_corpse_01_farmer/*434676*/ && x.SnoActor.Sno <= ActorSnoEnum._tristramvillager_female_c_corpse_01_farmer /*434679*/);
  540.                 foreach (var actor in SlainFarmer) {
  541.                     SlainFarmerDecorator.Paint(layer, actor, actor.FloorCoordinate, actor.SnoActor.NameLocalized);
  542.                 }
  543.             }
  544.  
  545.             // Horadric Cache
  546.             if (HoradricCaches) {
  547.                 var HoradricCache = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode == "horadriccache");
  548.                 foreach (var cache in HoradricCache) {
  549.                     HoradricCacheDecorator.Paint(layer, cache, cache.FloorCoordinate, cache.SnoItem.NameLocalized);
  550.                     string HoradricCacheText = "Cache   ->                       <-   Cache";
  551.                     ancientRankDecorator.Paint(layer, cache, cache.FloorCoordinate, HoradricCacheText);
  552.  
  553.                     HoradricTimer = NextHoradricSound - Hud.Game.CurrentRealTimeMilliseconds;
  554.                     if (HoradricTimer < 0) HoradricTimer = 0;
  555.                     if (cache.NormalizedXyDistanceToMe <= 50 && HoradricTimer == 0) {
  556.                         if (!Hud.Sound.IsIngameSoundEnabled) continue;
  557.                         var soundPlayer = Hud.Sound.LoadSoundPlayer("Horadric-Cache-By-Resu.wav");
  558.  
  559.                         ThreadPool.QueueUserWorkItem(state => {
  560.                             try { soundPlayer.PlaySync(); }
  561.                             catch (Exception) { }
  562.                         });
  563.                         NextHoradricSound = Hud.Game.CurrentRealTimeMilliseconds + 20000;
  564.                     }
  565.                 }
  566.             }
  567.  
  568.             if (LoreChestsDisplay) {
  569.                 var loreChests = Hud.Game.Actors.Where(x => !x.IsDisabled && !x.IsOperated && x.GizmoType == GizmoType.LoreChest);
  570.                 foreach (var actor in loreChests) {
  571.                     var LoreTexture = Hud.Texture.GetTexture(3651511087);
  572.                     if (!Hud.Game.Me.IsInTown) LoreTexture.Draw(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, 31.5f, 49.5f, 1f);
  573.                 }
  574.             }
  575.  
  576.             var Glow = Hud.Texture.GetTexture(1981524232);
  577.  
  578.             if (NormalChestsDisplay) {
  579.                 var normalChests = Hud.Game.Actors.Where(x => !x.IsDisabled && !x.IsOperated && x.SnoActor.Kind == ActorKind.ChestNormal);
  580.                 foreach (var actor in normalChests) {
  581.                     var NormalTexture = Hud.Texture.GetTexture(4061587565);
  582.                     Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out float textureX, out float textureY);
  583.                     Glow.Draw(textureX - 11, textureY - 13, 28f, 33f, 1f);
  584.                     NormalTexture.Draw(textureX - 11, textureY - 13, 22.77f, 27.06f, 1f);
  585.                 }
  586.             }
  587.  
  588.             if (ResplendentChestsDisplay) {
  589.                 var resplendentChests = Hud.Game.Actors.Where(x => !x.IsDisabled && !x.IsOperated && x.SnoActor.Kind == ActorKind.Chest);
  590.                 foreach (var actor in resplendentChests) {
  591.                     var RespendentTexture = Hud.Texture.GetTexture(4029005773);
  592.                     Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out float textureX, out float textureY);
  593.                     Glow.Draw(textureX - 11, textureY - 13, 31f, 36f, 1f);
  594.                     RespendentTexture.Draw(textureX - 11, textureY - 13, 22.77f, 27.06f, 1f);
  595.                 }
  596.             }
  597.         }
  598.  
  599.         private bool SameAsArmory(IItem item)
  600.         {
  601.             for (int i = 0; i < Hud.Game.Me.ArmorySets.Length; ++i) {
  602.                 var armorySet = Hud.Game.Me.ArmorySets[i];
  603.                 if (armorySet != null) {
  604.                     if (armorySet.ContainsItem(item)) {
  605.                         return true;
  606.                     }
  607.                 }
  608.             }
  609.             return false;
  610.         }
  611.  
  612.         private bool SameAsEquipped(IItem item, bool includeArmory)
  613.         {
  614.             uint ThatItemSno = item.SnoItem.Sno;
  615.             int ThatItemRank = item.AncientRank;
  616.  
  617.             if (ThatItemRank == 1) ThatItemRank = 2;
  618.             bool Worn = Hud.Game.Items.Any(x => (int)x.Location > 0 && (int)x.Location < 14 && x.SnoItem.Sno == ThatItemSno && x.AncientRank <= ThatItemRank);
  619.             bool Cubed1 = Hud.Game.Me.CubeSnoItem1?.Sno == ThatItemSno && ThatItemRank > 0;
  620.             bool Cubed2 = Hud.Game.Me.CubeSnoItem2?.Sno == ThatItemSno && ThatItemRank > 0;
  621.             bool Cubed3 = Hud.Game.Me.CubeSnoItem3?.Sno == ThatItemSno && ThatItemRank > 0;
  622.  
  623.             if (Worn) return true;
  624.             else if (Cubed1) return true;
  625.             else if (Cubed2) return true;
  626.             else if (Cubed3) return true;
  627.  
  628.             /* Consider armory items as equipped */
  629.             if (!includeArmory) return false;
  630.             return SameAsArmory(item);
  631.         }
  632.  
  633.         private bool DisplayItem(byte ItemQuality)
  634.         {
  635.             var EquippedItems = Hud.Game.Items.Where(x => (int)x.Location > 0 && (int)x.Location < 14);
  636.             byte LowerQualityEquipped = 9;
  637.  
  638.             foreach (var EquippedItem in EquippedItems) {
  639.                 if ((byte)EquippedItem.Quality < LowerQualityEquipped) LowerQualityEquipped = (byte)EquippedItem.Quality;
  640.             }
  641.  
  642.             if (ItemQuality >= LowerQualityEquipped) return true;
  643.             else return false;
  644.         }
  645.  
  646.         private int stashTabAbs;
  647.  
  648.         public void PaintTopInGame(ClipState clipState)
  649.         {
  650.             if (clipState == ClipState.Inventory && Equipped) {
  651.                 stashTabAbs = Hud.Inventory.SelectedStashTabIndex + Hud.Inventory.SelectedStashPageIndex * Hud.Inventory.MaxStashTabCountPerPage;
  652.  
  653.                 foreach (var item in Hud.Game.Items) {
  654.                     if ((Int32)item.Location > 0 && (Int32)item.Location < 14) continue;
  655.                     if (SameAsEquipped(item, false)) {
  656.                         if (item.Location == ItemLocation.Stash) {
  657.                             if ((item.InventoryY / 10) != stashTabAbs) continue;
  658.                         }
  659.                         if ((item.InventoryX < 0) || (item.InventoryY < 0)) continue;
  660.                         var rect = Hud.Inventory.GetItemRect(item);
  661.                         if (rect == System.Drawing.RectangleF.Empty) continue;
  662.                         EquippedBrush.DrawLine(rect.Right, rect.Bottom, rect.Right, rect.Top);
  663.                         EquippedBrush.DrawLine(rect.Left, rect.Bottom, rect.Left, rect.Top);
  664.                         EquippedBrush.DrawLine(rect.Right, rect.Top, rect.Left, rect.Top);
  665.                         EquippedBrush.DrawLine(rect.Right, rect.Bottom, rect.Left, rect.Bottom);
  666.                     }
  667.                 }
  668.             }
  669.         }
  670.     }
  671. }
  672.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement