Esempio n. 1
0
        /************************************************************************************/
        protected static void AppendItemInfo(FlexStringBuilder ThisBuilder, int iBulletNumber, Item ThisItem)
        {
            ThisBuilder.AppendedLinePrefix = "   ";
            if (!ThisItem.IsValid)
            {
                ThisBuilder.AppendLine("{0}. Item not valid.", iBulletNumber);
                return;
            }

            ThisBuilder.AppendLine("{0}. \"{1}\"",
                                   iBulletNumber,
                                   ThisItem.Name);
            ThisBuilder.AppendedLinePrefix = "      ";

            ThisBuilder.AppendLine("Tier: {0}", ThisItem.Tier);
            ThisBuilder.AppendLine("Description: {0}", ThisItem.Description);
            ThisBuilder.AppendLine("Level: {0}", ThisItem.Level);
            //ThisBuilder.AppendLine("Link ID: {0}", ThisItem.LinkID);

            List <string> astrFlags = new List <string>();

            if (ThisItem.Lore)
            {
                astrFlags.Add("Lore");
            }
            if (ThisItem.LoreOnEquip)
            {
                astrFlags.Add("LoreOnEquip");
            }
            if (ThisItem.NoTrade)
            {
                astrFlags.Add("NoTrade");
            }
            if (ThisItem.Heirloom)
            {
                astrFlags.Add("Heirloom");
            }
            if (ThisItem.NoValue)
            {
                astrFlags.Add("NoValue");
            }
            if (ThisItem.NoZone)
            {
                astrFlags.Add("NoZone");
            }
            if (ThisItem.Attuneable)
            {
                astrFlags.Add("Attunable");
            }
            if (ThisItem.Attuned)
            {
                astrFlags.Add("Attuned");
            }

            string strFlags = string.Join(", ", astrFlags.ToArray());

            ThisBuilder.AppendLine("Flags: {0}", strFlags);

            return;
        }
        /************************************************************************************/
        protected void TrackNearestActors(int iActorCount, bool bDumpActorInfo, string strSearchSubstring)
        {
            TrackType eTrackType = TrackType.None;

            if (strSearchSubstring == "named")
            {
                eTrackType = TrackType.Named;
            }
            else if (strSearchSubstring == "resource")
            {
                eTrackType = TrackType.Resource;
            }
            else if (string.IsNullOrEmpty(strSearchSubstring.Trim()))
            {
                eTrackType = TrackType.EmptyName;
            }

            List <Actor> ActorList          = new List <Actor>();
            int          iValidActorCount   = 0;
            int          iInvalidActorCount = 0;

            foreach (Actor ThisActor in EnumActors())
            {
                bool bAddThisActor = false;

                switch (eTrackType)
                {
                case TrackType.Named:
                {
                    if (ThisActor.IsNamed && !ThisActor.IsAPet)
                    {
                        bAddThisActor = true;
                    }
                    break;
                }

                case TrackType.EmptyName:
                {
                    if (string.IsNullOrEmpty(ThisActor.Name.Trim()))
                    {
                        bAddThisActor = true;
                    }
                    break;
                }

                case TrackType.Resource:
                {
                    if (ThisActor.Type == "Resource")
                    {
                        bAddThisActor = true;
                    }
                    break;
                }

                default:
                {
                    string strActorName = ThisActor.Name.ToLower();
                    if (strActorName.Contains(strSearchSubstring))
                    {
                        bAddThisActor = true;
                    }
                    break;
                }
                }

                if (bAddThisActor)
                {
                    ActorList.Add(ThisActor);
                    iValidActorCount++;
                }
                else
                {
                    iInvalidActorCount++;
                }
            }

            if (ActorList.Count == 0)
            {
                Program.Log("Unable to find actor \"{0}\".", strSearchSubstring);
                RunCommand("/waypoint_cancel");
                return;
            }

            ActorList.Sort(new ActorDistanceComparer());

            /// Run the waypoint on the nearest actor.
            RunCommand("/waypoint {0}, {1}, {2}", ActorList[0].X, ActorList[0].Y, ActorList[0].Z);

            if (bDumpActorInfo)
            {
                FlexStringBuilder SummaryBuilder = new FlexStringBuilder();
                SummaryBuilder.AppendLine("{0} actor(s) found ({1} invalid) using \"{2}\".", iValidActorCount, iInvalidActorCount, strSearchSubstring);

                /// Now display the individual results.
                for (int iIndex = 0; iIndex < ActorList.Count && iIndex < 5; iIndex++)
                {
                    Actor ThisActor = ActorList[iIndex];
                    AppendActorInfo(SummaryBuilder, iIndex + 1, ThisActor);
                }

                Program.Log(SummaryBuilder.ToString());
            }
            return;
        }
