Impulse's source npc

03/06/2011 08:21 vladradu2007#1
Can anyone tell me why this does not work?It's the same id as in the npcs.txt file(111110) but it still chooses the default in the "switch (client.ActiveNpc)" is there something wrong with the "(npcRequest.OptionID)" or?



Code:
public static void GetDialog(NpcRequest npcRequest, GameState client)
        {
            if (npcRequest == null || client == null || client.Entity == null)
                return;
       
            Dialogs dialog = new Dialogs();
            dialog.Client = client;
            dialog.Replies = new List<NpcReply>();
            switch (client.ActiveNpc)
            {
                #region BirthVillage
                #region Gateman
                case 111110://Village gateman

                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Teleport to TwinCity?");
                                    dialog.Option("Yes", 1);
                                    dialog.Option("No.", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                
                                {
                                    client.Entity.Teleport(1002, 439, 390);
                                    break;
                                }

                              
                        }
                        break;
                    }
                #endregion
                #endregion

                default:
                    {
                        dialog.Text("This npc doesn't have a text added. It's ID is " + client.ActiveNpc);
                        dialog.Option("Alright.", 255);
                        dialog.Send();
                        break;
                    }
            }
        }
Edit:I rebuilt and everything.Anyone has any ideas?