コード例 #1
0
ファイル: Skills.cs プロジェクト: avatar21/runuo
        public static void SetSkill_OnCommand(CommandEventArgs arg)
        {
            if (arg.Length != 2)
            {
                arg.Mobile.SendMessage("SetSkill <skill name> <value>");
            }
            else
            {
                SkillName skill;
#if Framework_4_0
                if (Enum.TryParse(arg.GetString(0), true, out skill))
                {
                    arg.Mobile.Target = new SkillTarget(skill, arg.GetDouble(1));
                }
                else
                {
                    arg.Mobile.SendLocalizedMessage(1005631);                       // You have specified an invalid skill to set.
                }
#else
                try
                {
                    skill = (SkillName)Enum.Parse(typeof(SkillName), arg.GetString(0), true);
                }
                catch
                {
                    arg.Mobile.SendLocalizedMessage(1005631);                       // You have specified an invalid skill to set.
                    return;
                }
                arg.Mobile.Target = new SkillTarget(skill, arg.GetDouble(1));
#endif
            }
        }
コード例 #2
0
ファイル: Skills.cs プロジェクト: FreeReign/imaginenation
		public static void SetSkill_OnCommand( CommandEventArgs arg )
		{
			if ( arg.Length != 2 )
			{
				arg.Mobile.SendMessage( "SetSkill <skill name> <value>" );
			}
			else
			{
				SkillName skill;
#if Framework_4_0
				if( Enum.TryParse( arg.GetString( 0 ), true, out skill ) )
				{
					arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
				}
				else
				{
					arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
				}
#else
                try
                {
                    skill = (SkillName)Enum.Parse(typeof(SkillName), arg.GetString(0), true);
                }
                catch
                {
                    arg.Mobile.SendLocalizedMessage(1005631); // You have specified an invalid skill to set.
                    return;
                }
                arg.Mobile.Target = new SkillTarget(skill, arg.GetDouble(1));
#endif
			}
		}
コード例 #3
0
ファイル: Skills.cs プロジェクト: tateima/PathOfUO
 public static void SetAllSkills_OnCommand(CommandEventArgs arg)
 {
     if (arg.Length != 1)
     {
         arg.Mobile.SendMessage("SetAllSkills <value>");
     }
     else
     {
         arg.Mobile.Target = new AllSkillsTarget(arg.GetDouble(0));
     }
 }
コード例 #4
0
ファイル: Skills.cs プロジェクト: Grimoric/RunUO.T2A
		public static void SetAllSkills_OnCommand( CommandEventArgs arg )
		{
			if ( arg.Length != 1 )
			{
				arg.Mobile.SendMessage( "SetAllSkills <value>" );
			}
			else
			{
				arg.Mobile.Target = new AllSkillsTarget( arg.GetDouble( 0 ) );
			}
		}
コード例 #5
0
        public static void RegionParagonMod_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            if (e.Length == 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("<BASEFONT COLOR=WHITE>MODIFIED PARAGON REGIONS<br><br>");

                foreach (var kvp in m_Modifiers)
                {
                    sb.Append(kvp.Key.Name);
                    sb.Append(": ");
                    sb.Append(kvp.Value);
                    sb.Append("<br>");
                }

                from.SendGump(new TextGump(sb.ToString()));

                return;
            }

            if (e.Length == 2)
            {
                try
                {
                    string name = e.GetString(0);
                    double mod  = e.GetDouble(1);

                    var region = FindRegion(from, name);

                    if (region == null)
                    {
                        from.SendMessage("No region with that name was found.");
                    }
                    else
                    {
                        SetModifier(region, mod);
                        from.SendMessage(String.Format("The paragon modifier for \"{0}\" has been set to {1}", region.Name, mod));
                    }
                }
                catch
                {
                    from.SendMessage("Error in arguments. Usage: [RegionParagonMod \"name\" 0.5 (50% paragons)");
                }
            }
        }
コード例 #6
0
ファイル: Skills.cs プロジェクト: tateima/PathOfUO
 public static void SetSkill_OnCommand(CommandEventArgs arg)
 {
     if (arg.Length != 2)
     {
         arg.Mobile.SendMessage("SetSkill <skill name> <value>");
     }
     else
     {
         if (Enum.TryParse(arg.GetString(0), true, out SkillName skill))
         {
             arg.Mobile.Target = new SkillTarget(skill, arg.GetDouble(1));
         }
         else
         {
             arg.Mobile.SendLocalizedMessage(1005631); // You have specified an invalid skill to set.
         }
     }
 }
コード例 #7
0
ファイル: Skills.cs プロジェクト: greeduomacro/last-wish
		public static void SetSkill_OnCommand( CommandEventArgs arg )
		{
			if ( arg.Length != 2 )
			{
				arg.Mobile.SendMessage( "SetSkill <skill name> <value>" );
			}
			else
			{
				SkillName skill;
				if( Enum.TryParse( arg.GetString( 0 ), true, out skill ) )
				{
					arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
				}
				else
				{
					arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
				}
			}
		}
コード例 #8
0
 public static void SetLokaiSkill_OnCommand(CommandEventArgs arg)
 {
     if (arg.Length != 2)
     {
         arg.Mobile.SendMessage("SetLokaiSkill <Lokai Skill name> <value>");
     }
     else
     {
         LokaiSkillName lokaiSkill;
         try
         {
             lokaiSkill = (LokaiSkillName)Enum.Parse(typeof(LokaiSkillName), arg.GetString(0), true);
         }
         catch
         {
             arg.Mobile.SendMessage("You have specified an invalid Lokai Skill to set.");
             return;
         }
         arg.Mobile.Target = new LokaiSkillTarget(lokaiSkill, arg.GetDouble(1));
     }
 }
コード例 #9
0
 public static void SetSkill_OnCommand(CommandEventArgs arg)
 {
     if (arg.Length != 2)
     {
         arg.Mobile.SendMessage("SetSkill <skill name> <value>");
     }
     else
     {
         SkillName skill;
         try
         {
             skill = (SkillName)Enum.Parse(typeof(SkillName), arg.GetString(0), true);
         }
         catch
         {
             arg.Mobile.SendLocalizedMessage(1005631);
             return;
         }
         arg.Mobile.Target = new SkillTarget(skill, arg.GetDouble(1));
     }
 }
コード例 #10
0
        public static void RepeatSoundCommand_OnCommand(CommandEventArgs args)
        {
            if (args.Length == 2)
            {
                Timer  timer      = null;
                bool   foundValue = false;
                int    soundID    = args.GetInt32(0);
                double interval   = args.GetDouble(1);

                if (m_Table.ContainsKey(soundID))
                {
                    foundValue = m_Table.TryGetValue(soundID, out timer);
                }

                if (foundValue || timer != null)
                {
                    if (timer != null)
                    {
                        timer.Stop();
                    }

                    if (m_Table.Remove(soundID))
                    {
                        args.Mobile.SendMessage("RepeatSound process with sound index {0} halted.", soundID);
                    }
                }
                else
                {
                    timer = new InternalTimer(args.Mobile, soundID, interval);
                    timer.Start();

                    m_Table.Add(soundID, timer);
                }
            }
            else
            {
                args.Mobile.SendMessage("Usage: RepeatSound <int soundID> <double intervalDelay>");
            }
        }