public override void Load(IController hud)
        {
            base.Load(hud);

            ShowIllusionistCloneDecorator = false;

            Affixes = new Dictionary <MonsterAffix, DangerousAffixMonsterDefinition>();

            DefaultMapShapePainter     = new CircleShapePainter(Hud);
            DefaultRadiusTransformator = new StandardPingRadiusTransformator(Hud, 500);
            DefaultBackgroundBrush     = Hud.Render.CreateBrush(255, 0, 0, 0, 0);
            DefaultForegroundBrush     = Hud.Render.CreateBrush(255, 255, 0, 0, 0);
            DefaultEliteAffixesFont    = Hud.Render.CreateFont("tahoma", 10f, 200, 255, 255, 0, false, false, 128, 0, 0, 0, true);
            DefaultMinionAffixesFont   = Hud.Render.CreateFont("tahoma", 7f, 200, 255, 255, 0, false, false, 128, 0, 0, 0, true);

            ////foreach (MonsterAffix affix in Enum.GetValues(typeof(MonsterAffix))) { DefineDangerousAffix(affix, (a) => a.NameLocalized.Substring(0, 2)); }
        }
Ejemplo n.º 2
0
        public void PaintWorld(WorldLayer layer)
        {
            if (!init_mapping)
            {
                init();
            }
            if (Hud.Render.UiHidden)
            {
                return;
            }

            var itemGroups = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor).GroupBy(item => item.SnoItem.Sno);

            if (GroupGems)
            {
                itemGroups = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode != "gems").GroupBy(item => item.SnoItem.Sno);
                var gemGroups = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode == "gems").GroupBy(item => item.SnoItem.MainGroupCode);

                foreach (var items in gemGroups)
                {
                    var orderedItems = items.OrderBy(i => i.NormalizedXyDistanceToMe);
                    var firstItem    = orderedItems.FirstOrDefault();

                    if (firstItem == null)
                    {
                        continue;
                    }

                    if (SnoMapping.ContainsKey(firstItem.SnoItem.Sno)) //2979276674
                    {
                        var count = orderedItems.Where(i => i.FloorCoordinate.XYDistanceTo(firstItem.FloorCoordinate) <= 40).Sum(i => i.Quantity);
                        if (count > 1)
                        {
                            var Qtt = " (" + count + ")";
                            SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, "Gems" + Qtt);
                            CountDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, count.ToString());
                        }
                        else
                        {
                            SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized);
                        }
                    }
                }
            }

            foreach (var items in itemGroups)
            {
                var orderedItems = items.OrderBy(i => i.NormalizedXyDistanceToMe);
                var firstItem    = orderedItems.FirstOrDefault();

                if (firstItem == null)
                {
                    continue;
                }

                if (SnoMapping.ContainsKey(items.Key))
                {
                    var count = orderedItems.Where(i => i.FloorCoordinate.XYDistanceTo(firstItem.FloorCoordinate) <= 40).Sum(i => i.Quantity);
                    if (count > 1)
                    {
                        var Qtt = " (" + count + ")";
                        SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized + Qtt);
                        CountDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, count.ToString());
                    }
                    else
                    {
                        SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized);
                    }
                }

                if (!firstItem.IsLegendary && !NoobGearMode)
                {
                    continue;
                }
                else if (!firstItem.IsLegendary && NoobGearMode && firstItem.Perfection != 0)
                {
                    if (DisplayItem((byte)firstItem.Quality))
                    {
                        if (firstItem.IsNormal)
                        {
                            NormalDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, "\u2605");
                        }
                        else if (firstItem.IsMagic)
                        {
                            MagicDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, "\u2605");
                        }
                        else if (firstItem.IsRare)
                        {
                            RareDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, "\u2605");
                        }
                    }
                }

                foreach (var item in items)
                {
                    var inKanaiCube  = Hud.Game.Me.IsCubed(item.SnoItem);
                    var canKanaiCube = !inKanaiCube && item.SnoItem.CanKanaiCube;

                    if (canKanaiCube)
                    {
                        var   cubeTexture = Hud.Texture.KanaiCubeTexture;
                        float radius;
                        Hud.Render.GetMinimapCoordinates(item.FloorCoordinate.X, item.FloorCoordinate.Y, out float mapX, out float mapY);
                        var RadiusTransformator = new StandardPingRadiusTransformator(Hud, 500)
                        {
                            RadiusMinimumMultiplier = 0.8f,
                        };
                        radius = 0.9f * Hud.Render.MinimapScale;
                        if (RadiusTransformator != null)
                        {
                            radius = RadiusTransformator.TransformRadius(radius);
                        }
                        var width  = cubeTexture.Width * radius;
                        var height = cubeTexture.Height * radius;
                        cubeTexture.Draw(mapX - width / 2, mapY - height / 2, width, height);
                    }

                    if (SameAsEquipped(item, false) && Equipped)
                    {
                        EquippedDecorator.Paint(layer, item, item.FloorCoordinate, "E");
                    }
                    else if (SameAsArmory(item) && Equipped)
                    {
                        EquippedDecorator.Paint(layer, item, item.FloorCoordinate, "\u2694");
                    }

                    if (item.AncientRank < 1 || !ShowAncientRank)
                    {
                        continue;
                    }
                    var ancientRankText = item.AncientRank == 1 ? "Ancient   ->                     <-   Ancient" : "Primal   ->                     <-   Primal";

                    if (item.SetSno != uint.MaxValue)
                    {
                        ancientRankSetDecorator.Paint(layer, item, item.FloorCoordinate, ancientRankText); // set color
                    }
                    else
                    {
                        ancientRankDecorator.Paint(layer, item, item.FloorCoordinate, ancientRankText); // legendary color
                    }
                }
            }

            /// Slain farmer
            if (SlainFarmers)
            {
                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*/);
                foreach (var actor in SlainFarmer)
                {
                    SlainFarmerDecorator.Paint(layer, actor, actor.FloorCoordinate, actor.SnoActor.NameLocalized);
                }
            }

            /// Horadric Cache
            if (HoradricCaches)
            {
                var HoradricCache = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode == "horadriccache");
                foreach (var cache in HoradricCache)
                {
                    HoradricCacheDecorator.Paint(layer, cache, cache.FloorCoordinate, cache.SnoItem.NameLocalized);
                    string HoradricCacheText = "Cache   ->                       <-   Cache";
                    ancientRankDecorator.Paint(layer, cache, cache.FloorCoordinate, HoradricCacheText);

                    HoradricTimer = NextHoradricSound - Hud.Game.CurrentRealTimeMilliseconds;
                    if (HoradricTimer < 0)
                    {
                        HoradricTimer = 0;
                    }
                    if (cache.NormalizedXyDistanceToMe <= 50 && HoradricTimer == 0)
                    {
                        if (!Hud.Sound.IsIngameSoundEnabled)
                        {
                            continue;
                        }
                        var soundPlayer = Hud.Sound.LoadSoundPlayer("Horadric-Cache-By-Resu.wav");

                        ThreadPool.QueueUserWorkItem(state =>
                        {
                            try
                            {
                                soundPlayer.PlaySync();
                            }
                            catch (Exception)
                            {
                            }
                        });
                        NextHoradricSound = Hud.Game.CurrentRealTimeMilliseconds + 20000;
                    }
                }
            }

            if (LoreChestsDisplay)
            {
                var loreChests = Hud.Game.Actors.Where(x => !x.IsDisabled && !x.IsOperated && x.GizmoType == GizmoType.LoreChest);
                foreach (var actor in loreChests)
                {
                    var LoreTexture = Hud.Texture.GetTexture(3651511087);
                    if (!Hud.Game.Me.IsInTown)
                    {
                        LoreTexture.Draw(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, 31.5f, 49.5f, 1f);
                    }
                }
            }

            var Glow = Hud.Texture.GetTexture(1981524232);

            if (NormalChestsDisplay)
            {
                var normalChests = Hud.Game.Actors.Where(x => !x.IsDisabled && !x.IsOperated && x.SnoActor.Kind == ActorKind.ChestNormal);
                foreach (var actor in normalChests)
                {
                    var NormalTexture = Hud.Texture.GetTexture(4061587565);
                    Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out float textureX, out float textureY);
                    Glow.Draw(textureX - 11, textureY - 13, 28f, 33f, 1f);
                    NormalTexture.Draw(textureX - 11, textureY - 13, 22.77f, 27.06f, 1f);
                }
            }

            if (ResplendentChestsDisplay)
            {
                var resplendentChests = Hud.Game.Actors.Where(x => !x.IsDisabled && !x.IsOperated && x.SnoActor.Kind == ActorKind.Chest);
                foreach (var actor in resplendentChests)
                {
                    var RespendentTexture = Hud.Texture.GetTexture(4029005773);
                    Hud.Render.GetMinimapCoordinates(actor.FloorCoordinate.X, actor.FloorCoordinate.Y, out float textureX, out float textureY);
                    Glow.Draw(textureX - 11, textureY - 13, 31f, 36f, 1f);
                    RespendentTexture.Draw(textureX - 11, textureY - 13, 22.77f, 27.06f, 1f);
                }
            }
        }
