// ---------------------------------------------------------------------------------------------------------------- //## Процесс убиства игрока void DuelSystem::KillUserProc(LPOBJ lpObj, LPOBJ lpTarget) { if(!this->DuelCheck(lpObj, lpTarget)) { return; } // ---- int iDuelRoom = this->GetUserDuelRoom(lpObj); // ---- if(iDuelRoom == -1) { return; } // ---- lpTarget->KillerType = 3; // ---- int Points = ((lpObj == this->g_DuelRooms[iDuelRoom].szlpObjOne) ? this->g_DuelRooms[iDuelRoom].szPointsOne : this->g_DuelRooms[iDuelRoom].szPointsTy); // ---- if(Points >= MAX_DUEL_WIN_POINTS) { this->g_DuelRooms[iDuelRoom].szWinner = TRUE; // ---- this->SendEndDuel(lpTarget); this->SendEndDuel(lpObj); // ---- this->SendEndDuelNotification(lpTarget, lpObj->Name, lpTarget->Name); this->SendEndDuelNotification(lpObj, lpObj->Name, lpTarget->Name); // ---- char Buff[256]; // ---- wsprintf(Buff,"You emerge triumphant over %s!", lpTarget->Name); GCServerMsgStringSend(Buff,lpObj->m_Index,1); // ---- wsprintf(Buff,"%s has defeated you!",lpObj->Name); GCServerMsgStringSend(Buff,lpTarget->m_Index,1); // ---- PMSG_SERVERCMD ServerCmd; // ---- PHeadSubSetB((LPBYTE)&ServerCmd, 0xF3, 0x40, sizeof(ServerCmd)); // ---- ServerCmd.CmdType = 0; ServerCmd.X = (int)lpObj->X; ServerCmd.Y = (int)lpObj->Y; // ---- MsgSendV2(lpObj, (unsigned char *)&ServerCmd, sizeof(ServerCmd)); DataSend(lpObj->m_Index, (unsigned char *)&ServerCmd, sizeof(ServerCmd)); // ---- WinnerBuff(lpObj); // ---- this->g_DuelRooms[iDuelRoom].dwTicketCount = GetTickCount() + 10000; // ---- Log.ConsoleOutPut(1, c_Blue,t_Duel,"[Duel System] [%s][%s] Has Won Duel, Looser [%s][%s] Room [%d]", lpObj->AccountID, lpObj->Name, lpTarget->AccountID, lpTarget->Name, iDuelRoom+1); } }
void cDuelSystem::KillUserProc(LPOBJ lpObj, LPOBJ lpTarget) { if(!this->DuelCheck(lpObj, lpTarget)) { return; } int iDuelRoom = this->GetUserDuelRoom(lpObj); if(iDuelRoom == -1) { return; } lpTarget->KillerType = 3; int Points = ((lpObj == this->g_DuelRooms[iDuelRoom].szlpObjOne) ? this->g_DuelRooms[iDuelRoom].szPointsOne : this->g_DuelRooms[iDuelRoom].szPointsTy); if(Points >= Config.WinRounds) { this->g_DuelRooms[iDuelRoom].szWinner = TRUE; this->SendEndDuel(lpTarget); this->SendEndDuel(lpObj); this->SendEndDuelNotification(lpTarget, lpObj->Name, lpTarget->Name); this->SendEndDuelNotification(lpObj, lpObj->Name, lpTarget->Name); char Buff[256]; wsprintf(Buff,"You emerge triumphant over %s!", lpTarget->Name); GCServerMsgStringSend(Buff,lpObj->m_Index,1); wsprintf(Buff,"%s has defeated you!",lpObj->Name); GCServerMsgStringSend(Buff,lpTarget->m_Index,1); PMSG_SERVERCMD ServerCmd; PHeadSubSetB((LPBYTE)&ServerCmd, 0xF3, 0x40, sizeof(ServerCmd)); ServerCmd.CmdType = 0; ServerCmd.X = (int)lpObj->X; ServerCmd.Y = (int)lpObj->Y; MsgSendV2(lpObj, (unsigned char *)&ServerCmd, sizeof(ServerCmd)); DataSend(lpObj->m_Index, (unsigned char *)&ServerCmd, sizeof(ServerCmd)); WinnerBuff(lpObj); this->g_DuelRooms[iDuelRoom].dwTicketCount = GetTickCount() + 10000; Chat.MessageAll(0, 0, NULL, "Duel: %s Vencen, %s Perdeu.", lpObj->Name, lpTarget->Name); Log.ConsoleOutPut ( 1, c_Blue, t_Duel, "[Duel System] [%s][%s] Has Won Duel, Looser [%s][%s] Room [%d]", lpObj->AccountID, lpObj->Name, lpTarget->AccountID, lpTarget->Name, iDuelRoom+1 ); } }