Skip to content

Commit

Permalink
v14.00 by Yohann
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosMarc committed Jan 4, 2021
1 parent c8849ef commit 2597bc3
Show file tree
Hide file tree
Showing 106 changed files with 7,817 additions and 7,562 deletions.
787 changes: 397 additions & 390 deletions Commons/D2Funcs.h

Large diffs are not rendered by default.

533 changes: 329 additions & 204 deletions Commons/D2UnitStruct.h

Large diffs are not rendered by default.

1,061 changes: 547 additions & 514 deletions Commons/d2BinFile.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Commons/d2StringTblStruct.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*=================================================================
File created by Yohann NICOLAS.
@brief Diablo II Tbl Structures definitions.
@brief Diablo II Tbl Structures definitions.
=================================================================*/

Expand Down
29 changes: 20 additions & 9 deletions Commons/d2Struct.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*=================================================================
File created by Yohann NICOLAS.
NOT TESTED IN 1.10 (1.09b)
NOT TESTED IN 1.10 (1.09b)
=================================================================*/

Expand All @@ -15,15 +15,15 @@ struct Room;
#pragma pack(1)
struct sWinMessage
{
void* msg;
DWORD msg;
DWORD type;
DWORD uk1;
DWORD key;
WORD x;
WORD y;
DWORD uk3;
DWORD uk4;
DWORD managed;
DWORD unmanaged;
DWORD unmanaged;
};
#pragma pack()

Expand Down Expand Up @@ -60,11 +60,11 @@ struct saveBitField

struct BINField
{
char* fieldName;
int type;
DWORD strLength;
DWORD offset;
void* lookup;
char* fieldName;
int type;
DWORD strLength;
DWORD offset;
void* lookup;
};

struct ItemGenerationData //size=0x84
Expand Down Expand Up @@ -95,6 +95,17 @@ struct ItemGenerationData //size=0x84
};
};

struct AIParam {
void* control; //+0x00
void* u_0x04; //+0x04
Unit* target; //+0x08
void* u_0x0C; //+0x0C
void* u_0x10; //+0x10
DWORD distanceToTarget; //+0x14
BOOL engagedInCombat; //+0x18
MonStatsBIN* ptMonStatsBIN; //+0x1C
void* ptMonStats2BIN; //+0x20
};

/*=================================================================*/
/* Data Structure to Update Client */
Expand Down
70 changes: 47 additions & 23 deletions Commons/d2constants.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*=================================================================
File created by Yohann NICOLAS.
Constants of D2
NOT TESTED IN 1.10 (from 1.09b)
Constants of D2
NOT TESTED IN 1.10 (from 1.09b)
=================================================================*/

#pragma once

/*==================================================================================*/
/*
/*
* Constants & Enumerations.
*/
/*==================================================================================*/
Expand All @@ -18,29 +18,29 @@ enum D2TypeSize { D2TS_UNITSIZE = 0x011C };
enum D2DifficultyModes { D2DM_NORMAL, D2DM_NIGHTMARE, D2DM_HELL };
enum D2PlayerClass { D2PC_AMAZON, D2PC_SORCERESS, D2PC_NECROMANCER, D2PC_PALADIN, D2PC_BARBARIAN, D2PC_DRUID, D2PC_ASSASSIN };

// add the prefix "ÿc" before the number directly in the text.
enum D2Color
{
BLACK=6,
// BLACK_BIS=14,
DARK_GRAY=5,
GRAY=16,
LIGHT_GRAY=15,
// WHITE_BIS=13,
WHITE=0,
RED=1,
GREEN=2,
BLUE=3,
BRIGHT_WHITE=18,
GOLD=4,
DARK_GRAY=5,
// INVISIBLE=6,
DARK_YELLOW=7,
ORANGE=8,
YELLOW=9,
DARKEST_GREEN=0xA,
PURPLE=0xB,
DARK_GREEN=0xC,
// WHITE_BIS=0xD,
// INVISIBLE2=0xE,
LIGHT_GRAY=0xF,
GRAY=0x10,
// VERY_WIERD=0x11,
BRIGHT_WHITE=0x12,
CRYSTAL_RED=0x13,
// WIERD_YELLOW=0x14
ORANGE=8,
DARKEST_GREEN=10,
DARK_GREEN=12,
GREEN=2,
BLUE=3,
PURPLE=11,
RED=1,
CRYSTAL_RED=19,
// VERY_WIERD=17,
};

