Example #1
0
  public static CancelOwerturn getInstance(Character actor) {
    CancelOwerturn packet = (CancelOwerturn) instance.newInstance();

    packet.actor = actor;

    return packet;
  }
  public static PlayerNameResult getInstance(int result) {
    PlayerNameResult packet = (PlayerNameResult) instance.newInstance();

    packet.result = result;

    return packet;
  }
Example #3
0
  public static PlayerBankPanel getInstance(Character owner) {
    PlayerBankPanel packet = (PlayerBankPanel) instance.newInstance();

    packet.name = owner.getName();
    packet.objectId = owner.getObjectId();
    packet.subId = owner.getSubId();

    return packet;
  }
Example #4
0
  public static TargetHp getInstance(Character target, int type) {
    TargetHp packet = (TargetHp) instance.newInstance();

    packet.objectId = target.getObjectId();
    packet.subId = target.getSubId();
    packet.hp = target.getCurrentHp() / (float) target.getMaxHp();
    packet.type = type;

    return packet;
  }
Example #5
0
  public static QuestCompleteList getInstance(Table<IntKey, QuestDate> completeTable) {
    QuestCompleteList packet = (QuestCompleteList) instance.newInstance();

    ByteBuffer buffer = packet.getPrepare();

    try {
      Array<QuestDate> completed = packet.getCompleted();

      // вносим и сортируем штамы выполнения
      completeTable.values(completed);

      // получаем массив штампов
      QuestDate[] array = completed.array();

      // получаем последний штамп
      QuestDate last = completed.last();

      int bytes = 8;

      packet.writeShort(buffer, completeTable.size()); // 1B 00 кол-во квестов в книге
      packet.writeShort(buffer, bytes); // 08 00

      for (int i = 0, length = completed.size(); i < length; i++) {
        QuestDate next = array[i];

        packet.writeShort(buffer, bytes);

        if (next != last) bytes += 8;
        else bytes = 0;

        packet.writeShort(buffer, bytes);
        packet.writeInt(buffer, next.getQuestId());
      }

      return packet;
    } finally {
      buffer.flip();
    }
  }
Example #6
0
  public static QuestStarted getInstance(
      QuestState quest, int npcType, int npcId, float x, float y, float z) {
    QuestStarted packet = (QuestStarted) instance.newInstance();

    packet.buffer = packet.prepare;

    Player player = quest.getPlayer();

    packet.writeShort(1); // 01 00
    packet.writeShort(14); // 0E 00
    packet.writeInt(12); // 0C 00 00 00
    packet.writeShort(0); // 00 00
    packet.writeInt(14); // 0E 00 00 00
    packet.writeShort(1); // 01 00
    packet.writeShort(57); // 39 00
    packet.writeShort(1); // 01 00
    packet.writeShort(85); // 55 00
    packet.writeInt(quest.getQuestId()); // 29 05 00 00 //NPC ID
    packet.writeInt(quest.getObjectId()); // C4 E0 89 00 //Обжект ид
    packet.writeInt(quest.getState()); // 01 00 00 00 //номер квеста уданного нпц
    packet.writeInt(
        1); // 01 00 00 00 00 00 00 00 // если 0, то квест красным висит, 1 обычный показ
    packet.writeInt(0);
    packet.writeInt(quest.getPanelStateId()); // 00 00 00 00 quest.getPanelStateId()
    packet.writeInt(0x00010100); // 00 01 01 00
    packet.writeShort(0); // 00 00
    packet.writeByte(0); // 00
    packet.writeInt(57); // 39 00 00 00 //след сектор
    packet.writeFloat(x); // 0B D1 A9 47 //видимо где след этап квеста X
    packet.writeFloat(y); // 1F 3D A6 C7 //видимо где след этап квеста Y
    packet.writeFloat(z); // 88 11 90 C5 //видимо где след этап квеста Z
    packet.writeInt(npcType); // D5 00 00 00 //213
    packet.writeInt(npcId); // EB 03 00 00 //1003 видимо ид след НПЦ
    packet.writeInt(player != null ? player.getZoneId() : 13); // 0D 00 00 00 //13
    packet.writeLong(85); // 55 00 00 00 00 00 00 00  //85

    return packet;
  }
 public static CharacterQuitCancelOk getInstance() {
   return (CharacterQuitCancelOk) instance.newInstance();
 }