Logo
live-news-icon

Noticias

Tema: Command Set PK Level para MuEMU

Applayo

  • *
Command Set PK Level para MuEMU | en: Abril 22, 2021, 12:25:07 am »

CommandManager.h
Dentro de enum eCommandNumber

Código: [Seleccionar]
COMMAND_PKSETLVL = 110,

Dentro de class CCommandManager

Código: [Seleccionar]
bool CCommandManager::CommandSetPKLevel(LPOBJ lpObj,char* arg, int Npc);

CommandManager.cpp

Código: [Seleccionar]
        case COMMAND_PKSETLVL:
            Result = CommandSetPKLevel(lpObj,argument,Npc);
            break;

Código: [Seleccionar]
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

   
Código: [Seleccionar]
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
« Última modificación: Abril 22, 2021, 01:10:31 am por Applayo »

robins1998

  • *
Re: Command Set PK Level para MuEMU | Respuesta #1 en: Mayo 27, 2021, 02:29:14 am »

Very helpful, thanks for sharing.


Responder Marcar No Leido Enviar Topic Print