enum D2Lang
Expand All @@ -52,8 +52,8 @@ enum D2Lang
LNG_POR,// Portuguese
LNG_ITA,// Italian
LNG_JPN,// Japanese
LNG_KOR,// Korean
LNG_SIN,//
LNG_KOR,// Korean
LNG_SIN,//
LNG_CHI,// Chinese
LNG_POL,// Polish
LNG_RUS,// Russian
Expand Down Expand Up @@ -445,7 +445,7 @@ enum D2Mod
DEXTERITY,
VITALITY,
ENERGY,
MAXMANA,
MAXMANA,
MAXMANA_PERCENT,
MAXHP,
MAXHP_PERCENT,
Expand Down Expand Up @@ -824,6 +824,30 @@ enum D2UnitType
UNIT_ROOMTILE
};

enum D2UnitMode
{
UNIT_MODE_DEATH = 0,
UNIT_MODE_NEUTRAL,
UNIT_MODE_WALK,
UNIT_MODE_RUN,
UNIT_MODE_GET_HIT,
UNIT_MODE_TOWN_NEUTRAL,
UNIT_MODE_TOWN_WALK,
UNIT_MODE_ATTACK1,
UNIT_MODE_ATTACK2,
UNIT_MODE_BLOCK,
UNIT_MODE_CAST,
UNIT_MODE_THROW,
UNIT_MODE_KICK,
UNIT_MODE_SKILL1,
UNIT_MODE_SKILL2,
UNIT_MODE_SKILL3,
UNIT_MODE_SKILL4,
UNIT_MODE_DEAD,
UNIT_MODE_SEQUENCE,
UNIT_MODE_KNOCK_BACK
};

enum D2BodyLoc
{
LOC_HEAD =1,
Expand Down
48 changes: 28 additions & 20 deletions PlugY/BigStash.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*=================================================================
File created by Yohann NICOLAS.
Add support 1.13d by L'Autour.
Add support 1.14d by haxifix.
Add support 1.14d by haxifix.
Use a more big stash
Expand Down Expand Up @@ -45,15 +45,26 @@ InventoryBIN* STDCALL modifStashGrid(InventoryBIN* ptInventoryBin)
return ptInventoryBin;
}


FCT_ASM ( caller_modifStashGrid )
POP ESI
PUSH DWORD PTR SS:[ESP+0x14]
PUSH DWORD PTR SS:[ESP+0x14]
PUSH DWORD PTR SS:[ESP+0x14]
PUSH DWORD PTR SS:[ESP+0x14]
PUSH DWORD PTR SS:[ESP+0x14]
CALL D2CompileTxtFile
PUSH EAX
CALL modifStashGrid
JMP ESI
RETN 0x14
}}

//FCT_ASM ( caller_modifStashGrid )
// POP ESI
// CALL D2CompileTxtFile
// PUSH EAX
// CALL modifStashGrid
// JMP ESI
//}}

FCT_ASM ( caller_changeTradeStash )
CMP onRealm,0
JNZ normalTradeStash
Expand All @@ -79,30 +90,27 @@ void Install_BigStash()

