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.
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.
And then add this, just scroll down for a bit...
Step 3: Client.java
Alright, we are done with the saving, now lets add some dialogue switching.
In case 40: add this:
Step 4: Client.java
Now in first click, or in case 155: add this:
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:
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:
So when you click the dialogue options, it'll work.
Step 7: Client.java
In case 9158: add this:
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!
Step 9: Client.java
In process() add this, so it'll change colors when you get to the right stage.
Step 10: Npchandler.java
Alright, notice the different file?
Search dad in that file, and under it add this:
If you can't understand that, just go to the Npcdead method.
I could post pictures, but it'll ruin the surprise.
Good luck!
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!