Пример #1
0
        protected internal override void write()
        {
            SLOT slot = this.player.getRoom().getSlots()[this.player.getPlayerId()];

            this.writeH(this._chat.chat_type);
            this.writeD(slot.getPlayer().getSlot());
            this.writeD(this._chat.chat.Length);
            this.writeS(this._chat.chat);
        }
Пример #2
0
        public override void WriteImpl()
        {
            WriteH(0xF25);
            WriteC(0);
            WriteC((byte)leaderSlot.getId());
            WriteC(1);//(byte)slotcount
            if (slotcount > 1)
            {
                foreach (int slot in Room.RED_TEAM)
                {
                    SLOT       oldSlot  = room.getRoomSlots()[slot];
                    SLOT       newSlot  = room.getRoomSlots()[slot + 1];
                    SLOT_STATE oldState = oldSlot.getState();
                    oldSlot.setState(newSlot.getState());
                    newSlot.setState(oldState);
                    Player oldPlayer = oldSlot.getPlayer();
                    oldSlot.setPlayer(newSlot.getPlayer());
                    newSlot.setPlayer(oldPlayer);

                    WriteC((byte)oldSlot.getId());
                    WriteC((byte)newSlot.getId());
                    WriteC((byte)(int)oldSlot.getState());
                    WriteC((byte)(int)newSlot.getState());
                }
            }
            else
            {
                SLOT oldSlot = room.getRoomSlotByPlayer(sender);
                SLOT newSlot = room.changeTeam(sender,newTeam);

                WriteC((byte)oldSlot.getId());
                WriteC((byte)newSlot.getId());
                WriteC((byte)(int)oldSlot.getState());
                WriteC((byte)(int)newSlot.getState());
            }
        }
        public override void WriteImpl()
        {
            WriteH((short)3842);

            if (player.getRoom().getSlotState(slot) == SLOT_STATE.SLOT_STATE_EMPTY)
            {
                WriteD(0);
            }
            else
            {
                SLOT slot = player.getRoom().getRoomSlot(this.slot);

                WriteD(this.slot);
                WriteS(slot.getPlayer().getName(),33);
                WriteD(slot.getPlayer().getExp());
                WriteD(slot.getPlayer().getRank());
                WriteD(slot.getPlayer().getRank());
                WriteD(slot.getPlayer().getGp());
                WriteD(slot.getPlayer().getMoney());
                if (slot.getPlayer().getClanID() != 0)
                {
                    WriteD(1);
                    WriteD(1);
                }
                else
                {
                    WriteB(new byte[8]);
                }
                WriteD(0);
                WriteD(0);
                WriteH((short)slot.getPlayer().getPCCafe());
                WriteC(0);// color
                WriteS(slot.getPlayer().getClan().getName(), 17);
                WriteH(slot.getPlayer().getClan().getRank());
                WriteC((byte)slot.getPlayer().getClan().getLogo1());
                WriteC((byte)slot.getPlayer().getClan().getLogo2());
                WriteC((byte)slot.getPlayer().getClan().getLogo3());
                WriteC((byte)slot.getPlayer().getClan().getLogo4());
                WriteH(slot.getPlayer().getClan().getColor());
                WriteD(0);
                WriteD(0);
                WriteD(0);

                stats = PlayersStatsTable.statistics[slot.getPlayer().PlayerID];

                WriteD(stats.getFights());          //всего боев
                WriteD(stats.getWins());            //всего побед
                WriteD(stats.getLosts());           //всего поражений
                WriteD(0);
                WriteD(stats.getKills());           //кол-во убийств
                WriteD(stats.getHeadshots());       //кол-во хедшотов
                WriteD(stats.getDeaths());          //кол-во смертей
                WriteD(0);
                WriteD(stats.getKills());           //опять килы о.о
                WriteD(stats.getEscapes());         //всего ливнул
                WriteD(stats.getSeasonFights());    //всего боев за сезон
                WriteD(stats.getSeasonWins());      //всего побед за сезон
                WriteD(stats.getSeasonLosts());     //всего поражений за сезон
                WriteD(0);
                WriteD(stats.getSeasonKills());     //киллы сезон по идее
                WriteD(stats.getSeasonHeadshots()); //хеды сезон по идее
                WriteD(stats.getSeasonDeaths());    //смерти сезон по идее
                WriteD(0);
                WriteD(stats.getSeasonKills());     //опять килы,хз зачем
                WriteD(stats.getSeasonEscapes());   //сколько ливнул за сезон

                equip = PlayerEquipTable.players_equip[slot.getPlayer().PlayerID];

                WriteD(equip.getCharRed());             // Скин Мужчина стандартный красные
                WriteD(equip.getCharBlue());            // Скин Мужчина стандартный синие
                WriteD(equip.getCharHelmet());          // Шлем поидеи... надо тестить
                WriteD(equip.getCharBeret());           // Берет
                WriteD(0);                              // Хз что это. Влазиет пистолеты, ножи, снайпы, пулеметы
                WriteD(equip.getWeaponPrimary());       // Основное оружие
                WriteD(equip.getWeaponSecondary());     // Второстепенное оружие
                WriteD(equip.getWeaponMelee());         // Ближнего боя
                WriteD(equip.getWeaponThrownNormal());  // Гранаты (Гранаты для взрыва)
                WriteD(equip.getWeaponThrownSpecial()); // Гранаты (Шранаты специальные, смок, слеповуха)
            }
        }
