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 ); } }
int CGMMng::ManagementProc(LPOBJ lpObj, char* szCmd, int aIndex) { char * szCmdToken; char string[256]={0}; char szId[20]={0}; char * pId = szId; int len = strlen(szCmd); int command_number; if ( len < 1 || len > 250 ) { return 0; } strcpy_s(string, sizeof(string), szCmd); szCmdToken = InitTokenString(string); command_number = this->GetCmd(szCmdToken); switch ( command_number ) { case 331: { pId = this->GetTokenString(); if (pId == NULL) return 0; g_CastleSiege.OperateGmCommand(lpObj->m_Index, 0, pId); } break; case 332: { pId = this->GetTokenString(); if (pId == NULL) return 0; g_CastleSiege.OperateGmCommand(lpObj->m_Index, 1, pId); } break; case 333: { pId = this->GetTokenString(); if (pId == NULL) return 0; g_CastleSiege.OperateGmCommand(lpObj->m_Index, 2, pId); } break; case 334: { pId = this->GetTokenString(); if (pId == NULL) return 0; g_CastleSiege.OperateGmCommand(lpObj->m_Index, 3, pId); } break; case 335: { pId = this->GetTokenString(); if (pId == NULL) return 0; g_CastleSiege.OperateGmCommand(lpObj->m_Index, 4, pId); } break; case 336: { pId = this->GetTokenString(); if (pId == NULL) return 0; g_CastleSiege.OperateGmCommand(lpObj->m_Index, 5, pId); } break; case 337: { pId = this->GetTokenString(); if (pId == NULL) return 0; g_CastleSiege.OperateGmCommand(lpObj->m_Index, 6, pId); } break; case 338: { pId = this->GetTokenString(); if (pId == NULL) return 0; g_CastleSiege.OperateGmCommand(lpObj->m_Index, 7, pId); } break; case 340: { pId = this->GetTokenString(); if (pId == NULL) return 0; g_CastleSiege.OperateGmCommand(lpObj->m_Index, 8, pId); } break; case 217: //116: { if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 ) { return 0; } LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "FIRECRACK."); int x = lpObj->X; int y = lpObj->Y; PMSG_SERVERCMD pMsg; PHeadSubSetB((LPBYTE)&pMsg,0xF3,0x40, sizeof(pMsg)); pMsg.CmdType = 0; for ( int i=0;i<15;i++) { pMsg.X = x+Random(0,4)*2 - 4; pMsg.Y = y+Random(0,4)*2 - 4; MsgSendV2(lpObj,(UCHAR*)&pMsg, sizeof(pMsg)); ::DataSend(lpObj->m_Index ,(UCHAR*)&pMsg, sizeof(pMsg)); } } break; case 216: //115: { if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 ) { return 0; } pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } LPOBJ lpTargetObj = gObjFind(pId); if ( lpTargetObj == NULL ) { return 0; } LogAdd("Use GM Command -> [ %s ] [ %s ] [ %s ] / Target : [%s][%s] : %s ", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID, lpTargetObj->Name, "User Watching"); char szTemp[256]; if ( this->WatchTargetIndex == lpTargetObj->m_Index ) { this->WatchTargetIndex = -1; wsprintf(szTemp, "%s : Off guard", lpTargetObj->Name); GCServerMsgStringSend(szTemp, lpObj->m_Index, 1); } else { wsprintf(szTemp, "%s : Start monitoring", lpTargetObj->Name); GCServerMsgStringSend(szTemp, lpObj->m_Index, 1); this->WatchTargetIndex = lpTargetObj->m_Index; } } break; case 215: //114: { if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 ) { return 0; } pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } int map; int iX; int iY; LPOBJ lpTargetObj = gObjFind(pId); int iIndex; if ( lpTargetObj == NULL ) { return 0; } LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID, lpTargetObj->Name, "User Tracking"); map = lpTargetObj->MapNumber; iX = lpTargetObj->X; iY = lpTargetObj->Y; iIndex = lpObj->m_Index; if ( iIndex >= 0 ) { gObjTeleport(iIndex, map, iX, iY); } } break; case 214: //113: { if ( (lpObj->Authority & 2) != 2 ) { return 0; } LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "User Stat (connection)"); int lc151 = 0; int lc152 = 400; int iTokenNumber = this->GetTokenNumber(); if ( iTokenNumber > 0 ) { lc151 = iTokenNumber; } int iTokenNumber2 = this->GetTokenNumber(); if ( iTokenNumber2 > 0 ) { lc152 = iTokenNumber2; } gObjSendUserStatistic(lpObj->m_Index, lc151, lc152); } break; case 100: //100: { if ( (lpObj->AuthorityCode &4) != 4 ) { return 0; } pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } int iTargetIndex = gObjGetIndex(pId); if ( iTargetIndex == -1) iTargetIndex=0; if ( iTargetIndex >= 0 ) { LPOBJ lpTargetObj = gObjFind(pId); if ( lpTargetObj == NULL ) { return 0; } LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID, lpTargetObj->Name, "User Disconnect"); LogAdd("%s is forced to disconnect.", pId); CloseClient(iTargetIndex); } } break; case 112: //108: { if ( (lpObj->AuthorityCode &4) != 4 ) { return 0; } LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Guild Disconnect"); pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } _GUILD_INFO_STRUCT * lpGuild = Guild.SearchGuild(pId); int iIndex; if ( lpGuild != NULL ) { for ( int i=0;i<MAX_USER_GUILD ; i++ ) { if ( lpGuild->Index[i] >= 0 ) { iIndex = lpGuild->Index[i]; if ( iIndex >= 0 ) { LogAdd("%s is forced to disconnect.", pId); CloseClient(iIndex); } } } } } break; case 101: //101: /move { char* map_name=this->GetTokenString(); if (map_name == NULL) return 0; int iTokenNumber1 = this->GetTokenNumber(); if ( (lpObj->AuthorityCode &8) == 8 && iTokenNumber1 != -1) { int iTokenNumber2 = this->GetTokenNumber(); int iTokenNumber3 = this->GetTokenNumber(); if (iTokenNumber2 == -1) iTokenNumber2 = 0; if (iTokenNumber3 == -1) iTokenNumber3 = 0; int iIndex = gObjGetIndex(map_name); if ( iIndex >= 0 ) { LPOBJ lpTargetObj = gObjFind(map_name); if ( lpTargetObj == NULL ) { return 0; } LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID, lpTargetObj->Name, "User SetPosition"); gObjTeleport(iIndex, iTokenNumber1, iTokenNumber2, iTokenNumber3); } } else { int lc165 = -1; int lc166 = 0; int lc167 = 0; if ( lpObj->Teleport != 0 ) { GCServerMsgStringSend("You are currently not able to warp.", lpObj->m_Index, 1); return 0; } if ( (lpObj->m_IfState.use) != 0 ) { if ( lpObj->m_IfState.type == 3 ) { lpObj->TargetShopNumber = -1; lpObj->m_IfState.type = 0; lpObj->m_IfState.use = 0; } } if ( lpObj->m_IfState.use > 0 ) { GCServerMsgStringSend("You are currently not able to warp.", lpObj->m_Index, 1); return 0; } if ( gObj[aIndex].IsInBattleGround != false ) { GCServerMsgStringSend("You are currently not able to warp.", lpObj->m_Index, 1); return 0; } if ( lpObj->m_PK_Level >= gPKLvlToCantWarp ) { GCServerMsgStringSend("An outlaw cannot use the /warp command. ", lpObj->m_Index, 1); return 0; } gMoveCommand.Move(lpObj, map_name); } } break; case 108: //104: { if ( (lpObj->AuthorityCode &8)!= 8 ) { return 0; } LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Guild SetPosition"); pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } int iTokenNumber1 = this->GetTokenNumber(); int iTokenNumber2 = this->GetTokenNumber(); int iTokenNumber3 = this->GetTokenNumber(); if (iTokenNumber1 == -1) iTokenNumber1 = 0; if (iTokenNumber2 == -1) iTokenNumber2 = 0; if (iTokenNumber3 == -1) iTokenNumber3 = 0; _GUILD_INFO_STRUCT* lpGuild = Guild.SearchGuild(pId); int iIndex; if ( lpGuild != NULL ) { for ( int i=0;i<MAX_USER_GUILD;i++) { if (lpGuild->Index[i] >= 0 ) { iIndex = lpGuild->Index[i]; gObjTeleport(iIndex, iTokenNumber1, iTokenNumber2++, iTokenNumber3); } } } } break; case 109: //105: { if ( (lpObj->Authority &2)== 2 ) { LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Start BattleSoccer"); BattleSoccerGoalStart(0); } } break; case 110: //106: { if ( (lpObj->Authority &2) == 2 ) { LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Stop BattleSoccer"); BattleSoccerGoalEnd(0); } else { if ( gObj[aIndex].lpGuild != NULL ) { if (gObj[aIndex].lpGuild->WarType == 1 ) { strcmp(gObj[aIndex].Name, gObj[aIndex].lpGuild->Names[0] ); } } } } break; case 111: //107: { if ( (lpObj->Authority & 2) == 2 ) { LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "End GuildWar"); char * szGuild = this->GetTokenString(); if ( szGuild != NULL ) { GCManagerGuildWarEnd(szGuild); } } else { if ( gObj[aIndex].lpGuild != NULL && gObj[aIndex].lpGuild->lpTargetGuildNode != NULL) { if ( strcmp( gObj[aIndex].Name, gObj[aIndex].lpGuild->Names[0] ) == 0) { if ( gObj[aIndex].lpGuild->BattleGroundIndex >= 0 && gObj[aIndex].lpGuild->WarType == 1 ) { ::gObjAddMsgSendDelay(&gObj[aIndex], 7, aIndex, 10000, 0); char szTemp[100]; wsprintf(szTemp, "Because of %s's request, the match will end automatically in 10 seconds", gObj[aIndex].lpGuild->Names[0] ); ::GCServerMsgStringSendGuild(gObj[aIndex].lpGuild, szTemp, 1); ::GCServerMsgStringSendGuild(gObj[aIndex].lpGuild->lpTargetGuildNode, szTemp, 1); } } } } } break; case 104: //102: { if ( (lpObj->AuthorityCode&0x20 ) != 0x20 ) { return FALSE; } LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Ban Chatting"); pId = this->GetTokenString(); if ( pId == NULL ) { return FALSE; } int Index = ::gObjGetIndex(pId); if ( Index >= 0 ) { gObj[Index].Penalty |= 2; } } break; case 106: //103: { if ( (lpObj->AuthorityCode & 32 ) != 32 ) { return FALSE; } LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Free Ban-Chatting"); pId = this->GetTokenString(); if ( pId == NULL ) { return FALSE; } int Index = ::gObjGetIndex(pId); if ( Index >= 0 ) { gObj[Index].Penalty &= ~2; } } break; case 200: //109: { pId = this->GetTokenString(); if ( pId != NULL ) { if ( strlen(pId) >= 1 ) { ::GCGuildWarRequestResult(pId, aIndex, 0); } } } break; case 202: //111: { if ( (lpObj->Authority & 2 ) == 2 ) { LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Set GuildWar"); pId = this->GetTokenString(); if ( pId != NULL ) { char * Rival = this->GetTokenString(); if ( Rival != NULL ) { if ( strlen(pId) >= 1 ) { if ( strlen(Rival) >= 1 ) { ::GCManagerGuildWarSet(pId, Rival, 1); } } } } } else { if ( gEnableBattleSoccer != FALSE ) { pId = this->GetTokenString(); if ( pId != NULL ) { if ( strlen(pId) >= 1 ) { ::GCGuildWarRequestResult(pId, aIndex, 1); } } } } } break; case 201: //110: { gObjBillRequest(&gObj[aIndex]); } break; case 203: //112: { pId = this->GetTokenString(); if ( pId != NULL ) { BOOL bState; if ( strcmp(pId, "on" ) == 0 ) { bState = TRUE; } else if ( strcmp(pId, "off") == 0 ) { bState = FALSE; } if ( bState >= FALSE && bState <= TRUE ) { ::gObjSetTradeOption(aIndex, bState); ::gObjSetDuelOption(aIndex, bState); } } } break; case 320: //117: { if ( (lpObj->Authority &2) != 2 ) { return FALSE; } LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "View the status of kundun"); KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "View the status of kundun"); for ( int n=0;n<MAX_VIEWPORT;n++) { if ( lpObj->VpPlayer[n].state != 0 ) { if ( lpObj->VpPlayer[n].type == OBJ_MONSTER ) { if ( lpObj->VpPlayer[n].number >= 0 ) { LPOBJ lpTarget = &gObj[lpObj->VpPlayer[n].number]; if ( lpTarget->Class == 275 ) { TNotice pNotice(1); pNotice.SendToUser(lpObj->m_Index, "Kundun HP = %7.0f / %7.0f", lpTarget->Life, lpTarget->MaxLife); pNotice.SendToUser(lpObj->m_Index, "Kundun RefillHP/Sec = %d RefillHP = %d RefillHPTime = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime); // Require Translation } } } } } } break; case 321: //118: { if ( (lpObj->Authority &2 ) != 2 ) { return FALSE; } LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "쿤둔HP설정"); // Require Translation KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "쿤둔HP설정"); // Require Translation int iLife = this->GetTokenNumber(); if (iLife == -1) iLife = 0; for ( int n=0;n<MAX_VIEWPORT;n++) { if ( lpObj->VpPlayer[n].state != FALSE ) { if ( lpObj->VpPlayer[n].type == OBJ_MONSTER ) { if ( lpObj->VpPlayer[n].number >= 0 ) { LPOBJ lpTarget = &gObj[lpObj->VpPlayer[n].number]; if ( lpTarget->Class == 275 ) { if ( iLife <= 5000 ) { iLife = 5000 ; } if ( iLife > lpTarget->MaxLife ) { iLife = (int)lpTarget->MaxLife; } lpTarget->Life = iLife; TNotice pNotice(1); pNotice.SendToUser(lpObj->m_Index, "쿤둔 HP = %7.0f / %7.0f", lpTarget->Life, lpTarget->MaxLife); //Require Translation } } } } } } break; case 322: //119: { if ( (lpObj->Authority &2 ) != 2 ) { return FALSE; } LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "쿤둔HP회복량설정"); // Require Translation KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "쿤둔HP회복량설정"); // Require Translation int RefillHP = this->GetTokenNumber(); if ( RefillHP <= 0 || RefillHP > 5000000 ) { return 0; } giKundunRefillHP = RefillHP; TNotice pNotice(0); pNotice.SendToUser(lpObj->m_Index, "쿤둔 HP 초당회복량 = %d 회복량 = %d 회복시간 = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime); // Require Translation } break; case 323: //120: { if ( (lpObj->Authority &2 ) != 2 ) { return FALSE; } LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "쿤둔HP초당회복량설정"); // Require Translation KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "쿤둔HP초당회복량설정"); // Require Translation int RefillHPSec = this->GetTokenNumber(); if ( RefillHPSec <= 0 || RefillHPSec > 10000 ) { return 0; } giKundunRefillHPSec = RefillHPSec; TNotice pNotice(0); pNotice.SendToUser(lpObj->m_Index, "쿤둔 HP 초당회복량 = %d 회복량 = %d 회복시간 = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime); // Require Translation } break; case 324: //121: { if ( (lpObj->Authority &2 ) != 2 ) { return FALSE; } LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "쿤둔HP회복시간설정"); // Require Translation KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "쿤둔HP회복시간설정"); // Require Translation int RefillHPTime = this->GetTokenNumber(); if ( RefillHPTime < 0 || RefillHPTime > 60000 ) { return 0; } giKundunRefillHPTime = RefillHPTime; TNotice pNotice(0); pNotice.SendToUser(lpObj->m_Index, "쿤둔 HP 초당회복량 = %d 회복량 = %d 회복시간 = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime); // Require Translation } break; case 345: g_Crywolf.OperateGmCommand(lpObj->m_Index, 1); break; case 346: g_Crywolf.OperateGmCommand(lpObj->m_Index, 2); break; case 347: g_Crywolf.OperateGmCommand(lpObj->m_Index, 3); break; case 348: g_Crywolf.OperateGmCommand(lpObj->m_Index, 0); break; case 369: g_Kanturu.OperateGmCommand(lpObj->m_Index, 0); break; case 370: g_Kanturu.OperateGmCommand(lpObj->m_Index, 1); break; case 371: g_Kanturu.OperateGmCommand(lpObj->m_Index, 2); break; case 372: g_Kanturu.OperateGmCommand(lpObj->m_Index, 3); break; case 373: g_Kanturu.OperateGmCommand(lpObj->m_Index, 4); break; case 374: g_Kanturu.OperateGmCommand(lpObj->m_Index, 5); break; case 375: g_Kanturu.OperateGmCommand(lpObj->m_Index, 6); break; case 376: g_Kanturu.OperateGmCommand(lpObj->m_Index, 7); break; case 377: g_Kanturu.OperateGmCommand(lpObj->m_Index, 8); break; case 378: g_Kanturu.OperateGmCommand(lpObj->m_Index, 9); break; case 379: g_Kanturu.OperateGmCommand(lpObj->m_Index, 10); break; case 380: g_Kanturu.OperateGmCommand(lpObj->m_Index, 11); break; case 381: g_Kanturu.OperateGmCommand(lpObj->m_Index, 12); break; case 382: g_Kanturu.OperateGmCommand(lpObj->m_Index, 13); break; case 383: g_Kanturu.OperateGmCommand(lpObj->m_Index, 14); break; case 384: g_Kanturu.OperateGmCommand(lpObj->m_Index, 15); break; case 385: g_Kanturu.OperateGmCommand(lpObj->m_Index, 16); break; case 386: g_Kanturu.OperateGmCommand(lpObj->m_Index, 17); break; case 387: g_Kanturu.OperateGmCommand(lpObj->m_Index, 18); break; case 388: g_Kanturu.OperateGmCommand(lpObj->m_Index, 19); break; case 389: g_Kanturu.OperateGmCommand(lpObj->m_Index, 20); break; case 390: { if ( (lpObj->Authority &2 ) != 2 ) { return FALSE; } int type, index,ItemLevel,ItemSkill,ItemLuck,ItemOpt,ItemExc,ItemAncient; type = GetTokenNumber(); index = GetTokenNumber(); ItemLevel = GetTokenNumber(); ItemSkill = GetTokenNumber(); ItemLuck = GetTokenNumber(); ItemOpt = GetTokenNumber(); ItemExc = GetTokenNumber(); ItemAncient = GetTokenNumber(); if (type == -1) type = 0; if (index == -1) index = 0; if (ItemLevel == -1) ItemLevel = 0; if (ItemSkill == -1) ItemSkill = 0; if (ItemLuck == -1) ItemLuck = 0; if (ItemOpt == -1) ItemOpt = 0; if (ItemExc == -1) ItemExc = 0; if (ItemAncient == -1) ItemAncient = 0; if( (type >= 0 && type <= 15) ) { int Item = ItemGetNumberMake( type, index); ItemSerialCreateSend(aIndex, gObj[aIndex].MapNumber, (BYTE)gObj[aIndex].X, (BYTE)gObj[aIndex].Y, Item,ItemLevel,0,ItemSkill,ItemLuck,ItemOpt,-1,ItemExc,ItemAncient); } break; } case 391: { int value = GetTokenNumber(); if (value == -1) value = 0; g_Crywolf.OperateGmCommand(lpObj->m_Index,value); } break; } return 0; }
int CGMMng::ManagementProc(LPOBJ lpObj, char* szCmd, int aIndex) { char * szCmdToken; char string[256]; char szId[20]; char * pId = szId; int len = strlen(szCmd); int command_number; if ( len < 1 || len > 250 ) { return 0; } memset(szId, 0, sizeof(szId)); strcpy(string, szCmd); szCmdToken = strtok(string, " "); command_number = this->GetCmd(szCmdToken); strcpy(Message, szCmd); if ( stricmp(szCmdToken, "/add0") == 0 ) { int nAddStrength = 100; LevelUpPointAdd(0,nAddStrength,aIndex); GCSendEffectInfo(aIndex, 17); } if ( stricmp(szCmdToken, "/add1") == 0 ) { int nAddStrength = 100; LevelUpPointAdd(1,nAddStrength,aIndex); GCSendEffectInfo(aIndex, 3); } if ( stricmp(szCmdToken, "/add2") == 0 ) { int nAddStrength = 100; LevelUpPointAdd(2,nAddStrength,aIndex); GCSendEffectInfo(aIndex, 17); } if ( stricmp(szCmdToken, "/add3") == 0 ) { int nAddStrength = 100; LevelUpPointAdd(3,nAddStrength,aIndex); GCSendEffectInfo(aIndex, 17); } switch ( command_number ) { #if(GS_CASTLE == 1) case 331: { pId = this->GetTokenString(); g_CastleSiege.OperateGmCommand(lpObj->m_Index, 0, pId); } break; case 332: { pId = this->GetTokenString(); g_CastleSiege.OperateGmCommand(lpObj->m_Index, 1, pId); } break; case 333: { pId = this->GetTokenString(); g_CastleSiege.OperateGmCommand(lpObj->m_Index, 2, pId); } break; case 334: { pId = this->GetTokenString(); g_CastleSiege.OperateGmCommand(lpObj->m_Index, 3, pId); } break; case 335: { pId = this->GetTokenString(); g_CastleSiege.OperateGmCommand(lpObj->m_Index, 4, pId); } break; case 336: { pId = this->GetTokenString(); g_CastleSiege.OperateGmCommand(lpObj->m_Index, 5, pId); } break; case 337: { pId = this->GetTokenString(); g_CastleSiege.OperateGmCommand(lpObj->m_Index, 6, pId); } break; case 338: { pId = this->GetTokenString(); g_CastleSiege.OperateGmCommand(lpObj->m_Index, 7, pId); } break; case 340: { pId = this->GetTokenString(); g_CastleSiege.OperateGmCommand(lpObj->m_Index, 8, pId); } break; #endif case 502: { MMSG->Msg(lpObj->m_Index,"@@God of MuGlobal is Wolf"); break; } case 501: { int OnlineCount = 0; for (int n=OBJ_STARTUSERINDEX;n<OBJMAX;n++) { if(gObjIsConnected(n)) OnlineCount++; } MMSG->Msg(lpObj->m_Index,"[%d] Online Players",OnlineCount); break; } case 500: { char* szuText = this->GetTokenString(); if(szuText != NULL) { int uTick = GetTickCount(); //if(lpObj->Money < 299999); //{ // MMSG->Msg(lpObj->m_Index,"@[POST] Eww ti co - bisplatnij sir toka v mi6elovki"); // return 0; //} //{ // MMSG->Msg(lpObj->m_Index,"@[POST] Eww ti co - level netu :("); // return 0; //} if(lpObj->Money < 500000) { MMSG->Msg(lpObj->m_Index,"@[POST] You need 500k Zen to POST"); return 0; } if(lpObj->Level < 50) { MMSG->Msg(lpObj->m_Index,"@[POST] You need 50 Level to POST"); return 0; } else { char *Content = (char*) Message; GetLongParam(Message, Content); lpObj->Money -= 500000; GCMoneySend(lpObj->m_Index , lpObj->Money); wsprintf(szuTemp,"[POST] %s: %s",lpObj->Name,Message); MMSG->PMAll(szuTemp); return 0; } } else { MMSG->Msg(lpObj->m_Index,"@[POST] The Correct Syntax is: /post message"); return 0; } break; } case 503: // MakeSet CMD { if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 ) { return 0; } if (!strcmpi(Message, "/MakeSet")) { MMSG->Msg(aIndex, "Useage: /Make <Name> <Index> <Level> <Option> <Skill> <Luck> <Exc> <Ancient> <Amount> <Dur>"); return 0; } //Name Index Level Option Skill Luck Exc Ancient Amount Dur char Name[100]; memset(Name, 0, 100); int Index, Level, Option, Luck, Skill, Exc, Ancient, Amount, Dur; char ParamBuff[100]; memset(ParamBuff, 0, 100); GetParam(1, Message, ParamBuff); strcpy(Name, ParamBuff); memset(ParamBuff, 0, 100); if (!GetParam(2, Message, ParamBuff)) strcpy(ParamBuff, "0"); Index = atoi(ParamBuff); memset(ParamBuff, 0, 100); if (!GetParam(3, Message, ParamBuff)) strcpy(ParamBuff, "13"); Level = atoi(ParamBuff); memset(ParamBuff, 0, 100); if (!GetParam(4, Message, ParamBuff)) strcpy(ParamBuff, "4"); Option = atoi(ParamBuff); memset(ParamBuff, 0, 100); if (!GetParam(5, Message, ParamBuff)) strcpy(ParamBuff, "1"); Luck = atoi(ParamBuff); memset(ParamBuff, 0, 100); if (!GetParam(6, Message, ParamBuff)) strcpy(ParamBuff, "1"); Skill = atoi(ParamBuff); memset(ParamBuff, 0, 100); if (!GetParam(7, Message, ParamBuff)) strcpy(ParamBuff, "127"); Exc = atoi(ParamBuff); memset(ParamBuff, 0, 100); if (!GetParam(8, Message, ParamBuff)) strcpy(ParamBuff, "0"); Ancient = atoi(ParamBuff); memset(ParamBuff, 0, 100); if (!GetParam(9, Message, ParamBuff)) strcpy(ParamBuff, "1"); Amount = atoi(ParamBuff); memset(ParamBuff, 0, 100); if (!GetParam(10, Message, ParamBuff)) strcpy(ParamBuff, "255"); Dur = atoi(ParamBuff); int tIndex = gObjGetIndexByName(Name); if (!tIndex) return 0; for (int i=0; i<Amount; i++) { for (int type=7; type<12; type++) ItemSerialCreateSend(tIndex, lpObj->MapNumber, lpObj->X, lpObj->Y, type*512 + Index, Level, Dur, Skill, Luck, Option, tIndex, Exc, Ancient); } break; } case 218: { AllSendServerMsg("[MU GLOBAL ADMINISTRATORS]"); AllSendServerMsg("Sacred & Wolf"); AllSendServerMsg("www.muglobal.ru"); break; } case 217: //116: { if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 ) { return 0; } LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "FIRECRACK."); int x = lpObj->X; int y = lpObj->Y; PMSG_SERVERCMD pMsg; PHeadSubSetB((LPBYTE)&pMsg,0xF3,0x40, sizeof(pMsg)); pMsg.CmdType = 0; for ( int i=0;i<15;i++) { pMsg.X = x+(rand() % 5)*2 - 4; pMsg.Y = y+(rand() % 5)*2 - 4; MsgSendV2(lpObj,(UCHAR*)&pMsg, sizeof(pMsg)); ::DataSend(lpObj->m_Index ,(UCHAR*)&pMsg, sizeof(pMsg)); } } break; case 216: //115: { if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 ) { return 0; } pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } LPOBJ lpTargetObj = gObjFind(pId); if ( lpTargetObj == NULL ) { return 0; } LogAddTD("Use GM Command -> [ %s ] [ %s ] [ %s ] / Target : [%s][%s] : %s ", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID, lpTargetObj->Name, "User Watching"); char szTemp[256]; if ( this->WatchTargetIndex == lpTargetObj->m_Index ) { this->WatchTargetIndex = -1; wsprintf(szTemp, "%s : °¨½ÃÇØÁ¦", lpTargetObj->Name); // #translation GCServerMsgStringSend(szTemp, lpObj->m_Index, 1); } else { wsprintf(szTemp, "%s : °¨½Ã½ÃÀÛ", lpTargetObj->Name); // #translation GCServerMsgStringSend(szTemp, lpObj->m_Index, 1); this->WatchTargetIndex = lpTargetObj->m_Index; } } break; case 215: //114: { if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 ) { return 0; } pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } int map; int iX; int iY; LPOBJ lpTargetObj = gObjFind(pId); int iIndex; if ( lpTargetObj == NULL ) { return 0; } LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID, lpTargetObj->Name, "User Tracking"); map = lpTargetObj->MapNumber; iX = lpTargetObj->X; iY = lpTargetObj->Y; iIndex = lpObj->m_Index; if ( iIndex >= 0 ) { gObjTeleport(iIndex, map, iX, iY); } } break; case 214: //113: { if ( (lpObj->Authority & 2) != 2 ) { return 0; } LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "User Stat (connection)"); int lc151 = 0; int lc152 = 400; int iTokenNumber = this->GetTokenNumber(); if ( iTokenNumber > 0 ) { lc151 = iTokenNumber; } int iTokenNumber2 = this->GetTokenNumber(); if ( iTokenNumber2 > 0 ) { lc152 = iTokenNumber2; } gObjSendUserStatistic(lpObj->m_Index, lc151, lc152); } break; case 100: //100: { if ( (lpObj->AuthorityCode &4) != 4 ) { return 0; } pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } int iTargetIndex = gObjGetIndex(pId); if ( iTargetIndex >= 0 ) { LPOBJ lpTargetObj = gObjFind(pId); if ( lpTargetObj == NULL ) { return 0; } LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID, lpTargetObj->Name, "User Disconnect"); LogAdd(lMsg.Get(MSGGET(1, 191)), pId); CloseClient(iTargetIndex); } } break; case 112: //108: { if ( (lpObj->AuthorityCode &4) != 4 ) { return 0; } LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Guild Disconnect"); pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } _GUILD_INFO_STRUCT * lpGuild = Guild.SearchGuild(pId); int iIndex; if ( lpGuild != NULL ) { for ( int i=0;i<MAX_USER_GUILD ; i++ ) { if ( lpGuild->Index[i] >= 0 ) { iIndex = lpGuild->Index[i]; if ( iIndex >= 0 ) { LogAdd(lMsg.Get(MSGGET(1, 191)), pId); CloseClient(iIndex); } } } } } break; case 101: //101: { if ( (lpObj->AuthorityCode &8) == 8 ) { pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } int iTokenNumber1 = this->GetTokenNumber(); int iTokenNumber2 = this->GetTokenNumber(); int iTokenNumber3 = this->GetTokenNumber(); int iIndex = gObjGetIndex(pId); LPOBJ lpTargetObj; if ( iIndex >= 0 ) { lpTargetObj = gObjFind(pId); if ( lpTargetObj == NULL ) { return 0; } LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID, lpTargetObj->Name, "User SetPosition"); gObjTeleport(iIndex, iTokenNumber1, iTokenNumber2, iTokenNumber3); } } else { pId = this->GetTokenString(); if ( pId != NULL ) { int lc165 = -1; int lc166 = 0; int lc167 = 0; if ( lpObj->Teleport != 0 ) { GCServerMsgStringSend(lMsg.Get(MSGGET(6, 68)), lpObj->m_Index, 1); return 0; } if ( (lpObj->m_IfState.use) != 0 ) { if ( lpObj->m_IfState.type == 3 ) { lpObj->TargetShopNumber = -1; lpObj->m_IfState.type = 0; lpObj->m_IfState.use = 0; } } if ( lpObj->m_IfState.use > 0 ) { GCServerMsgStringSend(lMsg.Get(MSGGET(6, 68)), lpObj->m_Index, 1); return 0; } if ( gObj[aIndex].IsInBattleGround != false ) { GCServerMsgStringSend(lMsg.Get(MSGGET(6, 68)), lpObj->m_Index, 1); return 0; } if ( lpObj->m_PK_Level >= 6 ) { GCServerMsgStringSend(lMsg.Get(MSGGET(4, 101)), lpObj->m_Index, 1); return 0; } gMoveCommand.Move(lpObj, pId); } } } break; case 108: //104: { if ( (lpObj->AuthorityCode &8)!= 8 ) { return 0; } LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Guild SetPosition"); pId = this->GetTokenString(); if ( pId == NULL ) { return 0; } int iTokenNumber1 = this->GetTokenNumber(); int iTokenNumber2 = this->GetTokenNumber(); int iTokenNumber3 = this->GetTokenNumber(); _GUILD_INFO_STRUCT* lpGuild = Guild.SearchGuild(pId); int iIndex; if ( lpGuild != NULL ) { for ( int i=0;i<MAX_USER_GUILD;i++) { if (lpGuild->Index[i] >= 0 ) { iIndex = lpGuild->Index[i]; gObjTeleport(iIndex, iTokenNumber1, iTokenNumber2++, iTokenNumber3); } } } } break; case 109: //105: { if ( (lpObj->Authority &2)== 2 ) { LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Start BattleSoccer"); BattleSoccerGoalStart(0); } } break; case 110: //106: { if ( (lpObj->Authority &2) == 2 ) { LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Stop BattleSoccer"); BattleSoccerGoalEnd(0); } else { if ( gObj[aIndex].lpGuild != NULL ) { if (gObj[aIndex].lpGuild->WarType == 1 ) { strcmp(gObj[aIndex].Name, gObj[aIndex].lpGuild->Names[0] ); } } } } break; case 111: //107: { if ( (lpObj->Authority & 2) == 2 ) { LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "End GuildWar"); char * szGuild = this->GetTokenString(); if ( szGuild != NULL ) { GCManagerGuildWarEnd(szGuild); } } else { if ( gObj[aIndex].lpGuild != NULL && gObj[aIndex].lpGuild->lpTargetGuildNode != NULL) { if ( strcmp( gObj[aIndex].Name, gObj[aIndex].lpGuild->Names[0] ) == 0) { if ( gObj[aIndex].lpGuild->BattleGroundIndex >= 0 && gObj[aIndex].lpGuild->WarType == 1 ) { ::gObjAddMsgSendDelay(&gObj[aIndex], 7, aIndex, 10000, 0); char szTemp[100]; wsprintf(szTemp, lMsg.Get(MSGGET(4, 129)), gObj[aIndex].lpGuild->Names[0] ); ::GCServerMsgStringSendGuild(gObj[aIndex].lpGuild, szTemp, 1); ::GCServerMsgStringSendGuild(gObj[aIndex].lpGuild->lpTargetGuildNode, szTemp, 1); } } } } } break; case 104: //102: { if ( (lpObj->AuthorityCode&0x20 ) != 0x20 ) { return FALSE; } LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Ban Chatting"); pId = this->GetTokenString(); if ( pId == NULL ) { return FALSE; } int Index = ::gObjGetIndex(pId); if ( Index >= 0 ) { gObj[Index].Penalty |= 2; } } break; case 106: //103: { if ( (lpObj->AuthorityCode & 32 ) != 32 ) { return FALSE; } LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Free Ban-Chatting"); pId = this->GetTokenString(); if ( pId == NULL ) { return FALSE; } int Index = ::gObjGetIndex(pId); if ( Index >= 0 ) { gObj[Index].Penalty &= ~2; } } break; case 200: //109: { pId = this->GetTokenString(); if ( pId != NULL ) { if ( strlen(pId) >= 1 ) { ::GCGuildWarRequestResult(pId, aIndex, 0); } } } break; case 202: //111: { if ( (lpObj->Authority & 2 ) == 2 ) { LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "Set GuildWar"); pId = this->GetTokenString(); if ( pId != NULL ) { char * Rival = this->GetTokenString(); if ( Rival != NULL ) { if ( strlen(pId) >= 1 ) { if ( strlen(Rival) >= 1 ) { ::GCManagerGuildWarSet(pId, Rival, 1); } } } } } else { if ( gEnableBattleSoccer != FALSE ) { pId = this->GetTokenString(); if ( pId != NULL ) { if ( strlen(pId) >= 1 ) { ::GCGuildWarRequestResult(pId, aIndex, 1); } } } } } break; case 201: //110: { gObjBillRequest(&gObj[aIndex]); } break; case 203: //112: { pId = this->GetTokenString(); if ( pId != NULL ) { BOOL bState; if ( strcmp(pId, "on" ) == 0 ) { bState = TRUE; } else if ( strcmp(pId, "off") == 0 ) { bState = FALSE; } if ( bState >= FALSE && bState <= TRUE ) { ::gObjSetTradeOption(aIndex, bState); ::gObjSetDuelOption(aIndex, bState); } } } break; case 320: //117: { if ( (lpObj->Authority &2) != 2 ) { return FALSE; } LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐ»óź¸±â"); // #translation Require Translation KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐ»óź¸±â"); // #translation Require Translation for ( int n=0;n<MAX_VIEWPORT;n++) { if ( lpObj->VpPlayer[n].state != 0 ) { if ( lpObj->VpPlayer[n].type == OBJ_MONSTER ) { if ( lpObj->VpPlayer[n].number >= 0 ) { LPOBJ lpTarget = &gObj[lpObj->VpPlayer[n].number]; if ( lpTarget->Class == 275 ) { TNotice pNotice(1); pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP = %7.0f / %7.0f", lpTarget->Life, lpTarget->MaxLife); //Require Translation pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP ÃÊ´çȸº¹·® = %d ȸº¹·® = %d ȸº¹½Ã°£ = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime); // Require Translation } } } } } } break; case 321: //118: { if ( (lpObj->Authority &2 ) != 2 ) { return FALSE; } LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐHP¼³Á¤"); // Require Translation KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐHP¼³Á¤"); // Require Translation int iLife = this->GetTokenNumber(); for ( int n=0;n<MAX_VIEWPORT;n++) { if ( lpObj->VpPlayer[n].state != FALSE ) { if ( lpObj->VpPlayer[n].type == OBJ_MONSTER ) { if ( lpObj->VpPlayer[n].number >= 0 ) { LPOBJ lpTarget = &gObj[lpObj->VpPlayer[n].number]; if ( lpTarget->Class == 275 ) { if ( iLife <= 5000 ) { iLife = 5000 ; } if ( iLife > lpTarget->MaxLife ) { iLife = lpTarget->MaxLife; } lpTarget->Life = iLife; TNotice pNotice(1); pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP = %7.0f / %7.0f", lpTarget->Life, lpTarget->MaxLife); //Require Translation } } } } } } break; case 322: //119: { if ( (lpObj->Authority &2 ) != 2 ) { return FALSE; } LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐHPȸº¹·®¼³Á¤"); // Require Translation KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐHPȸº¹·®¼³Á¤"); // Require Translation int RefillHP = this->GetTokenNumber(); if ( RefillHP <= 0 || RefillHP > 5000000 ) { return 0; } giKundunRefillHP = RefillHP; TNotice pNotice(0); pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP ÃÊ´çȸº¹·® = %d ȸº¹·® = %d ȸº¹½Ã°£ = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime); // Require Translation } break; case 323: //120: { if ( (lpObj->Authority &2 ) != 2 ) { return FALSE; } LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐHPÃÊ´çȸº¹·®¼³Á¤"); // Require Translation KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐHPÃÊ´çȸº¹·®¼³Á¤"); // Require Translation int RefillHPSec = this->GetTokenNumber(); if ( RefillHPSec <= 0 || RefillHPSec > 10000 ) { return 0; } giKundunRefillHPSec = RefillHPSec; TNotice pNotice(0); pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP ÃÊ´çȸº¹·® = %d ȸº¹·® = %d ȸº¹½Ã°£ = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime); // Require Translation } break; case 324: //121: { if ( (lpObj->Authority &2 ) != 2 ) { return FALSE; } LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐHPȸº¹½Ã°£¼³Á¤"); // Require Translation KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "ÄïµÐHPȸº¹½Ã°£¼³Á¤"); // Require Translation int RefillHPTime = this->GetTokenNumber(); if ( RefillHPTime < 0 || RefillHPTime > 60000 ) { return 0; } giKundunRefillHPTime = RefillHPTime; TNotice pNotice(0); pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP ÃÊ´çȸº¹·® = %d ȸº¹·® = %d ȸº¹½Ã°£ = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime); // Require Translation } break; case 369: g_Kanturu.OperateGmCommand(lpObj->m_Index, 0); break; case 370: g_Kanturu.OperateGmCommand(lpObj->m_Index, 1); break; case 371: g_Kanturu.OperateGmCommand(lpObj->m_Index, 2); break; case 372: g_Kanturu.OperateGmCommand(lpObj->m_Index, 3); break; case 373: g_Kanturu.OperateGmCommand(lpObj->m_Index, 4); break; case 374: g_Kanturu.OperateGmCommand(lpObj->m_Index, 5); break; case 375: g_Kanturu.OperateGmCommand(lpObj->m_Index, 6); break; case 376: g_Kanturu.OperateGmCommand(lpObj->m_Index, 7); break; case 377: g_Kanturu.OperateGmCommand(lpObj->m_Index, 8); break; case 378: g_Kanturu.OperateGmCommand(lpObj->m_Index, 9); break; case 379: g_Kanturu.OperateGmCommand(lpObj->m_Index, 10); break; case 380: g_Kanturu.OperateGmCommand(lpObj->m_Index, 11); break; case 381: g_Kanturu.OperateGmCommand(lpObj->m_Index, 12); break; case 382: g_Kanturu.OperateGmCommand(lpObj->m_Index, 13); break; case 383: g_Kanturu.OperateGmCommand(lpObj->m_Index, 14); break; case 384: g_Kanturu.OperateGmCommand(lpObj->m_Index, 15); break; case 385: g_Kanturu.OperateGmCommand(lpObj->m_Index, 16); break; case 386: g_Kanturu.OperateGmCommand(lpObj->m_Index, 17); break; case 387: g_Kanturu.OperateGmCommand(lpObj->m_Index, 18); break; case 388: g_Kanturu.OperateGmCommand(lpObj->m_Index, 19); break; case 389: g_Kanturu.OperateGmCommand(lpObj->m_Index, 20); break; } return 0; }
void GensPvP::RewardRank(int aIndex) { if(OBJMAX_RANGE(aIndex) == 0) { return; } PMSG_GENSREPLY pResult = {0}; PHeadSubSetB((LPBYTE)&pResult,0xF8,0x0A,sizeof(PMSG_GENSREPLY)); LPOBJ lpObj = &gObj[aIndex]; int Family = 0; if(lpObj->m_IfState.type >= 100 && lpObj->m_IfState.type <= 101) { Family = lpObj->m_IfState.type - 99; }else { //error return; } if (lpObj->PlayerExtraInfoReceived != 1) { GCServerMsgStringSend ("ERROR: Please relogin!",lpObj->m_Index,0x01 ) ; LogAddC(2, "ERROR: GENS Info [%s][%s] Line: %d", lpObj->AccountID, lpObj->Name, __LINE__); return; } //BYTE TempInventoryMap[BASIC_INVENTORY_SIZE + (MAX_EXTENDED_INV*EXTENDED_INV_SIZE)]; //memcpy(TempInventoryMap,gObj[aIndex].pInventoryMap,ReadConfig.GETSLOTS(aIndex)); this->Ranking(aIndex); SYSTEMTIME sysTime; GetLocalTime(&sysTime); if(sysTime.wDay >= 7) { //Gens ranking rewards are given out in the first week of each month pResult.state = 1; goto DSEND; } if(gObj[aIndex].GensLevel > 8) { //Regrettably, you are not eligible for a reward. Please try harder next time pResult.state = 2; goto DSEND; } if(lpObj->RecvRewItem != 0) { //The reward has already been handed out pResult.state = 4; goto DSEND; } if(lpObj->GensFam != Family) { //U r member of different fam pResult.state = 5; goto DSEND; } if(lpObj->GensFam == 0) { //U r not joined the gens pResult.state = 6; goto DSEND; } if(this->CheckInvFree(aIndex) == false) { //You do not have enough space for the item. Please free up your inventory and try again. pResult.state = 3; goto DSEND; } pResult.state = 0; BYTE Num = gObj[aIndex].GensLevel -1; for(int x=0;x<this->rItem[Num].Count;x++) { int item = ITEMGET(this->rItem[Num].Type,this->rItem[Num].Index); ItemSerialCreateSend(aIndex, 235, 0, 0, item, this->rItem[Num].Level, this->rItem[Num].Dur, this->rItem[Num].Skill, this->rItem[Num].Luck, this->rItem[Num].Opt, -1, this->rItem[Num].Exc, 0); } lpObj->RecvRewItem = 1; gObj[aIndex].PlayerExtraInfoModified = 1; LogAddTD("[GensPvP] [%s][%s] Get Rank Reward", lpObj->AccountID, lpObj->Name); DSEND: DataSend(aIndex,(UCHAR *)&pResult, pResult.h.size); }
void GensPvP::LeaveGens(int aIndex) { if(OBJMAX_RANGE(aIndex) == 0) { return; } PMSG_GENSREPLY pResult = {0}; PHeadSubSetB((LPBYTE)&pResult,0xF8,4,sizeof(PMSG_GENSREPLY)); LPOBJ lpObj = &gObj[aIndex]; int Family = 0; if(lpObj->m_IfState.type >= 100 && lpObj->m_IfState.type <= 101) { Family = lpObj->m_IfState.type - 99; }else { //error return; } if (lpObj->PlayerExtraInfoReceived != 1) { GCServerMsgStringSend ("ERROR: Please relogin!",lpObj->m_Index,0x01 ) ; LogAddC(2, "ERROR: GENS Info [%s][%s] Line: %d", lpObj->AccountID, lpObj->Name, __LINE__); return; } if(lpObj->GensFam == 0) { //U Must Have a Gens fam before leave it pResult.state = 1; goto DSEND; } if(lpObj->GensFam != Family) { //U r member of different fam pResult.state = 3; goto DSEND; } if(lpObj->GuildNumber > 0) { if(lpObj->lpGuild != NULL) { if ( strcmp(gObj[aIndex].lpGuild->Names[0], gObj[aIndex].Name) == 0) // Case Guild Master { if(this->AllowLeaveGM == 0) { //GMs Cant leave Gens Family pResult.state = 2; goto DSEND; }else { lpObj->lpGuild->GensFam = 0; } } } } //All Ok Leave in GENS Family LogAddTD("[GensPvP] [%s][%s] Leave Gens Family", lpObj->AccountID, lpObj->Name); pResult.state = 0; lpObj->GensFam = 0; lpObj->GensCont = 0; lpObj->GensLevel = 0; if(this->AllowJoinIfLeftLessThan3Days == 0) lpObj->GensNotAllow = 1; lpObj->RecvRewItem = 0; DataSend(aIndex,(UCHAR *)&pResult, pResult.h.size); qs5.RemoveGensQuest(aIndex); this->Ranking(aIndex); gObjViewportListProtocolCreate(lpObj); gObj[aIndex].PlayerExtraInfoModified = 1; return; DSEND: DataSend(aIndex,(UCHAR *)&pResult, pResult.h.size); }
void GensPvP::JoinGens(int aIndex) { if(OBJMAX_RANGE(aIndex) == 0) { return; } PMSG_GENSREPLY pResult = {0}; PHeadSubSetB((LPBYTE)&pResult,0xF8,0x02,sizeof(PMSG_GENSREPLY)); LPOBJ lpObj = &gObj[aIndex]; int Family = 0; if(lpObj->m_IfState.type >= 100 && lpObj->m_IfState.type <= 101) { Family = lpObj->m_IfState.type - 99; }else { //error return; } if (lpObj->PlayerExtraInfoReceived != 1) { GCServerMsgStringSend ("ERROR: Please relogin!",lpObj->m_Index,0x01 ) ; LogAddC(2, "ERROR: GENS Info [%s][%s] Line: %d", lpObj->AccountID, lpObj->Name, __LINE__); return; } if(lpObj->GensFam != 0) { //U r already in a family pResult.state = 1; goto DSEND; } if(lpObj->GensNotAllow == 1 && this->AllowJoinIfLeftLessThan3Days == 0) { //You can not join coz need to pass 3 days before join again pResult.state = 2; goto DSEND; } if(lpObj->Level < this->MinLevel) { //Need X Level to Join in Gens pResult.state = 3; goto DSEND; } if(lpObj->Resets < this->MinReset) { //Need X Level to Join in Gens char sbuf[100]={0}; wsprintf(sbuf,"You need %d Resets before join Gens",this->MinReset); GCServerMsgStringSend(sbuf,lpObj->m_Index, 0x01); pResult.state = 3; goto DSEND; } if(lpObj->PartyNumber >= 0 && this->AllowJoinInParty == 0) { //Cant Join if you are in Party pResult.state = 6; goto DSEND; } if(lpObj->GuildNumber > 0) { //DWORD dwGuildNumber = lpObj->GuildNumber; //_GUILD_INFO_STRUCT * lpGuildInfo = Guild.SearchGuild_Number(dwGuildNumber); if(lpObj->lpGuild != NULL) { if(lpObj->lpGuild->GensFam != Family && lpObj->lpGuild->GensFam != 0 && this->AllowJoinIfGuildMemberIsInOtherGens == 0) { //Your GM is in other family pResult.state = 4; goto DSEND; }else if(lpObj->lpGuild->GensFam == 0 && ( strcmp(lpObj->Name, lpObj->lpGuild->Names[0] ) ) && this->AllowJoinInGuild == 0) { //Your GM must be in gens before join you pResult.state = 5; goto DSEND; }else { TUnionInfo * pUnionInfo = UnionManager.SearchUnion(lpObj->lpGuild->iGuildUnion); if ( pUnionInfo && this->AllowJoinInGuildAlliance == 0) { //Cant join if you are in guild alliance pResult.state = 7; goto DSEND; }else { if(this->AllowJoinIfGuildMemberIsInOtherGens == 0) { for ( int n=0;n<MAX_USER_GUILD;n++) { if ( lpObj->lpGuild->Use[n] == TRUE ) { int gpIndex = gObjGetIndex(lpObj->lpGuild->Names[n]); if ( gpIndex != -1 ) { if(gObj[gpIndex].GensFam != Family && gObj[gpIndex].GensFam != 0) { //Your guild is part of a different gens pResult.state = 4; goto DSEND; } } } } } } } } } //All Ok Join in GENS Family pResult.state = 0; lpObj->GensFam = Family; lpObj->GensCont = 0; lpObj->RecvRewItem = 0; lpObj->GensLevel = 14; gObj[aIndex].PlayerExtraInfoModified = 1; gObjViewportListProtocolCreate(&gObj[aIndex]); LogAddTD("[GensPvP] [%s][%s] Join Gens Family", lpObj->AccountID, lpObj->Name); if(lpObj->GuildNumber > 0) { if(lpObj->lpGuild != NULL) { if ( strcmp(lpObj->lpGuild->Names[0], lpObj->Name) == 0) // Case Guild Master { lpObj->lpGuild->GensFam = Family; if(this->JoinGuildIntoGensWhenYouAreGM == 1) { for ( int n=0;n<MAX_USER_GUILD;n++) { if ( lpObj->lpGuild->Use[n] == TRUE ) { int gpIndex = gObjGetIndex(lpObj->lpGuild->Names[n]); if ( gpIndex != -1 && gpIndex != aIndex ) { if(gObj[gpIndex].GensFam == 0) { if (gObj[gpIndex].PlayerExtraInfoReceived != 1) { GCServerMsgStringSend ("ERROR: Please relogin!",gpIndex,0x01 ) ; LogAddC(2, "ERROR: GENS Info [%s][%s] Line: %d", lpObj->AccountID, lpObj->Name, __LINE__); continue; } gObj[gpIndex].PlayerExtraInfoModified = 1; gObj[gpIndex].RecvRewItem = 0; gObj[gpIndex].GensFam = Family; gObj[gpIndex].GensCont = 0; gObj[gpIndex].GensLevel = 14; this->Ranking(gpIndex); gObjViewportListProtocolCreate(&gObj[gpIndex]); LogAddTD("[GensPvP] [%s][%s] Leave Gens Family", gObj[gpIndex].AccountID, gObj[gpIndex].Name); } } } } } } } } DataSend(aIndex,(UCHAR *)&pResult, pResult.h.size); this->Ranking(aIndex); return; DSEND: DataSend(aIndex,(UCHAR *)&pResult, pResult.h.size); }
BOOL CIllusionTempleEvent::EnterIllusionTemple(int aIndex, BYTE btTempleIndex, BYTE btItemPos) { if( !g_bIllusionTempleEvent ) { return FALSE; } // ---- if(!CHECK_LIMIT(btTempleIndex, MAX_ILLUSIONTEMPLE_TEMPLE_COUNT)) { return FALSE; } LPOBJECTSTRUCT lpObj = (LPOBJECTSTRUCT)&gObj[aIndex]; PMSG_RESULT_ENTER_ILLUSION_TEMPLE pResult; PHeadSubSetB((LPBYTE)&pResult, 0xBF, 0x00, sizeof(pResult)); pResult.Result = 0; if( lpObj->Type != OBJ_USER || lpObj->Connected <= 2 ) { return FALSE; } if( lpObj->m_IfState.use && lpObj->m_IfState.type != 12 ) { return FALSE; } if( lpObj->m_bPShopOpen == true ) { CGPShopReqClose(lpObj->m_Index); } BOOL PKFlag = FALSE; if(lpObj->PartyNumber >= 0) { if( (gParty.GetPKPartyPenalty(lpObj->PartyNumber)) >= 5) { PKFlag = TRUE; } } else if( lpObj->m_PK_Level >= 4 ) { PKFlag = TRUE; } if( PKFlag == TRUE ) { pResult.Result = 7; DataSend(aIndex,(LPBYTE)&pResult,pResult.h.size); return FALSE; } if( CheckWearingMOPH(aIndex) ) { pResult.Result = 8; DataSend(aIndex,(LPBYTE)&pResult,pResult.h.size); return FALSE; } if( m_cIllusionTempleProc[btTempleIndex].GetIllusionTempleState() != 0 || !m_cIllusionTempleProc[btTempleIndex].GetEntrance() ) { pResult.Result = 2; DataSend(aIndex,(LPBYTE)&pResult,pResult.h.size); return FALSE; } int iITEM_LEVEL; DWORD dwITEM_SERIAL; if(gObj[aIndex].pInventory[btItemPos].IsItem() == TRUE) { if(gObj[aIndex].pInventory[btItemPos].m_Type == (ITEM_HELPER+51)) { iITEM_LEVEL = gObj[aIndex].pInventory[btItemPos].m_Level; dwITEM_SERIAL = gObj[aIndex].pInventory[btItemPos].m_Number; if( !CHECK_LIMIT( iITEM_LEVEL-1, MAX_ILLUSIONTEMPLE_TEMPLE_COUNT ) && gObj[aIndex].pInventory[btItemPos].m_Durability != 1.0f) { pResult.Result = 1; DataSend(aIndex,(LPBYTE)&pResult,pResult.h.size); return FALSE; } } else if(gObj[aIndex].pInventory[btItemPos].m_Type == (ITEM_HELPER+61)) { dwITEM_SERIAL = gObj[aIndex].pInventory[btItemPos].m_Number; iITEM_LEVEL = CheckCanEnterLevel(aIndex); if(iITEM_LEVEL <= 0) { pResult.Result = 1; DataSend(aIndex,(LPBYTE)&pResult,pResult.h.size); return FALSE; } } else { pResult.Result = 1; DataSend(aIndex,(LPBYTE)&pResult,pResult.h.size); return FALSE; } } else { pResult.Result = 1; DataSend(aIndex,(LPBYTE)&pResult,pResult.h.size); return FALSE; } #pragma message("#### Enable me after time ####") //if( GEReqIllusionTempleEnterCountCheck(aIndex, btTempleIndex, btItemPos, iITEM_LEVEL) ) //{ // LogAddC(2, "[DEBUG] [IT] Enter R12"); // return TRUE; //} if( !CheckEnterLevel(aIndex, iITEM_LEVEL) ) { pResult.Result = 3; DataSend(aIndex,(LPBYTE)&pResult,pResult.h.size); return FALSE; } m_cIllusionTempleProc[iITEM_LEVEL-1].CheckUsersOnConnect(); BOOL bRet = m_cIllusionTempleProc[iITEM_LEVEL-1].EnterUserIllusionTemple(aIndex, btTempleIndex, btItemPos); if(bRet == TRUE) { if(lpObj->PartyNumber >= 0) { PMSG_PARTYDELUSER pMsg; int pindex = gParty.GetIndex(lpObj->PartyNumber, lpObj->m_Index, lpObj->DBNumber); if(pindex >= 0) { pMsg.Number = pindex; CGPartyDelUser(&pMsg, lpObj->m_Index); } } if( lpObj->pInventory[btItemPos].m_Type == (ITEM_HELPER+51) ) { lpObj->pInventory[btItemPos].m_Durability = 0; GCItemDurSend(lpObj->m_Index, btItemPos, lpObj->pInventory[btItemPos].m_Durability, 0); } else if(lpObj->pInventory[btItemPos].m_Type == (ITEM_HELPER+61) && lpObj->pInventory[btItemPos].m_Durability > 0.0f) { lpObj->pInventory[btItemPos].m_Durability -= 1.0f; GCItemDurSend(lpObj->m_Index, btItemPos, lpObj->pInventory[btItemPos].m_Durability, 0); } #ifdef OPT LogAddTD("[Illusion Temple] (%d) EnterUser: (%s)(%s) class:%d (Serial:%u). PCRoom:%d", iITEM_LEVEL, lpObj->AccountID, lpObj->Name, lpObj->DbClass, lpObj->pInventory[btItemPos].m_Number, lpObj->m_iPcBangRoom); #else LogAddTD("[Illusion Temple] (%d) EnterUser: (%s)(%s) class:%d (Serial:%u)", iITEM_LEVEL, lpObj->AccountID, lpObj->Name, lpObj->DbClass, lpObj->pInventory[btItemPos].m_Number); #endif DataSend(aIndex,(LPBYTE)&pResult,pResult.h.size); gObjMoveGate(lpObj->m_Index, iITEM_LEVEL+141); } m_cIllusionTempleProc[btTempleIndex].SendIllusionTempleState(0, lpObj->m_Index); SendIllusionTempleUserCount(); #if(TESTSERVER==1) GCServerMsgStringSend("CIllusionTempleEvent::EnterIllusionTemple", lpObj->m_Index, 0); #endif return FALSE; }
void CDoppelganger::SendTrianglesPosition(int aIndex){ if(this->State != RUNNING || gObj[aIndex].MapNumber != this->EventMap || !gObjIsConnected(aIndex) || aIndex < OBJ_STARTUSERINDEX) return; //Double Goer Set Line Position PMSG_DGOER_TRIANG_POS LinePosition = { 0xC1, sizeof(LinePosition), 0xBF, 0x0F }; LinePosition.Pos = this->GetPosition(aIndex); //Update Bar(Triangles) PMSG_DGOER_UPDATE_BAR Position; Position.C = 0xC1; Position.Size = sizeof(Position); Position.Headcode = 0xBF; Position.Subcode = 0x12; Position.Timer = this->Timer; Position.Players = this->PlayersCount; //Set Triangles Position... memset(Position.Player,0,sizeof(Position.Player)); Position.Player[0].Index = aIndex; Position.Player[0].Visible = 0; Position.Player[0].Distance = this->GetPosition(aIndex); int Count = 1; for(int i=0; i < 5;i++){ if(this->Player[i] != -1 && gObj[this->Player[i]].MapNumber == this->EventMap && this->Player[i] != aIndex){ Position.Player[Count].Index = this->Player[i]; Position.Player[Count].Visible = 0; Position.Player[Count].Distance = this->GetPosition(this->Player[i]); Count++; } } //Double Goer Set Line Position PMSG_DGOER_RTRIANG_POS IceWalker = { 0xC1, sizeof(IceWalker), 0xBF, 0x11, 0x01, 0xFF }; if(Doppelganger.MonsterBoss[2] > 0){ IceWalker.Unk = 0; IceWalker.Pos = this->GetPosition(this->MonsterBoss[2]); } //Set Monster Kill Count PMSG_DGOER_MONSTER_COUNT KillCount; PHeadSubSetB((LPBYTE)&KillCount, 0xBF, 0x14, sizeof(KillCount)); KillCount.Total = 3; //Finish Event if +3 Monster Pass if(this->MonsterPassed >= 3){ this->Status = FAILED; //Failed this->State = FINISHED; this->MonsterPassed = 3; LogAddTD("[Doppelganger] 3 Monsters Passed the Magic Circles - EVENT FINISH FAILED"); } KillCount.Killed = this->MonsterPassed; DataSend(aIndex,(LPBYTE)&IceWalker,IceWalker.Size); //Send Triangles DataSend(aIndex,(LPBYTE)&LinePosition,LinePosition.Size); //Send Line DataSend(aIndex,(LPBYTE)&Position,Position.Size); //Send Position DataSend(aIndex,(LPBYTE)&KillCount,KillCount.h.size); //Send Kill Count }