Example #1
0
        public static void Add(this ActorCommonData Actor, MapItemElement Ele, int I = -1, int EliteOff = -1, bool IsMonster = false)
        {
            IMapActor Monster = new IMapActor(Actor, Ele, EliteOff, I, IsMonster);

            Monsters.Add(Actor.Address, Monster);
            MonstersAdd.Add(Monster);
        }
Example #2
0
        public static MapItem MiniMapItems(MapItemElement Type, int Identifier)
        {
            if (Type == MapItemElement.AT_Custom)
            {
                return(_.FKMinimap.DefaultMapItem.CustomActors[Identifier]);
            }

            return(_.FKMinimap.DefaultMapItem.DefaultActors[(int)Type]);
        }
Example #3
0
 public IMapActor(ActorCommonData A, MapItemElement E, int EliteOff = -1, int I = -1, bool Monster = false)
 {
     Actor       = A;
     Type        = E;
     EliteOffset = EliteOff;
     Identifier  = I;
     ACDID       = Actor.x000_Id;
     Id          = Actor.Address;
     IsMonster   = Monster;
     IsItem      = A.IsItem();
 }
Example #4
0
        public void Draw(bool LargeMap = false)
        {
            this.LargeMinimap = LargeMap;

            try
            {
                if (LargeMinimap)
                {
                    LargeMapOffset = UIObjects.LargeMap.TryGetPoint <UXMinimap>(Enigma.D3.OffsetConversion.UXControlMinimapRect);
                }

                using (DrawingContext drawingContext = _visual.RenderOpen())
                {
                    if ((LargeMinimap && RevealLargemap.Enabled) || (!LargeMinimap && RevealMinimap.Enabled))
                    {
                        if (!TownHelper.InTown)
                        {
                            IEnumerable <SceneHelper.NavHelper> Scenes = SceneHelper.NavHelpers.Values
                                                                         .Where(x => !x.NavContainer.Skip || (!GameManager.Instance.GManager.GList.MainAccount.RiftHelper.InRiftNow && x.LevelAreaSnoID == GameManager.Instance.GManager.GList.MainAccount.DiabloIII.LevelArea.x044_SnoId));

                            DrawScene(LargeMinimap ? Scenes : Scenes.Where(x => !this.OutofBounds(x.NavContainer.Position, 450)), drawingContext);
                        }
                    }


                    MapItemElement Current = MapItemElement.AT_Unsigned;
                    MapItemShape   Shape   = null;
                    drawingContext.PushOpacity(1);

                    /*foreach (IMap.IMapActor Actor in Controller.GameManager.Instance.GManager.GList.MainAccount.LevelAreaContainer.Monsters.OrderBy(x => x.Type))
                     * {
                     *  if (Actor.Type == MapItemElement.AT_Portal)
                     *  {
                     *      drawingContext.DrawImage(Door, new Rect(Actor.Point.X - UIScale(25 / 2), Actor.Point.Y - UIScale(26 / 2), UIScale(25), UIScale(26)));
                     *  }
                     *  else
                     *  {
                     *      if (Actor.Type != Current)
                     *      {
                     *          Shape = Config.MiniMapItems(Actor.Type, Actor.Identifier).Shape;
                     *          Current = Actor.Type;
                     *          drawingContext.Pop();
                     *          drawingContext.PushOpacity(Shape.Opacity);
                     *      }
                     *
                     *      if (Shape.Shape == ItemShape.Ellipse)
                     *          DrawEllipse(new DrawHelper(new Size(Shape.Width, Shape.Height), new Point(Actor.Point.X, Actor.Point.Y), Shape.FillBrush, Shape.StrokeBrush), drawingContext);
                     *
                     *      else if (Shape.Shape == ItemShape.Rectangle)
                     *          DrawRectangle(new DrawHelper(new Size(Shape.Width, Shape.Height), new Point(Actor.Point.X, Actor.Point.Y), Shape.FillBrush, Shape.StrokeBrush), drawingContext);
                     *
                     *      if (Actor.EliteOffset != -1 && Drawline)
                     *          drawingContext.DrawLine(Shape.StrokeBrush, new Point(Actor.Point.X - (Shape.Width / 2), Actor.Point.Y - (Shape.Height) / 2), RotatePoint(-45, new Point(175, -105 + (40 * Actor.EliteOffset))));
                     *      // drawingContext.Pop();
                     *  }
                     * }*
                     *
                     * drawingContext.Pop();*/


                    /* foreach (var x in Controller.GameManager.Instance.GManager.GList.MainAccount.DiabloIII.TrickleManager.x04_Ptr_Items.Dereference())
                     * {
                     *
                     *   double UI = Controller.GameManager.Instance.GManager.GRef.Attacher.UIScale;
                     *   MapItemShape Shapes = Config.MiniMapItems(MapItemElement.AT_Objective, -1).Shape;
                     *   Size Controll = new Size(Shapes.Width * UI, Shapes.Height * UI);
                     *
                     *   Point Point = new System.Windows.Point(
                     *        x.x08_WorldPosX - Controller.GameManager.Instance.GManager.GList.MainAccount.Player.x0D0_WorldPosX,
                     *          x.x0C_WorldPosY - Controller.GameManager.Instance.GManager.GList.MainAccount.Player.x0D4_WorldPosY);
                     *
                     *   drawingContext.DrawEllipse(Shapes.FillBrush, Shapes.StrokeBrush,
                     *         Point, Controll.Width, Controll.Height);
                     *
                     * }*/

                    if (Controller.GameManager.Instance.GManager.GList.MainAccount.DiabloIII.LevelArea == null)
                    {
                        return;
                    }

                    foreach (var marker in Controller.GameManager.Instance.GManager.GList.MainAccount.DiabloIII.LevelArea.x008_PtrQuestMarkersMap.Dereference().ToDictionary().Where(x => x.Value.x00_WorldPosition.x0C_WorldId == Controller.GameManager.Instance.GManager.GList.MainAccount.DiabloIII.ObjectManager.x790.Dereference().x038_WorldId_))
                    {
                        double       UI       = Controller.GameManager.Instance.GManager.GRef.Attacher.UIScale;
                        MapItemShape Shapes   = Config.MiniMapItems(MapItemElement.AT_Objective, -1).Shape;
                        Size         Controll = new Size(Shapes.Width * UI, Shapes.Height * UI);

                        Point Point = new System.Windows.Point(
                            marker.Value.x00_WorldPosition.x00_X - Controller.GameManager.Instance.GManager.GList.MainAccount.Player.x0D0_WorldPosX,
                            marker.Value.x00_WorldPosition.x04_Y - Controller.GameManager.Instance.GManager.GList.MainAccount.Player.x0D4_WorldPosY);

                        int   Scale  = (int)((LargeMap) ? (1200 * UI) / 2 : (350 * UI) / 2);
                        Point offset = new Point((this.VisualOffset.X) * UI, (this.VisualOffset.Y) * UI);

                        if (LargeMap)
                        {
                            Point = new Point(
                                (LargeMapOffset.X < 0) ? Point.X + -LargeMapOffset.X : Point.X - LargeMapOffset.X,
                                (LargeMapOffset.Y < 0) ? Point.Y + -LargeMapOffset.Y : Point.Y - LargeMapOffset.Y
                                );
                        }

                        if (Point.X > offset.X)
                        {
                            Point.X = offset.X;
                        }
                        if (Point.X < -offset.X)
                        {
                            Point.X = -offset.X;
                        }
                        if (Point.Y > offset.Y)
                        {
                            Point.Y = offset.Y;
                        }
                        if (Point.Y < -offset.Y)
                        {
                            Point.Y = -offset.Y;
                        }

                        Point.X = Point.X - (Controll.Width / 2) + 5;
                        Point.Y = Point.Y - (Controll.Height / 2) + 5;

                        //  drawingContext.DrawEllipse(Shapes.FillBrush, Shapes.StrokeBrush,
                        //    Point, Controll.Width, Controll.Height);
                    }
                }
            }

            catch (Exception e) {
                DebugWriter.Write(e);
            }
        }
