//////////////////////////////////////////////////////////////////////
// Meph stone.cpp
// -------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////
#include <ClientCore.cpp> // Include the backend of the module
//////////////////////////////////////////////////////////////////////
// Global stuff.
// -------------------------------------------------------------------
// This is a very convenient place to your function declarations and
// global variables.
//////////////////////////////////////////////////////////////////////
THISGAMESTRUCT* thisgame;
BOOL PRIVATE OnGameCommandSet(char** argv, int argc);
BOOL PRIVATE OnGameCommandgo(char** argv, int argc);
BOOL PRIVATE OnGameCommandstop(char** argv, int argc);
BOOL PRIVATE OnGameCommandclean(char** argv, int argc);
int check=0;
int check2=0;
int check3=0;
int check5=0;
int countnum=0;
int countmax=0;
BYTE getnewstones[9]={0x31,0,0,0,0,0xa7,0x02,0,0};
BYTE dropstoneinhand[5]={0x17,0,0,0,0};
BYTE pickupstonetohand[5]={0x19,0,0,0,0};
/////////////////////////////////////
// Clientinfo change things if you want
CLIENTINFO
(
0,1,
"coolspot31",
"gods-network.com",
"Mephy stone dupe",
"coolspot31@mindspring.com"
)
/////////////////////////////////
// Commnads used in module
/////////////////////////////////
MODULECOMMANDSTRUCT ModuleCommands[]=
{
{
// The help command
"help",
OnGameCommandHelp,
"Displays help textÿc0"
},
{
// Custom command
"set",
OnGameCommandSet,
"Sets moduleÿc0"
},
{
// Custom command
"go",
OnGameCommandgo,
"Makes module go. Format is .msd go <number times>ÿc0"
},
// Custom command
{
"stop",
OnGameCommandstop,
"Emergency stop. ÿc0" //changed with edit to be more descriptive
},
////////// End of command list /////
{NULL}
};
BOOL PRIVATE OnGameCommandSet(char** argv, int argc){
server->GamePrintInfo("ÿc1Click on cain...");
check5=1;
return true;
}
BOOL PRIVATE OnGameCommandgo(char** argv, int argc)
{
if (check2==1)
{
if (atoi(argv[2])>0)
{
countmax=atoi(argv[2]);
server->GamePrintInfo("ÿc1Duping, type .msd stop to stop the process");
check3=1;
server->GameSendPacketToServer(getnewstones, 9);
}
else
server->GamePrintInfo("Correct usage is .msd go [ammount of times]");
}
else
{
server->GamePrintInfo("Set it first");
}
return true;
}
BOOL PRIVATE OnGameCommandclean(char** argv, int argc){
return true;
}
BOOL PRIVATE OnGameCommandstop(char** argv, int argc){
//Added the following code to be compatable with the xx # times feature:
countmax=0;
countnum=0; //resets counter
check3=0;
check=1;
return true;
}
DWORD EXPORT OnGamePacketBeforeSent(BYTE* aPacket, DWORD aLen)
{
if(aPacket[0]==0x13 && aPacket[1]==0x01 && check5 == 1)
{
memcpy(getnewstones+1,aPacket+5,4);
server->GamePrintInfo("ÿc3Got cain id. Type .msd go to continue");
check2=1;
check5=0;
}
return aLen;
}
DWORD EXPORT OnGamePacketBeforeReceived(BYTE* aPacket, DWORD aLen) //Keeps you from getting dropped.
{
if (aPacket[0]==0x9c && aPacket[1]==0x04 && aPacket[2] ==0x14 && check3==1 && countnum<=countmax)
{
memcpy(pickupstonetohand+1,aPacket+4,4);
memcpy(dropstoneinhand+1,aPacket+4,4);
server->GameSendPacketToServer(pickupstonetohand, 5);
countnum++;
}
if (aPacket[0]==0x9c && aPacket[1]==0x02 && aPacket[2] ==0x16 && check3==1)
{
server->GameSendPacketToServer(getnewstones, 9);
}
if (aPacket[0]==0x9d && aPacket[4]==pickupstonetohand[1] && check3==1)
{
memcpy(pickupstonetohand+1,aPacket+4,4);
server->GameSendPacketToServer(dropstoneinhand, 5);
if (countnum==countmax)
{
char t[64];
sprintf(t,"Completed %i stones.",countmax);
server->GamePrintInfo(t);
countmax=0;
countnum=0; //resets counter
check3=0;
check=1; //prevents game from crashing when typing .msd go without a value for number of times, no clue as to why
}
}
return aLen;
}