Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.rs.game.player.dialogues.impl;
- import com.rs.game.Animation;
- import com.rs.game.ForceMovement;
- import com.rs.game.ForceTalk;
- import com.rs.game.Graphics;
- import com.rs.game.World;
- import com.rs.game.WorldTile;
- import com.rs.game.item.Item;
- import com.rs.game.npc.NPC;
- import com.rs.game.player.QuestManager.Quests;
- import com.rs.game.player.Skills;
- import com.rs.game.player.content.ItemConstants;
- import com.rs.game.player.dialogues.Dialogue;
- import com.rs.game.tasks.WorldTask;
- import com.rs.game.tasks.WorldTasksManager;
- import com.rs.utils.Utils;
- public class CompletionistCape extends Dialogue {
- static final int[] randomNPC = { 6935, 3283, 4344, 6966 };
- int capeId;
- NPC guard;
- /**
- * This dialogue is sent upon the player clicking on object id: 2562.
- */
- @Override
- public void start() {
- sendNPCDialogue(
- 4405,
- 9827,
- "Hey! Get your hands off that! Don't you know not to touch items that don't belong to you.");
- }
- @Override
- public void run(int interfaceId, int componentId) {
- switch (stage) {
- case -1:
- sendPlayerDialogue(9827, "Sorry, I just wondered what it was.");
- stage = 1;
- break;
- case 1:
- sendNPCDialogue(4405, 9827,
- "A good question. It's perhaps one of more mysterious exibits in this land.");
- stage = 2;
- break;
- case 2:
- sendNPCDialogue(
- 4405,
- 9827,
- "It was only discovered recently, but I have"
- + " dated it back almost as far as I can track. It turns out"
- + " this cape might be the product, or at least involved with a"
- + " Second Age mage by the name of Anima.");
- stage = 3;
- break;
- case 3:
- sendPlayerDialogue(9827, "Anima?");
- stage = 4;
- break;
- case 4:
- sendNPCDialogue(
- 4405,
- 9827,
- "Indeed, you might have learned about him. He"
- + " was a powerful mage back in the First Age. Very skill-"
- + " focused too, so this cape was a particular find.");
- stage = 5;
- break;
- case 5:
- sendPlayerDialogue(9827, "What do you mean by that?");
- stage = 6;
- break;
- case 6:
- sendNPCDialogue(
- 4405,
- 9827,
- "Well, generally, his magical abilities were focused away"
- + " from combat - it seems this cape is under the mose"
- + " powerful enchantment we've ever seen.");
- stage = 7;
- break;
- case 7:
- sendPlayerDialogue(9827, "This cape is enchanted?");
- stage = 8;
- break;
- case 8:
- sendNPCDialogue(
- 4405,
- 9827,
- "Yes, and more than I can grasp. It physically repels anyone who tries to touch"
- + " it. I had quite a hassle getting it here with a ship.");
- stage = 9;
- break;
- case 9:
- sendPlayerDialogue(9827, "So no one has worn this cape?");
- stage = 10;
- break;
- case 10:
- sendNPCDialogue(
- 4405,
- 9827,
- "No one can! It's like it has a mind of it's own juding those who try as unworthy.");
- stage = 11;
- break;
- case 11:
- sendOptionsDialogue("Select Option", "Can I try?",
- "How interesting.");
- stage = 12;
- break;
- case 12:
- switch (componentId) {
- case OPTION_1:
- stage = 13;
- sendPlayerDialogue(9827, "Can I try?");
- break;
- case OPTION_2:
- default:
- stage = 30;
- sendPlayerDialogue(9827, "How interesting.");
- break;
- }
- break;
- case 13:
- sendNPCDialogue(
- 4405,
- 9827,
- "I said no touching... but, if you get close enough, I'm sure you'll the enchantment affects"
- + " ... Good luck!");
- stage = 14;
- break;
- case 14:
- if (!ItemConstants.canWear(new Item(20769), player)) {
- player.getInterfaceManager().removeDialogueInterface();
- player.lock();
- player.setNextFaceWorldTile(new WorldTile(3263, 3455, 2));
- WorldTasksManager.schedule(new WorldTask() {
- int phase = 0;
- @Override
- public void run() {
- switch (phase) {
- case 0:
- player.setNextAnimation(new Animation(857));
- break;
- case 1:
- player.setNextAnimation(new Animation(915));
- break;
- case 2:
- player.setNextAnimation(new Animation(857));
- break;
- case 3:
- player.setNextGraphics(new Graphics(86));
- player.getAppearence().transformIntoNPC(randomNPC[Utils.random(randomNPC.length - 1)]);
- break;
- case 4:
- player.setNextForceTalk(new ForceTalk("..What."));
- break;
- case 5:
- player.setNextGraphics(new Graphics(86));
- player.getAppearence().transformIntoNPC(-1);
- player.setNextAnimation(new Animation(10070));
- player.setNextForceMovement(new ForceMovement(
- new WorldTile(3263, 3453, 2), 1, 0));
- break;
- case 6:
- player.setNextWorldTile(new WorldTile(3263, 3453, 2));
- player.setNextFaceWorldTile(new WorldTile(3263, 3455, 2));
- sendNPCDialogue(4405, 9827,
- "Looks like Anima had a sense of humour!");
- player.unlock();
- break;
- }
- phase++;
- }
- }, 2, 2);
- stage = 15;
- } else {// TODO: Animation & graphics
- sendNPCDialogue(4405, 9827,
- "I've not seen a reaction like that! I think this cape is"
- + " identifying it's true owner.");
- stage = 16;
- }
- break;
- case 15:
- player.setNextFaceEntity(null);
- player.unlock();
- sendNPCDialogue(4405, 9827,
- "Sorry, it doesn't look like you are worthy of this cape. At"
- + " least not yet...");
- stage = -2;
- break;
- case 16:
- sendPlayerDialogue(9827, "You mean I can have it?");
- stage = 17;
- break;
- case 17:
- sendNPCDialogue(
- 4405,
- 9827,
- "Well, yes, but... I can't just let you take the cape. You"
- + " may be the true owner, but it is one of the most"
- + " treasured items I have.");
- stage = 18;
- break;
- case 18:
- sendNPCDialogue(
- 4405,
- 9827,
- "I suppose if I were compensated, perhaps I"
- + " could let you take it... How does 5,000,000 coins"
- + " sound?");
- stage = 19;
- break;
- case 19:
- sendOptionsDialogue("Select Option",
- "That sounds fair.", "That sounds like a joke!");
- stage = 20;
- break;
- case 20:
- switch (componentId) {
- case OPTION_1:
- sendPlayerDialogue(9827, "That sounds fair.");
- stage = 21;
- break;
- case OPTION_2:
- sendPlayerDialogue(9827, "That sounds like a joke!");
- stage = -2;
- break;
- }
- break;
- case 21:
- if (player.getInventory().getCoinsAmount() < 5000000) {
- sendNPCDialogue(
- 4405,
- 9827,
- "Alright, well come talk to me again when you have enough gold and I'll let you have it.");
- stage = -2;
- } else {
- if (player.getInventory().getFreeSlots() < 2) {
- sendNPCDialogue(4405, 9827,
- "Sorry, but your inventory seems to be full, please come back "
- + "with more space.");
- stage = -2;
- } else {
- int value = 5000000;
- player.getInventory().removeItemMoneyPouch(new Item(995,value));
- sendNPCDialogue(4405, 9827, "Thanks, enjoy!");
- player.getInventory().addItem(new Item(20769, 1));
- player.getInventory().addItem(new Item(20770, 1));
- stage = -2;
- }
- }
- break;
- case 30:
- sendNPCDialogue(4405, 9827, "Thanks for wasting my time.");
- stage = -2;
- break;
- case -2:
- end();
- break;
- }
- }
- public void sendRequirementMessages() {
- }
- @Override
- public void finish() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement