I run the program, from what I see the game runs fine. Then when I click on the object that suppose to send a dialogue, it disconnects me and throws this error in the run.batch window.

Exception in thread "main" java.lang.NullPointerException
        at NPCDialogue.UpdateNPCChat(NPCDialogue.java:18)
        at client.process(client.java:8471)
        at PlayerHandler.process(PlayerHandler.java:137)
        at server.main(server.java:55)

Here is what I have in those files, I wont put the PlayerHandler.java or server.java because thats just calling the file NPCDialogue.java.

This is what is inside NPCDialogue.java.

public client c;
public Player P;

	public void UpdateNPCChat() {
		/*c.sendFrame126("", 4902);
		c.sendFrame126("", 4903);
		c.sendFrame126("", 4904);
		c.sendFrame126("", 4905);
		c.sendFrame126("", 4906);*/
That's line 18->		c.sendFrame126("", 976);
		switch (P.NpcDialogue) {
		}
	}

Note: I would of posted the entire void, but its too big.

This is what I have in Client.java.

if (NpcDialogue > 0 && NpcDialogueSend == false) {
This is line 8471->			server.NPCDialogue.UpdateNPCChat();
		}
public void sendFrame126(String s, int id) {
	if (id <= 20000) {
		if (InterfaceText[id] != null && InterfaceText[id].equals(s)) {
			return;
		} else {
			InterfaceText[id] = s;
		}
	}
		outStream.createFrameVarSizeWord(126);
		outStream.writeString(s);
		outStream.writeWordA(id);
		outStream.endFrameVarSizeWord();
		flushOutStream();
	}

--------------------------------------------------------------------------------------

This is another java.lang.nullpointer exception error I get. This happens when I click on the item I want to eat to heal myself.

java.lang.NullPointerException at CheckSkillHandler.CheckForSkillUse3(CheckSkillHandler.java:1382)
at PacketHandler.parseIncomingPackets(PacketHandler.java:800)
        at client.parseIncomingPackets(client.java:8526)
        at client.packetProcess(client.java:8510)
        at client.process(client.java:8480)
        at PlayerHandler.process(PlayerHandler.java:137)
        at server.main(server.java:55)
pimpscape Server [fatal] - exception

This is what I have for CheckSkillHandler.java.

case 385: //Shark
This is line 1382->				c.healing[1] = 20;
				c.healing[2] = 20;
				c.healing[3] = -1;
				break;

Note: I would of posted the entire void, but its too big again.
This is what I have in PacketHandler.java.

case 122:	// Call for burying bones
				int interfaace = c.inStream.readSignedWordBigEndianA();
				int ItemSlot = c.inStream.readUnsignedWordA();
				int ItemID = c.inStream.readUnsignedWordBigEndian();
				/*if (P.IsUsingSkill == false &&  c.CheckForSkillUse3(ItemID, ItemSlot) == true) {
					P.IsUsingSkill = true;
				}*/
                                if(c.playerItems[ItemSlot] == ItemID+1){
this is line 800->server.CheckSkillHandler.CheckForSkillUse3(ItemID, ItemSlot);

This is what I have in client.java.

public void parseIncomingPackets(){
		int i;
		int junk;
		int junk2;
		int junk3;

line 8526->server.PacketHandler.parseIncomingPackets(this, this);

		switch(packetType) {
		}
	}
line 8510->			parseIncomingPackets();	
			packetType = -1;
		} catch(java.lang.Exception __ex) {	__ex.printStackTrace();  disconnected = true;
                  System.out.println("pimpscape Server [fatal] - exception"); }
		return true;
	}

}
line 8480-> return packetProcess();
}

Well I hope you guys can help hopefully. Thank you.

where did you instantiate c? cause it looks like c is not referencing any object. comment out line 18 and try this

System.out.println(c.toString());

if it prints out null then you haven't instantiated c

Well c. calls for client.java

where in your code did you do this

c = new client()

?

post the code for NPCDialogue here

I didn't do

c = new client()

Here is NPCDialogue class.

import java.io.*;
import java.util.StringTokenizer;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.security.*;

public class NPCDialogue {

public client c;
public Player P;

