Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if (componentId == 38) {
- if (!canCreateGatestone())
- return false;
- if (packetId == WorldPacketsDecoder.ACTION_BUTTON2_PACKET) {
- player.getInventory().deleteItem(DungeonConstants.GATESTONE, 1);
- player.getInventory().addItem(DungeonConstants.GATESTONE, 1);
- player.getInventory().deleteItem(Magic.DUNG_COSMIC_RUNE, 3);
- player.getSkills().addXp(Skills.MAGIC, 43.5);
- player.setNextAnimation(new Animation(713));
- player.setNextGraphics(new Graphics(113));
- if (gatestone != null) {
- FloorItem item = World.getRegion(gatestone.getRegionId())
- .getGroundItem(DungeonConstants.GATESTONE, gatestone, player);
- if (item == null)
- return false;
- World.removeGroundItem(player, item, false);
- setGatestone(null);
- }
- } else {
- if (player.getInventory().containsItem(DungeonConstants.GATESTONE, 1)) {
- player.getPackets().sendGameMessage(
- "You already have a gatestone in your pack. Making another would be pointless.");
- } else if (gatestone != null) {
- player.getDialogueManager().startDialogue(new Dialogue() {
- @Override
- public void start() {
- this.sendDialogue("You already have an active gatestone, ",
- "Do you want to destroy your current and make another?");
- }
- @Override
- public void run(int interfaceId, int componentId) {
- if (stage == -1) {
- stage = 0;
- this.sendOptionsDialogue(DEFAULT_OPTIONS_TITLE, "Yes.", "No.");
- } else if (stage == 0) {
- if (componentId == OPTION_1) {
- player.getInventory().addItem(DungeonConstants.GATESTONE, 1);
- player.getInventory().deleteItem(Magic.DUNG_COSMIC_RUNE, 3);
- player.getSkills().addXp(Skills.MAGIC, 43.5);
- player.setNextAnimation(new Animation(713));
- player.setNextGraphics(new Graphics(113));
- if (gatestone != null) {
- FloorItem item = World.getRegion(gatestone.getRegionId())
- .getGroundItem(DungeonConstants.GATESTONE, gatestone, player);
- if (item == null)
- return;
- World.removeGroundItem(player, item, false);
- setGatestone(null);
- }
- }
- end();
- }
- }
- @Override
- public void finish() {
- // TODO Auto-generated method stub
- }
- });
- } else {
- player.getInventory().addItem(DungeonConstants.GATESTONE, 1);
- player.getInventory().deleteItem(Magic.DUNG_COSMIC_RUNE, 3);
- player.getSkills().addXp(Skills.MAGIC, 43.5);
- player.setNextAnimation(new Animation(713));
- player.setNextGraphics(new Graphics(113));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment