• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[317] Gnome Slave - Quest

Newbie Spellweaver
Joined
Apr 26, 2008
Messages
16
Reaction score
1
This is a quest that goes like this: You will talk to a Gnome and he will ask you to kill some people. This is the most simplest quest out of all of mine, but its pretty fun. You must have a dodian based server aswell...

Step 1: Client.java

Declare these.
You must as this will give stages to the quest, and also help us count the balls you'll get when defeating the target.

Code:
//Quest 5: Gnome Slave
  public boolean c126o1 = false;
  public boolean c131t132 = false;
  public int quest5Progress = 0;
  public int cannonDrop = 0;

Step 2: Client.java

Saving this is easy, and I hope you know where to put it.
If not, search for case 2: for a while until you find this.

Code:
 else if (token.equals("character-5thQuest")) {
					    quest5Progress = Integer.parseInt(token2);
			}

And then add this, just scroll down for a bit...

Code:
 characterfile.write("character-5thQuest = ", 0, 21);
	  characterfile.write(Integer.toString(quest5Progress), 0, Integer.toString(quest5Progress).length());
	  characterfile.newLine();

Step 3: Client.java

Alright, we are done with the saving, now lets add some dialogue switching.
In case 40: add this:

Code:
if (NpcDialogue == 128 || NpcDialogue == 129) {
			NpcDialogue += 1;
			NpcDialogueSend = false;
			} else if ((NpcDialogue == 130)) {
			NpcDialogue = 0;
			NpcDialogueSend = false;
			RemoveAllWindows();
				} else {
				closeInterface();
			}
		if (NpcDialogue == 132 || NpcDialogue == 133 || NpcDialogue == 134) {
			NpcDialogue += 1;
			NpcDialogueSend = false;
			} else if ((NpcDialogue == 135)) {
			NpcDialogue = 0;
			NpcDialogueSend = false;
			RemoveAllWindows();
				} else {
				closeInterface();
			}
		//end quest5

Step 4: Client.java

Now in first click, or in case 155: add this:

Code:
else if (NPCID == 479) {
			if (quest5Progress == 0) {
			sSh();
			NpcWanneTalk = 128;
			}
			if (quest5Progress == 1) {
			sSh();
			NpcWanneTalk = 132;
			}
			if (cannonDrop == 1) {
			sSh();
			NpcWanneTalk = 136;
			}
			if (quest5Progress == 2) {
			sSh();
			NpcWanneTalk = 138;
			}
		} //end quest5

This will make it so when you talk to the Npc, it'll give us new paths.
When you first start, he will assign you a quest, at the end, he will tell you good job and give you a reward.

Step 5: Client.java

In case 185: add this:

Code:
  case 28215:
			if (quest5Progress == 0) {
			sendMessage("Talk to the Gnome Troop in Eleves.");
			}
			if (quest5Progress == 1) {
			sendMessage("You must defeat the Elf Rangers to get the cannon balls.");
			}
			if (quest5Progress == 2) {
			sendMessage("You already finished this quest.");
			}
			break;

When clicking the button 28215 (look in your quest book) you will get different messages.
You can always change it, if that slot is already taking.

Step 6: Client.java

Now in case 9157: add this:

Code:
//Quest5
			if (c126o1 == true) {
			NpcDialogueSend = false;
			RemoveAllWindows();
			c126o1 = false;
			NpcDialogue = 132;
			c131t132 = true;
			} //End quest5
			if (shopOption1 == true) {            
				NpcDialogue = 0;
                NpcDialogueSend = false;
                openUpShop(60);
				shopOption1 = false;  
			}

So when you click the dialogue options, it'll work.

Step 7: Client.java

In case 9158: add this:

Code:
  //Quest5
		  	if (c126o1 == true) {
			NpcDialogue = 0;
			NpcDialogueSend = false;
			RemoveAllWindows();
			c126o1 = false;
			} //End Quest5
			if (shopOption1 == true) {
			NpcDialogueSend = false;
			NpcDialogue = 0;
			shopOption1 = false;
			RemoveAllWindows();
			}

