Exemplo n.º 1
0
        public void ChangeParameters(WorldClient changer, ushort rank, sbyte experienceGivenPercent, uint rights)
        {
            GuildRecord guild = changer.Character.GetGuild();

            if (guild == null || guild.Id != this.GuildId)
            {
                return;
            }
            CharacterGuildRecord modifier = CharacterGuildRecord.GetCharacterGuild(changer.Character.Id);

            if (modifier != this)
            {
                if (modifier.HasRight(GuildRightsBitEnum.GUILD_RIGHT_MANAGE_XP_CONTRIBUTION))
                {
                    this.ExperienceGivenPercent = experienceGivenPercent;
                }
            }
            else
            {
                if (this.HasRight(GuildRightsBitEnum.GUILD_RIGHT_MANAGE_MY_XP_CONTRIBUTION))
                {
                    this.ExperienceGivenPercent = experienceGivenPercent;
                }
            }
            if (modifier.HasRight(GuildRightsBitEnum.GUILD_RIGHT_MANAGE_RANKS))
            {
                this.Rank = rank;
            }
            if (modifier.HasRight(GuildRightsBitEnum.GUILD_RIGHT_MANAGE_RIGHTS))
            {
                this.Rights = rights;
            }
            SaveTask.UpdateElement(modifier);
        }
Exemplo n.º 2
0
        public static void RemoveWhereId(CharacterRecord record)
        {
            var guildRecord = GuildRecord.GetGuild(record.GuildId);

            if (guildRecord != null)
            {
                var member = guildRecord.GetContextGuildMember(record.Id);

                if (member != null)
                {
                    guildRecord.Members.Remove(member);
                    guildRecord.UpdateElement();
                }
            }
        }