BOOL TMonsterAIElement::ApplyElementNightmareWarp(int iIndex, int iTargetIndex, TMonsterAIState * pAIState) { LPOBJ lpObj = &gObj[iIndex]; BYTE x = this->m_iX; BYTE y = this->m_iY; PMSG_MAGICATTACK_RESULT pAttack; PHeadSetBE((unsigned char *)&pAttack,0x19,sizeof(pAttack)); pAttack.MagicNumberH = SET_NUMBERH(AT_SKILL_TELEPORT); pAttack.MagicNumberL = SET_NUMBERL(AT_SKILL_TELEPORT); pAttack.SourceNumberH = SET_NUMBERH(iIndex); pAttack.SourceNumberL = SET_NUMBERL(iIndex); pAttack.TargetNumberH = SET_NUMBERH(iIndex); pAttack.TargetNumberL = SET_NUMBERL(iIndex); if ( lpObj->Type == OBJ_USER ) DataSend(iIndex,(unsigned char *)&pAttack,pAttack.h.size); MsgSendV2(lpObj,(unsigned char*)&pAttack,pAttack.h.size); LogAddC(2, "[%s] Warp [%d,%d] -> [%d,%d]", lpObj->Name, lpObj->X, lpObj->Y, x, y); gObjTeleportMagicUse(iIndex,x,y); lpObj->TargetNumber = -1; return FALSE; }
void CIllusionTempleEvent::SendInfo() { if( m_TempleData[1].GetState() == IT_STATE_CLOSED && m_TempleData[1].OpenState() == TRUE ) { PMSG_ITSEND_ENTER_INFO pMsg; PHeadSubSetB((LPBYTE)&pMsg,0xBF,3,sizeof(pMsg)); pMsg.UserCnt[0] = m_TempleData[0].GetUserCount(); pMsg.UserCnt[1] = m_TempleData[1].GetUserCount(); pMsg.UserCnt[2] = m_TempleData[2].GetUserCount(); pMsg.UserCnt[3] = m_TempleData[3].GetUserCount(); pMsg.UserCnt[4] = m_TempleData[4].GetUserCount(); if( g_bMaxLevelIllusion != 0 ) { pMsg.UserCnt[5] = m_TempleData[5].GetUserCount(); } else { pMsg.UserCnt[5] = 0; } MsgSendV2(&gObj[this->iEnterNpc],(LPBYTE)&pMsg,pMsg.h.size); } }
BOOL TMonsterSkillElement::ApplyElementTeleportSkill(int iIndex, int iTargetIndex) { if ( !OBJMAX_RANGE(iIndex)) return FALSE; if ( gObjCheckUsedBuffEffect(&gObj[iIndex],BUFF_STUN) == TRUE ) return FALSE; if ( gObjCheckUsedBuffEffect(&gObj[iIndex],BUFF_SLEEP) == TRUE ) return FALSE; if ( gObjCheckUsedBuffEffect(&gObj[iIndex],BUFF_EARTHBINDS) == TRUE ) return FALSE; LPOBJ lpObj = &gObj[iIndex]; BYTE x; BYTE y; int depth = rand()%4 + 3; PMSG_MAGICATTACK_RESULT pAttack; if ( (rand()%2) == 0 ) x = lpObj->X + depth; else x = lpObj->X - depth; if ( (rand()%2) == 0 ) y = lpObj->Y + depth; else y = lpObj->Y - depth; if ( gObjCheckTeleportArea(iIndex, x, y) == FALSE ) { LogAddC(2, "[%s] Try Teleport Not Move Area [%d,%d]", lpObj->Name, x, y); return FALSE; } PHeadSetBE((LPBYTE)&pAttack, 0x19, sizeof(pAttack)); pAttack.MagicNumberH = SET_NUMBERH(AT_SKILL_TELEPORT); pAttack.MagicNumberL = SET_NUMBERL(AT_SKILL_TELEPORT); pAttack.SourceNumberH = SET_NUMBERH(iIndex); pAttack.SourceNumberL = SET_NUMBERL(iIndex); pAttack.TargetNumberH = SET_NUMBERH(iIndex); pAttack.TargetNumberL = SET_NUMBERL(iIndex); if ( lpObj->Type == OBJ_USER ) DataSend(iIndex, (LPBYTE)&pAttack, pAttack.h.size); MsgSendV2(lpObj, (LPBYTE)&pAttack, pAttack.h.size); LogAddC(2, "[%s] Warp [%d,%d] -> [%d,%d]", lpObj->Name, lpObj->X, lpObj->Y, x, y); gObjTeleportMagicUse(iIndex, x, y); lpObj->TargetNumber = -1; return FALSE; }
// ---------------------------------------------------------------------------------------------------------------- //## Процесс убиства игрока 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); } }
BOOL TMonsterAIElement::ApplyElementNightmareWarp(int iIndex, int iTargetIndex, TMonsterAIState * pAIState) { LPOBJ lpObj = &gObj[iIndex]; BYTE x = this->m_iX; BYTE y = this->m_iY; PMSG_MAGICATTACK_RESULT pAttack(6,iIndex,iIndex); if ( lpObj->Type == OBJ_USER ) DataSend(iIndex,(unsigned char *)&pAttack,pAttack.h.size); MsgSendV2(lpObj,(unsigned char*)&pAttack,pAttack.h.size); LogAddC(2, "[%s] Warp [%d,%d] -> [%d,%d]", lpObj->Name, lpObj->X, lpObj->Y, x, y); gObjTeleportMagicUse(iIndex,x,y); lpObj->TargetNumber = -1; return FALSE; }
void CIllusionTempleEvent::SendIllusionTempleUserCount() { PMSG_ILLUSION_TEMPLE_USER_COUNT pMsg; // [sp+4Ch] [bp-10h]@3 if ( !this->m_cIllusionTempleProc[1].GetIllusionTempleState() && this->m_cIllusionTempleProc[1].GetEntrance() == 1 ) { PHeadSubSetB(&pMsg.h.c, -65, 3, 10); pMsg.btUserCount[0] = this->m_cIllusionTempleProc[0].GetUserCount(); pMsg.btUserCount[1] = this->m_cIllusionTempleProc[1].GetUserCount(); pMsg.btUserCount[2] = this->m_cIllusionTempleProc[2].GetUserCount(); pMsg.btUserCount[3] = this->m_cIllusionTempleProc[3].GetUserCount(); pMsg.btUserCount[4] = this->m_cIllusionTempleProc[4].GetUserCount(); if ( g_bUseMaxLevelIllusionTemple ) pMsg.btUserCount[5] = 0; else pMsg.btUserCount[5] = this->m_cIllusionTempleProc[5].GetUserCount(); MsgSendV2(&gObj[this->m_nMirageIndex],(LPBYTE)&pMsg,pMsg.h.size); } }
void CDarkSpirit::SendAttackMsg(int aIndex, int aTargetIndex, int criticaldamage, int iActionType) { PMSG_PET_ITEM_ATTACK_COMMAND pMsg; if ( criticaldamage != 3 ) { pMsg.PetType = 0; pMsg.SkillType = (criticaldamage)? 0 : 1; pMsg.NumberH = SET_NUMBERH(aIndex); pMsg.NumberL = SET_NUMBERL(aIndex); pMsg.TargetNumberH = SET_NUMBERH(aTargetIndex); pMsg.TargetNumberL = SET_NUMBERL(aTargetIndex); pMsg.h.set((LPBYTE)&pMsg, 0xA8, sizeof(pMsg)); DataSend(aIndex, (UCHAR*)&pMsg, pMsg.h.size); MsgSendV2(&gObj[aIndex], (UCHAR*)&pMsg, pMsg.h.size); if ( iActionType == 1 ) { criticaldamage = 0; LPOBJ lpObj = &gObj[aIndex]; if ( (rand()%100) < (this->m_iCriticalSuccessRate+lpObj->m_MPSkillOpt.MpsDarkSpiritStr2) ) { criticaldamage = 1; } if( (rand()%100) < (this->m_iExcelentSuccessRate+lpObj->m_MPSkillOpt.MpsDarkSpiritStr3) ) { criticaldamage = 2; } } } else { criticaldamage = 0; } gObjAddAttackProcMsgSendDelay(&gObj[aIndex], 51, aTargetIndex, 600, criticaldamage, iActionType); }
//006bbab0 bool CPeriodItemEx::RemovePeriodItemData(LPOBJ lpObj, BYTE btItemType, WORD wItemCode, unsigned long dwSerial) //OK { if( !lpObj ) return false; if( lpObj->Type != OBJ_USER || lpObj->Connected < 2 ) return false; if( btItemType == 1 ) { BUFF_EFFECT_DATE* lpBuffData = 0; lpBuffData = g_BuffEffectSlot.GetEffectDataFromItemCode(wItemCode); if( !lpBuffData ) return false; gObjRemoveBuffEffect(lpObj,lpBuffData->btIndex); } else if( btItemType == 2 ) { if( dwSerial == 0 ) return false; int iInventoryPosition = 0; iInventoryPosition = this->GetItemFromInventory(lpObj,wItemCode,dwSerial); if( iInventoryPosition == -1 ) return false; SetDisableItemToExpire(lpObj,iInventoryPosition); //auto-deleting gObjInventoryDeleteItem(lpObj->m_Index, iInventoryPosition); GCInventoryItemDeleteSend(lpObj->m_Index, iInventoryPosition, 1); gObjCalCharacter(lpObj->m_Index); // ---- if( iInventoryPosition < 12 ) { if( iInventoryPosition == 10 || iInventoryPosition == 11 ) { gObjUseSkill.SkillChangeUse(lpObj->m_Index); } // ---- gObjMakePreviewCharSet(lpObj->m_Index); PMSG_USEREQUIPMENTCHANGED pChange; PHeadSetB((LPBYTE)&pChange, 0x25, sizeof(pChange)); pChange.NumberH = SET_NUMBERH(lpObj->m_Index); pChange.NumberL = SET_NUMBERL(lpObj->m_Index); ItemByteConvert(pChange.ItemInfo, lpObj->pInventory[iInventoryPosition]); pChange.ItemInfo[1] = iInventoryPosition << 4; pChange.ItemInfo[1] |= LevelSmallConvert(lpObj->m_Index, iInventoryPosition) & 0x0F; DataSend(lpObj->m_Index, (LPBYTE)&pChange, pChange.h.size); MsgSendV2(lpObj, (LPBYTE)&pChange, pChange.h.size); } } else { return false; } ITEMDATA ItemData; ItemData.btType = btItemType; ItemData.wItemCode = wItemCode; ItemData.dwSerial = dwSerial; RequestPeriodItemDelete(lpObj,&ItemData); return true; }
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]; 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; }
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; }