boris160
19/07/2017, 09:33 PM
Comando básico e bem interessante,feito como base do /make :ott1
CommandManager.h
COMMAND_DROP = 34,
//==============
void CommandDrop(LPOBJ lpObj,char* arg);
ServerInfo.h
int m_CommandDropSwitch;
int m_CommandDropGameMasterLevel;
CommandManager.cpp
this->Add(gMessage.GetMessage(517),COMMAND_DROP);
//==================================
break;
case COMMAND_DROP:
this->CommandDrop(lpObj,argument);
//===================================
void CCommandManager::CommandDrop(LPOBJ lpObj,char* arg) // OK
{
if(gServerInfo.m_CommandDropSwitch == 0)
{
return;
}
if(gGameMaster.CheckGameMasterLevel(lpObj,gServerI nfo.m_CommandDropGameMasterLevel) == 0)
{
gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,gMessage.GetMessage(518));
return;
}
int section = this->GetNumber(arg,0);
int type = this->GetNumber(arg,1);
int level = this->GetNumber(arg,2);
int skill = this->GetNumber(arg,3);
int luck = this->GetNumber(arg,4);
int option = this->GetNumber(arg,5);
int exc = this->GetNumber(arg,6);
int set = this->GetNumber(arg,7);
GDCreateItemSend(lpObj->Index,lpObj->Map,(BYTE)lpObj->TX+1,(BYTE)lpObj->TY+1,(section,type),level,0,skill,luck,option,-1,exc,set,0,0,0,0xFF,0);
gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,gMessage.GetMessage(519));
gLog.Output(LOG_COMMAND,"[CommandDrop][%s][%s] - (Section: %d, Type: %d, Level: %d, Skill: %d, Luck: %d, Option: %d, Exc: %d, Set: %d)",lpObj->Account,lpObj->Name,section,type,level,skill,luck,option,exc,set) ;
}
ServerInfo.cpp
this->m_CommandDropSwitch = GetPrivateProfileInt(section,"CommandDropSwitch",0,path);
this->m_CommandDropGameMasterLevel = GetPrivateProfileInt(section,"CommandDropGameMasterLevel",0,path);
Adicione as linhas no Message.txt
517 "/drop"
518 "Você não tem permissão para utilizar o /drop"
519 "Você dropou o item com sucesso"
Adicione as linhas no GameServerInfo - Command
CommandDropSwitch = 1
CommandDropGameMasterLevel = 0
Resultado :
[Only registered and activated users can see links]
Crédito : boris160
CommandManager.h
COMMAND_DROP = 34,
//==============
void CommandDrop(LPOBJ lpObj,char* arg);
ServerInfo.h
int m_CommandDropSwitch;
int m_CommandDropGameMasterLevel;
CommandManager.cpp
this->Add(gMessage.GetMessage(517),COMMAND_DROP);
//==================================
break;
case COMMAND_DROP:
this->CommandDrop(lpObj,argument);
//===================================
void CCommandManager::CommandDrop(LPOBJ lpObj,char* arg) // OK
{
if(gServerInfo.m_CommandDropSwitch == 0)
{
return;
}
if(gGameMaster.CheckGameMasterLevel(lpObj,gServerI nfo.m_CommandDropGameMasterLevel) == 0)
{
gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,gMessage.GetMessage(518));
return;
}
int section = this->GetNumber(arg,0);
int type = this->GetNumber(arg,1);
int level = this->GetNumber(arg,2);
int skill = this->GetNumber(arg,3);
int luck = this->GetNumber(arg,4);
int option = this->GetNumber(arg,5);
int exc = this->GetNumber(arg,6);
int set = this->GetNumber(arg,7);
GDCreateItemSend(lpObj->Index,lpObj->Map,(BYTE)lpObj->TX+1,(BYTE)lpObj->TY+1,(section,type),level,0,skill,luck,option,-1,exc,set,0,0,0,0xFF,0);
gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,gMessage.GetMessage(519));
gLog.Output(LOG_COMMAND,"[CommandDrop][%s][%s] - (Section: %d, Type: %d, Level: %d, Skill: %d, Luck: %d, Option: %d, Exc: %d, Set: %d)",lpObj->Account,lpObj->Name,section,type,level,skill,luck,option,exc,set) ;
}
ServerInfo.cpp
this->m_CommandDropSwitch = GetPrivateProfileInt(section,"CommandDropSwitch",0,path);
this->m_CommandDropGameMasterLevel = GetPrivateProfileInt(section,"CommandDropGameMasterLevel",0,path);
Adicione as linhas no Message.txt
517 "/drop"
518 "Você não tem permissão para utilizar o /drop"
519 "Você dropou o item com sucesso"
Adicione as linhas no GameServerInfo - Command
CommandDropSwitch = 1
CommandDropGameMasterLevel = 0
Resultado :
[Only registered and activated users can see links]
Crédito : boris160