Esempio n. 3
0
        /************************************************************************************/
        protected static void AppendActorInfo(FlexStringBuilder ThisBuilder, int iBulletNumber, Actor ThisActor)
        {
            ThisBuilder.AppendedLinePrefix = "   ";
            if (!ThisActor.IsValid)
            {
                ThisBuilder.AppendLine("{0}. Actor not valid.", iBulletNumber);
                return;
            }

            ThisBuilder.AppendLine("{0}. \"{1}\" ({2}) found {3:0.00} meters away at ({4:0.00}, {5:0.00}, {6:0.00})",
                                   iBulletNumber,
                                   ThisActor.Name,
                                   ThisActor.ID,
                                   ThisActor.Distance,
                                   ThisActor.X,
                                   ThisActor.Y,
                                   ThisActor.Z);
            ThisBuilder.AppendedLinePrefix = "      ";

            string strFullName = ThisActor.Name;

            if (!string.IsNullOrEmpty(ThisActor.LastName))
            {
                strFullName += " " + ThisActor.LastName;
            }
            if (!string.IsNullOrEmpty(ThisActor.SuffixTitle))
            {
                strFullName += " " + ThisActor.SuffixTitle;
            }
            if (!string.IsNullOrEmpty(ThisActor.Guild))
            {
                strFullName += " <" + ThisActor.Guild + ">";
            }

            ThisBuilder.AppendLine("Full Name: {0}", strFullName);

            ThisBuilder.AppendLine("Type: {0}", ThisActor.Type);
            ThisBuilder.AppendLine("Class: {0}", ThisActor.Class);
            ThisBuilder.AppendLine("Race: {0}", ThisActor.Race);
            ThisBuilder.AppendLine("Level(Effective): {0}({1})", ThisActor.Level, ThisActor.EffectiveLevel);
            ThisBuilder.AppendLine("Encounter Size: {0}", ThisActor.EncounterSize);
            ThisBuilder.AppendLine("Collision Radius: {0}", ThisActor.CollisionRadius);
            ThisBuilder.AppendLine("Speed: {0}%", ThisActor.Speed);

            List <string> astrFlags = new List <string>();

            if (ThisActor.IsLinkdead)
            {
                astrFlags.Add("IsLinkdead");
            }

            if (ThisActor.IsSolo)
            {
                astrFlags.Add("IsSolo");
            }
            else if (ThisActor.IsHeroic)
            {
                astrFlags.Add("IsHeroic");
            }
            else if (ThisActor.IsEpic)
            {
                astrFlags.Add("IsEpic");
            }

            if (ThisActor.IsMerchant)
            {
                astrFlags.Add("IsMerchant");
            }
            if (ThisActor.IsBanker)
            {
                astrFlags.Add("IsBanker");
            }
            if (ThisActor.IsInvis)
            {
                astrFlags.Add("IsInvis");
            }
            if (ThisActor.IsStealthed)
            {
                astrFlags.Add("IsStealthed");
            }
            if (ThisActor.IsDead)
            {
                astrFlags.Add("IsDead");
            }
            if (ThisActor.IsFD)
            {
                astrFlags.Add("IsFD");
            }
            if (ThisActor.IsAggro)
            {
                astrFlags.Add("IsAggro");
            }
            if (ThisActor.IsLocked)
            {
                astrFlags.Add("IsLocked");
            }
            if (ThisActor.IsEncounterBroken)
            {
                astrFlags.Add("IsEncounterBroken");
            }
            if (ThisActor.IsNamed)
            {
                astrFlags.Add("IsNamed");
            }
            if (ThisActor.IsAPet)
            {
                astrFlags.Add("IsAPet");
            }
            if (ThisActor.IsMyPet)
            {
                astrFlags.Add("IsMyPet");
            }
            if (ThisActor.IsChest)
            {
                astrFlags.Add("IsChest");
            }

            if (ThisActor.IsIdle)
            {
                astrFlags.Add("IsIdle");
            }
            else if (ThisActor.IsBackingUp)
            {
                astrFlags.Add("IsBackingUp");
            }
            else if (ThisActor.IsStrafingLeft)
            {
                astrFlags.Add("IsStrafingLeft");
            }
            else if (ThisActor.IsStrafingRight)
            {
                astrFlags.Add("IsStrafingRight");
            }

            if (ThisActor.InCombatMode)
            {
                astrFlags.Add("InCombatMode");
            }
            else if (ThisActor.IsCrouching)
            {
                astrFlags.Add("IsCrouching");
            }
            else if (ThisActor.IsSitting)
            {
                astrFlags.Add("IsSitting");
            }

            if (ThisActor.IsSprinting)
            {
                astrFlags.Add("IsSprinting");
            }
            else if (ThisActor.IsWalking)
            {
                astrFlags.Add("IsWalking");
            }
            else if (ThisActor.IsRunning)
            {
                astrFlags.Add("IsRunning");
            }

            if (ThisActor.OnCarpet)
            {
                astrFlags.Add("OnCarpet");
            }
            else if (ThisActor.OnHorse)
            {
                astrFlags.Add("OnHorse");
            }
            else if (ThisActor.OnGriffin)
            {
                astrFlags.Add("OnGriffin");
            }
            else if (ThisActor.OnGriffon)
            {
                astrFlags.Add("OnGriffon");
            }

            string strFlags = string.Join(", ", astrFlags.ToArray());

            ThisBuilder.AppendLine("Flags: {0}", strFlags);
            return;
        }