Jump to content
Sign in to follow this  
omgitsbob12

[PI] Doric's Quest

Recommended Posts

[SIZE=6]I did not write this[/SIZE]
Thought RuneLocus could use a tutorial.


Make a DoricsQuest.Java
[CODE]package server.model.features.quests;

import server.model.players.Client;

public class DoricsQuest {

Client c;

public DoricsQuest(Client c) {
this.c = c;
}


public void showInformation() {
for(int i = 8144; i < 8195; i++) {
c.getPA().sendFrame126("", i);
}
c.getPA().sendFrame126("@[email protected]'s Quest", 8144);
c.getPA().sendFrame126("", 8145);
if(c.doricsQuest == 0) {
c.getPA().sendFrame126("Doric's Quest", 8144);
c.getPA().sendFrame126("I can start this quest by speaking to Doric, the dwarf, near", 8147);
c.getPA().sendFrame126("Goblin Village near the crossing of Falador to Varrock.", 8148);
c.getPA().sendFrame126("", 8149);
c.getPA().sendFrame126("Minimum requirements are:", 8150);
c.getPA().sendFrame126("Atleast level 15 mining.", 8151);
} else if(c.doricsQuest == 1) {
c.getPA().sendFrame126("Doric's Quest", 8144);
c.getPA().sendFrame126("@[email protected]'ve spoken with Doric and accepted his request.", 8147);
c.getPA().sendFrame126("He wants me to gather the following materials:", 8148);
if(c.getItems().playerHasItem(435,6)) {
c.getPA().sendFrame126("@[email protected] clay (noted)", 8149);
} else {
c.getPA().sendFrame126("@[email protected] clay (noted)", 8149);
}
if(c.getItems().playerHasItem(437,4)) {
c.getPA().sendFrame126("@[email protected] copper ores (noted)", 8150);
} else {
c.getPA().sendFrame126("@[email protected] copper ores (noted)", 8150);
}
if(c.getItems().playerHasItem(441,2)) {
c.getPA().sendFrame126("@[email protected] iron ores (noted)", 8151);
} else {
c.getPA().sendFrame126("@[email protected] iron ores (noted)", 8151);
}
} else if(c.cooksAssistant == 2) {
c.getPA().sendFrame126("Doric's Quest", 8144);
c.getPA().sendFrame126("@[email protected]'ve spoken with Doric and accepted his request.", 8147);
c.getPA().sendFrame126("He wants me to gather the following materials:", 8148);
if(c.getItems().playerHasItem(435,6)) {
c.getPA().sendFrame126("@[email protected] clay (noted)", 8149);
} else {
c.getPA().sendFrame126("@[email protected] clay (noted)", 8149);
}
if(c.getItems().playerHasItem(437,4)) {
c.getPA().sendFrame126("@[email protected] copper ores (noted)", 8150);
} else {
c.getPA().sendFrame126("@[email protected] copper ores (noted)", 8150);
}
if(c.getItems().playerHasItem(441,2)) {
c.getPA().sendFrame126("@[email protected] iron ores (noted)", 8151);
} else {
c.getPA().sendFrame126("@[email protected] iron ores (noted)", 8151);
}
} else if(c.doricsQuest == 3) {
c.getPA().sendFrame126("Doric's Quest", 8144);
c.getPA().sendFrame126("@[email protected]'ve spoken with Doric and accepted his request.", 8147);
c.getPA().sendFrame126("@[email protected]'ve given him the materials he requested.", 8148);
c.getPA().sendFrame126("@[email protected] QUEST COMPLETE", 8150);
c.getPA().sendFrame126("As a reward, I gained 30,000 Mining Experience!", 8151);
}
c.getPA().showInterface(8134);
}


}[/CODE]
Add these to client.java
[CODE]private DoricsQuest dQuest = new DoricsQuest(this);[/CODE]
[CODE]public DoricsQuest getDQ() {
return dQuest;
}[/CODE]
If you have your own Graham's event manager, then use that, but since most people don't know/don't have Graham's manager, under process() add
[CODE]getPA().questLoader();[/CODE]
In PlayerAssistant.java (change the ids to suite your client)
[CODE]public void questLoader() {
if (c.doricsQuest == 0) {
c.getPA().setTextColor(7336, 0x6000);
} else if (c.doricsQuest == 1 || c.doricsQuest == 2) {
c.getPA().setTextColor(7336, 0x33FF66);
} else {
c.getPA().setTextColor(7336, 0x3366);
}
}[/CODE]
In Player.java, in the int declarations
[CODE]doricsQuest,[/CODE]
In DialogueHandler.java (replace the cases with ones that aren't used
[CODE]case 45:
sendNpcChat3("Oy der, mate! Care to help a little fella who needs", "some clay and a couple o' ores? There's a good", "reward, there is. So, how 'bout it, mate?", c.talkingNpc, "Doric");
c.nextChat = 46;
break;
case 46:
sendOption2("Sure.", "Uh, I'll have to pass for now.");
c.dialogueAction = 18;
break;
case 47:
sendPlayerChat1("Sure.");
c.doricsQuest = 1;
c.nextChat = 48;
break;
case 48:
sendNpcChat3("Oh, that's great, right 'der, that's great. Now, I", "will be needing some clay, some copper, and", "a couple o' iron ores.", c.talkingNpc, "Doric");
c.nextChat = 49;
break;
case 49:
sendPlayerChat1("Alright, I'm on my way.");

c.nextChat = 0;
break;
case 50:
sendPlayerChat1("Uh, I'll have to pass for now.");
c.nextChat = 49;
break;
case 51:
sendNpcChat3("You'll have to pass? Oh I see, it's 'cause I'm", "short, ain't it? You pesky humans need to learn", "some respect for us dwarfs. Get out of my house!", c.talkingNpc, "Doric");
c.nextChat = 0;
break;
case 52:
sendNpcChat1("So, you got my items, mate?", c.talkingNpc, "Doric");
c.nextChat = 53;
break;
case 53:
if(c.getItems().playerHasItem(437, 4) && c.getItems().playerHasItem(441, 2) && c.getItems().playerHasItem(435, 6)) {
sendPlayerChat1("Here's all the items!");
c.nextChat = 54;
} else {
sendPlayerChat1("I don't have all the items yet.");
c.nextChat = 56;
}
break;
case 54:
c.getItems().deleteItem(437, 4);
c.getItems().deleteItem(435, 6);
c.getItems().deleteItem(441, 2);
c.doricsQuest = 2;
sendNpcChat1("Thanks mate! I owe it to ya!", c.talkingNpc, "Doric");
c.nextChat = 55;
break;
case 55:
c.getPA().doricsQuest();
break;
case 56:
sendNpcChat1("Well then go get them, you baffoon!", c.talkingNpc, "Doric");
c.nextChat = 0;
break;
case 57:
sendNpcChat1("Y'know, you could always use my anvils.", c.talkingNpc, "Doric");
c.nextChat = 0;
break;[/CODE]
In ClickingButtons.java, go to case 9157
[CODE]if(c.dialogueAction == 18 && c.doricsQuest == 0) {
c.getDH().sendDialogues(47, 284);
return;
}[/CODE]
In PlayerSave.java
[CODE]else if (token.equals("doricsQuest")) {
p.doricsQuest = Integer.parseInt(token2);
}[/CODE]
[CODE]characterfile.write("doricsQuest = ", 0, 14);
characterfile.write(Integer.toString(p.doricsQuest), 0, Integer.toString(p.doricsQuest).length());
characterfile.newLine();[/CODE]
[IMG]http://www.nexushost.x10.mx/serverplus/pics/1-8-2012%201-48-18%20PM.png[/IMG]

100% Credits to Nexus'

Share this post


Link to post
Share on other sites
Where exactly do you save DoricsQuest.Java everywhere I've tried so far has given me errors?

Share this post


Link to post
Share on other sites
[img]http://img638.imageshack.us/img638/6590/773ebf4b92c443988051e83.png[/img]

Share this post


Link to post
Share on other sites
[quote name='waqar135']Where exactly do you save DoricsQuest.Java everywhere I've tried so far has given me errors?[/QUOTE]

learn packaging server.model.features.quests;

In server > model > features > quests

if you dont have the folders add them and add them to your compiler

Share this post


Link to post
Share on other sites
i got a problem case 9157 is my barrows tele tunnel what do i do now?
[CODE]
case 9157://barrows tele to tunnels
if(c.dialogueAction == 1) {
int r = 4;
//int r = Misc.random(3);
switch(r) {
case 0:
c.getPA().movePlayer(3534, 9677, 0);
break;

case 1:
c.getPA().movePlayer(3534, 9712, 0);
break;

case 2:
c.getPA().movePlayer(3568, 9712, 0);
break;

case 3:
c.getPA().movePlayer(3568, 9677, 0);
break;
case 4:
c.getPA().movePlayer(3551, 9694, 0);
break;
}
[/CODE]

Share this post


Link to post
Share on other sites
[quote name='meaty1212']i got a problem case 9157 is my barrows tele tunnel what do i do now?
[CODE]
case 9157://barrows tele to tunnels
if(c.dialogueAction == 1) {
int r = 4;
//int r = Misc.random(3);
switch(r) {
case 0:
c.getPA().movePlayer(3534, 9677, 0);
break;

case 1:
c.getPA().movePlayer(3534, 9712, 0);
break;

case 2:
c.getPA().movePlayer(3568, 9712, 0);
break;

case 3:
c.getPA().movePlayer(3568, 9677, 0);
break;
case 4:
c.getPA().movePlayer(3551, 9694, 0);
break;
}
[/CODE][/QUOTE]

:FACEPALM:

Just add it under the case [B]9157[/B] - insidia coders are just trolling you.

Share this post


Link to post
Share on other sites
Might end up trying this out, thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×