help with guild part

02/01/2010 21:02 renetjuuh#1
hello guys ,

i find out that in patch 5165 the guild part that you cant make an guild enemies or allies. can some one tell me how i can fix that.
02/01/2010 22:43 coreymills#2
its nothing to be fixed u have to add the enemies and allies into the npc
02/02/2010 19:37 renetjuuh#3
i know that why im asking same qwuestion that you got
02/03/2010 02:57 WHITELIONX#4
Sadly nobody has a starting point on which to try to figure this out or they do but they are keeping it to themselves. I don`t have allies/enemies either because simply put I would have no idea on how to start coding that NPC.
02/03/2010 18:33 renetjuuh#5
yep i got that to, that why i asking for it but if the wont tell us its oke then
02/03/2010 20:53 pro4never#6
Quote:
Originally Posted by WHITELIONX View Post
Sadly nobody has a starting point on which to try to figure this out or they do but they are keeping it to themselves. I don`t have allies/enemies either because simply put I would have no idea on how to start coding that NPC.
Why not just use 5095 CoEmu as a reference? I can check real quick but I'm fairly sure allies/enemies are fully working in some of the released versions.
02/03/2010 23:38 ImmuneOne#7
I think this is enough to help you out;
Code:
          public static COPacket GuildData(int Type, int Data)
          {
            byte[] Packet = new byte[8 + 12]
            P.WriteInt16((ushort)(Packet.Length - 8));
            P.WriteInt16((ushort)1107); 
            P.WriteInt32(Type);
            P.WriteInt32(Data);
            return P;
          }
//uint16() 12 (Length) Index : 0
//uint16() 1107 (Type) Index : 2
//uint32() Type Index : 4
//uint32() Data Index : 8
Example of using the packet;

Code:
GuildData(7, GuildID); // Allied
GuildData(9, GuildID); // Enemied.
List;
Quote:
Join = 1,
Invite = 2,
Quit = 3,
Info = 6,
Allied = 7,
Neutral = 8,
Enemied = 9,
Donate = 11,
Status = 12,
Leave = 19
02/04/2010 01:19 |_Beetle_|#8
Quote:
public static COPacket GuildData(int Type, int Data)
{
byte[] Packet = new byte[8 + 12]
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)1107);
P.WriteInt32(Type);
P.WriteInt32(Data);
return P;
}
//uint16() 12 (Length) Index : 0
//uint16() 1107 (Type) Index : 2
//uint32() Type Index : 4
//uint32() Data Index : 8
Lack red.

But I have problems to add, if anyone can help clarify how to do it, it is helpful
: D

Thanks
02/04/2010 07:10 renetjuuh#9
@Pro Never:its true i saw yesterday coemu and its way more better
you can see everything realy qwickly,
02/04/2010 10:10 WHITELIONX#10
Yes I have CoEmu source file also but to be honest there are still more important things to concentrate on than just the few NPCs with missing parts lol. I will eventually get around to having a good look at it but for now other things come first lol

Besides after today I will find out if there are any courses at college or at least I am hoping so. Then I will have a better understanding of C# or at least start to have a better understanding :)

Ok this is what people are having difficulty with I have allied and enemied already in the source somewhat because of taking it from something else with no errors, just that to add it to the NPC itself well I am trying but error after error. It`s like going to France and not speaking a word of French to a Frenchman and he does not speak a word of English lmfao. Anyway here is what I was attempting and this is from the deputize part and I TRIED to convert it or at least start to try to convert it but failed :(
Code:
else if (Control == 7)
                                    {
                                        if (GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            GC.AddSend(Packets.NPCSay("Insert the name of the enemy guild."));
                                            GC.AddSend(Packets.NPCLink2("Here", 8));
                                            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 == 8)
                                    {
                                        string GuildName = ReadString(Data);
                                        Features.Guild M = GC.MyChar.Guilds.Guild(GuildName);
                                        if (M != null && M.Enemies == Guilds && ((Hashtable)GC.MyChar.MyGuild.Members[(byte)90]).Count < 5)
                                        {
                                            M.Enemies = NewestCOServer.Features.Guilds.ValidName;
                                            ((Hashtable)GC.MyChar.MyGuild.Guilds[(byte)50]).Remove(M.GuildID);
                                            ((Hashtable)GC.MyChar.MyGuild.Guilds[(byte)90]).Add(M.GuildID, 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());
                                        }
                                    }
Yes I have CoEmu V2 5095 and no there isn`t an NPC included for this code in fact I didn`t even see a guild NPC period? The reason I put this up is because I wanted to have a quick look at a previous attempt I had of making this NPC but meh I must have deleted it albeit parts were still in // because of the failed attempts lmao
02/08/2010 16:52 Huseby#11
Closed by OPs wish.