Code:
/**
* @author Noobscape
* @link www.rune-server.org
*/
public class MakeOverMage extends Dialogue {
int npcId;
@Override
public void start() {
npcId = (Integer) parameters[0];
sendEntityDialogue(
SEND_3_TEXT_CHAT,
new String[] {
"Make Over Mage",
"Hello there! I am know as the Makeover Mage! I have",
"spent many years researching magicks that can change",
"your physical appearence." }, IS_NPC, npcId, 9827);
}
@Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
npcId = (Integer) parameters[0];
sendEntityDialogue(SEND_2_TEXT_CHAT,
new String[] {
"Make Over Mage",
"I call it a 'makeover'.",
"Would you like to perform my magicks on you?" },
IS_NPC, npcId, 9827);
stage = 1;
} else if (stage == 1) {
sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE,
"Tell me more about this 'makeover'.", "Sure, do it.",
"No thanks.", "Cool amulet! Can I have one?");
stage = 2;
} else if (stage == 2) {
if (componentId == OPTION_1)
stage = 3;
else if (componentId == OPTION_2)
stage = 4;
else if (componentId == OPTION_3)
stage = 17;
else if (componentId == OPTION_4) {
stage = 6;
}
} if (stage == 3) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"Tell me more about this 'makeover'" }, IS_PLAYER,
player.getIndex(), 9827);
stage = 7;
} if (stage == 4) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"Sure, do it." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 19;
} if (stage == 5) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"No thanks. I'm happy as Saradomin made me." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 20;
} if (stage == 6) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"Cool amulet! Can I have one?" }, IS_PLAYER,
player.getIndex(), 9827);
stage = 21;
} else if (stage == 21) {
npcId = (Integer) parameters[0];
sendEntityDialogue(
SEND_3_TEXT_CHAT,
new String[] {
"Make Over Mage",
"No problem, but please remember that the amulet I will",
"sell you is only a copy of my own. It contains no magical",
"powers and, as such, it will only cost you 100 coins." },
IS_NPC, npcId, 9827);
stage = 22;
} else if (stage == 7) {
sendEntityDialogue(
SEND_2_TEXT_CHAT,
new String[] {
"Make Over Mage",
"Why, of course! Basically, and I will explain so that",
"you understand it correctly," }, IS_NPC, npcId,
9827);
stage = 8;
} else if (stage == 8) {
npcId = (Integer) parameters[0];
sendEntityDialogue(
SEND_2_TEXT_CHAT,
new String[] {
"Make Over Mage",
"I use my secret magical technique to melt your body down",
"into a puddle of its elements" }, IS_NPC, npcId,
9827);
stage = 9;
} else if (stage == 9) {
npcId = (Integer) parameters[0];
sendEntityDialogue(
SEND_2_TEXT_CHAT,
new String[] {
"Make Over Mage",
"When I have broken down all components of your body, I",
"then rebuilt it into the form I am thinking of." },
IS_NPC, npcId, 9827);
stage = 10;
} else if (stage == 10) {
npcId = (Integer) parameters[0];
sendEntityDialogue(
SEND_1_TEXT_CHAT,
new String[] {
"Make Over Mage",
"Or, you know, something vaguely close enough, anyway." },
IS_NPC, npcId, 9827);
stage = 11;
} if (stage == 11) {
sendEntityDialogue(
SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"Uh... that doesn't sound particualry safe to me." },
IS_PLAYER, player.getIndex(), 9827);
stage = 12;
} else if (stage == 12) {
npcId = (Integer) parameters[0];
sendEntityDialogue(
SEND_2_TEXT_CHAT,
new String[] {
"Make Over Mage",
"It's as safe as houses. Why, I have only had thirty-six",
"major accidents this month!" }, IS_NPC, npcId,
9827);
stage = 13;
} else if (stage == 13) {
npcId = (Integer) parameters[0];
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] {
"Make Over Mage",
"So what do you say? Feel like a change?" },
IS_NPC, npcId, 9827);
stage = 14;
} else if (stage == 14) {
sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE,
"Sure do it.", "No thanks.");
stage = 15;
} else if (stage == 15) {
if (componentId == OPTION_1)
stage = 16;
else if (componentId == OPTION_2) {
stage = 17;
}
} if (stage == 16) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"Sure, do it." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 19;
} if (stage == 19) {
PlayerLook.openMageMakeOver(player);
end();
} if (stage == 17) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"No thanks. I'm happy as Saradomin made me." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 20;
} else if (stage == 20) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] {
"Make Over Mage",
"Ehhh...suit yourself." }, IS_NPC, npcId, 9827);
end();
} else if (stage == 22) {
sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE,
"Sure, here you go.", "No way! That's too expensive.");
stage = 23;
} else if (stage == 23) {
if (componentId == OPTION_1)
stage = 24;
else if (componentId == OPTION_2) {
stage = 25;
}
if (stage == 24) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"Sure, here you go." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 26;
if (!(player.money != 995))
end();
}
if (stage == 26) {
sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { "",
"You receive an amulet in exchange for 100 coins." },
IS_ITEM, 7803, SEND_NO_EMOTE);
player.money -= 100;
player.getPackets().sendRunScript(5561, 0, 100);
player.getInventory().addItem(7803, 1);
stage = 27;
} if (stage == 25) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(),
"No way! That's too expensive." }, IS_PLAYER,
player.getIndex(), 9827);
stage = 27;
}
//fixed by cr3zzy
if (stage == 27) {
end();
}
else stage++;
@Override
public void finish() {
// TODO Auto-generated method stub
}
}