Ejemplo n.º 3
0
        public override void Configure(IController hud)
        {
            var Hud = hud;

            // I'M BRAVE ENOUGH
            Hud.TogglePlugin <MonsterPackPlugin>(true);
            Hud.TogglePlugin <EliteMonsterAffixPlugin>(false);

            /////////////
            // GOBLINS //
            /////////////
            Hud.RunOnPlugin <GoblinPlugin>(plugin =>
            {
                var radiusTransformator = new StandardPingRadiusTransformator(Hud, 333);

                plugin.AllGoblinDecorators().ForEach(goblin =>
                {
                    goblin.GetDecorators <MapShapeDecorator>().ForEach(decorator =>
                    {
                        var painter = decorator.ShapePainter as CircleShapePainter;
                        if (painter != null)
                        {
                            decorator.RadiusTransformator = radiusTransformator;
                        }
                    });
                    goblin.GetDecorators <GroundCircleDecorator>().ForEach(decorator =>
                    {
                        decorator.RadiusTransformator = radiusTransformator;
                    });
                });

                plugin.MalevolentTormentorDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 0, true, false, true)
                });
                plugin.BloodThiefDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 155, 0, 255, true, false, true)
                });
                plugin.OdiousCollectorDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 0, 255, 0, true, false, true)
                });
                plugin.GemHoarderDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true)
                });
                plugin.GelatinousDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 0, 0, 255, true, false, true)
                });
                plugin.GildedBaronDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 240, 0, true, false, true)
                });
                plugin.InsufferableMiscreantDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 50, 50, true, false, true)
                });
                plugin.DefaultGoblinDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 200, 150, 150, 150, true, false, true)
                });
                plugin.RainbowGoblinDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 0, true, false, true)
                });
                plugin.MenageristGoblinDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 0, true, false, true)
                });
                plugin.TreasureFiendGoblinDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 163, 15, true, false, true)
                });
            });

            ////////////////////////
            // EXPLOSIVE MONSTERS //
            ////////////////////////
            //var explosiveMonsterPlugin = Hud.GetPlugin<ExplosiveMonsterPlugin>();
            //if (explosiveMonsterPlugin != null)
            //{
            //    explosiveMonsterPlugin.InRiftDecorator.Add(new GroundTimerDecorator(Hud)
            //    {
            //        CountDownFrom = 3,
            //        BackgroundBrushEmpty = Hud.Render.CreateBrush(64, 0, 0, 0, 0),
            //        BackgroundBrushFill = Hud.Render.CreateBrush(160, 255, 255, 255, 0),
            //        Radius = 20
            //    });
            //}
        }
        public void Customize()
        {
            // I'M BRAVE ENOUGH
            Hud.TogglePlugin <MonsterPackPlugin>(true);
            Hud.TogglePlugin <EliteMonsterAffixPlugin>(false);
            /////////////////////////////////////////////////

            Hud.TogglePlugin <DebugPlugin>(true);

            Hud.RunOnPlugin <InventoryAndStashPlugin>(plugin =>
            {
                plugin.NotGoodDisplayEnabled       = true;
                plugin.DefinitelyBadDisplayEnabled = true;
                //plugin.LooksGoodDisplayEnabled = true;
            });

            //Hud.RunOnPlugin<FeetBuffListPlugin>(plugin =>
            //{
            //    plugin.BuffPainter.ShowTimeLeftNumbers = true;
            //    plugin.BuffPainter.Opacity = 0.85f;

            //    // Iron Skin
            //    plugin.RuleCalculator.Rules.Add(new BuffRule(291804) { IconIndex = null, MinimumIconCount = 1, ShowTimeLeft = true, IconSizeMultiplier = 1.0f, });
            //});

            Hud.RunOnPlugin <AttributeLabelListPlugin>(plugin =>
            {
                plugin.LabelList.WidthFunc = () => Hud.Window.Size.Height * 0.0630f;

                plugin.LabelList.LabelDecorators[9].TextFunc = () => Hud.Game.Me.Stats.PickupRange.ToString("#");
                plugin.LabelList.LabelDecorators[9].HintFunc = () => "pickup radius";

                /*var index = 9; //0..9
                 * if (index < plugin.LabelList.LabelDecorators.Count && index >= 0)
                 * {
                 *  plugin.LabelList.LabelDecorators[index].AlertTextFunc = () => Hud.Game.Me.Stats.PickupRange.ToString("#");
                 *  plugin.LabelList.LabelDecorators[index].HintFunc = () => "pickup radius";
                 * }/**/
            });

            Hud.RunOnPlugin <GlobePlugin>(plugin =>
            {
                plugin.RiftOrbDecorator.Add(new GroundCircleDecorator(Hud)
                {
                    Brush  = Hud.Render.CreateBrush(255, 240, 120, 240, 3),
                    Radius = 1.5f
                });
            });

            Hud.RunOnPlugin <PlayerSkillPlugin>(plugin =>
            {
                plugin.SentryDecorator.Decorators.Add(new GroundCircleDecorator(Hud)
                {
                    Brush  = Hud.Render.CreateBrush(178, 240, 148, 32, 2),
                    Radius = 16,
                });

                //plugin.SentryDecorator.GetDecorators<MapShapeDecorator>().ForEach(d => d.ShapePainter = new CircleShapePainter(Hud));

                plugin.SentryWithCustomEngineeringDecorator.Decorators.Add(new GroundCircleDecorator(Hud)
                {
                    Brush  = Hud.Render.CreateBrush(178, 240, 148, 32, 2),
                    Radius = 16,
                });

                //plugin.SentryWithCustomEngineeringDecorator.GetDecorators<MapShapeDecorator>().ForEach(d => d.ShapePainter = new CircleShapePainter(Hud));
            });

            //Hud.RunOnPlugin<OtherPlayersPlugin>(plugin =>
            //{
            //    plugin.DecoratorByClass[HeroClass.Barbarian].GetDecorators<MapLabelDecorator>().ForEach(d =>
            //    {
            //        d.LabelFont = Hud.Render.CreateFont("tahoma", 6f, 255, 255, 255, 0, false, false, 128, 0, 0, 0, true);
            //        d.Up = true;
            //    });
            //    plugin.DecoratorByClass[HeroClass.Barbarian].GetDecorators<GroundLabelDecorator>().ForEach(d =>
            //    {
            //        d.BorderBrush = Hud.Render.CreateBrush(255, 255, 255, 0, 1);
            //        d.TextFont = Hud.Render.CreateFont("tahoma", 6f, 255, 255, 255, 0, false, false, 128, 0, 0, 0, true);
            //    });
            //});

            Hud.RunOnPlugin <GoblinPlugin>(plugin =>
            {
                var radiusTransformator = new StandardPingRadiusTransformator(Hud, 333);

                plugin.AllGoblinDecorators().ForEach(goblin =>
                {
                    goblin.GetDecorators <MapShapeDecorator>().ForEach(decorator =>
                    {
                        var painter = decorator.ShapePainter as CircleShapePainter;
                        if (painter != null)
                        {
                            decorator.RadiusTransformator = radiusTransformator;
                        }
                    });
                    goblin.GetDecorators <GroundCircleDecorator>().ForEach(decorator =>
                    {
                        decorator.RadiusTransformator = radiusTransformator;
                    });
                });
                //});

                //Hud.RunOnPlugin<GoblinPlugin>(plugin =>
                //{
                plugin.MalevolentTormentorDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 0, true, false, true)
                });
                plugin.BloodThiefDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 155, 0, 255, true, false, true)
                });
                plugin.OdiousCollectorDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 0, 255, 0, true, false, true)
                });
                plugin.GemHoarderDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true)
                });
                plugin.GelatinousDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 0, 0, 255, true, false, true)
                });
                plugin.GildedBaronDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 240, 0, true, false, true)
                });
                plugin.InsufferableMiscreantDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 50, 50, true, false, true)
                });
                plugin.DefaultGoblinDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 200, 150, 150, 150, true, false, true)
                });
                plugin.RainbowGoblinDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 0, true, false, true)
                });
                plugin.MenageristGoblinDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 0, true, false, true)
                });
                plugin.TreasureFiendGoblinDecorator.Decorators.Add(new MapLabelDecorator(Hud)
                {
                    LabelFont = Hud.Render.CreateFont("tahoma", 7, 180, 255, 163, 15, true, false, true)
                });
            });

            Enabled = false;
        }