Пример #4
0
 public override void WriteImpl()
 {
     WriteH(0xf45);
     WriteD(playerSlot.getId());
     WriteC((byte)playerSlot.getState());
     WriteH((byte)playerSlot.getPlayer().getRank());
     WriteB(new byte[8]);
     if (playerSlot.getPlayer().getClanID() == 0)
     {
         WriteC(0xff);
         WriteC(0xff);
         WriteC(0xff);
         WriteC(0xff);
         WriteC(0);
         WriteS("",0x16);
     }
     else
     {
         WriteC((byte)playerSlot.getPlayer().getClan().getLogo1());
         WriteC((byte)playerSlot.getPlayer().getClan().getLogo2());
         WriteC((byte)playerSlot.getPlayer().getClan().getLogo3());
         WriteC((byte)playerSlot.getPlayer().getClan().getLogo4());
         WriteC((byte)playerSlot.getPlayer().getClan().getColor());
         WriteS(playerSlot.getPlayer().getClan().getName(),Clan.CLAN_NAME_SIZE);
     }
     WriteC((byte)playerSlot.getId());
     WriteC((byte)playerSlot.getPlayer().PlayerName.Length);
     WriteC(0);
     WriteH((byte)(playerSlot.getPlayer().PlayerName.Length + 1));
     WriteS(playerSlot.getPlayer().PlayerName,Player.MAX_NAME_SIZE);
     WriteC(0);
 }
