Beispiel #1
0
        /// <summary>
        /// Attack Target from gui filter selector, in Targetting tab.
        /// </summary>
        /// <param name="target_name"></param>
        public static void AttackTargetFromList(string target_name)
        {
            TargetGUI targetdata = Settings.Target.TargetRead(target_name);

            if (targetdata == null)
            {
                return;
            }

            Mobiles.Filter filter   = targetdata.TargetGuiObject.Filter.ToMobileFilter();
            string         selector = targetdata.TargetGuiObject.Selector;

            List <Mobile> filterresult;

            filterresult = Mobiles.ApplyFilter(filter);

            Mobile mobtarget = Mobiles.Select(filterresult, selector);

            if (mobtarget == null)
            {
                return;
            }

            AttackMessage(mobtarget.Serial, true);             // Process message for highlight
            if (Targeting.LastAttack != mobtarget.Serial)
            {
                Assistant.Client.Instance.SendToClientWait(new ChangeCombatant(mobtarget.Serial));
                Targeting.LastAttack = (uint)mobtarget.Serial;
            }
            Assistant.Client.Instance.SendToServerWait(new AttackReq(mobtarget.Serial));             // Real attack
        }
Beispiel #2
0
        /// <summary>
        /// Execute Target from GUI filter selector, in Targetting tab.
        /// </summary>
        /// <param name="target_name">Name of the target filter.</param>
        public static void PerformTargetFromList(string target_name)
        {
            TargetGUI targetdata = Settings.Target.TargetRead(target_name);

            if (targetdata == null)
            {
                return;
            }

            Mobiles.Filter filter   = targetdata.TargetGuiObject.Filter.ToMobileFilter();
            string         selector = targetdata.TargetGuiObject.Selector;

            List <Mobile> filterresult;

            filterresult = Mobiles.ApplyFilter(filter);

            Mobile mobtarget = Mobiles.Select(filterresult, selector);

            if (mobtarget == null)
            {
                return;
            }

            TargetExecute(mobtarget.Serial);
            SetLast(mobtarget);
        }
Beispiel #3
0
        /// <summary>
        /// Get Mobile object from GUI filter selector, in Targetting tab.
        /// </summary>
        /// <param name="target_name">Name of the target filter.</param>
        /// <returns>Mobile object matching. None: not found</returns>
        public static Mobile GetTargetFromList(string target_name)
        {
            TargetGUI targetdata = Settings.Target.TargetRead(target_name);

            if (targetdata == null)
            {
                return(null);
            }


            Mobiles.Filter filter   = targetdata.TargetGuiObject.Filter.ToMobileFilter();
            string         selector = targetdata.TargetGuiObject.Selector;

            List <Mobile> filterresult;

            filterresult = Mobiles.ApplyFilter(filter);

            Mobile mobtarget = Mobiles.Select(filterresult, selector);

            if (mobtarget == null)
            {
                return(null);
            }

            return(mobtarget);
        }
Beispiel #4
0
        internal static void SetLastTargetFromListHotKey(string targetid)
        {
            TargetGUI targetdata = Settings.Target.TargetRead(targetid);

            if (targetdata == null)
            {
                return;
            }

            Mobiles.Filter filter   = targetdata.TargetGuiObject.Filter.ToMobileFilter();
            string         selector = targetdata.TargetGuiObject.Selector;

            List <Mobile> filterresult;

            filterresult = Mobiles.ApplyFilter(filter);

            Mobile mobtarget = Mobiles.Select(filterresult, selector);

            if (mobtarget == null)
            {
                return;
            }

            TargetMessage(mobtarget.Serial, false);             // Process message for highlight

            Assistant.Mobile mobile = World.FindMobile(mobtarget.Serial);
            if (mobile != null)
            {
                Targeting.SetLastTarget(mobile.Serial, 0, false);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Set Last Target from GUI filter selector, in Targetting tab.
        /// </summary>
        /// <param name="target_name">Name of the target filter.</param>
        public static void SetLastTargetFromList(string target_name)
        {
            TargetGUI targetdata = Settings.Target.TargetRead(target_name);

            if (targetdata != null)
            {
                Mobiles.Filter filter   = targetdata.TargetGuiObject.Filter.ToMobileFilter();
                string         selector = targetdata.TargetGuiObject.Selector;

                List <Mobile> filterresult;
                filterresult = Mobiles.ApplyFilter(filter);

                Mobile mobtarget = Mobiles.Select(filterresult, selector);
                if (mobtarget == null)
                {
                    return;
                }

                RazorEnhanced.Target.SetLast(mobtarget);
            }
        }