Ejemplo n.º 5
0
        public void PaintWorld(WorldLayer layer)
        {
            if (!init_mapping)
            {
                init();
            }
            if (Hud.Render.UiHidden)
            {
                return;
            }


            var itemGroups = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor).GroupBy(item => item.SnoItem.Sno);

            foreach (var items in itemGroups)
            {
                var orderedItems = items.OrderBy(i => i.NormalizedXyDistanceToMe);
                var firstItem    = orderedItems.FirstOrDefault();

                if (firstItem == null)
                {
                    continue;
                }


                if (SnoMapping.ContainsKey(items.Key))
                {
                    var count = orderedItems.Where(i => i.FloorCoordinate.XYDistanceTo(firstItem.FloorCoordinate) <= 40).Sum(i => i.Quantity);
                    if (count > 1)
                    {
                        var Qtt = " (" + count + ")";
                        SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized + Qtt);
                    }
                    else
                    {
                        SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized);
                    }
                }

                if (!firstItem.IsLegendary)
                {
                    continue;
                }
                foreach (var item in items)
                {
                    var inKanaiCube  = Hud.Game.Me.IsCubed(item.SnoItem);
                    var canKanaiCube = !inKanaiCube && item.SnoItem.CanKanaiCube;

                    if (canKanaiCube)
                    {
                        var   cubeTexture = Hud.Texture.KanaiCubeTexture;
                        float mapX, mapY, radius;
                        Hud.Render.GetMinimapCoordinates(item.FloorCoordinate.X, item.FloorCoordinate.Y, out mapX, out mapY);
                        var RadiusTransformator = new StandardPingRadiusTransformator(Hud, 500)
                        {
                            RadiusMinimumMultiplier = 0.8f,
                        };
                        radius = 0.9f * Hud.Render.MinimapScale;
                        if (RadiusTransformator != null)
                        {
                            radius = RadiusTransformator.TransformRadius(radius);
                        }
                        var width  = cubeTexture.Width * radius;
                        var height = cubeTexture.Height * radius;
                        cubeTexture.Draw(mapX - width / 2, mapY - height / 2, width, height);
                    }

                    if (item.AncientRank < 1 || !ShowAncientRank)
                    {
                        continue;
                    }
                    var ancientRankText = item.AncientRank == 1 ? "Ancient   ->                     <-   Ancient" : "Primal   ->                     <-   Primal";

                    if (item.SetSno != uint.MaxValue)
                    {
                        ancientRankSetDecorator.Paint(layer, item, item.FloorCoordinate, ancientRankText); // set color
                    }
                    else
                    {
                        ancientRankDecorator.Paint(layer, item, item.FloorCoordinate, ancientRankText); // legendary color
                    }
                }
            }

            /// Slain farmer
            if (SlainFarmers)
            {
                var SlainFarmer = Hud.Game.Actors.Where(x => x.DisplayOnOverlay && x.SnoActor.Sno >= 434676 && x.SnoActor.Sno <= 434679);
                foreach (var actor in SlainFarmer)
                {
                    SlainFarmerDecorator.Paint(layer, actor, actor.FloorCoordinate, actor.SnoActor.NameLocalized);
                }
            }

            /// Horadric Cache
            if (HoradricCaches)
            {
                var HoradricCache = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode == "horadriccache");
                foreach (var cache in HoradricCache)
                {
                    HoradricCacheDecorator.Paint(layer, cache, cache.FloorCoordinate, cache.SnoItem.NameLocalized);
                }
            }
        }
