Ejemplo n.º 1
0
        public static bool Create(string[] args, CommandGroup command)
        {
            if (args.Count() < 1)
            {
                return(false);
            }

            Player target;

            if (!command.extractPlayerTarget(args[0], out target))
            {
                return(false);
            }

            string guildname = command.extractQuotedArg(args[0].Contains("\"") ? args[0] : args[1]);

            if (guildname == null)
            {
                return(false);
            }

            if (target.GuildGuid != 0)
            {
                return(command.SendErrorMessage(CypherStrings.PlayerInGuild));
            }

            Guild guild = new Guild();

            if (!GuildMgr.CreateGuild(target, guildname))
            {
                return(command.SendErrorMessage(CypherStrings.GuildNotCreated));
            }

            return(true);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// This method checks if a guild exists
 /// if not, the guild is created with default values
 /// </summary>
 /// <param name="currentRealm">Current Realm being checked</param>
 /// <param name="guildName">The guild name that is being checked</param>
 private static void CheckGuild(eRealm currentRealm, string guildName)
 {
     if (!GuildMgr.DoesGuildExist(guildName))
     {
         Guild newguild = GuildMgr.CreateGuild(currentRealm, guildName);
         newguild.Ranks[8].OcHear = true;
         newguild.Motd            = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Guild.StartupGuild.Motd");
         newguild.Omotd           = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Guild.StartupGuild.Omotd");
         newguild.Ranks[8].Title  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Guild.StartupGuild.Title");
     }
 }