Disable resetting of the module on game join

This is a discussion on Disable resetting of the module on game join within the Diablo 2 forum board part of the Hot Games category; This may be more like a HELP thread instead of CODING, but I decided to choose CODING, so you know ...

Results 1 to 1 of 1
  1. #1
    TheRealSlimShady is offline Newbie
    Array
    Join Date
    Oct 2016
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0

    Thumbs up Disable resetting of the module on game join

    This may be more like a HELP thread instead of CODING, but I decided to choose CODING, so you know what is it about and don't even open the thread if u don't know how to code, errrrrrr ... ANYWAYS ...

    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,"c2SomeGuyc0","FromSomePlace","c8Godmodec0","[email protected]il.com")
    
    
    MODULECOMMANDSTRUCT ModuleCommands[]={
    {"help",OnGameCommandHelp,"Displays help textc0"},
    {"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 buyc2' 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 c1inventoryc2 and a c;Full Rejuvinationc2 potion from your c1beltc2.c0");
    server->GamePrintInfo("c2Godmode: Also click the c1NPCc2 you want to use for 'c4.godmode buyc2'.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 setc2' 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 setc2' 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!
    Attached Files

Similar Threads

  1. [Windows] Help With Resetting Password!
    By kimhypno in forum Operating Systems
    Replies: 3
    Last Post: 01-06-2012, 01:14 PM
  2. Steam Anti-VAC: Disable VAC on any Steam game and use any hack.
    By Goodzie in forum Counter-Strike: Source Hacks
    Replies: 7
    Last Post: 06-08-2011, 07:00 PM
  3. [TEMPLATE] [VB6] Game Module Code
    By Kalbintion in forum Development
    Replies: 3
    Last Post: 01-31-2009, 02:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •