public static void displayMerch(MapleClient c) {
    int conv = c.getPlayer().getConversation();
    boolean merch = World.hasMerchant(c.getPlayer().getAccountID(), c.getPlayer().getId());
    MerchItemPackage pack;
    if (merch) {
      c.getPlayer().dropMessage(1, "Please close the existing store and try again.");
      c.getPlayer().setConversation(0);
    } else if (c.getChannelServer().isShutdown()) {
      c.getPlayer().dropMessage(1, "The world is going to shut down.");
      c.getPlayer().setConversation(0);
    } else if (conv == 3) {
      pack = loadItemFrom_Database(c.getPlayer().getAccountID());

      if (pack == null) {
        c.getPlayer().dropMessage(1, "You do not have any item(s) with Fredrick.");
        c.getPlayer().setConversation(0);
      } else if (pack.getItems().size() <= 0) {
        if (!check(c.getPlayer(), pack)) {
          c.getSession().write(PlayerShopPacket.merchItem_Message(33));
          return;
        }
        if (deletePackage(
            c.getPlayer().getAccountID(), pack.getPackageid(), c.getPlayer().getId())) {
          c.getPlayer().fakeRelog();
          c.getPlayer().gainMeso(pack.getMesos(), false);
          c.getSession().write(PlayerShopPacket.merchItem_Message(29));
          c.getPlayer().dropMessage(1, "You have retrieved your mesos.");
        } else {
          c.getPlayer().dropMessage(1, "An unknown error occured.");
        }
        c.getPlayer().setConversation(0);
      } else {
        c.getSession().write(PlayerShopPacket.merchItemStore_ItemData(pack));
        MapleInventoryManipulator.checkSpace(c, conv, conv, null);
        for (Item item : pack.getItems()) {
          if (c.getPlayer()
              .getInventory(GameConstants.getInventoryType(item.getItemId()))
              .isFull()) {
            c.removeClickedNPC();
            c.getPlayer().dropMessage(1, "Your inventory is full (Please relog)");
            break;
          }
          MapleInventoryManipulator.addFromDrop(c, item, true);
          deletePackage(c.getPlayer().getAccountID(), pack.getPackageid(), c.getPlayer().getId());

          c.removeClickedNPC();
        }
        c.getPlayer().dropMessage(1, "Items have been returned to you, please relog.");
      }
    }

    c.getSession().write(CWvsContext.enableActions());
  }
Example #2
0
 @Override
 public int execute(MapleClient c, String[] splitted) {
   c.removeClickedNPC();
   NPCScriptManager.getInstance().dispose(c);
   c.getSession().write(CWvsContext.enableActions());
   return 1;
 }
Example #3
0
 @Override
 public int execute(MapleClient c, String[] splitted) {
   c.removeClickedNPC();
   NPCScriptManager.getInstance().dispose(c);
   ItemScriptManager.getInstance().dispose(c);
   QuestScriptManager.getInstance().dispose(c);
   c.getSession().write(MaplePacketCreator.enableActions());
   c.getPlayer().dropMessage(6, "解卡成功。");
   return 1;
 }
Example #4
0
 @Override
 public int execute(MapleClient c, String[] splitted) {
   c.getPlayer()
       .dropMessage(
           6,
           "You currently have "
               + c.getPlayer().getCSPoints(1)
               + " Cash, "
               + c.getPlayer().getEPoints()
               + " Event Points, "
               + c.getPlayer().getDPoints()
               + " Donation Points, "
               + c.getPlayer().getVPoints()
               + " voting points and "
               + c.getPlayer().getIntNoRecord(GameConstants.BOSS_PQ)
               + " Boss Party Quest points.");
   c.getPlayer()
       .dropMessage(
           6,
           "The time is currently "
               + FileoutputUtil.CurrentReadable_TimeGMT()
               + " GMT. | EXP "
               + (Math.round(c.getPlayer().getEXPMod()) * 100)
                   * Math.round(c.getPlayer().getStat().expBuff / 100.0)
               + "%, Drop "
               + (Math.round(c.getPlayer().getDropMod()) * 100)
                   * Math.round(c.getPlayer().getStat().dropBuff / 100.0)
               + "%, Meso "
               + Math.round(c.getPlayer().getStat().mesoBuff / 100.0) * 100
               + "%");
   c.getPlayer()
       .dropMessage(6, "EXP: " + c.getPlayer().getExp() + " / " + c.getPlayer().getNeededExp());
   c.removeClickedNPC();
   NPCScriptManager.getInstance().dispose(c);
   c.getSession().write(CWvsContext.enableActions());
   return 1;
 }