Fix 5290+ source NPC option!!!!

09/18/2010 05:39 262315610#1
First thx pro4ever rel this source !!!!

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
Open NpcRequest.cs
Edit NpcRequest method like that:
PHP Code:
        public NpcRequest(byte[] PacketSocketClient Client)
        {
            
this.RequestedID BitConverter.ToUInt32(Packet4);
            
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(ClientExodus.NpcPool[this.RequestedID]);
                        if (!
this.TQDialog.RegisteredTypes.Contains(120))
                            
this.TQDialog.MENUCREATE();
                    }
                    else
                    {
                        break;
                    }
                    break;
                default:
                    
uint RealOptionId = (uint)GetRealOption(ClientControlID);
                    
this.TQDialog = new TQDialog(Client);
                    
Client.TQDialog this.TQDialog;
                    
ExecuteTask(ClientRealOptionId);
                    if (!
this.TQDialog.RegisteredTypes.Contains(120))
                        
this.TQDialog.MENUCREATE();
                    break;
            }

            
this.TemporaryReplies.Clear();
        } 
And behind NpcRequest method
add another method:
PHP Code:
        public int GetRealOption(SocketClient Client,byte option)
        {
            for (
int i 0Client.TQDialog.NpcReplies.Counti++)
            {
                
NpcInteract item Client.TQDialog.NpcReplies[i];
                if (
item.OptionID == ControlID)
                {
                    return 
item.RealOptionID;
                }
            }
            return 
0;
        } 
Open TQDialog.cs
Find code:
PHP Code:
private List<NpcInteractNpcReplies
eidt like:
PHP Code:
public List<NpcInteractNpcReplies
And find method:
PHP Code:
private void MENULINK(string param
Edit like that:
PHP Code:
        private void MENULINK(string param)
        {
            
string[] Params GetSafeParam(param);
            
this.NpcReplies.Add(new NpcInteract(NpcInteract.OptionParams[0]) { OptionID = (byte)int.Parse(Params[1]), RealOptionID int.Parse(Params[1]) });
        } 
Complete , press F5 to Compile!!!

I think that this may not be the best way

But i work it up 100%!!

If help you , is my pleasure
09/18/2010 19:51 .: RoCK :.#2
tyy & nice res..