I have this old module ( Diablo II 1.10 ) source code ( C++ ) which works fine with the latest beta of D2Hackit a.k.a version 2_0920. The problem is that every time you get into the game if requires you to:
1) Type .godmode set
2) Pick item from inventory (to get the ID)
3) Pick Full Rejuv potion from belt (to get the ID)
4) Click on some NPC (to get the ID)
5) type .godmode start (to actually start the module)
Now this is kinda not necessary, cause the private server I play on doesn't change the ID's or anything. So what I want to do is simply type .godmode start and boom, godmode started. No other extra commands should be needed ( just like the very first god mode module, which I can not use, cause the server developers changed the Full Rejuv packet in order to try patching the module )
Here's the code for the module:
Code:
#include "Source\ClientCore.cpp"
BYTE heal[9] = {0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
BYTE buyheal[5] = {0x39, 0x00, 0x00, 0x00, 0x00};
bool cSet = FALSE;
bool pCopied = FALSE;
bool iCopied = FALSE;
bool gmStart = FALSE;
bool npcCopied = FALSE;
bool gmOn = FALSE;
BOOL PRIVATE OnGameCommandSet(char** argv, int argc);
BOOL PRIVATE OnGameCommandStart(char** argv, int argc);
BOOL PRIVATE OnGameCommandStop(char** argv, int argc);
BOOL PRIVATE OnGameCommandHeal(char** argv, int argc);
BOOL PRIVATE OnGameCommandBuy(char** argv, int argc);
CLIENTINFO (0,1,"每c2SomeGuy每c0","FromSomePlace","每c8Godmode每c0","[email protected]")
MODULECOMMANDSTRUCT ModuleCommands[]={
{"help",OnGameCommandHelp,"Displays help text每c0"},
{"set",OnGameCommandSet,"Sets module for exploit.每c0"},
{"start",OnGameCommandStart,"Starts module.每c0"},
{"stop",OnGameCommandStop,"Starts module.每c0"},
{"heal",OnGameCommandHeal,"Starts module.每c0"},
{"buy",OnGameCommandBuy,"Buys health from any NPC.每c0"},
{NULL}};
VOID EXPORT OnGameJoin(THISGAMESTRUCT* thisgame){
cSet = FALSE;
pCopied = FALSE;
iCopied = FALSE;
npcCopied = FALSE;
gmOn = FALSE;
server->GamePrintInfo("每c2Godmode: Godmode reset, please use the set command again.每c0");
return;}
BOOL EXPORT OnClientStart(){
return TRUE;}
DWORD EXPORT OnGamePacketBeforeReceived(BYTE* aPacket, DWORD aLen){
if ((aPacket[0] == 0x95) && (gmOn == TRUE)) {
server->GameSendPacketToServer(heal,9);
return 0;}
return aLen;}
DWORD EXPORT OnGamePacketBeforeSent(BYTE* aPacket, DWORD aLen){
if ((aPacket[0] == 0x24) && (cSet == TRUE)) {
memcpy(heal+5,aPacket+1,4);
server->GamePrintInfo("每c2Godmode: Potion ID copied.每c0");
pCopied = TRUE;}
if ((aPacket[0] == 0x19) && (cSet == TRUE)) {
memcpy(heal+1,aPacket+1,4);
server->GamePrintInfo("每c2Godmode: Item ID copied.每c0");
iCopied = TRUE;}
if ((aPacket[0] == 0x13) && (aPacket[1] == 0x01) && (cSet == TRUE)) {
memcpy(buyheal+1,aPacket+5,4);
server->GamePrintInfo("每c2Godmode: NPC ID copied. You may now use '每c5.godmode buy每c2' to buy health from the NPC.每c0");
npcCopied = TRUE;}
if ((cSet == TRUE) && (iCopied == TRUE) && (pCopied == TRUE) && (npcCopied == TRUE)){
cSet = FALSE;
server->GamePrintInfo("每c2Godmode: All IDs copied.每c0");}
return aLen;}
BOOL PRIVATE OnGameCommandSet(char** argv, int argc){
server->GamePrintInfo("每c2Godmode: Pick up any item from your 每c1inventory每c2 and a 每c;Full Rejuvination每c2 potion from your 每c1belt每c2.每c0");
server->GamePrintInfo("每c2Godmode: Also click the 每c1NPC每c2 you want to use for '每c4.godmode buy每c2'.每c0");
cSet = TRUE;
return TRUE;}
BOOL PRIVATE OnGameCommandStart(char** argv, int argc){
if ((iCopied == TRUE) && (pCopied == TRUE)){
server->GamePrintInfo("每c2Godmode: Godmode activated!每c0");
gmOn = TRUE;}
else{
server->GamePrintInfo("每c2Godmode: Please type '每c5.godmode set每c2' and pick up the full rejuv from your belt and item from your inventory first.每c0");}
return TRUE;}
BOOL PRIVATE OnGameCommandStop(char** argv, int argc){
server->GamePrintInfo("每c2Godmode: All flags disabled.每c0");
gmOn = FALSE;
return TRUE;}
BOOL PRIVATE OnGameCommandHeal(char** argv, int argc){
if ((iCopied == TRUE) && (pCopied == TRUE)){
server->GameSendPacketToServer(heal,9);
server->GamePrintInfo("每c2Godmode: Healed.每c0");}
else{
server->GamePrintInfo("每c2Godmode: Please type '每c5.godmode set每c2' and pick up the full rejuv from your belt and item from your inventory first.每c0");}
return TRUE;}
BOOL PRIVATE OnGameCommandBuy(char** argv, int argc){
if (npcCopied == TRUE){
server->GamePrintInfo("每c2Godmode: Health purchased.每c0");
server->GameSendPacketToServer(buyheal,5);}
return TRUE;}
I have attached the whole project in case you want to compile the source for testing ( you will need Visual C++ 6.0 to compile ).
And here's what I already tried:
1) Changing
Code:
VOID EXPORT OnGameJoin(THISGAMESTRUCT* thisgame){
cSet = FALSE;
pCopied = FALSE;
iCopied = FALSE;
npcCopied = FALSE;
gmOn = FALSE;
server->GamePrintInfo("每c2Godmode: Godmode reset, please use the set command again.每c0");
return;}
To:
Code:
VOID EXPORT OnGameJoin(THISGAMESTRUCT* thisgame){
cSet = TRUE; //Also tried changing this to FALSE and leave others to TRUE
pCopied = TRUE;
iCopied = TRUE;
npcCopied = TRUE;
gmOn = TRUE;
server->GamePrintInfo("每c2Godmode: Godmode reset, please use the set command again.每c0");
return;}
The result was:
1) Game lags a lot
2) Cannot run (only walk)
3) Only have 1HP and 1MP
4) Cannot teleport or attack anything
I also tried to change the stop command a little bit so I can first get the ID's and the re-join the game, by changing this:
Code:
BOOL PRIVATE OnGameCommandStop(char** argv, int argc){
server->GamePrintInfo("每c2Godmode: All flags disabled.每c0");
gmOn = FALSE;
return TRUE;}
To this:
Code:
BOOL PRIVATE OnGameCommandStop(char** argv, int argc){
server->GamePrintInfo("每c2Godmode: All flags disabled.每c0");
cSet = FALSE;
pCopied = FALSE;
iCopied = FALSE;
npcCopied = FALSE;
gmOn = FALSE;
return TRUE;}
Result was the same as the previous one, lelllll ... Someone help me out there, please! Thank you!