Ejemplo n.º 6
0
        public void PaintWorld(WorldLayer layer)
        {
            if (!init_mapping)
            {
                init();
            }
            if (Hud.Render.UiHidden)
            {
                return;
            }


            var itemGroups = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor).GroupBy(item => item.SnoItem.Sno);

            foreach (var items in itemGroups)
            {
                var orderedItems = items.OrderBy(i => i.NormalizedXyDistanceToMe);
                var firstItem    = orderedItems.FirstOrDefault();

                if (firstItem == null)
                {
                    continue;
                }

                if (SnoMapping.ContainsKey(items.Key))
                {
                    var count = orderedItems.Where(i => i.FloorCoordinate.XYDistanceTo(firstItem.FloorCoordinate) <= 40).Sum(i => i.Quantity);
                    if (count > 1)
                    {
                        var Qtt = " (" + count + ")";
                        SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized + Qtt);
                        CountDecorator.Paint(layer, firstItem, firstItem.FloorCoordinate, count.ToString());
                    }
                    else
                    {
                        SnoMapping[firstItem.SnoItem.Sno].Paint(layer, firstItem, firstItem.FloorCoordinate, firstItem.SnoItem.NameLocalized);
                    }
                }

                if (!firstItem.IsLegendary)
                {
                    continue;
                }
                foreach (var item in items)
                {
                    var inKanaiCube  = Hud.Game.Me.IsCubed(item.SnoItem);
                    var canKanaiCube = !inKanaiCube && item.SnoItem.CanKanaiCube;

                    if (canKanaiCube)
                    {
                        var   cubeTexture = Hud.Texture.KanaiCubeTexture;
                        float mapX, mapY, radius;
                        Hud.Render.GetMinimapCoordinates(item.FloorCoordinate.X, item.FloorCoordinate.Y, out mapX, out mapY);
                        var RadiusTransformator = new StandardPingRadiusTransformator(Hud, 500)
                        {
                            RadiusMinimumMultiplier = 0.8f,
                        };
                        radius = 0.9f * Hud.Render.MinimapScale;
                        if (RadiusTransformator != null)
                        {
                            radius = RadiusTransformator.TransformRadius(radius);
                        }
                        var width  = cubeTexture.Width * radius;
                        var height = cubeTexture.Height * radius;
                        cubeTexture.Draw(mapX - width / 2, mapY - height / 2, width, height);
                    }

                    if (SameAsEquipped(item.SnoItem.Sno) && Equipped)
                    {
                        EquippedDecorator.Paint(layer, item, item.FloorCoordinate, "E");
                    }

                    if (item.AncientRank < 1 || !ShowAncientRank)
                    {
                        continue;
                    }
                    var ancientRankText = item.AncientRank == 1 ? "Ancient   ->                     <-   Ancient" : "Primal   ->                     <-   Primal";

                    if (item.SetSno != uint.MaxValue)
                    {
                        ancientRankSetDecorator.Paint(layer, item, item.FloorCoordinate, ancientRankText); // set color
                    }
                    else
                    {
                        ancientRankDecorator.Paint(layer, item, item.FloorCoordinate, ancientRankText); // legendary color
                    }
                }
            }

            /// Slain farmer
            if (SlainFarmers)
            {
                var SlainFarmer = Hud.Game.Actors.Where(x => !x.IsDisabled && !x.IsOperated && x.SnoActor.Sno >= 434676 && x.SnoActor.Sno <= 434679);
                foreach (var actor in SlainFarmer)
                {
                    SlainFarmerDecorator.Paint(layer, actor, actor.FloorCoordinate, actor.SnoActor.NameLocalized);
                }
            }

            /// Horadric Cache
            if (HoradricCaches)
            {
                var HoradricCache = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode == "horadriccache");
                foreach (var cache in HoradricCache)
                {
                    HoradricCacheDecorator.Paint(layer, cache, cache.FloorCoordinate, cache.SnoItem.NameLocalized);
                    string HoradricCacheText = "Cache   ->                       <-   Cache";
                    ancientRankDecorator.Paint(layer, cache, cache.FloorCoordinate, HoradricCacheText);

                    HoradricTimer = NextHoradricSound - Hud.Game.CurrentRealTimeMilliseconds;
                    if (HoradricTimer < 0)
                    {
                        HoradricTimer = 0;
                    }
                    if (cache.NormalizedXyDistanceToMe <= 50 && HoradricTimer == 0)
                    {
                        if (!Hud.Sound.IsIngameSoundEnabled)
                        {
                            continue;
                        }
                        var soundPlayer = Hud.Sound.LoadSoundPlayer("Horadric-Cache-By-Resu.wav");

                        ThreadPool.QueueUserWorkItem(state =>
                        {
                            try
                            {
                                soundPlayer.PlaySync();
                            }
                            catch (Exception)
                            {
                            }
                        });
                        NextHoradricSound = Hud.Game.CurrentRealTimeMilliseconds + 20000;
                    }
                }
            }
        }
