[code]#region Adding Enemies
string Name = ""; for (int i = 14; i < 14 + Data[13]; i++) { Name += Convert.ToChar(Data[i]); }
if (GC.MyChar.MyGuild.Enemies.Count < 5)
{
foreach (KeyValuePair<int, Struct.Guilds> Guilds in Guilds)
{
Struct.Guilds TGuild = Guilds.Value;
if (TGuild.Name != GC.MyChar.MyGuild.GuildID)
{
if (!GC.MyChar.MyGuild.Enemies.Contains(TGuild.ID))
{
if (TGuild.Name == Name)
{
Struct.Guilds GuildUpdate = NewestCoServer.Guilds[GC.MyChar.MyGuild];
GuildUpdate.Enemies.Add(TGuild.ID, TGuild);
GC.AddSend(Packets.NPCSay("Done."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
Database.database.UpdateGuild(GC.MyChar.MyGuild);
foreach (GC Socket in Database.ClientPool.Values)
{
string[] Names = new string[1];
Names[0] = TGuild.Name;
Socket.GetType(NewestCoServer.String(Names, TGuild.ID, Struct.StringType.GuildEnemies, 1));
PacketHandler.Guild.SendGuildScreen(Socket);
}
}
}
else { GC.AddSend(Packets.NPCSay("This is guild already is your enemy."));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
}
}
else { GC.AddSend(Packets.NPCSay("You are full enemies."));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
#endregion
What do I need to put because I am changing the npc text etc but some of the things are puzzling to me especially such as this part >.< Just a few things that won`t accept >.<
I haven't used the source so it's hard for me to tell but from a purely structural level things seemed to make some sense (note: please use the [code] system properly.. makes everything infinitely more readable)
Huh@Korvacs? "This is the original I am attempting to make it work for 5165" I would have thought with the words GUILDS and ENEMIES it would have been obvious considering 5165 has no allies and enemies for guilds >.< In fairness my only posts recently have been for 5165.
Ok the original code is for coemuv2 thought checking through sources this would have been obvious since 5017 is completely different with no script liike this for GuildNPC. So far I have seen this code only once unless you count binaries.
This is the part that confuses me because I am not sure what the 5165 should read >.<
Ok cool I think I understand the code thing now Some of the words are not found in that little part now but I have no idea what the words should be >.<
Basically Database is fine but Database.database is not fine because database comes up as an issue. So the words causing me a problem in this little part would be Struct, Guilds, NewestCoServer, Getstats and ClientPool
Database.Database is because you are converting it from a CoEmu source that has a folder named Database with a .cs file in it named Database.cs (therefore Database.Database.functionname)
Where is your guild structures handled? again, CoEmu has a folder named Struct>Guilds.cs for handling guild structures.
basically you just need to link the problem areas up with where the code exists in your source. client pool would indicate all connected clients, easiest way to find that would be to find where new connections are being accepted. Once authenticated/logged in fully they should be being added to a client thread... Client Pool I am 90 pct sure refers to what it is called in CoEmu but it should still function similarly
Ahhhhhhhhhh so I need it to be something like Database.Features.functionname? Ok so I have Guilds.cs in Features but I also have Guild stuff in Database.cs and Guild.cs in PacketHandling
Meh I give up I have absolutely no idea what is supposed to be where and when I try to change it well it just gives new errors >.<
Ahhhhhhhhhh so I need it to be something like Database.Features.functionname? Ok so I have Guilds.cs in Features but I also have Guild stuff in Database.cs and Guild.cs in PacketHandling
Meh I give up I have absolutely no idea what is supposed to be where and when I try to change it well it just gives new errors >.<
dont give up. try digging more. As I saw the converted codes.. seems like there are few Methods that you need to add in Guild.cs enable for it to work. maybe by adding some structs for allies and enemies. then modify the SaveGuild() method to add the info for allies and enemies... as will as the LoadGuild() and other affected methods in Guild.cs