Next scroll down to public Guild(BinaryReader BR) and under
Wins = BR.ReadUInt32();
insert this
Code:
int a = BR.ReadInt32();
{
for (int i = 0; i < a; i++)
Allies.Add(BR.ReadUInt32(), BR.ReadString());
}
int e = BR.ReadInt32();
{
for (int i = 0; i < e; i++)
Enemies.Add(BR.ReadUInt32(), BR.ReadString());
}
And bam, loading and saving.
To add to the dictionary it is GuildID then GuildName.
I don't know either man :/
But it didn't work till I did that.
I would keep getting "Cannot read to end of stream." error.
But once I did that, it worked.
The NPC you already have should be fine for the allys/enemys just add this code into the NPC under Disband. Not sure if this will work for you but it works for me and has done for a while now. All you should need to do is change a few things.
NOTE! : This is JUST Allys you should be able to work out enemys for yourself.
Code:
#region Ally
if (option == 20)
{
Say("Who would you like to ally?", GC);
Link2("Ally", 21, GC);
Done(30, GC);
}
if (option == 21)
if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == MayaCo.Features.GuildRank.GuildLeader)
{
string Ally = ReadString(Data);
foreach (Features.Guild g in Features.Guilds.AllTheGuilds.Values)
{
if (g.GuildName == Ally)
{
if (g.Creator.Info != null)
{
if (g.Creator.Info.MyTeam.Members.Contains(GC.MyChar.EntityID))
{
if (!GC.MyChar.MyGuild.Allies.ContainsValue(Ally))
{
GC.MyChar.MyGuild.AddAlly(Ally);
GC.AddSend(Packets.String(g.GuildID, 21, Ally));
Say(g.GuildName + " is now your ally!", GC);
Link("Thanks.", 255, GC);
}
else
{
Say(g.GuildName + " is already your ally.", GC);
Link("Damn.", 255, GC);
}
}
else
{
Say("Make sure the guild leader of the Features guild is in your team.", GC);
Link("Okay", 255, GC);
}
}
}
}
break;
}
#endregion
If this doesn't work for you I will recode it using Tanels source.
[Problem]Guild Allies and Enemies 08/16/2010 - CO2 Private Server - 2 Replies Well after two days of having a go at this, and one day of asking people for help, I finally decided it was time to ask the community for help.
Well I am trying to load allies from the Guilds.dat file.
They are defined as public Dictionary<uint, string> Allies = new Dictionary<uint, string>();
When something is added to the dictionary its like this.
Allies.Add(GuildID, GuildName);
Now when saving to the guild.dat file, its saved like this.
BW.Write((int)Allies.Count);
...
allies and enemies 03/31/2010 - CO2 Private Server - 1 Replies Anybody know if Guild Allie and Enemy code is released for LOTF?
The status are added, but not codes for npc.
And im to lazy to make it, so if is not released ill just leave it untill i got time to make it ^^
Thanks
[Help]Guild Allies 02/14/2010 - CO2 Private Server - 9 Replies could someone help me with allies this is what i have so far
if (MyChar.GuildPosition == 100)
{
if (MyChar.MyGuild.Allies.Count <= 6)
{
string Allies = "";
for (int i = 14; i < 14 + Data; i++)
{
Allies +=...
[Question]Guild Allies 02/02/2010 - CO2 Private Server - 0 Replies could someone help me with adding allies
its for 5017
guild and allies 12/29/2007 - CO2 Weapon, Armor, Effects & Interface edits - 0 Replies hi all
i was thinking
does anyone know if its possible to make allie colors yellow and guild green
cause i like the green more
grtz