The Voice Of God
Mylictruan
- Joined
- Sep 25, 2004
- Messages
- 281
- Reaction score
- 0
Code:
/////////////////////////////////////
// Module made with D2MoMa - By SF
/////////////////////////////////////
// Incudes the D2HackIt Source
#include "Source\ClientCore.cpp"
// Sets up the commands (only supports 4 commands so far)
BOOL PRIVATE OnGameCommandSet(char** argv, int argc);
/////////////////////////////////////
// Clientinfo change things if you want
CLIENTINFO
(
0,1,
"StarFish",
"www.battleforums.com",
"Test Module",
"myemail@meh.com"
)
// This defines the packet 'pack'
BYTE pack[5] = {0x3d, 0x00, 0x00, 0x00, 0x00};
// This will copy/paste bytes if something happens
DWORD EXPORT OnGamePacketBeforeReceived(BYTE* aPacket, DWORD aLen)
{
if ( aPacket[0] == 0x19)
{
// The next line is the function called 'memcpy'
memcpy(pack+1,aPacket+1,4);
server->GamePrintInfo("ÿc8Item ID logged!");
}
return aLen;
}
/////////////////////////////////
// Commnads used in module
/////////////////////////////////
MODULECOMMANDSTRUCT ModuleCommands[]=
{
{
// The help command
"help",
OnGameCommandHelp,
"Displays help textÿc0"
},
{
// Custom command
"start",
OnGameCommandSet,
"Starts Moduleÿc0"
},
////////// End of command list /////
{NULL}
};
BOOL PRIVATE OnGameCommandSet(char** argv, int argc)
{
// *** Add actions here, then close tag ***
// This will drop the item whos ID was memcpy'ed
server->GameSendPacketToServer(pack,5);
////////// End of command //////////
return TRUE;
}
is there something out of order?