Example #5
0
        public static void DetermineActor(this ActorCommonData Actor)
        {
            if (Monsters.ContainsKey(Actor.Address))
            {
                if (Actor.IsElite(true))
                {
                    Actor.EliteAffixes();
                }
                return;
            }

            if (Config._.FKMinimap.OverrideLayout.ContainsKey(Actor.x090_ActorSnoId) && Actor.x08C_ActorId != -1)
            {
                Actor.Add(MapItemElement.AT_Custom, Config._.FKMinimap.OverrideLayout[Actor.x090_ActorSnoId]);
            }

            else
            {
                if (Actor.IsMonster()) // Monster, Goblins, Bosses etc
                {
                    int EliteOffset = -1;

                    if ((Actor.IsTreasureGoblin()) && Config._.FKMinimap.Allowed.Contains((int)MapItemElement.AT_Goblin))
                    {
                        Actor.Add(MapItemElement.AT_Goblin, -1, -1, true);
                    }

                    else
                    {
                        if (!Config._.FKMinimap.Allowed.Contains((int)(MapItemElement)Actor.x0B8_MonsterQuality))
                        {
                            return;
                        }

                        MapItemElement Quality = (MapItemElement)Actor.x0B8_MonsterQuality;

                        if (Controller.GameManagerData.GameManagerAccountHelper.Current.LevelAreaHelper.EliteAffixesEnabled && (Actor.IsElite(true)))
                        {
                            EliteOffset = Actor.EliteAffixes();
                        }

                        if (Actor.IsKeyWarden())
                        {
                            Quality = MapItemElement.AT_Keywardens;
                        }

                        Actor.Add(Quality, -1, EliteOffset, true);
                    }
                }

                else if (Actor.IsItem())
                {
                    if ((Actor.IsGreaterRiftSoul()) && Config._.FKMinimap.Allowed.Contains((int)MapItemElement.AT_GreaterRiftSoul)) // GR Stuff
                    {
                        Actor.Add(MapItemElement.AT_GreaterRiftSoul);
                    }

                    else if ((Actor.IsRiftSoul()) && Config._.FKMinimap.Allowed.Contains((int)MapItemElement.AT_RiftSoul))
                    {
                        Actor.Add(MapItemElement.AT_RiftSoul);
                    }
                }

                else // Dunno yet ??????
                {
                    if ((Actor.IsShrine()) && Config._.FKMinimap.Allowed.Contains((int)MapItemElement.AT_Shrines))
                    {
                        if (Actor.GetAttribute(AttributeId.GizmoHasBeenOperated) == 1)
                        {
                            Actor.Add(MapItemElement.AT_HasBeenOperated);
                        }
                        else
                        {
                            Actor.Add(MapItemElement.AT_Shrines);
                        }
                    }

                    else if ((Actor.IsPowerPylon()) && Config._.FKMinimap.Allowed.Contains((int)MapItemElement.AT_PowerPylons))
                    {
                        if (Actor.GetAttribute(AttributeId.GizmoHasBeenOperated) == 1)
                        {
                            Actor.Add(MapItemElement.AT_HasBeenOperated);
                        }
                        else
                        {
                            Actor.Add(MapItemElement.AT_PowerPylons);
                        }
                    }

                    else if (Actor.x180_GizmoType == GizmoType.Chest)
                    {
                        if ((Actor.TryCreateResplendent()) && Config._.FKMinimap.Allowed.Contains((int)MapItemElement.AT_ResplendentChest))
                        {
                            Actor.Add(MapItemElement.AT_ResplendentChest);
                        }
                        else if ((Actor.TryCreateChest()) && Config._.FKMinimap.Allowed.Contains((int)MapItemElement.AT_Chests))
                        {
                            Actor.Add(MapItemElement.AT_Chests);
                        }
                        ///  else if (Actor.TryCreateChest(true))
                        //   GameManager.MainAccount.ActorList.Monsters.Add(new IMap.IMapActor { Actor = Actor, Type = MapItemElement.AT_LootableContainers });
                        //  else if (Actor.TryCreateLootable())
                        // GameManager.MainAccount.ActorList.Monsters.Add(new IMap.IMapActor { Actor = Actor, Type = MapItemElement.AT_LoreBooks });
                    }

                    else if ((Actor.IsPoolOfReflection()) && Config._.FKMinimap.Allowed.Contains((int)MapItemElement.AT_PoolOfReflection))
                    {
                        if (Actor.GetAttribute(AttributeId.GizmoHasBeenOperated) == 1)
                        {
                            Actor.Add(MapItemElement.AT_HasBeenOperated);
                        }
                        else
                        {
                            Actor.Add(MapItemElement.AT_PoolOfReflection);
                        }
                    }
                }
            }
        }