Damn, that was fast.Quote:
[Only registered and activated users can see links. Click Here To Register...]
The case number should be the same as your NPC ID.Quote:
Could somebody explain to me how to add dialog to an npc please? I know how to make the dialog, but when i build then debug the npc still says nothing. Not sure what i'm doing wrong so if anyone could tell me that'd be great, thanks.
Move the "Dialogs.cs" file to the main project, right about "Program.cs". Then delete the second project and rebuild it. There's NO benefit from splitting off the Dialogs into their own project. These days, if your computer can't build a solution in less than 3 seconds, there's something seriously wrong with it.Quote:
i've been making sure the case numbers are matching with the npc id but still doesn't work
Thanks i got it working now :). Another question though, every once in a while i get a problem in program.cs with this line:Quote:
Move the "Dialogs.cs" file to the main project, right about "Program.cs". Then delete the second project and rebuild it. There's NO benefit from splitting off the Dialogs into their own project. These days, if your computer can't build a solution in less than 3 seconds, there's something seriously wrong with it.
You shouldn't keep the dialogs like that either. Circular dependency is very poor style in programming and it causes a lot of problems... like the one you're experiencing.
try
{
Client.Exchange = false;
Client.Action = 1;
ushort position = 7;
uint PacketLen = BitConverter.ToUInt32(arg1, position); position += 4;
int JunkLen = BitConverter.ToInt32(arg1, position); position += 4; position += (ushort)JunkLen;
int Len = BitConverter.ToInt32(arg1, position); position += 4;
byte[] pubKey = new byte[Len];
for (int x = 0; x < Len; x++)
pubKey[x] = arg1[x + position];
string PubKey = System.Text.ASCIIEncoding.ASCII.GetString(pubKey);
Client.Cryptography = Client.DHKeyExchance.HandleClientKeyPacket(PubKey, Client.Cryptography);
}
ah i almost had it lol i was one line off.Quote:
Ive had that many of times I fixed it by changing the routine.
Just uses a different method to do it. never had the problem since. could never figure it out either.Code:try { Client.Exchange = false; Client.Action = 1; ushort position = 7; uint PacketLen = BitConverter.ToUInt32(arg1, position); position += 4; int JunkLen = BitConverter.ToInt32(arg1, position); position += 4; position += (ushort)JunkLen; int Len = BitConverter.ToInt32(arg1, position); position += 4; byte[] pubKey = new byte[Len]; for (int x = 0; x < Len; x++) pubKey[x] = arg1[x + position]; string PubKey = System.Text.ASCIIEncoding.ASCII.GetString(pubKey); Client.Cryptography = Client.DHKeyExchance.HandleClientKeyPacket(PubKey, Client.Cryptography); }