Beispiel #1
0
        public static string GetCorpseName(Mobile m)
        {
            if (m is BaseCreature)
            {
                BaseCreature bc = (BaseCreature)m;

                if (bc.CorpseNameOverride != null)
                {
                    return(bc.CorpseNameOverride);
                }
            }

            Type t = m.GetType();

            object[] attrs = t.GetCustomAttributes(typeof(CorpseNameAttribute), true);

            if (attrs.Length > 0)
            {
                CorpseNameAttribute attr = attrs[0] as CorpseNameAttribute;

                if (attr != null)
                {
                    return(attr.Name);
                }
            }

            return(null);
        }
Beispiel #2
0
        public static string GetCorpseName(Mobile m)
        {
            XmlData x = (XmlData)XmlAttach.FindAttachment(m, typeof(XmlData), "CorpseName");

            if (x != null)
            {
                return(x.Data);
            }

            if (m is BaseCreature)
            {
                BaseCreature bc = (BaseCreature)m;

                if (bc.CorpseNameOverride != null)
                {
                    return(bc.CorpseNameOverride);
                }
            }

            Type t = m.GetType();

            var attrs = t.GetCustomAttributes(typeof(CorpseNameAttribute), true);

            if (attrs != null && attrs.Length > 0)
            {
                CorpseNameAttribute attr = attrs[0] as CorpseNameAttribute;

                if (attr != null)
                {
                    return(attr.Name);
                }
            }

            return(null);
        }
        public static string GetCorpseName(Mobile m)
        {
            Type t = m.GetType();

            object[] attrs = t.GetCustomAttributes(typeof(CorpseNameAttribute), true);

            if (attrs != null && attrs.Length > 0)
            {
                CorpseNameAttribute attr = attrs[0] as CorpseNameAttribute;

                if (attr != null)
                {
                    if (m is BaseCreature)
                    {
                        // Does it have a spawner?
                        if (((BaseCreature)m).Spawner != null)
                        {
                            // Do we have a custom name we need to use?
                            Spawner sp = ((BaseCreature)m).Spawner;

                            if (sp.TemplateEnabled && sp.TemplateMobile != null)
                            {
                                // Let the system catch and handle this
                                return(null);
                            }
                        }
                    }
                    return(attr.Name);
                }
            }

            return(null);
        }
Beispiel #4
0
        public static string GetCorpseName(Mobile m)
        {
            Type t = m.GetType();

            PlayerMobile tmob = m as PlayerMobile;

            if (tmob != null && tmob.Race != null)
            {
                if (tmob.Female)
                {
                    return(tmob.Race.NameF);
                }
                else
                {
                    return(tmob.Race.Name);
                }
            }


            object[] attrs = t.GetCustomAttributes(typeof(CorpseNameAttribute), true);

            if (attrs != null && attrs.Length > 0)
            {
                CorpseNameAttribute attr = attrs[0] as CorpseNameAttribute;

                if (attr != null)
                {
                    return(attr.Name);
                }
            }

            return(null);
        }
Beispiel #5
0
        public static string GetCorpseName(Mobile m)
        {
            Type t = m.GetType();

            object[] attrs = t.GetCustomAttributes(typeof(CorpseNameAttribute), true);

            if (attrs != null && attrs.Length > 0)
            {
                CorpseNameAttribute attr = attrs[0] as CorpseNameAttribute;

                if (attr != null)
                {
                    return(attr.Name);
                }
            }

            return(null);
        }
Beispiel #6
0
        public static string GetCorpseName(Mobile m)
        {
            Type t = m.GetType();

            object[] attrs = t.GetCustomAttributes(typeof(CorpseNameAttribute), true);

            if (m is ElfRogue || m is Rogue || m is OrkRogue || m is Bandit || m is Brigand)
            {
                string called = m.Name + " the thief";

                if (m is Bandit)
                {
                    called = m.Name + " the bandit";
                }
                else if (m is Brigand)
                {
                    called = m.Name + " the brigand";
                }
                else if (m.Title.Contains(" assassin"))
                {
                    called = m.Name + " the assassin";
                }
                else if (m.Title.Contains(" hunter"))
                {
                    called = m.Name + " the assassin";
                }
                else if (m.Title.Contains(" ninja"))
                {
                    called = m.Name + " the assassin";
                }

                return("the remains of " + called);
            }
            else if (m is PirateLand ||
                     m is PirateCrew ||
                     m is PirateCrewBow ||
                     m is PirateCrewMage ||
                     m is PirateCaptain ||
                     m is ElfPirateCaptain ||
                     m is ElfPirateCrew ||
                     m is ElfPirateCrewBow ||
                     m is EvilSailorMinstrel ||
                     m is EvilSailorArcher ||
                     m is ElfEvilSailorWizard ||
                     m is ElfEvilSailorMinstrel ||
                     m is EvilSailorWizard ||
                     m is ElfEvilSailorArcher ||
                     m is ElfPirateCrewMage)
            {
                return("the remains of " + m.Name + " the pirate");
            }
            else if (attrs != null && attrs.Length > 0)
            {
                CorpseNameAttribute attr = attrs[0] as CorpseNameAttribute;

                if (attr != null)
                {
                    return(attr.Name);
                }
            }

            return(null);
        }