TUServerMU

MuOnline => Sources Generales => Tema comenzado por: KrizR on September 30, 2017, 09:19:30 AM

Titulo: Código Borrar inventario MuEmu
Posteado por: KrizR on September 30, 2017, 09:19:30 AM
(http://i.imgur.com/Z9MYwwl.png)
Titulo: Re: Código Borrar inventario MuEmu
Posteado por: sombe30 on September 30, 2017, 11:17:28 AM
se agrega en el cCommand.cpp   y donde mas amigo
Titulo: Re: Código Borrar inventario MuEmu
Posteado por: seedmaker on October 17, 2017, 01:02:11 AM
How to Fix this ? Error   1   error C2039: 'CommandClearInventory' : is not a member of 'CCommandManager'   D:\My MU Files\Server Files\[ Extra ] Source Files\Package [SOURCE] MuEmu\Package [SOURCE] MuEmu\eMU\GameServer\GameServer\CommandManager.cpp   1396   1   GameServer
Error   2   error C2039: 'm_CommandClearINVSwitch' : is not a member of 'CServerInfo'   D:\My MU Files\Server Files\[ Extra ] Source Files\Package [SOURCE] MuEmu\Package [SOURCE] MuEmu\eMU\GameServer\GameServer\CommandManager.cpp   1398   1   GameServer
Error   3   error C2039: 'm_CommandClearINVEnable' : is not a member of 'CServerInfo'   D:\My MU Files\Server Files\[ Extra ] Source Files\Package [SOURCE] MuEmu\Package [SOURCE] MuEmu\eMU\GameServer\GameServer\CommandManager.cpp   1403   1   GameServer
Error   4   error C2039: 'm_CommandClearINVMoney' : is not a member of 'CServerInfo'   D:\My MU Files\Server Files\[ Extra ] Source Files\Package [SOURCE] MuEmu\Package [SOURCE] MuEmu\eMU\GameServer\GameServer\CommandManager.cpp   1409   1   GameServer
Error   5   error C2039: 'm_CommandClearINVMoney' : is not a member of 'CServerInfo'   D:\My MU Files\Server Files\[ Extra ] Source Files\Package [SOURCE] MuEmu\Package [SOURCE] MuEmu\eMU\GameServer\GameServer\CommandManager.cpp   1415   1   GameServer
   6   IntelliSense: class "CCommandManager" has no member "CommandClearInventory"   d:\my mu files\server files\[ extra ] source files\package [source] muemu\package [source] muemu\emu\gameserver\gameserver\commandmanager.cpp   1396   23   GameServer
   7   IntelliSense: class "CServerInfo" has no member "m_CommandClearINVSwitch"   d:\my mu files\server files\[ extra ] source files\package [source] muemu\package [source] muemu\emu\gameserver\gameserver\commandmanager.cpp   1398   19   GameServer
   8   IntelliSense: class "CServerInfo" has no member "m_CommandClearINVEnable"   d:\my mu files\server files\[ extra ] source files\package [source] muemu\package [source] muemu\emu\gameserver\gameserver\commandmanager.cpp   1403   19   GameServer
   9   IntelliSense: class "CServerInfo" has no member "m_CommandClearINVMoney"   d:\my mu files\server files\[ extra ] source files\package [source] muemu\package [source] muemu\emu\gameserver\gameserver\commandmanager.cpp   1409   42   GameServer
   10   IntelliSense: class "CServerInfo" has no member "m_CommandClearINVMoney"   d:\my mu files\server files\[ extra ] source files\package [source] muemu\package [source] muemu\emu\gameserver\gameserver\commandmanager.cpp   1415   32   GameServer
Titulo: Re: Código Borrar inventario MuEmu
Posteado por: Lude on October 18, 2017, 07:47:50 PM
Me gustaría aclarar que el código esta incompleto ya que solo está aportando el CommandManager.cpp, falta su respectiva declaración en h, también falta el ServerInfo.cpp y h, también falta agregarlo al Message.txt y al GameServer-Commands.dat
Titulo: Re: Código Borrar inventario MuEmu
Posteado por: DeilanSasame on January 05, 2018, 10:17:07 PM
Codigo Full:

+ = Agregar Linea
- = Eliminar Linea

CommandManager.h
Code: [Select]
-#define MAX_COMMAND 31
+#define MAX_COMMAND 32


COMMAND_CUSTOM_ATTACK_OFFLINE = 31,
+ COMMAND_CLEAR_INV = 32,

commandmanager.cpp
Code: [Select]
	this->Add(gCustomAttack.m_CustomAttackOfflineCommandSyntax,COMMAND_CUSTOM_ATTACK_OFFLINE);
+ this->Add(gMessage.GetMessage(59),COMMAND_CLEAR_INV);

case COMMAND_CUSTOM_ATTACK_OFFLINE:
gCustomAttack.CommandCustomAttackOffline(lpObj,argument);
break;
+ case COMMAND_CLEAR_INV:
+ this->CommandClearInv(lpObj,argument);
+ break;
default:
return 0;


Al Final Agregar lo Siguiente:

Code: [Select]
void CCommandManager::CommandClearInv(LPOBJ lpObj,char* arg) // OK
{

if(gServerInfo.m_CommandClearInvSwitch == 0)
{
return;
}

if(lpObj->Money < ((DWORD)gServerInfo.m_CommandClearInvZen[lpObj->AccountLevel]))
   {
      gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,gMessage.GetMessage(492),gServerInfo.m_CommandClearInvZen[lpObj->AccountLevel]);
      return;
   }

   lpObj->Money -= gServerInfo.m_CommandClearInvZen[lpObj->AccountLevel];

   GCMoneySend(lpObj->Index,lpObj->Money);

   int MaxValue = gItemManager.GetInventoryMaxValue(lpObj);

    for (int i = INVENTORY_WEAR_SIZE; i < MaxValue; i++)
   {
      gItemManager.InventoryDelItem(lpObj->Index,i);
      gItemManager.GCItemDeleteSend(lpObj->Index,i,1);
   }

   gNotice.GCNoticeSend(lpObj->Index,1,0,0,0,0,0,gMessage.GetMessage(493));

   gLog.Output(LOG_COMMAND,"[Command Clear Iventory] Use for:[%s][%s]",lpObj->Account,lpObj->Name);

}