Пример #5
0
        protected internal override void run()
        {
            Account player = base.getClient().getPlayer();
            bool    flag   = player != null;

            if (flag)
            {
                Room room  = player.getRoom();
                bool flag2 = room != null;
                if (flag2)
                {
                    SLOT sLOT = room.getSlots()[this._kills.killerIdx];
                    int  num  = this._kills.weapon / 100000;
                    sLOT.killMessage = 0;
                    int num2 = this._kills.killsCount - 1;
                    for (int i = 0; i <= num2; i++)
                    {
                        Frag frag  = this._kills.frags[i];
                        bool flag3 = this._kills.killsCount > 1;
                        if (flag3)
                        {
                            int num3 = (num == 8030) ? 0 : ((num != 9030) ? 1 : 0);
                            sLOT.killMessage = ((num3 != 0) ? 1 : 2);
                        }
                        else
                        {
                            int  num3  = 0;
                            bool flag4 = frag.hitspotNum >> 4 == 3;
                            if (flag4)
                            {
                                num3 = 4;
                            }
                            else
                            {
                                bool flag5 = frag.hitspotNum >> 4 == 1 && frag.hitspotNum % 2 == 1 && num == 7020;
                                if (flag5)
                                {
                                    num3 = 6;
                                }
                            }
                            bool flag6 = num3 > 0;
                            if (flag6)
                            {
                                int num4 = sLOT.lastKillState >> 12;
                                int num5 = num3;
                                if (num5 != 0)
                                {
                                    if (num5 != 4)
                                    {
                                        if (num5 == 6)
                                        {
                                            bool flag7 = num4 != 6;
                                            if (flag7)
                                            {
                                                sLOT.repeatLastState = false;
                                            }
                                            int num6 = sLOT.killsOnLife + 1;
                                            sLOT.lastKillState = (num3 << 12 | num6);
                                            int  num7            = sLOT.lastKillState & 15;
                                            bool repeatLastState = sLOT.repeatLastState;
                                            if (repeatLastState)
                                            {
                                                bool flag8 = num7 > 1;
                                                if (flag8)
                                                {
                                                    sLOT.killMessage = 6;
                                                }
                                            }
                                            else
                                            {
                                                sLOT.repeatLastState = true;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        bool flag9 = num4 != 4;
                                        if (flag9)
                                        {
                                            sLOT.repeatLastState = false;
                                        }
                                        int num6 = sLOT.killsOnLife + 1;
                                        sLOT.lastKillState = (num3 << 12 | num6);
                                        int  num7             = sLOT.lastKillState & 15;
                                        bool repeatLastState2 = sLOT.repeatLastState;
                                        if (repeatLastState2)
                                        {
                                            sLOT.killMessage = ((num7 <= 1) ? 4 : 5);
                                        }
                                        else
                                        {
                                            sLOT.killMessage     = 4;
                                            sLOT.repeatLastState = true;
                                        }
                                    }
                                }
                                else
                                {
                                    bool flag10 = sLOT.killsOnLife == 1;
                                    if (flag10)
                                    {
                                        this._kills.Message = 3;
                                    }
                                    else
                                    {
                                        bool flag11 = sLOT.killsOnLife == 2;
                                        if (flag11)
                                        {
                                            this._kills.Message = 3;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                sLOT.lastKillState   = 0;
                                sLOT.repeatLastState = false;
                            }
                        }
                        SLOT sLOT2 = room.getSlots()[frag.getDeatSlot()];
                        sLOT2.allDeaths++;
                        sLOT2.killMessage   = 0;
                        sLOT2.lastKillState = 0;
                        sLOT2.resetkillsOnLife();
                        sLOT2.repeatLastState = false;
                        bool flag12 = this._kills.killerIdx != frag.getDeatSlot();
                        if (flag12)
                        {
                            sLOT.allKills++;
                            sLOT.killsOnLife++;
                        }
                        bool flag13 = frag.getDeatSlot() % 2 == 0 && frag.getDeatSlot() != this._kills.killerIdx;
                        if (flag13)
                        {
                            room.addDeaths(TeamEnum.CHARACTER_TEAM_RED);
                            room.addKills(TeamEnum.CHARACTER_TEAM_BLUE);
                        }
                        else
                        {
                            bool flag14 = frag.getDeatSlot() % 2 != 0 && frag.getDeatSlot() != this._kills.killerIdx;
                            if (flag14)
                            {
                                room.addDeaths(TeamEnum.CHARACTER_TEAM_BLUE);
                                room.addKills(TeamEnum.CHARACTER_TEAM_RED);
                            }
                        }
                    }
                    bool flag15 = sLOT.killMessage == 4 || sLOT.killMessage == 5;
                    if (flag15)
                    {
                        sLOT.headshotsInPlay++;
                    }
                    bool flag16 = room.special == 6;
                    if (flag16)
                    {
                        bool flag17 = player.getSlot() % 2 == 0;
                        if (flag17)
                        {
                            SLOT slot = room.getSlot(this._kills.killerIdx);
                            slot.botScore += 5 + room.getSlot(this._kills.killerIdx).killsOnLife*room._aiLevel;
                        }
                        else
                        {
                            SLOT slot2 = room.getSlot(this._kills.killerIdx);
                            slot2.botScore += 5 + room.getSlot(this._kills.killerIdx).killsOnLife*room._aiLevel;
                        }
                    }
                    for (int j = 0; j < room.getSlots().Length; j++)
                    {
                        int  playerId = room.getSlot(j)._playerId;
                        bool flag18   = playerId > 0;
                        if (flag18)
                        {
                            Account playerFromPlayerId = ChannelInfoHolder.getChannel(base.getClient().getChannelId()).getPlayerFromPlayerId(playerId);
                            bool    flag19             = playerFromPlayerId != null;
                            if (flag19)
                            {
                                playerFromPlayerId.sendPacket(new PROTOCOL_BATTLE_DEATH_ACK(playerFromPlayerId,this._kills));
                            }
                        }
                    }
                    bool flag20 = room.special != 6;
                    if (flag20)
                    {
                        SLOT slot3  = room.getSlot(this._kills.killerIdx);
                        bool flag21 = base.getClient().getPlayer() == slot3.getPlayer();
                        if (flag21)
                        {
                            for (int k = 0; k < this._kills.killsCount; k++)
                            {
                                base.getClient().sendPacket(new PROTOCOL_BASE_QUEST_CHANGE_ACK(242,1));
                            }
                            bool flag22 = slot3.getKillMessage() == 7;
                            if (flag22)
                            {
                                base.getClient().sendPacket(new PROTOCOL_BASE_QUEST_CHANGE_ACK(243,1));
                            }
                            bool flag23 = slot3.getKillMessage() == 8;
                            if (flag23)
                            {
                                base.getClient().sendPacket(new PROTOCOL_BASE_QUEST_CHANGE_ACK(243,1));
                            }
                            bool flag24 = slot3.getKillMessage() == 9;
                            if (flag24)
                            {
                                base.getClient().sendPacket(new PROTOCOL_BASE_QUEST_CHANGE_ACK(243,1));
                            }
                        }
                        bool flag25 = sLOT == room.getRoomSlotByPlayer(base.getClient().getPlayer());
                        if (flag25)
                        {
                            base.getClient().sendPacket(new PROTOCOL_BASE_QUEST_CHANGE_ACK(241,1));
                        }
                        bool flag26 = room.room_type == 2;
                        if (flag26)
                        {
                            bool flag27 = room.getBlueKills() == room.redTeamCount;
                            if (flag27)
                            {
                                this.TeamWin = 1;
                            }
                            else
                            {
                                bool flag28 = room.getRedKills() == room.blueTeamCount;
                                if (flag28)
                                {
                                    this.TeamWin = 0;
                                }
                            }
                        }
                        bool flag29 = room.room_type == 4;
                        if (flag29)
                        {
                            bool flag30 = room.getBlueKills() == room.redTeamCount;
                            if (flag30)
                            {
                                this.TeamWin = 1;
                            }
                            else
                            {
                                bool flag31 = room.getRedKills() == room.blueTeamCount;
                                if (flag31)
                                {
                                    this.TeamWin = 0;
                                }
                            }
                        }
                    }
                }
                bool flag32 = this.TeamWin >= 0;
                if (flag32)
                {
                    bool flag33 = this.TeamWin != 1 || room.getBombState() != 1;
                    if (flag33)
                    {
                        room.setRedKills(0);
                        room.setBlueKills(0);
                        bool flag34 = this.TeamWin == 1;
                        if (flag34)
                        {
                            room.setBlueWinRounds(room.getBlueWinRounds() + 1);
                        }
                        else
                        {
                            room.setRedWinRounds(room.getRedWinRounds() + 1);
                        }
                        bool flag35 = Math.Max(room.getRedWinRounds(),room.getBlueWinRounds()) >= room.getKillsByMask();
                        if (flag35)
                        {
                            foreach (Account current in base.getClient().getPlayer().getRoom().getAllPlayers())
                            {
                                SLOT roomSlotByPlayer = room.getRoomSlotByPlayer(current);
                                current.getClient().sendPacket(new PROTOCOL_BATTLE_ENDBATTLE_ACK(current));
                                roomSlotByPlayer.setKillMessage(0);
                                roomSlotByPlayer.setLastKillMessage(0);
                                roomSlotByPlayer.setOneTimeKills(0);
                                roomSlotByPlayer.setAllKills(0);
                                roomSlotByPlayer.setAllDeahts(0);
                            }
                            room.setRedKills(0);
                            room.setRedDeaths(0);
                            room.setBlueKills(0);
                            room.setBlueDeaths(0);
                            room.setFigth(0);
                            room.setBlueWinRounds(0);
                            room.setRedWinRounds(0);
                            room.setBombState(0);
                        }
                        else
                        {
                            foreach (Account current2 in base.getClient().getPlayer().getRoom().getAllPlayers())
                            {
                                SLOT roomSlotByPlayer2 = room.getRoomSlotByPlayer(current2);
                                roomSlotByPlayer2.setKillMessage(0);
                                roomSlotByPlayer2.setLastKillMessage(0);
                                roomSlotByPlayer2.setOneTimeKills(0);
                                roomSlotByPlayer2.lastKillState = 0;
                                room.setRedKills(0);
                                room.setRedDeaths(0);
                                room.setBlueKills(0);
                                room.setBlueDeaths(0);
                                room.setBombState(0);
                                current2.getClient().sendPacket(new PROTOCOL_BATTLE_MISSION_ROUND_END_ACK(this.TeamWin,this.TeamWin,base.getClient().getPlayer().getRoom()));
                            }
                            Thread.Sleep(8000);
                            foreach (Account current3 in base.getClient().getPlayer().getRoom().getAllPlayers())
                            {
                                current3.getClient().sendPacket(new PROTOCOL_BATTLE_MISSION_ROUND_START_ACK(current3.getRoom()));
                            }
                        }
                    }
                    this.TeamWin = -1;
                }
            }
        }
Пример #6
0
        public override void WriteImpl()
        {
            try
            {
                if (room != null)
                {
                    WriteH(3861);
                    if (room.getRoomSlotByPlayer(room.getLeader()) == null)
                    {
                        room.setNewLeader();
                    }

                    WriteD(room.getRoomSlotByPlayer(room.getLeader()).getId());
                    for (int slotId = 0; slotId < 16; ++slotId)
                    {
                        Player player   = room.getRoomSlot(slotId).getPlayer();
                        SLOT   roomSlot = room.getRoomSlot(slotId);

                        if (player != null)
                        {
                            WriteC((byte)roomSlot.getState());
                            WriteC((byte)roomSlot.getPlayer().getRank());
                            WriteB(new byte[9]);
                            WriteC(roomSlot.getPlayer() == null || roomSlot.getPlayer().ClanID == 0 ? (byte)255 : (byte)roomSlot.getPlayer().Clan.Logo1);
                            WriteC(roomSlot.getPlayer() == null || roomSlot.getPlayer().ClanID == 0 ? (byte)255 : (byte)roomSlot.getPlayer().Clan.Logo2);
                            WriteC(roomSlot.getPlayer() == null || roomSlot.getPlayer().ClanID == 0 ? (byte)255 : (byte)roomSlot.getPlayer().Clan.Logo3);
                            WriteC(roomSlot.getPlayer() == null || roomSlot.getPlayer().ClanID == 0 ? (byte)255 : (byte)roomSlot.getPlayer().Clan.Logo4);
                            WriteC(roomSlot.getPlayer() == null || roomSlot.getPlayer().ClanID == 0 ? (byte)255 : (byte)roomSlot.getPlayer().Clan.Color);
                            WriteD(roomSlot.getPlayer() == null || roomSlot.getPlayer().ClanID == 0 ? 0 : roomSlot.getPlayer().getPCCafe());               //пк_кафе
                            WriteH(roomSlot.getPlayer() == null || roomSlot.getPlayer().ClanID == 0 ? (short)0 : (short)roomSlot.getPlayer().getEmblem()); //Лычка
                            WriteS(roomSlot.getPlayer() == null || roomSlot.getPlayer().ClanID == 0 ? "" : roomSlot.getPlayer().Clan.Name,Clan.CLAN_NAME_SIZE);
                            WriteC((byte)roomSlot.getPlayer().getEffect1());
                            WriteC((byte)roomSlot.getPlayer().getEffect2());
                            WriteC((byte)roomSlot.getPlayer().getEffect3());
                            WriteC((byte)roomSlot.getPlayer().getEffect4());
                            WriteC((byte)roomSlot.getPlayer().getEffect5());
                            WriteC(0);
                            WriteC(0);
                        }
                        else
                        {
                            WriteC((byte)roomSlot.getState());
                            WriteC(0);
                            WriteB(new byte[9]);
                            WriteC(0xff);
                            WriteC(0xff);
                            WriteC(0xff);
                            WriteC(0xff);
                            WriteC(0);
                            WriteB(new byte[6]);
                            WriteS("",0x11);
                            WriteH(0);
                            WriteC(0);
                            WriteC(0);
                        }
                    }
                }
                else
                {
                    WriteH((short)3861);
                    WriteD(0);
                    WriteB(new byte[10]
                    {
                        (byte)1,
                        (byte)2,
                        (byte)3,
                        (byte)4,
                        (byte)5,
                        (byte)6,
                        (byte)7,
                        (byte)8,
                        (byte)9,
                        (byte)10
                    });
                }
            }
            catch (Exception e)
            {
                Logger.Error(e.ToString());
            }
        }
Пример #7
0
        public override void RunImpl()
        {
            Room   room   = getClient().getPlayer().getRoom();
            Player player = getClient().getPlayer();

            if (room != null && player != null)
            {
                SLOT killer = room.getRoomSlot(fragInfos.getKiller());
                for (int i = 1; i <= fragInfos.getKillsCount(); i++)
                {
                    Frag frag = fragInfos.getFrag(i);
                    if (frag != null)
                    {
                        bool suicide = frag.getDeatSlot() == fragInfos.getKiller();
                        SLOT death   = room.getRoomSlot(frag.getDeatSlot());

                        if (!suicide)
                        {
                            killer.setAllKills(killer.getAllKills() + 1);

                            /* Подсчет опыта и очков */
                            killer.setAllExp(killer.getAllExp() + 9); //сохраняем опыт
                            killer.setAllGP(killer.getAllGp() + 5);   //сохраняем очки

                            killer.setOneTimeKills(killer.getOneTimeKills() + 1);
                            int weaponHeadNum = fragInfos.getWeaponHeadNum();
                            killer.setKillMessage(0);
                            if (fragInfos.getKillsCount() > 1)
                            {
                                if ((weaponHeadNum == 8030) || (weaponHeadNum == 9030))
                                {
                                    killer.setKillMessage(2);
                                }
                                else
                                {
                                    killer.setKillMessage(1);
                                }
                            }
                            else
                            {
                                int killMessage = 0;
                                if (frag.getDeathMask() >> 4 == 3)
                                { //TODO:: понять что это и всунуть в Frag!
                                    killMessage = 4;
                                }
                                else if ((frag.getDeathMask() >> 4 == 1) && (frag.getDeathMask() >> 2 == 1) && (weaponHeadNum == 7020))
                                {
                                    killMessage = 6;
                                }

                                if (killMessage > 0)
                                {
                                    int lastMessage = killer.lastKillState >> 12;

                                    if (killMessage == 4)
                                    {
                                        if (lastMessage != 4)
                                        {
                                            killer.repeatLastState = false;
                                            //killer.setOneTimeKills(0);
                                        }

                                        killer.setOneTimeKills(killer.getOneTimeKills() + 1);
                                        killer.lastKillState = killMessage << 12 | killer.getOneTimeKills();

                                        int countedKill = killer.lastKillState & 0xF;

                                        if (killer.repeatLastState)
                                        {
                                            if (countedKill > 1)
                                            {
                                                killer.setKillMessage(5);
                                            }
                                            else
                                            {
                                                killer.setKillMessage(4);
                                            }
                                        }
                                        else
                                        {
                                            killer.setKillMessage(4);
                                            killer.repeatLastState = true;
                                        }
                                    }
                                    else if (killMessage == 6)
                                    {
                                        if (lastMessage != 6)
                                        {
                                            killer.repeatLastState = false;
                                            // killer.setOneTimeKills(0);
                                        }

                                        killer.setOneTimeKills(killer.getOneTimeKills() + 1);
                                        killer.lastKillState = killMessage << 12 | killer.getOneTimeKills();

                                        int countedKill = killer.lastKillState & 0xF;

                                        if (killer.repeatLastState)
                                        {
                                            if (countedKill > 1)
                                            {
                                                killer.setKillMessage(6);
                                            }
                                        }
                                        else
                                        {
                                            killer.repeatLastState = true;
                                        }
                                    }
                                }
                                else
                                {
                                    killer.lastKillState   = 0;
                                    killer.repeatLastState = false;
                                }
                            }
                            //
                        }
                        //Добавляем общий счет команде
                        if (frag.getDeatSlot() % 2 == 0)
                        {    // Если помер красный
                            room.setBlueKills(room.getBlueKills() + 1);
                            room.setRedDeaths(room.getRedDeaths() + 1);
                        }
                        else
                        {
                            room.setRedKills(room.getRedKills() + 1);
                            room.setBlueDeaths(room.getBlueDeaths() + 1);
                        }
                        death.setOneTimeKills(0);
                        death.setKillMessage(0);
                        death.setLastKillMessage(0);
                        death.lastKillState = 0;

                        death.setAllDeahts(death.getAllDeath() + 1);
                        //Добавляем очки в бою с ботами
                        if (room.getSpecial() == 6)
                        {
                            SLOT slot    = room.getRoomSlot(fragInfos.getKiller());
                            int  AILevel = room.getRoomSlotByPlayer(room.getLeader()).getId() % 2 == 0 ? room.getAiLevel() + room.getBlueDeaths() / 20 : room.getAiLevel() + room.getRedDeaths() / 20;
                            int  AIScore = 10 + room.getRoomSlot(fragInfos.getKiller()).getOneTimeKills() * AILevel;
                            slot.setBotScore(slot.getBotScore() + AIScore);
                        }

                        /* Миссии */
                        if (room.getSpecial() != 6)
                        {
                            SLOT killer2 = room.getRoomSlot(fragInfos.getKiller());

                            if (getClient().getPlayer() == killer2.getPlayer())
                            {
                                for (int count = 0; count < fragInfos.getKillsCount(); count++)
                                {
                                    getClient().SendPacket(new PROTOCOL_BASE_MISSION_COMPLETE_ACK(242, 1));//убийство
                                }

                                if (killer2.getKillMessage() == 8)
                                {
                                    getClient().SendPacket(new PROTOCOL_BASE_MISSION_COMPLETE_ACK(244, 1));//хедшот
                                }

                                if (killer2.getKillMessage() == 9)
                                {
                                    getClient().SendPacket(new PROTOCOL_BASE_MISSION_COMPLETE_ACK(244, 1));//тож хедшот
                                }
                            }

                            if (death == room.getRoomSlotByPlayer(getClient().getPlayer()))
                            {
                                getClient().SendPacket(new PROTOCOL_BASE_MISSION_COMPLETE_ACK(241, 1));//смерть
                            }
                        }

                        if (room.getType() == 2)
                        {
                            if (room.getBlueKills() == room.redTeamCount)
                            {
                                TeamWin = 1;
                            }
                            else if (room.getRedKills() == room.blueTeamCount)
                            {
                                TeamWin = 0;
                            }
                        }
                        /* Уничтожение */
                        if (room.getType() == 4)
                        {
                            if (room.getBlueKills() == room.redTeamCount)
                            {
                                TeamWin = 1;
                            }
                            else if (room.getRedKills() == room.blueTeamCount)
                            {
                                TeamWin = 0;
                            }
                        }
                    }
                }
                foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                {
                    if (SLOT_STATE.SLOT_STATE_BATTLE == room.getRoomSlotByPlayer(member).getState())
                    {
                        member.getClient().SendPacket(new PROTOCOL_BATTLE_FRAG_INFO_ACK(room, fragInfos));
                    }
                }
                if (TeamWin >= 0)
                {
                    //TeamWin = -1;
                    if (!(TeamWin == 1 && room.getBombState() == 1))
                    {
                        room.setRedKills(0);
                        room.setBlueKills(0);
                        if (TeamWin == 1)
                        {
                            room.setBlueWinRounds(room.getBlueWinRounds() + 1);
                        }
                        else
                        {
                            room.setRedWinRounds(room.getRedWinRounds() + 1);
                        }
                        if ((TeamWin == 1 ? room.getBlueWinRounds() : room.getRedWinRounds()) == room.getKillsByMask())
                        {
                            foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                            {
                                SLOT slot = room.getRoomSlotByPlayer(member);
                                member.getClient().SendPacket(new PROTOCOL_BATTLE_END_ACK(member,room));
                                slot.setKillMessage(0);
                                slot.setLastKillMessage(0);
                                slot.setOneTimeKills(0);
                                slot.setAllKills(0);
                                slot.setAllDeahts(0);
                            }
                            room.setRedKills(0);
                            room.setRedDeaths(0);
                            room.setBlueKills(0);
                            room.setBlueDeaths(0);
                            room.setFigth(0);
                            room.setBlueWinRounds(0);
                            room.setRedWinRounds(0);
                            room.setBombState(0);
                        }
                        else
                        {
                            foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                            {
                                SLOT slot = room.getRoomSlotByPlayer(member);
                                slot.setKillMessage(0);
                                slot.setLastKillMessage(0);
                                slot.setOneTimeKills(0);
                                slot.lastKillState = 0;
                                room.setRedKills(0);
                                room.setRedDeaths(0);
                                room.setBlueKills(0);
                                room.setBlueDeaths(0);
                                room.setBombState(0);
                                member.getClient().SendPacket(new PROTOCOL_BATTLE_ROUND_END_ACK(TeamWin,4,getClient().getPlayer().getRoom()));
                            }
                            Thread.Sleep(8000);
                            foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                            {
                                member.getClient().SendPacket(new opcode_3865_ACK());
                                member.getClient().SendPacket(new PROTOCOL_BATTLE_ROUND_START(member.getRoom()));
                            }
                        }
                        //TeamWin = -1;
                    }
                    TeamWin = -1;
                }
            }
        }