Ejemplo n.º 1
0
		public DBGuild()
		{
			m_guildname = "default guild name";
			m_realm = 0;
			m_emblem = 0;
			Ranks = new DBRank[10];
			m_webpage = "";
			m_email = "";
			m_guildBanner = false;
			m_guildDues = false;
			m_guildBank = 0;
			m_guildDuesPercent = 0;
			m_guildHouse = false;
			m_guildHouseNumber = 0;
			m_meritPoints = 0;
			m_bonusType = 0;
			m_bonusStartTime = new DateTime(2000, 1, 1);
			m_guildBannerLostTime = new DateTime(2000, 1, 1);
		}
Ejemplo n.º 2
0
 public DBGuild()
 {
     m_guildname           = "default guild name";
     m_realm               = 0;
     m_emblem              = 0;
     Ranks                 = new DBRank[10];
     m_webpage             = string.Empty;
     m_email               = string.Empty;
     m_guildBanner         = false;
     m_guildDues           = false;
     m_guildBank           = 0;
     m_guildDuesPercent    = 0;
     m_guildHouse          = false;
     m_guildHouseNumber    = 0;
     m_meritPoints         = 0;
     m_bonusType           = 0;
     m_bonusStartTime      = new DateTime(2000, 1, 1);
     m_guildBannerLostTime = new DateTime(2000, 1, 1);
 }
Ejemplo n.º 3
0
        private static DBRank CreateRank(Guild guild, int rankLevel)
        {
            DBRank rank = new DBRank();
            rank.AcHear = false;
            rank.AcSpeak = false;
            rank.Alli = false;
            rank.Claim = false;
            rank.Emblem = false;
            rank.GcHear = true;
            rank.GcSpeak = false;
            rank.GuildID = guild.GuildID;
            rank.Invite = false;
            rank.OcHear = false;
            rank.OcSpeak = false;
            rank.Promote = false;
            rank.RankLevel = (byte)rankLevel;
            rank.Release = false;
            rank.Remove = false;
            rank.Title = "Rank " + rankLevel.ToString();
            rank.Upgrade = false;
            rank.View = false;
            rank.View = false;
            rank.Dues = false;

            if (rankLevel < 9)
            {
                rank.GcSpeak = true;
                rank.View = true;
                if (rankLevel < 8)
                {
                    rank.Emblem = true;
                    if (rankLevel < 7)
                    {
                        rank.AcHear = true;
                        if (rankLevel < 6)
                        {
                            rank.AcSpeak = true;
                            if (rankLevel < 5)
                            {
                                rank.OcHear = true;
                                if (rankLevel < 4)
                                {
                                    rank.OcSpeak = true;
                                    if (rankLevel < 3)
                                    {
                                        rank.Invite = true;
                                        rank.Promote = true;

                                        if (rankLevel < 2)
                                        {
                                            rank.Release = true;
                                            rank.Upgrade = true;
                                            rank.Claim = true;
                                            if (rankLevel < 1)
                                            {
                                                rank.Remove = true;
                                                rank.Alli = true;
                                                rank.Dues = true;
                                                rank.Withdraw = true;
                                                rank.Title = "Guildmaster";
                                                rank.Buff = true;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            return rank;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Add a player to a guild with the specified rank
        /// </summary>
        /// <param name="addPlayer"></param>
        /// <param name="rank"></param>
        /// <returns></returns>
        public bool AddPlayer(GamePlayer addPlayer, DBRank rank)
        {
            if (addPlayer == null || addPlayer.Guild != null)
                return false;

            if (log.IsDebugEnabled)
                log.Debug("Adding player to the guild, guild name=\"" + Name + "\"; player name=" + addPlayer.Name);

            try
            {
                AddOnlineMember(addPlayer);
                addPlayer.GuildName = Name;
                addPlayer.GuildID = GuildID;
                addPlayer.GuildRank = rank;
                addPlayer.Guild = this;
                addPlayer.SaveIntoDatabase();
                GuildMgr.AddPlayerToAllGuildPlayersList(addPlayer);
                addPlayer.Out.SendMessage("You have agreed to join " + this.Name + "!", eChatType.CT_Group, eChatLoc.CL_SystemWindow);
                addPlayer.Out.SendMessage("Your current rank is " + addPlayer.GuildRank.Title + "!", eChatType.CT_Group, eChatLoc.CL_SystemWindow);
                SendMessageToGuildMembers(addPlayer.Name + " has joined the guild!", eChatType.CT_Group, eChatLoc.CL_SystemWindow);
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                    log.Error("AddPlayer", e);
                return false;
            }

            return true;
        }