コード例 #1
0
        /*
         * public static void TeamNoto_Command(CommandEventArgs e)
         * {
         *  string[] args = e.Arguments;
         *  if (args != null)
         *  {
         *      bool error = false;
         *      if (args.Length > 0)
         *      {
         *          try
         *          {
         *              int val = int.Parse(args[0]);
         *              if (val < 0 || val > 3)
         *              {
         *                  error = true;
         *              }
         *              else
         *              {
         *                  AITeamList.NotoType = (AITeamList.NotoTypeEnum)Enum.ToObject(typeof(AITeamList.NotoTypeEnum), val);
         *              }
         *          }
         *          catch (Exception) { error = true; }
         *      }
         *      else
         *      {
         *          error = true;
         *      }
         *      if (error)
         *      {
         *          e.Mobile.SendMessage("Current noto type = " + AITeamList.NotoType + "\n... change with [teamnoto (int)\n"
         + "For all options below, all enemy team members will flag orange, regardless of other noto:\n"
         + "   0 = all allies are green\n"
         + "   1 = all allies are blue/grey/red but enemy militia are not orange\n"
         + "   2 = all allies standard noto (enemy militia/guilds flag orange)"
         + "   3 = all allies standard noto, and cannot heal allies in an enemy militia");
         +      }
         +  }
         + }*/

        /*
         * public static void TeamHarm_Command(CommandEventArgs e)
         * {
         *  string[] args = e.Arguments;
         *  if (args != null)
         *  {
         *      bool error = false;
         *      if (args.Length > 0)
         *      {
         *          try
         *          {
         *              string val = args[0].ToLower().Trim();
         *              if (val == "true")
         *              {
         *                  AITeamList.TeamHarm = true;
         *                  e.Mobile.SendMessage("Successfully set to true.  Teams can now harm each other");
         *              }
         *              else if (val == "false")
         *              {
         *                  AITeamList.TeamHarm = false;
         *                  e.Mobile.SendMessage("Successfully set to false.  Teams cannot harm each other anymore.");
         *              }
         *              else
         *              {
         *                  error = true;
         *              }
         *          }
         *          catch (Exception) { error = true; }
         *      }
         *      else
         *      {
         *          error = true;
         *      }
         *      if (error)
         *      {
         *          e.Mobile.SendMessage("You must provide either true or false as an argument!");
         *      }
         *  }
         * }*/

        public static void Direct_Command(CommandEventArgs e)
        {
            if (CreaturePossession.HasAnyPossessPermissions(e.Mobile))
            {
                string[] args = e.Arguments;
                if (args != null)
                {
                    if (args.Length > 0)
                    {
                        if (args[0].ToLower() == "force")
                        {
                            e.Mobile.Target = new DirectTarget(true);
                            e.Mobile.SendMessage("Target location to direct nearby mobs.");
                        }
                        else
                        {
                            e.Mobile.SendMessage("Use either '[direct' or '[direct force' with this command!");
                        }
                    }
                    else
                    {
                        e.Mobile.SendMessage("Target location to direct nearby mobs (use '[direct force' to move in combat).");
                        e.Mobile.Target = new DirectTarget(false);
                    }
                }
            }
        }
コード例 #2
0
 public static void OnPossessTargetRequest(Mobile from)
 {
     if (CreaturePossession.HasAnyPossessPermissions(from))
     {
         from.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(OnPossessTarget));
         from.SendMessage("Target a creature to possess.");
     }
 }