Save Guild Enemies/Allies

12/05/2010 12:38 Syst3m_W1z4rd#121
Delete the bracket under break;
You have 2 brackets under it, where ur only supposed to have 1 :)
12/05/2010 13:37 denominator#122
Agreed but now I get "} expected" error along with 301 more errors and all because of that dumb } lol. By the way it works on my NPC that I created but it just won`t work for the guild NPC >.<
12/05/2010 16:12 .Beatz#123
Quote:
Originally Posted by denominator View Post
Agreed but now I get "} expected" error along with 301 more errors and all because of that dumb } lol. By the way it works on my NPC that I created but it just won`t work for the guild NPC >.<
add me on msn I will help you out over TV if you have it.

You need that extra curley bracket but you are adding it in the wrong place by the looks of it.
12/05/2010 16:25 denominator#124
I don`t have TV on this comp yet I had it for my laptop but haven`t got around to putting it on here lol. Well it`s not to important yet but I will take you up on that offer :) For now I should really get my head down. Been far to busy again through the night and had headache earlier so took a headache pill and carried on but I really should get some sleep.

I assume .Beatz you`re a Brit like me? If so will you be awake through the night? I`m a night creature rather than a day creature lol.
12/05/2010 18:43 .Beatz#125
Quote:
Originally Posted by denominator View Post
I don`t have TV on this comp yet I had it for my laptop but haven`t got around to putting it on here lol. Well it`s not to important yet but I will take you up on that offer :) For now I should really get my head down. Been far to busy again through the night and had headache earlier so took a headache pill and carried on but I really should get some sleep.

I assume .Beatz you`re a Brit like me? If so will you be awake through the night? I`m a night creature rather than a day creature lol.
Yeah I am a Brit and yeah I will be on for most of the night... well until about 2 maybe 3 soo I will talk to you a bit later
12/06/2010 01:06 denominator#126
Ok well I had a few hours sleep and am back now :) I really want to try to work this one out for myself but will only resort to TV when I am on the floor in tears because it just won`t work rofl.

This works
Code:
#region Guild NPC allied&enemied
                            case 19999:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("I am what my name says. I create and manage guilds. So what do you want to do?"));
                                        GC.AddSend(Packets.NPCLink("Create Allies", 1));
                                        GC.AddSend(Packets.NPCLink("Create Enemies", 3));
                                        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                        #region Ally
                                        if (Control == 1)
                                        {
                                            GC.AddSend(Packets.NPCSay("Who would you like to Ally?"));
                                            GC.AddSend(Packets.NPCLink2("Ally", 21));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        if (Control == 21)
                                        {
                                            if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.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.Allies.Add(0, Ally);
                                                                    GC.AddSend(Packets.String(g.GuildID, 21, Ally));
                                                                    GC.AddSend(Packets.NPCSay(g.GuildName + " is now your ally!"));
                                                                    GC.AddSend(Packets.NPCLink("Thanks.", 255));
                                                                    GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                                    GC.AddSend(Packets.NPCFinish());
                                                                }
                                                                else
                                                                {
                                                                    GC.AddSend(Packets.NPCSay(g.GuildName + " is already allied."));
                                                                    GC.AddSend(Packets.NPCLink("Oh alright.", 255));
                                                                    GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                                    GC.AddSend(Packets.NPCFinish());
                                                                }
                                                            }
                                                            else
                                                            {
                                                                GC.AddSend(Packets.NPCSay("Make sure the guild leader of the Features guild is in your team."));
                                                                GC.AddSend(Packets.NPCLink("Okay", 255));
                                                            }
                                                        }
                                                    }
                                                }
                                                break;
                                            }
                                        }
                                        #endregion
                                        #region Enemy
                                        if (Control == 3)
                                        {
                                            GC.AddSend(Packets.NPCSay("Who would you like to Enemy?"));
                                            GC.AddSend(Packets.NPCLink2("Enemy", 23));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        if (Control == 23)
                                        {
                                            if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                            {
                                                string Enemy = ReadString(Data);
                                                foreach (Features.Guild g in Features.Guilds.AllTheGuilds.Values)
                                                {
                                                    if (g.GuildName == Enemy)
                                                    {
                                                        if (g.Creator.Info != null)
                                                        {
                                                                if (!GC.MyChar.MyGuild.Enemies.ContainsValue(Enemy))
                                                                {
                                                                    GC.MyChar.MyGuild.Enemies.Add(0, Enemy);
                                                                    GC.AddSend(Packets.String(g.GuildID, 21, Enemy));
                                                                    GC.AddSend(Packets.NPCSay(g.GuildName + " is now your enemy!"));
                                                                    GC.AddSend(Packets.NPCLink("Thanks.", 255));
                                                                    GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                                    GC.AddSend(Packets.NPCFinish());
                                                                }
                                                                else
                                                                {
                                                                    GC.AddSend(Packets.NPCSay(g.GuildName + " is already enemied."));
                                                                    GC.AddSend(Packets.NPCLink("Oh alright.", 255));
                                                                    GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                                    GC.AddSend(Packets.NPCFinish());
                                                                }
                                                            }
                                                            else
                                                            {
                                                                GC.AddSend(Packets.NPCSay("Make sure the guild leader of the Features guild is in your team."));
                                                                GC.AddSend(Packets.NPCLink("Okay", 255));
                                                            }
                                                        }
                                                    }
                                                }
                                                break;
                                        }
                                        #endregion
        
                                    break;
                                }
                                #endregion
BUT if I try to add it to the correct NPC then it doesn`t open the box for me to add allies or enemies?

