CommandManager.h
Dentro de enum eCommandNumber
COMMAND_PKSETLVL = 110,
Dentro de class CCommandManager
bool CCommandManager::CommandSetPKLevel(LPOBJ lpObj,char* arg, int Npc);
CommandManager.cpp
case COMMAND_PKSETLVL:
Result = CommandSetPKLevel(lpObj,argument,Npc);
break;
bool CCommandManager::CommandSetPKLevel(LPOBJ lpObj,char* arg, int Npc)
{
char name[11] = {0};
this->GetString(arg,name,sizeof(name),0);
LPOBJ lpTarget = gObjFind(name);
if(lpTarget == 0)
{
gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,"O Personagem não existe ou não está online.");
return 0;
}
int pk = this->GetNumber(arg,1);
if(pk >= 7)
{
gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,"O Valor que você entrou é inválido.");
return 0;
}
lpTarget->PKLevel = pk;
GCPKLevelSend(lpTarget->Index,lpTarget->PKLevel);
if (Npc <= -1)
{
GCChatTargetNewSend(lpTarget,Npc,gMessage.GetMessage(536));
}
gLog.Output(LOG_COMMAND,"[CommandSetPKLevel][%s][%s] - (PKLevel: %d)",lpTarget->Account,lpTarget->Name,lpTarget->PKLevel);
return 1;
}
Command.txt
109 "/setlvlpk" 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 //setlvl <player> <nivel> - Editar nivel PK