コード例 #1
0
ファイル: ElementalWorkshop.java プロジェクト: Ventuz/vscape
 public static boolean itemOnItemHandling(Player player, int firstItem, int secondItem) {
   if (firstItem == 946 && secondItem == 2886) {
     player.getInventory().removeItem(new Item(2886));
     player.getDialogue().sendStatement("You cut apart the book to find a key.");
     player.getInventory().addItem(new Item(2887));
     if (player.getQuestStage(12) == 1) {
       player.setQuestStage(12, 2);
     }
     return true;
   }
   return false;
 }
コード例 #2
0
ファイル: ElementalWorkshop.java プロジェクト: Ventuz/vscape
 public void completeQuest(Player player) {
   getReward(player);
   player.getActionSender().sendInterface(12140);
   player.getActionSender().sendString("You have completed: " + getQuestName(), 12144);
   player.getActionSender().sendString("You are rewarded: ", 12146);
   player.getActionSender().sendString("1 Quest Point,", 12150);
   player
       .getActionSender()
       .sendString((int) (expReward[0][1] * Constants.EXP_RATE) + " Crafting XP,", 12151);
   player
       .getActionSender()
       .sendString((int) (expReward[0][1] * Constants.EXP_RATE) + " Smithing XP,", 12152);
   player.getActionSender().sendString("The ability to make", 12153);
   player.getActionSender().sendString("Elemental Shields.", 12154);
   player.getActionSender().sendString("Quest points: " + player.getQuestPoints(), 12146);
   player.getActionSender().sendString(" ", 12147);
   player.setQuestStage(getQuestID(), QUEST_COMPLETE);
   player.getActionSender().sendString("@gre@" + getQuestName(), 7459);
 }
コード例 #3
0
ファイル: ElementalWorkshop.java プロジェクト: Ventuz/vscape
 public static boolean doObjectClicking(Player player, int object, int x, int y) {
   switch (object) {
     case 3389: // elemental workshop bookshelf
       if (x == 2716 && y == 3481 && !player.getInventory().ownsItem(2886)) {
         if (player.getQuestStage(12) < 1) {
           player.setQuestStage(12, 1);
           QuestHandler.getQuests()[12].startQuest(player);
         }
         player.getDialogue().sendStatement("You find an old, beaten book.");
         player.getInventory().addItem(new Item(2886));
         return true;
       }
       break;
     case 3390:
     case 3391: // elemental workshop wall
       if (player.getInventory().playerHasItem(2887)) {
         player.fadeTeleport(new Position(2716, 9888));
         if (player.getQuestStage(12) == 2) player.setQuestStage(12, 3);
         return true;
       }
       break;
     case 3397: // elemental workshop boxes
       if (player.getQuestStage(12) == 5 && !player.getInventory().playerHasItem(1741)) {
         player
             .getDialogue()
             .sendStatement("You find some leather after rummaging through the boxes.");
         player.getInventory().addItem(new Item(1741));
         return true;
       }
       break;
     case 3409: // elemental workshop bellows lever
       if (player.getQuestStage(12) == 6) {
         player
             .getDialogue()
             .sendStatement("You hear the whoosh of air as the bellows come to life.");
         // player.getActionSender().animateObject(2734, 9882, 0, 469);
         player.setQuestStage(12, 7);
         return true;
       }
       break;
     case 3398: // elemental workshop crate for stone bowl
       if (player.getQuestStage(12) == 7 && !player.getInventory().playerHasItem(2888)) {
         player.getDialogue().sendStatement("You find an empty stone bowl.");
         player.getInventory().addItem(new Item(2888));
         player.setQuestStage(12, 8);
         return true;
       }
       break;
     case 3410: // elemental workshop bellows
       if (player.getQuestStage(12) == 5) {
         if (player.getSkill().getLevel()[Skill.CRAFTING] < 20) {
           player
               .getDialogue()
               .sendStatement("You need a Crafting level of 20 to fix the bellows.");
           return true;
         } else if (player.getInventory().playerHasItem(1733)
             && player.getInventory().playerHasItem(1734)
             && player.getInventory().playerHasItem(1741)) {
           player.getInventory().removeItem(new Item(1734));
           player.getInventory().removeItem(new Item(1741));
           player
               .getDialogue()
               .sendStatement(
                   "You patch up the bellows.", "You should be able to pull the lever now.");
           player.setQuestStage(12, 6);
           return true;
         } else {
           player
               .getDialogue()
               .sendStatement(
                   "The hole looks rather large.",
                   "You will need needle, thread, and a piece of regular leather.");
           return true;
         }
       }
       break;
     case 3404:
     case 3405: // elemental workshop water valve
       if (x == 2726 && y == 9908 && player.getQuestStage(12) == 3) {
         player.getDialogue().sendStatement("You turned the valve on. You hear water flowing.");
         return true;
       } else if (x == 2713 && y == 9908 && player.getQuestStage(12) == 3) {
         player
             .getDialogue()
             .sendStatement("You turned the valve on. You hear lots of water flowing.");
         player.setQuestStage(12, 4);
         return true;
       }
       break;
     case 3406: // elemental workshop water wheel
       if (player.getQuestStage(12) == 4) {
         player.getDialogue().sendStatement("You hear a lurch and a squeel as the wheel turns.");
         player.getActionSender().animateObject(2719, 9907, 0, 472);
         player.setQuestStage(12, 5);
         return true;
       } else {
         player.getDialogue().sendStatement("The lever won't budge without flowing water.");
         return true;
       }
   }
   return false;
 }
