示例#1
0
        public static void AddTreePosition()
        {
            Lumberjacking2 lumber = new Lumberjacking2();

            lumber.AddTree();
        }
示例#2
0
        public static void RemoveTreePosition()
        {
            Lumberjacking2 lumber = new Lumberjacking2();

            lumber.RemoveTree();
        }
示例#3
0
        public static void StartLumber(Serial container, Serial innerContainer, string containerPosition, string ressPosition, string deny, string trees, int maxForesnicSkill, int nastrojLoad, bool enableVisitor, string ESWN)
        {
            Lumberjacking2 lumber = new Lumberjacking2();

            lumber.StartPosition = new UOPositionBase(World.Player.X, World.Player.Y, 0);

            if (!String.IsNullOrEmpty(ESWN))
            {
                string[] esvnSplit = ESWN.Split(new char[] { ',' });

                if (esvnSplit.Length > 0)
                {
                    lumber.MaxE = Int32.Parse(esvnSplit[0]);
                }
                if (esvnSplit.Length > 1)
                {
                    lumber.MaxS = Int32.Parse(esvnSplit[1]);
                }
                if (esvnSplit.Length > 2)
                {
                    lumber.MaxW = Int32.Parse(esvnSplit[2]);
                }
                if (esvnSplit.Length > 3)
                {
                    lumber.MaxN = Int32.Parse(esvnSplit[3]);
                }
            }


            if (String.IsNullOrEmpty(trees))
            {
                int currentX = lumber.StartPosition.X.GetValueOrDefault();
                int currentY = lumber.StartPosition.Y.GetValueOrDefault();
                int minX     = 0;
                int minY     = 0;
                int maxX     = 0;
                int maxY     = 0;

                minX = (currentX - lumber.SearchSuqareSize < 0 ? 0 : currentX - lumber.SearchSuqareSize);
                maxX = (currentX + lumber.SearchSuqareSize > 6000 ? 6000 : currentX + lumber.SearchSuqareSize);
                minY = (currentY - lumber.SearchSuqareSize < 0 ? 0 : currentY - lumber.SearchSuqareSize);
                maxY = (currentY + lumber.SearchSuqareSize > 6000 ? 6000 : currentY + lumber.SearchSuqareSize);

                if (lumber.MaxE > 0)
                {
                    maxX = Math.Min(maxX, lumber.MaxE);
                }
                if (lumber.MaxS > 0)
                {
                    maxY = Math.Min(maxY, lumber.MaxS);
                }
                if (lumber.MaxW > 0)
                {
                    minX = Math.Max(minX, lumber.MaxW);
                }
                if (lumber.MaxN > 0)
                {
                    minY = Math.Max(minY, lumber.MaxN);
                }

                UOPositionCollection allTrees = new UOPositionCollection();
                allTrees.Load(String.Format("IsTree=1 AND X>={0} AND X<={1} AND Y>={2} AND Y<={3}", minX, maxX, minY, maxY));
                allTrees = allTrees.SortByOptimalTrack(new Robot().ActualPosition);

                lumber.Trees.AddRange(allTrees.ToArray());
            }
            else
            {
                lumber.Trees.AddRange(UOPositionBase.ParseList(trees));
            }

            lumber.Container         = container;
            lumber.InnerContainer    = innerContainer;
            lumber.ContainerPosition = UOPositionBase.ParseList(containerPosition);
            lumber.RessPositionPath  = UOPositionBase.ParseList(ressPosition);
            lumber.MaxForensicSkill  = maxForesnicSkill;
            lumber.NastrojLoad       = nastrojLoad;
            lumber.EnableVisitorInfo = enableVisitor;

            foreach (string s in deny.Split(new char[] { ',' }))
            {
                lumber.dennyLogList.Add(s);
            }

            UO.Print(0x0035, "StartLumber s nasledujicimi parametry:");
            UO.Print(0x0035, "Container:" + lumber.Container);
            UO.Print(0x0035, "InnerContainer:" + lumber.InnerContainer);
            UO.Print(0x0035, "ContainerPosition:" + UOPositionBase.ListToString(lumber.ContainerPosition));
            UO.Print(0x0035, "RessPositionPath:" + UOPositionBase.ListToString(lumber.RessPositionPath));
            UO.Print(0x0035, "StartPosition:" + lumber.StartPosition);
            UO.Print(0x0035, "Trees:" + lumber.Trees.Count);
            UO.Print(0x0035, "MaxForensicSkill:" + lumber.MaxForensicSkill);
            UO.Print(0x0035, "KumpLoad:" + lumber.NastrojLoad);
            UO.Print(0x0035, "EnableVisitorInfo:" + lumber.EnableVisitorInfo);
            UO.Print(0x0191, "DenyOres:" + String.Join(",", lumber.dennyLogList.ToArray()));



            lumber.Lumber();
        }