	public void UpdateNPCChat() {
		/*c.sendFrame126("", 4902);
		c.sendFrame126("", 4903);
		c.sendFrame126("", 4904);
		c.sendFrame126("", 4905);
		c.sendFrame126("", 4906);*/
		c.sendFrame126("", 976);
		switch (P.NpcDialogue) {
			case 1:
				/*c.sendFrame200(4901, 554);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
				c.sendFrame126("Good day, how can I help you?", 4904);
				c.sendFrame75(P.NpcTalkTo, 4901);
				c.sendFrame164(4900);
				*/
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Good day, how can I help you?", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				break;
			case 2:
				c.sendFrame171(1, 2465);
				c.sendFrame171(0, 2468);
				c.sendFrame126("What would you like to say?", 2460);
				c.sendFrame126("I'd like to access my bank account, please.", 2461);
				c.sendFrame126("I'd like to check my PIN settings.", 2462);
				c.sendFrame164(2459);
				P.NpcDialogueSend = true;
				break;
			case 3:
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Do you want to buy some runes?", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				break;
			case 4:
				c.sendFrame171(1, 2465);
				c.sendFrame171(0, 2468);
				c.sendFrame126("Select an Option", 2460);
				c.sendFrame126("Yes please!", 2461);
				c.sendFrame126("Oh it's a rune shop. No thank you, then.", 2462);
				c.sendFrame164(2459);
				P.NpcDialogueSend = true;
				break;
			case 5:
				c.sendFrame200(615, 974);
				c.sendFrame126(P.playerName, 975);
				c.sendFrame126("Oh it's a rune shop. No thank you, then.", 976);
				c.sendFrame185(974);
				c.sendFrame164(973);
				P.NpcDialogueSend = true;
				break;
			case 6:
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Well, if you find somone who does want runes, please", 4885);
				c.sendFrame126("send them my way.", 4886);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				break;
			case 7: /*NEED TO CHANGE FOR GUARD*/
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Well, if you find somone who does want runes, please", 4885);
				c.sendFrame126("send them my way.", 4886);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				break;
			case 31: // NEW CLUE
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Heres your next clue, goodluck", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				break;
			case 32: // COMPLETED CLUE
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Congratulations! Heres your last reward!", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
                                server.ClueManager.givereward(c.cluelevel);
				break;
         case 40:
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Do you want to go on a trip to Karjama?", 4904);
            c.sendFrame126("It's free.", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 41:
            c.sendFrame171(1, 2465);
            c.sendFrame171(0, 2468);
            c.sendFrame126("Select an Option", 2460);
            c.sendFrame126("Yes, please", 2461);
            c.sendFrame126("No, Thank you.", 2462);
            c.sendFrame164(2459);
            P.NpcDialogueSend = true;
            break;
         case 42:
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Do you want to go on a trip to Port Sarim?", 4904);
            c.sendFrame126("It's free.", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 43:
            c.sendFrame171(1, 2465);
            c.sendFrame171(0, 2468);
            c.sendFrame126("Select an Option", 2460);
            c.sendFrame126("Yes, please", 2461);
            c.sendFrame126("No, Thank you.", 2462);
            c.sendFrame164(2459);
            P.NpcDialogueSend = true;
            break;
			case 11021: // COMPLETED QUEST STAGE 2
				c.sendFrame200(615, 974);
				c.sendFrame126(P.playerName, 975);
				c.sendFrame126("Ok, where can I find the "+c.GetItemName(4206)+"?", 977);
				c.sendFrame185(974);
				c.sendFrame164(973);
				P.NpcDialogueSend = true;
				break;	
			case 11022: // COMPLETED QUEST STAGE 2
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("It can be found in the caves of Relleka, north ", 4885);
				c.sendFrame126("of Camelot, but be warned, evil monsters lie there...", 4886);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				break;
                        case 100: // QUEST STAGE 0
				{c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Hey I need help with making some invisible armour...", 4885);
				c.sendFrame126("and you're gonna help me.", 4886);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				P.NpcDialogueSend = true;
                                c.q1stage = 1;
                                //c.RemoveAllWindows();
				break;
				}
			case 101: // QUEST STAGE 1
				{c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("I'll add the list of materials I need to your", 4885);
				c.sendFrame126("quest log, as I'm too busy to talk.", 4886);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
                                c.q1stage = 1;
                                //c.RemoveAllWindows();
				break;
				}
			case 102: // QUEST STAGE 2
				{c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Why are you still here...go get the materials", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
                                c.q1stage = 2;
                                //c.RemoveAllWindows();
				break;
				}
			case 103: // QUEST STAGE 3
				{c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Get me the "+c.GetItemName(4206)+" please!", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
                                //c.RemoveAllWindows();
				break;
				}
			case 104: // QUEST STAGE 4
				{c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("You lost it?!?! Go get it again man.", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;;
                                c.q1stage = 3;
                                //c.RemoveAllWindows();
				break;
				}
			case 1101: // COMPLETED QUEST STAGE 1
				{c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Thanks for getting me these, I've updated", 4885);
				c.sendFrame126("your quest log for my next request.", 4886);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
                                c.q1stage = 2;
                                c.deleteItem(451, c.getItemSlot(451), 1);
                                c.deleteItem(2339, c.getItemSlot(2339), 1);
                                c.deleteItem(1777, c.getItemSlot(1777), 1);
                                //c.RemoveAllWindows();
				break;
				}
			case 1102: // COMPLETED QUEST STAGE 2
				{c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Thanks giving me the "+c.GetItemName(6889)+", now all I need", 4885);
				c.sendFrame126("is the "+c.GetItemName(4206)+" to add the power to the armour.", 4886);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
                                c.q1stage = 3;
                                c.deleteItem(6889, c.getItemSlot(6889), 1);
				//P.NpcDialogue = 11021;
				P.NpcDialogueSend = true;
                                break;
				}
			case 1105: // COMPLETED QUEST
				{
                                if(c.q1stage == 4)
                                {
                                c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Thanks for helping me with this project,", 4885);
				c.sendFrame126("heres your reward, also look out for more of this armour...", 4886);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
                                c.showQuestCompleted("Invisible Armour", 3);
                                c.q1stage = -1;
                                c.addItem(6656, 1);
                                c.sendMessage("Quest complete!");
                                c.loadquestinterface();
                                c.deleteItem(4206, c.getItemSlot(4206), 1);				
                                break;
				}
                                }
			case 200: // QUEST2 STAGE 0
				{c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Yo, I'll add what I need to your quest log", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
                                c.q2stage = 1;
                                c.loadquestinterface();
                                break;
				}
			case 201: // QUEST2 STAGE 1
				{c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Come back when you have the ingredients.", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				//P.NpcDialogue = 11021;
				P.NpcDialogueSend = true;
                                break;
				}
			case 2001: // COMPLETED QUEST2
				{
                                if(c.q2stage == 1)
                                {
                                c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Thanks for getting me the ingredients!", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
                                c.showQuestCompleted("Cook's Assistant", 2);
                                c.q2stage = -1;
                                c.addItem(775, 1);
                                c.sendMessage("Quest complete!");
                                c.loadquestinterface();
                                c.deleteItem(1927, c.getItemSlot(1927), 1);	
                                c.deleteItem(1944, c.getItemSlot(1944), 1);
                                c.deleteItem(1933, c.getItemSlot(1933), 1);			
                                break;
				}
                                }
         case 14600: // Make over mage chat
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Yo you want a make over?", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 14601: // Make over mage chat option - choose make over y/n
            c.sendFrame171(1, 2465);
            c.sendFrame171(0, 2468);
            c.sendFrame126("Select an Option", 2460);
            c.sendFrame126("Sure", 2461);
            c.sendFrame126("Nope", 2462);
            c.sendFrame164(2459);
            P.NpcDialogueSend = true;
            break;
         case 14602: // Make over mage chat accept offer
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Ok that'll be 10000 coins", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 14603: // Make over mage chat option - pay coins - owned k?
            c.sendFrame171(1, 2465);
            c.sendFrame171(0, 2468);
            c.sendFrame126("Select an Option", 2460);
            c.sendFrame126("Ok", 2461);
            c.sendFrame126("Gay...", 2462);
            c.sendFrame164(2459);
            P.NpcDialogueSend = true;
            break;
         case 14604: // Make over mage chat accept coins
            if(c.playerHasItemAmount(995, 10000)) {
            c.deleteItem(995, c.getItemSlot(995), 10000);
            c.showInterface(3559);
            P.NpcDialogue = 0;
            break;
            }
            else {
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("You got no money, bitch,", 4904);
            c.sendFrame126("come back when you got some.", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
            }
         case 300: // Spells of the gods (q3) start point - player says nope to dialogue 302
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Oh ok if you to tell me ok.", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 301: // Spells of the gods (q3) start point
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Hi there, you don't happen to of seen a staff", 4904);
            c.sendFrame126("with a pink orb, have you?", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 302: // Choose between starting the quest (q3 - spells of the gods) or not
            c.sendFrame171(1, 2465);
            c.sendFrame171(0, 2468);
            c.sendFrame126("Select an Option", 2460);
            c.sendFrame126("No but maybe I can help?", 2461);
            c.sendFrame126("Nope", 2462);
            c.sendFrame164(2459);
            P.NpcDialogueSend = true;
            break;
         case 303: // Spells of the gods (q3) start point - player agrees to help to dialogue 302
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("You will? Well I think it's located in a", 4904);
            c.sendFrame126("dungeon to the east of Ardougne, try there.", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 304: // Spells of the gods (q3) stage 1 - player returns without staff
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Go get the staff of Armadyl!", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 305: // Spells of the gods (q3) stage 1 - player returns with staff
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Thanks! Now you'll need to get me", 4904);
            c.sendFrame126("the magic stone, which Kalrag owns.", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            c.q3stage = 2;
            break;
         case 306: // Choose between asking where kalrag is or saying ok bye
            c.sendFrame171(1, 2465);
            c.sendFrame171(0, 2468);
            c.sendFrame126("Select an Option", 2460);
            c.sendFrame126("Where is Kalrag?", 2461);
            c.sendFrame126("Ok bye.", 2462);
            c.sendFrame164(2459);
            P.NpcDialogueSend = true;
            break;
         case 307: // Player asks where Kalrag is
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Kalrag can be found in Lumbridge Swamp,", 4904);
            c.sendFrame126("good luck "+P.playerName+"!", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 308: // Spells of the gods (q3) stage 2 - player returns with magic stone
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Ok good, you have the magic stone,", 4904);
            c.sendFrame126("now you'll need to make a firework...", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            c.q3stage = 3;
            break;
         case 309: // Spells of the gods (q3) stage 2 - player returns with magic stone part2
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("To do this get a gnome bowl and use it", 4904);
            c.sendFrame126("with a fire to create an item named fire...", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 310: // Spells of the gods (q3) stage 2 - player returns with magic stone part3
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Then you'll need to use that with the magic", 4904);
            c.sendFrame126("stone to make a firework and then return to me", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 311: // Spells of the gods (q3) stage 2 - player returns without magic stone
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Go get the magic stone bitch!", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 312: // Spells of the gods (q3) stage 3 - player returns without firework
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("You forgot to go get the firework.", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 313: // Spells of the gods (q3) stage 3 - player returns with firework
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Good you got it, aiightz now you need", 4904);
            c.sendFrame126("to go to level 40+ wilderness where the...", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            c.q3stage = 4;
            break;
         case 314: // Spells of the gods (q3) stage 3 - player returns with firework part2
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("abberant spectors are, and light the", 4904);
            c.sendFrame126("firework on the red circle to spawn the...", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 315: // Spells of the gods (q3) stage 3 - player returns with firework part3
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("heart crystal which you'll need later...", 4904);
            c.sendFrame126("Good luck!", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 316: // Spells of the gods (q3) stage 4 - player returns without heart crystal
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Good luck getting the heart crystal!", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 317: // Spells of the gods (q3) stage 4 - player returns with heart crystal part1
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Great! You got the crystal! Now all that needs", 4904);
            c.sendFrame126("doing is getting your disguise for when you...", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            c.q3stage = 5;
            break;
         case 318: // Spells of the gods (q3) stage 4 - player returns with heart crystal part2
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("sneak into the mage guild, to do that", 4904);
            c.sendFrame126("you'll need to head to Camelot Castle, then...", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 319: // Spells of the gods (q3) stage 4 - player returns with heart crystal part3
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("head into the North East section of the garden,", 4904);
            c.sendFrame126("and into the shelter, and then drop the...", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 320: // Spells of the gods (q3) stage 4 - player returns with heart crystal part4
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("heart crystal on the red circle to spawn the", 4904);
            c.sendFrame126("Infernal Mage, kill him and take the disguise!", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 321: // Spells of the gods (q3) stage 5 - player returns without disguise
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Come back with the disguise in your inventory...", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 322: // Spells of the gods (q3) stage 5 - player returns with disguise
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Good, you have the diguise, now all you need to do", 4904);
            c.sendFrame126("is put it on the disguise and...", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            c.q3stage = 6;
            break;
         case 323: // Spells of the gods (q3) stage 5 - player returns with disguise
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("head to the Mage Guild located in Yanille.", 4904);
            c.sendFrame126("Go in wearing the disguise and look for the", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 324: // Spells of the gods (q3) stage 5 - player returns with disguise
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("daconia rock, which is needed to complete the staff", 4904);
            c.sendFrame126("and return to me for you reward.", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 325: // Spells of the gods (q3) stage 6/7 - player returns without daconia rock
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Go get the rock bitch!", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            c.q3stage = 6;
            break;
         case 326: // Spells of the gods (q3) stage 7 - player returns with daconia rock
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Thanks so much! I'll now give you the", 4904);
            c.sendFrame126("power of the Gods and your reward!", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            c.q3stage = -1;
            c.savemoreinfo();
            c.showQuestCompleted("Spells Of The Gods", 4);
            c.addSkillXP(1000000, 6);
            c.addItem(6603, 1);
            c.sendMessage("You are rewarded 1 million magic experience!");
            c.sendMessage("You can now use all 3 god spells! (Level 99 magic needed)");
            break;
         case 2259:
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Hello, would you like me to tele you to the abyss?", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 2260:
            c.sendFrame171(1, 2465);
            c.sendFrame171(0, 2468);
            c.sendFrame126("Select an Option", 2460);
            c.sendFrame126("Hell yeah!", 2461);
            c.sendFrame126("No thanks.", 2462);
            c.sendFrame164(2459);
            P.NpcDialogueSend = true;
            break;
         case 1001:
            c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
            c.sendFrame126("", 4903);
            c.sendFrame126("Hello...are you wishing to be converted?", 4904);
            c.sendFrame126("", 4905);
            c.sendFrame126("", 4906);
            c.sendFrame75(P.NpcTalkTo, 4901);
            c.sendFrame164(4900);
            P.NpcDialogueSend = true;
            break;
         case 1002:
            c.sendFrame171(1, 2465);
            c.sendFrame171(0, 2468);
            c.sendFrame126("Select an Option", 2460);
            c.sendFrame126("Of course.", 2461);
            c.sendFrame126("Nope.", 2462);
            c.sendFrame164(2459);
            P.NpcDialogueSend = true;
            break;
          case 9292: // for random event by pimp
            c.sendFrame171(1, 2465);
            c.sendFrame171(0, 2468);
            c.sendFrame126("one of those evil monks stole my wistle ", 2460);
            c.sendFrame126("and i just happened to see you when i used my.", 2461);
            c.sendFrame126("scrying orb so your getting it back for me", 2462);
            c.sendFrame164(2459);
            P.NpcDialogueSend = true;
			break;

                       case 6889: // Ghost Talk
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Take this!", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
                                c.addItem(6889, 1);
                                //c.RemoveAllWindows();
                                break;
				
		}
	}

}

c is not referencing any object thats why you are getting a null pointer exception. you need to create an instance of Client and then pass it to your NPCDialogue class; same goes for Player p

oh wow. Thanks, it fixed the nullpointer error.

there we go. could you mark this thread as solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.