コード例 #4
0
ファイル: ElementalWorkshop.java プロジェクト: Ventuz/vscape
 public static boolean doItemOnObject(Player player, int object, int item) {
   switch (object) {
     case 3402: // elemental workshop workbench
       if (item == 2893
           && player.getQuestStage(12) >= 10
           && player.getSkill().getLevel()[Skill.SMITHING] >= 20) {
         if (player.getInventory().playerHasItem(2347)) {
           player.getInventory().removeItem(new Item(2893));
           player.getInventory().addItem(new Item(2890));
           if (player.getQuestStage(12) == 10) {
             player.setQuestStage(12, 11);
             QuestHandler.completeQuest(player, 12);
             return true;
           }
           return true;
         } else {
           player.getDialogue().sendStatement("You need a hammer to smith!");
           return true;
         }
       } else if (player.getSkill().getLevel()[Skill.SMITHING] < 20) {
         player.getDialogue().sendStatement("You need 20 smithing to smith and elemental shield.");
         return true;
       }
       break;
     case 3413: // elemental workshop furnace
       if (item == 2889 && player.getQuestStage(12) == 8) {
         player
             .getDialogue()
             .sendStatement("The furnace flares dramatically as you pour the lava in.");
         player.getInventory().replaceItemWithItem(new Item(2889), new Item(2888));
         player.setQuestStage(12, 9);
         return true;
       } else if (item == 2892 && player.getQuestStage(12) >= 9) {
         if (player.getInventory().playerHasItem(453, 4)) {
           player.getInventory().removeItem(new Item(2892));
           player.getInventory().removeItem(new Item(453, 4));
           player.getInventory().addItem(new Item(2893));
           player.getActionSender().sendMessage("You smelt the elemental ore in the furnace.");
           player.getActionSender().sendMessage("You retrieve elemental metal from the furnace.");
           player.getUpdateFlags().sendAnimation(899);
           player.getActionSender().sendSound(469, 0, 0);
           if (player.getQuestStage(12) == 9) {
             player.setQuestStage(12, 10);
           }
           return true;
         } else {
           player.getDialogue().sendStatement("You need 4 coal to smelt Elemental Ore.");
           return true;
         }
       } else if (player.getQuestStage(12) >= 7) {
         if (item == GlassMaking.BUCKET_OF_SAND) GlassMaking.makeMoltenGlass(player);
         else if (item == GemCrafting.GOLD_BAR) GemCrafting.openInterface(player);
         else if (item == SilverCrafting.SILVER_BAR) Menus.sendSkillMenu(player, "silverCrafting");
         else if (ItemManager.getInstance().getItemName(item).toLowerCase().endsWith("ore")
             && item != 668) Smelting.smeltInterface(player);
         else if (item == 668) Dialogues.startDialogue(player, 10200);
         return true;
       }
       break;
     case 3414: // elemental workshop lava trough
       if (item == 2888 && player.getQuestStage(12) == 8) {
         player.getDialogue().sendStatement("You carefully fill the bowl with lava.");
         player.getInventory().replaceItemWithItem(new Item(2888), new Item(2889));
         return true;
       }
       break;
   }
   return false;
 }
コード例 #5
0
ファイル: ElementalWorkshop.java プロジェクト: Ventuz/vscape
 public void startQuest(Player player) {
   player.setQuestStage(getQuestID(), QUEST_STARTED);
   player.getActionSender().sendString("@yel@" + getQuestName(), 7459);
 }