Pretty much the same as step 7.

Step 8: Client.java

Now, to add dialogue, go to the dialogue section.
You can change the case numbers, but beware: Change the case 40 things too!

Code:
case 132:
		c131t132 = false;
		quest5Progress = 1;
		npt();
		sendFrame126("Kill Elf for cannon ball.", 4885);
		break;
	case 133:
		npt();
		sendFrame126("We need 30 cannon ball!", 4885);
		break;
	case 134:
		npt();
		sendFrame126("Once you done bring back!", 4885);
		cannonDrop = 1;
		break;
	case 136:
		if (playerHasItem(2, 30)) {
		deleteItem(2, 30);
		cannonDrop = 0;
		quest5Progress = 2;
		npt();
		sendFrame126("Thank you, you done!", 4885);
		sendMessage("");
		sendMessage("You have completed the quest: Gnome Ball");
		sendMessage("Your reward: 5000 Coins, 2 Quest Points, 20000 Ranging Experience, Gnome Amulet");
		addSkillXP(20000, 4);
		addItem(589, 1);
		addItem(995, 5000);
		questpoints += 2;
		} else {
		npt();
		sendFrame126("You not done!", 4885);
		sendMessage("If you do not know what to do, click the quest on the quest tab.");
		}
		break;
	case 137:
		npt();
		sendFrame126("NOT NOW IM BUSY!", 4885);
		break;
		//End Quest5

Step 9: Client.java

In process() add this, so it'll change colors when you get to the right stage.

Code:
//quest5
	if(quest5Progress == 0) {
	sendQuest("Gnome Slave", 7383);
		}
	if(quest5Progress == 1) {
	sendQuest("@yel@Gnome Slave", 7383);
		}
	if(quest5Progress == 2) {
	sendQuest("@gre@Gnome Slave", 7383);
		}

Step 10: Npchandler.java

Alright, notice the different file?
Search dad in that file, and under it add this:

Code:
							//quest5
							if(npcs[i].npcType == 1183) {
							  if (temp.cannonDrop == 1) {
								  if (misc.random(2) == 1) {
								  temp.addItem(2, 1);
								    }
								  }
								}
							//end quest5

If you can't understand that, just go to the Npcdead method.

I could post pictures, but it'll ruin the surprise.
Good luck! :)
 
Newbie Spellweaver
Joined
Jan 8, 2007
Messages
41
Reaction score
0
Re: [Tut] Gnome Slave - Quest

Give credits to the person who wrote it at R-Server....
 
Newbie Spellweaver
Joined
Apr 26, 2008
Messages
16
Reaction score
1
Re: [Tut] Gnome Slave - Quest

(I'm him)
 
Newbie Spellweaver
Joined
Jan 13, 2007
Messages
62
Reaction score
0
Re: [Tut] Gnome Slave - Quest

iTyler it is him....
 
right + down + X
Loyal Member
Joined
May 25, 2006
Messages
1,688
Reaction score
298
Re: [Tut] Gnome Slave - Quest

Hey mate, great tutorial. Some suggestions if you wish to keep up the tutorials...

Instead of just handing them code to C & P, try and explain how to do it as well. Also, be sure to include the [317] tag
 
Newbie Spellweaver
Joined
May 17, 2008
Messages
14
Reaction score
0
Re: [Tut] Gnome Slave - Quest

ty for this nice tut
 
Newbie Spellweaver
Joined
Jun 10, 2009
Messages
5
Reaction score
0
Re: [Tut] Gnome Slave - Quest

It's called sarcasm. :mellow:

some people cant see sarcasm through the computer



and ty dude :p i had forgotten how to add the token thing into the save part of the things to add quests.. ty man, saved me a lot of searching :p

i like, tho its pretty nooby.. i'll take this.. and make it 50x more complexicated than it needs to be!
 
Back
Top