Esempio n. 1
0
 // 2743 = 360, 2627 = 22, 2630 = 45, 2631 = 90, 2741 = 180
 public void spawnNextWave(Client c) {
   if (c != null) {
     if (c.waveId >= WAVES.length) {
       c.waveId = 0;
       return;
     }
     if (c.waveId < 0) {
       return;
     }
     int npcAmount = WAVES[c.waveId].length;
     for (int j = 0; j < npcAmount; j++) {
       int npc = WAVES[c.waveId][j];
       int X = coordinates[j][0];
       int Y = coordinates[j][1];
       int H = c.heightLevel;
       int hp = getHp(npc);
       int max = getMax(npc);
       int atk = getAtk(npc);
       int def = getDef(npc);
       Server.npcHandler.spawnNpc(c, npc, X, Y, H, 0, hp, max, atk, def, true, false);
     }
     c.tzhaarToKill = npcAmount;
     c.tzhaarKilled = 0;
   }
 }
Esempio n. 2
0
  @Override
  public void processPacket(Client c, int packetType, int packetSize) {
    /*
     * a = ?
     * b = ?
     */

    int a = c.getInStream().readUnsignedWord();
    int objectId = c.getInStream().readSignedWordBigEndian();
    int objectY = c.getInStream().readSignedWordBigEndianA();
    int b = c.getInStream().readUnsignedWord();
    int objectX = c.getInStream().readSignedWordBigEndianA();
    int itemId = c.getInStream().readUnsignedWord();
    if (!c.getItems().playerHasItem(itemId, 1)) {
      return;
    }
    UseItem.ItemonObject(c, objectId, objectX, objectY, itemId);
    c.objectX = objectX;
    c.objectY = objectY;
  }
Esempio n. 3
0
  @Override
  public void processPacket(Client c, int packetType, int packetSize) {
    c.wearId = c.getInStream().readUnsignedWord();
    c.wearSlot = c.getInStream().readUnsignedWordA();
    c.interfaceId = c.getInStream().readUnsignedWordA();

    if (!c.getItems().playerHasItem(c.wearId, 1, c.wearSlot)) {
      return;
    }
    int oldCombatTimer = c.attackTimer;
    if (c.playerIndex > 0 || c.npcIndex > 0) c.getCombat().resetPlayerAttack();
    if (c.wearId >= 5509 && c.wearId <= 5515) {
      int pouch = -1;
      int a = c.wearId;
      if (a == 5509) pouch = 0;
      if (a == 5510) pouch = 1;
      if (a == 5512) pouch = 2;
      if (a == 5514) pouch = 3;
      c.getPA().emptyPouch(pouch);
      return;
    }
    // c.attackTimer = oldCombatTimer;
    c.getItems().wearItem(c.wearId, c.wearSlot);
  }