예제 #1
0
 public void JoinGuild(RealmTime t, JoinGuildPacket pkt)
 {
     Database db = new Database();
     GuildStruct gStruct = db.GetGuild(pkt.GuildName);
     if (psr.Player.Invited == false)
     {
         SendInfo("You need to be invited to join a guild!");
     }
     if (gStruct != null)
     {
         Guild g = db.ChangeGuild(psr.Account, gStruct.Id, 0, false);
         if (g != null)
         {
             psr.Account.Guild = g;
             Guild = g.Name;
             GuildRank = g.Rank;
             UpdateCount++;
             foreach (var p in RealmManager.GuildMembersOf(g.Name))
             {
                 p.Client.SendPacket(new TextPacket()
                 {
                     BubbleTime = 0,
                     Stars = -1,
                     //Name = "@" + psr.Account.Name + " has joined the guild!"
                     Name = "",
                     Recipient = "*Guild*",
                     Text = psr.Account.Name + " has joined the guild!"
                 });
             }
         }
     }
 }