Quote:
Originally Posted by shadowman123
Guild Data packet ?? Do u mean packet 1106 ?
|
Yes. And if I remember right, you also have to send a string packet corresponding to whether the guild is neutral, enemy, or ally. If you don't do that, the client won't know what color to make the name.
Edit: You send the ally/enemy info on login. Here's what I sent when a character logged on in my old 4274 source (might be buggy..)
Code:
public static void SendGuildInfo(EndClient Client)
{
if (Client.Char.Guild == 0)
{
Client.Send(GamePackets.Guild(Client));
return;
}
if (Pool.ContainsKey(Client.Char.Guild))
{
Guild MyGuild = Pool[Client.Char.Guild];
Client.Send(GamePackets.Guild(Client));
Client.Send(GamePackets.String(MyGuild.GuildID, MyGuild.Name, (int)StringType.GuildName));
Client.Send(GamePackets.Chat(Convert.ToString(MyGuild.GuildID), Client.Char.Name, MyGuild.Bulletin, 0, ChatType.GuildBulletin));
foreach (Guild G in Pool.Values)
{
if (G.GuildID != Client.Char.Guild)
{
Client.Send(GamePackets.GuildData(GuildType.Neutral, G.GuildID));
if (MyGuild.EnemyList.Contains(G.GuildID))
{
Guild EnemyGuild = Pool[G.GuildID];
Client.Send(GamePackets.String(G.GuildID, EnemyGuild.Name, (int)StringType.GuildEnemies));
Client.Send(GamePackets.GuildData(GuildType.Enemied, G.GuildID));
}
if (MyGuild.AllyList.Contains(G.GuildID))
{
Guild AllyGuild = Pool[G.GuildID];
Client.Send(GamePackets.String(G.GuildID, AllyGuild.Name, (int)StringType.GuildAllies));
Client.Send(GamePackets.GuildData(GuildType.Allied, G.GuildID));
}
}
}
}
}
Edit: Also, obviously, it would have been better to loop through the ally list and enemy list instead of the whole pool, but I wasn't too bright back then.