What you will be adding:
Step 1.
Make a new file called WitchesPotion.java in src-server-model-players-quests.
Then add this in.
Code:
package server.model.players.quests;
import server.model.players.Client;
import server.model.players.ActionHandler;
/*
* @author Liam Aka Insidia X (R-S Name).
*/
public class WitchesPotion {
Client c;
public WitchesPotion(Client c) {
this.c = c;
}
public void showInformation() {
for (int i = 8144; i < 8195; i++) {
c.getPA().sendFrame126("", i);
}
c.getPA().sendFrame126("@dre@Witches Potion", 8144);
c.getPA().sendFrame126("", 8145);
if(c.WitchesPotion == 0) {
c.getPA().sendFrame126("Witches Potion", 8144);
c.getPA().sendFrame126("Talk to Hetty in her house in Rimmington, south of Falador,", 8147);
c.getPA().sendFrame126("west of Port Sarim.", 8148);
c.getPA().sendFrame126("", 8149);
c.getPA().sendFrame126("There are no requirments.", 8150);
} else if(c.WitchesPotion == 1) {
c.getPA().sendFrame126("Witches Potion", 8144);
c.getPA().sendFrame126("@str@I've talked to Hetty.", 8147);
c.getPA().sendFrame126("She wants me to gather the following ingredients:", 8148);
if(c.getItems().playerHasItem(300,1)) {
c.getPA().sendFrame126("@str@A Rat's tail", 8149);
} else {
c.getPA().sendFrame126("@red@A Rat's tail", 8149);
}
if(c.getItems().playerHasItem(2146,1)) {
c.getPA().sendFrame126("@str@Some Burnt Meat", 8150);
} else {
c.getPA().sendFrame126("@red@Some Burnt Meat", 8150);
}
if(c.getItems().playerHasItem(221,1)) {
c.getPA().sendFrame126("@str@An Eye of newt", 8151);
} else {
c.getPA().sendFrame126("@red@An Eye of newt", 8151);
}
if(c.getItems().playerHasItem(1957,1)) {
c.getPA().sendFrame126("@str@And An Onion", 8152);
} else {
c.getPA().sendFrame126("@red@And An Onion", 8152);
}
} else if(c.WitchesPotion == 2) {
c.getPA().sendFrame126("Witches Potion", 8144);
c.getPA().sendFrame126("@str@I've talked to Hetty.", 8147);
c.getPA().sendFrame126("She wants me to gather the following ingredients:", 8148);
if(c.getItems().playerHasItem(300,1)) {
c.getPA().sendFrame126("@str@A Rat's tail", 8149);
} else {
c.getPA().sendFrame126("@red@A Rat's tail", 8149);
}
if(c.getItems().playerHasItem(2146,1)) {
c.getPA().sendFrame126("@str@Some Burnt Meat", 8150);
} else {
c.getPA().sendFrame126("@red@Some Burnt Meat", 8150);
}
if(c.getItems().playerHasItem(221,1)) {
c.getPA().sendFrame126("@str@An Eye of newt", 8151);
} else {
c.getPA().sendFrame126("@red@An Eye of newt", 8151);
}
if (c.getItems().playerHasItem(1957,1)) {
c.getPA().sendFrame126("@str@And An Onion", 8152);
} else {
c.getPA().sendFrame126("@red@And An Onion", 8152);
}
} else if(c.WitchesPotion == 3) {
c.getPA().sendFrame126("Witches", 8144);
c.getPA().sendFrame126("@str@I talked to Hetty.", 8147);
c.getPA().sendFrame126("@str@I gave her the ingredients.", 8148);
c.getPA().sendFrame126("@red@ QUEST COMPLETE", 8150);
c.getPA().sendFrame126("As a reward, I gained 325,000 Magic Experience.", 8151);
}
c.getPA().showInterface(8134);
}
}
Step 2.
Go to dialoguehandler class and put this in it.
Code:
/**
* Witches Potion
*
* Made by Liam
* Credits too - I'm A Boss
*
*/
case 549:
sendNpcChat1("Okay, please hurry, the cauldron is waiting.", c.talkingNpc, "Hetty");
c.nextChat = 0;
break;
case 550:
sendNpcChat1("What could you want with an old woman like me?", c.talkingNpc, "Hetty");
c.nextChat = 551;
break;
case 551:
c.dialogueAction = 530;
sendOption2("I am in search of a Quest.","Nothing");
break;
case 552:
sendPlayerChat1("I am in search of a quest.");
c.nextChat = 553;
break;
case 553:
sendNpcChat1("Hmmm, maybe I could think of something for you.", c.talkingNpc, "Hetty");
c.nextChat = 554;
break;
case 554:
sendNpcChat1("Would you like to become more proficient in the dark arts?", c.talkingNpc, "Hetty");
c.nextChat = 555;
break;
case 555:
sendPlayerChat1("Yes help me become one with my darker side.");
c.WitchesPotion = 1;
c.nextChat = 556;
break;
case 556:
sendNpcChat1("Ok, I'm going to make a potion to help bring out your darker self.", c.talkingNpc, "Hetty");
c.nextChat = 557;
break;
case 557:
sendNpcChat1("You will need certain ingredients.", c.talkingNpc, "Hetty");
c.nextChat = 558;
break;
case 558:
sendPlayerChat1("What do I need?");
c.nextChat = 559;
break;
case 559:
sendNpcChat2("You need an eye of newt, a rat's tail, an onion...", "Oh and a peice of burnt mean.", c.talkingNpc, "Hetty");
c.nextChat = 560;
break;
case 560:
sendPlayerChat1("Okay, I will go and get them now.");
c.nextChat = 0;
break;
case 561:
sendNpcChat1("So have you found the things for my potion?", c.talkingNpc, "Hetty");
c.nextChat = 562;
break;
case 562:
if(c.getItems().playerHasItem(300, 1) && c.getItems().playerHasItem(2146, 1) && c.getItems().playerHasItem(221, 1)&& c.getItems().playerHasItem(1957, 1)) {
sendPlayerChat1("Yes I have Everything!");
c.nextChat = 563;
} else {
sendPlayerChat1("I don't have all the items yet.");
c.nextChat = 549;
}
case 563:
sendNpcChat1("Excellent can I have them?", c.talkingNpc, "Hetty");
c.nextChat = 564;
break;
case 564:
sendNpcChat1("Great, you brought me everything I need.", c.talkingNpc, "Hetty");
c.getItems().deleteItem(300, 1);
c.getItems().deleteItem(2146, 1);
c.getItems().deleteItem(221, 1);
c.getItems().deleteItem(1957, 1);
c.WitchesPotion = 2;
c.nextChat = 565;
break;
case 565:
sendPlayerChat1("Well is it ready?");
c.nextChat = 566;
break;
case 566:
sendNpcChat1("Yes, now drink up, and enjoy.", c.talkingNpc, "Hetty");
c.nextChat = 0;
c.sendMessage("You drink the witches potion");
c.getPA().witchFinish();
break;
case 567:
sendNpcChat1("You are now a Dark Wizard.", c.talkingNpc, "Hetty");
break;
/*end of Witches Potion*/
Step 3.
Go to clickingbuttons and under case 9157 add this.
Code:
if(c.dialogueAction == 530 && c.WitchesPotion == 0) {
c.getDH().sendDialogues(552, 307);
return;
}
Step 4.
Open actionhandler and put this in it.
Code:
case 307:
if(c.WitchesPotion == 0) {
c.getDH().sendDialogues(550, 307);
} else if(c.WitchesPotion == 1) {
c.getDH().sendDialogues(561, 307);
} else if(c.WitchesPotion == 3) {
c.getDH().sendDialogues(567, 307);
}
break;
Step 5.
Go to playerassistant and add these methods somewhere, you might already have loadQuest, so if so, add the WitchesPotion code, under it.
Code:
public void loadQuests() {
if(c.WitchesPotion == 0) {
sendFrame126("@red@Witches Potion", 7383);
} else if(c.WitchesPotion == 3) {
sendFrame126("@gre@Witches Potion", 7383);
} else {
sendFrame126("@yel@Witches Potion", 7383);
}
}
/**Witches Potion**/
public void witchFinish() {
c.WitchesPotion = 3;
c.getPA().addSkillXP(325000, 6);
c.getPA().showInterface(297);
c.getPA().showInterface(12140);
c.getPA().sendFrame126("You have completed: Witches Potion", 12144);
c.getPA().sendFrame126("325,000 Magic Experience", 12150);
c.getPA().sendFrame126("", 12151);
c.getPA().sendFrame126("", 12152);
c.getPA().sendFrame126("", 12153);
c.getPA().sendFrame126("", 12154);
c.getPA().sendFrame126("", 12155);
c.getPA().sendFrame126("@gre@Witches Potion", 7332);
}
Step 6.
Now still in client.java Find
Code:
private Food food = new Food(this);
and under it add.
Code:
private WitchesPotion witchesPotion = new WitchesPotion(this);
Make sure you add imports at top. You should know how to do this.
Step 7.
Search for,
Code:
public Food getFood() {
Under it add
Code:
public WitchesPotion getWP() {
return witchesPotion;
}
Step 8.
Go into now go to playersave and add
Code:
else if (token.equals("WitchesPotion")) {
p.WitchesPotion = Integer.parseInt(token2);
}
Step 9.
Still in playersave add this now.
Code:
characterfile.newLine();
characterfile.write("WitchesPotion = ", 0, 15);
characterfile.write(Integer.toString(p.WitchesPotion), 0, Integer.toString(p.WitchesPotion).length());
characterfile.newLine();
Step 10. The final step.
go into player.java and add
If you use this please thank me and rep, and if you post on other sites please give credits ty.