Pesquisar na Comunidade
Mostrando resultados para as tags ''Java scripts''.
Encontrado 1 registro
-
Primeira mente boa tarde a todos. Sou novo no forum porem gostei e venho aqui para tirar e ver se alguém da uma força rsrs pois estou a 1 semana tentando resolver isso e não consigo elaborar uma solução. Vamos lá. esse é minha dúvida public SM_BATTLE_END(Player player, Room room) { super(0xD08); // sebelum nya 0xD08 this.player = player; this.room = room; } @Override public void writeImpl() { //TODO переделать LevelUpInfo levelUpInfo = LevelUpDaoService.getInstance().getLevelInfoForRank((byte) (player.getRank() + 1)); RoomSlot slotByPlayer = room.getRoomSlotByPlayer(player); player.setExp(player.getExp() + slotByPlayer.getAllExp()); player.setGp(player.getGp() + slotByPlayer.getAllGp()); if (player.getRank() <= 52) { if (levelUpInfo.getAllExp() < player.getExp()) { player.setRank((short) (player.getRank() + 1)); player.setGp(player.getGp() + levelUpInfo.getRewardGp()); } } // writeC(room.getRedKills() > room.getBlueKills() ? 0 : 1);// походу команда которая выигрывает writeH(383); // что это??? writeH(266); // что это??? // Опыт for (int i = 0; i < 16; i++) { RoomSlot slot = room.getRoomSlot(i); writeH(slot.getAllExp()); } // Очки for (int i = 0; i < 16; i++) { RoomSlot slot = room.getRoomSlot(i); writeH(slot.getAllGp()); } //Очки за ботов for (int i = 0; i < 16; i++) { if (room.getSpecial() == 6) { RoomSlot slot = room.getRoomSlot(i); int score = slot.getBotScore(); writeH(score); } else writeH(0); } writeB(new byte[]{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// 0x00, 0x00,// // и тут ХЗ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// 0x00, 0x00, 0x00, 0x00 // }); writeS(player.getName(), Player.MAX_NAME_SIZE); // Имя перса writeD(player.getExp()); // опыт writeD(player.getRank()); // ранк (0-54) writeD(player.getRank()); // Пока не понятно за чего отвечают пустые байты... writeD(player.getGp()); // ГП writeD(con.getAccount().getMoney()); // Рублики writeD(0); // ClanID writeD(0); // ClanNameColor writeD(0); // Unk writeD(0); // Unk writeH(player.getPcCafe()); writeC(player.getColor()); // 0-9 Color name if (player.getClan() == null) { writeS("", 16); writeC(0); writeH(0); writeC(255); writeC(255); writeC(255); writeC(255); writeH(0); } else { writeS(player.getClan().getName(), 16); writeC(0); // unk - Видимо разделитель writeH(player.getClan().getRank()); writeC(player.getClan().getLogo1()); writeC(player.getClan().getLogo2()); writeC(player.getClan().getLogo3()); writeC(player.getClan().getLogo4()); writeH(player.getClan().getColor()); } writeD(0); // Непонятно чо writeB(new byte[9]); writeD(player.getStats().getFights()); writeD(player.getStats().getWins()); writeD(player.getStats().getLosts()); writeD(0); // unk writeD(player.getStats().getKills()); writeD(player.getStats().getSeriaWins()); writeD(player.getStats().getDeaths()); writeD(0); // unk writeD(player.getStats().getKpd()); writeD(player.getStats().getEscapes()); writeD(player.getStats().getSeasonFights()); writeD(player.getStats().getSeasonWins()); writeD(player.getStats().getSeasonLosts()); writeD(0); // unk writeD(player.getStats().getSeasonKills()); writeD(player.getStats().getSeasonSeriaWins()); writeD(player.getStats().getSeasonDeaths()); writeD(0); // unk writeD(player.getStats().getSeasonKpd()); writeD(player.getStats().getSeasonEscapes()); writeB(new byte[53]); } } AQUI DECLARA SÓ UM TIME VENCEDOR writeC(room.getRedKills() > room.getBlueKills() ? 0 : 1);// походу команда которая выигрывает writeH(383); // что это??? writeH(266); // что это??? esse scripts em azul acho que está ok mas e fogo adaptar esse para o que o de cima //|==COMEÇO DO COMANDO DE QUEM VENCEU==| if (this.r.getKills(TeamEnum.CHARACTER_TEAM_BLUE) == this.r.getKills(TeamEnum.CHARACTER_TEAM_RED)) this.writeC((byte)2); else if (this.r.getKills(TeamEnum.CHARACTER_TEAM_BLUE) > this.r.getKills(TeamEnum.CHARACTER_TEAM_RED)) this.writeC((byte)1); else this.writeC((byte)0); //|==FINAL DO COMANDO DE QUEM VENCEU==| if (this._player == null || this.r.getLeader() == null || this._player.player_id != this.r.getLeader().player_id) return; this.r.stopBattle(this._player); this.writeH((short)383); this.writeH((short)266); ESTAVA TENTANDO VER ALGUMAS ELABORAÇÕES POREM NÃO OBTIVE SUCESSO ABAIXO E AS INFORMAÇÕES QUE A PARTE DE CIMA COLHE PARA DA O RESULTADO DO TIME VENCEDOR public class SM_BATTLE_FRAG_INFO extends ServerPacket { private Room room; private FragInfos fragInfos; public SM_BATTLE_FRAG_INFO(Room room, FragInfos fragInfos) { super(0xD1B); this.room = room; this.fragInfos = fragInfos; } @Override public void writeImpl() { writeC(fragInfos.getVicTimIdx()); // WTF? writeC(fragInfos.getKillsCount()); // Всего померло. writeC(fragInfos.getKiller()); // Слот убитого. writeD(fragInfos.getKillWeaapon()); // Орудие убийства. writeB(fragInfos.getUnkBytes()); // Хз что там. RoomSlot killer = room.getRoomSlot(fragInfos.getKiller()); for(int i = 1; i <= fragInfos.getKillsCount(); i++) { Frag frag = fragInfos.getFrag(i); writeC(frag.getUnkC1()); writeC(frag.getDeathMask()); // switch(killer.getKillMessage()) { case 0: writeH(0); break; case 1: writeH(1); break; case 2: writeH(2); break; case 3: writeH(4); break; case 4: writeH(8); break; case 5: writeH(16); break; case 6: writeH(32); break; case 7: writeH(64); break; case 8: writeH(128); break; default: writeH(0); break; } writeB(frag.getUnk13bytes()); } writeD(room.getRedKills()); // writeH(0); writeD(room.getBlueKills()); // writeH(0); for(RoomSlot member : room.getRoomSlots()) { writeH(member.getAllKills()); writeH(member.getAllDeath()); } // writeC(0); // кол-вол игроков? if(fragInfos.getKillsCount() == 1) if(killer.getOneTimeKills() == 1) writeC(0); else if(killer.getOneTimeKills() == 2) writeC(1); else if(killer.getOneTimeKills() == 3) writeC(2); else if(killer.getOneTimeKills() > 3) writeC(3); writeH(killer.getBotScore()); int hz = 0; if(hz > 0) writeD(0); } }