I set up , and test it ...
Test the npc option is not work...
now i will teach you how to fix that
Open SocketClient.cs
Add code:
PHP Code:
public TQDialog TQDialog;
Edit NpcRequest method like that:
PHP Code:
public NpcRequest(byte[] Packet, SocketClient Client)
{
this.RequestedID = BitConverter.ToUInt32(Packet, 4);
this.ControlID = Packet[10];
this.TemporaryReplies = new List<uint>();
this.InteractType = Packet[11];
switch (this.ControlID)
{
case 0:
this.TQDialog = new TQDialog(Client);
Client.TQDialog = this.TQDialog;
if (this.RequestedID != 0)
{
ExecuteTask(Client, Exodus.NpcPool[this.RequestedID]);
if (!this.TQDialog.RegisteredTypes.Contains(120))
this.TQDialog.MENUCREATE();
}
else
{
break;
}
break;
default:
uint RealOptionId = (uint)GetRealOption(Client, ControlID);
this.TQDialog = new TQDialog(Client);
Client.TQDialog = this.TQDialog;
ExecuteTask(Client, RealOptionId);
if (!this.TQDialog.RegisteredTypes.Contains(120))
this.TQDialog.MENUCREATE();
break;
}
this.TemporaryReplies.Clear();
}
add another method:
PHP Code:
public int GetRealOption(SocketClient Client,byte option)
{
for (int i = 0; i < Client.TQDialog.NpcReplies.Count; i++)
{
NpcInteract item = Client.TQDialog.NpcReplies[i];
if (item.OptionID == ControlID)
{
return item.RealOptionID;
}
}
return 0;
}
Find code:
PHP Code:
private List<NpcInteract> NpcReplies;
PHP Code:
public List<NpcInteract> NpcReplies;
PHP Code:
private void MENULINK(string param)
PHP Code:
private void MENULINK(string param)
{
string[] Params = GetSafeParam(param);
this.NpcReplies.Add(new NpcInteract(NpcInteract.Option, Params[0]) { OptionID = (byte)int.Parse(Params[1]), RealOptionID = int.Parse(Params[1]) });
}
I think that this may not be the best way
But i work it up 100%!!
If help you , is my pleasure