// modification of stash grid
mem_seek R8(D2Common, C9F3, CA03, 14ED3, 5FCB5, 2A505, 1BDB5, 82CA5, 6CC25, 25C0F8);
if (version_D2Common == V114d) {
MEMT_REF4(0xFFFB61F4, caller_modifStashGrid);
}
else {
MEMC_REF4(D2CompileTxtFile, caller_modifStashGrid);
}
MEMC_REF4( D2CompileTxtFile, caller_modifStashGrid);
//01B64ED2 |. E8 99AEFFFF CALL D2Common.#10578
//6FDAFCB4 |. E8 A7C3FCFF CALL D2Common.#10653
//6FD7A504 |. E8 5743FEFF CALL D2Common.#10496 ; \#10496
//6FD6BDB4 |. E8 97600200 CALL D2Common.#10244 ; \#10244
//6FDD2CA4 |. E8 97C2FDFF CALL D2Common.#10849 ; \#10849
//6FDBCC24 |. E8 B7FEF9FF CALL D2Common.#10037 ; \#10037
//0065C0F7 |. E8 F461FBFF CALL Game.006122F0 ; \Game.006122F0

// modification of stash background
mem_seek R8(D2Client, 45B1C, 45B1C, 4C61C, A643C, 749BC, A9D7C, 8CC1C, 943FC, 89EB5);
memt_byte(0x68, 0xE8); // CALL caller_changeTradeStash
MEMT_REF4(0x00000104, caller_changeTradeStash);

//6FAEC61C |. 68 04010000 PUSH 104
//6FB5643C |. 68 04010000 PUSH 104
//6FB249BC |. 68 04010000 PUSH 104
//6FB59D7C |. 68 04010000 PUSH 104
//6FB3CC1C |. 68 04010000 PUSH 104
//6FB443FC |. 68 04010000 PUSH 104
mem_seek R8(D2Client, 45B1C, 45B1C, 4C61C, A643C, 749BC, A9D7C, 8CC1C, 943FC, 89EB5);
memt_byte( 0x68, 0xE8 ); // CALL caller_changeTradeStash
MEMT_REF4( 0x00000104, caller_changeTradeStash);
//6FAEC61C |. 68 04010000 PUSH 104
//6FB5643C |. 68 04010000 PUSH 104
//6FB249BC |. 68 04010000 PUSH 104
//6FB59D7C |. 68 04010000 PUSH 104
//6FB3CC1C |. 68 04010000 PUSH 104
//6FB443FC |. 68 04010000 PUSH 104
//00489EB5 |. 68 04010000 PUSH 104 ; |Arg2 = 00000104

log_msg("\n");

isInstalled = true;
Expand Down
8 changes: 4 additions & 4 deletions PlugY/ClientSaveFile.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*=================================================================
File created by Yohann NICOLAS.
Add an extra save file for each characters.
Add an extra save file for each characters.
=================================================================*/
/*
Expand All @@ -23,7 +23,7 @@ BYTE * openClientSaveFile(char* name, DWORD* size)
strcat(filename, ".clt");
log_msg("Client file to read : %s\n",filename);
FILE* file = fopen(filename, "rb");
if (file)
{
Expand Down Expand Up @@ -55,7 +55,7 @@ DWORD loadClientSaveFile()
if (!data) return 0;
DWORD curSize = 0;
log_msg("Load client file.\n");
if (*(DWORD*)&data[curSize] != FILE_SAVETYPE)
{
Expand Down Expand Up @@ -103,7 +103,7 @@ DWORD saveClientSaveFile()
D2FogGetSavePath( (char*)data, BUFFER_SIZE);
sprintf( szSaveName, "%s%s.clt", data, PCPlayerData->name );
log_msg("Client save file for saving : %s\n",szSaveName);
// if (!MoveFileEx(szTempName, szSaveName, MOVEFILE_WRITE_THROUGH|MOVEFILE_REPLACE_EXISTING))
// if (!MoveFileEx(szTempName, szSaveName, MOVEFILE_WRITE_THROUGH|MOVEFILE_REPLACE_EXISTING))
DeleteFile(szSaveName);
if (!MoveFile(szTempName, szSaveName))
log_box("Could not create the client save file.");
Expand Down
Loading

0 comments on commit 2597bc3

Please sign in to comment.