This is my GuildNPC without the allies and enemies thing in. GuildNPC works apart from this.
Code:
#region Guild NPC
                            case 10003:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("I am what my name says. I create and manage guilds. So what do you want to do?"));
                                        GC.AddSend(Packets.NPCLink("Create Guild", 1)); 
                                        GC.AddSend(Packets.NPCLink("Deputize", 3));
                                        GC.AddSend(Packets.NPCLink("Disband my guild", 5));
                                        //GC.AddSend(Packets.NPCLink("Allies", 7));
                                        //GC.AddSend(Packets.NPCLink("Enemies", 9));
                                        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    #region Create
                                    else if (Control == 1)
                                    {
                                        if (GC.MyChar.MyGuild == null)
                                        {
                                            GC.AddSend(Packets.NPCSay("I don't know why, but you have to be level 95 or higher and need 1 million silvers to create one."));
                                            GC.AddSend(Packets.NPCLink2("Create", 2));
                                            GC.AddSend(Packets.NPCLink("No, i changed my mind.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are already in a guild. You cannot create a guild."));
                                            GC.AddSend(Packets.NPCLink("Oh, i forgot...", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 2)
                                    {
                                        if (GC.MyChar.Level >= 95 && GC.MyChar.MyGuild == null)
                                        {
                                            if (GC.MyChar.Silvers >= 1000000)
                                            {
                                                string GuildName = ReadString(Data);
                                                if (Features.Guilds.ValidName(GuildName))
                                                {
                                                    GC.MyChar.Silvers -= 1000000;
                                                    ushort NewGuildID = (ushort)Rnd.Next(ushort.MaxValue);
                                                    while (Features.Guilds.AllTheGuilds.Contains(NewGuildID))
                                                        NewGuildID = (ushort)Rnd.Next(ushort.MaxValue);
                                                    Features.Guilds.CreateNewGuild(GuildName, NewGuildID, GC.MyChar);
                                                    Game.World.Spawn(GC.MyChar, false);

                                                    GC.AddSend(Packets.GuildInfo(GC.MyChar.MyGuild, GC.MyChar));
                                                    GC.AddSend(Packets.String(GC.MyChar.MyGuild.GuildID, (byte)Game.StringType.GuildName, GC.MyChar.MyGuild.GuildName));

                                                    GC.AddSend(Packets.NPCSay("Congratulations! You now have your own guild."));
                                                    GC.AddSend(Packets.NPCLink("Thanks.", 255));
                                                    GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                    GC.AddSend(Packets.NPCFinish());
                                                }
                                                else
                                                {
                                                    GC.AddSend(Packets.NPCSay("Choose another name, this name is taken or has invalid length."));
                                                    GC.AddSend(Packets.NPCLink2("Create", 2));
                                                    GC.AddSend(Packets.NPCLink("I changed my mind.", 255));
                                                    GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                    GC.AddSend(Packets.NPCFinish());
                                                }
                                            }
                                            else
                                            {
                                                GC.AddSend(Packets.NPCSay("I said you need 1 million silvers and you don't have enough."));
                                                GC.AddSend(Packets.NPCLink("Ok ok, i'll go bring the money.", 255));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("Forget it! You're too weak."));
                                            GC.AddSend(Packets.NPCLink("Alright, i will get stronger.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    #endregion
                                    #region Deputize
                                    else if (Control == 3)
                                    {
                                        if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            GC.AddSend(Packets.NPCSay("Insert the name of the player in your guild you want to make a deputy leader."));
                                            GC.AddSend(Packets.NPCLink2("Here", 4));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not a guild leader."));
                                            GC.AddSend(Packets.NPCLink("Silly me.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 4)
                                    {
                                        string PlayerName = ReadString(Data);
                                        Features.MemberInfo M = GC.MyChar.MyGuild.MembOfName(PlayerName);
                                        if (M != null && M.MembName == PlayerName && ((Hashtable)GC.MyChar.MyGuild.Members[(byte)90]).Count < 5)
                                        {
                                            M.Rank = NewestCOServer.Features.GuildRank.DeputyManager;
                                            ((Hashtable)GC.MyChar.MyGuild.Members[(byte)50]).Remove(M.MembID);
                                            ((Hashtable)GC.MyChar.MyGuild.Members[(byte)90]).Add(M.MembID, M);
                                            Game.Character C = M.Info;
                                            if (C != null)
                                            {
                                                C.GuildRank = NewestCOServer.Features.GuildRank.DeputyManager;
                                                Game.World.Spawn(C, false);
                                                C.MyClient.AddSend(Packets.GuildInfo(GC.MyChar.MyGuild, GC.MyChar));
                                            }
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("The player is not in your guild or is not a normal member. By the way, the max number deputy leaders there can be is 5."));
                                            GC.AddSend(Packets.NPCLink("Oh, sorry.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    #endregion
                                    #region Disband
                                    else if (Control == 5)
                                    {
                                        if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            GC.AddSend(Packets.NPCSay("Are you sure you want to disband your guild?"));
                                            GC.AddSend(Packets.NPCLink("Yes, i want to disband my guild.", 6));
                                            GC.AddSend(Packets.NPCLink("I've changed my mind.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not a guild leader, therefore you cannot disband a guild."));
                                            GC.AddSend(Packets.NPCLink("I see.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 6)
                                    {
                                        if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            GC.MyChar.MyGuild.Disband();
                                        }
                                    #endregion
                                    }
                                    break;
                                }
                                #endregion
It doesn`t throw any errors at all it just doesn`t open the box for me to put text in >.< I know I have areas in GuildNPC that are // but that`s because I have taken the rest of the code back out.

Also what should this be? I want a remove enemy :D
Code:
 GC.MyChar.MyGuild.Enemies.Remove(0, Enemy);
I also tried using the part that arco placed on here several pages ago but I get an error >.<
12/06/2010 11:47 .Beatz#127
Quote:
Originally Posted by denominator View Post
Ok well I had a few hours sleep and am back now :) I really want to try to work this one out for myself but will only resort to TV when I am on the floor in tears because it just won`t work rofl.

It doesn`t throw any errors at all it just doesn`t open the box for me to put text in >.< I know I have areas in GuildNPC that are // but that`s because I have taken the rest of the code back out.

Also what should this be? I want a remove enemy :D
Code:
 GC.MyChar.MyGuild.Enemies.Remove(0, Enemy);
I also tried using the part that arco placed on here several pages ago but I get an error >.<
Code:
else if (Control == 30)
                                    {
                                        if (GC.Char.GuildRank == GuildRank.GuildLeader)
                                        {
                                            Text("What is the Guild you would like to remove as an enemy?.", GC);
                                            Link2("Guild Name", 31, GC);
                                            Link("Just passing by", 255, GC);
                                            Face(30, GC);
                                            End(GC);
                                        }
                                        else
                                        {
                                            NpcSendMessage("You're not the guild leader!", N, GC);
                                        }
                                    }
                                    else if (Control == 61)
                                    {
                                        string name = ReadString(Data);
                                        Guild Enemy = null;
                                        #region read guild
                                        foreach (Guild G in Game.GameGuilds.Values)
                                        {
                                            if (G != null)
                                            {
                                                if (G.ID != GC.Char.Guild.ID)
                                                {
                                                    Enemy = G;
                                                }
                                            }
                                        }
                                        #endregion
This is my remove enemy code, I have no idea why it is not letting you type anything into the box... could you please post the packet of Link2?
12/06/2010 12:01 denominator#128
I would but I have no idea where to find that packet >.< Strangely enough though the chatbox comes up with my own NPC but still doesn`t friggin add the allies lmao. I mean I can write the name of the guild to ally BUT it just doesn`t ally the guilds?

Perhaps this is what you need?

Code:
case 2031:
                            {
                                GC.DialogNPC = BitConverter.ToUInt32(Data, 4);
                                PacketHandling.NPCDialog.Handle(GC, Data, GC.DialogNPC, 0);
                                break;
                            }
                        case 2032:
                            {
                                if (Data[10] != 0)
                                    PacketHandling.NPCDialog.Handle(GC, Data, GC.DialogNPC, Data[10]);
                                else
                                {
                                    byte NameLength = Data[13];
                                    string Name = "";
                                    for (byte i = 0; i < NameLength; i++)
                                        Name += Convert.ToChar(Data[14 + i]);

                                    if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)                                    
                                        GC.MyChar.MyGuild.MemberLeaves(Name, true);                                    
                                }
                                break;
                            }
12/06/2010 14:35 .Beatz#129

Also if you hit F12 on Link2 that will bring up a packet like this
Code:
 public static COPacket NPCLink2(string Text, byte DialNr)
        {
            byte[] Packet = new byte[8 + 17 + Text.Length];
            COPacket P = new COPacket(Packet);
            P.WriteInt16((ushort)(Packet.Length - 8));
            P.WriteInt16((ushort)0x7f0);
            P.Move(6);
            P.WriteByte(DialNr);
            P.WriteByte(0x03);
            P.WriteByte(0x01);
            P.WriteByte((byte)Text.Length);
            P.WriteString(Text);
            P.Move(3);

            return P;
        }
But since you can type it in then you wont need to add it... Use the code I pasted here it does work because it is from Arco (I think) and it works on my 5165 source...
12/06/2010 17:22 denominator#130
Thank you I will give it a whirl :) Ok I have converted what I could but for some of it I am lost or have confused myself >.<

Code:
//         #region Passing Leaderance
                           //         else if (Control == 7)
                           //         {
                            //            if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                            //            {
                            //                GC.AddSend(Packets.NPCSay("Who do you want to be the new Guild Leader?"));
                            //                GC.AddSend(Packets.NPCLink2("Will be...", 8));
                           //                 GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                            //                Face(N.Avatar, GC);
                            //                End(GC);
                            //            }
                            //            else
                            //            {
                            //                Text("You're not the guild leader!", GC);
                            //                Link("I see", 255, GC);
                           //                 Face(N.Avatar, GC);
                          //                  End(GC);
                          //              }
                          //          }
                          //          else if (Control == 8)
                           //         {
                           //             string NewLeader = ReadString(Data);
                          //              Character Char = null;
                         //               Guild G = GuildName[GC.MyChar.MyGuild.GuildID];
                         //               if (NewLeader == GC.MyChar.Name)
                         //               {
                         //                   Text("You can't pass the leadership to yourself!", GC);
                         //                   Link("I see", 255, GC);
                         //                   Face(N.Avatar, GC);
                        //                    End(GC);
                        //                    return;
                        //                }
                        //                foreach (Game.Character Target in World.H_Chars.Values)
                        //                {
                       //                     if (Game.Character.Name == NewLeader)
                       //                         Char = Cli.Char;
                       //                 }
                       //                 if (Char != null)
                       //                 {
                        //                    if (G.Members.ContainsKey(Char.EntityID))
                        //                    {
                       //                         Features.MemberInfo M = NewestCOServer.Features.Guilds.ValidName[Char.EntityID];
                       //                         M.Rank = NewestCOServer.Features.GuildRank.GuildLeader;
                       //                         Char.GuildRank = NewestCOServer.Features.GuildRank.GuildLeader;
                       //                         GC.MyChar.GuildRank = NewestCOServer.Features.GuildRank.Member;
                       //                         Game.World.Spawn(Char, false);
                       //                         Char.MyClient.AddSend(Packets.GuildInfo(Char.MyGuild, Char));
                       //                     }
                      //                      else
                      //                      {
                      //                          Text("You don't have a member with that name or the member isn't online!", GC);
                      //                          Link("I see", 255, GC);
                      //                          Face(N.Avatar, GC);
                      //                          End(GC);
                      //                          return;
                      //                      }
                      //                  }
                      //                  else
                      //                  {
                      //                      Text("You don't have a member with that name or the member isn't online!", GC);
                     //                       Link("I see", 255, GC);
                     //                       Face(N.Avatar, GC);
                     //                       End(GC);
                    //                        return;
                    //                    }
                    //                }
                    //                #endregion
                                    #region Enemy
                                    else if (Control == 9)
                                    {
                                        if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            Text("Please, tell me the guild name.", GC);
                                            GC.AddSend(Packets.NPCLink2("Guild Name", 50));
                                            Link("Just passing by", 255, GC);
                                            Face(N.Avatar, GC);
                                            End(GC);
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You're not the guild leader... Please leave me!"));
                                        }
                                    }
                                    else if (Control == 50)
                                    {
                                        string name = ReadString(Data);
                                        Guild Enemy = null;
                                        #region read guild
                                        foreach (Guild G in Game.GameGuilds.Values)
                                        {
                                            if (G != null)
                                            {
                                                if (G.ID != GC.Char.Guild.ID)
                                                {
                                                    Enemy = G;
                                                }
                                            }
                                        }
                                        #endregion

                                        if (Enemy == null)
                                        {
                                            GC.AddSend(Packets.NPCSay("Hmmm... This guild name is invalid, doesn't exist a guild with that name!"));
                                        }
                                        else
                                        {
                                            if (!GC.MyChar.MyGuild.Enemies.ContainsKey(Enemy.GuildID))
                                                GC.MyChar.MyGuild.Enemies.Add(Enemy.GuildID, 0);

                                            Database.NewEnemy(GC.MyChar.MyGuild.GuildID, Enemy.GuildID);
                                            Game.World.Spawns(GC.MyChar, false);
                                        }
                                    }
                                    else if (Control == 60)
                                    {
                                        if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            Text("Please, tell me the guild name.", GC);
                                            GC.AddSend(Packets.NPCLink2("Guild Name", 61));
                                            Link("Just passing by", 255, GC);
                                            Face(N.Avatar, GC);
                                            End(GC);
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You're not the guild leader... Please leave me!"));
                                        }
                                    }
                                    else if (Control == 61)
                                    {
                                        string name = ReadString(Data);
                                        Guild Enemy = null;
                                        #region read guild
                                        foreach (Guild G in Game.GameGuilds.Values)
                                        {
                                            if (G != null)
                                            {
                                                if (G.ID != GC.Char.Guild.ID)
                                                {
                                                    Enemy = G;
                                                }
                                            }
                                        }
                                        #endregion

                                        if (Enemy == null)
                                        {
                                            GC.AddSend(Packets.NPCSay("Hmmm... This guild name is invalid, doesn't exist a guild with that name!"));
                                        }
                                        else
                                        {
                                            if (GC.MyChar.MyGuild.Enemies.ContainsKey(Enemy.GuildID))
                                            {
                                                GC.MyChar.MyGuild.Enemies.Remove(Enemy.GuildID);
                                                Database.DeleteEnemy(GC.MyChar.MyGuild.GuildID, Enemy.GuildID);
                                            }
                                            Game.World.Spawns(GC.MyChar, false);
                                        }
                                    }
                                    #endregion
                                    #region Ally
                                    else if (Control == 12)
                                    {
                                        if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            if (GC.MyChar.MyTeam != null && GC.MyChar.TeamLeader)
                                            {
                                                foreach (Character C in GC.MyChar.MyTeam.Members)
                                                {
                                                    if (C.EntityID != GC.MyChar.EntityID)
                                                    {
                                                        if (Calculate.InBox(GC.MyChar.Loc.X, GC.MyChar.Loc.Y, C.Loc.X, C.Loc.Y, 15))
                                                        {
                                                            if (C.MyGuild != null && C.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                                            {
                                                                Guild my = GC.MyChar.Guild;
                                                                Guild ally = C.MyGuild;
                                                                if (!my.Allies.ContainsKey(ally.ID) && !ally.Allies.ContainsKey(my.GuildID))
                                                                {
                                                                    try
                                                                    {
                                                                        my.Allies.Add(ally.ID, 0);
                                                                        ally.Allies.Add(my.ID, 0);
                                                                    }
                                                                    catch { }
                                                                    Database.NewAlly(my.ID, ally.ID);
                                                                    Database.NewAlly(ally.ID, my.ID);
                                                                    Actions.Spawns(GC.Char, false);
                                                                    Actions.Spawns(C, false);
                                                                    break;
                                                                }
                                                                else
                                                                {
                                                                    GC.AddSend(Packets.NPCSay("This guild is already your ally!"));
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                GC.AddSend(Packets.NPCSay("Make a team first!"));
                                            }
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You're not the guild leader... Please leave me!"));
                                        }
                                    }
                                    else if (Control == 62)
                                    {
                                        if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            Text("Please, tell me the guild name.", GC);
                                            GC.AddSend(Packets.NPCLink2("Guild Name", 63));
                                            Link("Just passing by", 255, GC);
                                            Face(N.Avatar, GC);
                                            End(GC);
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You're not the guild leader... Please leave me!"));
                                        }
                                    }
                                    else if (Control == 63)
                                    {
                                        string name = ReadString(Data);
                                        Guild Ally = null;
                                        #region read guild
                                        foreach (Guild G in Game.GameGuilds.Values)
                                        {
                                            if (G != null)
                                            {
                                                if (G.ID != GC.Char.Guild.ID)
                                                {
                                                    Ally = G;
                                                }
                                            }
                                        }
                                        #endregion

                                        if (Ally == null)
                                        {
                                            GC.AddSend(Packets.NPCSay("Hmmm... This guild name is invalid, doesn't exist a guild with that name!"));
                                        }
                                        else
                                        {
                                            if (GC.MyChar.MyGuild.Allies.ContainsKey(Ally.GuildID))
                                            {
                                                GC.MyChar.MyGuild.Allies.Remove(Ally.GuildID);
                                                Database.DeleteAlly(GC.MyChar.MyGuild.GuildID, Ally.GuildID);
                                            }
                                            Game.World.Spawns(GC.MyChar, false);
                                        }
                                    }
                                    #endregion
                                    else if (Control == 13)
                                    {
                                        Text("I am what my name says. I help create and manage guilds. So what do you want to do?", GC);
                                        Link("Ally to a guild", 12, GC);
                                        Link("Remove Ally", 62, GC);
                                        Link("Enemy to a guild", 9, GC);
                                        Link("Remove Enemy", 60, GC);
                                        Link("Just passing by", 255, GC);
                                        Face(N.Avatar, GC);
                                        End(GC);
                                    }
                                    break;
                                }
                            #endregion
I`m sure there are probably some people laughing at me but meh lol
12/06/2010 19:11 .Beatz#131
Quote:
Originally Posted by denominator View Post
Thank you I will give it a whirl :) Ok I have converted what I could but for some of it I am lost or have confused myself >.<

Code:
//         #region Passing Leaderance
                           //         else if (Control == 7)
                           //         {
                            //            if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                            //            {
                            //                GC.AddSend(Packets.NPCSay("Who do you want to be the new Guild Leader?"));
                            //                GC.AddSend(Packets.NPCLink2("Will be...", 8));
                           //                 GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                            //                Face(N.Avatar, GC);
                            //                End(GC);
                            //            }
                            //            else
                            //            {
                            //                Text("You're not the guild leader!", GC);
                            //                Link("I see", 255, GC);
                           //                 Face(N.Avatar, GC);
                          //                  End(GC);
                          //              }
                          //          }
                          //          else if (Control == 8)
                           //         {
                           //             string NewLeader = ReadString(Data);
                          //              Character Char = null;
                         //               Guild G = GuildName[GC.MyChar.MyGuild.GuildID];
                         //               if (NewLeader == GC.MyChar.Name)
                         //               {
                         //                   Text("You can't pass the leadership to yourself!", GC);
                         //                   Link("I see", 255, GC);
                         //                   Face(N.Avatar, GC);
                        //                    End(GC);
                        //                    return;
                        //                }
                        //                foreach (Game.Character Target in World.H_Chars.Values)
                        //                {
                       //                     if (Game.Character.Name == NewLeader)
                       //                         Char = Cli.Char;
                       //                 }
                       //                 if (Char != null)
                       //                 {
                        //                    if (G.Members.ContainsKey(Char.EntityID))
                        //                    {
                       //                         Features.MemberInfo M = NewestCOServer.Features.Guilds.ValidName[Char.EntityID];
                       //                         M.Rank = NewestCOServer.Features.GuildRank.GuildLeader;
                       //                         Char.GuildRank = NewestCOServer.Features.GuildRank.GuildLeader;
                       //                         GC.MyChar.GuildRank = NewestCOServer.Features.GuildRank.Member;
                       //                         Game.World.Spawn(Char, false);
                       //                         Char.MyClient.AddSend(Packets.GuildInfo(Char.MyGuild, Char));
                       //                     }
                      //                      else
                      //                      {
                      //                          Text("You don't have a member with that name or the member isn't online!", GC);
                      //                          Link("I see", 255, GC);
                      //                          Face(N.Avatar, GC);
                      //                          End(GC);
                      //                          return;
                      //                      }
                      //                  }
                      //                  else
                      //                  {
                      //                      Text("You don't have a member with that name or the member isn't online!", GC);
                     //                       Link("I see", 255, GC);
                     //                       Face(N.Avatar, GC);
                     //                       End(GC);
                    //                        return;
                    //                    }
                    //                }
                    //                #endregion
                                    #region Enemy
                                    else if (Control == 9)
                                    {
                                        if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            Text("Please, tell me the guild name.", GC);
                                            GC.AddSend(Packets.NPCLink2("Guild Name", 50));
                                            Link("Just passing by", 255, GC);
                                            Face(N.Avatar, GC);
                                            End(GC);
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You're not the guild leader... Please leave me!"));
                                        }
                                    }
                                    else if (Control == 50)
                                    {
                                        string name = ReadString(Data);
                                        Guild Enemy = null;
                                        #region read guild
                                        foreach (Guild G in Game.GameGuilds.Values)
                                        {
                                            if (G != null)
                                            {
                                                if (G.ID != GC.Char.Guild.ID)
                                                {
                                                    Enemy = G;
                                                }
                                            }
                                        }
                                        #endregion

                                        if (Enemy == null)
                                        {
                                            GC.AddSend(Packets.NPCSay("Hmmm... This guild name is invalid, doesn't exist a guild with that name!"));
                                        }
                                        else
                                        {
                                            if (!GC.MyChar.MyGuild.Enemies.ContainsKey(Enemy.GuildID))
                                                GC.MyChar.MyGuild.Enemies.Add(Enemy.GuildID, 0);

                                            Database.NewEnemy(GC.MyChar.MyGuild.GuildID, Enemy.GuildID);
                                            Game.World.Spawns(GC.MyChar, false);
                                        }
                                    }
                                    else if (Control == 60)
                                    {
                                        if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            Text("Please, tell me the guild name.", GC);
                                            GC.AddSend(Packets.NPCLink2("Guild Name", 61));
                                            Link("Just passing by", 255, GC);
                                            Face(N.Avatar, GC);
                                            End(GC);
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You're not the guild leader... Please leave me!"));
                                        }
                                    }
                                    else if (Control == 61)
                                    {
                                        string name = ReadString(Data);
                                        Guild Enemy = null;
                                        #region read guild
                                        foreach (Guild G in Game.GameGuilds.Values)
                                        {
                                            if (G != null)
                                            {
                                                if (G.ID != GC.Char.Guild.ID)
                                                {
                                                    Enemy = G;
                                                }
                                            }
                                        }
                                        #endregion

                                        if (Enemy == null)
                                        {
                                            GC.AddSend(Packets.NPCSay("Hmmm... This guild name is invalid, doesn't exist a guild with that name!"));
                                        }
                                        else
                                        {
                                            if (GC.MyChar.MyGuild.Enemies.ContainsKey(Enemy.GuildID))
                                            {
                                                GC.MyChar.MyGuild.Enemies.Remove(Enemy.GuildID);
                                                Database.DeleteEnemy(GC.MyChar.MyGuild.GuildID, Enemy.GuildID);
                                            }
                                            Game.World.Spawns(GC.MyChar, false);
                                        }
                                    }
                                    #endregion
                                    #region Ally
                                    else if (Control == 12)
                                    {
                                        if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            if (GC.MyChar.MyTeam != null && GC.MyChar.TeamLeader)
                                            {
                                                foreach (Character C in GC.MyChar.MyTeam.Members)
                                                {
                                                    if (C.EntityID != GC.MyChar.EntityID)
                                                    {
                                                        if (Calculate.InBox(GC.MyChar.Loc.X, GC.MyChar.Loc.Y, C.Loc.X, C.Loc.Y, 15))
                                                        {
                                                            if (C.MyGuild != null && C.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                                            {
                                                                Guild my = GC.MyChar.Guild;
                                                                Guild ally = C.MyGuild;
                                                                if (!my.Allies.ContainsKey(ally.ID) && !ally.Allies.ContainsKey(my.GuildID))
                                                                {
                                                                    try
                                                                    {
                                                                        my.Allies.Add(ally.ID, 0);
                                                                        ally.Allies.Add(my.ID, 0);
                                                                    }
                                                                    catch { }
                                                                    Database.NewAlly(my.ID, ally.ID);
                                                                    Database.NewAlly(ally.ID, my.ID);
                                                                    Actions.Spawns(GC.Char, false);
                                                                    Actions.Spawns(C, false);
                                                                    break;
                                                                }
                                                                else
                                                                {
                                                                    GC.AddSend(Packets.NPCSay("This guild is already your ally!"));
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                GC.AddSend(Packets.NPCSay("Make a team first!"));
                                            }
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You're not the guild leader... Please leave me!"));
                                        }
                                    }
                                    else if (Control == 62)
                                    {
                                        if (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            Text("Please, tell me the guild name.", GC);
                                            GC.AddSend(Packets.NPCLink2("Guild Name", 63));
                                            Link("Just passing by", 255, GC);
                                            Face(N.Avatar, GC);
                                            End(GC);
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You're not the guild leader... Please leave me!"));
                                        }
                                    }
                                    else if (Control == 63)
                                    {
                                        string name = ReadString(Data);
                                        Guild Ally = null;
                                        #region read guild
                                        foreach (Guild G in Game.GameGuilds.Values)
                                        {
                                            if (G != null)
                                            {
                                                if (G.ID != GC.Char.Guild.ID)
                                                {
                                                    Ally = G;
                                                }
                                            }
                                        }
                                        #endregion

                                        if (Ally == null)
                                        {
                                            GC.AddSend(Packets.NPCSay("Hmmm... This guild name is invalid, doesn't exist a guild with that name!"));
                                        }
                                        else
                                        {
                                            if (GC.MyChar.MyGuild.Allies.ContainsKey(Ally.GuildID))
                                            {
                                                GC.MyChar.MyGuild.Allies.Remove(Ally.GuildID);
                                                Database.DeleteAlly(GC.MyChar.MyGuild.GuildID, Ally.GuildID);
                                            }
                                            Game.World.Spawns(GC.MyChar, false);
                                        }
                                    }
                                    #endregion
                                    else if (Control == 13)
                                    {
                                        Text("I am what my name says. I help create and manage guilds. So what do you want to do?", GC);
                                        Link("Ally to a guild", 12, GC);
                                        Link("Remove Ally", 62, GC);
                                        Link("Enemy to a guild", 9, GC);
                                        Link("Remove Enemy", 60, GC);
                                        Link("Just passing by", 255, GC);
                                        Face(N.Avatar, GC);
                                        End(GC);
                                    }
                                    break;
                                }
                            #endregion
I`m sure there are probably some people laughing at me but meh lol
I am laughing at you...Just for the shear fact that I am completely lost now aha, so you have converted what you can?
I am guessing
// = Converted ???

Give me your whole NPC.cs or w/e it is and I will convert it for you / just add a new system all together lol
12/07/2010 10:13 denominator#132
No // is because I am not interested in converting that part yet. Calculations is MyMath in the source I am using and Link2 is GC.AddSend(Packets.NPCLink2......)); also Send needs to be AddSend lol. I came down to about five maybe six things that needed converting, and how I figured calculations would be MyMath is anyones guess.

I would but I like the system I am using already lol. I was over tired yesterday so really needed to get some rest but will take another look over what needs finishing today.