예제 #1
0
        private static void ProcessGuildJoinRequestAccept(WorldClient Client)
        {
            if (!Client.IsGameAction(GameActionTypeEnum.BASIC_REQUEST))
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            if (!(Client.GetBaseRequest() is GuildJoinRequest))
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            if (Client == Client.GetBaseRequest().Requester)
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            if (Client.GetBaseRequest().Accept())
            {
                Client.GetBaseRequest().Requester.Send(new GuildJoinMessage('K', GuildJoinReason.REASON_IN_GUILD, Client.GetCharacter().Name));

                var Guild = Client.GetBaseRequest().Requester.GetCharacter().GetGuild();



                var member = new CharacterGuild()
                {
                    ID                = Client.Character.ID,
                    Name              = Client.Character.Name,
                    Level             = Client.Character.Level,
                    Gfx               = Client.Character.Look,
                    ExperiencePercent = 0,
                    Experience        = 0,
                    Alignement        = Client.Character.Alignement,
                    lastConnection    = Client.Account.LastConnectionDate,
                };
                Client.Character.setCharacterGuild(member);
                Guild.Register(Client);
                Guild.AddPlayer(Client.GetCharacter().getCharacterGuild(), GuildGradeEnum.GRADE_ESSAI);


                CharactersGuildTable.Add(member);

                Client.GetCharacter().getCharacterGuild().SendGuildSettingsInfos();

                Client.Send(new GuildJoinMessage('K', GuildJoinReason.REASON_JOIN_ACCEPT));

                Client.EndGameAction(GameActionTypeEnum.BASIC_REQUEST);

                Client.GetCharacter().RefreshOnMap();
            }
        }
예제 #2
0
        public void LevelUP()
        {
            if (this.Level == ExpFloorTable.Cache.Count)
            {
                return;
            }
            this.Level++;
            this.CaractPoint += 5;
            this.SpellPoint++;
            this.Life = this.MaxLife;
            if (this.Level == 100)
            {
                this.AP++;
                this.myStats.AddBase(EffectEnum.AddPA, 1);
            }
            this.mySpells.GenerateLevelUpSpell((ClassEnum)this.Classe, this.Level);
            this.Experience = ExpFloorTable.GetFloorByLevel(this.Level).Character;

            if (this.HasGuild())
            {
                this.getCharacterGuild().Level = this.Level;
                CharactersGuildTable.Add(this.getCharacterGuild());
            }
        }
예제 #3
0
        private static void ProcessGuildCreateRequest(WorldClient Client, string Packet)
        {
            if (!Client.IsGameAction(GameActionTypeEnum.GUILD_CREATE))
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            if (!Packet.Contains('|'))
            {
                Client.Send(new GuildCreateMessage(false, "a"));
                return;
            }

            var GuildInfos = Packet.Substring(2).Split('|');

            if (GuildInfos.Length != 5)
            {
                Client.Send(new GuildCreateMessage(false, "a"));
                return;
            }

            var BackGroundId    = StringHelper.EncodeBase36(int.Parse(GuildInfos[0]));
            var BackGroundColor = StringHelper.EncodeBase36(int.Parse(GuildInfos[1]));

            var EmblemId    = StringHelper.EncodeBase36(int.Parse(GuildInfos[2]));
            var EmblemColor = StringHelper.EncodeBase36(int.Parse(GuildInfos[3]));

            var FullEmblem = BackGroundId + "," + BackGroundColor + "," + EmblemId + "," + EmblemColor;

            var GuildName = GuildInfos[4];

            if (GuildTable.Contains(GuildName) || GuildName.Length > 20)
            {
                Client.Send(new GuildCreateMessage(false, "an"));
                return;
            }

            var Guild = GuildTable.TryCreateGuild(Client, GuildName, FullEmblem);

            if (Guild == null)
            {
                Client.Send(new GuildCreateMessage(false, "an"));
                return;
            }

            Guild.CharactersGuildCache = new List <CharacterGuild>();

            var member = new CharacterGuild()
            {
                ID                = Client.Character.ID,
                Name              = Client.Character.Name,
                Level             = Client.Character.Level,
                Gfx               = Client.Character.Look,
                ExperiencePercent = 0,
                Experience        = 0,
                Alignement        = Client.Character.Alignement,
                lastConnection    = Client.Account.LastConnectionDate,
            };

            Guild.AddPlayer(member, GuildGradeEnum.GRADE_BOSS);
            Guild.Register(Client);
            Client.Character.setCharacterGuild(member);
            CharactersGuildTable.Add(member);

            Client.GetCharacter().getCharacterGuild().SendGuildSettingsInfos();

            Client.EndGameAction(GameActionTypeEnum.GUILD_CREATE);

            Client.GetCharacter().RefreshOnMap();
        }