serverinfo.h

Code: [Select]
	int m_CommandHideGameMasterLevel;
+ int m_CommandClearInvSwitch;
+ int m_CommandClearInvZen[MAX_ACCOUNT_LEVEL];

ServerInfo.cpp
Code: [Select]
this->m_CommandHideGameMasterLevel = GetPrivateProfileInt(section,"CommandHideGameMasterLevel",0,path);

+ this->m_CommandClearInvSwitch = GetPrivateProfileInt(section,"CommandClearInvSwitch",0,path);

+ this->m_CommandClearInvZen[0] = GetPrivateProfileInt(section,"CommandClearInvMoney_AL0",0,path);
+ this->m_CommandClearInvZen[1] = GetPrivateProfileInt(section,"CommandClearInvMoney_AL1",0,path);
+ this->m_CommandClearInvZen[2] = GetPrivateProfileInt(section,"CommandClearInvMoney_AL2",0,path);
+ this->m_CommandClearInvZen[3] = GetPrivateProfileInt(section,"CommandClearInvMoney_AL3",0,path);
+ this->m_CommandClearInvZen[4] = GetPrivateProfileInt(section,"CommandClearInvMoney_AL4",0,path);
}

Messager.txt
Code: [Select]
57        "/re"
58        "/hide"
+ 59        "/clearinv"

491       "%s won %d Jewel of Bless"
+ 492       "You must have at least %d Zen to use this command"
+ 493       "Inventory Cleaned Successfully"
end

GameServerInfo - Command.dat
Code: [Select]
;==================================================
; Hide Command Settings
;==================================================
CommandHideSwitch = 1
CommandHideGameMasterLevel = 0

+ ;==================================================
+ ; Inv Clear Command Settings
+ ;==================================================
+ CommandClearInvSwitch = 1
+ CommandClearInvMoney_AL0 = 1000000
+ CommandClearInvMoney_AL1 = 1000000
+ CommandClearInvMoney_AL2 = 1000000
+ CommandClearInvMoney_AL3 = 1000000
+ CommandClearInvMoney_AL4 = 1000000

Titulo: Re: Código Borrar inventario MuEmu
Posteado por: inax123 on January 19, 2018, 07:54:52 PM
.......


Solamente te falto agregar en CommandManager.h
Code: [Select]
void CommandResetAutoProc(LPOBJ lpObj);
+void CommandClearInv(LPOBJ lpObj,char* arg);