@Override protected void writeImpl(L2Client client, L2Player activeChar, MMOBuffer buf) throws RuntimeException { // Unowned fortress example: // Fortress (D): Antharas' Fortress (116) // Owner pledge (S): // Under siege (D): No (0) // Owned for (D): N/A (0) // Owned fortress example: // Fortress (D): Hunter's Fortress (118) // Owner pledge (S): Eximius // Under siege (D): No (0) // Owned for (D): 4 days, 7 hours, 45 minutes, 59 seconds (373559) // TODO: when implementing, consult an up-to-date packets_game_server.xml and/or savormix final int sizeA = 21; // Fort count buf.writeD(sizeA); for (int i = 0; i < sizeA; i++) { buf.writeD(101 + i); // Fortress buf.writeS(""); // Owner pledge buf.writeD(0); // Under siege buf.writeD(0); // Owned for } }
@Override protected void writeImpl(L2Client client, MMOBuffer buf) throws RuntimeException { // TODO: when implementing, consult an up-to-date packets_game_server.xml and/or savormix final ClientProtocolVersion cpv = client.getVersion(); buf.writeD(_characters.size()); // Character count buf.writeD(7); // New characters buf.writeC(0); // 0 if (cpv.isNewerThanOrEqualTo(ClientProtocolVersion.GODDESS_OF_DESTRUCTION)) { buf.writeC(1); // 1 buf.writeD(0); // 0 } for (PlayerDB p : _characters) { buf.writeS(p.name); // Character name buf.writeD(p.getPersistentId()); // Character ID buf.writeS(p.accountName); // Account name buf.writeD(client.getSessionId()); // Session ID buf.writeD(0); // Pledge ID buf.writeD(0); // 0 buf.writeD(p.gender); // Sex buf.writeD(p.mainClassId.getRace()); // Race buf.writeD(p.mainClassId); // Main class buf.writeD(ReportedConfig.ID); // Game server buf.writeD(p.x); // Location X buf.writeD(p.y); // Location Y buf.writeD(p.z); // Location Z buf.writeF(100D); // Current HP buf.writeF(30D); // Current MP buf.writeD(0); // SP buf.writeQ(0L); // XP if (client.getVersion().isNewerThanOrEqualTo(ClientProtocolVersion.HIGH_FIVE)) buf.writeF(0D); // XP % buf.writeD(1); // Level buf.writeD(0); // Karma buf.writeD(0); // PK Count buf.writeD(0); // PvP Count buf.writeD(0); // ??? 0 buf.writeD(0); // ??? 0 buf.writeD(0); // ??? 0 buf.writeD(0); // ??? 0 buf.writeD(0); // ??? 0 buf.writeD(0); // ??? 0 buf.writeD(0); // ??? 0 buf.writeD(0); // Shirt buf.writeD(0); // Right earring buf.writeD(0); // Left earring buf.writeD(0); // Necklace buf.writeD(0); // Right ring buf.writeD(0); // Left ring buf.writeD(0); // Helmet buf.writeD(0); // Main weapon buf.writeD(0); // Shield/support weapon buf.writeD(0); // Gloves buf.writeD(0); // Chest armor buf.writeD(0); // Leg armor buf.writeD(0); // Boots buf.writeD(0); // Cloak buf.writeD(0); // Two-handed weapon buf.writeD(0); // 1st hair item buf.writeD(0); // 2nd hair item buf.writeD(0); // Right bracelet buf.writeD(0); // Left bracelet buf.writeD(0); // 1st talisman buf.writeD(0); // 2nd talisman buf.writeD(0); // 3rd talisman buf.writeD(0); // 4th talisman buf.writeD(0); // 5th talisman buf.writeD(0); // 6th talisman buf.writeD(0); // Belt buf.writeD(p.hairStyle); // Hair style buf.writeD(p.hairColor); // Hair color buf.writeD(p.face); // Face buf.writeF(100D); // Maximum HP buf.writeF(30D); // Maximum MP buf.writeD(0); // Time of deletion buf.writeD(p.activeClassId); // Current class buf.writeD(1); // Selected buf.writeC(0); // Weapon enchant glow buf.writeD(0); // Weapon augmentation buf.writeD(0); // Transformation buf.writeD(0); // Pet buf.writeD(0); // Pet level buf.writeD(0); // ??? 0 buf.writeD(0); // Total satiation incl inv food? buf.writeF(0D); // Pet current HP buf.writeF(0D); // Pet current MP if (cpv.isNewerThanOrEqualTo(ClientProtocolVersion.HIGH_FIVE)) buf.writeD(20000); // Vitality if (cpv.isNewerThanOrEqualTo(ClientProtocolVersion.GODDESS_OF_DESTRUCTION)) buf.writeD(1); // ??? 1 } }