Cookin Assistant (Not n00b version!) 90% like real rs
Server base: LaxiScape (p16)
First made a new java file called: DialogueHandler.java
Put these inside:
Code:
public class DialogueHandler {
public void Case40(int ID) {
client p = (client) server.playerHandler.players[ID];
if (p.NpcDialogue == 1 || p.NpcDialogue == 10 || p.NpcDialogue == 100 || p.NpcDialogue == 102 || p.NpcDialogue == 103 || p.NpcDialogue == 104 || p.NpcDialogue == 105 || p.NpcDialogue == 106 || p.NpcDialogue == 107 || p.NpcDialogue == 108 || p.NpcDialogue == 109 || p.NpcDialogue == 110|| p.NpcDialogue == 112|| p.NpcDialogue == 113|| p.NpcDialogue == 115|| p.NpcDialogue == 116|| p.NpcDialogue == 117|| p.NpcDialogue == 119|| p.NpcDialogue == 121|| p.NpcDialogue == 123|| p.NpcDialogue == 125|| p.NpcDialogue == 127|| p.NpcDialogue == 128|| p.NpcDialogue == 129|| p.NpcDialogue == 130|| p.NpcDialogue == 133|| p.NpcDialogue == 135|| p.NpcDialogue == 136|| p.NpcDialogue == 137|| p.NpcDialogue == 138|| p.NpcDialogue == 139|| p.NpcDialogue == 140|| p.NpcDialogue == 141|| p.NpcDialogue == 142|| p.NpcDialogue == 143|| p.NpcDialogue == 144|| p.NpcDialogue == 146|| p.NpcDialogue == 148|| p.NpcDialogue == 149|| p.NpcDialogue == 151|| p.NpcDialogue == 152|| p.NpcDialogue == 154|| p.NpcDialogue == 155|| p.NpcDialogue == 156 || p.NpcDialogue == 157|| p.NpcDialogue == 158|| p.NpcDialogue == 159|| p.NpcDialogue == 161|| p.NpcDialogue == 162|| p.NpcDialogue == 164|| p.NpcDialogue == 165|| p.NpcDialogue == 167|| p.NpcDialogue == 168|| p.NpcDialogue == 169|| p.NpcDialogue == 170|| p.NpcDialogue == 171|| p.NpcDialogue == 172|| p.NpcDialogue == 173|| p.NpcDialogue == 174) {
p.NpcDialogue += 1;
p.NpcDialogueSend = false;
} else if (p.NpcDialogue == 122) {
p.NpcDialogue = 118;
p.NpcDialogueSend = false;
} else if (p.NpcDialogue == 124) {
p.NpcDialogue = 118;
p.NpcDialogueSend = false;
} else if (p.NpcDialogue == 126) {
p.NpcDialogue = 118;
p.NpcDialogueSend = false;
} else if (p.NpcDialogue == 132) {
p.NpcDialogue = 118;
p.NpcDialogueSend = false;
}
}
public void NpcChat(int NpcDialogue, int ID) {
client p = (client) server.playerHandler.players[ID];
switch (NpcDialogue) {
case 100:
p.oneline("What am I to do?");
break;
case 101:
p.selectfourline("Select an Option","What's wrong?","Can you make me a cake?","You don't look very happy.","Nice hat!");
break;
case 102:
p.charoneline("Nice hat!");
break;
case 103:
p.oneline("Err thank you. It's pretty ordinary cooks hat really.");
break;
case 104:
p.charoneline("Still, suits you. The trousers are pretty special too.");
break;
case 105:
p.oneline("Its all standard cook's issue uniform...");
break;
case 106:
p.chartwoline("The whole hat, apron, stripey trousers ensemble - it","works. It make you looks like a real cook.");
break;
case 107:
p.twoline("I'm a real cook! I haven't got time to be chatting","about Culinary Fashion. I am in desperate need of help!");
break;
case 108:
p.charoneline("What's wrong?");
break;
case 109:
p.threeline("Oh dear, oh deat, oh dear, I'm in a terrible terrible","mess! It's the Duke's britheday today, and I should be","make him a lovely big britheday cake.");
break;
case 110:
p.fourline("I've forgott to buy the ingredients. I'll never get","them in time now. He'll sack me! What will I do? I have","four childen and a goat to look after. Would you help","me? Please?");
break;
case 111:
p.sendFrame171(1, 2465);
p.sendFrame171(0, 2468);
p.sendFrame126("Select an Option", 2460);
p.sendFrame126("I'm always happy to help a cook in distress.", 2461);
p.sendFrame126("I can't right now, maybe later.", 2462);
p.sendFrame164(2459);
p.NpcDialogueSend = true;
break;
case 112:
p.charoneline("No, I don't feel like it. Maybe later.");
break;
case 113:
p.twoline("Fine. I always knew you Adventurer types were callous","beasts. Go on your merry way!");
break;
case 114:
p.RemoveAllWindows();
break;
case 115:
p.charoneline("Yes, I'll help you.");
p.q1stage = 1;
break;
case 116:
p.twoline("Oh thank you thank you. I need milk, an egg and","flour. I'd be very grateful if you can get them for me.");
break;
case 117:
p.charoneline("So where do I find these ingredients then?");
break;
case 118:
p.selectfourline("Select an Option","Where do I find some flour?","How about milk?","And eggs? Where are they found?","Actually, I know where find this stuff.");
break;
case 119:
p.charoneline("Actually, I know where find this stuff.");
break;
case 120:
p.RemoveAllWindows();
break;
case 121:
p.threeline("There is a Mill fairy close, Go North and then West.","Mill Lane Mill is just off the road to Draynor. I","usually get my flour from there.");
break;
case 122:
p.twoline("Talk to Millie, she'll help, she's a lovely girl and a fine","Miller..");
break;
case 123:
p.twoline("There is a cattle field on the other side of river,","just across the road from the Groats' Farm.");
break;
case 124:
p.threeline("talk to Gillie Groats, she looks after the Dairy cows","she'll tell you everything you need to know about","milking cows!");
break;
case 125:
p.twoline("I normally get my eggs from Groats' farm, on the","other side of the river.");
break;
case 126:
p.oneline("But any chicken should lay eggs.");
break;
case 127:
p.oneline("How are you getting on whit finding the ingredients?");
break;
case 128:
p.charoneline("I haven't got any of them yet, I'm still looking.");
break;
case 129:
p.twoline("Please get the ingredients quickly. I'm running out of","time! The Duke will throw me into streets!");
break;
case 130:
p.twosimpleline("You still need to get:","A bucket of milk. A pot of flour. An egg.");
break;
case 131:
p.selecttwoline("Select an Option","I'll get right on it.","Can you remind me how to find these things again?");
break;
case 132:
p.charoneline("Can you remind me how to find these things again?");
break;
case 133:
p.charoneline("I'll get right on it.");
break;
case 134:
p.RemoveAllWindows();
break;
case 135:
p.oneline("How are you getting on whit finding the ingredients?");
break;
case 136:
p.charoneline("Here's a bucket of milk.");
break;
case 137:
p.charoneline("Here's a pot of flour.");
break;
case 138:
p.charoneline("Here' a fresh egg.");
break;
case 139:
p.twoline("You've brought me everything I need! I am saved!","Thank you!");
break;
case 140:
p.charoneline("So do I get to go to the Duke's Party?");
break;
case 141:
p.twoline("I'm afraid not, only the big chees get to dine whit the","Duke.");
break;
case 142:
p.chartwoline("Well maybe one day I'll be impotant enough to sit on","the Duke's table.");
break;
case 143:
p.oneline("Maybe, but I won't be holding my breath.");
break;
case 144:
p.RemoveAllWindows();
p.totalqp += p.q1reward;
p.showInterface(297);
p.sendQuest("Congratulations!", 299);
p.sendQuest("Close Window", 300);
p.sendQuest("You are awarded:", 6156);
p.sendQuest("", 6157);
p.sendQuest(""+p.q1reward+" Quest Point", 6158);
p.sendQuest("Quest Points:", 303);
p.sendQuest("You have completed Cook's Assistant", 301);
p.sendQuest(""+p.totalqp, 304);
p.sendMessage("Congratulations! Quest completed!");
p.sendQuest("300 Cooking XP", 6159);
p.addSkillXP(300, 7);
p.deleteItem(1944, p.getItemSlot(1944), 1);
p.deleteItem(1927, p.getItemSlot(1927), 1);
p.deleteItem(1933, p.getItemSlot(1933), 1);
p.NpcDialogue = 145;
p.q1stage = -1;
break;
case 145:
p.showInterface(297);
p.sendQuest("Congratulations!", 299);
p.sendQuest("Close Window", 300);
p.sendQuest("You are awarded:", 6156);
p.sendQuest(""+p.q1reward+" Quest Point", 6158);
p.sendQuest("Quest Points:", 303);
p.sendQuest("You have completed Cook's Assistant", 301);
p.sendQuest(""+p.totalqp, 304);
p.sendQuest("300 Cooking XP", 6159);
break;
case 146:
p.oneline("Hello friend, how the adventuring going?");
break;
case 147:
p.selectthreeline("Select an Option","I'm getting strong and mighty.","I keep on dying.","Can I use your range?");
break;
case 148:
p.charoneline("I'm getting strong and mighty.. Grrr");
break;
case 149:
p.oneline("Glad to hear it!");
break;
case 150:
p.RemoveAllWindows();
break;
case 151:
p.charoneline("I keep on dying.");
break;
case 152:
p.oneline("Ah well, at least you keep coming back to life!");
break;
case 153:
p.RemoveAllWindows();
break;
case 154:
p.charoneline("Can I use your range?");
break;
case 155:
p.twoline("Go ahead - it's a very good range. It's easyer to use","than most other ranges.");
break;
case 156:
p.twoline("Its called the Cook-o-matic 100. It uses a combination of","state of art temperature regulation and magic.");
break;
case 157:
p.charoneline("Will it mean my food burn less often?");
break;
case 158:
p.oneline("Well, that's what the salesman told us anyway...");
break;
case 159:
p.charoneline("Thanks?");
break;
case 160:
p.RemoveAllWindows();
break;
case 161:
p.charoneline("You've a cook, why don't you bake me a cake?");
break;
case 162:
p.oneline("*sniff* Don't talk to me about cakes...");
break;
case 163:
p.NpcDialogue = 108;
p.NpcDialogueSend = false;
break;
case 164:
p.charoneline("You don't look very happy.");
break;
case 165:
p.twoline("No, I'm not. The world is caving around me - I'm","overcome by dark feelings of impending doom.");
break;
case 166:
p.selecttwoline("Select an Option","What's wrong?","I'd like the rest of the day off if I were you.");
break;
case 167:
p.charoneline("I'd like the rest of the day off if I were you.");
break;
case 168:
p.twoline("No, that's the worst thing I could do. I'd get in terrible","truble.");
break;
case 169:
p.charoneline("Well maybe you need to take a holiday...");
break;
case 170:
p.twoline("That would be nice, but the Duke dosn't allow holidays","for core staff.");
break;
case 171:
p.chartwoline("Hmm, why not run away to the sea and start a new","life as a Pirate?");
break;
case 172:
p.twoline("My wife gets sea stick, and I have an irrational fear of","eyepatches. I don't see it working myself.");
break;
case 173:
p.charoneline("I'm afraid I've run out of ideas.");
break;
case 174:
p.oneline("I know I'm doomed.");
break;
case 175:
p.NpcDialogue = 108;
p.NpcDialogueSend = false;
break;
}
}
}
A little big (h)...
Now open server.java and add these:
Code:
dialogueHandler = new DialogueHandler();
public static DialogueHandler dialogueHandler = null;
close server.java and open client.java
Add this voids and the boolean
Code:
public void selectthreeline(String line1, String line2, String line3, String line4) {
sendFrame171(1, 2474);
sendFrame171(0, 2479);
sendFrame126(""+line1+"", 2470);
sendFrame126(""+line2+"", 2471);
sendFrame126(""+line3+"", 2472);
sendFrame126(""+line4+"", 2473);
sendFrame164(2469);
NpcDialogueSend = true;
}
public void selecttwoline(String line1, String line2, String line3) {
sendFrame171(1, 2465);
sendFrame171(0, 2468);
sendFrame126(""+line1+"", 2460);
sendFrame126(""+line2+"", 2461);
sendFrame126(""+line3+"", 2462);
sendFrame164(2459);
NpcDialogueSend = true;
}
public void twosimpleline(String line1, String line2) {
sendFrame126(""+line1+"", 360);
sendFrame126(""+line2+"", 361);
sendFrame164(359);
NpcDialogueSend = true;
}
public void selectfourline(String line1, String line2,String line3,String line4,String line5) {
sendFrame171(1, 2465);
sendFrame171(0, 2468);
sendFrame126(""+line1+"", 8208);
sendFrame126(""+line2+"", 8209);
sendFrame126(""+line3+"", 8210);
sendFrame126(""+line4+"", 8211);
sendFrame126(""+line5+"", 8212);
sendFrame164(8207);
NpcDialogueSend = true;
}
public void charoneline(String line1) {
sendFrame200(969, 591);
sendFrame126(playerName, 970);
sendFrame126(""+line1+"", 971);
sendFrame164(968);
NpcDialogueSend = true;
}
public void chartwoline(String line1, String line2) {
sendFrame200(974, 591);
sendFrame126(playerName, 975);
sendFrame126(""+line1+"", 976);
sendFrame126(""+line2+"", 977);
sendFrame164(973);
NpcDialogueSend = true;
}
public void oneline(String line1) {
sendFrame200(4883, 591);
sendFrame126(GetNpcName(NpcTalkTo), 4884);
sendFrame126(""+line1+"", 4885);
sendFrame75(NpcTalkTo, 4883);
sendFrame164(4882);
NpcDialogueSend = true;
}
public void twoline(String line1, String line2) {
sendFrame200(4888, 591);
sendFrame126(GetNpcName(NpcTalkTo), 4889);
sendFrame126(""+line1+"", 4890);
sendFrame126(""+line2+"", 4891);
sendFrame75(NpcTalkTo, 4888);
sendFrame164(4887);
NpcDialogueSend = true;
}
public void threeline(String line1, String line2,String line3) {
sendFrame200(4894, 591);
sendFrame126(GetNpcName(NpcTalkTo), 4895);
sendFrame126(""+line1+"", 4896);
sendFrame126(""+line2+"", 4897);
sendFrame126(""+line3+"", 4898);
sendFrame75(NpcTalkTo, 4894);
sendFrame164(4893);
NpcDialogueSend = true;
}
public void fourline(String line1, String line2,String line3,String line4) {
sendFrame200(4901, 591);
sendFrame126(GetNpcName(NpcTalkTo), 4902);
sendFrame126(""+line1+"", 4903);
sendFrame126(""+line2+"", 4904);
sendFrame126(""+line3+"", 4905);
sendFrame126(""+line4+"", 4906);
sendFrame75(NpcTalkTo, 4901);
sendFrame164(4900);
NpcDialogueSend = true;
}
public boolean PutNPCCoords = false;
now find:
You see this:
Code:
case 40:
if (server.dialogueHandler.DialogueType[NpcDialogue] == 1 || server.dialogueHandler.DialogueType[NpcDialogue] == 3) {
NpcDialogue = server.dialogueHandler.DialogueNextDia[NpcDialogue];
NpcDialogueSend = false;
if (NpcDialogue == 0) {
RemoveAllWindows();
}
}
break;
Under this:
Add this line:
Code:
server.dialogueHandler.Case40(playerId);
Now find this:
Code:
if (NpcDialogue > 0 && NpcDialogueSend == false) {
You see this:
Code:
if (NpcDialogue > 0 && NpcDialogueSend == false) {
UpdateNPCChat();
}
Above this:
Add this line:
Code:
server.dialogueHandler.NpcChat(NpcDialogue,playerId);
okey... now find this:
and add this:
Code:
} else if (NpcDialogue == 111) {
NpcDialogue = 115;
NpcDialogueSend = false;
} else if (NpcDialogue == 166) {
NpcDialogue = 108;
NpcDialogueSend = false;
} else if (NpcDialogue == 131) {
NpcDialogue = 133;
NpcDialogueSend = false;
Now find this:
And add this:
Code:
} else if (NpcDialogue == 111) {
NpcDialogue = 112;
NpcDialogueSend = false;
} else if (NpcDialogue == 166) {
NpcDialogue = 167;
NpcDialogueSend = false;
} else if (NpcDialogue == 131) {
NpcDialogue = 132;
NpcDialogueSend = false;
now Find the NEXT!!! break; ....
and under add this:
Code:
case 9167://3/1
if (NpcDialogue == 147) {
NpcDialogue = 148;
NpcDialogueSend = false;
}
break;
case 9168://3/2
if (NpcDialogue == 147) {
NpcDialogue = 151;
NpcDialogueSend = false;
}
break;
case 9169://3/3
if (NpcDialogue == 147) {
NpcDialogue = 154;
NpcDialogueSend = false;
}
break;
case 32017://4/1
if (NpcDialogue == 118) {
NpcDialogue = 121;
NpcDialogueSend = false;
} else if (NpcDialogue == 101) {
NpcDialogue = 108;
NpcDialogueSend = false;
}
break;
case 32018://4/2
if (NpcDialogue == 118) {
NpcDialogue = 123;
NpcDialogueSend = false;
} else if (NpcDialogue == 101) {
NpcDialogue = 161;
NpcDialogueSend = false;
}
break;
case 32019://4/3
if (NpcDialogue == 118) {
NpcDialogue = 125;
NpcDialogueSend = false;
} else if (NpcDialogue == 101) {
NpcDialogue = 164;
NpcDialogueSend = false;
}
break;
case 32020://4/4
if (NpcDialogue == 101) {
NpcDialogue = 102;
NpcDialogueSend = false;
} else if (NpcDialogue == 118) {
NpcDialogue = 119;
NpcDialogueSend = false;
}
break;
now find this:
Code:
public void quest()
and add this:
Code:
if(questid == 2)
{
if(q1stage == 0)
{
loadquest("Cook's Assistant", "I can start this quest by speaking to the @[email protected]"+GetNpcName(278)+"@[email protected] in the", "Kitchen on the ground floor of @[email protected] [email protected]@.", "", "", "", "", "", "", "");
}
if(q1stage == 1)
{
loadquest("Cook's Assistant","It's the @[email protected] of Lumbridge'[email protected]@ birthday and I have to help", "his @[email protected]@[email protected] make him a birthday cake. To do this I need to", "bring him the following ingredients:", "I need to find a @[email protected] of [email protected]@.", "I need to find a @[email protected] of [email protected]@.", "I need to find an @[email protected]@[email protected]", "", "", "");
}
if(q1stage == -1)
{
loadquest("Cook's Assistant", "It was the Duke of Lumbridge's brithday, but his cook had", "forgotten to buy the ingredients he needed to make him a", "cake. I brought the cook on egg, some flour and some milk", "and the cook made me a delicious looking cake whit them.", "", "As a reward he now lets me use his high quality range", "which lets me burn things less whenever I wish to cook", "there.", "@[email protected] COMPLETE!");
}
}
Edit:
I forgott this parts sry...
find this:
Code:
case 155: //first Click npc
under add this (IF YOU DONT HAVE!) :
Code:
if (PutNPCCoords == true) {
skillX = server.npcHandler.npcs[NPCSlot].absX;
skillY = server.npcHandler.npcs[NPCSlot].absY;
}
and delete this:
Code:
boolean PutNPCCoords = false;
and add this:
Code:
} else if (NPCID == 278 && q1stage == 1 && (playerHasItem(1933) == true) && (playerHasItem(1927) == true) && (playerHasItem(1944) == true) ) {//Cook
PutNPCCoords = true;
NpcWanneTalk = 135;
} else if (NPCID == 278 && q1stage == 0) {//Cook
PutNPCCoords = true;
NpcWanneTalk = 100;
} else if (NPCID == 278 && q1stage == 1) {//Cook
PutNPCCoords = true;
NpcWanneTalk = 127;
} else if (NPCID == 278 && q1stage == -1) {//Cook
PutNPCCoords = true;
NpcWanneTalk = 146;
}
now add this int to the client.java
Code:
public int q1reward = 0;
The code need to you dont have other quests!
If you have others you need to rename the q1stage ....
This is need 1 week work for me, but I relese...(h)
Pls post the bugs and others here...
Have fun!:s