Exemple #1
0
 @Override
 public void clickItem(L1Character cha, ClientBasePacket packet) {
   if (cha instanceof L1PcInstance) {
     L1PcInstance pc = (L1PcInstance) cha;
     L1ItemInstance useItem = pc.getInventory().getItem(this.getId());
     int itemId = this.getItemId();
     L1ItemInstance l1iteminstance1 = pc.getInventory().getItem(packet.readD());
     if (itemId == 50020) { // 봉인줌서
       if (l1iteminstance1.getBless() >= 0 && l1iteminstance1.getBless() <= 3) {
         int Bless = 0;
         switch (l1iteminstance1.getBless()) {
           case 0:
             Bless = 128;
             break; // 축
           case 1:
             Bless = 129;
             break; // 보통
           case 2:
             Bless = 130;
             break; // 저주
           case 3:
             Bless = 131;
             break; // 미확인
         }
         l1iteminstance1.setBless(Bless);
         pc.getInventory().updateItem(l1iteminstance1, L1PcInventory.COL_BLESS);
         pc.getInventory().saveItem(l1iteminstance1, L1PcInventory.COL_BLESS);
         pc.getInventory().removeItem(useItem, 1);
       } else pc.sendPackets(new S_ServerMessage(79)); // \f1 아무것도 일어나지 않았습니다.
     } else if (itemId == 50021) { // 봉인해제줌서
       if (l1iteminstance1.getBless() >= 128 && l1iteminstance1.getBless() <= 131) {
         int Bless = 0;
         switch (l1iteminstance1.getBless()) {
           case 128:
             Bless = 0;
             break;
           case 129:
             Bless = 1;
             break;
           case 130:
             Bless = 2;
             break;
           case 131:
             Bless = 3;
             break;
         }
         l1iteminstance1.setBless(Bless);
         pc.getInventory().updateItem(l1iteminstance1, L1PcInventory.COL_BLESS);
         pc.getInventory().saveItem(l1iteminstance1, L1PcInventory.COL_BLESS);
         pc.getInventory().removeItem(useItem, 1);
       } else pc.sendPackets(new S_ServerMessage(79)); // \f1 아무것도 일어나지 않았습니다.	
     }
   }
 }
Exemple #2
0
 @Override
 public void execute(L1PcInstance pc, String cmdName, String arg) {
   try {
     StringTokenizer st = new StringTokenizer(arg);
     int gfxid = Integer.parseInt(st.nextToken(), 10);
     int count = Integer.parseInt(st.nextToken(), 10);
     L1ItemInstance item = null;
     for (int i = 0; i < count; i++) {
       item = ItemTable.getInstance().createItem(40005);
       item.getItem().setGfxId(gfxid + i);
       item.getItem().setName(String.valueOf(gfxid + i));
       item.getItem().setNameId(String.valueOf(gfxid + i));
       pc.getInventory().storeItem(item);
     }
   } catch (Exception exception) {
     pc.sendPackets(new S_SystemMessage(cmdName + " [id] [출현시키는 수]로 입력해 주세요. "));
   }
 }
  private void giveFeather(L1PcInstance pc) {

    pc.setTimeCount(0);
    int featherCount = 0;

    if (Config.GAME_SERVER_TYPE == 1) {
      featherCount = 600;
    } else {
      if (pc.isPrivateShop()) {
        featherCount = 1;
      } else {
        featherCount = 18;
      }
    }
    featherCount *= pc.getadFeature();

    pc.getInventory().storeItem(41159, featherCount); // 신비한 날개깃털 지급
    pc.sendPackets(new S_ServerMessage(403, "$5116 (" + featherCount + ")"));
  }
Exemple #4
0
  private void buttonPolyClicked(MouseEvent evt) {

    String kname1 = 닉네임.getText();

    for (L1PcInstance pc : L1World.getInstance().getAllPlayers()) {

      if (pc.getName().equalsIgnoreCase(kname1)) {

        int Polyid = Integer.parseInt(변신번호.getText());
        pc.setTempCharGfxAtDead(Polyid);
        pc.sendPackets(new S_ChangeShape(pc.getId(), Polyid));
        // pc.broadcastPacket(this, new S_ChangeShape(pc.getId(), 0));
        pc.getInventory().takeoffEquip(Polyid);
        bone.LogServerAppend("변신 시켜 주었습니다..", "확인바람");
      } else if (!pc.getName().equalsIgnoreCase(kname1)) {

        bone.LogServerAppend("변신실패 했습니다...", "확인바람");
      }
    }
  }
  private void GungeonTimeCheck(L1PcInstance pc) {
    RealTime time = RealTimeClock.getInstance().getRealTime();
    int entertime = pc.getGdungeonTime() % 1000;
    int enterday = pc.getGdungeonTime() / 1000;
    int dayofyear = time.get(Calendar.DAY_OF_YEAR);

    if (dayofyear == 365) dayofyear += 1;

    if (entertime > 180) {
      // 메세지를 주고
      L1Teleport.teleport(pc, 33419, 32810, (short) 4, 5, true);
    } else if (enterday < dayofyear) {
      pc.setGdungeonTime(time.get(Calendar.DAY_OF_YEAR) * 1000);
    } else {
      if (entertime > 169) {
        int a = 180 - entertime;
        pc.sendPackets(new S_ServerMessage(1527, "" + a + "")); // 체류시간이  %분 남았다.
      }
      pc.setGdungeonTime(pc.getGdungeonTime() + 1);
    }
  }
  public static void runSkill(L1Character cha) {

    L1PcInstance pc = (L1PcInstance) cha;
    int attr = pc.getElfAttr();
    if (attr != 0) {
      if (pc.getMap().isRecallPets() || pc.isGm()) {
        int petcost = 0;
        Object[] petlist = pc.getPetList().values().toArray();
        for (Object pet : petlist) {
          petcost += ((L1NpcInstance) pet).getPetcost();
        }

        if (petcost == 0) {
          int summonid = 0;
          int summons[];
          summons = new int[] {45306, 45303, 45304, 45305};
          int npcattr = 1;
          for (int i = 0; i < summons.length; i++) {
            if (npcattr == attr) {
              summonid = summons[i];
              i = summons.length;
            }
            npcattr *= 2;
          }
          if (summonid == 0) {
            Random random = new Random();
            int k3 = random.nextInt(4);
            summonid = summons[k3];
          }

          L1Npc npcTemp = NpcTable.getInstance().getTemplate(summonid);
          L1SummonInstance summon = new L1SummonInstance(npcTemp, pc);
          summon.setPetcost(pc.getAbility().getTotalCha() + 7);
        }
      } else {
        pc.sendPackets(new S_ServerMessage(79));
      }
    }
  }
Exemple #7
0
 public static void runSkill(L1Character cha, int buffIconDuration) {
   L1PcInstance pc = (L1PcInstance) cha;
   pc.addDmgup(5);
   pc.sendPackets(new S_SkillIconAura(116, buffIconDuration));
 }