示例#1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Mobile        targ   = (Mobile)targeted;
                    Server.Skills skills = targ.Skills;

                    for (int i = 0; i < skills.Length; ++i)
                    {
                        skills[i].Base = m_Value;
                    }

                    CommandLogging.LogChangeProperty(from, targ, "EverySkill.Base", m_Value.ToString());
                }
                else
                {
                    from.SendMessage("That does not have skills!");
                }
            }
示例#2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Mobile targ  = (Mobile)targeted;
                    Skill  skill = targ.Skills[m_Skill];

                    if (skill == null)
                    {
                        return;
                    }

                    skill.Cap = m_Value;
                    CommandLogging.LogChangeProperty(from, targ, String.Format("{0}.Cap", m_Skill), m_Value.ToString());

                    from.SendMessage("{0} : {1} (Base: {2}) (Cap: {3})", m_Skill, skill.Value, skill.Base, skill.Cap);
                }
                else
                {
                    from.SendMessage("That does not have skills!");
                }
            }
示例#3
0
        public static string InternalSetValue(Mobile from, object logobj, object o, PropertyInfo p, string pname, string value, bool shouldLog)
        {
            object toSet  = null;
            string result = ConstructFromString(p.PropertyType, o, value, ref toSet);

            if (result != null)
            {
                return(result);
            }

            try
            {
                if (shouldLog)
                {
                    CommandLogging.LogChangeProperty(from, logobj, pname, value);
                }

                p.SetValue(o, toSet, null);

                if (Miscellanious.ValidateLabeling(o) && from.AccessLevel < AccessLevel.Administrator)
                {
                    if (o is Mobile)
                    {
                        (o as Mobile).Cheater_Name = String.Format("This mobile modified by GM {0}", from.Name);
                    }
                    if (o is Item)
                    {
                        (o as Item).Cheater_Name = String.Format("This item modified by GM {0}", from.Name);
                    }
                }
                return("Property has been set.");
            }
            catch
            {
                return("An exception was caught, the property may not be set.");
            }
        }