Ejemplo n.º 7
0
        public override void Load(IController hud)
        {
            base.Load(hud);

            var pingTransformator = new StandardPingRadiusTransformator(Hud, 333);
            var shapePainter      = new CircleShapePainter(Hud);

            DecoratorByClass.Add(HeroClass.Barbarian, new WorldDecoratorCollection(
                                     new MapLabelDecorator(Hud)
            {
                LabelFont = Hud.Render.CreateFont("tahoma", 7f, 250, 255, 128, 64, false, false, 128, 0, 0, 0, true),
                Up        = true,
            },
                                     new GroundLabelDecorator(Hud)
            {
                BackgroundBrush = Hud.Render.CreateBrush(255, 255, 128, 64, 0),
                BorderBrush     = Hud.Render.CreateBrush(250, 0, 0, 0, 1),
                TextFont        = Hud.Render.CreateFont("tahoma", 8f, 255, 0, 0, 0, true, false, 128, 255, 255, 255, true),
            }
                                     ));

            DecoratorByClass.Add(HeroClass.Crusader, new WorldDecoratorCollection(
                                     new MapLabelDecorator(Hud)
            {
                LabelFont = Hud.Render.CreateFont("tahoma", 7f, 240, 240, 240, 240, false, false, 128, 0, 0, 0, true),
                Up        = true,
            },
                                     new GroundLabelDecorator(Hud)
            {
                BackgroundBrush = Hud.Render.CreateBrush(255, 240, 240, 240, 0),
                BorderBrush     = Hud.Render.CreateBrush(240, 0, 0, 0, 1),
                TextFont        = Hud.Render.CreateFont("tahoma", 8f, 255, 0, 0, 0, true, false, 128, 255, 255, 255, true),
            }
                                     ));

            DecoratorByClass.Add(HeroClass.DemonHunter, new WorldDecoratorCollection(
                                     new MapLabelDecorator(Hud)
            {
                LabelFont = Hud.Render.CreateFont("tahoma", 7f, 255, 0, 200, 255, false, false, 128, 0, 0, 0, true),
                Up        = true,
            },
                                     new GroundLabelDecorator(Hud)
            {
                BackgroundBrush = Hud.Render.CreateBrush(255, 0, 255, 255, 0),
                BorderBrush     = Hud.Render.CreateBrush(255, 0, 0, 0, 1),
                TextFont        = Hud.Render.CreateFont("tahoma", 8f, 255, 0, 0, 0, true, false, 128, 255, 255, 255, true),
            }
                                     ));

            DecoratorByClass.Add(HeroClass.Monk, new WorldDecoratorCollection(
                                     new MapLabelDecorator(Hud)
            {
                LabelFont = Hud.Render.CreateFont("tahoma", 7f, 245, 255, 255, 0, false, false, 128, 0, 0, 0, true),
                Up        = true,
            },
                                     new GroundLabelDecorator(Hud)
            {
                BackgroundBrush = Hud.Render.CreateBrush(255, 255, 255, 0, 0),
                BorderBrush     = Hud.Render.CreateBrush(240, 0, 0, 0, 1),
                TextFont        = Hud.Render.CreateFont("tahoma", 8f, 255, 0, 0, 0, true, false, 128, 255, 255, 255, true),
            }
                                     ));

            DecoratorByClass.Add(HeroClass.WitchDoctor, new WorldDecoratorCollection(
                                     new MapLabelDecorator(Hud)
            {
                LabelFont = Hud.Render.CreateFont("tahoma", 7f, 255, 0, 255, 0, false, false, 128, 0, 0, 0, true),
                Up        = true,
            },
                                     new GroundLabelDecorator(Hud)
            {
                BackgroundBrush = Hud.Render.CreateBrush(255, 0, 255, 0, 0),
                BorderBrush     = Hud.Render.CreateBrush(250, 0, 0, 0, 1),
                TextFont        = Hud.Render.CreateFont("tahoma", 8f, 255, 0, 0, 0, true, false, 128, 255, 255, 255, true),
            }
                                     ));

            DecoratorByClass.Add(HeroClass.Wizard, new WorldDecoratorCollection(
                                     new MapLabelDecorator(Hud)
            {
                LabelFont = Hud.Render.CreateFont("tahoma", 7f, 255, 255, 0, 255, false, false, 128, 0, 0, 0, true),
                Up        = true,
            },
                                     new GroundLabelDecorator(Hud)
            {
                BackgroundBrush = Hud.Render.CreateBrush(255, 255, 0, 255, 0),
                BorderBrush     = Hud.Render.CreateBrush(255, 0, 0, 0, 1),
                TextFont        = Hud.Render.CreateFont("tahoma", 8f, 255, 0, 0, 0, true, false, 128, 255, 255, 255, true),
            }
                                     ));
            DecoratorByClass.Add(HeroClass.Necromancer, new WorldDecoratorCollection(
                                     new MapLabelDecorator(Hud)
            {
                LabelFont = Hud.Render.CreateFont("tahoma", 7f, 230, 0, 190, 190, false, false, 128, 0, 0, 0, true),
                Up        = true,
            },
                                     new GroundLabelDecorator(Hud)
            {
                BackgroundBrush = Hud.Render.CreateBrush(255, 0, 190, 190, 0),
                BorderBrush     = Hud.Render.CreateBrush(255, 0, 0, 0, 1),
                TextFont        = Hud.Render.CreateFont("tahoma", 8f, 255, 0, 0, 0, true, false, 128, 255, 255, 255, true),
            }
                                     ));
        }