예제 #1
0
 public void SetPlayer(World.Network.WorldClient client)
 {
     Player = client;
     if (Memory == null)
     {
         Memory = new Interop.Cache.PersistCache(Interop.Cache.PersistCache.CachePath + this.Nickname + ".character.cache");
     }
     if (GuildID != 0)
     {
         World.Game.Guilds.Guild guild = World.Helper.GuildHelper.GetGuild(GuildID);
         if (guild != null)
         {
             Player.Action.Guild       = guild;
             Player.Action.GuildMember = guild.FindMember(this.ID);
         }
     }
 }
예제 #2
0
        private void CreateGuild(string datas)
        {
            //TODO VERIF IF HAST THE CLIENT A GILDAOGEME

            if (Client.Player.Guild != null)
            {
                Client.Player.NClient.Send("Ea");
                return;
            }

            var infos = datas.Split('|');

            if (infos.Length < 5)
            {
                Client.Send("BN");
                return;
            }

            if (infos[0].Contains("-"))
                infos[0] = "1";
            if (infos[1].Contains("-"))
                infos[1] = "0";
            if (infos[2].Contains("-"))
                infos[2] = "1";
            if (infos[3].Contains("-"))
                infos[3] = "0";

            var bgID = 0;
            var bgColor = 0;
            var embID = 0;
            var embColor = 0;

            if (!int.TryParse(infos[0], out bgID) || !int.TryParse(infos[1], out bgColor) ||
                !int.TryParse(infos[2], out embID) || !int.TryParse(infos[3], out embColor))
            {
                Client.Send("BN");
                return;
            }

            if (infos[4].Length > 15 || Entities.Requests.GuildsRequest.GuildsList.Any(x => x.Name == infos[4]))
            {
                Client.Player.NClient.Send("Ean");
                return;
            }

            var ID = (Entities.Requests.GuildsRequest.GuildsList.Count < 1 ? 1 : Entities.Requests.GuildsRequest.GuildsList.OrderByDescending(x => x.ID).ToArray()[0].ID + 1);

            var guild = new World.Game.Guilds.Guild()
            {
                ID = ID,
                Name = infos[4],
                BgID = bgID,
                BgColor = bgColor,
                EmbID = embID,
                EmbColor = embColor,
                Exp = 0,
                Level = 1,
                CollectorMax = 1,
                CollectorProspection = 0,
                CollectorWisdom = 0,
                CollectorPods = 0,
                IsNewGuild = true
            };

            guild.AddMember(new Game.Guilds.GuildMember(Client.Player));

            guild.Spells.Add(462, 1);
            guild.Spells.Add(461, 1);
            guild.Spells.Add(460, 1);
            guild.Spells.Add(459, 1);
            guild.Spells.Add(458, 1);
            guild.Spells.Add(457, 1);
            guild.Spells.Add(456, 1);
            guild.Spells.Add(455, 1);
            guild.Spells.Add(454, 1);
            guild.Spells.Add(453, 1);
            guild.Spells.Add(452, 1);
            guild.Spells.Add(451, 1);

            Client.Send(string.Format("gS{0}|{1}|{2}", guild.Name, guild.Emblem.Replace(",", "|"), Utilities.Basic.ToBase36(guild.Members[0].Rights)));
            Client.Send("gV");

            Entities.Requests.GuildsRequest.GuildsList.Add(guild);

            //REMOVE GILDAOGEME
        }