mirror of
https://gitlab.com/hashborgir/plugy.git
synced 2025-04-27 23:05:36 +00:00
Compare commits
70 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e89cfad117 | ||
|
f3b0abf9ab | ||
|
9a858693c5 | ||
|
6bef4f86c8 | ||
|
3b06e3ad08 | ||
|
8a3841f49b | ||
|
64792db947 | ||
|
e9fe6cb433 | ||
|
a1e3cac784 | ||
|
b6e0436944 | ||
|
2597bc3946 | ||
|
c8849ef0fa | ||
|
9c23f48faf | ||
|
c66c4cfe5b | ||
|
bdb13151cf | ||
|
fc8c4a8a15 | ||
|
a9ab308da4 | ||
|
ec9e6c7089 | ||
|
9a7c818d37 | ||
|
a44e3be492 | ||
|
f834ce7755 | ||
|
f0ceac1d92 | ||
|
f1472e74d1 | ||
|
e0472480c4 | ||
|
1657f9ca6c | ||
|
f6848c515c | ||
|
779ec95c3d | ||
|
d0a28e23d1 | ||
|
2ae254ab43 | ||
|
17b5d682c8 | ||
|
f35d9790d7 | ||
|
10df6a86b7 | ||
|
6246f98247 | ||
|
93aaeb0b61 | ||
|
9c3a7a01c3 | ||
|
bb7eac37f4 | ||
|
e8dc732f2c | ||
|
c982875959 | ||
|
29cbdbe028 | ||
|
c0ab93847c | ||
|
0116cb44b4 | ||
|
a0c5ef7c9f | ||
|
3f25bf1b0a | ||
|
9a05a42243 | ||
|
1f7ae685b6 | ||
|
58c251230c | ||
|
857834bc82 | ||
|
825a51f608 | ||
|
ac348b8cb7 | ||
|
1abbd073f9 | ||
|
722e7c2046 | ||
|
b9f766313b | ||
|
d2b9c9c06b | ||
|
d743794477 | ||
|
0e1a9d449e | ||
|
4a0ba8e2c9 | ||
|
d1bf1eb471 | ||
|
3d4273028a | ||
|
3f60030fbb | ||
|
1f35a1a5a8 | ||
|
bcb9674663 | ||
|
8e599c9022 | ||
|
28fe25a3aa | ||
|
28e33f74ba | ||
|
484ee259c9 | ||
|
71955576c8 | ||
|
30c1be25dc | ||
|
61afc5de33 | ||
|
bcaa0acf0b | ||
|
5a1eb33f03 |
14
.gitignore
vendored
14
.gitignore
vendored
@ -26,3 +26,17 @@
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
**/*.zip
|
||||
|
||||
.idea
|
||||
**/.vs
|
||||
**/Release/
|
||||
**/*.vcxproj
|
||||
**/*.vcxproj.filters
|
||||
**/*.vcxproj.user
|
||||
**/*.VC.db
|
||||
**/*.VC.VC.opendb
|
||||
**/UpgradeLog*
|
||||
/PlugYRun/PlugYRun.aps
|
||||
PlugY/Debug/
|
||||
|
||||
|
286
ASLR_fix.patch
Normal file
286
ASLR_fix.patch
Normal file
@ -0,0 +1,286 @@
|
||||
diff --git a/PlugY/D2wrapper.cpp b/PlugY/D2wrapper.cpp
|
||||
index d13608e..ffd02f2 100644
|
||||
--- a/PlugY/D2wrapper.cpp
|
||||
+++ b/PlugY/D2wrapper.cpp
|
||||
@@ -291,6 +291,7 @@ void loadCustomLibraries()
|
||||
log_msg("\n\n");
|
||||
}
|
||||
|
||||
+/*
|
||||
void loadLibrary(LPCSTR libName, int* libVersion, DWORD* libOffset, int shift, DWORD v109b, DWORD v109d, DWORD v110, DWORD v111, DWORD v111b, DWORD v112, DWORD v113c)
|
||||
{
|
||||
*libOffset = (DWORD)LoadLibrary(libName);
|
||||
@@ -386,6 +387,273 @@ void initD2modules()
|
||||
|
||||
log_msg("\n\n");
|
||||
}
|
||||
+*/
|
||||
+
|
||||
+IMAGE_NT_HEADERS* GetHeader(LPBYTE pBase) {
|
||||
+ if (pBase == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ IMAGE_DOS_HEADER* pDosHeader = (IMAGE_DOS_HEADER*)pBase;
|
||||
+
|
||||
+ if (IsBadReadPtr(pDosHeader, sizeof(IMAGE_DOS_HEADER)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
+ return NULL;
|
||||
+
|
||||
+ IMAGE_NT_HEADERS* pHeader = (IMAGE_NT_HEADERS*)(pBase + pDosHeader->e_lfanew);
|
||||
+ if (IsBadReadPtr(pHeader, sizeof(IMAGE_NT_HEADERS)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (pHeader->Signature != IMAGE_NT_SIGNATURE)
|
||||
+ return NULL;
|
||||
+
|
||||
+ return pHeader;
|
||||
+}
|
||||
+
|
||||
+void initD2modules()
|
||||
+{
|
||||
+ log_msg("***** Get D2 Modules address and version *****\n\n");
|
||||
+
|
||||
+ offset_D2Client = (DWORD)LoadLibrary("D2Client.dll");
|
||||
+ offset_D2CMP = (DWORD)LoadLibrary("D2CMP.dll");
|
||||
+ offset_D2Common = (DWORD)LoadLibrary("D2Common.dll");
|
||||
+ offset_D2Game = (DWORD)LoadLibrary("D2Game.dll");
|
||||
+ offset_D2gfx = (DWORD)LoadLibrary("D2gfx.dll");
|
||||
+ offset_D2Lang = (DWORD)LoadLibrary("D2Lang.dll");
|
||||
+ offset_D2Launch = (DWORD)LoadLibrary("D2Launch.dll");
|
||||
+ offset_D2Net = (DWORD)LoadLibrary("D2Net.dll");
|
||||
+ offset_D2Win = (DWORD)LoadLibrary("D2Win.dll");
|
||||
+ offset_Fog = (DWORD)LoadLibrary("Fog.dll");
|
||||
+ offset_Storm = (DWORD)LoadLibrary("Storm.dll");
|
||||
+
|
||||
+ int count_109b = 0;
|
||||
+ int count_109d = 0;
|
||||
+ int count_110f = 0;
|
||||
+ int count_111 = 0;
|
||||
+ int count_111b = 0;
|
||||
+ int count_112a = 0;
|
||||
+ int count_113c = 0;
|
||||
+ int count_113d = 0;
|
||||
+ int count_114a = 0;
|
||||
+ int count_114b = 0;
|
||||
+ int count_114c = 0;
|
||||
+ int count_114d = 0;
|
||||
+
|
||||
+ IMAGE_NT_HEADERS* pHeader;
|
||||
+
|
||||
+ if (offset_D2Client != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_D2Client);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C234D) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C16CD) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C1C1D) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045E6) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045EE) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045FA) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045F6) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045DE) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_D2CMP != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_D2CMP);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00011361) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00011361) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00010E61) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_D2Common != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_D2Common);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00074D1D) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00074E2D) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000856DD) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C94) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C8D) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C97) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C8F) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000047C7) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_D2Game != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_D2Game);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C66AC) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C6D5C) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000EDC2C) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000036E6) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000373D) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000374B) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000373C) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003747) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_D2gfx != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_D2gfx);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000054EB) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000054EB) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000054A5) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_D2Lang != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_D2Lang);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00005148) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00005138) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00005048) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A6A) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A5B) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A75) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A71) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A5A) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_D2Launch != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_D2Launch);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000172C3) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00017243) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00018DC7) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A84) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A85) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A85) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A87) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A84) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_D2Net != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_D2Net);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002BCE) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002BCE) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C6E) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001676) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001676) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000167E) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001676) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000167E) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_D2Win != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_D2Win);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00014F38) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00014F38) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00012EC0) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000187E) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000187E) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000188E) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000187E) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001887) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_Fog != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_Fog);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00013658) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000142E7) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000162B0) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003159) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003142) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000314A) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003162) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003142) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ if (offset_Storm != NULL) {
|
||||
+ pHeader = GetHeader((LPBYTE)offset_Storm);
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00013658) count_109b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000142E7) count_109d++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000162B0) count_110f++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003159) count_111++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003142) count_111b++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000314A) count_112a++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003162) count_113c++;
|
||||
+ if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0003C3E0) count_113d++;
|
||||
+ }
|
||||
+
|
||||
+ int minimum_match_dll = 7;
|
||||
+
|
||||
+ if (count_109b >= minimum_match_dll) version_Game = V109b;
|
||||
+ if (count_109d >= minimum_match_dll) version_Game = V109d;
|
||||
+ if (count_110f >= minimum_match_dll) version_Game = V110;
|
||||
+ if (count_111 >= minimum_match_dll) version_Game = V111;
|
||||
+ if (count_111b >= minimum_match_dll) version_Game = V111b;
|
||||
+ if (count_112a >= minimum_match_dll) version_Game = V112;
|
||||
+ if (count_113c >= minimum_match_dll) version_Game = V113c;
|
||||
+ if (count_113d >= minimum_match_dll) version_Game = V113d;
|
||||
+
|
||||
+ //version_SmackW32 = version_Game;
|
||||
+ version_D2Common = version_Game;
|
||||
+ //version_ijl11 = version_Game;
|
||||
+ //version_D2Gdi = version_Game;
|
||||
+ version_D2Win = version_Game;
|
||||
+ //version_D2sound = version_Game;
|
||||
+ //version_D2MCPCLI = version_Game;
|
||||
+ version_D2Launch = version_Game;
|
||||
+ version_D2gfx = version_Game;
|
||||
+ version_D2Client = version_Game;
|
||||
+ version_D2Net = version_Game;
|
||||
+ version_D2Lang = version_Game;
|
||||
+ version_D2Game = version_Game;
|
||||
+ version_D2CMP = version_Game;
|
||||
+ //version_Bnclient = version;
|
||||
+ version_Fog = version_Game;
|
||||
+ version_Storm = version_Game;
|
||||
+
|
||||
+ log_msg("DLL match for version 1.09b :\t%d\n", count_109b);
|
||||
+ log_msg("DLL match for version 1.09d :\t%d\n", count_109d);
|
||||
+ log_msg("DLL match for version 1.10f :\t%d\n", count_110f);
|
||||
+ log_msg("DLL match for version 1.11 :\t%d\n", count_111);
|
||||
+ log_msg("DLL match for version 1.11b :\t%d\n", count_111b);
|
||||
+ log_msg("DLL match for version 1.12a :\t%d\n", count_112a);
|
||||
+ log_msg("DLL match for version 1.13c :\t%d\n", count_113c);
|
||||
+ log_msg("\n");
|
||||
+
|
||||
+ offset_Game = (DWORD)GetModuleHandle("Game.exe");
|
||||
+ if (offset_Game != NULL) {
|
||||
+ version_Game = GetD2Version((HMODULE)offset_Game);
|
||||
+ log_msg("Game.exe loaded at:\t%08X (%s)\n", offset_Game, GetVersionString(version_Game));
|
||||
+ if (version_Game >= V114a)
|
||||
+ {
|
||||
+ //version_SmackW32 = version_Game;
|
||||
+ version_D2Common = version_Game;
|
||||
+ //version_ijl11 = version_Game;
|
||||
+ //version_D2Gdi = version_Game;
|
||||
+ version_D2Win = version_Game;
|
||||
+ //version_D2sound = version_Game;
|
||||
+ //version_D2MCPCLI = version_Game;
|
||||
+ version_D2Launch = version_Game;
|
||||
+ version_D2gfx = version_Game;
|
||||
+ version_D2Client = version_Game;
|
||||
+ version_D2Net = version_Game;
|
||||
+ version_D2Lang = version_Game;
|
||||
+ version_D2Game = version_Game;
|
||||
+ version_D2CMP = version_Game;
|
||||
+ //version_Bnclient = version;
|
||||
+ version_Fog = version_Game;
|
||||
+ version_Storm = version_Game;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ //if (offset_Game != NULL) {
|
||||
+ // pHeader = GetHeader((LPBYTE)offset_Game);
|
||||
+ // if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00291342) count_114a++;
|
||||
+ // if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x002854F2) count_114b++;
|
||||
+ // if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x002850E2) count_114c++;
|
||||
+ // if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00282985) count_114d++;
|
||||
+ //}
|
||||
+
|
||||
+ log_msg("Version game is:\t(%s)\n\n", GetVersionString(version_Game));
|
||||
+
|
||||
+ if (version_Game == UNKNOWN)
|
||||
+ {
|
||||
+ MessageBoxA(NULL, "This version of Diablo II is not supported by Plugy. Please upgrade or downgrade to a supported version.", "Plugy 14.03", MB_OK);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
//////////////////////////////////// EXPORTS FUNCTIONS ////////////////////////////////////
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
/*======================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Declares the type for a STDCALL or FASTCALL function pointer
|
||||
called N with arguments list P, returning R, namedInDLL D and at @A
|
||||
Declares the type for a STDCALL or FASTCALL function pointer
|
||||
called N with arguments list P, returning R, namedInDLL D and at @A
|
||||
|
||||
======================================================================*/
|
||||
|
||||
@ -19,7 +21,7 @@
|
||||
//D2S(D2Common,11068, DWORD, D2InvAddItem, (Inventory* ptInventory, Unit* ptItem, DWORD posX, DWORD posY, DWORD vValueC, DWORD bIsClient, BYTE page));//ONLY 1.11b result : boolean 0=echec ; vValueC = 0 for Game.dll, 1 for Clientdll
|
||||
//D2S(D2Common,10250, DWORD, D2Common10250, (const char* file, DWORD line, Inventory* ptInventory, DWORD posX, DWORD posY, DWORD vValueC, DWORD bIsClient, BYTE page));// result : boolean 0=echec ; vValueC = 0 for Game.dll, 1 for Clientdll
|
||||
////D2S(D2Common,10257, Unit*, D2GetItemFromBodyLoc, (Inventory* ptInventory, DWORD bodyloc));
|
||||
//D2S(D2Common,10273, DWORD, D2Common10273, (Inventory* ptInventory, void* unknow));
|
||||
//D2S(D2Common,10273, DWORD, D2Common10273, (Inventory* ptInventory, void* unknown));
|
||||
//D2S(D2Common,10535, Unit*, D2InventoryGetFirstItem, (Inventory* ptInventory));//ONLY 1.11b
|
||||
//D2S(D2Common,11140, Unit*, D2UnitGetNextItem, (Unit* ptItem));//ONLY 1.11b
|
||||
//D2S(D2Common,10748, Unit*, D2GetRealItem, (Unit* ptUnit));//ONLY 1.11b
|
||||
@ -147,143 +149,143 @@
|
||||
|
||||
|
||||
|
||||
//F7(STD, D2Common,00000,00000,00000,00000,10001,00000,00000, DWORD, D2GetActIDFromLevel, (DWORD levelID));
|
||||
F7(STD, D2Common,00000,00000,00000,10188,11084,11109,10346, DWORD, D2Common11084, (Room* ptRoom, DWORD zero));
|
||||
F7(STD, D2Common,10057,10057,10057,10332,11021,10511,10826, DWORD, D2GetLevelID, (Room* ptRoom));
|
||||
F7(STD, D2Common,10138,10138,10138,10623,10491,11043,10654, Room*, D2GetDropRoom, (Room* ptRoom, Position*, Position*, DWORD, DWORD, DWORD, DWORD));
|
||||
//F7(STD, D2Common,10149,10149,10149,00000,00000,00000,00000, Inventory*, D2GetInventory, (Unit* ptUnit));
|
||||
F7(STD, D2Common,10242,10242,10242,00000,00000,00000,00000, Unit*, D2Common10242, (Inventory* ptInventory, Unit* ptItem, DWORD bIsClient));
|
||||
F7(STD, D2Common,10246,10246,10246,10855,10813,10289,10133, Unit*, D2CanPutItemInInv, (Inventory* ptInventory, Unit* ptItem, DWORD p3, DWORD zero, Unit* ptUnit, const char* file, DWORD line));
|
||||
F7(STD, D2Common,10243,10243,10243,10461,10827,10936,10646, Unit*, D2InvRemoveItem, (Inventory* ptInventory, Unit* ptItem));
|
||||
F7(STD, D2Common,10249,10249,10249,10880,11068,10436,11107, DWORD, D2InvAddItem, (Inventory* ptInventory, Unit* ptItem, DWORD posX, DWORD posY, DWORD vValueC, DWORD bIsClient, BYTE page));//result : boolean 0=echec ; vValueC = 0 for Game.dll, 1 for Clientdll
|
||||
F7(STD, D2Common,10250,10250,10250,00000,00000,00000,00000, DWORD, D2Common10250, (const char* file, DWORD line, Inventory* ptInventory, DWORD posX, DWORD posY, DWORD vValueC, DWORD bIsClient, BYTE page));// result : boolean 0=echec ; vValueC = 0 for Game.dll, 1 for Clientdll
|
||||
//F7(STD, D2Common,10257,10257,10257,00000,00000,00000,00000, Unit*, D2GetItemFromBodyLoc, (Inventory* ptInventory, DWORD bodyloc));
|
||||
F7(STD, D2Common,10273,10273,10273,00000,00000,00000,00000, DWORD, D2Common10273, (Inventory* ptInventory, void* unknow));
|
||||
F7(STD, D2Common,10277,10277,10277,10402,10535,11151,10460, Unit*, D2InventoryGetFirstItem, (Inventory* ptInventory));
|
||||
F7(STD, D2Common,10304,10304,10304,10934,11140,10770,10464, Unit*, D2UnitGetNextItem, (Unit* ptItem));
|
||||
F7(STD, D2Common,10305,10305,10305,11095,10748,10852,11147, Unit*, D2GetRealItem, (Unit* ptUnit));
|
||||
//F7(STD, D2Common,10321,10321,10321,00000,00000,00000,00000, SkillData*, D2GetLeftSkill, (Unit* ptChar));
|
||||
//F7(STD, D2Common,10322,10322,10322,00000,00000,00000,00000, SkillData*, D2GetRightSkill, (Unit* ptChar));
|
||||
F7(STD, D2Common,10326,10326,00000,00000,00000,00000,00000, DWORD, D2GetPosX, (Unit* ptUnit));//NOT IN 1.10
|
||||
//F7(STD, D2Common,10328,10328,10328,00000,00000,00000,00000, void, D2SetPosX, (Unit* ptUnit, DWORD pos));
|
||||
F7(STD, D2Common,10329,10329,00000,00000,00000,00000,00000, DWORD, D2GetPosY, (Unit* ptUnit));//NOT IN 1.10
|
||||
//F7(STD, D2Common,10331,10331,10331,00000,00000,00000,00000, void, D2SetPosY, (Unit* ptUnit, DWORD pos));
|
||||
F7(STD, D2Common,10332,10332,10332,11080,10056,10543,10141, void, D2GetPosition, (Unit* ptUnit, Position* pos));
|
||||
F7(STD, D2Common,10339,10339,10339,10455,10864,10941,11060, DWORD, D2GetMaxGoldBank, (Unit* ptUnit));
|
||||
F7(STD, D2Common,10342,10342,10342,10172,10933,10366,10331, Room*, D2GetRoom, (Unit* ptUnit));
|
||||
//F7(STD, D2Common,10348,10348,10348,00000,00000,00000,00000, void, D2SetUnitMode, (Unit* ptUnit, DWORD mode));
|
||||
//F7(STD, D2Common,10394,10394,10394,00000,00000,00000,00000, ObjectsBIN*,D2GetObjectsBIN, (Unit* ptObject));
|
||||
F7(STD, D2Common,10420,10420,10420,10218,10079,11097,10356, PlayerData*,D2InitPlayerData, (Unit* ptChar));
|
||||
//F7(STD, D2Common,10421,10421,10421,10914,10329,00000,00000, DWORD, D2FreePlayerData, (DWORD game1C, Unit* ptChar));
|
||||
F7(STD, D2Common,10424,10424,10424,10562,10800,10860,10920, PlayerData*,D2GetPlayerData, (Unit* ptChar));
|
||||
F7(STD, D2Common,10431,10431,10431,00000,00000,00000,00000, DWORD, D2GetDefence, (Unit* ptChar));
|
||||
F7(STD, D2Common,10433,10433,10433,00000,00000,00000,00000, DWORD, D2GetChanceToBlock, (Unit* ptChar, DWORD isLODGame));
|
||||
F7(STD, D2Common,10439,10439,10439,10343,11131,10729,10049, DWORD, D2GetMaxGold, (Unit* ptUnit));
|
||||
F7(STD, D2Common,00000,00000,00000,10440,10572,10481,11090, DWORD, D2Common10572, (Unit* ptObject, DWORD value));
|
||||
//F7(STD, D2Common,10463,10463,10463,00000,00000,00000,00000, DWORD, D2SetStatWithNoTest, ( Stats* ptStats, DWORD statID, DWORD statValue, DWORD statIndex));
|
||||
//F7(STD, D2Common,10464,10464,10464,00000,00000,00000,00000, void, D2AddStat, (Stats* ptStats, DWORD statID, DWORD statValue, DWORD statIndex));
|
||||
//F7(STD, D2Common,10465,10465,10465,00000,00000,00000,00000, DWORD, D2SetStat, (Stats* ptStats, DWORD statID, DWORD statValue, DWORD statIndex));
|
||||
//F7(STD, D2Common,10466,10466,10466,00000,00000,00000,00000, int, D2GetStat, (Stats* ptStats, DWORD statID, DWORD statIndex));
|
||||
//F7(STD, D2Common,10470,10470,10470,00000,00000,00000,00000, Stats*, D2AllocNewStats, (DWORD nUnitId, DWORD flags, DWORD uk18, DWORD nUnitType, DWORD nItemNum));
|
||||
F7(STD, D2Common,00000,00000,00000,10471,11160,10866,10258, BYTE, D2GetObjectFlags, (Unit* ptObject));
|
||||
F7(STD, D2Common,00000,00000,00000,10572,11048,10150,10111, void, D2SetObjectFlags, (Unit* ptObject, BYTE flags));
|
||||
//F7(STD, D2Common,10471,10471,10471,00000,00000,00000,00000, DWORD, D2Common10471, (void*));
|
||||
//F7(STD, D2Common,10472,10472,10472,00000,00000,00000,00000, DWORD, D2Common10472, (void*));
|
||||
//F7(STD, D2Common,10475,10475,10475,00000,00000,00000,00000, void, D2UpdateDisabledStat, (Stats* ptCharStats, Stats* ptStats, DWORD one));
|
||||
//F7(STD, D2Common,10481,10481,10481,00000,00000,00000,00000, void*, D2Common10481, (Unit* ptUnit, DWORD flags));
|
||||
//F7(STD, D2Common,10484,10484,10484,00000,00000,00000,00000, Stats*, D2GetAffixStats, (Unit* ptItem, DWORD, DWORD));
|
||||
//F7(STD, D2Common,10485,10485,10485,00000,00000,00000,00000, void, D2FreeStats, (Stats* ptStats));
|
||||
F7(STD, D2Common,10487,10487,10487,00000,00000,00000,00000, DWORD, D2isInState, (Unit* ptChar, DWORD isLODGame));
|
||||
//F7(STD, D2Common,10517,10517,10517,00000,00000,00000,00000, void, D2SetPlayerStat, (Unit* ptChar, DWORD statID, int amount, DWORD index));
|
||||
F7(STD, D2Common,10518,10518,10518,10109,10627,10762,10551, void, D2AddPlayerStat, (Unit* ptChar, DWORD statID, int amount, DWORD index));//ONLY 1.11b
|
||||
F7(STD, D2Common,10519,10519,10519,11092,10061,10658,10973, int, D2GetPlayerStat, (Unit* ptChar, DWORD statID, DWORD index));//ONLY 1.11b
|
||||
//F7(STD, D2Common,10520,10520,10520,00000,00000,00000,00000, int, D2GetPlayerStat20, (Unit* ptChar, DWORD statID, DWORD index));
|
||||
F7(STD, D2Common,10521,10521,10521,10733,10550,10494,10587, int, D2GetPlayerBaseStat, (Unit* ptChar, DWORD statID, DWORD index));//ONLY 1.11b
|
||||
//F7(STD, D2Common,10527,10527,10527,00000,00000,00000,00000, DWORD, D2Common10527, (Unit* ptUnit));
|
||||
F7(STD, D2Common,10539,10539,10539,00000,00000,00000,00000, DWORD, D2haveDefenceBonus, (Unit* ptChar));
|
||||
F7(STD, D2Common,10540,10540,10540,00000,00000,00000,00000, DWORD, D2haveFireResBonus, (Unit* ptChar));
|
||||
F7(STD, D2Common,10541,10541,10541,00000,00000,00000,00000, DWORD, D2haveColdResBonus, (Unit* ptChar));
|
||||
F7(STD, D2Common,10542,10542,10542,00000,00000,00000,00000, DWORD, D2haveLightResBonus, (Unit* ptChar));
|
||||
F7(STD, D2Common,10543,10543,10543,00000,00000,00000,00000, DWORD, D2havePoisonResBonus, (Unit* ptChar));
|
||||
F7(STD, D2Common,10546,10546,10546,00000,00000,00000,00000, DWORD, D2haveDefenceMalus, (Unit* ptChar));
|
||||
F7(STD, D2Common,10547,10547,10547,00000,00000,00000,00000, DWORD, D2haveFireResMalus, (Unit* ptChar));
|
||||
F7(STD, D2Common,10548,10548,10548,00000,00000,00000,00000, DWORD, D2haveColdResMalus, (Unit* ptChar));
|
||||
F7(STD, D2Common,10549,10549,10549,00000,00000,00000,00000, DWORD, D2haveLightResMalus, (Unit* ptChar));
|
||||
F7(STD, D2Common,10550,10550,10550,00000,00000,00000,00000, DWORD, D2havePoisonResMalus, (Unit* ptChar));
|
||||
//F7(STD, D2Common,10552,10552,10552,00000,00000,00000,00000, DWORD, D2Common10552, (Unit* ptUnit));
|
||||
//F7(STD, D2Common,10567,10567,10567,00000,00000,00000,00000, DWORD, D2CanBeBroken, (Unit* ptItem));
|
||||
//F7(STD, D2Common,10573,10573,10573,00000,00000,00000,00000, void, D2CopyStats, (Stats* ptDestStats, Stats* ptSrcStats));
|
||||
//F7(STD, D2Common,10574,10574,10574,00000,00000,00000,00000, void*, D2SetEnabledStat, (Unit* ptItem, DWORD statId, DWORD disabled));
|
||||
//F7(STD, D2Common,10575,10575,10575,00000,00000,00000,00000, void, D2FreeBinFiles, ());
|
||||
//F7(STD, D2Common,10576,10576,10576,00000,00000,00000,00000, void, D2LoadBinFiles, (DWORD zero1, DWORD zero2, bool));
|
||||
//F7(STD, D2Common,00000,00000,00000,10651,10651,00000,00000, DWORD, D2CheckQuestState, (void* ptQuest, DWORD index, DWORD value));
|
||||
F7(STD, D2Common,10578,10578,10578,10653,10496,10244,10849, void*, D2CompileTxtFile, (DWORD unused, const char* filename, BINField* ptFields, DWORD* ptRecordCount, DWORD recordLength));
|
||||
F7(STD, D2Common,10600,10600,10600,10573,10262,10887,10695, ItemsBIN*, D2GetItemsBIN, (DWORD itemID));
|
||||
//F7(STD, D2Common,10601,10601,10601,00000,00000,00000,00000, ItemsBIN*, D2GetByCodeItemStatsBIN, (DWORD code, DWORD* itemID));
|
||||
//F7(STD, D2Common,10604,10604,10604,00000,00000,00000,00000, AffixBIN*, D2GetAffixBIN, (int affixID));
|
||||
F7(STD, D2Common,10616,10616,10616,10500,10523,10774,10806, GemsBIN*, D2GetGemsBIN, (DWORD gemID));
|
||||
F7(STD, D2Common,11232,11232,11232,10746,10258,10913,10783, CubeMainBIN*,D2GetCubeMainBIN, (DWORD cubemainID));
|
||||
F7(STD, D2Common,11233,11233,11233,10639,11135,10390,10675, int, D2GetNbCubeMainBIN, ());
|
||||
//F7(STD, D2Common,10737,10737,10737,00000,00000,00000,00000, LevelsBIN*, D2GetLevelsBIN, (DWORD levelID));
|
||||
F7(STD, D2Common,10628,10628,10628,00000,00000,00000,00000, DWORD, D2GetNextLevelXP, (DWORD classID, DWORD level));
|
||||
F7(STD, D2Common,10629,10629,10629,00000,00000,00000,00000, DWORD, D2GetMaxLevel, (DWORD classID));
|
||||
F7(STD, D2Common,10655,10655,10655,10655,10309,10297,10218, DifficultyLevelsBIN*, D2GetDifficultyLevelsBIN, (DWORD difficultyLevel));
|
||||
//F7(STD, D2Common,10659,10659,10659,00000,00000,00000,00000, TreasureClassBIN*, D2GetTreasureClassBIN, (WORD id, DWORD uk));
|
||||
//F7(STD, D2Common,10668,10668,10668,10450,10953,00000,00000, SuperUniqueBIN*, D2GetSuperUniqueBIN, (WORD id));
|
||||
F7(STD, D2Common,10695,10695,10695,10927,10899,10276,10106, DWORD, D2GetItemQuality, (Unit* ptItem));
|
||||
F7(STD, D2Common,10707,10707,10707,10911,10303,10989,10202, DWORD, D2TestFlags, (Unit* ptUnit, DWORD flags, DWORD line, const char* file));
|
||||
//F7(STD, D2Common,10708,10708,10708,00000,00000,00000,00000, void, D2SetFlags, (Unit* ptUnit, DWORD flags, DWORD bitNewValue));
|
||||
//F7(STD, D2Common,10709,10709,10709,00000,00000,00000,00000, DWORD, D2GetFlags, (Unit* ptUnit));
|
||||
//F7(STD, D2Common,10711,10711,10711,00000,00000,00000,00000, void, D2ItemSetFlags, (Unit* ptItem, DWORD flags, DWORD toSet));// toSet = 0 for set to 0 the selected flags else set to 1
|
||||
F7(STD, D2Common,10717,10717,10717,10898,10100,10410,10086, DWORD, D2GetItemLevel, (Unit* ptItem));
|
||||
F7(STD, D2Common,10719,10719,10719,10820,10505,10370,10020, BYTE, D2ItemGetPage, (Unit* ptUnit));
|
||||
F7(STD, D2Common,10720,10720,10720,10485,10608,10223,10012, void, D2ItemSetPage, (Unit* ptItem, BYTE page));
|
||||
F7(STD, D2Common,10731,10731,10731,11017,10890,10231,10744, DWORD, D2CheckItemType, (Unit* ptItem, DWORD itype));
|
||||
F7(STD, D2Common,10732,10732,10732,10692,10685,10280,10620, int, D2GetUniqueID, (Unit* ptItem));
|
||||
F7(STD, D2Common,10734,10734,10734,00000,00000,00000,00000, void, D2SetAnim, (Unit* ptUnit, int anim));
|
||||
//F7(STD, D2Common,10749,10749,10749,00000,00000,00000,00000, void, D2GetWidthHeight, (Unit* ptItem, BYTE* Width, BYTE* Height);
|
||||
//F7(STD, D2Common,10751,10751,10751,00000,00000,00000,00000, DWORD, D2GetItemType, (Unit* ptUnit));
|
||||
//F7(STD, D2Common,10757,10757,10757,00000,00000,00000,00000, DWORD, D2GetItemLevelReq, (Unit* ptChar, Unit* ptItem));
|
||||
F7(STD, D2Common,10619,10619,10619,10687,10877,10321,11032, int*, D2GetNbRunesBIN, ());//return the point on th number
|
||||
F7(STD, D2Common,10620,10620,10620,10775,10296,10622,10006, RunesBIN*, D2GetRunesBIN, (int runesID));
|
||||
//F7(STD, D2Common,10792,10792,10792,00000,00000,00000,00000, DWORD, D2CanBeRare, (Unit* ptItem));
|
||||
//F7(STD, D2Common,10810,10810,10810,00000,00000,00000,00000, BYTE, D2CheckHasInv, (Unit* ptItem));
|
||||
//F7(STD, D2Common,10813,10813,10813,00000,00000,00000,00000, DWORD, D2GetStaffMods, (Unit* ptItem));
|
||||
//F7(STD, D2Common,10816,10816,10816,10816,11085,00000,00000, DWORD, D2GetNbSocket, (Unit* ptItem));
|
||||
//F7(STD, D2Common,10840,10840,10840,00000,00000,00000,00000, DWORD, D2Common10840, (Unit* ptItem, Unit* ptChar));
|
||||
//F7(STD, D2Common,10855,10855,10855,00000,00000,00000,00000, void, D2AddAffix, (DWORD, DWORD, Unit* ptItem, AffixBIN* ptAffix, DWORD, DWORD));
|
||||
//F7(STD, D2Common,10872,10872,10872,00000,00000,00000,00000, DWORD, D2WarpPlayer, (Path* ptPath, Unit* ptChar, Room* ptRoom, DWORD x, DWORD y));
|
||||
//F7(STD, D2Common,10875,10875,10875,00000,00000,00000,00000, WORD, D2GetItemVersion, (Unit* ptItem));
|
||||
F7(STD, D2Common,11163,11163,11163,10880,11068,10436,11107, DWORD, D2isEtheral, (Unit* ptItem));//ONLY UNTIL 1.10
|
||||
F7(STD, D2Common,10881,10881,10881,10956,11156,10218,10987, DWORD, D2SaveItem, (Unit* ptItem, saveBitField* data, DWORD startSize, DWORD p4, DWORD p5, DWORD p6));
|
||||
//F7(STD, D2Common,10916,10916,10916,00000,00000,00000,00000, void, DoNothing916, ());
|
||||
//F7(STD, D2Common,10940,10940,10940,10027,10105,10953,00000, void, D2Common10027, (Unit* ptChar, DWORD skillID));
|
||||
//F7(STD, D2Common,10950,10950,10950,00000,00000,00000,00000, SkillData*, D2GetSkillPointer, (Unit* ptChar, WORD SkillID));
|
||||
//F7(STD, D2Common,10952,10952,10952,10950,10256,10858,00000, SkillData*, D2IncSkillBaseLevel, (Unit* ptChar, DWORD skillID));
|
||||
F7(STD, D2Common,10953,10953,10953,10099,10255,10210,10302, void, D2SetSkillBaseLevel,(Unit* ptChar, DWORD skillID, DWORD slvl, DWORD bRemove, char*, DWORD));
|
||||
//F7(STD, D2Common,10963,10963,10963,00000,00000,00000,00000, DWORD, D2GetSkillID, (SkillData* ptSkill, const char* file, DWORD line));
|
||||
//F7(FAST, D2Common,10966,10966,10966,00000,00000,00000,00000, SkillsBIN*, D2GetSkillsBIN, (SkillData* ptSkill));
|
||||
F7(STD, D2Common,10968,10968,10968,10700,10109,10904,10306, DWORD, D2GetSkillLevel, (Unit* ptChar, SkillData* ptSkill, DWORD includingBonus));
|
||||
//F7(STD, D2Common,11023,11023,11023,00000,00000,00000,00000, DWORD, D2GetCriticalStrikeFromMasteries, (Unit* ptChar, Unit* ptItem, DWORD zero, DWORD two));
|
||||
//F7(STD, D2Common,11007,11007,11007,00000,00000,00000,00000, bool, D2TestQuestState, (void* ptQuest, DWORD QuestID, DWORD QuestState));
|
||||
//F7(STD, D2Common,11041,11041,11041,00000,00000,00000,00000, int, D2GetPlayerSkillID, (DWORD playerID, DWORD skillNumber));
|
||||
//F7(STD, D2Common,11042,11042,11042,00000,00000,00000,00000, int, D2GetNbSkillsPerPlayer, (DWORD playerID));
|
||||
//F7(STD, D2Common,11269,11269,11269,00000,00000,00000,00000, DWORD, D2GetAllIndexFromStat, (Stats* ptStats, DWORD statID, D2Stat* allIndex, DWORD maxIndex));
|
||||
//F7(STD, D2Common,11270,11270,11270,00000,00000,00000,00000, DWORD, D2GetAllIndexFromStatID, (Unit* ptItem, DWORD statID, D2Stat* allIndex, DWORD));
|
||||
F7(STD, D2Common,11276,11276,11276,10254,10074,10111,10435, DWORD, D2GetSkillCost, (Unit* ptChar, int skpoints, DWORD skillID, DWORD curSkillLevel));//not 10447
|
||||
A7(FAST, D2Common,00000,00000,82C80, 15D0, 1800, 1220, 12D0, CharStatsBIN*, D2GetCharStatsBIN, (DWORD charID));
|
||||
A7(FAST, D2Common,00000,00000,12410,5D7D0,1A100,116C0,1C020, DWORD, D2CompileCubeInput, (CubeInput* cubeinput, char* s, DWORD p1, DWORD p2));
|
||||
A7(FAST, D2Common,00000,00000,12910,5D210,19B40,11100,1BA60, DWORD, D2CompileCubeOutput, (CubeOutput* cubeoutput, char* s, DWORD p1, DWORD p2));
|
||||
A7(FAST, D2Common,00000,00000,2B1A0, 11F0, 1380, 1140, 1300, ItemTypesBIN*, D2GetItemTypesBIN, (DWORD itemTypesId));
|
||||
//A7(FAST, D2Common,00000,00000,62FD0,00000,00000,00000,00000, void, D2EncodeValueCheckMax, (saveBitField* data, DWORD value, DWORD bitSize));
|
||||
A7(FAST, D2Common,00000,00000,642B0, 13F0, 12F0, 1540, 17A0, ItemStatCostBIN*,D2GetItemStatCostBIN, (DWORD id));
|
||||
//A7(FAST, D2Common,00000,00000,764A0,00000,00000,00000,00000, void*, D2Common764A0, (Stats* ptStats, DWORD stat, ItemStatCostBIN* itemStatCost ,DWORD));
|
||||
//A7(STD, D2Common,00000,00000,76E30,00000,00000,00000,00000, void, D2PreUpdateDisabledStat, (Stats* ptStats));
|
||||
//A7(FAST, D2Common,00000,00000,76C10,00000,00000,00000,00000, void, D2ApplyStat,(Stats* ptCharStats, DWORD statId, DWORD value, Unit* ptItem));
|
||||
A7(FAST, D2Common,738A4,739B4,84268, 96E0, 98D0, 9900, 9900, void*, D2ReadFile,(DWORD unused, char* filename, DWORD* size, const char*, DWORD));
|
||||
//A7(FAST, D2Common,00000,00000, 94D0,00000,00000,00000,00000, void*, D2GetStringIDForTxtFile,(const char * string));
|
||||
A7(STD, D2Common,1F500,1F510,29FA0,71EB0,32AA0,7D2A0,59870, void, D2LoadSuperuniques,(DWORD mempool));//FASCALL UNTIL 1.10
|
||||
|
||||
//F8(STD, D2Common,00000,00000,00000,00000,10001,00000,00000,00000,00000, DWORD, D2GetActIDFromLevel, (DWORD levelID));
|
||||
F8(STD, D2Common,00000,00000,00000,10188,11084,11109,10346,10907,21AED0, DWORD, D2Common11084, (Room* ptRoom, DWORD zero));
|
||||
F8(STD, D2Common,10057,10057,10057,10332,11021,10511,10826,10691,21A1B0, DWORD, D2GetLevelID, (Room* ptRoom));
|
||||
F8(STD, D2Common,10138,10138,10138,10623,10491,11043,10654,10716,24E810, Room*, D2GetDropRoom, (Room* ptRoom, Position*, Position*, DWORD, DWORD, DWORD, DWORD));
|
||||
//F8(STD, D2Common,10149,10149,10149,00000,00000,00000,00000,00000,00000, Inventory*, D2GetInventory, (Unit* ptUnit));
|
||||
F8(STD, D2Common,10242,10242,10242,00000,00000,00000,00000,00000,00000, Unit*, D2Common10242, (Inventory* ptInventory, Unit* ptItem, DWORD bIsClient));
|
||||
F8(STD, D2Common,10246,10246,10246,10855,10813,10289,10133,10402,23B950, Unit*, D2CanPutItemInInv, (Inventory* ptInventory, Unit* ptItem, DWORD p3, DWORD zero, Unit* ptUnit, const char* file, DWORD line));
|
||||
F8(STD, D2Common,10243,10243,10243,10461,10827,10936,10646,10490,23AD90, Unit*, D2InvRemoveItem, (Inventory* ptInventory, Unit* ptItem));
|
||||
F8(STD, D2Common,10249,10249,10249,10880,11068,10436,11107,10963,23BCC0, DWORD, D2InvAddItem, (Inventory* ptInventory, Unit* ptItem, DWORD posX, DWORD posY, DWORD vValueC, DWORD bIsClient, BYTE page));//result : boolean 0=echec ; vValueC = 0 for Game.dll, 1 for Clientdll
|
||||
F8(STD, D2Common,10250,10250,10250,00000,00000,00000,00000,00000,00000, DWORD, D2Common10250, (const char* file, DWORD line, Inventory* ptInventory, DWORD posX, DWORD posY, DWORD vValueC, DWORD bIsClient, BYTE page));// result : boolean 0=echec ; vValueC = 0 for Game.dll, 1 for Clientdll
|
||||
//F8(STD, D2Common,10257,10257,10257,00000,00000,00000,00000,00000,00000, Unit*, D2GetItemFromBodyLoc, (Inventory* ptInventory, DWORD bodyloc));
|
||||
F8(STD, D2Common,10273,10273,10273,00000,00000,00000,00000,00000,00000, DWORD, D2Common10273, (Inventory* ptInventory, void* unknown));
|
||||
F8(STD, D2Common,10277,10277,10277,10402,10535,11151,10460,11040,23B2C0, Unit*, D2InventoryGetFirstItem, (Inventory* ptInventory));
|
||||
F8(STD, D2Common,10304,10304,10304,10934,11140,10770,10464,10879,23DFA0, Unit*, D2UnitGetNextItem, (Unit* ptItem));
|
||||
F8(STD, D2Common,10305,10305,10305,11095,10748,10852,11147,10897,23DFD0, Unit*, D2GetRealItem, (Unit* ptUnit));
|
||||
//F8(STD, D2Common,10321,10321,10321,00000,00000,00000,00000,00000,00000, SkillData*, D2GetLeftSkill, (Unit* ptChar));
|
||||
//F8(STD, D2Common,10322,10322,10322,00000,00000,00000,00000,00000,00000, SkillData*, D2GetRightSkill, (Unit* ptChar));
|
||||
F8(STD, D2Common,10326,10326,00000,00000,00000,00000,00000,00000,00000, DWORD, D2GetPosX, (Unit* ptUnit));//NOT IN 1.10
|
||||
//F8(STD, D2Common,10328,10328,10328,00000,00000,00000,00000,00000,00000, void, D2SetPosX, (Unit* ptUnit, DWORD pos));
|
||||
F8(STD, D2Common,10329,10329,00000,00000,00000,00000,00000,00000,00000, DWORD, D2GetPosY, (Unit* ptUnit));//NOT IN 1.10
|
||||
//F8(STD, D2Common,10331,10331,10331,00000,00000,00000,00000,00000,00000, void, D2SetPosY, (Unit* ptUnit, DWORD pos));
|
||||
F8(STD, D2Common,10332,10332,10332,11080,10056,10543,10141,11166,220870, void, D2GetPosition, (Unit* ptUnit, Position* pos));
|
||||
F8(STD, D2Common,10339,10339,10339,10455,10864,10941,11060,11025,223460, DWORD, D2GetMaxGoldBank, (Unit* ptUnit));
|
||||
F8(STD, D2Common,10342,10342,10342,10172,10933,10366,10331,10846,220BB0, Room*, D2GetRoom, (Unit* ptUnit));
|
||||
//F8(STD, D2Common,10348,10348,10348,00000,00000,00000,00000,00000,00000, void, D2SetUnitMode, (Unit* ptUnit, DWORD mode));
|
||||
//F8(STD, D2Common,10394,10394,10394,00000,00000,00000,00000,00000,00000, ObjectsBIN*,D2GetObjectsBIN, (Unit* ptObject));
|
||||
F8(STD, D2Common,10420,10420,10420,10218,10079,11097,10356,10404,221F90, PlayerData*,D2InitPlayerData, (Unit* ptChar));
|
||||
//F8(STD, D2Common,10421,10421,10421,10914,10329,00000,00000,00000,00000, DWORD, D2FreePlayerData, (DWORD game1C, Unit* ptChar));
|
||||
F8(STD, D2Common,10424,10424,10424,10562,10800,10860,10920,11103,2221A0, PlayerData*,D2GetPlayerData, (Unit* ptChar));
|
||||
F8(STD, D2Common,10431,10431,10431,00000,00000,00000,00000,00000,00000, DWORD, D2GetDefence, (Unit* ptChar));
|
||||
F8(STD, D2Common,10433,10433,10433,00000,00000,00000,00000,00000,00000, DWORD, D2GetChanceToBlock, (Unit* ptChar, DWORD isLODGame));
|
||||
F8(STD, D2Common,10439,10439,10439,10343,11131,10729,10049,11159,222E70, DWORD, D2GetMaxGold, (Unit* ptUnit));
|
||||
F8(STD, D2Common,00000,00000,00000,10440,10572,10481,11090,10193,224690, DWORD, D2Common10572, (Unit* ptObject, DWORD value));
|
||||
//F8(STD, D2Common,10463,10463,10463,00000,00000,00000,00000,00000,00000, DWORD, D2SetStatWithNoTest, ( Stats* ptStats, DWORD statID, DWORD statValue, DWORD statIndex));
|
||||
//F8(STD, D2Common,10464,10464,10464,00000,00000,00000,00000,00000,00000, void, D2AddStat, (Stats* ptStats, DWORD statID, DWORD statValue, DWORD statIndex));
|
||||
//F8(STD, D2Common,10465,10465,10465,00000,00000,00000,00000,00000,00000, DWORD, D2SetStat, (Stats* ptStats, DWORD statID, DWORD statValue, DWORD statIndex));
|
||||
//F8(STD, D2Common,10466,10466,10466,00000,00000,00000,00000,00000,00000, int, D2GetStat, (Stats* ptStats, DWORD statID, DWORD statIndex));
|
||||
//F8(STD, D2Common,10470,10470,10470,00000,00000,00000,00000,00000,00000, Stats*, D2AllocNewStats, (DWORD nUnitId, DWORD flags, DWORD uk18, DWORD nUnitType, DWORD nItemNum));
|
||||
F8(STD, D2Common,00000,00000,00000,10471,11160,10866,10258,10040,2222C0, BYTE, D2GetObjectFlags, (Unit* ptObject));
|
||||
F8(STD, D2Common,00000,00000,00000,10572,11048,10150,10111,10033,222300, void, D2SetObjectFlags, (Unit* ptObject, BYTE flags));
|
||||
//F8(STD, D2Common,10471,10471,10471,00000,00000,00000,00000,00000,00000, DWORD, D2Common10471, (void*));
|
||||
//F8(STD, D2Common,10472,10472,10472,00000,00000,00000,00000,00000,00000, DWORD, D2Common10472, (void*));
|
||||
//F8(STD, D2Common,10475,10475,10475,00000,00000,00000,00000,00000,00000, void, D2UpdateDisabledStat, (Stats* ptCharStats, Stats* ptStats, DWORD one));
|
||||
//F8(STD, D2Common,10481,10481,10481,00000,00000,00000,00000,00000,00000, void*, D2Common10481, (Unit* ptUnit, DWORD flags));
|
||||
//F8(STD, D2Common,10484,10484,10484,00000,00000,00000,00000,00000,00000, Stats*, D2GetAffixStats, (Unit* ptItem, DWORD, DWORD));
|
||||
//F8(STD, D2Common,10485,10485,10485,00000,00000,00000,00000,00000,00000, void, D2FreeStats, (Stats* ptStats));
|
||||
F8(STD, D2Common,10487,10487,10487,00000,00000,00000,00000,00000,00000, DWORD, D2isInState, (Unit* ptChar, DWORD isLODGame));
|
||||
//F8(STD, D2Common,10517,10517,10517,00000,00000,00000,00000,00000,00000, void, D2SetPlayerStat, (Unit* ptChar, DWORD statID, int amount, DWORD index));
|
||||
F8(STD, D2Common,10518,10518,10518,10109,10627,10762,10551,10645,2272B0, void, D2AddPlayerStat, (Unit* ptChar, DWORD statID, int amount, DWORD index));//ONLY 1.11b
|
||||
F8(STD, D2Common,10519,10519,10519,11092,10061,10658,10973,10550,225480, int, D2GetPlayerStat, (Unit* ptChar, DWORD statID, DWORD index));//ONLY 1.11b
|
||||
//F8(STD, D2Common,10520,10520,10520,00000,00000,00000,00000,00000,00000, int, D2GetPlayerStat20, (Unit* ptChar, DWORD statID, DWORD index));
|
||||
F8(STD, D2Common,10521,10521,10521,10733,10550,10494,10587,10216,2253B0, int, D2GetPlayerBaseStat, (Unit* ptChar, DWORD statID, DWORD index));//ONLY 1.11b
|
||||
//F8(STD, D2Common,10527,10527,10527,00000,00000,00000,00000,00000,00000, DWORD, D2Common10527, (Unit* ptUnit));
|
||||
F8(STD, D2Common,10539,10539,10539,00000,00000,00000,00000,00000,00000, DWORD, D2haveDefenceBonus, (Unit* ptChar));
|
||||
F8(STD, D2Common,10540,10540,10540,00000,00000,00000,00000,00000,00000, DWORD, D2haveFireResBonus, (Unit* ptChar));
|
||||
F8(STD, D2Common,10541,10541,10541,00000,00000,00000,00000,00000,00000, DWORD, D2haveColdResBonus, (Unit* ptChar));
|
||||
F8(STD, D2Common,10542,10542,10542,00000,00000,00000,00000,00000,00000, DWORD, D2haveLightResBonus, (Unit* ptChar));
|
||||
F8(STD, D2Common,10543,10543,10543,00000,00000,00000,00000,00000,00000, DWORD, D2havePoisonResBonus, (Unit* ptChar));
|
||||
F8(STD, D2Common,10546,10546,10546,00000,00000,00000,00000,00000,00000, DWORD, D2haveDefenceMalus, (Unit* ptChar));
|
||||
F8(STD, D2Common,10547,10547,10547,00000,00000,00000,00000,00000,00000, DWORD, D2haveFireResMalus, (Unit* ptChar));
|
||||
F8(STD, D2Common,10548,10548,10548,00000,00000,00000,00000,00000,00000, DWORD, D2haveColdResMalus, (Unit* ptChar));
|
||||
F8(STD, D2Common,10549,10549,10549,00000,00000,00000,00000,00000,00000, DWORD, D2haveLightResMalus, (Unit* ptChar));
|
||||
F8(STD, D2Common,10550,10550,10550,00000,00000,00000,00000,00000,00000, DWORD, D2havePoisonResMalus, (Unit* ptChar));
|
||||
//F8(STD, D2Common,10552,10552,10552,00000,00000,00000,00000,00000,00000, DWORD, D2Common10552, (Unit* ptUnit));
|
||||
//F8(STD, D2Common,10567,10567,10567,00000,00000,00000,00000,00000,00000, DWORD, D2CanBeBroken, (Unit* ptItem));
|
||||
//F8(STD, D2Common,10573,10573,10573,00000,00000,00000,00000,00000,00000, void, D2CopyStats, (Stats* ptDestStats, Stats* ptSrcStats));
|
||||
//F8(STD, D2Common,10574,10574,10574,00000,00000,00000,00000,00000,00000, void*, D2SetEnabledStat, (Unit* ptItem, DWORD statId, DWORD disabled));
|
||||
//F8(STD, D2Common,10575,10575,10575,00000,00000,00000,00000,00000,00000, void, D2FreeBinFiles, ());
|
||||
//F8(STD, D2Common,10576,10576,10576,00000,00000,00000,00000,00000,00000, void, D2LoadBinFiles, (DWORD zero1, DWORD zero2, bool));
|
||||
//F8(STD, D2Common,00000,00000,00000,10651,10651,00000,00000,00000,00000, DWORD, D2CheckQuestState, (void* ptQuest, DWORD index, DWORD value));
|
||||
F8(STD, D2Common,10578,10578,10578,10653,10496,10244,10849,10037,2122F0, void*, D2CompileTxtFile, (DWORD unused, const char* filename, BINField* ptFields, DWORD* ptRecordCount, DWORD recordLength));
|
||||
F8(STD, D2Common,10600,10600,10600,10573,10262,10887,10695,10994,2335F0, ItemsBIN*, D2GetItemsBIN, (DWORD itemID));
|
||||
//F8(STD, D2Common,10601,10601,10601,00000,00000,00000,00000,00000,00000, ItemsBIN*, D2GetByCodeItemStatsBIN, (DWORD code, DWORD* itemID));
|
||||
//F8(STD, D2Common,10604,10604,10604,00000,00000,00000,00000,00000,00000, AffixBIN*, D2GetAffixBIN, (int affixID));
|
||||
F8(STD, D2Common,10616,10616,10616,10500,10523,10774,10806,10619,2372C0, GemsBIN*, D2GetGemsBIN, (DWORD gemID));
|
||||
F8(STD, D2Common,11232,11232,11232,10746,10258,10913,10783,10393,26A1B0, CubeMainBIN*,D2GetCubeMainBIN, (DWORD cubemainID));
|
||||
F8(STD, D2Common,11233,11233,11233,10639,11135,10390,10675,10235,26A200, int, D2GetNbCubeMainBIN, ());
|
||||
//F8(STD, D2Common,10737,10737,10737,00000,00000,00000,00000,00000,00000, LevelsBIN*, D2GetLevelsBIN, (DWORD levelID));
|
||||
F8(STD, D2Common,10628,10628,10628,00000,00000,00000,00000,00000,00000, DWORD, D2GetNextLevelXP, (DWORD classID, DWORD level));
|
||||
F8(STD, D2Common,10629,10629,10629,00000,00000,00000,00000,00000,00000, DWORD, D2GetMaxLevel, (DWORD classID));
|
||||
F8(STD, D2Common,10655,10655,10655,10655,10309,10297,10218,10694,111D30, DifficultyLevelsBIN*, D2GetDifficultyLevelsBIN, (DWORD difficultyLevel));
|
||||
//F8(STD, D2Common,10659,10659,10659,00000,00000,00000,00000,00000,00000, TreasureClassBIN*, D2GetTreasureClassBIN, (WORD id, DWORD uk));
|
||||
//F8(STD, D2Common,10668,10668,10668,10450,10953,00000,00000,00000,00000, SuperUniqueBIN*, D2GetSuperUniqueBIN, (WORD id));
|
||||
F8(STD, D2Common,10695,10695,10695,10927,10899,10276,10106,10911,227E70, DWORD, D2GetItemQuality, (Unit* ptItem));
|
||||
F8(STD, D2Common,10707,10707,10707,10911,10303,10989,10202,10458,2280A0, DWORD, D2TestFlags, (Unit* ptUnit, DWORD flags, DWORD line, const char* file));
|
||||
//F8(STD, D2Common,10708,10708,10708,00000,00000,00000,00000,00000,00000, void, D2SetFlags, (Unit* ptUnit, DWORD flags, DWORD bitNewValue));
|
||||
//F8(STD, D2Common,10709,10709,10709,00000,00000,00000,00000,00000,00000, DWORD, D2GetFlags, (Unit* ptUnit));
|
||||
//F8(STD, D2Common,10711,10711,10711,00000,00000,00000,00000,00000,00000, void, D2ItemSetFlags, (Unit* ptItem, DWORD flags, DWORD toSet));// toSet = 0 for set to 0 the selected flags else set to 1
|
||||
F8(STD, D2Common,10717,10717,10717,10898,10100,10410,10086,10008,2281E0, DWORD, D2GetItemLevel, (Unit* ptItem));
|
||||
F8(STD, D2Common,10719,10719,10719,10820,10505,10370,10020,10810,228250, BYTE, D2ItemGetPage, (Unit* ptUnit));
|
||||
F8(STD, D2Common,10720,10720,10720,10485,10608,10223,10012,11026,228280, void, D2ItemSetPage, (Unit* ptItem, BYTE page));
|
||||
F8(STD, D2Common,10731,10731,10731,11017,10890,10231,10744,10601,229BB0, DWORD, D2CheckItemType, (Unit* ptItem, DWORD itype));
|
||||
F8(STD, D2Common,10732,10732,10732,10692,10685,10280,10620,10075,229DA0, int, D2GetUniqueID, (Unit* ptItem));
|
||||
F8(STD, D2Common,10734,10734,10734,00000,00000,00000,00000,00000,00000, void, D2SetAnim, (Unit* ptUnit, int anim));
|
||||
//F8(STD, D2Common,10749,10749,10749,00000,00000,00000,00000,00000,00000, void, D2GetWidthHeight, (Unit* ptItem, BYTE* Width, BYTE* Height);
|
||||
//F8(STD, D2Common,10751,10751,10751,00000,00000,00000,00000,00000,00000, DWORD, D2GetItemType, (Unit* ptUnit));
|
||||
//F8(STD, D2Common,10757,10757,10757,00000,00000,00000,00000,00000,00000, DWORD, D2GetItemLevelReq, (Unit* ptChar, Unit* ptItem));
|
||||
F8(STD, D2Common,10619,10619,10619,10687,10877,10321,11032,10981,239CB0, int*, D2GetNbRunesBIN, ());//return the point on th number
|
||||
F8(STD, D2Common,10620,10620,10620,10775,10296,10622,10006,10405,239D60, RunesBIN*, D2GetRunesBIN, (int runesID));
|
||||
//F8(STD, D2Common,10792,10792,10792,00000,00000,00000,00000,00000,00000, DWORD, D2CanBeRare, (Unit* ptItem));
|
||||
//F8(STD, D2Common,10810,10810,10810,00000,00000,00000,00000,00000,00000, BYTE, D2CheckHasInv, (Unit* ptItem));
|
||||
//F8(STD, D2Common,10813,10813,10813,00000,00000,00000,00000,00000,00000, DWORD, D2GetStaffMods, (Unit* ptItem));
|
||||
//F8(STD, D2Common,10816,10816,10816,10816,11085,00000,00000,00000,00000, DWORD, D2GetNbSocket, (Unit* ptItem));
|
||||
//F8(STD, D2Common,10840,10840,10840,00000,00000,00000,00000,00000,00000, DWORD, D2Common10840, (Unit* ptItem, Unit* ptChar));
|
||||
//F8(STD, D2Common,10855,10855,10855,00000,00000,00000,00000,00000,00000, void, D2AddAffix, (DWORD, DWORD, Unit* ptItem, AffixBIN* ptAffix, DWORD, DWORD));
|
||||
//F8(STD, D2Common,10872,10872,10872,00000,00000,00000,00000,00000,00000, DWORD, D2WarpPlayer, (Path* ptPath, Unit* ptChar, Room* ptRoom, DWORD x, DWORD y));
|
||||
//F8(STD, D2Common,10875,10875,10875,00000,00000,00000,00000,00000,00000, WORD, D2GetItemVersion, (Unit* ptItem));
|
||||
//F8(STD, D2Common,11163,11163,11163,10880,11068,10436,11107,10963,23BCC0, DWORD, D2isEtheral, (Unit* ptItem));//ONLY UNTIL 1.10
|
||||
F8(STD, D2Common,10881,10881,10881,10956,11156,10218,10987,10665,2313E0, DWORD, D2SaveItem, (Unit* ptItem, saveBitField* data, DWORD startSize, DWORD p4, DWORD p5, DWORD p6));
|
||||
//F8(STD, D2Common,10916,10916,10916,00000,00000,00000,00000,00000,00000, void, DoNothing916, ());
|
||||
//F8(STD, D2Common,10940,10940,10940,10027,10105,10953,00000,00000,00000, void, D2Common10027, (Unit* ptChar, DWORD skillID));
|
||||
//F8(STD, D2Common,10950,10950,10950,00000,00000,00000,00000,00000,00000, SkillData*, D2GetSkillPointer, (Unit* ptChar, WORD SkillID));
|
||||
//F8(STD, D2Common,10952,10952,10952,10950,10256,10858,00000,00000,00000, SkillData*, D2IncSkillBaseLevel, (Unit* ptChar, DWORD skillID));
|
||||
F8(STD, D2Common,10953,10953,10953,10099,10255,10210,10302,10335,247280, void, D2SetSkillBaseLevel,(Unit* ptChar, DWORD skillID, DWORD slvl, DWORD bRemove, char*, DWORD));
|
||||
//F8(STD, D2Common,10963,10963,10963,00000,00000,00000,00000,00000,00000, DWORD, D2GetSkillID, (SkillData* ptSkill, const char* file, DWORD line));
|
||||
//F8(FAST, D2Common,10966,10966,10966,00000,00000,00000,00000,00000,00000, SkillsBIN*, D2GetSkillsBIN, (SkillData* ptSkill));
|
||||
F8(STD, D2Common,10968,10968,10968,10700,10109,10904,10306,10007,2442A0, DWORD, D2GetSkillLevel, (Unit* ptChar, SkillData* ptSkill, DWORD includingBonus));
|
||||
//F8(STD, D2Common,11023,11023,11023,00000,00000,00000,00000,00000,00000, DWORD, D2GetCriticalStrikeFromMasteries, (Unit* ptChar, Unit* ptItem, DWORD zero, DWORD two));
|
||||
//F8(STD, D2Common,11007,11007,11007,00000,00000,00000,00000,00000,00000, bool, D2TestQuestState, (void* ptQuest, DWORD QuestID, DWORD QuestState));
|
||||
//F8(STD, D2Common,11041,11041,11041,00000,00000,00000,00000,00000,00000, int, D2GetPlayerSkillID, (DWORD playerID, DWORD skillNumber));
|
||||
//F8(STD, D2Common,11042,11042,11042,00000,00000,00000,00000,00000,00000, int, D2GetNbSkillsPerPlayer, (DWORD playerID));
|
||||
//F8(STD, D2Common,11269,11269,11269,00000,00000,00000,00000,00000,00000, DWORD, D2GetAllIndexFromStat, (Stats* ptStats, DWORD statID, D2Stat* allIndex, DWORD maxIndex));
|
||||
//F8(STD, D2Common,11270,11270,11270,00000,00000,00000,00000,00000,00000, DWORD, D2GetAllIndexFromStatID, (Unit* ptItem, DWORD statID, D2Stat* allIndex, DWORD));
|
||||
F8(STD, D2Common,11276,11276,11276,10254,10074,10111,10435,11081,246CA0, DWORD, D2GetSkillCost, (Unit* ptChar, int skpoints, DWORD skillID, DWORD curSkillLevel));//not 10447
|
||||
A8(FAST, D2Common,00000,00000,82C80, 15D0, 1800, 1220, 12D0, 17B0, 833E0, CharStatsBIN*, D2GetCharStatsBIN, (DWORD charID));
|
||||
A8(FAST, D2Common,00000,00000,12410,5D7D0,1A100,116C0,1C020,5B0E0,268600, DWORD, D2CompileCubeInput, (CubeInput* cubeinput, char* s, DWORD p1, DWORD p2));
|
||||
//A8(FAST, D2Common,00000,00000,12910,5D210,19B40,11100,1BA60,5AB20,268A90, DWORD, D2CompileCubeOutput, (CubeOutput* cubeoutput, char* s, DWORD p1, DWORD p2));
|
||||
A8(FAST, D2Common,00000,00000,2B1A0, 11F0, 1380, 1140, 1300, 1160,155C90, ItemTypesBIN*, D2GetItemTypesBIN, (DWORD itemTypesId));
|
||||
//A8(FAST, D2Common,00000,00000,62FD0,00000,00000,00000,00000,00000,00000, void, D2EncodeValueCheckMax, (saveBitField* data, DWORD value, DWORD bitSize));
|
||||
A8(FAST, D2Common,00000,00000,642B0, 13F0, 12F0, 1540, 17A0, 17E0,5C4F0, ItemStatCostBIN*,D2GetItemStatCostBIN, (DWORD id));
|
||||
//A8(FAST, D2Common,00000,00000,764A0,00000,00000,00000,00000,00000,00000, void*, D2Common764A0, (Stats* ptStats, DWORD stat, ItemStatCostBIN* itemStatCost ,DWORD));
|
||||
//A8(STD, D2Common,00000,00000,76E30,00000,00000,00000,00000,00000,00000, void, D2PreUpdateDisabledStat, (Stats* ptStats));
|
||||
//A8(FAST, D2Common,00000,00000,76C10,00000,00000,00000,00000,00000,00000, void, D2ApplyStat,(Stats* ptCharStats, DWORD statId, DWORD value, Unit* ptItem));
|
||||
A8(FAST, D2Common,738A4,739B4,84268, 96E0, 98D0, 9900, 9900, B5E0,117079, void*, D2ReadFile,(DWORD mempool, char* filename, DWORD* size, const char*, DWORD));
|
||||
//A8(FAST, D2Common,00000,00000, 94D0,00000,00000,00000,00000,00000,00000, void*, D2GetStringIDForTxtFile,(const char * string));
|
||||
A8(STD, D2Common,1F500,1F510,29FA0,71EB0,32AA0,7D2A0,59870,80C40,2552E0, void, D2LoadSuperuniques,(DWORD mempool));//FASCALL UNTIL 1.10
|
||||
A8(STD, D2Common,00000,00000,00000,00000,00000,00000,81EA0,00000,00000, InventoryBIN*, D2GetInventoryBIN, ());
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//D2Client : 6FAA0000
|
||||
@ -307,26 +309,29 @@ A7(STD, D2Common,1F500,1F510,29FA0,71EB0,32AA0,7D2A0,59870, void, D2LoadSuper
|
||||
//E2F(D2Client,5BA90, void, D2ReloadGambleScreen, ());//1.11b
|
||||
//E2F(D2Client,1FEB0, void, D2OpenNPCMenu, (Unit* ptNPC));//1.11b by ESI
|
||||
|
||||
A7(FAST, D2Client, 1000, 1000, 1000,75D00,A9070,BEF70,2B420, void*, D2LoadImage, (const char* filename, DWORD filetype));
|
||||
A7(FAST, D2Client, 1150, 1150, 1140,00000,00000,00000,00000, void, D2FreeImage, (void* image));//6FAA1140
|
||||
A7(FAST, D2Client, D640, D630, DB50,73620,5E4E0,79670,147A0, void, D2SendMsgToAll,(BYTE* data));//1.11 and 1.11b by ESI !!
|
||||
//A7(STD, D2Client,00000,00000,15A80,00000,00000,00000,00000, int, D2GetAvgChanceMonsterWillHitYou, ());//6FAB5A80
|
||||
A7(STD, D2Client,00000,00000,15A80,00000,00000,00000,00000, DWORD, D2GetLastMonsterIDFight, ());//6FAB5A80
|
||||
A7(STD, D2Client,29800,297F0,2FD60,828A0,89320,6B280,BCEA0, void, D2PrintStatsPage, ());
|
||||
//A7(FAST, D2Client,00000,00000,45990,00000,00000,00000,00000, Unit*, D245990, (Inventory*,DWORD idItem);//6FAE5990
|
||||
A7(FAST, D2Client,4BB20,4BB20,521C0,B8CB0,21250,88EA0,54E10, DWORD, D2PrintStat,(Unit* ptItem, Stats* ptStats, DWORD statID, DWORD statIndex, DWORD statValue, LPWSTR lpText));//statID=EAX, lpText=ESI 1.11b
|
||||
A7(FAST, D2Client,85A60,84DE0,80430,9EEB0,62070,8B7A0,BF5F0, LPWSTR, D2SetColorPopup, (LPWSTR popupText, DWORD color));//1.11 and 1.11b BY EDI
|
||||
//A7(FAST, D2Client,00000,00000,869F0,00000,00000,00000,00000, Unit*, D2ClientGetObject, (DWORD itemNum, DWORD type));//6FB269F0
|
||||
A7(FAST, D2Client,B4360,B36E0,B5820,3ACC0,54210,31FA0,88A70, DWORD, D2PlaySound, (DWORD id, DWORD, DWORD, DWORD, DWORD));
|
||||
//A7(FAST, D2Client,B9970,B8CF0,BB0F0,00000,00000,00000,00000, void, D2FillRect,(DWORD x, DWORD y, DWORD Width, DWORD Height, DWORD color, DWORD transTbl));
|
||||
A7(FAST, D2Client,00000,00000,00000,00000,571C0,18450,46150, Unit*, D2GetCurrentNPC, ());
|
||||
A7(FAST, D2Client,00000,00000,00000,73260,5DE40,791A0,143E0, void, D2SendToServerXX,(DWORD size, BYTE * data));//by EBX
|
||||
A7(FAST, D2Client,88940,87CC0,83260,A1F30,65690,8EF00,C2790, void, D2TogglePage, (DWORD a, DWORD b, DWORD c));
|
||||
A7(FAST, D2Client,00000,00000,00000,A6520,710C0,A6640,8CD00, void, D2ClickOnStashButton, (DWORD x, DWORD y));//BY x=ESI y=EDI
|
||||
A7(STD, D2Client,897B0,88B30,84110,9E3B0,621C0,8B8F0,BEAF0, void*, D2LoadBuySelBtn, ());
|
||||
A7(FAST, D2Client,00000,00000,00000,8E480,5BA90,1CC00,4ABE0, void, D2ReloadGambleScreen, ());
|
||||
//A7(FAST, D2Client,00000,00000,00000,00000,1FEB0,5CDD0,00000, void, D2OpenNPCMenu, (Unit* ptNPC));//by ESI
|
||||
|
||||
A8(FAST, D2Client, 1000, 1000, 1000,75D00,A9070,BEF70,2B420,A9480,788B0, void*, D2LoadImage, (const char* filename, DWORD filetype));
|
||||
A8(FAST, D2Client, 1150, 1150, 1140,00000,00000,00000,00000,00000,78A00, void, D2FreeImage, (void* image));//6FAA1140
|
||||
A8(FAST, D2Client, D640, D630, DB50,73620,5E4E0,79670,147A0,B6890,787B0, void, D2SendMsgToAll,(BYTE* data));//1.11 and 1.11b by ESI !!
|
||||
//A8(STD, D2Client,00000,00000,15A80,00000,00000,00000,00000,00000,00000, int, D2GetAvgChanceMonsterWillHitYou, ());//6FAB5A80
|
||||
A8(STD, D2Client,00000,00000,15A80,00000,00000,00000,00000,00000,00000, DWORD, D2GetLastMonsterIDFight, ());//6FAB5A80
|
||||
A8(STD, D2Client,29800,297F0,2FD60,828A0,89320,6B280,BCEA0,BF640,A7D00, void, D2PrintStatsPage, ());
|
||||
//A8(FAST, D2Client,00000,00000,45990,00000,00000,00000,00000,00000,00000, Unit*, D245990, (Inventory*,DWORD idItem);//6FAE5990
|
||||
A8(FAST, D2Client,4BB20,4BB20,521C0,B8CB0,21250,88EA0,54E10,2CE40,E4D80, DWORD, D2PrintStat,(Unit* ptItem, Stats* ptStats, DWORD statID, DWORD statIndex, DWORD statValue, LPWSTR lpText));//statID=EAX, lpText=ESI 1.11b
|
||||
A8(FAST, D2Client,85A60,84DE0,80430,9EEB0,62070,8B7A0,BF5F0,18820,521C0, LPWSTR, D2SetColorPopup, (LPWSTR popupText, DWORD color));//1.11 and 1.11b BY EDI
|
||||
//A8(FAST, D2Client,00000,00000,869F0,00000,00000,00000,00000,00000,00000, Unit*, D2ClientGetObject, (DWORD itemNum, DWORD type));//6FB269F0
|
||||
A8(FAST, D2Client,B4360,B36E0,B5820,3ACC0,54210,31FA0,88A70,26270,B9A00, DWORD, D2PlaySound, (DWORD id, DWORD, DWORD, DWORD, DWORD));
|
||||
//A8(FAST, D2Client,B9970,B8CF0,BB0F0,00000,00000,00000,00000,00000,00000, void, D2FillRect,(DWORD x, DWORD y, DWORD Width, DWORD Height, DWORD color, DWORD transTbl));
|
||||
//A8(FAST, D2Client,00000,00000,00000,00000,571C0,18450,46150,790D0,00000, Unit*, D2GetCurrentNPC, ());
|
||||
A8(FAST, D2Client,00000,00000,00000,73260,5DE40,791A0,143E0,B61F0,78350, void, D2SendToServerXX,(DWORD size, BYTE * data));//by EBX
|
||||
A8(FAST, D2Client,88940,87CC0,83260,A1F30,65690,8EF00,C2790,1C190,55F20, void, D2TogglePage, (DWORD a, DWORD b, DWORD c));
|
||||
A8(FAST, D2Client,00000,00000,00000,A6520,710C0,A6640,8CD00,90C10,89980, void, D2ClickOnStashButton, (DWORD x, DWORD y));//BY x=ESI y=EDI
|
||||
A8(STD, D2Client,897B0,88B30,84110,9E3B0,621C0,8B8F0,BEAF0,18AA0,54600, void*, D2LoadBuySelBtn, ());
|
||||
//A8(FAST, D2Client,00000,00000,00000,8E480,5BA90,1CC00,4ABE0,7DC60,00000, void, D2ReloadGambleScreen, ());
|
||||
//A8(FAST, D2Client,00000,00000,00000,00000,1FEB0,5CDD0,00000,00000,00000, void, D2OpenNPCMenu, (Unit* ptNPC));//by ESI
|
||||
A8(FAST, D2Client,00000,00000,00000,00000,00000,00000,00000,00000,520C0, void*, D2LoadResImage, (const char* filename));
|
||||
A8(FAST, D2Client,00000,00000,00000,00000,00000,00000,00000,00000,96990, void*, D2FreeResImages, ());
|
||||
A8(FAST, D2Client,00000,00000,00000,00000,00000,00000,00000,00000,5C850, void*, D2ReceivePacket, (DWORD a , DWORD b));
|
||||
A8(STD, D2Client,87220,865A0,81B70,A35F0,669F0,90150,C39E0,1D3E0,56EE0, DWORD, D2PrintInterface, (void* unknown));
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//D2Game : 6FC30000
|
||||
@ -348,7 +353,7 @@ A7(FAST, D2Client,00000,00000,00000,8E480,5BA90,1CC00,4ABE0, void, D2ReloadGamb
|
||||
////E2F(D2Game,22C00, WORD, D2GetNewAffix, (Unit* ptItem, DWORD testIfSpawnable, DWORD mustSelectOne, DWORD addToItem, DWORD isPrefix, int affixID, WORD autoAffixGroupID));//6FC52C00
|
||||
////E2F(D2Game,23610, WORD, D2GetRareAffixName, (Unit* ptItem, DWORD wantPrefix));//6FC53610
|
||||
////E2F(D2Game,3AD10, DWORD, D2GetSuperUniqueMonsterID, (Game* ptGame, Unit* ptMonster));//6FC6AD10
|
||||
//E2F(D2Game,EC7E0, DWORD, D2SpawnMonster, (Game* ptGame, Room* ptRoom, DWORD zero1, DWORD x, DWORD y, DWORD minusOne, DWORD superuniqueID, DWORD zero2));//1.11b (wrong param)
|
||||
//E2F(D2Game,EC7E0, DWORD, D2SpawnSuperUnique, (Game* ptGame, Room* ptRoom, DWORD zero1, DWORD x, DWORD y, DWORD minusOne, DWORD superuniqueID, DWORD zero2));//1.11b (wrong param)
|
||||
//E2S(D2Game,235C0, void, D2Game235C0, (Game* ptGame, Room* ptRoom));//1.11/1.11b
|
||||
//E2F(D2Game,4C7B0, Unit*, D2GetSkillItem, (Unit* ptChar));//6FC7C7B0
|
||||
////E2F(D2Game,5A500, DWORD, D2SavePlayer, (Game* ptGame, Unit* ptChar, char* playername, DWORD zero));//6FC8A500
|
||||
@ -359,53 +364,57 @@ A7(FAST, D2Client,00000,00000,00000,8E480,5BA90,1CC00,4ABE0, void, D2ReloadGamb
|
||||
//E2F(D2Game,C09E0, Unit*, D2CreateUnit, (DWORD type, DWORD id, DWORD x, DWORD y, Game* ptGame, Room* ptRoom, DWORD uk1, DWORD uk2, DWORD uk3));//1.11b
|
||||
//E2F(D2Game,34920, void, D2OpenPandPortal, (Game* ptGame, Unit* ptChar));//1.11b
|
||||
//E2F(D2Game,34910, void, D2OpenPandFinalPortal, (Game* ptGame, Unit* ptChar));//1.11b
|
||||
//E2F(D2Game,85AA0, void, D2MephIA, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,D7BD0, void, D2DiabloIA, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,2BC80, void, D2BaalIA, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,D2D70, void, D2UberMephIA, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,7FE60, void, D2UberDiabloIA, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,2A300, void, D2UberBaalIA, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,85AA0, void, D2MephAI, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,D7BD0, void, D2DiabloAI, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,2BC80, void, D2BaalAI, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,D2D70, void, D2UberMephAI, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,7FE60, void, D2UberDiabloAI, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
//E2F(D2Game,2A300, void, D2UberBaalAI, (Game* ptGame, Unit* ptMonster, DWORD*));//1.11b
|
||||
////E2F(D2Game,92420, void, D2ReloadGambleScreenGame, (Unit* ptNPC, Game* ptGame, Unit* ptChar, DWORD, DWORD one));//1.11b
|
||||
//E2S(D2Game,E66D0, void, D2SaveGame, (Game* ptGame));//1.11b
|
||||
|
||||
|
||||
F7(FAST, D2Game,10059,10059,10059,10039,10007,10037,10049, void, D2SetNbPlayers, (DWORD nbPlayers));
|
||||
//A7(FAST, D2Game,00000,00000,01DE0,00000,00000,00000,00000, void*, D2GetClientByClientID, (Game* ptGame, DWORD clientID));//6FC31DE0
|
||||
A7(FAST, D2Game,00000,00000, 6C60,E3DA0,E8210,EB060,49930, void, D2AddClient, (DWORD clientID));//BY EAX
|
||||
A7(STD, D2Game,00000,00000, 94E0,E0520,E49A0,A6360,2AAE0, Game*, D2GetGameByClientID, (DWORD clientID));//6FC394E0
|
||||
A7(FAST, D2Game,00000,00000, B0E0,DF250,E36D0,A5080,29820, void, D2BroadcastFunction, (Game* ptGame, void* fct, void* param));//00DAB0E0
|
||||
A7(FAST, D2Game, C380, C650, C710,41420,A0D50,7D220,8A3E0, DWORD, D2SendPacket, (void* ptNetClient, LPVOID pData, DWORD size));//EAX=ptNetClient [ESP]=pData
|
||||
A7(FAST, D2Game, D650, D920, DB50,44D00,A3F20,802E0,8D5F0, void, D2SetSkillBaseLevelOnClient, (void* ptClient, Unit* ptChar, DWORD skillID, DWORD sLvl, DWORD bRemove));//by EAX,ESI,EBX
|
||||
//A7(FAST, D2Game,00000,00000,0E6F0,00000,00000,00000,00000, void, D2UpdateClientItem, (NetClient* ptNetClient, Unit* ptChar, Unit* ptItem,DWORD,DWORD,DWORD));//6FC3E6F0
|
||||
//A7(FAST, D2Game,00000,00000,10FB0,00000,00000,00000,00000, DWORD, D2UpdateInventory, (Game* ptGame, Unit* ptChar, void* ptNetClient, Inventory* pInventory));//6FC40FB0
|
||||
//A7(FAST, D2Game,00000,00000,110E0,00000,00000,00000,00000, DWORD, D2UpdateItem, (Unit* ptChar, Unit* ptItem, Unit* ptSocketedItem, void* ptNetClient));//6FC410E0
|
||||
A7(STD, D2Game,00000,00000,00000,27230,109F0,AE930,A22E0, DWORD, D2LinkPortal, (Game* ptGame, Unit* ptObject, DWORD levelEndID, DWORD levelStartID));
|
||||
A7(FAST, D2Game,00000,00000,128F0,38D90,43E60,11FF0,D2070, DWORD, D2VerifIfNotCarry1, (Unit* ptItem, ItemsBIN* itemsData, Unit* ptFirstItem));// BY EBX=itemsData EAX=ptFirstItem [ESP]=ptItem
|
||||
//A7(FAST, D2Game,00000,00000,1ED80,00000,00000,00000,00000, Unit*, D2CreateItem, (Game* ptGame, ItemGenerationData* itemGenerationData, DWORD));//6FC4ED80
|
||||
A7(FAST, D2Game,00000,00000,22070, 1090, 1DF0, 11F0, 1280, Room*, D2TestPositionInRoom, (Room* ptRoom, DWORD x, DWORD y));
|
||||
//A7(FAST, D2Game,00000,00000,22410,00000,00000,00000,00000, void, D2AddStaffModAffixes, (Unit* ptItem, ItemGenerationData* itemParam));//6FC52410
|
||||
//A7(FAST, D2Game,00000,00000,22C00,00000,00000,00000,00000, WORD, D2GetNewAffix, (Unit* ptItem, DWORD testIfSpawnable, DWORD mustSelectOne, DWORD addToItem, DWORD isPrefix, int affixID, WORD autoAffixGroupID));//6FC52C00
|
||||
//A7(FAST, D2Game,00000,00000,23610,00000,00000,00000,00000, WORD, D2GetRareAffixName, (Unit* ptItem, DWORD wantPrefix));//6FC53610
|
||||
//A7(FAST, D2Game,00000,00000,3AD10,00000,00000,00000,00000, DWORD, D2GetSuperUniqueMonsterID, (Game* ptGame, Unit* ptMonster));//6FC6AD10
|
||||
A7(FAST, D2Game,00000,00000,3F220,4ABE0,EC7E0,40B90,24950, DWORD, D2SpawnMonster, (Game* ptGame, Room* ptRoom, DWORD zero1, DWORD x, DWORD y, DWORD minusOne, DWORD superuniqueID, DWORD zero2));//wrong param
|
||||
A7(STD, D2Game,00000,00000,00000,D6D10,235C0, D410,200E0, void, D2Game235C0, (Game* ptGame, Room* ptRoom));
|
||||
//A7(FAST, D2Game,00000,00000,4C7B0,00000,00000,00000,00000, Unit*, D2GetSkillItem, (Unit* ptChar));//6FC7C7B0
|
||||
//A7(FAST, D2Game,00000,00000,5A500,00000,00000,00000,00000, DWORD, D2SavePlayer, (Game* ptGame, Unit* ptChar, char* playername, DWORD zero));//6FC8A500
|
||||
A7(FAST, D2Game,4F100,4F500,5B8A0,B9D70,25D50,44950,54810, DWORD, D2LoadInventory, (Game* ptGame, Unit* pChar, saveBitField* pdata, DWORD p2, DWORD maxSize, DWORD p4, DWORD *ptNbBytesRead));//6FC8B8A0
|
||||
A7(FAST, D2Game,7BAE0,7BFD0,8BB00,97620,BEF80,93650,E03A0, Unit*, D2GameGetObject, (Game* ptGame, DWORD type, DWORD itemNum));//6FCBBB00
|
||||
//A7(FAST, D2Game,00000,00000,9F320,501C0,F1C50,F1A50,F3220, Unit*, D2GetOwnerMonster, (Unit* ptMonster));
|
||||
//A7(FAST, D2Game,00000,00000,E08D0,00000,00000,00000,00000, void, D2UpdateSkillDataAfterUnassignment, (Game* ptGame, Unit* ptChar, DWORD skillID));//6FD108D0
|
||||
A7(FAST, D2Game,00000,00000,00000,99760,C09E0,94E70,E1D90, Unit*, D2CreateUnit, (DWORD type, DWORD id, DWORD x, DWORD y, Game* ptGame, Room* ptRoom, DWORD uk1, DWORD uk2, DWORD uk3));
|
||||
A7(FAST, D2Game,00000,00000,00000,9B480,34920,D1AA0,70180, void, D2OpenPandPortal, (Game* ptGame, Unit* ptChar));
|
||||
A7(FAST, D2Game,00000,00000,00000,9B470,34910,D1A90,70170, void, D2OpenPandFinalPortal, (Game* ptGame, Unit* ptChar));
|
||||
A7(FAST, D2Game,00000,00000,00000,84730,85AA0,DBE90,A9610, void, D2MephIA, (Game* ptGame, Unit* ptMonster, DWORD*));
|
||||
A7(FAST, D2Game,00000,00000,00000,75980,D7BD0,CD0F0,85B60, void, D2DiabloIA, (Game* ptGame, Unit* ptMonster, DWORD*));
|
||||
A7(FAST, D2Game,00000,00000,00000,EAB20,2BC80,B3B90,B8610, void, D2BaalIA, (Game* ptGame, Unit* ptMonster, DWORD*));
|
||||
A7(FAST, D2Game,00000,00000,00000,70320,D2D70,C2A90,7B4E0, void, D2UberMephIA, (Game* ptGame, Unit* ptMonster, DWORD*));
|
||||
A7(FAST, D2Game,00000,00000,00000,7F200,7FE60,D6250,A39D0, void, D2UberDiabloIA, (Game* ptGame, Unit* ptMonster, DWORD*));
|
||||
A7(FAST, D2Game,00000,00000,00000,E92B0,2A300,B2210,B6C80, void, D2UberBaalIA, (Game* ptGame, Unit* ptMonster, DWORD*));
|
||||
//A7(FAST, D2Game,00000,00000,00000,00000,92420,00000,00000, void, D2ReloadGambleScreenGame, (Unit* ptNPC, Game* ptGame, Unit* ptChar, DWORD, DWORD one));
|
||||
A7(STD, D2Game,00000,00000, 89C0,E2390,E66D0,A8090,2C830, void, D2SaveGame, (Game* ptGame) );
|
||||
F8(FAST, D2Game,10059,10059,10059,10039,10007,10037,10049,10002,135780, void, D2SetNbPlayers, (DWORD nbPlayers));
|
||||
//A8(FAST, D2Game,00000,00000,01DE0,00000,00000,00000,00000,00000,00000, void*, D2GetClientByClientID, (Game* ptGame, DWORD clientID));//6FC31DE0
|
||||
A8(FAST, D2Game,00000,00000, 6C60,E3DA0,E8210,EB060,49930,E5070,12C550, void, D2AddClient, (DWORD clientID));//BY EAX
|
||||
A8(STD, D2Game,00000,00000, 94E0,E0520,E49A0,A6360,2AAE0,BC700,12E860, Game*, D2GetGameByClientID, (DWORD clientID));//6FC394E0
|
||||
A8(FAST, D2Game,00000,00000, B0E0,DF250,E36D0,A5080,29820,BB510,12DED0, void, D2BroadcastFunction, (Game* ptGame, void* fct, void* param));//00DAB0E0
|
||||
A8(FAST, D2Game, C380, C650, C710,41420,A0D50,7D220,8A3E0,DB780,13B280, DWORD, D2SendPacket, (void* ptNetClient, LPVOID pData, DWORD size));//EAX=ptNetClient [ESP]=pData
|
||||
A8(FAST, D2Game, D650, D920, DB50,44D00,A3F20,802E0,8D5F0,DD4F0,13C4A0, void, D2SetSkillBaseLevelOnClient, (void* ptClient, Unit* ptChar, DWORD skillID, DWORD sLvl, DWORD bRemove));//by EAX,ESI,EBX
|
||||
//A8(FAST, D2Game,00000,00000,0E6F0,00000,00000,00000,00000,00000,00000, void, D2UpdateClientItem, (NetClient* ptNetClient, Unit* ptChar, Unit* ptItem,DWORD,DWORD,DWORD));//6FC3E6F0
|
||||
//A8(FAST, D2Game,00000,00000,10FB0,00000,00000,00000,00000,00000,00000, DWORD, D2UpdateInventory, (Game* ptGame, Unit* ptChar, void* ptNetClient, Inventory* pInventory));//6FC40FB0
|
||||
//A8(FAST, D2Game,00000,00000,110E0,00000,00000,00000,00000,00000,00000, DWORD, D2UpdateItem, (Unit* ptChar, Unit* ptItem, Unit* ptSocketedItem, void* ptNetClient));//6FC410E0
|
||||
A8(STD, D2Game,00000,00000,00000,27230,109F0,AE930,A22E0,15F40,16CF40, DWORD, D2LinkPortal, (Game* ptGame, Unit* ptObject, DWORD levelEndID, DWORD levelStartID));
|
||||
A8(FAST, D2Game,00000,00000,128F0,38D90,43E60,11FF0,D2070,B2F70,15CA40, DWORD, D2VerifIfNotCarry1, (Unit* ptItem, ItemsBIN* itemsData, Unit* ptFirstItem));// BY EBX=itemsData EAX=ptFirstItem [ESP]=ptItem
|
||||
//A8(FAST, D2Game,00000,00000,1ED80,00000,00000,00000,00000,00000,00000, Unit*, D2CreateItem, (Game* ptGame, ItemGenerationData* itemGenerationData, DWORD));//6FC4ED80
|
||||
A8(FAST, D2Game,00000,00000,22070, 1090, 1DF0, 11F0, 1280, 1340,63740, Room*, D2TestPositionInRoom, (Room* ptRoom, DWORD x, DWORD y));
|
||||
//A8(FAST, D2Game,00000,00000,22410,00000,00000,00000,00000,00000,00000, void, D2AddStaffModAffixes, (Unit* ptItem, ItemGenerationData* itemParam));//6FC52410
|
||||
//A8(FAST, D2Game,00000,00000,22C00,00000,00000,00000,00000,00000,00000, WORD, D2GetNewAffix, (Unit* ptItem, DWORD testIfSpawnable, DWORD mustSelectOne, DWORD addToItem, DWORD isPrefix, int affixID, WORD autoAffixGroupID));//6FC52C00
|
||||
//A8(FAST, D2Game,00000,00000,23610,00000,00000,00000,00000,00000,00000, WORD, D2GetRareAffixName, (Unit* ptItem, DWORD wantPrefix));//6FC53610
|
||||
//A8(FAST, D2Game,00000,00000,3AD10,00000,00000,00000,00000,00000,00000, DWORD, D2GetSuperUniqueMonsterID, (Game* ptGame, Unit* ptMonster));//6FC6AD10
|
||||
A8(FAST, D2Game,00000,00000,3F220,4ABE0,EC7E0,40B90,24950,CDE20,1A09E0, DWORD, D2SpawnSuperUnique, (Game* ptGame, Room* ptRoom, DWORD zero1, DWORD x, DWORD y, DWORD minusOne, DWORD superuniqueID, DWORD zero2));//wrong param
|
||||
A8(FAST, D2Game,00000,00000,00000,C80F0,EF870,EFB10,EF650,C8D70,1B2F20, Unit*, D2SpawnMonster, (DWORD id, DWORD mode, Game* ptGame, Room* ptRoom, DWORD x, DWORD y, DWORD one, DWORD zero));
|
||||
A8(STD, D2Game,00000,00000,00000,D6D10,235C0, D410,200E0,59980,142B40, void, D2Game235C0, (Game* ptGame, Room* ptRoom));
|
||||
//A8(FAST, D2Game,00000,00000,4C7B0,00000,00000,00000,00000,00000,00000, Unit*, D2GetSkillItem, (Unit* ptChar));//6FC7C7B0
|
||||
//A8(FAST, D2Game,00000,00000,5A500,00000,00000,00000,00000,00000,00000, DWORD, D2SavePlayer, (Game* ptGame, Unit* ptChar, char* playername, DWORD zero));//6FC8A500
|
||||
A8(FAST, D2Game,4F100,4F500,5B8A0,B9D70,25D50,44950,54810,3A4C0,1335E0, DWORD, D2LoadInventory, (Game* ptGame, Unit* pChar, saveBitField* pdata, DWORD p2, DWORD maxSize, DWORD p4, DWORD *ptNbBytesRead));//6FC8B8A0
|
||||
A8(FAST, D2Game,7BAE0,7BFD0,8BB00,97620,BEF80,93650,E03A0,6DC40,152F60, Unit*, D2GameGetObject, (Game* ptGame, DWORD type, DWORD itemNum));//6FCBBB00
|
||||
//A8(FAST, D2Game,00000,00000,9F320,501C0,F1C50,F1A50,F3220,00000,00000, Unit*, D2GetOwnerMonster, (Unit* ptMonster));
|
||||
//A8(FAST, D2Game,00000,00000,E08D0,00000,00000,00000,00000,00000,00000, void, D2UpdateSkillDataAfterUnassignment, (Game* ptGame, Unit* ptChar, DWORD skillID));//6FD108D0
|
||||
A8(FAST, D2Game,00000,00000,00000,99760,C09E0,94E70,E1D90,6FE10,155230, Unit*, D2CreateUnit, (DWORD type, DWORD id, DWORD x, DWORD y, Game* ptGame, Room* ptRoom, DWORD uk1, DWORD uk2, DWORD uk3));
|
||||
A8(FAST, D2Game,00000,00000,00000,9B480,34920,D1AA0,70180,941E0,165A90, void, D2OpenPandPortal, (Game* ptGame, Unit* ptChar));
|
||||
A8(FAST, D2Game,00000,00000,00000,9B470,34910,D1A90,70170,941D0,165AA0, void, D2OpenPandFinalPortal, (Game* ptGame, Unit* ptChar));
|
||||
A8(FAST, D2Game,00000,00000,00000,75980,D7BD0,CD0F0,85B60,4EAD0,1F78B0, void, D2MephAI, (Game* ptGame, Unit* ptMonster, AIParam* args));
|
||||
A8(FAST, D2Game,00000,00000,00000,84730,85AA0,DBE90,A9610,31920,1E9170, void, D2DiabloAI, (Game* ptGame, Unit* ptMonster, AIParam* args));
|
||||
A8(FAST, D2Game,00000,00000,00000,EAB20,2BC80,B3B90,B8610,C8850,1FCFE0, void, D2BaalAI, (Game* ptGame, Unit* ptMonster, AIParam* args));
|
||||
A8(FAST, D2Game,00000,00000,00000,E92B0,2A300,B2210,B6C80,C6EC0,1FD200, void, D2UberBaalAI, (Game* ptGame, Unit* ptMonster, AIParam* args));
|
||||
A8(FAST, D2Game,00000,00000,00000,70320,D2D70,C2A90,7B4E0,49480,1F81C0, void, D2UberMephAI, (Game* ptGame, Unit* ptMonster, AIParam* args));
|
||||
A8(FAST, D2Game,00000,00000,00000,7F200,7FE60,D6250,A39D0,2C3F0,1E9DF0, void, D2UberDiabloAI, (Game* ptGame, Unit* ptMonster, AIParam* args));
|
||||
//A8(FAST, D2Game,00000,00000,00000,00000,92420,00000,00000,00000,179430, void, D2ReloadGambleScreenGame, (Unit* ptNPC, Game* ptGame, Unit* ptChar, DWORD, DWORD one));
|
||||
A8(STD, D2Game,00000,00000, 89C0,E2390,E66D0,A8090,2C830,BE660,12CA10, void, D2SaveGame, (Game* ptGame) );
|
||||
A8(FAST, D2Game,00000,00000,00000,EF580,F0F70,F0D70,F2540,F1800,1DEB60, void, D2MonsterMove, (Game* ptGame, Unit* ptMonster, Unit* target, DWORD two, DWORD x, DWORD y, DWORD one, DWORD zero) );
|
||||
A8(FAST, D2Game,00000,00000,00000,FF1B0,F0DB0,F0BB0,F2380,F1430,1DEAD0, void, D2MonsterUseSkill, (Game* ptGame, Unit* ptMonster, DWORD arg, DWORD skill, Unit* target, DWORD x, DWORD y) );
|
||||
A8(FAST, D2Game,00000,00000,00000,B9340,25450,44140,53F10,39810,132240, void, D2SaveSPChar, (Game* ptGame, Unit* ptChar, char* name, DWORD arg, DWORD secondPass) );
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -413,8 +422,8 @@ A7(STD, D2Game,00000,00000, 89C0,E2390,E66D0,A8090,2C830, void, D2SaveGame, (G
|
||||
//D2S(D2Net,10020, DWORD, D2SendToServer, (DWORD size, DWORD one, void* data));//ONLY 1.11b
|
||||
//D2S(D2Net,10018, DWORD, D2SendToClient, (DWORD zero, DWORD clientID, void* data, DWORD size));//ONLY 1.11b
|
||||
|
||||
F7(STD, D2Net, 10005,10005,10005,10035,10020,10036,10024, DWORD, D2SendToServer, (DWORD size, DWORD one, void* data));//(DWORD zero, void* data, DWORD size) for 1.10 and before
|
||||
F7(STD, D2Net, 10006,10006,10006,10018,10018,10015,10002, DWORD, D2SendToClient, (DWORD zero, DWORD clientID, void* data, DWORD size));
|
||||
F8(STD, D2Net, 10005,10005,10005,10035,10020,10036,10024,10015,12AE50, DWORD, D2SendToServer, (DWORD size, DWORD one, void* data));//(DWORD zero, void* data, DWORD size) for 1.10 and before
|
||||
F8(STD, D2Net, 10006,10006,10006,10018,10018,10015,10002,10012,12B330, DWORD, D2SendToClient, (DWORD zero, DWORD clientID, void* data, DWORD size));
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -435,29 +444,29 @@ F7(STD, D2Net, 10006,10006,10006,10018,10018,10015,10002, DWORD, D2SendToClien
|
||||
////D2S(Fog,10127, DWORD, D2GetBitFieldSize, (saveBitField* data));//6FF536C0
|
||||
////D2S(Fog,10128, void, D2EncodeValue, (saveBitField* data, DWORD value, DWORD bitSize));//6FF536C0
|
||||
////D2S(Fog,10130, DWORD, D2DecodeValue, (saveBitField* data,DWORD readingSize));//6FF53840
|
||||
//D2S(Fog,10212, void, D2Fog10212, (DWORD unknow));//1.11b
|
||||
//D2S(Fog,10212, void, D2Fog10212, (DWORD unknown));//1.11b
|
||||
////D2S(Fog,10217, int, D2GetIDFromLookUpTable, (void* table, char* string, bool));//6FF53840
|
||||
//D2S(Fog,10265, int, D2GetInstructionPointer, ());//ONLY 1.11/1.11b NOT 1.10
|
||||
|
||||
F7(STD, Fog, 10023,10023,10023,00000,00000,00000,00000, void, D2FogAssertOld, (const char* ptMessage, DWORD eip, DWORD line));//(STDCALL until 1.10)
|
||||
F7(FAST, Fog, 00000,00000,00000,10024,10024,10024,10024, void, D2FogAssert, (const char* ptMessage, DWORD eip, DWORD line));
|
||||
F7(FAST, Fog, 10042,10042,10042,10042,10042,10042,10042, void*, D2FogMemAlloc, (DWORD dwMemSize, LPCSTR lpszErrFile, DWORD ErrLine, DWORD Zero));
|
||||
F7(FAST, Fog, 10043,10043,10043,10043,10043,10043,10043, void*, D2FogMemDeAlloc, (void* ptMemLoc, LPCSTR lpszErrFile, DWORD ErrLine, DWORD Zero));
|
||||
F7(FAST, Fog, 10045,10045,10045,10045,10045,10045,10045, void*, D2AllocMem, (DWORD,DWORD dwMemSize, LPCSTR lpszErrFile, DWORD ErrLine, DWORD Zero));
|
||||
F7(FAST, Fog, 10046,10046,10046,10046,10046,10046,10046, void*, D2FreeMem, (DWORD,void* ptMemLoc, LPCSTR lpszErrFile, DWORD ErrLine, DWORD Zero));
|
||||
F7(FAST, Fog, 10102,10102,10102,10102,10102,10102,10102, DWORD, D2MPQOpenFile, (char* ptPath, void** buf));
|
||||
F7(FAST, Fog, 10103,10103,10103,10103,10103,10103,10103, DWORD, D2MPQCloseFile, (void* mpqfile));
|
||||
F7(FAST, Fog, 10104,10104,10104,10104,10104,10104,10104, DWORD, D2MPQReadFile, (void* mpqfile, BYTE* buffer, DWORD nbToRead, DWORD* nbRead,DWORD,DWORD,DWORD));
|
||||
F7(FAST, Fog, 10105,10105,10105,10105,10105,10105,10105, DWORD, D2MPQGetSizeFile, (void* mpqfile, DWORD* toReset));
|
||||
F7(FAST, Fog, 10115,10115,10115,10115,10115,10115,10115, void, D2FogGetSavePath, (char* ptPath, DWORD maxsize));
|
||||
F7(FAST, Fog, 10116,10116,10116,10116,10116,10116,10116, void, D2FogGetInstallPath, (char* ptPath, DWORD maxsize));
|
||||
//F7(STD, Fog, 10126,10126,10126,10126,10126,10126,10126, DWORD, D2InitBitField, (saveBitField* data, BYTE* buf, DWORD bufsize));//6FF536C0
|
||||
//F7(STD, Fog, 10127,10127,10127,10127,10127,10127,10127, DWORD, D2GetBitFieldSize, (saveBitField* data));//6FF536C0
|
||||
//F7(STD, Fog, 10128,10128,10128,10128,10128,10128,10128, void, D2EncodeValue, (saveBitField* data, DWORD value, DWORD bitSize));//6FF536C0
|
||||
//F7(STD, Fog, 10130,10130,10130,10130,10130,10130,10130, DWORD, D2DecodeValue, (saveBitField* data,DWORD readingSize));//6FF53840
|
||||
F7(STD, Fog, 10212,10212,10212,10212,10212,10212,10212, void, D2Fog10212, (DWORD unknow));
|
||||
//F7(STD, Fog, 10217,10217,10217,10217,10217,10217,10217, int, D2GetIDFromLookUpTable, (void* table, char* string, bool));//6FF53840
|
||||
F7(STD, Fog, 00000,00000,00000,10265,10265,10265,10265, int, D2GetInstructionPointer, ());
|
||||
F8(STD, Fog, 10023,10023,10023,00000,00000,00000,00000,00000,00000, void, D2FogAssertOld, (const char* ptMessage, DWORD eip, DWORD line));//(STDCALL until 1.10)
|
||||
F8(FAST, Fog, 00000,00000,00000,10024,10024,10024,10024,10024,8A60, void, D2FogAssert, (const char* ptMessage, DWORD eip, DWORD line));
|
||||
F8(FAST, Fog, 10042,10042,10042,10042,10042,10042,10042,10042,B380, void*, D2FogMemAlloc, (DWORD dwMemSize, LPCSTR lpszErrFile, DWORD ErrLine, DWORD Zero));
|
||||
F8(FAST, Fog, 10043,10043,10043,10043,10043,10043,10043,10043,B3C0, void*, D2FogMemDeAlloc, (void* ptMemLoc, LPCSTR lpszErrFile, DWORD ErrLine, DWORD Zero));
|
||||
F8(FAST, Fog, 10045,10045,10045,10045,10045,10045,10045,10045,B430, void*, D2AllocMem, (DWORD,DWORD dwMemSize, LPCSTR lpszErrFile, DWORD ErrLine, DWORD Zero));
|
||||
F8(FAST, Fog, 10046,10046,10046,10046,10046,10046,10046,10046,B480, void*, D2FreeMem, (DWORD,void* ptMemLoc, LPCSTR lpszErrFile, DWORD ErrLine, DWORD Zero));
|
||||
F8(FAST, Fog, 10102,10102,10102,10102,10102,10102,10102,10102,68E0, DWORD, D2MPQOpenFile, (char* ptPath, void** buf));
|
||||
F8(FAST, Fog, 10103,10103,10103,10103,10103,10103,10103,10103,68F0, DWORD, D2MPQCloseFile, (void* mpqfile));
|
||||
F8(FAST, Fog, 10104,10104,10104,10104,10104,10104,10104,10104,6900, DWORD, D2MPQReadFile, (void* mpqfile, BYTE* buffer, DWORD nbToRead, DWORD* nbRead,DWORD,DWORD,DWORD));
|
||||
F8(FAST, Fog, 10105,10105,10105,10105,10105,10105,10105,10105,6930, DWORD, D2MPQGetSizeFile, (void* mpqfile, DWORD* toReset));
|
||||
F8(FAST, Fog, 10115,10115,10115,10115,10115,10115,10115,10115,7050, void, D2FogGetSavePath, (char* ptPath, DWORD maxsize));
|
||||
F8(FAST, Fog, 10116,10116,10116,10116,10116,10116,10116,10116,6BA0, void, D2FogGetInstallPath, (char* ptPath, DWORD maxsize));
|
||||
//F8(STD, Fog, 10126,10126,10126,10126,10126,10126,10126,10126,00000, DWORD, D2InitBitField, (saveBitField* data, BYTE* buf, DWORD bufsize));//6FF536C0
|
||||
//F8(STD, Fog, 10127,10127,10127,10127,10127,10127,10127,10127,00000, DWORD, D2GetBitFieldSize, (saveBitField* data));//6FF536C0
|
||||
//F8(STD, Fog, 10128,10128,10128,10128,10128,10128,10128,10128,00000, void, D2EncodeValue, (saveBitField* data, DWORD value, DWORD bitSize));//6FF536C0
|
||||
//F8(STD, Fog, 10130,10130,10130,10130,10130,10130,10130,10130,00000, DWORD, D2DecodeValue, (saveBitField* data,DWORD readingSize));//6FF53840
|
||||
F8(STD, Fog, 10212,10212,10212,10212,10212,10212,10212,10212,2BD0B0, void, D2Fog10212, (DWORD unknow));
|
||||
//F8(STD, Fog, 10217,10217,10217,10217,10217,10217,10217,10217,00000, int, D2GetIDFromLookUpTable, (void* table, char* string, bool));//6FF53840
|
||||
F8(STD, Fog, 00000,00000,00000,10265,10265,10265,10265,10265,8090, int, D2GetInstructionPointer, ());
|
||||
//Fog10213 getIndexFromLookupTable (&table,code,bool)
|
||||
|
||||
|
||||
@ -476,18 +485,19 @@ F7(STD, Fog, 00000,00000,00000,10265,10265,10265,10265, int, D2GetInstructionP
|
||||
////E2F(D2Lang,2CD0, DWORD, D2unicodenwidth, (char* ptChar, DWORD size));//6FC12CD0_unicodenwidth
|
||||
////E2S(D2Lang,1670, DWORD, D2swprintf, (DWORD bufSize, LPWSTR buf, LPWSTR string, ...));//6FC11670_sprintf
|
||||
|
||||
//F7(FAST, D2Lang, 10003,10003,10003,00000,00000,00000,00000, LPWSTR, D2GetStringFromString, (const char* ptString));//6FC13BC0
|
||||
F7(FAST, D2Lang, 10004,10004,10004,10005,10000,10005,10003, LPWSTR, D2GetStringFromIndex, (WORD dwIndexNum));
|
||||
//F7(STD, D2Lang, 10006,10006,10006,00000,00000,00000,00000, void, D2GetStringLang, (LPSTR ptLang, DWORD Zero));//6FC13FB0
|
||||
F7(STD, D2Lang, 10007,10007,10007,10009,10013,10002,10009, DWORD, D2GetLang, ());
|
||||
F7(STD, D2Lang, 10010,10010,10010,00000,00000,00000,00000, DWORD, D2PrintBigNumber, (LPWSTR ptBuf , DWORD number, DWORD size));//6FC14210
|
||||
//F7(STD, D2Lang, 10013,10013,10013,00000,00000,00000,00000, DWORD, D2GetStringAndIndexFromString, (const char* ptString , LPWSTR result));//6FC13960
|
||||
//A7(FAST, D2Lang, 00000,00000,029B0,00000,00000,00000,00000, DWORD, D2UnicodeWidth, (DWORD MemLoc, WORD Size));//6FC129B0
|
||||
//A7(FAST, D2Lang, 00000,00000,02E60,00000,00000,00000,00000, LPWSTR, D2GetStrFromIndex , (void* ptFile, void* ptMemLoc, DWORD dwIndexNum));//6FC12E60
|
||||
//A7(FAST, D2Lang, 00000,00000,03640,00000,00000,00000,00000, TblHeader*, D2LoadTblFile, (LPCSTR lpszFileName));//6FC13640
|
||||
//A7(FAST, D2Lang, 00000,00000,03A90,00000,00000,00000,00000, WORD, D2GetStrAndIndexFromString, (void* ptFile, void* ptMemLoc, LPSTR String, LPWSTR RetString));//6FC13A90
|
||||
//A7(FAST, D2Lang, 00000,00000,02CD0,00000,00000,00000,00000, DWORD, D2unicodenwidth, (char* ptChar, DWORD size));//6FC12CD0_unicodenwidth
|
||||
//A7(STD, D2Lang, 00000,00000,01670,00000,00000,00000,00000, DWORD, D2swprintf, (DWORD bufSize, LPWSTR buf, LPWSTR string, ...));//6FC11670_sprintf
|
||||
//F8(FAST, D2Lang, 10003,10003,10003,00000,00000,00000,00000,10011,00000, LPWSTR, D2GetStringFromString, (const char* ptString));//6FC13BC0
|
||||
F8(FAST, D2Lang, 10003,10003,10003,10002,10004,10010,10011,10011,124E20, LPWSTR, D2GetStringFromString, (const char* ptString));//6FC13BC0 LAutour
|
||||
F8(FAST, D2Lang, 10004,10004,10004,10005,10000,10005,10003,10004,124A30, LPWSTR, D2GetStringFromIndex, (WORD dwIndexNum));
|
||||
//F8(STD, D2Lang, 10006,10006,10006,00000,00000,00000,00000,00000,00000, void, D2GetStringLang, (LPSTR ptLang, DWORD Zero));//6FC13FB0
|
||||
F8(STD, D2Lang, 10007,10007,10007,10009,10013,10002,10009,10001,125150, DWORD, D2GetLang, ());//14b 00522A20
|
||||
F8(STD, D2Lang, 10010,10010,10010,00000,00000,00000,00000,00000,00000, DWORD, D2PrintBigNumber, (LPWSTR ptBuf , DWORD number, DWORD size));//6FC14210
|
||||
//F8(STD, D2Lang, 10013,10013,10013,00000,00000,00000,00000,10005,00000, DWORD, D2GetStringAndIndexFromString, (const char* ptString , LPWSTR result));//6FC13960
|
||||
//A8(FAST, D2Lang, 00000,00000,029B0,00000,00000,00000,00000,00000,00000, DWORD, D2UnicodeWidth, (DWORD MemLoc, WORD Size));//6FC129B0
|
||||
//A8(FAST, D2Lang, 00000,00000,02E60,00000,00000,00000,00000,00000,00000, LPWSTR, D2GetStrFromIndex , (void* ptFile, void* ptMemLoc, DWORD dwIndexNum));//6FC12E60
|
||||
//A8(FAST, D2Lang, 00000,00000,03640,00000,00000,00000,00000,00000,00000, TblHeader*, D2LoadTblFile, (LPCSTR lpszFileName));//6FC13640
|
||||
//A8(FAST, D2Lang, 00000,00000,03A90,00000,00000,00000,00000,00000,00000, WORD, D2GetStrAndIndexFromString, (void* ptFile, void* ptMemLoc, LPSTR String, LPWSTR RetString));//6FC13A90
|
||||
//A8(FAST, D2Lang, 00000,00000,02CD0,00000,00000,00000,00000,00000,00000, DWORD, D2unicodenwidth, (char* ptChar, DWORD size));//6FC12CD0_unicodenwidth
|
||||
//A8(STD, D2Lang, 00000,00000,01670,00000,00000,00000,00000,00000,00000, DWORD, D2swprintf, (DWORD bufSize, LPWSTR buf, LPWSTR string, ...));//6FC11670_sprintf
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Storm : 6FFB0000
|
||||
@ -496,10 +506,10 @@ F7(STD, D2Lang, 10010,10010,10010,00000,00000,00000,00000, DWORD, D2PrintBigNu
|
||||
//D2S(Storm,503, void, D2Storm503, (DWORD, DWORD, DWORD)); //+1.11
|
||||
//D2S(Storm,511, void, D2FreeWinMessage, (sWinMessage* msg));//1.11/1.11b
|
||||
|
||||
//F7(STD, Storm, 253, 253, 253, 253, 253, 253, 000, void, D2StormMPQCloseFile, (void* mpqfile));
|
||||
F7(STD, Storm, 268, 268, 268, 268, 268, 268, 268, DWORD, D2StormMPQOpenFile, (DWORD zero, LPCSTR fileName, DWORD dwSearchScope, void** buffer))
|
||||
F7(STD, Storm, 503, 503, 503, 503, 503, 503, 503, void, D2Storm503, (DWORD, DWORD, DWORD));
|
||||
F7(STD, Storm, 511, 511, 511, 511, 511, 511, 511, void, D2FreeWinMessage, (sWinMessage* msg));
|
||||
//F8(STD, Storm, 253, 253, 253, 253, 253, 253, 000, 000,00000, void, D2StormMPQCloseFile, (void* mpqfile));
|
||||
F8(STD, Storm, 268, 268, 268, 268, 268, 268, 268, 268, 192F0, DWORD, D2StormMPQOpenFile, (DWORD zero, LPCSTR fileName, DWORD dwSearchScope, void** buffer))
|
||||
F8(STD, Storm, 503, 503, 503, 503, 503, 503, 503, 503, 13750, void, D2Storm503, (DWORD, DWORD, DWORD));
|
||||
F8(STD, Storm, 511, 511, 511, 511, 511, 511, 511, 511, 20290, void, D2FreeWinMessage, (sWinMessage* msg));
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -511,12 +521,12 @@ F7(STD, Storm, 511, 511, 511, 511, 511, 511, 511, void, D2FreeWinMessa
|
||||
//D2S(D2gfx,10000, void, D2FillArea,(DWORD x1, DWORD y1, DWORD x2, DWORD y2, DWORD color, DWORD transTbl));//ONLY 1.11b
|
||||
//D2S(D2gfx,10044, void, D2PrintImage,(sDrawImageInfo* data, DWORD x, DWORD y, DWORD p4, DWORD p5, DWORD p6) );//ONLY 1.11b
|
||||
|
||||
F7(STD, D2gfx, 10005,10005,10005,10000,10063,10043,10031, DWORD, D2GetResolution,() );
|
||||
//F7,STD, D2gfx, 10023,10023,10023,00000,00000,00000,00000, DWORD, D2CreateMainWindow,(DWORD,DWORD) );
|
||||
//F7(STD, D2gfx, 10026,10026,10026,00000,00000,00000,00000, DWORD, D2ShowWindow,() );
|
||||
//F7,STD, D2gfx, 10027,10027,10027,00000,00000,00000,00000, HWND, D2GetWindowHandle,() );//6FA749C0
|
||||
F7(STD, D2gfx, 10055,10055,10055,10028,10000,10062,10014, void, D2FillArea,(DWORD x1, DWORD y1, DWORD x2, DWORD y2, DWORD color, DWORD transTbl));
|
||||
F7(STD, D2gfx, 10072,10072,10072,10047,10044,10024,10041, void, D2PrintImage,(sDrawImageInfo* data, DWORD x, DWORD y, DWORD p4, DWORD p5, DWORD p6) );
|
||||
F8(STD, D2gfx, 10005,10005,10005,10000,10063,10043,10031,10012,F5160, DWORD, D2GetResolution,() );
|
||||
//F8,STD, D2gfx, 10023,10023,10023,00000,00000,00000,00000,00000,00000, DWORD, D2CreateMainWindow,(DWORD,DWORD) );
|
||||
//F8(STD, D2gfx, 10026,10026,10026,00000,00000,00000,00000,00000,00000, DWORD, D2ShowWindow,() );
|
||||
//F8,STD, D2gfx, 10027,10027,10027,00000,00000,00000,00000,00000,00000, HWND, D2GetWindowHandle,() );//6FA749C0
|
||||
F8(STD, D2gfx, 10055,10055,10055,10028,10000,10062,10014,10028,F6300, void, D2FillArea,(DWORD x1, DWORD y1, DWORD x2, DWORD y2, DWORD color, DWORD transTbl));
|
||||
F8(STD, D2gfx, 10072,10072,10072,10047,10044,10024,10041,10042,F6480, void, D2PrintImage,(sDrawImageInfo* data, DWORD x, DWORD y, DWORD p4, DWORD p5, DWORD p6) );
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -530,36 +540,42 @@ F7(STD, D2gfx, 10072,10072,10072,10047,10044,10024,10041, void, D2PrintImage,(
|
||||
//D2F(D2Win,10132, DWORD, D2PrintTextPopup,(LPWSTR s, DWORD x, DWORD y, DWORD uk, DWORD type, DWORD color) );//6F8AB080
|
||||
//D2S(D2Win,10113, void*, D2CreateTextBox,(DWORD* data) );//ONLY 1.11b
|
||||
|
||||
F7(FAST, D2Win, 10046,10046,10046,10061,10075,10015,10022, void, D2PrintLineOnTextBox,(void* screen, char* s, DWORD color) );
|
||||
F7(FAST, D2Win, 10117,10117,10117,10020,10064,10001,10150, void, D2PrintString,(LPWSTR s, DWORD x, DWORD y, DWORD color, DWORD bfalse) );
|
||||
F7(FAST, D2Win, 10121,10121,10121,10034,10128,10132,10028, DWORD, D2GetPixelLen,(LPWSTR s) );
|
||||
F7(FAST, D2Win, 10127,10127,10127,10141,10170,10010,10184, DWORD, D2SetFont,(DWORD fontID) );
|
||||
F7(FAST, D2Win, 10129,10129,10129,10118,10039,10031,10085, void, D2PrintPopup,(LPWSTR s, DWORD x, DWORD y, DWORD color, DWORD center) );
|
||||
F7(FAST, D2Win, 10131,10131,10131,00000,00000,00000,00000, void, D2GetPixelRect,(LPWSTR s, DWORD* x, DWORD* y) );//6F8AB260
|
||||
F7(FAST, D2Win, 10132,10132,10132,00000,00000,00000,00000, DWORD, D2PrintTextPopup,(LPWSTR s, DWORD x, DWORD y, DWORD uk, DWORD type, DWORD color) );//6F8AB080
|
||||
F7(STD, D2Win, 10017,10017,10017,10147,10113,10098,10098, void*, D2CreateTextBox,(DWORD* data) );
|
||||
F8(FAST, D2Win, 10046,10046,10046,10061,10075,10015,10022,10051,FCFF0, void, D2PrintLineOnTextBox,(void* screen, char* s, DWORD color) );
|
||||
F8(FAST, D2Win, 10117,10117,10117,10020,10064,10001,10150,10076,102320, void, D2PrintString,(LPWSTR s, DWORD x, DWORD y, DWORD color, DWORD bfalse) );
|
||||
F8(FAST, D2Win, 10121,10121,10121,10034,10128,10132,10028,10150,101820, DWORD, D2GetPixelLen,(LPWSTR s) );
|
||||
F8(FAST, D2Win, 10127,10127,10127,10141,10170,10010,10184,10047,102EF0, DWORD, D2SetFont,(DWORD fontID) );
|
||||
F8(FAST, D2Win, 10129,10129,10129,10118,10039,10031,10085,10137,102280, void, D2PrintPopup,(LPWSTR s, DWORD x, DWORD y, DWORD color, DWORD center) );
|
||||
F8(FAST, D2Win, 10131,10131,10131,00000,00000,00000,00000,00000,00000, void, D2GetPixelRect,(LPWSTR s, DWORD* x, DWORD* y) );//6F8AB260
|
||||
F8(FAST, D2Win, 10132,10132,10132,00000,00000,00000,00000,00000,00000, DWORD, D2PrintTextPopup,(LPWSTR s, DWORD x, DWORD y, DWORD uk, DWORD type, DWORD color) );//6F8AB080
|
||||
F8(STD, D2Win, 10017,10017,10017,10147,10113,10098,10098,10164,F93C0, void*, D2CreateTextBox,(DWORD* data) );
|
||||
|
||||
// Add a call wrapper for the following:
|
||||
// D2Win.0x6F8AA2A0 (#10121) // int __fastcall D2Win_10121_GetTextWidth(const Unicode* wszText)
|
||||
F8(FAST, D2Win, 10121, 10121, 10121, 10121, 10121, 10121, 10121, 10121, AA2A0, DWORD, D2Win_GetTextWidth, (const wchar_t* wszText));
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//D2CMP : ????0000
|
||||
//D2S(D2CMP,10014, DWORD, D2CMP10014, (void* image) );//ONLY 1.11
|
||||
|
||||
F7(STD, D2CMP, 10032,10032,10032,10021,10014,10106,10065, DWORD, D2CMP10014, (void* image) );
|
||||
F8(STD, D2CMP, 10032,10032,10032,10021,10014,10106,10065,10020,201A50, DWORD, D2CMP10014, (void* image) );
|
||||
|
||||
|
||||
//ONLY UNTIL 1.10 :
|
||||
A7(FAST, D2Client, BA00, B9F0, C080,00000,00000,00000,00000, DWORD, D2isLODGame, ());//6FAAC080
|
||||
A7(FAST, D2Client, 00000,00000, C090,00000,00000,00000,00000, BYTE, D2GetDifficultyLevel, ());//6FAAC090 1.09 should be BA10 (b) BA00 (d)
|
||||
A7(STD, D2Client, B6670,B59F0,B7BC0,00000,00000,00000,00000, DWORD, D2GetMouseX, ());//6FB57BC0
|
||||
A7(STD, D2Client, B6680,B5A00,B7BD0,00000,00000,00000,00000, DWORD, D2GetMouseY, ());//6FB57BD0
|
||||
A7(STD, D2Client, 8DC40,8CFC0,883D0,00000,00000,00000,00000, Unit*, D2GetClientPlayer, ());//6FB283D0
|
||||
A7(FAST, D2Client, B920, B910, BF60,00000,00000,00000,00000, void, D2CleanStatMouseUp, ());//6FAABF60
|
||||
A7(FAST, D2Client, D210, D200, D990,00000,00000,00000,00000, void, D2SendToServer3, (BYTE type, WORD p));//6FAAD990
|
||||
//A7(FAST, D2Client, 00000,00000, DA20,00000,00000,00000,00000, void, D2SendToServer5, (BYTE type, DWORD p));//6FAADA20
|
||||
//A7(FAST, D2Client, 00000,00000, D9E0,00000,00000,00000,00000, void, D2SendToServer7, (BYTE type, WORD p1, WORD p2, WORD p3));//6FAAD9E0
|
||||
//A7(FAST, D2Client, 00000,00000, DA40,00000,00000,00000,00000, void, D2SendToServer9, (BYTE type, DWORD p1, DWORD p2));//6FAADA40
|
||||
//A7(FAST, D2Client, 00000,00000, DA70,00000,00000,00000,00000, void, D2SendToServer13,(BYTE type, DWORD p1, DWORD p2, DWORD p3));//6FAADA70
|
||||
A7(FAST, D2Game, 7C2C0,7C7B0,8C2E0,00000,00000,00000,00000, NetClient*, D2GetClient, (Unit* ptUnit, char* lpszErrFile, DWORD ErrLine));//6FCBC2E0
|
||||
A8(FAST, D2Client, BA00, B9F0, C080,00000,00000,00000,00000,00000,00000, DWORD, D2isLODGame, ());//6FAAC080
|
||||
A8(FAST, D2Client, 00000,00000, C090,00000,00000,00000,00000,00000,00000, BYTE, D2GetDifficultyLevel, ());//6FAAC090 1.09 should be BA10 (b) BA00 (d)
|
||||
A8(STD, D2Client, B6670,B59F0,B7BC0,00000,00000,00000,00000,00000,00000, DWORD, D2GetMouseX, ());//6FB57BC0
|
||||
A8(STD, D2Client, B6680,B5A00,B7BD0,00000,00000,00000,00000,00000,00000, DWORD, D2GetMouseY, ());//6FB57BD0
|
||||
A8(STD, D2Client, 8DC40,8CFC0,883D0,00000,00000,00000,00000,00000,63DD0, Unit*, D2GetClientPlayer, ());//6FB283D0
|
||||
A8(FAST, D2Client, B920, B910, BF60,00000,00000,00000,00000,00000,4DA70, void, D2CleanStatMouseUp, ());//6FAABF60
|
||||
A8(FAST, D2Client, D210, D200, D990,00000,00000,00000,00000,00000,00000, void, D2SendToServer3, (BYTE type, WORD p));//6FAAD990
|
||||
//A8(FAST, D2Client, 00000,00000, DA20,00000,00000,00000,00000,00000,00000, void, D2SendToServer5, (BYTE type, DWORD p));//6FAADA20
|
||||
//A8(FAST, D2Client, 00000,00000, D9E0,00000,00000,00000,00000,00000,00000, void, D2SendToServer7, (BYTE type, WORD p1, WORD p2, WORD p3));//6FAAD9E0
|
||||
//A8(FAST, D2Client, 00000,00000, DA40,00000,00000,00000,00000,00000,00000, void, D2SendToServer9, (BYTE type, DWORD p1, DWORD p2));//6FAADA40
|
||||
//A8(FAST, D2Client, 00000,00000, DA70,00000,00000,00000,00000,00000,00000, void, D2SendToServer13,(BYTE type, DWORD p1, DWORD p2, DWORD p3));//6FAADA70
|
||||
A8(FAST, D2Game, 7C2C0,7C7B0,8C2E0,00000,00000,00000,00000,00000,1531C0, NetClient*, D2GetClient, (Unit* ptUnit, char* lpszErrFile, DWORD ErrLine));//6FCBC2E0
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////// VARIABLES ////////
|
||||
@ -580,23 +596,25 @@ A7(FAST, D2Game, 7C2C0,7C7B0,8C2E0,00000,00000,00000,00000, NetClient*, D2GetCli
|
||||
//E2C(D2Client,11B418,DWORD, MouseX);//0x320 = 800 //1.11b
|
||||
//E2C(D2Client,11C1E0,Unit*, ptClientChar);//1.11b
|
||||
|
||||
//C7(D2Common,000000,000000, 96A20, 9B74C, 9EE8C, 9B500, 99E1C, DataTables*,SgptDataTables); //03836A20 - 037A0000 //01EE6A20
|
||||
C7(D2Client, D50E8, D40E0, D40F0, F5C60, F4FC8, DC6E4, DBC4C, DWORD, ResolutionY);//0x258 = 600
|
||||
C7(D2Client, D50EC, D40E4, D40F4, F5C5C, F4FC4, DC6E0, DBC48, DWORD, ResolutionX);//0x320 = 800
|
||||
C7(D2Client,125AD8,124958,11A74C,11BD28,11BEFC,11BD2C,11B9A4, DWORD, NegWindowStartY);//0xFFFFFFC4 = -60
|
||||
C7(D2Client,125AD4,124954,11A748,11BD24,11BEF8,11BD28,11B9A0, DWORD, WindowStartX);//0x50 = 80
|
||||
//C7(D2Launch, 55818, 56088, 2CD5C,000000, 2CD5C,000000,000000, DWORD, GameTypeMode);//0x50 = 80 //6FA3CD5C-6FA10000
|
||||
C7(D2Game, F2A80, F2918,113FB8,111718,1115E0,1105E0,1107B8, NetClient*, ClientTable);
|
||||
//C7(D2Client,000000,000000,000000,000000,104225,000000,000000, DWORD, CurrentNPCNum);
|
||||
C7(D2Client,000000,000000,000000, FB3F4,11A2F4,10330C,119854, DWORD, IsLodGame);
|
||||
C7(D2Client,000000,000000,10795C,11BFB8,11C2A8,11BFF4,000000, BYTE, DifficultyLevel);
|
||||
C7(D2Client,000000,000000,000000,10A40C,11B414,101634,11B824, DWORD, MouseY);//0x258 = 600
|
||||
C7(D2Client,000000,000000,000000,10A410,11B418,101638,11B828, DWORD, MouseX);//0x320 = 800
|
||||
C7(D2Client,000000,000000,000000,11C4F0,11C1E0,11C3D0,11BBFC, Unit*, ptClientChar);
|
||||
//C8(D2Common,000000,000000, 96A20, 9B74C, 9EE8C, 9B500, 99E1C,000000,000000, DataTables*,SgptDataTables); //03836A20 - 037A0000 //01EE6A20
|
||||
C8(D2Client, D50E8, D40E0, D40F0, F5C60, F4FC8, DC6E4, DBC4C, F7038,311470, DWORD, ResolutionY);//0x258 = 600
|
||||
C8(D2Client, D50EC, D40E4, D40F4, F5C5C, F4FC4, DC6E0, DBC48, F7034,31146C, DWORD, ResolutionX);//0x320 = 800
|
||||
C8(D2Client,125AD8,124958,11A74C,11BD28,11BEFC,11BD2C,11B9A4,11D358,3A285C, DWORD, NegWindowStartY);//0xFFFFFFC4 = -60
|
||||
C8(D2Client,125AD4,124954,11A748,11BD24,11BEF8,11BD28,11B9A0,11D354,3A2858, DWORD, WindowStartX);//0x50 = 80
|
||||
//C8(D2Launch, 55818, 56088, 2CD5C,000000, 2CD5C,000000,000000,00000,000000, DWORD, GameTypeMode);//0x50 = 80 //6FA3CD5C-6FA10000
|
||||
C8(D2Game, F2A80, F2918,113FB8,111718,1115E0,1105E0,1107B8,1105E0,4842A8, NetClient*, ClientTable);
|
||||
//C8(D2Client,000000,000000,000000,000000,104225,000000,000000,00000,000000, DWORD, CurrentNPCNum);
|
||||
C8(D2Client,000000,000000,000000, FB3F4,11A2F4,10330C,119854,1087B4,3A04F4, DWORD, IsLodGame);
|
||||
C8(D2Client,000000,000000,10795C,11BFB8,11C2A8,11BFF4,000000,000000,000000, BYTE, DifficultyLevel);
|
||||
//C8(D2Client,000000,000000,10795C,11BFB8,11C2A8,11BFF4,000000,11D1D8,000000, BYTE, DifficultyLevel);
|
||||
C8(D2Client,000000,000000,000000,10A40C,11B414,101634,11B824,11C94C,3A6AAC, DWORD, MouseY);//0x258 = 600
|
||||
C8(D2Client,000000,000000,000000,10A410,11B418,101638,11B828,11C950,3A6AB0, DWORD, MouseX);//0x320 = 800
|
||||
C8(D2Client,000000,000000,000000,11C4F0,11C1E0,11C3D0,11BBFC,11D050,3A6A70, Unit*, ptClientChar);
|
||||
C8(D2Client,11E0F4,11CF54,112D04,11B9A8,11BB30,11BF48,11C028,11CAA4,3BB5E8, DWORD, InputCommandLen);
|
||||
C8(D2Client,11CE50,11BCB0,111A58,11C590,11D590,11FC40,11EC80,11D650,3BB638, WCHAR, InputCommand);
|
||||
|
||||
|
||||
C7(D2Client, DB918, DA828,000000,000000,000000,000000,000000, DWORD, NbStatDesc);
|
||||
C7(D2Client, DAF98, D9EA8,000000,000000,000000,000000,000000, DWORD, StatDescTable);
|
||||
C8(D2Client, DB918, DA828,000000,000000,000000,000000,000000,000000,000000, DWORD, NbStatDesc);
|
||||
C8(D2Client, DAF98, D9EA8,000000,000000,000000,000000,000000,000000,000000, DWORD, StatDescTable);
|
||||
|
||||
/* NEXT NOT TESTED IN 1.10 (1.09b fct)
|
||||
D2_STD(D2Common10066, void, D2RemoveFromRoom, (DrlgRoom1* hRoom, DWORD untitype, DWORD unitID), 0x6FD7CFD0);
|
||||
@ -654,69 +672,69 @@ D2_FST(D2Client6FB30470,void, D2ClientUpdatePlayer, (Unit* ptChar, DWORD nUnitT
|
||||
|
||||
|
||||
Storm 1.09:
|
||||
251 SFileAuthenticateArchive
|
||||
252 SFileCloseArchive
|
||||
253 SFileCloseFile
|
||||
254 SFileDdaBegin
|
||||
255 SFileDdaBeginEx
|
||||
256 SFileDdaDestroy
|
||||
257 SFileDdaEnd
|
||||
258 SFileDdaGetPos
|
||||
259 SFileDdaGetVolume
|
||||
260 SFileDdaInitialize
|
||||
261 SFileDdaSetVolume
|
||||
262 SFileDestroy
|
||||
263 SFileEnableDirectAccess
|
||||
264 SFileGetFileArchive
|
||||
265 SFileGetFileSize
|
||||
266 SFileOpenArchive
|
||||
267 SFileOpenFile
|
||||
268 SFileOpenFileEx
|
||||
269 SFileReadFile
|
||||
270 SFileSetBasePath
|
||||
271 SFileSetFilePointer
|
||||
272 SFileSetLocale
|
||||
273 SFileGetBasePath
|
||||
274 SFileSetIoErrorMode
|
||||
275 SFileGetArchiveName
|
||||
276 SFileGetFileName
|
||||
277 SFileGetArchiveInfo
|
||||
278 SFileSetPlatform
|
||||
279 SFileLoadFile
|
||||
280 SFileUnloadFile
|
||||
281 SFileLoadFileEx
|
||||
282 SFilePrioritizeRequest
|
||||
283 SFile_CancelRequest
|
||||
284 SFileSetAsyncBudget
|
||||
285 SFileSetDataChunkSize
|
||||
286 SFileEnableSeekOptimization
|
||||
287 SFileReadFileEx
|
||||
288 SFile_CancelRequestEx
|
||||
289 SFileReadFileEx2
|
||||
290 SFileLoadFileEx2
|
||||
251 SFileAuthenticateArchive
|
||||
252 SFileCloseArchive
|
||||
253 SFileCloseFile
|
||||
254 SFileDdaBegin
|
||||
255 SFileDdaBeginEx
|
||||
256 SFileDdaDestroy
|
||||
257 SFileDdaEnd
|
||||
258 SFileDdaGetPos
|
||||
259 SFileDdaGetVolume
|
||||
260 SFileDdaInitialize
|
||||
261 SFileDdaSetVolume
|
||||
262 SFileDestroy
|
||||
263 SFileEnableDirectAccess
|
||||
264 SFileGetFileArchive
|
||||
265 SFileGetFileSize
|
||||
266 SFileOpenArchive
|
||||
267 SFileOpenFile
|
||||
268 SFileOpenFileEx
|
||||
269 SFileReadFile
|
||||
270 SFileSetBasePath
|
||||
271 SFileSetFilePointer
|
||||
272 SFileSetLocale
|
||||
273 SFileGetBasePath
|
||||
274 SFileSetIoErrorMode
|
||||
275 SFileGetArchiveName
|
||||
276 SFileGetFileName
|
||||
277 SFileGetArchiveInfo
|
||||
278 SFileSetPlatform
|
||||
279 SFileLoadFile
|
||||
280 SFileUnloadFile
|
||||
281 SFileLoadFileEx
|
||||
282 SFilePrioritizeRequest
|
||||
283 SFile_CancelRequest
|
||||
284 SFileSetAsyncBudget
|
||||
285 SFileSetDataChunkSize
|
||||
286 SFileEnableSeekOptimization
|
||||
287 SFileReadFileEx
|
||||
288 SFile_CancelRequestEx
|
||||
289 SFileReadFileEx2
|
||||
290 SFileLoadFileEx2
|
||||
|
||||
Storm1.08
|
||||
401 SMemAlloc
|
||||
403 SMemFree
|
||||
404 SMemGetSize
|
||||
405 SMemReAlloc
|
||||
481 SMemFindNextBlock
|
||||
482 SMemFindNextHeap
|
||||
483 SMemGetHeapByCaller
|
||||
484 SMemGetHeapByPtr
|
||||
485 SMemHeapAlloc
|
||||
486 SMemHeapCreate
|
||||
487 SMemHeapDestroy
|
||||
488 SMemHeapFree
|
||||
489 SMemHeapReAlloc
|
||||
490 SMemHeapSize
|
||||
491 SMemCopy
|
||||
492 SMemFill
|
||||
493 SMemMove
|
||||
494 SMemZero
|
||||
495 SMemCmp
|
||||
496 SMemSetDebugFlags
|
||||
497 SMemDumpState
|
||||
401 SMemAlloc
|
||||
403 SMemFree
|
||||
404 SMemGetSize
|
||||
405 SMemReAlloc
|
||||
481 SMemFindNextBlock
|
||||
482 SMemFindNextHeap
|
||||
483 SMemGetHeapByCaller
|
||||
484 SMemGetHeapByPtr
|
||||
485 SMemHeapAlloc
|
||||
486 SMemHeapCreate
|
||||
487 SMemHeapDestroy
|
||||
488 SMemHeapFree
|
||||
489 SMemHeapReAlloc
|
||||
490 SMemHeapSize
|
||||
491 SMemCopy
|
||||
492 SMemFill
|
||||
493 SMemMove
|
||||
494 SMemZero
|
||||
495 SMemCmp
|
||||
496 SMemSetDebugFlags
|
||||
497 SMemDumpState
|
||||
*/
|
||||
//Kingpin: D2Common #10027 is used to get dest unit (used for get type5 object in next room)
|
||||
//D2Common10247, (ptInventory, ptItem, x,y,0xC,void*,void*,BYTE page) verif if items can be put in inventory
|
||||
@ -736,9 +754,9 @@ Storm1.08
|
||||
/*
|
||||
Kingpin: d2common #11270
|
||||
Kingpin: Check MonType.txt line to see if it match (returns a boolan)
|
||||
Kingpin: arg1 = unknown
|
||||
arg2 = damage_vs_montype (stat from intestatscost.txt)
|
||||
arg3 = ptUnit
|
||||
Kingpin: arg1 = unknown
|
||||
arg2 = damage_vs_montype (stat from intestatscost.txt)
|
||||
arg3 = ptUnit
|
||||
arg4 = 80 (maxline maybe, but is only guessing)
|
||||
|
||||
//d2game.6FD1D660 reverse player name :P
|
||||
@ -758,42 +776,42 @@ Kingpin: D2Client.6FB18770 returns a boolean if you have enough mana for skill
|
||||
Kingpin: D2Client.6FB18AC0 sets it to selectable or not
|
||||
D2Common #10480 Return ptState arg1 = ptUnit, arg2 = state_id
|
||||
D2Common #10479 Get State_ID from ptState+14
|
||||
D2Common #11265 Get Skill_ID from ptState+1C Arg1 = ptState
|
||||
D2Common #11265 Get Skill_ID from ptState+1C Arg1 = ptState
|
||||
|
||||
Kingpin: D2Common #10497 Get Duration of State
|
||||
Kingpin: D2Common #10497 Get Duration of State
|
||||
Kingpin: arg1 = state_id
|
||||
|
||||
|
||||
D2Client.6FB5B0F0
|
||||
Function: Draw Filled Rectangle
|
||||
D2Client.6FB5B0F0
|
||||
Function: Draw Filled Rectangle
|
||||
void FASTCALL D2ClientFillRect(int x, int y, int Width, int Height, ULONG ulColor, ULONG transTbl);
|
||||
D2_FST(D2Client6FB5B0F0,void, D2ClientFillRect,(int x, int y, int Width, int Height, DWORD col, DWORD transTbl), offset_D2Client + 0xBB0F0);//6FB5B0F0-6FAA0000
|
||||
D2Gfx.#10055
|
||||
Function: Draw Filled Rectangle
|
||||
D2Gfx.#10055
|
||||
Function: Draw Filled Rectangle
|
||||
void STDCALL D2GfxFillRect(int left, int top, int right, int bottom, ULONG ulColor, ULONG transTbl);
|
||||
NOTES:
|
||||
color = Palette index.
|
||||
transTbl = pl2 transform table index ...
|
||||
0 = 75% transparent
|
||||
1 = 50% transparent
|
||||
2 = 25% transparent
|
||||
3 = color blend 1 //white is transparent black is solid
|
||||
4 = color blend 2 //black is transparent white is solid
|
||||
5 = normal draw
|
||||
6 = color blend 3 // screen + color
|
||||
7 = hilight
|
||||
NOTES:
|
||||
color = Palette index.
|
||||
transTbl = pl2 transform table index ...
|
||||
0 = 75% transparent
|
||||
1 = 50% transparent
|
||||
2 = 25% transparent
|
||||
3 = color blend 1 //white is transparent black is solid
|
||||
4 = color blend 2 //black is transparent white is solid
|
||||
5 = normal draw
|
||||
6 = color blend 3 // screen + color
|
||||
7 = hilight
|
||||
|
||||
|
||||
6FAE7831 E8 9A380800 CALL <JMP.&D2Common.#10252> ; click inventory
|
||||
6FAE8D44 E8 87230800 CALL <JMP.&D2Common.#10252> ; Right click inventory
|
||||
6FAE7831 E8 9A380800 CALL <JMP.&D2Common.#10252> ; click inventory
|
||||
6FAE8D44 E8 87230800 CALL <JMP.&D2Common.#10252> ; Right click inventory
|
||||
6FAE8972 E8 59270800 CALL <JMP.&D2Common.#10252> ; mouse over
|
||||
|
||||
|
||||
D2Client.6FACFCD0 then that set color for the text (it calls in this function #10121 and 10117)
|
||||
Kingpin: and the position
|
||||
Kingpin: arg1 = Xpos
|
||||
arg2 = Ypos
|
||||
arg3 = Pointer to Unicode String
|
||||
Kingpin: arg1 = Xpos
|
||||
arg2 = Ypos
|
||||
arg3 = Pointer to Unicode String
|
||||
arg4 = Color
|
||||
|
||||
Kingpin: 10470 has as first arg ptGame +1C (memory alloc thing)
|
||||
@ -803,51 +821,51 @@ Kingpin: arg4 = 4 (same here, no idea)
|
||||
Kingpin: arg5 = uniqueID
|
||||
|
||||
Kingpin: 10868 SetMod
|
||||
arg1 = ptItem
|
||||
arg2 = ItemMod
|
||||
arg1 = ptItem
|
||||
arg2 = ItemMod
|
||||
arg3 = 1
|
||||
Kingpin: 11232 Get Cube Recipe Record (Line) from Cubemain.bin Address in memory
|
||||
Kingpin: 11232 Get Cube Recipe Record (Line) from Cubemain.bin Address in memory
|
||||
Kingpin: i have no parameters for 11232
|
||||
Kingpin: 11233 Get Number of Cube Recipes
|
||||
|
||||
Kingpin: edi contains target unit
|
||||
Kingpin: edi contains target unit
|
||||
Kingpin: 10342 get ptRoom from target unit
|
||||
Kingpin: ecx = unique unit id
|
||||
Kingpin: ebx = unit type
|
||||
Kingpin: eax = ptRoom
|
||||
Kingpin: 10066 remove unit from room
|
||||
|
||||
D2Game.6FCBC900 ; Get Target Unit
|
||||
D2Game.6FCBC900 ; Get Target Unit
|
||||
Arg1 = ptPlayer (ptUnit)
|
||||
Arg2 = ptGame
|
||||
|
||||
|
||||
|
||||
#10962 Add skill to player
|
||||
Kingpin: arg1 ptPlayer
|
||||
#10962 Add skill to player
|
||||
Kingpin: arg1 ptPlayer
|
||||
arg2 SkillID
|
||||
Kingpin: arg3 Skill Level
|
||||
|
||||
10602 Gets an item ID # from an item code
|
||||
10602 Gets an item ID # from an item code
|
||||
|
||||
Kingpin: get Prefix/suffix
|
||||
Kingpin: #10699 arg1 = ptItem, arg2 = prefix Index
|
||||
Kingpin: #10701 arg1 = ptItem, arg2 = suffix index
|
||||
|
||||
|
||||
D2EquipUnit STDCALL_FUNCTION(int, D2Common280D, (Inventory* ptInventory, Unit* ptItem, int bodylocation));
|
||||
D2AddItemToInventory STDCALL_FUNCTION(int, D2Common2802, (Inventory* ptInventory, Unit* ptItem, int nodePage));
|
||||
D2EquipUnit STDCALL_FUNCTION(int, D2Common280D, (Inventory* ptInventory, Unit* ptItem, int bodylocation));
|
||||
D2AddItemToInventory STDCALL_FUNCTION(int, D2Common2802, (Inventory* ptInventory, Unit* ptItem, int nodePage));
|
||||
Kingpin: in my notes it should start here
|
||||
Kingpin: 6FC51360 /$ 55 PUSH EBP
|
||||
|
||||
D2DropTC FASTCALL_FUNCTION(void, D2Game6FC51360, (D2Game* ptGame, Unit* ptChar, Unit* ptNPC, void* ptTC, DWORD z5, DWORD ilvl, DWORD z1, DWORD z2, DWORD z3, DWORD z4));
|
||||
D2DropTC FASTCALL_FUNCTION(void, D2Game6FC51360, (D2Game* ptGame, Unit* ptChar, Unit* ptNPC, void* ptTC, DWORD z5, DWORD ilvl, DWORD z1, DWORD z2, DWORD z3, DWORD z4));
|
||||
|
||||
Kingpin: D2CreateItemUnit FASTCALL_FUNCTION(Unit*, D2Game6FC501A0, (Unit* ptPlayer, DWORD itemCode, D2Game* ptGame, DWORD uk1, DWORD quality, DWORD uk3, DWORD uk4, DWORD Lvl, DWORD uk5, DWORD uk6, DWORD uk7));
|
||||
ptItem = D2CreateItemUnit(ptPlayer, D2GetItemIDfromCode(CharstatTXT->Item1), PCGame, 4, 2, 1, 1, D2GetUnitStat(ptPlayer,STATS_LEVEL,0), 0, 0, 0);
|
||||
Kingpin: D2CreateItemUnit FASTCALL_FUNCTION(Unit*, D2Game6FC501A0, (Unit* ptPlayer, DWORD itemCode, D2Game* ptGame, DWORD uk1, DWORD quality, DWORD uk3, DWORD uk4, DWORD Lvl, DWORD uk5, DWORD uk6, DWORD uk7));
|
||||
ptItem = D2CreateItemUnit(ptPlayer, D2GetItemIDfromCode(CharstatTXT->Item1), PCGame, 4, 2, 1, 1, D2GetUnitStat(ptPlayer,STATS_LEVEL,0), 0, 0, 0);
|
||||
|
||||
Kingpin: monsterData +28 holds ptGame
|
||||
Kingpin: ptGame +2C UniqueID (owner ID)
|
||||
Kingpin: ptGame +30 UnitType
|
||||
Kingpin: ptGame +30 UnitType
|
||||
srvDoFunc 15 adds temporarly a stat
|
||||
|
||||
Kingpin: we have 10041 that get ptRoom from ptAct, XOffset&Yoffset
|
||||
|
@ -1,10 +1,10 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
@brief Diablo II Unit Structures definitions.
|
||||
@brief Diablo II Unit Structures definitions.
|
||||
|
||||
NOT TESTED IN 1.10 (1.09b)
|
||||
|
||||
NOT TESTED IN 1.10 (1.09b)
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#pragma once
|
||||
@ -13,6 +13,17 @@
|
||||
struct CBPlayerData;
|
||||
struct CBItemData;
|
||||
struct Unit;
|
||||
struct SkillsBIN;
|
||||
struct SkillData;
|
||||
struct ObjectsBIN;
|
||||
struct NetClient;
|
||||
|
||||
struct Game;
|
||||
struct ActMap;
|
||||
struct ActData;
|
||||
struct Level;
|
||||
struct RoomEx;
|
||||
struct Room;
|
||||
|
||||
/*=================================================================*/
|
||||
/* Skill Structure. */
|
||||
@ -56,7 +67,7 @@ struct Position
|
||||
DWORD y;
|
||||
};
|
||||
|
||||
struct Room//size=0x80
|
||||
/*struct Room//size=0x80
|
||||
{
|
||||
//ptRoom +48 0 = spawn new units (monster, objects e.tc), 1 = don't spawn any new units
|
||||
DWORD seed1; //+00
|
||||
@ -76,23 +87,113 @@ struct Room//size=0x80
|
||||
BYTE isGenerated2:1;//???
|
||||
};
|
||||
};
|
||||
};
|
||||
};*/
|
||||
|
||||
struct ActMap//ptGame+BC size=0x60
|
||||
struct RoomEx //size=5C
|
||||
{
|
||||
DWORD isNotManaged;
|
||||
DWORD uk4;
|
||||
DWORD uk8;//size = 0x488
|
||||
Room* ptFirstRoom;
|
||||
DWORD __00[2]; //0x00
|
||||
RoomEx** roomExNear; //0x08
|
||||
DWORD __0C[5]; //0x0C
|
||||
struct {
|
||||
INT32 roomNumber; //0x00
|
||||
void* __04; //0x04
|
||||
PINT32 subNumber; //0x08
|
||||
} *pType2Info; //0x20
|
||||
RoomEx* ptNextRoomEx; //0x24
|
||||
UINT32 roomFlags; //0x28
|
||||
UINT32 roomsNearCount; //0x2C
|
||||
Room* ptRoom; //0x30
|
||||
INT32 posX; //0x34
|
||||
INT32 posY; //0x38
|
||||
INT32 sizeX; //0x3C
|
||||
INT32 sizeY; //0x40
|
||||
DWORD __44; //0x44
|
||||
UINT32 presetType; //0x48
|
||||
void* ptWarpTiles; //0x4C
|
||||
DWORD __50[2]; //0x50
|
||||
Level* ptLevel; //0x58
|
||||
};
|
||||
|
||||
struct Room //size=0x80
|
||||
{
|
||||
Room** ptNearRooms; //0x00
|
||||
DWORD __04[3]; //0x04
|
||||
RoomEx* ptRoomEx; //0x10
|
||||
DWORD __14[3]; //0x14
|
||||
void* coll; //0x20
|
||||
INT32 nbNearRooms; //0x24
|
||||
DWORD __28[9]; //0x28
|
||||
DWORD startX; //0x4C
|
||||
DWORD startY; //0x50
|
||||
DWORD sizeX; //0x54
|
||||
DWORD sizeY; //0x58
|
||||
DWORD __5C[6]; //0x5C
|
||||
Unit* ptFirstUnit; //0x74
|
||||
DWORD __78; //0x78
|
||||
Room* ptNextRoom; //0x7C
|
||||
};
|
||||
|
||||
struct Level //size=0x234
|
||||
{
|
||||
DWORD type; //+000
|
||||
DWORD flags; //+004
|
||||
DWORD __004_010[2]; //+008
|
||||
RoomEx* ptFirstRoomEx; //+010
|
||||
DWORD __014_01C[2]; //+014
|
||||
INT32 posX; //+01C
|
||||
INT32 posY; //+020
|
||||
INT32 sizeX; //+024
|
||||
INT32 sizeY; //+028
|
||||
DWORD __0C2_1AC[96]; //+02C
|
||||
Level* ptNextLevel; //+1AC
|
||||
DWORD __1B0; //+1B0
|
||||
ActData* ptActData; //+1B4
|
||||
DWORD __1B8_1C0[2]; //+1B8
|
||||
DWORD levelType; //+1C0
|
||||
DWORD seed1; //+1C4
|
||||
DWORD seed2; //+1C8
|
||||
DWORD uk_1CC; //+1CC
|
||||
UINT32 levelNo; //+1D0
|
||||
DWORD __1D4_234[96]; //+1D4
|
||||
};
|
||||
|
||||
struct ActData //size=0x488
|
||||
{
|
||||
DWORD seed1; //+000
|
||||
DWORD seed2; //+004
|
||||
DWORD nbRooms; //+008
|
||||
DWORD __00C_0094[34]; //+00C
|
||||
DWORD nTalRashaTombLevel; //094
|
||||
DWORD __098; //+098
|
||||
Game* ptGame; //+09C
|
||||
DWORD __0A0_450[237]; //+0A0
|
||||
BYTE difficulty; //+450
|
||||
BYTE __451_46C[27]; //+451
|
||||
ActMap* ptActMap; //+46C
|
||||
DWORD __470_484[5]; //+470
|
||||
DWORD nBossMummyTombLevel;//+484
|
||||
};
|
||||
|
||||
struct ActMap //size=0x60
|
||||
{
|
||||
DWORD isNotManaged; //+00
|
||||
DWORD __04; //+04
|
||||
DWORD townLevel; //+08
|
||||
DWORD seed; //+0C
|
||||
Room* ptFirstRoom; //+10
|
||||
DWORD actNumber; //+14
|
||||
DWORD __18_48[12]; //+18
|
||||
ActData* ptActData; //+48
|
||||
DWORD __50_5C[4]; //+4C
|
||||
void* ptMemoryPool; //+5C
|
||||
};
|
||||
|
||||
struct NetClient;
|
||||
//ptGame : 04E4007C
|
||||
struct Game
|
||||
{ //Offset from Code.
|
||||
{ //Offset from Code.
|
||||
BYTE uk1[0x18]; //+00
|
||||
DWORD _ptLock; //+18 Unknown
|
||||
DWORD memoryPool; //+1C Memory Pool (??)
|
||||
DWORD _ptLock; //+18 Unknown
|
||||
DWORD memoryPool; //+1C Memory Pool (??)
|
||||
BYTE uk2[0x4D]; //+20
|
||||
BYTE difficultyLevel; //+6D (Difficulty 0,1 or 2)
|
||||
WORD unknown1; //+6E Cube puts 4 here
|
||||
@ -101,7 +202,9 @@ struct Game
|
||||
WORD unknown2; //+78
|
||||
BYTE uk4[0x0E]; //+7A
|
||||
NetClient* ptClient; //+88
|
||||
BYTE uk8C[0x30]; //+8C
|
||||
BYTE __8C[0x1C]; //+8C
|
||||
DWORD gameFrame; //+A8
|
||||
BYTE __AC[0x10]; //+AC
|
||||
ActMap* mapAct[5]; //+BC
|
||||
BYTE ukD0[0x1024]; //+D0
|
||||
DWORD* game10F4; //+10F4
|
||||
@ -114,7 +217,7 @@ struct Game
|
||||
|
||||
|
||||
struct Path //(8 dword)
|
||||
{ //Offset from Code. Size: 20
|
||||
{ //Offset from Code. Size: 20
|
||||
WORD uk1; //+00
|
||||
WORD mapx; //+02
|
||||
WORD uk2; //+04
|
||||
@ -129,7 +232,7 @@ struct Path //(8 dword)
|
||||
|
||||
|
||||
struct Inventory
|
||||
{ //Offset from Code. Size: 30 à 40
|
||||
{ //Offset from Code. Size: 30 to 40
|
||||
DWORD tag; //+00 = 0x01020304
|
||||
BYTE uk1[0x04]; //+04 =? 0
|
||||
Unit* ptChar; //+08
|
||||
@ -197,24 +300,49 @@ struct Stats //sizeof(Stats)=0x64
|
||||
DWORD unknow2; //+60 (=0)
|
||||
};
|
||||
|
||||
struct AIControl
|
||||
{
|
||||
DWORD specialState; // +00 SpecialState - stuff like terror, confusion goes here
|
||||
void* aiFunction; // +04 fpAiFunction(); - the primary ai function to call (void * __fastcall)(pGame,pUnit,pAiTickArgs);
|
||||
DWORD aiFlags; // +08 AiFlags
|
||||
DWORD ownerGUID; // +0C OwnerGUID - the global unique identifier of the boss or minion owner
|
||||
DWORD ownerType; // +10 eOwnerType - the unit type of the boss or minion owner
|
||||
DWORD args[3]; // +14 dwArgs[3] - three dwords holding custom data used by ai func to store counters (etc)
|
||||
void* cmdCurrent; // +20 pCmdCurrents
|
||||
void* cmdLast; // +24 pCmdLast
|
||||
Game* ptGame; // +28 pGame
|
||||
DWORD ownerGUID2; // +2C OwnerGUID - the same as +008
|
||||
DWORD ownerType2; // +30 eOwnerType - the same as +00C
|
||||
void* minionList; // +34 pMinionList - list of all minions, for boss units (SetBoss in MonStats, Unique, SuperUnique etc)
|
||||
DWORD trapNo; // +3C eTrapNo - used by shadows for summoning traps (so they stick to one type usually)
|
||||
};
|
||||
|
||||
struct MonsterData // sizeof(MonsterData)=0x60
|
||||
{ //Offset from Code.
|
||||
BYTE uk[0x16]; //+00
|
||||
union {
|
||||
WORD flags; //+16
|
||||
struct {
|
||||
WORD fuk1:1;
|
||||
WORD isSuperUnique:1;
|
||||
WORD isChampion:1;
|
||||
WORD isUnique:1;
|
||||
WORD fuk2:13;
|
||||
MonStatsBIN* ptMonStats; //+000 - pMonStats - record in monstats.txt
|
||||
BYTE components[0x10]; //+004 - Components[16] - bytes holding the component Ids for each component; Order: HD, TR, LG, RA, LA, RH, LH, SH, S1, S2, S3, S4, S5, S6, S7, S8
|
||||
WORD seed; //+014 - NameSeed
|
||||
union
|
||||
{
|
||||
BYTE flags; //+016 - TypeFlags
|
||||
struct
|
||||
{
|
||||
BYTE isOther:1; // MONTYPE_OTHER(set for some champs, uniques)
|
||||
BYTE isSuperUnique:1; // MONTYPE_SUPERUNIQUE
|
||||
BYTE isChampion:1; // MONTYPE_CHAMPION
|
||||
BYTE isUnique:1; // MONTYPE_UNIQUE
|
||||
BYTE isMinion:1; // MONTYPE_MINION
|
||||
BYTE isPossessed:1; // MONTYPE_POSSESSED
|
||||
BYTE isGhostly:1; // MONTYPE_GHOSTLY
|
||||
BYTE isMultishot:1; // MONTYPE_MULTISHOT
|
||||
};
|
||||
};
|
||||
BYTE uk1[0x0E]; //+18
|
||||
WORD superUniqueID; //+26
|
||||
void* unknow1; //+28
|
||||
BYTE uk2[0x38]; //+28
|
||||
BYTE lastMode; //+017 - eLastMode
|
||||
DWORD duriel; //+018 - dwDuriel - set only for duriel
|
||||
BYTE monUModList[10]; //+01C - MonUModList[9] - nine bytes holding the Ids for each MonUMod assigned to the unit
|
||||
DWORD superUniqueID; //+026
|
||||
AIControl* ptAiGeneral; //+02A
|
||||
BYTE uk2[0x32]; //+02E
|
||||
};
|
||||
|
||||
struct ObjectData
|
||||
@ -223,15 +351,15 @@ struct ObjectData
|
||||
BYTE levelID;
|
||||
};
|
||||
/*
|
||||
Kingpin: struct MonsterData
|
||||
{
|
||||
BYTE uk1[0x13]; // +00
|
||||
DWORD Flags; // +14
|
||||
DWORD uk2; // +18
|
||||
DWORD MinionOwnerID; // +1C
|
||||
BYTE uk3[0x5]; // +20
|
||||
WORD SuperUniqueID; // +26 Superunique ID of monster
|
||||
D2Game* ptGame; // +28 ptGame
|
||||
Kingpin: struct MonsterData
|
||||
{
|
||||
BYTE uk1[0x13]; // +00
|
||||
DWORD Flags; // +14
|
||||
DWORD uk2; // +18
|
||||
DWORD MinionOwnerID; // +1C
|
||||
BYTE uk3[0x5]; // +20
|
||||
WORD SuperUniqueID; // +26 Superunique ID of monster
|
||||
D2Game* ptGame; // +28 ptGame
|
||||
};
|
||||
*/
|
||||
|
||||
@ -266,27 +394,27 @@ struct ItemData//size=0x74
|
||||
};
|
||||
};
|
||||
/*
|
||||
ITEMFLAG_NEWITEM = 0x00000001,
|
||||
ITEMFLAG_TAGETING = 0x00000004,
|
||||
ITEMFLAG_UNIDENTIFIED = 0x00000010,
|
||||
ITEMFLAG_QUANTITY = 0x00000020,
|
||||
ITEMFLAG_Durability = 0x00000100,
|
||||
ITEMFLAG_UNKNOWN2 = 0x00000400,
|
||||
ITEMFLAG_SOCKETED = 0x00000800,
|
||||
ITEMFLAG_NON_SELLABLE = 0x00001000,
|
||||
ITEMFLAG_NEWITEM2 = 0x00002000,
|
||||
ITEMFLAG_UNKNOWN3 = 0x00004000,
|
||||
ITEMFLAG_CHECKSECPRICE = 0x00010000,
|
||||
ITEMFLAG_CHECKGAMBLEPRICE = 0x00020000,
|
||||
ITEMFLAG_UNKNOWN4 = 0x00080000,
|
||||
ITEMFLAG_INDESTRUCTIBLE(ETHERAL) = 0x00400000,
|
||||
ITEMFLAG_UNKNOWN5 = 0x00800000,
|
||||
ITEMFLAG_FROMPLAYER = 0x01000000,
|
||||
ITEMFLAG_NEWITEM = 0x00000001,
|
||||
ITEMFLAG_TAGETING = 0x00000004,
|
||||
ITEMFLAG_UNIDENTIFIED = 0x00000010,
|
||||
ITEMFLAG_QUANTITY = 0x00000020,
|
||||
ITEMFLAG_Durability = 0x00000100,
|
||||
ITEMFLAG_UNKNOWN2 = 0x00000400,
|
||||
ITEMFLAG_SOCKETED = 0x00000800,
|
||||
ITEMFLAG_NON_SELLABLE = 0x00001000,
|
||||
ITEMFLAG_NEWITEM2 = 0x00002000,
|
||||
ITEMFLAG_UNKNOWN3 = 0x00004000,
|
||||
ITEMFLAG_CHECKSECPRICE = 0x00010000,
|
||||
ITEMFLAG_CHECKGAMBLEPRICE = 0x00020000,
|
||||
ITEMFLAG_UNKNOWN4 = 0x00080000,
|
||||
ITEMFLAG_INDESTRUCTIBLE(ETHERAL) = 0x00400000,
|
||||
ITEMFLAG_UNKNOWN5 = 0x00800000,
|
||||
ITEMFLAG_FROMPLAYER = 0x01000000,
|
||||
ITEMFLAG_RUNEWORD = 0x04000000
|
||||
*/
|
||||
DWORD guid1; //+1C Global Unique ID 1
|
||||
DWORD guid2; //+20 Global Unique ID 2
|
||||
DWORD guid3; //+24 Global Unique ID 3
|
||||
DWORD guid1; //+1C Global Unique ID 1
|
||||
DWORD guid2; //+20 Global Unique ID 2
|
||||
DWORD guid3; //+24 Global Unique ID 3
|
||||
DWORD uniqueID; //+28
|
||||
BYTE ilvl; //+2C
|
||||
BYTE uk1[0x03]; //+2D
|
||||
@ -297,7 +425,7 @@ ITEMFLAG_RUNEWORD = 0x04000000
|
||||
WORD prefix[3]; //+38
|
||||
WORD suffix[3]; //+3E
|
||||
BYTE equipLoc; //+44
|
||||
/* emplacement si équipé
|
||||
/* location if equipped
|
||||
* 00 = noequip/inBelt
|
||||
* 01 = head
|
||||
* 02 = neck
|
||||
@ -323,7 +451,7 @@ ITEMFLAG_RUNEWORD = 0x04000000
|
||||
BYTE ItemData3; //+47 //D2Common10854 D2Common10853
|
||||
BYTE pEarLevel; //+48
|
||||
BYTE varGfx; //+49
|
||||
char IName[0x12]; //+4A //inscribed/ear name
|
||||
char IName[0x12]; //+4A //inscribed/ear name
|
||||
Inventory* ptInventory; //+5C
|
||||
Unit* ptPrevItem; //+60
|
||||
Unit* ptNextItem; //+64
|
||||
@ -345,22 +473,24 @@ struct NetClient
|
||||
WORD isHardCoreGame:1;
|
||||
};
|
||||
};
|
||||
BYTE uk2[0x170]; //+0C
|
||||
BYTE uk2; //+0C
|
||||
char name[0x10]; //+0D
|
||||
BYTE uk3[0x15F]; //+1D
|
||||
BYTE* savefile; //+17C
|
||||
DWORD finalSize; //+180
|
||||
DWORD counter; //+184
|
||||
DWORD currentSize; //+188
|
||||
BYTE uk3[0x1C]; //+18C
|
||||
BYTE uk4[0x1C]; //+18C
|
||||
Game* ptGame; //+1A8
|
||||
//+1A8 is ptGame
|
||||
//+4A8 ptNextClient
|
||||
/*
|
||||
Kingpin: ptPclient
|
||||
+16C is either act or unit type
|
||||
+170 Active UniqueID for player
|
||||
+174 Active ptPlayer on Client
|
||||
+1a8 ptGame
|
||||
+1b4 Current or next ptRoom
|
||||
Kingpin: ptPclient
|
||||
+16C is either act or unit type
|
||||
+170 Active UniqueID for player
|
||||
+174 Active ptPlayer on Client
|
||||
+1a8 ptGame
|
||||
+1b4 Current or next ptRoom
|
||||
*/
|
||||
};
|
||||
/*
|
||||
@ -371,20 +501,20 @@ struct PlayerData
|
||||
NetClient* ptNetClient; //+9C
|
||||
};
|
||||
*/
|
||||
struct PlayerData
|
||||
{
|
||||
char name[0x10]; //+00 Player Name
|
||||
void* ptQuest[3]; //+10 Quest Pointers for each difficulty
|
||||
struct PlayerData
|
||||
{
|
||||
char name[0x10]; //+00 Player Name
|
||||
void* ptQuest[3]; //+10 Quest Pointers for each difficulty
|
||||
BYTE uk1[0x18]; //+1C //before : 0x14
|
||||
void* ptArenaUnit; //+34 ptArena for the Unit
|
||||
void* ptArenaUnit; //+34 ptArena for the Unit
|
||||
BYTE uk2[0x4]; //+38 //before : 0x7
|
||||
WORD MPSourcePortalUniqueID; //+3C Source Portal Unique_ID
|
||||
WORD MPSourcePortalUniqueID; //+3C Source Portal Unique_ID
|
||||
BYTE uk3[0x2]; //+3E
|
||||
WORD MPDestPortalUniqueID; //+40 Destination Portal Unique_ID
|
||||
BYTE uk4[0x06]; //+42
|
||||
BYTE ptObjectUnID; //+48 Object UniqueID for TownPortals
|
||||
BYTE uk5[0x53]; //+49
|
||||
NetClient* ptNetClient; //+9C ptClient
|
||||
WORD MPDestPortalUniqueID; //+40 Destination Portal Unique_ID
|
||||
BYTE uk4[0x06]; //+42
|
||||
BYTE ptObjectUnID; //+48 Object UniqueID for TownPortals
|
||||
BYTE uk5[0x53]; //+49
|
||||
NetClient* ptNetClient; //+9C ptClient
|
||||
};
|
||||
|
||||
|
||||
@ -395,11 +525,11 @@ struct Unit
|
||||
DWORD nUnitType; //+00
|
||||
union{
|
||||
DWORD nPlayerClass;
|
||||
DWORD nTxtFileNo;
|
||||
DWORD nTxtFileNo;
|
||||
}; //+04
|
||||
DWORD nUnitId; //+08
|
||||
DWORD nItemNum; //+0C
|
||||
DWORD CurrentAnim; //+10
|
||||
DWORD mode; //+10
|
||||
union{
|
||||
MonsterData* ptMonsterData;
|
||||
ObjectData* ptObjectData;
|
||||
@ -447,7 +577,7 @@ struct Unit
|
||||
BYTE uk10[0x0C]; //+D4
|
||||
Unit* ptFirstMonster; //+E0
|
||||
Unit* Unit1; //+E4
|
||||
Unit* Unit2; //+E8
|
||||
Unit* ptNextUnitInRoom; //+E8
|
||||
BYTE uk11[0x08]; //+EC
|
||||
union{
|
||||
CBPlayerData* ptCBPlayerData;
|
||||
@ -475,60 +605,60 @@ struct ItemMod
|
||||
|
||||
struct AIStruct
|
||||
{
|
||||
DWORD mSpawn; // +00
|
||||
void* mAIFunc; // +04
|
||||
DWORD mUnknown1[8]; // +08
|
||||
D2Game* mGame; // +28
|
||||
DWORD mMinionOwner; // +2C
|
||||
DWORD mOwnerType; // +30
|
||||
DWORD mSpawn; // +00
|
||||
void* mAIFunc; // +04
|
||||
DWORD mUnknown1[8]; // +08
|
||||
D2Game* mGame; // +28
|
||||
DWORD mMinionOwner; // +2C
|
||||
DWORD mOwnerType; // +30
|
||||
};
|
||||
|
||||
|
||||
struct LocInfo
|
||||
{ //Offset from Code
|
||||
Unit* noneLoc; //+00
|
||||
Unit* headLoc; //+04
|
||||
Unit* neckLoc; //+08
|
||||
Unit* torsoLoc; //+0c
|
||||
Unit* rightArmLoc; //+10
|
||||
Unit* leftArmLoc; //+14
|
||||
Unit* rightRingLoc; //+18
|
||||
Unit* leftRingLoc; //+1c
|
||||
Unit* beltLoc; //+20
|
||||
Unit* feetLoc; //+24
|
||||
Unit* glovesLoc; //+28
|
||||
Unit* noneLoc; //+00
|
||||
Unit* headLoc; //+04
|
||||
Unit* neckLoc; //+08
|
||||
Unit* torsoLoc; //+0c
|
||||
Unit* rightArmLoc; //+10
|
||||
Unit* leftArmLoc; //+14
|
||||
Unit* rightRingLoc; //+18
|
||||
Unit* leftRingLoc; //+1c
|
||||
Unit* beltLoc; //+20
|
||||
Unit* feetLoc; //+24
|
||||
Unit* glovesLoc; //+28
|
||||
};
|
||||
|
||||
struct ItemData
|
||||
struct ItemData
|
||||
{ // Offset from Code
|
||||
DWORD quality; // +00.
|
||||
DWORD lowSeed; // +04.
|
||||
DWORD highSeed; // +08.
|
||||
DWORD unknown1; // +0c.
|
||||
DWORD startLowSeed; // +10.
|
||||
DWORD cmdFlags; // +14.
|
||||
DWORD flags; // +18.
|
||||
DWORD unknown2[2]; // +1C
|
||||
DWORD originID; // +24.
|
||||
DWORD iLvl; // +28.
|
||||
WORD version; // +2C.
|
||||
WORD prefix; // +2E.
|
||||
WORD suffix; // +30.
|
||||
WORD autoPrefix; // +32.
|
||||
WORD prefix1; // +34.
|
||||
WORD prefix2; // +36.
|
||||
WORD prefix3; // +38.
|
||||
WORD suffix1; // +3A.
|
||||
WORD suffix2; // +3C.
|
||||
WORD suffix3; // +3E.
|
||||
BYTE bodyLoc; // +40. // 0=inv/stash 4=gaucheS 5=droiteS
|
||||
BYTE inPage; // +41. // FF=equip 00=inv 04=stash
|
||||
BYTE unknown3[3]; // +42
|
||||
BYTE picture[8]; // +45
|
||||
DWORD ilvl; // +4C
|
||||
DWORD lowSeed; // +04.
|
||||
DWORD highSeed; // +08.
|
||||
DWORD unknown1; // +0c.
|
||||
DWORD startLowSeed; // +10.
|
||||
DWORD cmdFlags; // +14.
|
||||
DWORD flags; // +18.
|
||||
DWORD unknown2[2]; // +1C
|
||||
DWORD originID; // +24.
|
||||
DWORD iLvl; // +28.
|
||||
WORD version; // +2C.
|
||||
WORD prefix; // +2E.
|
||||
WORD suffix; // +30.
|
||||
WORD autoPrefix; // +32.
|
||||
WORD prefix1; // +34.
|
||||
WORD prefix2; // +36.
|
||||
WORD prefix3; // +38.
|
||||
WORD suffix1; // +3A.
|
||||
WORD suffix2; // +3C.
|
||||
WORD suffix3; // +3E.
|
||||
BYTE bodyLoc; // +40. // 0=inv/stash 4=gaucheS 5=droiteS
|
||||
BYTE inPage; // +41. // FF=equip 00=inv 04=stash
|
||||
BYTE unknown3[3]; // +42
|
||||
BYTE picture[8]; // +45
|
||||
DWORD ilvl; // +4C
|
||||
};
|
||||
|
||||
struct PresetUnit
|
||||
struct PresetUnit
|
||||
{ //Offset from Code
|
||||
DWORD unitType; //+00
|
||||
DWORD txtFileNo; //+04
|
||||
@ -541,128 +671,128 @@ struct PresetUnit
|
||||
|
||||
struct MissileData
|
||||
{
|
||||
+04 flags
|
||||
+08 0 on start
|
||||
+0c -1 on start
|
||||
+20 nDirection
|
||||
+28 range?
|
||||
+2c range?
|
||||
+30 level
|
||||
+34 number of pierces (byte)
|
||||
+35 (byte)
|
||||
+36 (byte)
|
||||
+37 (byte)
|
||||
+38 range-activate
|
||||
+04 flags
|
||||
+08 0 on start
|
||||
+0c -1 on start
|
||||
+20 nDirection
|
||||
+28 range?
|
||||
+2c range?
|
||||
+30 level
|
||||
+34 number of pierces (byte)
|
||||
+35 (byte)
|
||||
+36 (byte)
|
||||
+37 (byte)
|
||||
+38 range-activate
|
||||
};
|
||||
|
||||
|
||||
struct Combat
|
||||
struct Combat
|
||||
{
|
||||
DWORD mHeader; // +00 : Always 0x32
|
||||
DWORD mHeader; // +00 : Always 0x32
|
||||
DWORD mDisplayFlag; // +04 : Affect critical hit etc ...
|
||||
DWORD mPhysicalDmg; // +08 : Values are << 8
|
||||
DWORD mUnknown1; // +0C
|
||||
DWORD mFireDmg; // +10 : Values are << 8
|
||||
DWORD mUnknown2; // +14
|
||||
DWORD mBurnLeng; // +18
|
||||
DWORD mLtngDmg; // +1C : values are << 8
|
||||
DWORD mMagDmg; // +20 : values are << 8
|
||||
DWORD mColdDmg; // +24 : values are << 8
|
||||
DWORD mPoisDmg; // +28 : ??
|
||||
DWORD mPoisLeng; // +2C
|
||||
DWORD mColdLeng; // +30
|
||||
DWORD mFreezeLeng; // +34
|
||||
DWORD mLifeSteal; // +38
|
||||
DWORD mManaSteal; // +3C
|
||||
DWORD mUnknwon3; // +40
|
||||
DWORD mStunLeng; // +44
|
||||
DWORD mUnknown4; // +48
|
||||
DWORD mTotalDamage; // +4C
|
||||
DWORD mUnknown5[6]; // +50
|
||||
DWORD mOverlay; // +68
|
||||
DWORD mUnknwon6; // +6C
|
||||
DWORD mBurnLeng; // +18
|
||||
DWORD mLtngDmg; // +1C : values are << 8
|
||||
DWORD mMagDmg; // +20 : values are << 8
|
||||
DWORD mColdDmg; // +24 : values are << 8
|
||||
DWORD mPoisDmg; // +28 : ??
|
||||
DWORD mPoisLeng; // +2C
|
||||
DWORD mColdLeng; // +30
|
||||
DWORD mFreezeLeng; // +34
|
||||
DWORD mLifeSteal; // +38
|
||||
DWORD mManaSteal; // +3C
|
||||
DWORD mUnknwon3; // +40
|
||||
DWORD mStunLeng; // +44
|
||||
DWORD mUnknown4; // +48
|
||||
DWORD mTotalDamage; // +4C
|
||||
DWORD mUnknown5[6]; // +50
|
||||
DWORD mOverlay; // +68
|
||||
DWORD mUnknwon6; // +6C
|
||||
};
|
||||
|
||||
|
||||
struct Node
|
||||
{ //Offset from Code.
|
||||
DWORD flag; //+00 //Yoh : null->flag
|
||||
Unit* ptItem; //+04 //Yoh : ItemData=>Unit
|
||||
DWORD unID; //+08
|
||||
DWORD page; //+0c //Yoh plutot etat : inventory/stash=1; inv-belt=2; equip=3
|
||||
Node* nextNode; //+10
|
||||
DWORD flag; //+00 //Yoh : null->flag
|
||||
Unit* ptItem; //+04 //Yoh : ItemData=>Unit
|
||||
DWORD unID; //+08
|
||||
DWORD page; //+0c //Yoh plutot etat : inventory/stash=1; inv-belt=2; equip=3
|
||||
Node* nextNode; //+10
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct MonsterData // size110 : 60
|
||||
{
|
||||
AIStruct* AIPtr;
|
||||
void* unkonwPtr1;
|
||||
void* uniqueInfo;
|
||||
void* spawnInfo;
|
||||
void* unknownPtr2;
|
||||
DWORD unkown[8];
|
||||
void* lvlPtr;
|
||||
MonStatTxt* monstatPtr;
|
||||
AIStruct* AIPtr;
|
||||
void* unkonwPtr1;
|
||||
void* uniqueInfo;
|
||||
void* spawnInfo;
|
||||
void* unknownPtr2;
|
||||
DWORD unkown[8];
|
||||
void* lvlPtr;
|
||||
MonStatTxt* monstatPtr;
|
||||
};
|
||||
|
||||
|
||||
struct Unit
|
||||
struct Unit
|
||||
{ //Offset from Code.
|
||||
DWORD nUnitType; //+00
|
||||
union
|
||||
{
|
||||
DWORD nTxtFileNo;
|
||||
DWORD nPlayerClass;
|
||||
}; //+04
|
||||
union
|
||||
{
|
||||
DWORD nTxtFileNo;
|
||||
DWORD nPlayerClass;
|
||||
}; //+04
|
||||
|
||||
DWORD nUnitId; //+08
|
||||
DWORD eMode; //+0c
|
||||
DWORD* unknow1; //+10
|
||||
DWORD nAct; //+14
|
||||
DWORD pActRelated; //+18
|
||||
DWORD unknown2[4]; //Unknown Data at +1C
|
||||
D2Seed nSeed; //+2C
|
||||
DWORD startSeed; //+34
|
||||
Path* pPos; //+38
|
||||
DWORD* unknow1; //+10
|
||||
DWORD nAct; //+14
|
||||
DWORD pActRelated; //+18
|
||||
DWORD unknown2[4]; //Unknown Data at +1C
|
||||
D2Seed nSeed; //+2C
|
||||
DWORD startSeed; //+34
|
||||
Path* pPos; //+38
|
||||
DWORD unknown3[6]; //Unknown Data at +3C
|
||||
DWORD animSpeed; //+54
|
||||
DWORD unknown32[2]; //+58
|
||||
BYTE COFString[12]; //+60
|
||||
Stats* ptStats; //+6C
|
||||
|
||||
union
|
||||
{
|
||||
DWORD animSpeed; //+54
|
||||
DWORD unknown32[2]; //+58
|
||||
BYTE COFString[12]; //+60
|
||||
Stats* ptStats; //+6C
|
||||
|
||||
union
|
||||
{
|
||||
PlayerData* pPlayerData;
|
||||
MonsterData* pMonsterData;
|
||||
ItemData* pItemData;
|
||||
MissileData* pMissile;
|
||||
MissileData* pMissile;
|
||||
ObjectData* pObjectData;
|
||||
}; //+70
|
||||
|
||||
DWORD unknown5[2]; //+74
|
||||
BYTE unknown6[2]; //+7C
|
||||
BYTE rndDmg[2]; //+7e
|
||||
DWORD unknown7; //+80
|
||||
BYTE unknown6[2]; //+7C
|
||||
BYTE rndDmg[2]; //+7e
|
||||
DWORD unknown7; //+80
|
||||
Inventory* ptInventory; //+84
|
||||
DWORD unknown8[4]; //+88
|
||||
DWORD startNull; //+98
|
||||
DWORD unknown9[2]; //+9c
|
||||
D2Game* ptGame; //+a4
|
||||
DWORD unknown10[4]; //+a8
|
||||
DWORD startNull; //+98
|
||||
DWORD unknown9[2]; //+9c
|
||||
D2Game* ptGame; //+a4
|
||||
DWORD unknown10[4]; //+a8
|
||||
DWORD nOwnerType; //+b8
|
||||
DWORD nOwnerId; //+bc
|
||||
DWORD unknown11[3]; //+c0
|
||||
D2Info* ptInfo; //+cc
|
||||
Combat* ptCombat; //+d0
|
||||
DWORD unknown12[5]; //+d4
|
||||
DWORD flags; //+e8
|
||||
DWORD LODflag; //+ec
|
||||
DWORD unknown11[3]; //+c0
|
||||
D2Info* ptInfo; //+cc
|
||||
Combat* ptCombat; //+d0
|
||||
DWORD unknown12[5]; //+d4
|
||||
DWORD flags; //+e8
|
||||
DWORD LODflag; //+ec
|
||||
DWORD unknown13[7]; //+f0
|
||||
Unit* pNext; //+10c
|
||||
DWORD unknown14[2]; //+110 //YOH
|
||||
union
|
||||
union
|
||||
{
|
||||
ItemData* ptItemData;
|
||||
void* ptData;
|
||||
|
85
Commons/VersionInfo.cpp
Normal file
85
Commons/VersionInfo.cpp
Normal file
@ -0,0 +1,85 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Get Game version.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include "VersionInfo.h"
|
||||
|
||||
#pragma comment(lib, "Version.Lib")
|
||||
|
||||
const char* VersionStrings[16] = { "1.00","1.07","1.08","1.09","1.09b","1.09d","1.10","1.11","1.11b","1.12","1.13c","1.13d","1.14a","1.14b","1.14c","1.14d" };
|
||||
|
||||
const char* GetVersionString(int version)
|
||||
{
|
||||
if (version < 0 || version >= sizeof(VersionStrings))
|
||||
return "UNKNOWN";
|
||||
return VersionStrings[version];
|
||||
}
|
||||
|
||||
eGameVersion GetD2Version(LPCVOID pVersionResource)
|
||||
{
|
||||
if (!pVersionResource) return UNKNOWN;
|
||||
|
||||
UINT uLen;
|
||||
VS_FIXEDFILEINFO* ptFixedFileInfo;
|
||||
if (!VerQueryValue(pVersionResource, "\\", (LPVOID*)&ptFixedFileInfo, &uLen))
|
||||
return UNKNOWN;
|
||||
|
||||
if (uLen == 0)
|
||||
return UNKNOWN;
|
||||
|
||||
WORD major = HIWORD(ptFixedFileInfo->dwFileVersionMS);
|
||||
WORD minor = LOWORD(ptFixedFileInfo->dwFileVersionMS);
|
||||
WORD revision = HIWORD(ptFixedFileInfo->dwFileVersionLS);
|
||||
WORD subrevision = LOWORD(ptFixedFileInfo->dwFileVersionLS);
|
||||
|
||||
if (major != 1)
|
||||
return UNKNOWN;
|
||||
if (minor == 0 && revision == 7 && subrevision == 0) return V107;
|
||||
if (minor == 0 && revision == 8 && subrevision == 28) return V108;
|
||||
if (minor == 0 && revision == 9 && subrevision == 19) return V109;
|
||||
if (minor == 0 && revision == 9 && subrevision == 20) return V109b;
|
||||
if (minor == 0 && revision == 9 && subrevision == 22) return V109d;
|
||||
if (minor == 0 && revision == 10 && subrevision == 39) return V110;
|
||||
if (minor == 0 && revision == 11 && subrevision == 45) return V111;
|
||||
if (minor == 0 && revision == 11 && subrevision == 46) return V111b;
|
||||
if (minor == 0 && revision == 12 && subrevision == 49) return V112;
|
||||
if (minor == 0 && revision == 13 && subrevision == 60) return V113c;
|
||||
if (minor == 0 && revision == 13 && subrevision == 64) return V113d;
|
||||
if (minor == 14 && revision == 0 && subrevision == 64) return V114a;
|
||||
if (minor == 14 && revision == 1 && subrevision == 68) return V114b;
|
||||
if (minor == 14 && revision == 2 && subrevision == 70) return V114c;
|
||||
if (minor == 14 && revision == 3 && subrevision == 71) return V114d;
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
eGameVersion GetD2Version(char* gameExe)
|
||||
{
|
||||
DWORD len = GetFileVersionInfoSize(gameExe, NULL);
|
||||
if (len == 0)
|
||||
return UNKNOWN;
|
||||
|
||||
BYTE* pVersionResource = new BYTE[len];
|
||||
GetFileVersionInfo(gameExe, NULL, len, pVersionResource);
|
||||
eGameVersion version = GetD2Version(pVersionResource);
|
||||
delete pVersionResource;
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
eGameVersion GetD2Version(HMODULE hModule)
|
||||
{
|
||||
HRSRC hResInfo = FindResource(hModule, MAKEINTRESOURCE(VS_VERSION_INFO), RT_VERSION);
|
||||
if (!hResInfo) return UNKNOWN;
|
||||
HGLOBAL hResData = LoadResource(hModule, hResInfo);
|
||||
if (!hResData) return UNKNOWN;
|
||||
LPVOID pVersionResource = LockResource(hResData);
|
||||
eGameVersion version = GetD2Version(pVersionResource);
|
||||
FreeResource(hResData);
|
||||
return version;
|
||||
}
|
||||
|
||||
///////////////////////// END OF FILE ///////////////////////
|
36
Commons/VersionInfo.h
Normal file
36
Commons/VersionInfo.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Get Game version.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
enum eGameVersion
|
||||
{
|
||||
UNKNOWN = -1,
|
||||
V100 = 0,
|
||||
V107,
|
||||
V108,
|
||||
V109,
|
||||
V109b,
|
||||
V109d,
|
||||
V110,
|
||||
V111,
|
||||
V111b,
|
||||
V112,
|
||||
V113c,
|
||||
V113d,
|
||||
V114a,
|
||||
V114b,
|
||||
V114c,
|
||||
V114d
|
||||
};
|
||||
|
||||
const char* GetVersionString(int version);
|
||||
eGameVersion GetD2Version(char* gamePath);
|
||||
eGameVersion GetD2Version(HMODULE hModule);
|
||||
|
||||
///////////////////////// END OF FILE ///////////////////////
|
1061
Commons/d2BinFile.h
1061
Commons/d2BinFile.h
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
@brief Diablo II Tbl Structures definitions.
|
||||
@brief Diablo II Tbl Structures definitions.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
NOT TESTED IN 1.10 (1.09b)
|
||||
NOT TESTED IN 1.10 (1.09b)
|
||||
|
||||
=================================================================*/
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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
|
||||
@ -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 */
|
||||
|
@ -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.
|
||||
*/
|
||||
/*==================================================================================*/
|
||||
@ -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,
|
||||
BRIGHT_WHITE=18,
|
||||
GOLD=4,
|
||||
DARK_YELLOW=7,
|
||||
YELLOW=9,
|
||||
ORANGE=8,
|
||||
DARKEST_GREEN=10,
|
||||
DARK_GREEN=12,
|
||||
GREEN=2,
|
||||
BLUE=3,
|
||||
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
|
||||
PURPLE=11,
|
||||
RED=1,
|
||||
CRYSTAL_RED=19,
|
||||
// VERY_WIERD=17,
|
||||
};
|
||||
|
||||
enum D2Lang
|
||||
@ -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
|
||||
@ -445,7 +445,7 @@ enum D2Mod
|
||||
DEXTERITY,
|
||||
VITALITY,
|
||||
ENERGY,
|
||||
MAXMANA,
|
||||
MAXMANA,
|
||||
MAXMANA_PERCENT,
|
||||
MAXHP,
|
||||
MAXHP_PERCENT,
|
||||
@ -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,
|
||||
|
@ -11,6 +11,7 @@ enum UpdateClientConst
|
||||
{
|
||||
UC_SELECT_STASH=0x18,
|
||||
UC_SHARED_GOLD,
|
||||
UC_PAGE_NAME,
|
||||
UC_ADD_STAT,
|
||||
UC_ADD_SYNERGY,
|
||||
UC_TEST1,
|
||||
@ -40,15 +41,28 @@ enum UpdateServerConst
|
||||
US_SELECT_PREVIOUS_INDEX2,
|
||||
US_SELECT_NEXT_INDEX2,
|
||||
US_WORLDEVENT,
|
||||
US_STARTSAVE,
|
||||
US_SAVE,
|
||||
US_MAXGOLD,
|
||||
US_PUTGOLD,
|
||||
US_TAKEGOLD,
|
||||
|
||||
//For CB
|
||||
US_TEST1,
|
||||
US_TEST2,
|
||||
US_TEST3
|
||||
US_RENAME,
|
||||
US_PAGENAME,
|
||||
US_SET_INDEX,
|
||||
US_SET_MAIN_INDEX,
|
||||
US_RESET_INDEX,
|
||||
US_INSERT_PAGE,
|
||||
US_DELETE_PAGE,
|
||||
US_SWAP3,
|
||||
US_SWAP2,
|
||||
US_SWAP1,
|
||||
US_SWAP0,
|
||||
US_SWAP0_TOGGLE,
|
||||
US_TOGGLE1,
|
||||
US_TOGGLE2,
|
||||
US_TOGGLE3,
|
||||
US_TEST1, //For CB
|
||||
US_TEST2, //For CB
|
||||
US_TEST3 //For CB
|
||||
};
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
887
HD_fix.patch
Normal file
887
HD_fix.patch
Normal file
@ -0,0 +1,887 @@
|
||||
diff --git a/PlugY/InfinityStash.cpp b/PlugY/InfinityStash.cpp
|
||||
index 22e9c35..ea09d36 100644
|
||||
--- a/PlugY/InfinityStash.cpp
|
||||
+++ b/PlugY/InfinityStash.cpp
|
||||
@@ -26,6 +26,7 @@ bool active_sharedStash = false;
|
||||
bool separateHardSoftStash = false;
|
||||
bool active_sharedGold=false;
|
||||
char* sharedStashFilename = NULL;
|
||||
+DWORD saveFileStackSize = 0x2000;
|
||||
|
||||
typedef int (*TchangeToSelectedStash)(Unit* ptChar, Stash* newStash, DWORD bOnlyItems, DWORD bIsClient);
|
||||
|
||||
@@ -422,7 +423,7 @@ void saveStashList(Unit* ptChar, Stash* ptStash, BYTE** data, DWORD* maxSize, DW
|
||||
|
||||
while(ptStash)
|
||||
{
|
||||
- if (*curSize + 0x2000 > *maxSize)
|
||||
+ if (*curSize + saveFileStackSize > *maxSize)
|
||||
{
|
||||
BYTE* oldData = *data;
|
||||
*maxSize *= 2;
|
||||
diff --git a/PlugY/Interface_Skills.cpp b/PlugY/Interface_Skills.cpp
|
||||
index 90178f7..8a07c2a 100644
|
||||
--- a/PlugY/Interface_Skills.cpp
|
||||
+++ b/PlugY/Interface_Skills.cpp
|
||||
@@ -49,9 +49,10 @@ Unit* STDCALL skillsPageMouseDown(sWinMessage* msg)
|
||||
if (active_SkillsPoints && !onRealm && D2isLODGame() && isOnButtonUnassignSkill(D2GetMouseX(),D2GetMouseY()))
|
||||
{
|
||||
log_msg("push down left button unassign skill\n");
|
||||
- btnSkillIsDown = 1;
|
||||
+ //btnSkillIsDown = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
freeMessage(msg);
|
||||
+ updateServer(US_UNASSIGN_SKILLS);
|
||||
return NULL;
|
||||
}
|
||||
return ptChar;
|
||||
@@ -233,6 +234,7 @@ void Install_InterfaceSkills()
|
||||
//6FAE1112 > C745 18 00000000 MOV DWORD PTR SS:[EBP+18],0
|
||||
//004ABC1A |> C746 18 00000000 MOV DWORD PTR DS:[ESI+18],0
|
||||
|
||||
+ /* Conflicts with D2ExpRes
|
||||
// Manage mouse up
|
||||
mem_seek R8(D2Client, 7BC40, 7BC40, 78466, 17558, 8C078, 80248, 795F8, 30AA8, ABC96);
|
||||
MEMJ_REF4( D2FreeWinMessage, caller_skillsPageMouseUp);//0xFFF93B0A
|
||||
@@ -243,6 +245,7 @@ void Install_InterfaceSkills()
|
||||
//6FB295F7 .^E9 8828F9FF JMP <JMP.&Storm.#511>
|
||||
//6FAE0AA7 .^E9 E0B2FDFF JMP <JMP.&Storm.#511>
|
||||
//004ABC95 |. E8 F645F7FF CALL Game.00420290
|
||||
+ */
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
diff --git a/PlugY/Interface_Stats.cpp b/PlugY/Interface_Stats.cpp
|
||||
index 85e6029..1d3a4cf 100644
|
||||
--- a/PlugY/Interface_Stats.cpp
|
||||
+++ b/PlugY/Interface_Stats.cpp
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
+/*
|
||||
static struct
|
||||
{
|
||||
union{
|
||||
@@ -35,6 +36,7 @@ static struct
|
||||
#define getYNextPageBtn() RY(D2GetResolution()?0x40:0x70)
|
||||
#define getHNextPageBtn() 32
|
||||
#define isOnNextPageBtn(x,y) isOnRect(x, y, getXNextPageBtn(), getYNextPageBtn(), getLNextPageBtn(), getHNextPageBtn())
|
||||
+*/
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +51,7 @@ void STDCALL printStatsPageBtns()
|
||||
sDrawImageInfo data;
|
||||
ZeroMemory(&data,sizeof(data));
|
||||
|
||||
- if (printBackgroundOnMainPage && D2GetResolution())
|
||||
+ if (printBackgroundOnMainPage)
|
||||
{
|
||||
setImage(&data, statsBackgroundImages);
|
||||
setFrame(&data, 1);
|
||||
@@ -57,16 +59,14 @@ void STDCALL printStatsPageBtns()
|
||||
}
|
||||
|
||||
setImage(&data, D2LoadBuySelBtn());
|
||||
- if (D2GetResolution())
|
||||
- {
|
||||
- setFrame(&data, 12 + isDownBtn.previousPage);
|
||||
- D2PrintImage(&data, getXPreviousPageBtn(), getYPreviousPageBtn(), -1, 5, 0);
|
||||
- }
|
||||
+ setFrame(&data, 12 + isDownBtn.previousPage);
|
||||
+ D2PrintImage(&data, getXPreviousPageBtn(), getYPreviousPageBtn(), -1, 5, 0);
|
||||
+
|
||||
setFrame(&data, 14 + isDownBtn.nextPage);
|
||||
D2PrintImage(&data, getXNextPageBtn(), getYNextPageBtn(), -1, 5, 0);
|
||||
|
||||
D2SetFont(1);
|
||||
- if (D2GetResolution() && isOnPreviousPageBtn(mx,my)) //print popup "previous page"
|
||||
+ if (isOnPreviousPageBtn(mx,my)) //print popup "previous page"
|
||||
{
|
||||
lpText = getLocalString(STR_PREVIOUS_PAGE);
|
||||
D2PrintPopup(lpText, getXPreviousPageBtn()+getLPreviousPageBtn()/2, getYPreviousPageBtn()-getHPreviousPageBtn(), WHITE, 1);
|
||||
@@ -84,6 +84,12 @@ Unit* STDCALL statsPageMouseDown(sWinMessage* msg)
|
||||
|
||||
if (!active_newInterfaces || !D2isLODGame() ) return ptChar;
|
||||
|
||||
+ if (statsLeftDown(msg)) {
|
||||
+ freeMessage(msg);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
if (D2GetResolution() && isOnPreviousPageBtn(msg->x,msg->y))
|
||||
{
|
||||
log_msg("push down left button previous page\n");
|
||||
@@ -100,6 +106,7 @@ Unit* STDCALL statsPageMouseDown(sWinMessage* msg)
|
||||
freeMessage(msg);
|
||||
return NULL;
|
||||
}
|
||||
+ */
|
||||
return ptChar;
|
||||
}
|
||||
|
||||
@@ -110,6 +117,13 @@ Unit* STDCALL statsPageMouseUp(sWinMessage* msg)
|
||||
|
||||
if (!active_newInterfaces || !D2isLODGame() ) return ptChar;
|
||||
|
||||
+ if (statsLeftUp(msg)) {
|
||||
+ isDownBtn.all=0;
|
||||
+ freeMessage(msg);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
if (D2GetResolution() && isOnPreviousPageBtn(msg->x,msg->y))
|
||||
{
|
||||
log_msg("push up left button previous page\n");
|
||||
@@ -134,6 +148,7 @@ Unit* STDCALL statsPageMouseUp(sWinMessage* msg)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
+ */
|
||||
|
||||
isDownBtn.all=0;
|
||||
return ptChar;
|
||||
diff --git a/PlugY/LocalizedStrings.cpp b/PlugY/LocalizedStrings.cpp
|
||||
index 70595ee..3c76d87 100644
|
||||
--- a/PlugY/LocalizedStrings.cpp
|
||||
+++ b/PlugY/LocalizedStrings.cpp
|
||||
@@ -51,7 +51,7 @@ LPCWSTR getLocalTypeString(DWORD code)
|
||||
{
|
||||
if (sLocalizedTypeStrings[i].code == code)
|
||||
{
|
||||
- log_msg("Code=%08X\n", code);
|
||||
+ //log_msg("Code=%08X\n", code);
|
||||
if (sLocalizedTypeStrings[i].itemStr)
|
||||
return StripGender(D2GetStringFromString(sLocalizedTypeStrings[i].itemStr));
|
||||
LPWSTR text = StripGender(sLocalizedTypeStrings[i].typeLocalizedString);
|
||||
@@ -300,6 +300,8 @@ void loadLocalizedStrings(int language)
|
||||
LOAD(STR_SHARED_GOLD_QUANTITY);
|
||||
LOAD(STR_PREVIOUS_PAGE);
|
||||
LOAD(STR_NEXT_PAGE);
|
||||
+ LOAD(STR_PREVIOUS_RUNE);
|
||||
+ LOAD(STR_NEXT_RUNE);
|
||||
LOAD(STR_ITEM_LEVEL);
|
||||
LOAD(STR_PAGE_TYPE_CHANGE);
|
||||
|
||||
diff --git a/PlugY/LocalizedStrings.h b/PlugY/LocalizedStrings.h
|
||||
index 9fb08e7..0e7b83d 100644
|
||||
--- a/PlugY/LocalizedStrings.h
|
||||
+++ b/PlugY/LocalizedStrings.h
|
||||
@@ -37,6 +37,8 @@ enum eStringList
|
||||
STR_SHARED_GOLD_QUANTITY,
|
||||
STR_PREVIOUS_PAGE,
|
||||
STR_NEXT_PAGE,
|
||||
+ STR_PREVIOUS_RUNE,
|
||||
+ STR_NEXT_RUNE,
|
||||
STR_ITEM_LEVEL,
|
||||
STR_PAGE_TYPE_CHANGE,
|
||||
//
|
||||
diff --git a/PlugY/NewInterface_CubeListing.cpp b/PlugY/NewInterface_CubeListing.cpp
|
||||
index 1c54331..d50c8bc 100644
|
||||
--- a/PlugY/NewInterface_CubeListing.cpp
|
||||
+++ b/PlugY/NewInterface_CubeListing.cpp
|
||||
@@ -233,12 +233,6 @@ DWORD print(CubeMainBIN* curForm, LPWSTR buf, LPINT len, DWORD)//maxsize)
|
||||
printInputItem(&curForm->input6, buf, len, &realNbInputs);
|
||||
printInputItem(&curForm->input7, buf, len, &realNbInputs);
|
||||
|
||||
- if (realNbInputs != curForm->numinputs)
|
||||
- {
|
||||
- PRINT(BUF, L" *** ERROR : numInputs(%d) != realNbInputs(%d) ***", curForm->numinputs, realNbInputs);
|
||||
- return 1;
|
||||
- }
|
||||
-
|
||||
PRINT(BUF,L" => ");
|
||||
int realNbOutputs=0;
|
||||
|
||||
@@ -269,6 +263,9 @@ DWORD print(CubeMainBIN* curForm, LPWSTR buf, LPINT len, DWORD)//maxsize)
|
||||
// if (curForm->version == 100)
|
||||
// sprintf(BUF, " [expansion only]");
|
||||
|
||||
+ if (realNbInputs != curForm->numinputs)
|
||||
+ PRINT(BUF, L" *** ERROR : numInputs(%d) != realNbInputs(%d) ***", curForm->numinputs, realNbInputs);
|
||||
+
|
||||
return 1;
|
||||
}
|
||||
#undef BUF
|
||||
diff --git a/PlugY/NewInterface_Runewords.cpp b/PlugY/NewInterface_Runewords.cpp
|
||||
index 99d1f38..13efd9f 100644
|
||||
--- a/PlugY/NewInterface_Runewords.cpp
|
||||
+++ b/PlugY/NewInterface_Runewords.cpp
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
+/*
|
||||
#define NB_RUNES_PER_PAGE 25
|
||||
|
||||
#define getXCloseBtn() 360
|
||||
@@ -53,6 +54,7 @@ static struct
|
||||
};
|
||||
};
|
||||
} isDownBtn;
|
||||
+*/
|
||||
|
||||
|
||||
void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
@@ -64,7 +66,7 @@ void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
D2SetFont(6);
|
||||
DWORD nbPixel = D2GetPixelLen(lpText);
|
||||
DWORD x1 = (nbPixel >= 195) ? 0 : 195-nbPixel;
|
||||
- D2PrintString(lpText, x1, 10 + pos*20, GOLD, 0);//MILIEU(0x00,0x70,nbPixel)
|
||||
+ D2PrintString(lpText, posXRunesList + RX(x1), posYRunesList + 10 + pos*20, GOLD, 0);//MILIEU(0x00,0x70,nbPixel)
|
||||
|
||||
typesList[0]=L'\0';
|
||||
DWORD numItype=0;
|
||||
@@ -80,7 +82,7 @@ void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
}
|
||||
nbPixel = D2GetPixelLen(typesList);
|
||||
x1 = (nbPixel >= 195) ? 0 : 195-nbPixel;
|
||||
- D2PrintString(typesList, x1, 20 + pos*20, WHITE, 0);//MILIEU(0x70,0xA0,nbPixel)
|
||||
+ D2PrintString(typesList, posXRunesList + RX(x1), posYRunesList + 20 + pos*20, WHITE, 0);//MILIEU(0x70,0xA0,nbPixel)
|
||||
|
||||
runesList[0]=L'\0';
|
||||
DWORD numRune=0;
|
||||
@@ -115,7 +117,7 @@ void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
}
|
||||
|
||||
// x1 = (nbPixel < 145) ? 155 : 300-nbPixel;
|
||||
- D2PrintString(runesList, x1, y1 + pos*20, WHITE, 0);//MILIEU(0xD0,0xA0,nbPixel)
|
||||
+ D2PrintString(runesList, posXRunesList + RX(x1), posYRunesList + y1 + pos*20, WHITE, 0);//MILIEU(0xD0,0xA0,nbPixel)
|
||||
}
|
||||
|
||||
|
||||
@@ -123,48 +125,58 @@ void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
//6FB21FAA
|
||||
void STDCALL printRunewordsPage()
|
||||
{
|
||||
- if (!D2isLODGame() || !D2GetResolution()) return D2PrintStatsPage();
|
||||
+ if (!D2isLODGame()) return D2PrintStatsPage();
|
||||
|
||||
LPWSTR lpText;
|
||||
- bDontPrintBorder = true;
|
||||
+ bDontPrintBorder = D2GetResolution()? true : false;
|
||||
|
||||
//Init data for print image
|
||||
sDrawImageInfo data;
|
||||
ZeroMemory(&data,sizeof(data));
|
||||
|
||||
//print background
|
||||
-/* setImage(&data, newStatsInterfaceImages);
|
||||
+ fillRect(RX(0), RY(ResolutionY), 512, 768, 0, 5);
|
||||
+ setImage(&data, newStatsInterfaceImages);
|
||||
setFrame(&data, 0);
|
||||
- D2PrintImage(&data, 0, 256, -1, 5, 0);
|
||||
+ D2PrintImage(&data, RX(0), RY(ResolutionY-256), -1, 5, 0);
|
||||
setFrame(&data, 1);
|
||||
- D2PrintImage(&data, 256,256, -1, 5, 0);
|
||||
+ D2PrintImage(&data, RX(256),RY(ResolutionY-256), -1, 5, 0);
|
||||
setFrame(&data, 2);
|
||||
- D2PrintImage(&data, 0, 512, -1, 5, 0);
|
||||
+ D2PrintImage(&data, RX(0), RY(ResolutionY-256*2), -1, 5, 0);
|
||||
setFrame(&data, 3);
|
||||
- D2PrintImage(&data, 256,512, -1, 5, 0);
|
||||
+ D2PrintImage(&data, RX(256),RY(ResolutionY-256*2), -1, 5, 0);
|
||||
setFrame(&data, 4);
|
||||
- D2PrintImage(&data, 0, 552, -1, 5, 0);
|
||||
+ D2PrintImage(&data, RX(0), RY(ResolutionY-256*3), -1, 5, 0);
|
||||
setFrame(&data, 5);
|
||||
- D2PrintImage(&data, 256,552, -1, 5, 0);
|
||||
-*/
|
||||
- fillRect(0,0,400,552,0,5);
|
||||
+ D2PrintImage(&data, RX(256),RY(ResolutionY-256*3), -1, 5, 0);
|
||||
+
|
||||
+ if (printBackgroundOnMainPage)
|
||||
+ {
|
||||
+ setImage(&data, statsBackgroundImages);
|
||||
+ setFrame(&data, 1);
|
||||
+ D2PrintImage(&data, getXPreviousPageBtn()-7, getYPreviousPageBtn()+8, -1, 5, 0);
|
||||
+ D2PrintImage(&data, getXPrevRunesBtn()-7, getYPrevRunesBtn()+8, -1, 5, 0);
|
||||
+ }
|
||||
|
||||
//print button close
|
||||
setImage(&data, D2LoadBuySelBtn());
|
||||
setFrame(&data, 10 + isDownBtn.close);
|
||||
D2PrintImage(&data, getXCloseBtn(), getYCloseBtn(), -1, 5, 0);
|
||||
|
||||
+ //print previous page button
|
||||
+ setFrame(&data, 12 + isDownBtn.previousPage);
|
||||
+ D2PrintImage(&data, getXPreviousPageBtn(), getYPreviousPageBtn(), -1, 5, 0);
|
||||
+
|
||||
//print next page button
|
||||
- setFrame(&data, isDownBtn.nextPage);
|
||||
+ setFrame(&data, 14 + isDownBtn.nextPage);
|
||||
D2PrintImage(&data, getXNextPageBtn(), getYNextPageBtn(), -1, 5, 0);
|
||||
|
||||
//print previous runes button
|
||||
- setImage(&data, stashBtnsImages);
|
||||
- setFrame(&data, isDownBtn.prevRunes);
|
||||
+ setFrame(&data, 12 + isDownBtn.prevRunes);
|
||||
D2PrintImage(&data, getXPrevRunesBtn(), getYPrevRunesBtn(), -1, 5, 0);
|
||||
|
||||
//print previous runes button
|
||||
- setFrame(&data, 2 + isDownBtn.nextRunes);
|
||||
+ setFrame(&data, 14 + isDownBtn.nextRunes);
|
||||
D2PrintImage(&data, getXNextRunesBtn(), getYNextRunesBtn(), -1, 5, 0);
|
||||
|
||||
D2SetFont(6);
|
||||
@@ -181,11 +193,11 @@ void STDCALL printRunewordsPage()
|
||||
{
|
||||
if (!runesData->Complete || runesData->Server) continue;
|
||||
nbRunesCompleted++;
|
||||
- if ( (curRunesPage * NB_RUNES_PER_PAGE < nbRunesCompleted) &&
|
||||
- (nbRunesCompleted <= (curRunesPage+1) * NB_RUNES_PER_PAGE) )
|
||||
+ if ( (curRunesPage * runesPerPage < nbRunesCompleted) &&
|
||||
+ (nbRunesCompleted <= (curRunesPage+1) * runesPerPage) )
|
||||
printRuneword(runesData, curNbRunes++);
|
||||
}
|
||||
- maxRunesPage = nbRunesCompleted ? (nbRunesCompleted-1) / NB_RUNES_PER_PAGE : 0;
|
||||
+ maxRunesPage = nbRunesCompleted ? (nbRunesCompleted-1) / runesPerPage : 0;
|
||||
|
||||
|
||||
//////////////////// POPUP PRINTING ////////////////////
|
||||
@@ -197,11 +209,26 @@ void STDCALL printRunewordsPage()
|
||||
{
|
||||
D2PrintPopup(D2GetStringFromIndex(0x1030), getXCloseBtn()+getLCloseBtn()/2, getYCloseBtn()-getHCloseBtn(), WHITE, 1);
|
||||
}
|
||||
+ else if (isOnPreviousPageBtn(x,y)) //print popup "previous page"
|
||||
+ {
|
||||
+ lpText = getLocalString(STR_PREVIOUS_PAGE);
|
||||
+ D2PrintPopup(lpText, getXPreviousPageBtn()+getLPreviousPageBtn()/2, getYPreviousPageBtn()-getHPreviousPageBtn(), WHITE, 1);
|
||||
+ }
|
||||
else if (isOnNextPageBtn(x,y)) // print popup "next page"
|
||||
{
|
||||
lpText = getLocalString(STR_NEXT_PAGE);
|
||||
D2PrintPopup(lpText, getXNextPageBtn()+getLNextPageBtn()/2, getYNextPageBtn()-getHNextPageBtn(), WHITE, 1);
|
||||
}
|
||||
+ else if (isOnPrevRunesBtn(x,y)) // print popup "previous rune"
|
||||
+ {
|
||||
+ lpText = getLocalString(STR_PREVIOUS_RUNE);
|
||||
+ D2PrintPopup(lpText, getXPrevRunesBtn()+getLPrevRunesBtn()/2, getYPrevRunesBtn()-getHPrevRunesBtn(), WHITE, 1);
|
||||
+ }
|
||||
+ else if (isOnNextRunesBtn(x,y)) // print popup "next rune"
|
||||
+ {
|
||||
+ lpText = getLocalString(STR_NEXT_RUNE);
|
||||
+ D2PrintPopup(lpText, getXNextRunesBtn()+getLNextRunesBtn()/2, getYNextRunesBtn()-getHNextRunesBtn(), WHITE, 1);
|
||||
+ }
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
diff --git a/PlugY/NewInterface_Stats.cpp b/PlugY/NewInterface_Stats.cpp
|
||||
index 10fa32d..d73c5da 100644
|
||||
--- a/PlugY/NewInterface_Stats.cpp
|
||||
+++ b/PlugY/NewInterface_Stats.cpp
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
+/*
|
||||
#define getXCloseBtn() 360
|
||||
#define getLCloseBtn() 32
|
||||
#define getYCloseBtn() (ResolutionY - 60)
|
||||
@@ -92,6 +93,7 @@ void** ptD2AssignStatsPointsBtnImages = (void**)0x6FBB5BB4;
|
||||
|
||||
|
||||
|
||||
+/*
|
||||
static struct
|
||||
{
|
||||
union{
|
||||
@@ -111,6 +113,7 @@ static struct
|
||||
};
|
||||
};
|
||||
} isDownBtn;
|
||||
+*/
|
||||
|
||||
|
||||
void print2Lines(WORD id, LPWSTR lpText, DWORD x, DWORD l, DWORD y)
|
||||
diff --git a/PlugY/NewInterface_StatsPageTwo.cpp b/PlugY/NewInterface_StatsPageTwo.cpp
|
||||
index dfdc8a1..6215dd6 100644
|
||||
--- a/PlugY/NewInterface_StatsPageTwo.cpp
|
||||
+++ b/PlugY/NewInterface_StatsPageTwo.cpp
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
+/*
|
||||
#define getXCloseBtn() RX(0x110)
|
||||
#define getLCloseBtn() 32
|
||||
#define getYCloseBtn() RY(0x40)
|
||||
@@ -29,11 +30,13 @@
|
||||
#define getYNextPageBtn() RY(0x40)
|
||||
#define getHNextPageBtn() 32
|
||||
#define isOnNextPageBtn(x,y) isOnRect(x, y, getXNextPageBtn(), getYNextPageBtn(), getLNextPageBtn(), getHNextPageBtn())
|
||||
+*/
|
||||
|
||||
const char * STATS_INTERFACE_FILENAME = "PlugY\\statsinterface.txt";
|
||||
|
||||
#define BUFSIZE 0x400
|
||||
|
||||
+/*
|
||||
static struct
|
||||
{
|
||||
union{
|
||||
@@ -45,6 +48,7 @@ static struct
|
||||
};
|
||||
};
|
||||
} isDownBtn;
|
||||
+*/
|
||||
|
||||
|
||||
struct statsInterfaceBIN
|
||||
@@ -337,8 +341,7 @@ void STDCALL printNewStatsPageTwo(int currentPage)
|
||||
|
||||
WCHAR text[BUFSIZE];
|
||||
LPWSTR lpText;
|
||||
- bDontPrintBorder = false;
|
||||
-
|
||||
+ bDontPrintBorder = D2GetResolution()? true : false;
|
||||
Unit* ptChar = D2GetClientPlayer();
|
||||
|
||||
d2_assert(!ptChar, "Printing stats page : no character selected",__FILE__,__LINE__);
|
||||
@@ -349,16 +352,20 @@ void STDCALL printNewStatsPageTwo(int currentPage)
|
||||
ZeroMemory(&data,sizeof(data));
|
||||
|
||||
//print background
|
||||
- fillRect(RX(0),RY(480),320,432,0,5);//552
|
||||
+ fillRect(RX(0), RY(ResolutionY), 512, 768, 0, 5);
|
||||
setImage(&data, newStatsInterfaceImages);
|
||||
setFrame(&data, 0);
|
||||
- D2PrintImage(&data, RX(0), RY(224), -1, 5, 0);
|
||||
+ D2PrintImage(&data, RX(0), RY(ResolutionY-256), -1, 5, 0);
|
||||
setFrame(&data, 1);
|
||||
- D2PrintImage(&data, RX(256),RY(224), -1, 5, 0);//256
|
||||
+ D2PrintImage(&data, RX(256),RY(ResolutionY-256), -1, 5, 0);
|
||||
setFrame(&data, 2);
|
||||
- D2PrintImage(&data, RX(0), RY(48), -1, 5, 0);//432
|
||||
+ D2PrintImage(&data, RX(0), RY(ResolutionY-256*2), -1, 5, 0);
|
||||
setFrame(&data, 3);
|
||||
- D2PrintImage(&data, RX(256),RY(48), -1, 5, 0);
|
||||
+ D2PrintImage(&data, RX(256),RY(ResolutionY-256*2), -1, 5, 0);
|
||||
+ setFrame(&data, 4);
|
||||
+ D2PrintImage(&data, RX(0), RY(ResolutionY-256*3), -1, 5, 0);
|
||||
+ setFrame(&data, 5);
|
||||
+ D2PrintImage(&data, RX(256),RY(ResolutionY-256*3), -1, 5, 0);
|
||||
|
||||
D2SetFont(1);
|
||||
for (int i=0; i<nbStatsInterface; i++)
|
||||
@@ -392,10 +399,12 @@ void STDCALL printNewStatsPageTwo(int currentPage)
|
||||
D2PrintString(text, x, y, WHITE, 0);
|
||||
*/
|
||||
|
||||
- //print background previous/next page buttons
|
||||
- setImage(&data, statsBackgroundImages);
|
||||
- setFrame(&data, D2GetResolution()?1:0);
|
||||
- D2PrintImage(&data, getXPreviousPageBtn()-7, getYPreviousPageBtn()+8, -1, 5, 0);
|
||||
+ if (printBackgroundOnMainPage) {
|
||||
+ //print background previous/next page buttons
|
||||
+ setImage(&data, statsBackgroundImages);
|
||||
+ setFrame(&data, 1);
|
||||
+ D2PrintImage(&data, getXPreviousPageBtn()-7, getYPreviousPageBtn()+8, -1, 5, 0);
|
||||
+ }
|
||||
|
||||
//print button close
|
||||
setImage(&data, D2LoadBuySelBtn());
|
||||
diff --git a/PlugY/NewInterfaces.cpp b/PlugY/NewInterfaces.cpp
|
||||
index 2bcb2f1..91003fb 100644
|
||||
--- a/PlugY/NewInterfaces.cpp
|
||||
+++ b/PlugY/NewInterfaces.cpp
|
||||
@@ -22,11 +22,39 @@ bool active_newInterfaces=false;
|
||||
bool selectMainPageOnOpenning=true;
|
||||
bool printBackgroundOnMainPage=true;
|
||||
|
||||
+int posXNextPageBtn = -1;
|
||||
+int posYNextPageBtn = -1;
|
||||
+int posXPrevPageBtn = -1;
|
||||
+int posYPrevPageBtn = -1;
|
||||
+int posXClosePageBtn = -1;
|
||||
+int posYClosePageBtn = -1;
|
||||
+int posXNextRuneBtn = -1;
|
||||
+int posYNextRuneBtn = -1;
|
||||
+int posXPrevRuneBtn = -1;
|
||||
+int posYPrevRuneBtn = -1;
|
||||
+int posXRunesList = -1;
|
||||
+int posYRunesList = -1;
|
||||
+int runesPerPage = -1;
|
||||
+
|
||||
+DWORD getXNextPageBtn() {return RX(posXNextPageBtn);}
|
||||
+DWORD getYNextPageBtn() {return RY(posYNextPageBtn);}
|
||||
+DWORD getXPreviousPageBtn() {return RX(posXPrevPageBtn);}
|
||||
+DWORD getYPreviousPageBtn() {return RY(posYPrevPageBtn);}
|
||||
+DWORD getXCloseBtn() {return RX(posXClosePageBtn);}
|
||||
+DWORD getYCloseBtn() {return RY(posYClosePageBtn);}
|
||||
+DWORD getXNextRunesBtn() {return RX(posXNextRuneBtn);}
|
||||
+DWORD getYNextRunesBtn() {return RY(posYNextRuneBtn);}
|
||||
+DWORD getXPrevRunesBtn() {return RX(posXPrevRuneBtn);}
|
||||
+DWORD getYPrevRunesBtn() {return RY(posYPrevRuneBtn);}
|
||||
+
|
||||
DWORD bDontPrintBorder=false;
|
||||
|
||||
int selectedPage=0;
|
||||
int lastPage=0;
|
||||
int extraHiddenPage=0;
|
||||
+int curRunesPage=0;
|
||||
+int maxRunesPage=0xFFFF;
|
||||
+BtnState isDownBtn={0};
|
||||
|
||||
void GoNextStatPage()
|
||||
{
|
||||
@@ -44,8 +72,12 @@ void GoPreviousStatPage()
|
||||
|
||||
void GoStatPage(int page)
|
||||
{
|
||||
- if ( (page >= 0) && (page <= lastPage + (D2GetResolution()? extraHiddenPage : 0)) )
|
||||
+ if ( (page >= 0) && (page <= (lastPage + extraHiddenPage)) )
|
||||
selectedPage = page;
|
||||
+ else if (page < 0)
|
||||
+ selectedPage = lastPage + extraHiddenPage;
|
||||
+ else
|
||||
+ selectedPage = 0;
|
||||
}
|
||||
|
||||
int GetCurrentPage()
|
||||
@@ -83,6 +115,16 @@ DWORD STDCALL mouseCustomPageLeftDown(sWinMessage* msg)
|
||||
DWORD STDCALL mouseCustomPageLeftUp(sWinMessage* msg)
|
||||
{
|
||||
if(onRealm) return -1;
|
||||
+
|
||||
+ if (selectedPage == 0) return -1;
|
||||
+ if (!isOnStatsPage(msg->x,msg->y)) return 1;
|
||||
+ statsLeftUp(msg);
|
||||
+ D2CleanStatMouseUp();
|
||||
+ freeMessage(msg);
|
||||
+ isDownBtn.all=0;
|
||||
+ return 0;
|
||||
+
|
||||
+ /*
|
||||
if ( (selectedPage > 0) && (selectedPage <= lastPage) )
|
||||
return mouseNewStatsPageTwoLeftUp(msg);
|
||||
else if (selectedPage == lastPage+1)
|
||||
@@ -91,6 +133,87 @@ DWORD STDCALL mouseCustomPageLeftUp(sWinMessage* msg)
|
||||
return mouseNewStatsPageLeftUp(msg);
|
||||
else
|
||||
return -1;
|
||||
+ */
|
||||
+}
|
||||
+
|
||||
+DWORD STDCALL statsLeftDown(sWinMessage* msg)
|
||||
+{
|
||||
+ if (isOnCloseBtn(msg->x,msg->y) && selectedPage != 0)
|
||||
+ {
|
||||
+ log_msg("push down left button close\n");
|
||||
+ isDownBtn.close = 1;
|
||||
+ D2PlaySound(4,0,0,0,0);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ else if (isOnPreviousPageBtn(msg->x,msg->y))
|
||||
+ {
|
||||
+ log_msg("push down left button previous page\n");
|
||||
+ isDownBtn.previousPage = 1;
|
||||
+ D2PlaySound(4,0,0,0,0);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ else if (isOnNextPageBtn(msg->x,msg->y))
|
||||
+ {
|
||||
+ log_msg("push down left button next page\n");
|
||||
+ isDownBtn.nextPage = 1;
|
||||
+ D2PlaySound(4,0,0,0,0);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ else if (isOnPrevRunesBtn(msg->x,msg->y) && selectedPage == (lastPage + extraHiddenPage))
|
||||
+ {
|
||||
+ log_msg("push down left button prev runes\n");
|
||||
+ isDownBtn.prevRunes = 1;
|
||||
+ D2PlaySound(4,0,0,0,0);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ else if (isOnNextRunesBtn(msg->x,msg->y) && selectedPage == (lastPage + extraHiddenPage))
|
||||
+ {
|
||||
+ log_msg("push down left button next runes\n");
|
||||
+ isDownBtn.nextRunes = 1;
|
||||
+ D2PlaySound(4,0,0,0,0);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+DWORD STDCALL statsLeftUp(sWinMessage* msg)
|
||||
+{
|
||||
+ if (isOnCloseBtn(msg->x,msg->y) && selectedPage != 0)
|
||||
+ {
|
||||
+ log_msg("push up left button close\n");
|
||||
+ if (isDownBtn.close)
|
||||
+ D2TogglePage(2,1,0);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ else if (isOnPreviousPageBtn(msg->x,msg->y))
|
||||
+ {
|
||||
+ log_msg("push up left button previous page\n");
|
||||
+ if (isDownBtn.previousPage)
|
||||
+ GoStatPage(selectedPage-1);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ else if (isOnNextPageBtn(msg->x,msg->y))
|
||||
+ {
|
||||
+ log_msg("push up left button next page\n");
|
||||
+ if (isDownBtn.nextPage)
|
||||
+ GoStatPage(selectedPage+1);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ else if (isOnPrevRunesBtn(msg->x,msg->y) && selectedPage == (lastPage + extraHiddenPage))
|
||||
+ {
|
||||
+ log_msg("push up left button prev runes\n");
|
||||
+ if (isDownBtn.prevRunes && curRunesPage)
|
||||
+ curRunesPage--;
|
||||
+ return 1;
|
||||
+ }
|
||||
+ else if (isOnNextRunesBtn(msg->x,msg->y) && selectedPage == (lastPage + extraHiddenPage))
|
||||
+ {
|
||||
+ log_msg("push up left button next runes\n");
|
||||
+ if (isDownBtn.nextRunes && (curRunesPage < maxRunesPage))
|
||||
+ curRunesPage++;
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_DontPrintBorder_114 )
|
||||
@@ -474,6 +597,7 @@ void Install_NewInterfaces()
|
||||
//00498636 |. 6A 48 PUSH 48
|
||||
//00498638 |. 8D45 B8 LEA EAX,DWORD PTR SS:[EBP-48]
|
||||
|
||||
+ /* Conflicts with D2ExpRes
|
||||
// Manage mouse down (Play sound)
|
||||
mem_seek R8(D2Client, 2A9DC, 2A9CC, 312A5, 82736, 891B6, 6B116, BCD36, BF4D6, A7731);
|
||||
memt_byte( 0x8D, 0xE8 ); // CALL
|
||||
@@ -486,6 +610,7 @@ void Install_NewInterfaces()
|
||||
//6FB6CD36 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//6FB6F4D6 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//004A7731 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
+ */
|
||||
|
||||
// Manage mouse up
|
||||
mem_seek R8(D2Client, 2ABBB, 2ABAB, 3148D, 836D9, 8A159, 6C0B9, BDCB9, C0459, A78DA);
|
||||
diff --git a/PlugY/Parameters.cpp b/PlugY/Parameters.cpp
|
||||
index b4dc915..392c112 100644
|
||||
--- a/PlugY/Parameters.cpp
|
||||
+++ b/PlugY/Parameters.cpp
|
||||
@@ -58,6 +58,7 @@ const char* S_dllFilenames2 = "DllToLoad2";
|
||||
const char* S_active_Commands = "ActiveCommands";
|
||||
const char* S_active_CheckMemory = "ActiveCheckMemory";
|
||||
const char* S_active_othersFeatures = "ActiveAllOthersFeatures";
|
||||
+const char* S_saveFileStackSize = "SaveFileStackSize";
|
||||
|
||||
const char* S_WINDOWED = "WINDOWED";
|
||||
const char* S_ActiveWindowed = "ActiveWindowed";
|
||||
@@ -214,6 +215,19 @@ const char* S_INTERFACE = "INTERFACE";
|
||||
const char* S_active_newInterfaces = "ActiveNewStatsInterface";
|
||||
const char* S_selectMainPageOnOpenning = "SelectMainPageOnOpenning";
|
||||
const char* S_printBackgroundOnMainPage = "PrintButtonsBackgroundOnMainStatsPage";
|
||||
+const char* S_posXNextPageBtn = "PosXNextPageBtn";
|
||||
+const char* S_posYNextPageBtn = "PosYNextPageBtn";
|
||||
+const char* S_posXPrevPageBtn = "PosXPrevPageBtn";
|
||||
+const char* S_posYPrevPageBtn = "PosYPrevPageBtn";
|
||||
+const char* S_posXClosePageBtn = "PosXClosePageBtn";
|
||||
+const char* S_posYClosePageBtn = "PosYClosePageBtn";
|
||||
+const char* S_posXNextRuneBtn = "PosXNextRuneBtn";
|
||||
+const char* S_posYNextRuneBtn = "PosYNextRuneBtn";
|
||||
+const char* S_posXPrevRuneBtn = "PosXPrevRuneBtn";
|
||||
+const char* S_posYPrevRuneBtn = "PosYPrevRuneBtn";
|
||||
+const char* S_posXRunesList = "PosXRunesList";
|
||||
+const char* S_posYRunesList = "PosYRunesList";
|
||||
+const char* S_runesPerPage = "RunesPerPage";
|
||||
|
||||
const char* S_EXTRA = "EXTRA";
|
||||
const char* S_active_RunLODs = "ActiveLaunchAnyNumberOfLOD";
|
||||
@@ -316,6 +330,10 @@ void init_General(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDefaultFi
|
||||
active_othersFeatures = atoi(buffer) != 0;
|
||||
log_msg("active_othersFeatures\t\t= %u\n", active_othersFeatures);
|
||||
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_GENERAL, S_saveFileStackSize, "8192");
|
||||
+ saveFileStackSize = atoi(buffer);
|
||||
+ log_msg("SaveFileStackSize\t\t\t= %u\n", saveFileStackSize);
|
||||
+
|
||||
log_msg("\n");
|
||||
}
|
||||
|
||||
@@ -1032,6 +1050,52 @@ void init_NewInterfaces(INIFile* iniFile, INIFile* iniFixedFile, INIFile* iniDef
|
||||
GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_printBackgroundOnMainPage, "1");
|
||||
printBackgroundOnMainPage = atoi(buffer) != 0;
|
||||
log_msg("printBackgroundOnMainPage\t= %u\n", printBackgroundOnMainPage);
|
||||
+
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posXNextPageBtn, "161");
|
||||
+ posXNextPageBtn = atoi(buffer);
|
||||
+ log_msg("posXNextPageBtn\t= %d\n", posXNextPageBtn);
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posYNextPageBtn, "64");
|
||||
+ posYNextPageBtn = atoi(buffer);
|
||||
+ log_msg("posYNextPageBtn\t= %d\n", posYNextPageBtn);
|
||||
+
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posXPrevPageBtn, "119");
|
||||
+ posXPrevPageBtn = atoi(buffer);
|
||||
+ log_msg("posXPrevPageBtn\t= %d\n", posXPrevPageBtn);
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posYPrevPageBtn, "64");
|
||||
+ posYPrevPageBtn = atoi(buffer);
|
||||
+ log_msg("posYPrevPageBtn\t= %d\n", posYPrevPageBtn);
|
||||
+
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posXClosePageBtn, "360");
|
||||
+ posXClosePageBtn = atoi(buffer);
|
||||
+ log_msg("posXClosePageBtn\t= %d\n", posXClosePageBtn);
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posYClosePageBtn, "64");
|
||||
+ posYClosePageBtn = atoi(buffer);
|
||||
+ log_msg("posYClosePageBtn\t= %d\n", posYClosePageBtn);
|
||||
+
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posXNextRuneBtn, "302");
|
||||
+ posXNextRuneBtn = atoi(buffer);
|
||||
+ log_msg("posXNextRuneBtn\t= %d\n", posXNextRuneBtn);
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posYNextRuneBtn, "64");
|
||||
+ posYNextRuneBtn = atoi(buffer);
|
||||
+ log_msg("posYNextRuneBtn\t= %d\n", posYNextRuneBtn);
|
||||
+
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posXPrevRuneBtn, "260");
|
||||
+ posXPrevRuneBtn = atoi(buffer);
|
||||
+ log_msg("posXPrevRuneBtn\t= %d\n", posXPrevRuneBtn);
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posYPrevRuneBtn, "64");
|
||||
+ posYPrevRuneBtn = atoi(buffer);
|
||||
+ log_msg("posYPrevRuneBtn\t= %d\n", posYPrevRuneBtn);
|
||||
+
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posXRunesList, "50");
|
||||
+ posXRunesList = atoi(buffer);
|
||||
+ log_msg("posXRunesList\t= %d\n", posXRunesList);
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_posYRunesList, "45");
|
||||
+ posYRunesList = atoi(buffer);
|
||||
+ log_msg("posYRunesList\t= %d\n", posYRunesList);
|
||||
+
|
||||
+ GET_PRIVATE_PROFILE_STRING(S_INTERFACE, S_runesPerPage, "30");
|
||||
+ runesPerPage = atoi(buffer);
|
||||
+ log_msg("runesPerPage\t= %d\n", runesPerPage);
|
||||
}
|
||||
log_msg("\n");
|
||||
}
|
||||
diff --git a/PlugY/infinityStash.h b/PlugY/infinityStash.h
|
||||
index 0ca6b4d..123705d 100644
|
||||
--- a/PlugY/infinityStash.h
|
||||
+++ b/PlugY/infinityStash.h
|
||||
@@ -18,6 +18,7 @@ extern bool active_sharedStash;
|
||||
extern bool active_sharedGold;
|
||||
extern bool separateHardSoftStash;
|
||||
extern char* sharedStashFilename;
|
||||
+extern DWORD saveFileStackSize;
|
||||
|
||||
extern bool displaySharedSetItemNameInGreen;
|
||||
extern int posXPreviousBtn;
|
||||
diff --git a/PlugY/newInterfaces.h b/PlugY/newInterfaces.h
|
||||
index de51f26..c4c4ff3 100644
|
||||
--- a/PlugY/newInterfaces.h
|
||||
+++ b/PlugY/newInterfaces.h
|
||||
@@ -9,20 +9,94 @@
|
||||
#include "common.h"
|
||||
|
||||
#define MILIEU(X,L,N) (X + ((N<L)? (L-N)/2 : 0))
|
||||
-#define isOnStatsPage(x,y) ((x<400) && (y<553))
|
||||
+#define isOnStatsPage(x,y) (x<RX(512))
|
||||
|
||||
extern DWORD bDontPrintBorder;
|
||||
+extern int selectedPage;
|
||||
extern int extraHiddenPage;
|
||||
+extern int curRunesPage;
|
||||
+extern int maxRunesPage;
|
||||
|
||||
void GoNextStatPage();
|
||||
void GoPreviousStatPage();
|
||||
void GoStatPage(int page);
|
||||
int GetCurrentPage();
|
||||
|
||||
+struct BtnState
|
||||
+{
|
||||
+ union{
|
||||
+ DWORD all;
|
||||
+ struct{
|
||||
+ DWORD AssSTR:1;
|
||||
+ DWORD AssDEX:1;
|
||||
+ DWORD AssVIT:1;
|
||||
+ DWORD AssENE:1;
|
||||
+ DWORD UnaSTR:1;
|
||||
+ DWORD UnaDEX:1;
|
||||
+ DWORD UnaVIT:1;
|
||||
+ DWORD UnaENE:1;
|
||||
+ DWORD close:1;
|
||||
+ DWORD previousPage:1;
|
||||
+ DWORD nextPage:1;
|
||||
+ DWORD prevRunes:1;
|
||||
+ DWORD nextRunes:1;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+extern BtnState isDownBtn;
|
||||
+
|
||||
extern bool active_newInterfaces;
|
||||
extern bool selectMainPageOnOpenning;
|
||||
extern bool printBackgroundOnMainPage;
|
||||
|
||||
+extern int posXNextPageBtn;
|
||||
+extern int posYNextPageBtn;
|
||||
+extern int posXPrevPageBtn;
|
||||
+extern int posYPrevPageBtn;
|
||||
+extern int posXClosePageBtn;
|
||||
+extern int posYClosePageBtn;
|
||||
+extern int posXNextRuneBtn;
|
||||
+extern int posYNextRuneBtn;
|
||||
+extern int posXPrevRuneBtn;
|
||||
+extern int posYPrevRuneBtn;
|
||||
+extern int posXRunesList;
|
||||
+extern int posYRunesList;
|
||||
+extern int runesPerPage;
|
||||
+
|
||||
+DWORD getXNextPageBtn();
|
||||
+DWORD getYNextPageBtn();
|
||||
+DWORD getXPreviousPageBtn();
|
||||
+DWORD getYPreviousPageBtn();
|
||||
+DWORD getXCloseBtn();
|
||||
+DWORD getYCloseBtn();
|
||||
+DWORD getXNextRunesBtn();
|
||||
+DWORD getYNextRunesBtn();
|
||||
+DWORD getXPrevRunesBtn();
|
||||
+DWORD getYPrevRunesBtn();
|
||||
+
|
||||
+#define getLCloseBtn() 32
|
||||
+#define getHCloseBtn() 32
|
||||
+#define isOnCloseBtn(x,y) isOnRect(x, y, getXCloseBtn(), getYCloseBtn(), getLCloseBtn(), getHCloseBtn())
|
||||
+
|
||||
+#define getLPreviousPageBtn() 32
|
||||
+#define getHPreviousPageBtn() 32
|
||||
+#define isOnPreviousPageBtn(x,y) isOnRect(x, y, getXPreviousPageBtn(), getYPreviousPageBtn(), getLPreviousPageBtn(), getHPreviousPageBtn())
|
||||
+
|
||||
+#define getLNextPageBtn() 32
|
||||
+#define getHNextPageBtn() 32
|
||||
+#define isOnNextPageBtn(x,y) isOnRect(x, y, getXNextPageBtn(), getYNextPageBtn(), getLNextPageBtn(), getHNextPageBtn())
|
||||
+
|
||||
+#define getLPrevRunesBtn() 32
|
||||
+#define getHPrevRunesBtn() 32
|
||||
+#define isOnPrevRunesBtn(x,y) isOnRect(x, y, getXPrevRunesBtn(), getYPrevRunesBtn(), getLPrevRunesBtn(), getHPrevRunesBtn())
|
||||
+
|
||||
+#define getLNextRunesBtn() 32
|
||||
+#define getHNextRunesBtn() 32
|
||||
+#define isOnNextRunesBtn(x,y) isOnRect(x, y, getXNextRunesBtn(), getYNextRunesBtn(), getLNextRunesBtn(), getHNextRunesBtn())
|
||||
+
|
||||
+DWORD STDCALL statsLeftDown(sWinMessage* msg);
|
||||
+DWORD STDCALL statsLeftUp(sWinMessage* msg);
|
||||
+
|
||||
void Install_NewInterfaces();
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
||||
\ No newline at end of file
|
||||
diff --git a/PlugY/parameters.h b/PlugY/parameters.h
|
||||
index d426c99..1cf884c 100644
|
||||
--- a/PlugY/parameters.h
|
||||
+++ b/PlugY/parameters.h
|
||||
@@ -6,7 +6,7 @@
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
-#define PLUGY_VERSION "14.03"
|
||||
+#define PLUGY_VERSION "14.03 HD"
|
||||
|
||||
enum TargetMod
|
||||
{
|
6
LICENSE
6
LICENSE
@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
20
PlugY/Backup/PlugY.sln
Normal file
20
PlugY/Backup/PlugY.sln
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlugY", "PlugY.vcproj", "{EB63DF4E-A019-4522-A140-9E8C7350B331}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EB63DF4E-A019-4522-A140-9E8C7350B331}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EB63DF4E-A019-4522-A140-9E8C7350B331}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EB63DF4E-A019-4522-A140-9E8C7350B331}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{EB63DF4E-A019-4522-A140-9E8C7350B331}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,14 +1,14 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Use a more big stash
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "plugYFiles.h" // Install_PlugYFiles()
|
||||
#include "common.h"
|
||||
|
||||
bool active_bigStash = false;
|
||||
bool active_bigStash_tested = false;
|
||||
@ -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
|
||||
@ -78,16 +89,18 @@ void Install_BigStash()
|
||||
log_msg("Patch D2Common & D2Client for make 10x10 squares in the stash. (BigStash)\n");
|
||||
|
||||
// modification of stash grid
|
||||
mem_seek R7(D2Common, C9F3, CA03, 14ED3, 5FCB5, 2A505, 1BDB5, 82CA5);
|
||||
mem_seek R8(D2Common, C9F3, CA03, 14ED3, 5FCB5, 2A505, 1BDB5, 82CA5, 6CC25, 25C0F8);
|
||||
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 R7(D2Client, 45B1C, 45B1C, 4C61C, A643C, 749BC, A9D7C, 8CC1C);
|
||||
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
|
||||
@ -95,6 +108,8 @@ void Install_BigStash()
|
||||
//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");
|
||||
|
||||
|
@ -1,13 +1,11 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Add an extra save file for each characters.
|
||||
Add an extra save file for each characters.
|
||||
|
||||
=================================================================*/
|
||||
/*
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define BUFFER_SIZE 0x4000
|
||||
@ -25,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)
|
||||
{
|
||||
@ -57,7 +55,7 @@ DWORD loadClientSaveFile()
|
||||
if (!data) return 0;
|
||||
|
||||
DWORD curSize = 0;
|
||||
|
||||
|
||||
log_msg("Load client file.\n");
|
||||
if (*(DWORD*)&data[curSize] != FILE_SAVETYPE)
|
||||
{
|
||||
@ -105,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.");
|
||||
|
@ -1,19 +1,22 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Updating server.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "updateServer.h"
|
||||
#include "updateClient.h"
|
||||
#include "infinityStash.h"
|
||||
#include "newInterfaces.h"
|
||||
#include "newInterface_CubeListing.h"
|
||||
#include "extraOptions.h"
|
||||
#include "windowed.h"
|
||||
#include "common.h"
|
||||
#include "savePlayerData.h"
|
||||
#include <stdio.h>
|
||||
|
||||
bool active_Commands=true;
|
||||
|
||||
@ -22,21 +25,42 @@ bool active_savegame=false;
|
||||
|
||||
#define MAX_CMD_SIZE 200
|
||||
|
||||
const char * CMD_RENAME="/rename";
|
||||
const char * CMD_LISTCUBEFORMULA="/listcube";
|
||||
const char * CMD_PLAYERS="players set to";
|
||||
|
||||
const char * CMD_SAVE="/save";
|
||||
const char * CMD_SELECTPAGE="/page";
|
||||
|
||||
const char * CMD_RELOAD="/reload";
|
||||
const char * CMD_LOCK_MOUSE = "/lockmouse";
|
||||
const char * CMD_LOCK_MOUSE2 = "/lock";
|
||||
const char * CMD_UNLOCK_MOUSE = "/unlockmouse";
|
||||
const char * CMD_UNLOCK_MOUSE2 = "/unlock";
|
||||
|
||||
const char * CMD_STARTSAVE="/save";
|
||||
const char * CMD_RENAME_CHAR="/renamechar";
|
||||
|
||||
const char * CMD_MAXGOLD="/maxgold";
|
||||
const char * CMD_RENAME_PAGE = "/renamepage";
|
||||
const char * CMD_SHORT_RENAME_PAGE = "/rp";
|
||||
const char * CMD_SET_INDEX = "/setindex";
|
||||
const char * CMD_SET_MAIN_INDEX = "/setmainindex";
|
||||
const char * CMD_RESET_INDEX = "/resetindex";
|
||||
const char * CMD_INSERT_PAGE = "/insertpage";
|
||||
const char * CMD_SHORT_INSERT_PAGE = "/ip";
|
||||
const char * CMD_DELETE_PAGE = "/deletepage";
|
||||
const char * CMD_SHORT_DELETE_PAGE = "/dp";
|
||||
const char * CMD_SWAP_PAGE = "/swappage";
|
||||
const char * CMD_SHORT_SWAP_PAGE = "/sp";
|
||||
const char * CMD_TOGGLE_PAGE = "/togglepage";
|
||||
const char * CMD_SHORT_TOGGLE_PAGE = "/tp";
|
||||
|
||||
const char * CMD_DISPLAY_MANA_LIFE = "/dml";
|
||||
const char * CMD_DISPLAY_LIFE_MANA = "/dlm";
|
||||
const char * CMD_DISPLAY_LIFE = "/dl";
|
||||
const char * CMD_DISPLAY_MANA = "/dm";
|
||||
|
||||
const char * CMD_LISTCUBEFORMULA="/listcube";
|
||||
//const char * CMD_RELOAD="/reload";
|
||||
//const char * CMD_MAXGOLD="/maxgold";
|
||||
|
||||
|
||||
/*
|
||||
$+21C8 02020648 |. 6A 01 PUSH 1
|
||||
$+21CA 0202064A |. 52 PUSH EDX
|
||||
@ -46,29 +70,139 @@ $+21CD 0202064D |. 8BC3 MOV EAX,EBX
|
||||
$+21CF 0202064F |. E8 2CDEFFFF CALL D2Game.0201E480
|
||||
*/
|
||||
|
||||
/*
|
||||
struct D2NPCRecordStrc
|
||||
{
|
||||
DWORD value;
|
||||
};
|
||||
struct D2NPCDataStrc
|
||||
{
|
||||
DWORD value;
|
||||
};
|
||||
D2NPCRecordStrc* __fastcall STORES_GetRecord(Game* pGame, int nNPC, int* pIndex)
|
||||
{
|
||||
if (pGame == NULL)
|
||||
return NULL;
|
||||
|
||||
if (pIndex != NULL)
|
||||
*pIndex = 0;
|
||||
|
||||
D2NPCDataStrc* pControl = pGame->pVendorControl;
|
||||
if (pControl == NULL)
|
||||
return NULL;
|
||||
|
||||
D2NPCRecordStrc* pList = pControl->pVendors;
|
||||
if (pList == NULL)
|
||||
return NULL;
|
||||
|
||||
const int nCount = INLINE_GetCustomTXT()->nNPCCount;
|
||||
for (int i = 0; i < nCount; i++)
|
||||
{
|
||||
if (pList->nNPC == nNPC)
|
||||
{
|
||||
if (pIndex != NULL)
|
||||
*pIndex = i;
|
||||
|
||||
return pList;
|
||||
}
|
||||
|
||||
pList++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Inventory* __fastcall STORES_GetGambleInventory(Game* pGame, Unit* pPlayer, Unit* pNPC)
|
||||
{
|
||||
if (pGame == NULL || pPlayer == NULL || pNPC == NULL)
|
||||
return NULL;
|
||||
|
||||
D2NPCRecordStrc* pRecord = STORES_GetRecord(pGame, pNPC->nUnitIndex, NULL);
|
||||
if (pRecord == NULL || !pRecord->bGambleInit)
|
||||
return NULL;
|
||||
|
||||
D2NPCGambleStrc* pGamble = pRecord->pGamble;
|
||||
int nGUID = pPlayer->dwGUID;
|
||||
while (pGamble != NULL)
|
||||
{
|
||||
if (pGamble->dwGUID == nGUID)
|
||||
return pGamble->pInventory;
|
||||
|
||||
pGamble = pGamble->pNext;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void __fastcall STORES_UpdateInventoryItems(D2UnitStrc* pNPC, D2InventoryStrc* pInventory, BOOL bPlayDropSounds = FALSE)
|
||||
{
|
||||
|
||||
D2UnitStrc* pItem = pInventory->pFirstItem;
|
||||
while (pItem != NULL)
|
||||
{
|
||||
if (pItem->nUnitType == UNIT_ITEM)
|
||||
{
|
||||
pItem->fUnitFlagsEx |= UNITFLAG_SHOPITEM;
|
||||
if (ITEMS_CheckSocketable(pItem))
|
||||
ITEMS_SetFlag(pItem, ITEMFLAG_NEWITEM, TRUE);
|
||||
|
||||
ITEMS_UpdateTrade(pNPC->pInventory, pItem); //D2Common.#10283
|
||||
if (bPlayDropSounds)
|
||||
{
|
||||
FileItemTable* pRecord = INLINE_GetItemRecord(pItem->nUnitIndex);
|
||||
if (pRecord != NULL)
|
||||
D2PlaySound(pRecord->nDropSound, pInventory->pOwner, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
pItem = pItem->pItemData->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
void gambleReload(Unit* ptChar)
|
||||
{
|
||||
D2UnitStrc* pNPC = UNITS_GetServer(pGame, UNIT_MONSTER, pPacket->dwInteractGUID);
|
||||
if (pNPC != NULL)
|
||||
{
|
||||
if (pNPC->dwGUID == pPlayer->dwInteractGUID)
|
||||
{
|
||||
D2NPCRecord* pNPCRecord = NPC_GetRecord(pGame, pNPC->nUnitIndex);
|
||||
if (pNPCRecord->bGambleInit)
|
||||
{
|
||||
D2FillTradeOrGamble(pGame, pNPC, pPlayer, TRUE); //D2Game.0x6FCCAE20
|
||||
D2InventoryStrc* pInv = STORES_GetGambleInventory(pGame, pPlayer, pNPC);
|
||||
STORES_UpdateInventoryItems(pNPC, pInv, TRUE);
|
||||
D2RefreshUnitInventory(pNPC, TRUE); //D2Common.#10357
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*void gambleReload(Unit* ptChar)
|
||||
{
|
||||
Unit* ptNPC = D2GetCurrentNPC();
|
||||
if (ptNPC)
|
||||
{
|
||||
D2TogglePage(0xC,1,0);
|
||||
__asm {
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
}
|
||||
// D2OpenNPCMenu(ptNPC);
|
||||
//Game* ptGame = ptChar->ptGame;
|
||||
//DWORD caller = offset_D2Game + 0x74900;
|
||||
//__asm {
|
||||
// PUSH 0
|
||||
// PUSH 6
|
||||
// PUSH 2
|
||||
// PUSH ptGame
|
||||
// MOV ECX, ptChar
|
||||
// CALL caller
|
||||
//}
|
||||
//0330CD70 . 837C24 08 0D CMP DWORD PTR SS:[ESP+8],0D
|
||||
D2OpenNPCMenu(ptNPC);
|
||||
D2ReloadGambleScreen();
|
||||
}
|
||||
}
|
||||
//6FACFFD4 |. E8 77F90000 CALL D2Client.6FADF950
|
||||
*/
|
||||
|
||||
void savePlayers(Unit* ptChar)
|
||||
{
|
||||
@ -80,15 +214,15 @@ void maxGold(Unit* ptChar)
|
||||
{
|
||||
log_msg("maxGold\n");
|
||||
|
||||
DWORD maxGold = D2GetMaxGold(ptChar);
|
||||
DWORD maxGold = D2GetMaxGold(ptChar);
|
||||
DWORD maxGoldBank = D2GetMaxGoldBank(ptChar);
|
||||
DWORD playerGold = D2GetPlayerStat(ptChar, STATS_GOLD, 0);
|
||||
DWORD playerGoldBank = D2GetPlayerStat(ptChar, STATS_GOLDBANK, 0);
|
||||
if ( (playerGold < maxGold) || (playerGoldBank < maxGoldBank) ) {
|
||||
D2AddPlayerStat( ptChar, STATS_GOLD, maxGold-playerGold, 0 );
|
||||
D2AddPlayerStat( ptChar, STATS_GOLD, maxGold-playerGold, 0 );
|
||||
D2AddPlayerStat( ptChar, STATS_GOLDBANK, maxGoldBank-playerGoldBank, 0 );
|
||||
} else {
|
||||
D2AddPlayerStat( ptChar, STATS_GOLD, 100000, 0 );
|
||||
D2AddPlayerStat( ptChar, STATS_GOLD, 100000, 0 );
|
||||
}
|
||||
if (active_sharedGold)
|
||||
{
|
||||
@ -136,70 +270,303 @@ void updateSharedGold(DWORD goldAmount)
|
||||
PCPY->sharedGold = goldAmount;
|
||||
}
|
||||
|
||||
bool renamePage(Unit* ptChar, char* newName)
|
||||
{
|
||||
Stash* ptStash = PCPY->currentStash;
|
||||
if (!ptStash)
|
||||
return 0;
|
||||
|
||||
log_msg("Rename current page on Client : '%s' -> '%s'\n", ptStash->name, newName);
|
||||
int len = strlen(newName);
|
||||
// trim text
|
||||
while (newName[0] == ' ')
|
||||
{
|
||||
newName++;
|
||||
len--;
|
||||
}
|
||||
while (len > 0 && newName[len-1] == ' ')
|
||||
{
|
||||
newName[len-1] = NULL;
|
||||
len--;
|
||||
}
|
||||
// Fix max length
|
||||
if (len > 20)
|
||||
{
|
||||
newName[20] = NULL;
|
||||
len = 20;
|
||||
}
|
||||
|
||||
// Check if new name is default name
|
||||
char defautText[50];
|
||||
wcstombs(defautText, getDefaultStashName(ptChar), 50);
|
||||
if (!strcmp(newName, defautText))
|
||||
{
|
||||
newName[0] = NULL;
|
||||
len = 0;
|
||||
}
|
||||
|
||||
// Check if the name change
|
||||
if (newName[0] == NULL && (ptStash->name == NULL || ptStash->name[0] == NULL))
|
||||
return 0;
|
||||
|
||||
if (ptStash->name && !strcmp(newName, ptStash->name))
|
||||
return 0;
|
||||
|
||||
// Rename the page
|
||||
log_msg("Rename current page valid : '%s' (%s)\n", newName, defautText);
|
||||
renameCurrentStash(ptChar, newName);
|
||||
for (int i = 0; i <= len; i++)
|
||||
updateServer(US_PAGENAME + (newName[i] << 8));
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool renameCharacter(Unit* ptChar, char* newName)
|
||||
{
|
||||
int len = strlen(newName);
|
||||
if (len < 2 || len > 15)
|
||||
return 0;
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
char c = newName[i];
|
||||
if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_')))
|
||||
return 1;
|
||||
}
|
||||
log_msg("Rename Character : %s -> %s\n", PCPlayerData->name, newName);
|
||||
|
||||
// Move current save file
|
||||
backupSaveFiles(PCPlayerData->name, -1);
|
||||
{
|
||||
char szCurrentFile[MAX_PATH];
|
||||
char szNewFile[MAX_PATH];
|
||||
|
||||
//Get temporary savefile name.
|
||||
D2FogGetSavePath(szCurrentFile, MAX_PATH);
|
||||
D2FogGetSavePath(szNewFile, MAX_PATH);
|
||||
strcat(szCurrentFile, PCPlayerData->name);
|
||||
strcat(szNewFile, newName);
|
||||
strcat(szCurrentFile, ".");
|
||||
strcat(szNewFile, ".");
|
||||
int curLen = strlen(szCurrentFile);
|
||||
int newLen = strlen(szNewFile);
|
||||
strcpy(&szCurrentFile[curLen], "d2s");
|
||||
strcpy(&szNewFile[newLen], "d2s");
|
||||
if (!MoveFile(szCurrentFile, szNewFile))
|
||||
return 0;
|
||||
strcpy(&szCurrentFile[curLen], "d2x");
|
||||
strcpy(&szNewFile[newLen], "d2x");
|
||||
MoveFile(szCurrentFile, szNewFile);
|
||||
strcpy(&szCurrentFile[curLen], "key");
|
||||
strcpy(&szNewFile[newLen], "key");
|
||||
MoveFile(szCurrentFile, szNewFile);
|
||||
strcpy(&szCurrentFile[curLen], "ma0");
|
||||
strcpy(&szNewFile[newLen], "ma0");
|
||||
MoveFile(szCurrentFile, szNewFile);
|
||||
strcpy(&szCurrentFile[curLen], "ma1");
|
||||
strcpy(&szNewFile[newLen], "ma1");
|
||||
MoveFile(szCurrentFile, szNewFile);
|
||||
strcpy(&szCurrentFile[curLen], "ma2");
|
||||
strcpy(&szNewFile[newLen], "ma2");
|
||||
MoveFile(szCurrentFile, szNewFile);
|
||||
strcpy(&szCurrentFile[curLen], "ma3");
|
||||
strcpy(&szNewFile[newLen], "ma3");
|
||||
MoveFile(szCurrentFile, szNewFile);
|
||||
strcpy(&szCurrentFile[curLen], "ma4");
|
||||
strcpy(&szNewFile[newLen], "ma4");
|
||||
MoveFile(szCurrentFile, szNewFile);
|
||||
strcpy(&szCurrentFile[curLen], "map");
|
||||
strcpy(&szNewFile[newLen], "map");
|
||||
MoveFile(szCurrentFile, szNewFile);
|
||||
}
|
||||
|
||||
// Update server
|
||||
for (int i = 0; i <= len; i++)
|
||||
updateServer(US_RENAME + (newName[i] << 8));
|
||||
|
||||
// Update client
|
||||
log_msg("Rename on Client : %s -> %s\n", PCPlayerData->name, newName);
|
||||
strcpy(PCPlayerData->name, newName);
|
||||
|
||||
updateServer(US_SAVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************************************/
|
||||
|
||||
int STDCALL commands (char* ptText)
|
||||
{
|
||||
log_msg("Command : %s\n", ptText);
|
||||
Unit* ptChar = D2GetClientPlayer();
|
||||
|
||||
char command[MAX_CMD_SIZE];
|
||||
ZeroMemory(command,MAX_CMD_SIZE);
|
||||
strncpy(command,ptText,MAX_CMD_SIZE-1);
|
||||
strlwr(command);
|
||||
_strlwr(command);
|
||||
|
||||
if (!strncmp(command,CMD_RENAME,strlen(CMD_RENAME)))
|
||||
if (!strncmp(command, CMD_PLAYERS, strlen(CMD_PLAYERS)))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
char* param = &command[strlen(CMD_RENAME)];
|
||||
DWORD len = strlen(param);
|
||||
if (len && (param[0] != ' ')) return 1;
|
||||
int nb = atoi(&command[strlen(CMD_PLAYERS)]);
|
||||
if (nb > 0 && nb <= 64)
|
||||
nbPlayersCommand = nb;
|
||||
return 1;
|
||||
}
|
||||
|
||||
Stash* ptStash = PCPY->currentStash;
|
||||
if (!ptStash) return 0;
|
||||
if (len>1)
|
||||
{
|
||||
D2FogMemDeAlloc(ptStash->name,__FILE__,__LINE__,0);
|
||||
ptStash->name = (char *)malloc(len);//D2FogMemAlloc(len,__FILE__,__LINE__,0);
|
||||
strcpy(ptStash->name,¶m[1]);
|
||||
} else {
|
||||
D2FogMemDeAlloc(ptStash->name,__FILE__,__LINE__,0);
|
||||
ptStash->name = NULL;
|
||||
}
|
||||
if (!strcmp(command, CMD_SAVE))
|
||||
{
|
||||
if (onRealm) return 1;
|
||||
updateServer(US_SAVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command,CMD_LISTCUBEFORMULA))
|
||||
{
|
||||
if (!active_listAllCubeFormula) return 1;
|
||||
listAllCubeFormula();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strncmp(command,CMD_SELECTPAGE,strlen(CMD_SELECTPAGE)))
|
||||
if (!strncmp(command, CMD_SELECTPAGE, strlen(CMD_SELECTPAGE)))
|
||||
{
|
||||
if (!active_newInterfaces) return 1;
|
||||
GoStatPage(atoi(&command[strlen(CMD_SELECTPAGE)])-1);
|
||||
GoStatPage(atoi(&command[strlen(CMD_SELECTPAGE)]) - 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command,CMD_RELOAD))
|
||||
if (!strcmp(command, CMD_LOCK_MOUSE) || !strcmp(command, CMD_LOCK_MOUSE2))
|
||||
{
|
||||
if (onRealm) return 1;
|
||||
gambleReload(ptChar);
|
||||
lockMouseCursor();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command,CMD_STARTSAVE))
|
||||
if (!strcmp(command, CMD_UNLOCK_MOUSE) || !strcmp(command, CMD_UNLOCK_MOUSE2))
|
||||
{
|
||||
if (onRealm) return 1;
|
||||
updateServer(US_STARTSAVE);
|
||||
unlockMouseCursor();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command,CMD_MAXGOLD))
|
||||
if (!strncmp(command, CMD_RENAME_CHAR, strlen(CMD_RENAME_CHAR)))
|
||||
{
|
||||
if (onRealm) return 1;
|
||||
updateServer(US_MAXGOLD);
|
||||
char* param = &ptText[strlen(CMD_RENAME_CHAR)];
|
||||
if (param[0] != ' ')
|
||||
return 1;
|
||||
param++;
|
||||
return renameCharacter(ptChar, param);
|
||||
}
|
||||
|
||||
if (!strncmp(command, CMD_RENAME_PAGE, strlen(CMD_RENAME_PAGE)))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
char* param = &ptText[strlen(CMD_RENAME_PAGE)];
|
||||
return renamePage(ptChar, param);
|
||||
}
|
||||
|
||||
if (!strncmp(command, CMD_SHORT_RENAME_PAGE, strlen(CMD_SHORT_RENAME_PAGE)))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
char* param = &ptText[strlen(CMD_SHORT_RENAME_PAGE)];
|
||||
return renamePage(ptChar, param);
|
||||
}
|
||||
|
||||
if (!strcmp(command, CMD_SET_INDEX))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
updateServer(US_SET_INDEX);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command, CMD_SET_MAIN_INDEX))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
updateServer(US_SET_MAIN_INDEX);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command, CMD_RESET_INDEX))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
updateServer(US_RESET_INDEX);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command, CMD_INSERT_PAGE))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
insertStash(ptChar);
|
||||
updateServer(US_INSERT_PAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command, CMD_SHORT_INSERT_PAGE))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
insertStash(ptChar);
|
||||
updateServer(US_INSERT_PAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command, CMD_DELETE_PAGE))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
if (deleteStash(ptChar, true))
|
||||
updateServer(US_DELETE_PAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command, CMD_SHORT_DELETE_PAGE))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
if (deleteStash(ptChar, true))
|
||||
updateServer(US_DELETE_PAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strncmp(command, CMD_SWAP_PAGE, strlen(CMD_SWAP_PAGE)))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
int page = atoi(&command[strlen(CMD_SWAP_PAGE)]) - 1;
|
||||
if (page < 0 && PCPY->currentStash->nextStash)
|
||||
page = PCPY->currentStash->nextStash->id;
|
||||
if (page < 0)
|
||||
return 1;
|
||||
updateServer(US_SWAP3 + ((page & 0xFF000000) >> 16));
|
||||
updateServer(US_SWAP2 + ((page & 0xFF0000) >> 8));
|
||||
updateServer(US_SWAP1 + (page & 0xFF00));
|
||||
updateServer(US_SWAP0 + ((page & 0xFF) << 8));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strncmp(command, CMD_SHORT_SWAP_PAGE, strlen(CMD_SHORT_SWAP_PAGE)))
|
||||
{
|
||||
if (!active_multiPageStash) return 1;
|
||||
int page = atoi(&command[strlen(CMD_SHORT_SWAP_PAGE)]) - 1;
|
||||
if (page < 0 && PCPY->currentStash->nextStash)
|
||||
page = PCPY->currentStash->nextStash->id;
|
||||
if (page < 0)
|
||||
return 1;
|
||||
updateServer(US_SWAP3 + ((page & 0xFF000000) >> 16));
|
||||
updateServer(US_SWAP2 + ((page & 0xFF0000) >> 8));
|
||||
updateServer(US_SWAP1 + (page & 0xFF00));
|
||||
updateServer(US_SWAP0 + ((page & 0xFF) << 8));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strncmp(command, CMD_TOGGLE_PAGE, strlen(CMD_TOGGLE_PAGE)))
|
||||
{
|
||||
if (!active_sharedStash) return 1;
|
||||
int page = atoi(&command[strlen(CMD_TOGGLE_PAGE)]) - 1;
|
||||
if (page < 0)
|
||||
return 1;
|
||||
updateServer(US_SWAP3 + ((page & 0xFF000000) >> 16));
|
||||
updateServer(US_SWAP2 + ((page & 0xFF0000) >> 8));
|
||||
updateServer(US_SWAP1 + (page & 0xFF00));
|
||||
updateServer(US_SWAP0_TOGGLE + ((page & 0xFF) << 8));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strncmp(command, CMD_SHORT_TOGGLE_PAGE, strlen(CMD_SHORT_TOGGLE_PAGE)))
|
||||
{
|
||||
if (!active_sharedStash) return 1;
|
||||
int page = atoi(&command[strlen(CMD_SHORT_TOGGLE_PAGE)]) - 1;
|
||||
if (page < 0)
|
||||
return 1;
|
||||
updateServer(US_SWAP3 + ((page & 0xFF000000) >> 16));
|
||||
updateServer(US_SWAP2 + ((page & 0xFF0000) >> 8));
|
||||
updateServer(US_SWAP1 + (page & 0xFF00));
|
||||
updateServer(US_SWAP0_TOGGLE + ((page & 0xFF) << 8));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -221,6 +588,66 @@ int STDCALL commands (char* ptText)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(command, CMD_LISTCUBEFORMULA))
|
||||
{
|
||||
if (!active_listAllCubeFormula) return 1;
|
||||
listAllCubeFormula();
|
||||
return 0;
|
||||
}
|
||||
|
||||
//if (!strcmp(command,CMD_RELOAD))
|
||||
//{
|
||||
// if (onRealm) return 1;
|
||||
// gambleReload(ptChar);
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
//if (!strcmp(command,CMD_MAXGOLD))
|
||||
//{
|
||||
// if (onRealm) return 1;
|
||||
// updateServer(US_MAXGOLD);
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
//if (!strcmp(command,"t"))
|
||||
//{
|
||||
// //test();
|
||||
// FILE* file = fopen("D:\\tmp.txt", "wb+");
|
||||
// for (int i = 0; i<= 0xFFFF; i++)
|
||||
// {
|
||||
// fwprintf( file, L"== %04X ===================================\n%s\n", i, D2GetStringFromIndex(i) );
|
||||
// }
|
||||
// fclose(file);
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
if (!strcmp(command,"aa"))
|
||||
{
|
||||
#pragma pack(1)
|
||||
struct {
|
||||
BYTE displayType;//0x15 main msg; 0x14: char popup
|
||||
BYTE un;
|
||||
BYTE zero;
|
||||
char string[0xFF];
|
||||
char null;
|
||||
char u1[0x100];
|
||||
char u2[0x100];
|
||||
char u3[0x100];
|
||||
} data;
|
||||
#pragma pack()
|
||||
|
||||
//D2SetNbPlayers(nbPlayersCommand);
|
||||
|
||||
memset(&data,0,sizeof(data));
|
||||
data.displayType=0x15;
|
||||
data.un=1;
|
||||
data.zero=0;//*(BYTE*)(offset_D2Client+0x112CFC); in 1.10
|
||||
data.null=NULL;
|
||||
sprintf(data.string, "players %u", nbPlayersCommand);
|
||||
D2SendMsgToAll((BYTE*)&data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -248,6 +675,19 @@ MANAGESOUNDCHAOSDEBUG:
|
||||
RETN 8
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_Commands_113d )
|
||||
TEST EAX,EAX
|
||||
JE MANAGESOUNDCHAOSDEBUG
|
||||
PUSH EDI
|
||||
CALL commands
|
||||
TEST EAX,EAX
|
||||
JNZ MANAGESOUNDCHAOSDEBUG
|
||||
ADD DWORD PTR SS:[ESP],7
|
||||
MANAGESOUNDCHAOSDEBUG:
|
||||
RETN 8
|
||||
}}
|
||||
|
||||
|
||||
void Install_Commands()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
@ -261,9 +701,9 @@ void Install_Commands()
|
||||
active_savegame = version_D2Common >= V111;
|
||||
|
||||
// Run custom commmand
|
||||
mem_seek R7(D2Client, 2C120, 2C110, 32BDD, C1EE6, 91C16, 86926, 70AE6);
|
||||
mem_seek R8(D2Client, 2C120, 2C110, 32BDD, C1EE6, 91C16, 86926, 70AE6, B1FD6, 7C548);
|
||||
memt_byte( 0x83, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0xC08508C4 , version_D2Client >= V111 ? caller_Commands_111 : caller_Commands);
|
||||
MEMT_REF4( 0xC08508C4 , version_D2Client >= V113d ? caller_Commands_113d : version_D2Client >= V111 ? caller_Commands_111 : caller_Commands);
|
||||
//6FB71EE6 . 83C4 08 ADD ESP,8
|
||||
//6FB71EE7 . 85C0 TEST EAX,EAX
|
||||
//6FB41C16 |. 83C4 08 ADD ESP,8
|
||||
@ -274,6 +714,10 @@ void Install_Commands()
|
||||
//6FB20AE9 |. 85C0 TEST EAX,EAX
|
||||
//6FB20AE6 |. 83C4 08 ADD ESP,8
|
||||
//6FB20AE9 |. 85C0 TEST EAX,EAX
|
||||
//6FB61FD6 |. 83C4 08 ADD ESP,8
|
||||
//6FB61FD9 |. 85C0 TEST EAX,EAX
|
||||
//0047C548 |. 83C4 08 ADD ESP,8
|
||||
//0047C54B |. 85C0 TEST EAX,EAX
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
|
470
PlugY/Common.cpp
470
PlugY/Common.cpp
@ -2,14 +2,10 @@
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Common functions.
|
||||
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
s_shifting shifting;
|
||||
|
||||
bool isOnRect(DWORD x, DWORD y, DWORD x0, DWORD y0, DWORD l, DWORD h)
|
||||
{return (x>=x0) && (x<x0+l) && (y>y0-h) && (y<=y0);}
|
||||
@ -22,468 +18,4 @@ void freeMessage(sWinMessage* msg)
|
||||
D2FreeWinMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
LPWSTR getString(LPWSTR eng, LPWSTR esp, LPWSTR deu, LPWSTR fra, LPWSTR por, LPWSTR ita, LPWSTR jpn, LPWSTR kor, LPWSTR sin, LPWSTR chi, LPWSTR pol, LPWSTR rus)
|
||||
{
|
||||
switch(D2GetLang())
|
||||
{
|
||||
case LNG_ENG: return eng;
|
||||
case LNG_ESP: return esp;
|
||||
case LNG_DEU: return deu;
|
||||
case LNG_FRA: return fra;
|
||||
case LNG_POR: return por;
|
||||
case LNG_ITA: return ita;
|
||||
case LNG_JPN: return jpn;
|
||||
case LNG_KOR: return kor;
|
||||
case LNG_SIN: return sin;
|
||||
case LNG_CHI: return chi;
|
||||
case LNG_POL: return pol;
|
||||
case LNG_RUS: return rus;
|
||||
case LNG_DEF:
|
||||
default: return eng;
|
||||
}
|
||||
}
|
||||
#define LANGUAGE(I,ENG,FRA,DEU,ITA,ESP,POL/*,CHI*/) case I : return getString(L##ENG,L##ESP,L##DEU,L##FRA,L##ENG,L##ITA,L##ENG,L##ENG,L##ENG,L##ENG,L##POL,L##ENG)
|
||||
|
||||
LPWSTR getTranslatedString(int stringID)
|
||||
{
|
||||
switch(stringID)
|
||||
{
|
||||
/* LANGUAGE2( STR_STATS_UNASSIGN_WITH_LIMIT,
|
||||
"+Alt: ;,+Shift: %d \x70B9\x6570",//"+Alt: Unassign, +Shift: by %d points",
|
||||
// "+Alt: \x91CD\x5206\x914D;,+Shift: %d \x70B9\x6570",//"+Alt: Unassign, +Shift: by %d points",
|
||||
"+Alt: Désallocation, +Shift: par %d points,",
|
||||
"+Alt: Zurücksetzen, +Shift: um %d Punkte",
|
||||
"+Alt: Rimuovi, +Shift: Assegna %d punti",
|
||||
"+Alt: Quita, +Shift: por %d puntos",
|
||||
"+Alt: \37325\20998\37197;,+Shift:%d \28857\25968");
|
||||
*/
|
||||
LANGUAGE( STR_STATS_UNASSIGN_WITH_LIMIT,
|
||||
"+Alt: Unassign, +Shift: by %d points",
|
||||
"+Alt: Désallocation, +Shift: par %d points",
|
||||
"+Alt: Zurücksetzen, +Shift: um %d Punkte",
|
||||
"+Alt: Rimuovi, +Shift: Assegna %d punti",
|
||||
"+Alt: Quita, +Shift: por %d puntos",
|
||||
"+Alt: Odejmij, +Shift: %d punktów");
|
||||
// "+Alt: ????, +Shift: %d ??");
|
||||
|
||||
LANGUAGE( STR_STATS_UNASSIGN_WITHOUT_LIMIT,
|
||||
"+Alt: Unassign, +Shift: all remaining points",
|
||||
"+Alt: Désallocation, +Shift: Tous les points restants",
|
||||
"+Alt: Zurücksetzen, +Shift: Alle verbleibenden Punkte",
|
||||
"+Alt: Rimuovi, +Shift: Assegna tutti i punti rimanenti",
|
||||
"+Alt: Quita, +Shift: Todos los puntos restantes",
|
||||
"+Alt: Odejmij, +Shift: wszystkie pozostale punkty");
|
||||
// "+Alt: ????, +Shift: ???");
|
||||
|
||||
LANGUAGE( STR_STATS_BASE_MIN,
|
||||
"Base: %d (Min: %d)",
|
||||
"Base: %d (Min: %d)",
|
||||
"Basiswert: %d (Min: %d)",
|
||||
"Base: %d (Min: %d)",
|
||||
"Base: %d (Min: %d)",
|
||||
"Bazowo: %d (Minimum: %d)");
|
||||
// "??: %d(??: %d)");
|
||||
|
||||
LANGUAGE( STR_SKILLS_UNASSIGN,
|
||||
"Un-allocate all skills points",
|
||||
"Désalloue tous les points d'aptitudes",
|
||||
"Alle Fertigkeitspunkte zurücksetzen",
|
||||
"Rimuovi tutte le abilità",
|
||||
"Quita todos los puntos de habilidades",
|
||||
"Rozdaj od nowa wszystkie punkty umiejetnosci");
|
||||
// "????????");
|
||||
|
||||
LANGUAGE( STR_STASH_PREVIOUS_PAGE,
|
||||
"Previous Page (+shift: First Page)",
|
||||
"Page précédente (+shift: Première page)",
|
||||
"Vorherige Seite (+shift: Erste Seite)",
|
||||
"Pagina Precedente (+shift: Prima Pagina)",
|
||||
"Pagina anterior (+shift: Primera Pagina)",
|
||||
"Poprzednia Strona (+shift: Pierwsza Strona)");
|
||||
// "??? (+shift: ??)");
|
||||
|
||||
LANGUAGE( STR_STASH_NEXT_PAGE,
|
||||
"Next Page (+shift: Last not empty Page)",
|
||||
"Page suivante (+shift: Dernière page non vide)",
|
||||
"Nächste Seite (+shift: Letzte nicht leere Seite )",
|
||||
"Pagina Successiva (+shift: Ultima Pagina non vuota)",
|
||||
"Pagina Siguiente (+shift: Ultima pagina non vacia)",
|
||||
"Nastepna Strona (+shift: Ostatnia nie pusta Strona)");
|
||||
// "??? (+shift: ?????");
|
||||
|
||||
LANGUAGE( STR_TOGGLE_TO_PERSONAL,
|
||||
"Toggle to Personal Stash",
|
||||
"Voir coffre personnel",
|
||||
"Wechselt zum persönlichen Goldschatz",
|
||||
"Vai all'Inventario Personale",
|
||||
"Ver el cofre personal",
|
||||
"Przejdz do Skrzyni Osobistej");
|
||||
// "????????");
|
||||
|
||||
LANGUAGE( STR_TOGGLE_TO_SHARED,
|
||||
"Toggle to Shared Stash",
|
||||
"Voir coffre partagé",
|
||||
"Wechselt zum gemeinsamen Goldschatz",
|
||||
"Vai all'Inventario Condiviso",
|
||||
"Ver el cofre compartido",
|
||||
"Przejdz do Skrzyni Wspólnej");
|
||||
// "????????");
|
||||
|
||||
LANGUAGE( STR_STASH_PREVIOUS_INDEX,
|
||||
"Previous Index : by %d Pages (+Shift: %d)",
|
||||
"Index précédent : par %d pages (+shift: %d)",
|
||||
"Vorheriger Index: in %d Seiten (+shift: %d)",
|
||||
"Schermata Precedente : Indietro di %d Pagine (+Shift: %d)",
|
||||
"Indice anterior : por %d paginas (+shift: %d)",
|
||||
"Poprzednia Strona : po %d Stron (+Shift: %d)");
|
||||
// "???? : %d ? (+Shift:%d)");
|
||||
|
||||
LANGUAGE( STR_STASH_NEXT_INDEX,
|
||||
"Next Index : by %d Pages (+shift: %d)",
|
||||
"Index suivant : par %d pages (+shift: %d)",
|
||||
"Nächster Index: in %d Seiten (+shift: %d)",
|
||||
"Schermata Successiva : Avanti di %d Pagine (+shift: %d)",
|
||||
"Indice siguiente : por %d paginas (+shift: %d)",
|
||||
"Nastepna Strona : po %d Stron (+shift: %d)");
|
||||
// "???? : %d ? (+shift:%d)");
|
||||
|
||||
LANGUAGE( STR_PUT_GOLD,
|
||||
"Put Gold",
|
||||
"Poser de l'Or",
|
||||
"Gib Gold",
|
||||
"Immetti Oro",
|
||||
"Poner oro",
|
||||
"Zdeponuj Zloto");
|
||||
// "????");
|
||||
|
||||
LANGUAGE( STR_TAKE_GOLD,
|
||||
"Take Gold",
|
||||
"Prendre de l'Or",
|
||||
"Nehme Gold",
|
||||
"Ritira Oro",
|
||||
"Tomar oro",
|
||||
"Wyplac zloto");
|
||||
// "????");
|
||||
|
||||
LANGUAGE( STR_PERSONAL_PAGE_NUMBER,
|
||||
"Personal Page n°%u",
|
||||
"Page perso n°%u",
|
||||
"Persönliche Seite n°%u",
|
||||
"Pagina Personale n°%u",
|
||||
"Pagina personal n°%u",
|
||||
"Strona Osobista n°%u");
|
||||
// "????? n°%u");
|
||||
|
||||
LANGUAGE( STR_SHARED_PAGE_NUMBER,
|
||||
"Shared Page n°%u",
|
||||
"Page partagée n°%u",
|
||||
"Gemeinsame Seite n°%u",
|
||||
"Pagina Condivisa n°%u",
|
||||
"Pagina personal n°%u",
|
||||
"Strona Wspólna n°%u");
|
||||
// "????? n°%u");
|
||||
|
||||
LANGUAGE( STR_NO_SELECTED_PAGE,
|
||||
"No selected page",
|
||||
"Aucune page sélectionnée",
|
||||
"Keine ausgewählte Seite",
|
||||
"Nessuna pagina selezionata",
|
||||
"Ninguna pagina seleccionada",
|
||||
"Nie zaznaczono strony");
|
||||
// "????");
|
||||
|
||||
LANGUAGE( STR_SHARED_GOLD_QUANTITY,
|
||||
"Shared Gold : %u",
|
||||
"Or partagé : %u",
|
||||
"Gemeinsamen Gold : %u",
|
||||
"Oro Condiviso : %u",
|
||||
"Oro compartido : %u",
|
||||
"Wspólne Zloto : %u");
|
||||
// "????: %u");
|
||||
|
||||
LANGUAGE( STR_PREVIOUS_PAGE,
|
||||
"Previous Page",
|
||||
"Page précédente",
|
||||
"Vorherige Seite",
|
||||
"Pagina Precedente",
|
||||
"Pagina anterior",
|
||||
"Poprzednia Strona");
|
||||
// "???");
|
||||
|
||||
LANGUAGE( STR_NEXT_PAGE,
|
||||
"Next Page",
|
||||
"Page suivante",
|
||||
"Nächste Seite",
|
||||
"Pagina Successiva",
|
||||
"Pagina siguiente",
|
||||
"Nastepna Strona");
|
||||
// "???");
|
||||
|
||||
default : return L"";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*=================================================================*/
|
||||
|
||||
const char* SNONE="";
|
||||
const char* c_shie[3]={"Shield (Not Class Specific)",SNONE,SNONE};
|
||||
const char* c_tors[3]={"Body Armor",SNONE,SNONE};
|
||||
const char* c_gold[3]={"Gold",SNONE,SNONE};
|
||||
const char* c_bowq[3]={"Arrow",SNONE,SNONE};
|
||||
const char* c_xboq[3]={"Bolt",SNONE,SNONE};
|
||||
const char* c_play[3]={"Ear",SNONE,SNONE};
|
||||
const char* c_herb[3]={"Herb",SNONE,SNONE};
|
||||
const char* c_poti[3]={"Potion",SNONE,SNONE};
|
||||
const char* c_ring[3]={"Ring",SNONE,SNONE};
|
||||
const char* c_elix[3]={"Elixir",SNONE,SNONE};
|
||||
const char* c_amul[3]={"Amulet",SNONE,SNONE};
|
||||
const char* c_char[3]={"Charm",SNONE,SNONE};
|
||||
const char* c_boot[3]={"Boot",SNONE,SNONE};
|
||||
const char* c_glov[3]={"Glove",SNONE,SNONE};
|
||||
const char* c_book[3]={"Book",SNONE,SNONE};
|
||||
const char* c_belt[3]={"Belt",SNONE,SNONE};
|
||||
const char* c_gem[3]={"Gem",SNONE,SNONE};
|
||||
const char* c_torc[3]={"Torch",SNONE,SNONE};
|
||||
const char* c_scro[3]={"Scroll",SNONE,SNONE};
|
||||
const char* c_scep[3]={"Scepter",SNONE,SNONE};
|
||||
const char* c_wand[3]={"Wand",SNONE,SNONE};
|
||||
const char* c_staf[3]={"Staff",SNONE,SNONE};
|
||||
const char* c_bow[3]={"Bow",SNONE,SNONE};
|
||||
const char* c_axe[3]={"Axe",SNONE,SNONE};
|
||||
const char* c_club[3]={"Club",SNONE,SNONE};
|
||||
const char* c_swor[3]={"Sword",SNONE,SNONE};
|
||||
const char* c_hamm[3]={"Hammer",SNONE,SNONE};
|
||||
const char* c_knif[3]={"Knife",SNONE,SNONE};
|
||||
const char* c_spea[3]={"Spear",SNONE,SNONE};
|
||||
const char* c_pole[3]={"Polearm",SNONE,SNONE};
|
||||
const char* c_xbow[3]={"Crossbow",SNONE,SNONE};
|
||||
const char* c_mace[3]={"Mace",SNONE,SNONE};
|
||||
const char* c_helm[3]={"Helm",SNONE,SNONE};
|
||||
|
||||
const char* c_tpot[3]={"Missile Potion",SNONE,SNONE};
|
||||
const char* c_ques[3]={"Quest Item",SNONE,SNONE};
|
||||
const char* c_body[3]={"Body Part",SNONE,SNONE};
|
||||
const char* c_key[3]={"Key",SNONE,SNONE};
|
||||
const char* c_tkni[3]={"Throwing Knife",SNONE,SNONE};
|
||||
const char* c_taxe[3]={"Throwing Axe",SNONE,SNONE};
|
||||
const char* c_jave[3]={"Javelin",SNONE,SNONE};
|
||||
const char* c_weap[3]={"Weapon",SNONE,SNONE};
|
||||
const char* c_mele[3]={"Melee Weapon",SNONE,SNONE};
|
||||
const char* c_miss[3]={"Missile Weapon",SNONE,SNONE};
|
||||
const char* c_thro[3]={"Throwing Weapon",SNONE,SNONE};
|
||||
const char* c_comb[3]={"Combo Weapon",SNONE,SNONE};
|
||||
const char* c_armo[3]={"Armor",SNONE,SNONE};
|
||||
const char* c_shld[3]={"Any Shield",SNONE,SNONE};
|
||||
const char* c_misc[3]={"Miscellaneous",SNONE,SNONE};
|
||||
const char* c_sock[3]={"Socket Filler",SNONE,SNONE};
|
||||
const char* c_seco[3]={"Second Hand Item",SNONE,SNONE};
|
||||
const char* c_rod[3]={"Staves And Rods",SNONE,SNONE};
|
||||
const char* c_misl[3]={"Missile",SNONE,SNONE};
|
||||
const char* c_blun[3]={"Blunt",SNONE,SNONE};
|
||||
|
||||
const char* c_jewl[3]={"Jewel",SNONE,SNONE};
|
||||
const char* c_clas[3]={"Class Specific",SNONE,SNONE};
|
||||
const char* c_amaz[3]={"Amazon Item",SNONE,SNONE};
|
||||
const char* c_barb[3]={"Barbarian Item",SNONE,SNONE};
|
||||
const char* c_necr[3]={"Necromancer Item",SNONE,SNONE};
|
||||
const char* c_pala[3]={"Paladin Item",SNONE,SNONE};
|
||||
const char* c_sorc[3]={"Sorceress Item",SNONE,SNONE};
|
||||
const char* c_assn[3]={"Assassin Item",SNONE,SNONE};
|
||||
const char* c_drui[3]={"Druid Item",SNONE,SNONE};
|
||||
const char* c_h2h[3]={"Claw",SNONE,SNONE};
|
||||
const char* c_orb[3]={"Orb",SNONE,SNONE};
|
||||
const char* c_head[3]={"Voodoo Heads",SNONE,SNONE};
|
||||
const char* c_ashd[3]={"Paladin Shield",SNONE,SNONE};
|
||||
const char* c_phlm[3]={"Barbarian Helm",SNONE,SNONE};
|
||||
const char* c_pelt[3]={"Druid Helm",SNONE,SNONE};
|
||||
const char* c_cloa[3]={"Cloak",SNONE,SNONE};
|
||||
const char* c_rune[3]={"Rune",SNONE,SNONE};
|
||||
const char* c_circ[3]={"Circlet",SNONE,SNONE};
|
||||
const char* c_hpot[3]={"Healing Potion",SNONE,SNONE};
|
||||
const char* c_mpot[3]={"Mana Potion",SNONE,SNONE};
|
||||
const char* c_rpot[3]={"Rejuvenation potion",SNONE,SNONE};
|
||||
const char* c_spot[3]={"Stamina Potion",SNONE,SNONE};
|
||||
const char* c_apot[3]={"Antidote Potion",SNONE,SNONE};
|
||||
const char* c_wpot[3]={"Thawing Potion",SNONE,SNONE};
|
||||
const char* c_scha[3]={"Small Charm",SNONE,SNONE};
|
||||
const char* c_mcha[3]={"Large Charm",SNONE,SNONE};
|
||||
const char* c_lcha[3]={"Grand Charm",SNONE,SNONE};
|
||||
const char* c_abow[3]={"Amazon Bow",SNONE,SNONE};
|
||||
const char* c_aspe[3]={"Amazon Spear",SNONE,SNONE};
|
||||
const char* c_ajav[3]={"Amazon Javelin",SNONE,SNONE};
|
||||
const char* c_h2h2[3]={"Assassin Claw",SNONE,SNONE};
|
||||
const char* c_mboq[3]={"Magic Arrow",SNONE,SNONE};
|
||||
const char* c_mxbq[3]={"Magic Bolt",SNONE,SNONE};
|
||||
const char* c_gem0[3]={"Chipped Gem",SNONE,SNONE};
|
||||
const char* c_gem1[3]={"Flawed Gem",SNONE,SNONE};
|
||||
const char* c_gem2[3]={"Normal Gem",SNONE,SNONE};
|
||||
const char* c_gem3[3]={"Flawless Gem",SNONE,SNONE};
|
||||
const char* c_gem4[3]={"Perfect Gem",SNONE,SNONE};
|
||||
const char* c_gema[3]={"Amethyst",SNONE,SNONE};
|
||||
const char* c_gemd[3]={"Diamond",SNONE,SNONE};
|
||||
const char* c_geme[3]={"Emerald",SNONE,SNONE};
|
||||
const char* c_gemr[3]={"Ruby",SNONE,SNONE};
|
||||
const char* c_gems[3]={"Sapphire",SNONE,SNONE};
|
||||
const char* c_gemt[3]={"Topaz",SNONE,SNONE};
|
||||
const char* c_gemz[3]={"Skull",SNONE,SNONE};
|
||||
|
||||
const char* getTypeString (DWORD code)
|
||||
{
|
||||
DWORD lang = 0;//D2GetLang();
|
||||
if ((lang == LNG_FRA) || (lang == LNG_DEU)) lang--;
|
||||
else lang = 0;
|
||||
switch (code)
|
||||
{
|
||||
case BIN('s','h','i','e') : return c_shie[0];
|
||||
case BIN('t','o','r','s') : return c_tors[0];
|
||||
case BIN('g','o','l','d') : return c_gold[0];
|
||||
case BIN('b','o','w','q') : return c_bowq[0];
|
||||
case BIN('x','b','o','q') : return c_xboq[0];
|
||||
case BIN('p','l','a','y') : return c_play[0];
|
||||
case BIN('h','e','r','b') : return c_herb[0];
|
||||
case BIN('p','o','t','i') : return c_poti[0];
|
||||
case BIN('r','i','n','g') : return c_ring[0];
|
||||
case BIN('e','l','i','x') : return c_elix[0];
|
||||
case BIN('a','m','u','l') : return c_amul[0];
|
||||
case BIN('c','h','a','r') : return c_char[0];
|
||||
case BIN('b','o','o','t') : return c_boot[0];
|
||||
case BIN('g','l','o','v') : return c_glov[0];
|
||||
case BIN('b','o','o','k') : return c_book[0];
|
||||
case BIN('b','e','l','t') : return c_belt[0];
|
||||
case BIN('g','e','m',' ') : return c_gem[0];
|
||||
case BIN('t','o','r','c') : return c_torc[0];
|
||||
case BIN('s','c','r','o') : return c_scro[0];
|
||||
case BIN('s','c','e','p') : return c_scep[0];
|
||||
case BIN('w','a','n','d') : return c_wand[0];
|
||||
case BIN('s','t','a','f') : return c_staf[0];
|
||||
case BIN('b','o','w',' ') : return c_bow[0];
|
||||
case BIN('a','x','e',' ') : return c_axe[0];
|
||||
case BIN('c','l','u','b') : return c_club[0];
|
||||
case BIN('s','w','o','r') : return c_swor[0];
|
||||
case BIN('h','a','m','m') : return c_hamm[0];
|
||||
case BIN('k','n','i','f') : return c_knif[0];
|
||||
case BIN('s','p','e','a') : return c_spea[0];
|
||||
case BIN('p','o','l','e') : return c_pole[0];
|
||||
case BIN('x','b','o','w') : return c_xbow[0];
|
||||
case BIN('m','a','c','e') : return c_mace[0];
|
||||
case BIN('h','e','l','m') : return c_helm[0];
|
||||
case BIN('t','p','o','t') : return c_tpot[0];
|
||||
case BIN('q','u','e','s') : return c_ques[0];
|
||||
case BIN('b','o','d','y') : return c_body[0];
|
||||
case BIN('k','e','y',' ') : return c_key[0];
|
||||
case BIN('t','k','n','i') : return c_tkni[0];
|
||||
case BIN('t','a','x','e') : return c_taxe[0];
|
||||
case BIN('j','a','v','e') : return c_jave[0];
|
||||
case BIN('w','e','a','p') : return c_weap[0];
|
||||
case BIN('m','e','l','e') : return c_mele[0];
|
||||
case BIN('m','i','s','s') : return c_miss[0];
|
||||
case BIN('t','h','r','o') : return c_thro[0];
|
||||
case BIN('c','o','m','b') : return c_comb[0];
|
||||
case BIN('a','r','m','o') : return c_armo[0];
|
||||
case BIN('s','h','l','d') : return c_shld[0];
|
||||
case BIN('m','i','s','c') : return c_misc[0];
|
||||
case BIN('s','o','c','k') : return c_sock[0];
|
||||
case BIN('s','e','c','o') : return c_seco[0];
|
||||
case BIN('r','o','d',' ') : return c_rod[0];
|
||||
case BIN('m','i','s','l') : return c_misl[0];
|
||||
case BIN('b','l','u','n') : return c_blun[0];
|
||||
case BIN('j','e','w','l') : return c_jewl[0];
|
||||
case BIN('c','l','a','s') : return c_clas[0];
|
||||
case BIN('a','m','a','z') : return c_amaz[0];
|
||||
case BIN('b','a','r','b') : return c_barb[0];
|
||||
case BIN('n','e','c','r') : return c_necr[0];
|
||||
case BIN('p','a','l','a') : return c_pala[0];
|
||||
case BIN('s','o','r','c') : return c_sorc[0];
|
||||
case BIN('a','s','s','n') : return c_assn[0];
|
||||
case BIN('d','r','u','i') : return c_drui[0];
|
||||
case BIN('h','2','h',' ') : return c_h2h[0];
|
||||
case BIN('h','2','h','2') : return c_h2h2[0];
|
||||
case BIN('o','r','b',' ') : return c_orb[0];
|
||||
case BIN('h','e','a','d') : return c_head[0];
|
||||
case BIN('a','s','h','d') : return c_ashd[0];
|
||||
case BIN('p','h','l','m') : return c_phlm[0];
|
||||
case BIN('p','e','l','t') : return c_pelt[0];
|
||||
case BIN('c','l','o','a') : return c_cloa[0];
|
||||
case BIN('r','u','n','e') : return c_rune[0];
|
||||
case BIN('c','i','r','c') : return c_circ[0];
|
||||
case BIN('h','p','o','t') : return c_hpot[0];
|
||||
case BIN('m','p','o','t') : return c_mpot[0];
|
||||
case BIN('r','p','o','t') : return c_rpot[0];
|
||||
case BIN('s','p','o','t') : return c_spot[0];
|
||||
case BIN('a','p','o','t') : return c_apot[0];
|
||||
case BIN('w','p','o','t') : return c_wpot[0];
|
||||
case BIN('s','c','h','a') : return c_scha[0];
|
||||
case BIN('m','c','h','a') : return c_mcha[0];
|
||||
case BIN('l','c','h','a') : return c_lcha[0];
|
||||
case BIN('a','b','o','w') : return c_abow[0];
|
||||
case BIN('a','s','p','e') : return c_aspe[0];
|
||||
case BIN('a','j','a','v') : return c_ajav[0];
|
||||
case BIN('m','b','o','q') : return c_mboq[0];
|
||||
case BIN('m','x','b','q') : return c_mxbq[0];
|
||||
case BIN('g','e','m','0') : return c_gem0[0];
|
||||
case BIN('g','e','m','1') : return c_gem1[0];
|
||||
case BIN('g','e','m','2') : return c_gem2[0];
|
||||
case BIN('g','e','m','3') : return c_gem3[0];
|
||||
case BIN('g','e','m','4') : return c_gem4[0];
|
||||
case BIN('g','e','m','a') : return c_gema[0];
|
||||
case BIN('g','e','m','d') : return c_gemd[0];
|
||||
case BIN('g','e','m','e') : return c_geme[0];
|
||||
case BIN('g','e','m','r') : return c_gemr[0];
|
||||
case BIN('g','e','m','s') : return c_gems[0];
|
||||
case BIN('g','e','m','t') : return c_gemt[0];
|
||||
case BIN('g','e','m','z') : return c_gemz[0];
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
char* getTypeAString (WORD id, char* lpText, DWORD size)
|
||||
{
|
||||
ItemTypesBIN* itemTypeData = D2GetItemTypesBIN(id);
|
||||
if (!itemTypeData)
|
||||
{
|
||||
strncpy(lpText, "Bad Type", size);
|
||||
return lpText;
|
||||
}
|
||||
|
||||
const char* string = getTypeString(itemTypeData->code);
|
||||
if (!string)
|
||||
{
|
||||
struct {
|
||||
DWORD code;
|
||||
BYTE zero;
|
||||
} code;
|
||||
code.code = itemTypeData->code;
|
||||
code.zero = 0;
|
||||
strncpy(lpText, (char*)&code, size);
|
||||
} else
|
||||
strncpy(lpText, string, size);
|
||||
|
||||
return lpText;
|
||||
}
|
||||
|
||||
LPWSTR getTypeUString (WORD id, LPWSTR lpText, DWORD size)
|
||||
{
|
||||
ItemTypesBIN* itemTypeData = D2GetItemTypesBIN(id);
|
||||
if (!itemTypeData)
|
||||
{
|
||||
mbstowcs(lpText, "Bad Type", size);
|
||||
return lpText;
|
||||
}
|
||||
const char* string = getTypeString(itemTypeData->code);
|
||||
if (!string)
|
||||
{
|
||||
struct {
|
||||
DWORD code;
|
||||
BYTE zero;
|
||||
} code;
|
||||
code.code = itemTypeData->code;
|
||||
code.zero = 0;
|
||||
mbstowcs(lpText, (char*)&code, size);
|
||||
} else
|
||||
mbstowcs(lpText, string, size);
|
||||
|
||||
return lpText;
|
||||
}
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,489 +0,0 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Common functions.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
s_shifting shifting;
|
||||
|
||||
bool isOnRect(DWORD x, DWORD y, DWORD x0, DWORD y0, DWORD l, DWORD h)
|
||||
{return (x>=x0) && (x<x0+l) && (y>y0-h) && (y<=y0);}
|
||||
|
||||
|
||||
void freeMessage(sWinMessage* msg)
|
||||
{
|
||||
msg->managed=1;
|
||||
msg->unmanaged=0;
|
||||
D2FreeWinMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
LPWSTR getString(LPWSTR eng, LPWSTR esp, LPWSTR deu, LPWSTR fra, LPWSTR por, LPWSTR ita, LPWSTR jpn, LPWSTR kor, LPWSTR sin, LPWSTR chi, LPWSTR pol, LPWSTR rus)
|
||||
{
|
||||
switch(D2GetLang())
|
||||
{
|
||||
case LNG_ENG: return eng;
|
||||
case LNG_ESP: return esp;
|
||||
case LNG_DEU: return deu;
|
||||
case LNG_FRA: return fra;
|
||||
case LNG_POR: return por;
|
||||
case LNG_ITA: return ita;
|
||||
case LNG_JPN: return jpn;
|
||||
case LNG_KOR: return kor;
|
||||
case LNG_SIN: return sin;
|
||||
case LNG_CHI: return chi;
|
||||
case LNG_POL: return pol;
|
||||
case LNG_RUS: return rus;
|
||||
case LNG_DEF:
|
||||
default: return eng;
|
||||
}
|
||||
}
|
||||
#define LANGUAGE(I,ENG,FRA,DEU,ITA,ESP,POL,CHI) case I : return getString(L##ENG,L##ESP,L##DEU,L##FRA,L##ENG,L##ITA,L##ENG,L##ENG,L##ENG,L##ENG,L##POL,L##ENG)
|
||||
|
||||
LPWSTR getTranslatedString(int stringID)
|
||||
{
|
||||
switch(stringID)
|
||||
{
|
||||
/* LANGUAGE2( STR_STATS_UNASSIGN_WITH_LIMIT,
|
||||
"+Alt: ;,+Shift: %d \x70B9\x6570",//"+Alt: Unassign, +Shift: by %d points",
|
||||
// "+Alt: \x91CD\x5206\x914D;,+Shift: %d \x70B9\x6570",//"+Alt: Unassign, +Shift: by %d points",
|
||||
"+Alt: Désallocation, +Shift: par %d points,",
|
||||
"+Alt: Zurücksetzen, +Shift: um %d Punkte",
|
||||
"+Alt: Rimuovi, +Shift: Assegna %d punti",
|
||||
"+Alt: Quita, +Shift: por %d puntos",
|
||||
"+Alt: \37325\20998\37197;,+Shift:%d \28857\25968");
|
||||
*/
|
||||
LANGUAGE( STR_STATS_UNASSIGN_WITH_LIMIT,
|
||||
"+Alt: Unassign, +Shift: by %d points",
|
||||
"+Alt: Désallocation, +Shift: par %d points",
|
||||
"+Alt: Zurücksetzen, +Shift: um %d Punkte",
|
||||
"+Alt: Rimuovi, +Shift: Assegna %d punti",
|
||||
"+Alt: Quita, +Shift: por %d puntos",
|
||||
"+Alt: Odejmij, +Shift: %d punktów");
|
||||
// "+Alt: 取消加点, +Shift: %d 点数");
|
||||
|
||||
LANGUAGE( STR_STATS_UNASSIGN_WITHOUT_LIMIT,
|
||||
"+Alt: Unassign, +Shift: all remaining points",
|
||||
"+Alt: Désallocation, +Shift: Tous les points restants",
|
||||
"+Alt: Zurücksetzen, +Shift: Alle verbleibenden Punkte",
|
||||
"+Alt: Rimuovi, +Shift: Assegna tutti i punti rimanenti",
|
||||
"+Alt: Quita, +Shift: Todos los puntos restantes",
|
||||
"+Alt: Odejmij, +Shift: wszystkie pozostale punkty");
|
||||
// "+Alt: 取消加点, +Shift: 所有剩");
|
||||
|
||||
LANGUAGE( STR_STATS_BASE_MIN,
|
||||
"Base: %d (Min: %d)",
|
||||
"Base: %d (Min: %d)",
|
||||
"Basiswert: %d (Min: %d)",
|
||||
"Base: %d (Min: %d)",
|
||||
"Base: %d (Min: %d)",
|
||||
"Bazowo: %d (Minimum: %d)");
|
||||
// "基础: %d(最小: %d)");
|
||||
|
||||
LANGUAGE( STR_SKILLS_UNASSIGN,
|
||||
"Un-allocate all skills points",
|
||||
"Désalloue tous les points d'aptitudes",
|
||||
"Alle Fertigkeitspunkte zurücksetzen",
|
||||
"Rimuovi tutte le abilità",
|
||||
"Quita todos los puntos de habilidades",
|
||||
"Rozdaj od nowa wszystkie punkty umiejetnosci");
|
||||
// "取消所有技能加点");
|
||||
|
||||
LANGUAGE( STR_STASH_PREVIOUS_PAGE,
|
||||
"Previous Page (+shift: First Page)",
|
||||
"Page précédente (+shift: Première page)",
|
||||
"Vorherige Seite (+shift: Erste Seite)",
|
||||
"Pagina Precedente (+shift: Prima Pagina)",
|
||||
"Pagina anterior (+shift: Primera Pagina)",
|
||||
"Poprzednia Strona (+shift: Pierwsza Strona)");
|
||||
// "上一页 (+shift: 首页)");
|
||||
|
||||
LANGUAGE( STR_STASH_NEXT_PAGE,
|
||||
"Next Page (+shift: Last not empty Page)",
|
||||
"Page suivante (+shift: Dernière page non vide)",
|
||||
"Nächste Seite (+shift: Letzte nicht leere Seite )",
|
||||
"Pagina Successiva (+shift: Ultima Pagina non vuota)",
|
||||
"Pagina Siguiente (+shift: Ultima pagina non vacia)",
|
||||
"Nastepna Strona (+shift: Ostatnia nie pusta Strona)");
|
||||
// "下一页 (+shift: 最后非空页");
|
||||
|
||||
LANGUAGE( STR_TOGGLE_TO_PERSONAL,
|
||||
"Toggle to Personal Stash",
|
||||
"Voir coffre personnel",
|
||||
"Wechselt zum persönlichen Goldschatz",
|
||||
"Vai all'Inventario Personale",
|
||||
"Ver el cofre personal",
|
||||
"Przejdz do Skrzyni Osobistej");
|
||||
// "切换到个人储物箱");
|
||||
|
||||
LANGUAGE( STR_TOGGLE_TO_SHARED,
|
||||
"Toggle to Shared Stash",
|
||||
"Voir coffre partagé",
|
||||
"Wechselt zum gemeinsamen Goldschatz",
|
||||
"Vai all'Inventario Condiviso",
|
||||
"Ver el cofre compartido",
|
||||
"Przejdz do Skrzyni Wspólnej");
|
||||
// "切换到共享储物箱");
|
||||
|
||||
LANGUAGE( STR_STASH_PREVIOUS_INDEX,
|
||||
"Previous Index : by %d Pages (+Shift: %d)",
|
||||
"Index précédent : par %d pages (+shift: %d)",
|
||||
"Vorheriger Index: in %d Seiten (+shift: %d)",
|
||||
"Schermata Precedente : Indietro di %d Pagine (+Shift: %d)",
|
||||
"Indice anterior : por %d paginas (+shift: %d)",
|
||||
"Poprzednia Strona : po %d Stron (+Shift: %d)");
|
||||
// "向前索引 : %d 页 (+Shift:%d)");
|
||||
|
||||
LANGUAGE( STR_STASH_NEXT_INDEX,
|
||||
"Next Index : by %d Pages (+shift: %d)",
|
||||
"Index suivant : par %d pages (+shift: %d)",
|
||||
"Nächster Index: in %d Seiten (+shift: %d)",
|
||||
"Schermata Successiva : Avanti di %d Pagine (+shift: %d)",
|
||||
"Indice siguiente : por %d paginas (+shift: %d)",
|
||||
"Nastepna Strona : po %d Stron (+shift: %d)");
|
||||
// "向后索引 : %d 页 (+shift:%d)");
|
||||
|
||||
LANGUAGE( STR_PUT_GOLD,
|
||||
"Put Gold",
|
||||
"Poser de l'Or",
|
||||
"Gib Gold",
|
||||
"Immetti Oro",
|
||||
"Poner oro",
|
||||
"Zdeponuj Zloto");
|
||||
// "放入金币");
|
||||
|
||||
LANGUAGE( STR_TAKE_GOLD,
|
||||
"Take Gold",
|
||||
"Prendre de l'Or",
|
||||
"Nehme Gold",
|
||||
"Ritira Oro",
|
||||
"Tomar oro",
|
||||
"Wyplac zloto");
|
||||
// "取出金币");
|
||||
|
||||
LANGUAGE( STR_PERSONAL_PAGE_NUMBER,
|
||||
"Personal Page n°%u",
|
||||
"Page perso n°%u",
|
||||
"Persönliche Seite n°%u",
|
||||
"Pagina Personale n°%u",
|
||||
"Pagina personal n°%u",
|
||||
"Strona Osobista n°%u");
|
||||
// "个人储物箱 n°%u");
|
||||
|
||||
LANGUAGE( STR_SHARED_PAGE_NUMBER,
|
||||
"Shared Page n°%u",
|
||||
"Page partagée n°%u",
|
||||
"Gemeinsame Seite n°%u",
|
||||
"Pagina Condivisa n°%u",
|
||||
"Pagina personal n°%u",
|
||||
"Strona Wspólna n°%u");
|
||||
// "共享储物箱 n°%u");
|
||||
|
||||
LANGUAGE( STR_NO_SELECTED_PAGE,
|
||||
"No selected page",
|
||||
"Aucune page sélectionnée",
|
||||
"Keine ausgewählte Seite",
|
||||
"Nessuna pagina selezionata",
|
||||
"Ninguna pagina seleccionada",
|
||||
"Nie zaznaczono strony");
|
||||
// "未使用页");
|
||||
|
||||
LANGUAGE( STR_SHARED_GOLD_QUANTITY,
|
||||
"Shared Gold : %u",
|
||||
"Or partagé : %u",
|
||||
"Gemeinsamen Gold : %u",
|
||||
"Oro Condiviso : %u",
|
||||
"Oro compartido : %u",
|
||||
"Wspólne Zloto : %u");
|
||||
// "共享金币: %u");
|
||||
|
||||
LANGUAGE( STR_PREVIOUS_PAGE,
|
||||
"Previous Page",
|
||||
"Page précédente",
|
||||
"Vorherige Seite",
|
||||
"Pagina Precedente",
|
||||
"Pagina anterior",
|
||||
"Poprzednia Strona");
|
||||
// "上一页");
|
||||
|
||||
LANGUAGE( STR_NEXT_PAGE,
|
||||
"Next Page",
|
||||
"Page suivante",
|
||||
"Nächste Seite",
|
||||
"Pagina Successiva",
|
||||
"Pagina siguiente",
|
||||
"Nastepna Strona");
|
||||
// "下一页");
|
||||
|
||||
default : return L"";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*=================================================================*/
|
||||
|
||||
const char* SNONE="";
|
||||
const char* c_shie[3]={"Shield (Not Class Specific)",SNONE,SNONE};
|
||||
const char* c_tors[3]={"Body Armor",SNONE,SNONE};
|
||||
const char* c_gold[3]={"Gold",SNONE,SNONE};
|
||||
const char* c_bowq[3]={"Arrow",SNONE,SNONE};
|
||||
const char* c_xboq[3]={"Bolt",SNONE,SNONE};
|
||||
const char* c_play[3]={"Ear",SNONE,SNONE};
|
||||
const char* c_herb[3]={"Herb",SNONE,SNONE};
|
||||
const char* c_poti[3]={"Potion",SNONE,SNONE};
|
||||
const char* c_ring[3]={"Ring",SNONE,SNONE};
|
||||
const char* c_elix[3]={"Elixir",SNONE,SNONE};
|
||||
const char* c_amul[3]={"Amulet",SNONE,SNONE};
|
||||
const char* c_char[3]={"Charm",SNONE,SNONE};
|
||||
const char* c_boot[3]={"Boot",SNONE,SNONE};
|
||||
const char* c_glov[3]={"Glove",SNONE,SNONE};
|
||||
const char* c_book[3]={"Book",SNONE,SNONE};
|
||||
const char* c_belt[3]={"Belt",SNONE,SNONE};
|
||||
const char* c_gem[3]={"Gem",SNONE,SNONE};
|
||||
const char* c_torc[3]={"Torch",SNONE,SNONE};
|
||||
const char* c_scro[3]={"Scroll",SNONE,SNONE};
|
||||
const char* c_scep[3]={"Scepter",SNONE,SNONE};
|
||||
const char* c_wand[3]={"Wand",SNONE,SNONE};
|
||||
const char* c_staf[3]={"Staff",SNONE,SNONE};
|
||||
const char* c_bow[3]={"Bow",SNONE,SNONE};
|
||||
const char* c_axe[3]={"Axe",SNONE,SNONE};
|
||||
const char* c_club[3]={"Club",SNONE,SNONE};
|
||||
const char* c_swor[3]={"Sword",SNONE,SNONE};
|
||||
const char* c_hamm[3]={"Hammer",SNONE,SNONE};
|
||||
const char* c_knif[3]={"Knife",SNONE,SNONE};
|
||||
const char* c_spea[3]={"Spear",SNONE,SNONE};
|
||||
const char* c_pole[3]={"Polearm",SNONE,SNONE};
|
||||
const char* c_xbow[3]={"Crossbow",SNONE,SNONE};
|
||||
const char* c_mace[3]={"Mace",SNONE,SNONE};
|
||||
const char* c_helm[3]={"Helm",SNONE,SNONE};
|
||||
|
||||
const char* c_tpot[3]={"Missile Potion",SNONE,SNONE};
|
||||
const char* c_ques[3]={"Quest Item",SNONE,SNONE};
|
||||
const char* c_body[3]={"Body Part",SNONE,SNONE};
|
||||
const char* c_key[3]={"Key",SNONE,SNONE};
|
||||
const char* c_tkni[3]={"Throwing Knife",SNONE,SNONE};
|
||||
const char* c_taxe[3]={"Throwing Axe",SNONE,SNONE};
|
||||
const char* c_jave[3]={"Javelin",SNONE,SNONE};
|
||||
const char* c_weap[3]={"Weapon",SNONE,SNONE};
|
||||
const char* c_mele[3]={"Melee Weapon",SNONE,SNONE};
|
||||
const char* c_miss[3]={"Missile Weapon",SNONE,SNONE};
|
||||
const char* c_thro[3]={"Throwing Weapon",SNONE,SNONE};
|
||||
const char* c_comb[3]={"Combo Weapon",SNONE,SNONE};
|
||||
const char* c_armo[3]={"Armor",SNONE,SNONE};
|
||||
const char* c_shld[3]={"Any Shield",SNONE,SNONE};
|
||||
const char* c_misc[3]={"Miscellaneous",SNONE,SNONE};
|
||||
const char* c_sock[3]={"Socket Filler",SNONE,SNONE};
|
||||
const char* c_seco[3]={"Second Hand Item",SNONE,SNONE};
|
||||
const char* c_rod[3]={"Staves And Rods",SNONE,SNONE};
|
||||
const char* c_misl[3]={"Missile",SNONE,SNONE};
|
||||
const char* c_blun[3]={"Blunt",SNONE,SNONE};
|
||||
|
||||
const char* c_jewl[3]={"Jewel",SNONE,SNONE};
|
||||
const char* c_clas[3]={"Class Specific",SNONE,SNONE};
|
||||
const char* c_amaz[3]={"Amazon Item",SNONE,SNONE};
|
||||
const char* c_barb[3]={"Barbarian Item",SNONE,SNONE};
|
||||
const char* c_necr[3]={"Necromancer Item",SNONE,SNONE};
|
||||
const char* c_pala[3]={"Paladin Item",SNONE,SNONE};
|
||||
const char* c_sorc[3]={"Sorceress Item",SNONE,SNONE};
|
||||
const char* c_assn[3]={"Assassin Item",SNONE,SNONE};
|
||||
const char* c_drui[3]={"Druid Item",SNONE,SNONE};
|
||||
const char* c_h2h[3]={"Claw",SNONE,SNONE};
|
||||
const char* c_orb[3]={"Orb",SNONE,SNONE};
|
||||
const char* c_head[3]={"Voodoo Heads",SNONE,SNONE};
|
||||
const char* c_ashd[3]={"Paladin Shield",SNONE,SNONE};
|
||||
const char* c_phlm[3]={"Barbarian Helm",SNONE,SNONE};
|
||||
const char* c_pelt[3]={"Druid Helm",SNONE,SNONE};
|
||||
const char* c_cloa[3]={"Cloak",SNONE,SNONE};
|
||||
const char* c_rune[3]={"Rune",SNONE,SNONE};
|
||||
const char* c_circ[3]={"Circlet",SNONE,SNONE};
|
||||
const char* c_hpot[3]={"Healing Potion",SNONE,SNONE};
|
||||
const char* c_mpot[3]={"Mana Potion",SNONE,SNONE};
|
||||
const char* c_rpot[3]={"Rejuvenation potion",SNONE,SNONE};
|
||||
const char* c_spot[3]={"Stamina Potion",SNONE,SNONE};
|
||||
const char* c_apot[3]={"Antidote Potion",SNONE,SNONE};
|
||||
const char* c_wpot[3]={"Thawing Potion",SNONE,SNONE};
|
||||
const char* c_scha[3]={"Small Charm",SNONE,SNONE};
|
||||
const char* c_mcha[3]={"Large Charm",SNONE,SNONE};
|
||||
const char* c_lcha[3]={"Grand Charm",SNONE,SNONE};
|
||||
const char* c_abow[3]={"Amazon Bow",SNONE,SNONE};
|
||||
const char* c_aspe[3]={"Amazon Spear",SNONE,SNONE};
|
||||
const char* c_ajav[3]={"Amazon Javelin",SNONE,SNONE};
|
||||
const char* c_h2h2[3]={"Assassin Claw",SNONE,SNONE};
|
||||
const char* c_mboq[3]={"Magic Arrow",SNONE,SNONE};
|
||||
const char* c_mxbq[3]={"Magic Bolt",SNONE,SNONE};
|
||||
const char* c_gem0[3]={"Chipped Gem",SNONE,SNONE};
|
||||
const char* c_gem1[3]={"Flawed Gem",SNONE,SNONE};
|
||||
const char* c_gem2[3]={"Normal Gem",SNONE,SNONE};
|
||||
const char* c_gem3[3]={"Flawless Gem",SNONE,SNONE};
|
||||
const char* c_gem4[3]={"Perfect Gem",SNONE,SNONE};
|
||||
const char* c_gema[3]={"Amethyst",SNONE,SNONE};
|
||||
const char* c_gemd[3]={"Diamond",SNONE,SNONE};
|
||||
const char* c_geme[3]={"Emerald",SNONE,SNONE};
|
||||
const char* c_gemr[3]={"Ruby",SNONE,SNONE};
|
||||
const char* c_gems[3]={"Sapphire",SNONE,SNONE};
|
||||
const char* c_gemt[3]={"Topaz",SNONE,SNONE};
|
||||
const char* c_gemz[3]={"Skull",SNONE,SNONE};
|
||||
|
||||
const char* getTypeString (DWORD code)
|
||||
{
|
||||
DWORD lang = 0;//D2GetLang();
|
||||
if ((lang == LNG_FRA) || (lang == LNG_DEU)) lang--;
|
||||
else lang = 0;
|
||||
switch (code)
|
||||
{
|
||||
case BIN('s','h','i','e') : return c_shie[0];
|
||||
case BIN('t','o','r','s') : return c_tors[0];
|
||||
case BIN('g','o','l','d') : return c_gold[0];
|
||||
case BIN('b','o','w','q') : return c_bowq[0];
|
||||
case BIN('x','b','o','q') : return c_xboq[0];
|
||||
case BIN('p','l','a','y') : return c_play[0];
|
||||
case BIN('h','e','r','b') : return c_herb[0];
|
||||
case BIN('p','o','t','i') : return c_poti[0];
|
||||
case BIN('r','i','n','g') : return c_ring[0];
|
||||
case BIN('e','l','i','x') : return c_elix[0];
|
||||
case BIN('a','m','u','l') : return c_amul[0];
|
||||
case BIN('c','h','a','r') : return c_char[0];
|
||||
case BIN('b','o','o','t') : return c_boot[0];
|
||||
case BIN('g','l','o','v') : return c_glov[0];
|
||||
case BIN('b','o','o','k') : return c_book[0];
|
||||
case BIN('b','e','l','t') : return c_belt[0];
|
||||
case BIN('g','e','m',' ') : return c_gem[0];
|
||||
case BIN('t','o','r','c') : return c_torc[0];
|
||||
case BIN('s','c','r','o') : return c_scro[0];
|
||||
case BIN('s','c','e','p') : return c_scep[0];
|
||||
case BIN('w','a','n','d') : return c_wand[0];
|
||||
case BIN('s','t','a','f') : return c_staf[0];
|
||||
case BIN('b','o','w',' ') : return c_bow[0];
|
||||
case BIN('a','x','e',' ') : return c_axe[0];
|
||||
case BIN('c','l','u','b') : return c_club[0];
|
||||
case BIN('s','w','o','r') : return c_swor[0];
|
||||
case BIN('h','a','m','m') : return c_hamm[0];
|
||||
case BIN('k','n','i','f') : return c_knif[0];
|
||||
case BIN('s','p','e','a') : return c_spea[0];
|
||||
case BIN('p','o','l','e') : return c_pole[0];
|
||||
case BIN('x','b','o','w') : return c_xbow[0];
|
||||
case BIN('m','a','c','e') : return c_mace[0];
|
||||
case BIN('h','e','l','m') : return c_helm[0];
|
||||
case BIN('t','p','o','t') : return c_tpot[0];
|
||||
case BIN('q','u','e','s') : return c_ques[0];
|
||||
case BIN('b','o','d','y') : return c_body[0];
|
||||
case BIN('k','e','y',' ') : return c_key[0];
|
||||
case BIN('t','k','n','i') : return c_tkni[0];
|
||||
case BIN('t','a','x','e') : return c_taxe[0];
|
||||
case BIN('j','a','v','e') : return c_jave[0];
|
||||
case BIN('w','e','a','p') : return c_weap[0];
|
||||
case BIN('m','e','l','e') : return c_mele[0];
|
||||
case BIN('m','i','s','s') : return c_miss[0];
|
||||
case BIN('t','h','r','o') : return c_thro[0];
|
||||
case BIN('c','o','m','b') : return c_comb[0];
|
||||
case BIN('a','r','m','o') : return c_armo[0];
|
||||
case BIN('s','h','l','d') : return c_shld[0];
|
||||
case BIN('m','i','s','c') : return c_misc[0];
|
||||
case BIN('s','o','c','k') : return c_sock[0];
|
||||
case BIN('s','e','c','o') : return c_seco[0];
|
||||
case BIN('r','o','d',' ') : return c_rod[0];
|
||||
case BIN('m','i','s','l') : return c_misl[0];
|
||||
case BIN('b','l','u','n') : return c_blun[0];
|
||||
case BIN('j','e','w','l') : return c_jewl[0];
|
||||
case BIN('c','l','a','s') : return c_clas[0];
|
||||
case BIN('a','m','a','z') : return c_amaz[0];
|
||||
case BIN('b','a','r','b') : return c_barb[0];
|
||||
case BIN('n','e','c','r') : return c_necr[0];
|
||||
case BIN('p','a','l','a') : return c_pala[0];
|
||||
case BIN('s','o','r','c') : return c_sorc[0];
|
||||
case BIN('a','s','s','n') : return c_assn[0];
|
||||
case BIN('d','r','u','i') : return c_drui[0];
|
||||
case BIN('h','2','h',' ') : return c_h2h[0];
|
||||
case BIN('h','2','h','2') : return c_h2h2[0];
|
||||
case BIN('o','r','b',' ') : return c_orb[0];
|
||||
case BIN('h','e','a','d') : return c_head[0];
|
||||
case BIN('a','s','h','d') : return c_ashd[0];
|
||||
case BIN('p','h','l','m') : return c_phlm[0];
|
||||
case BIN('p','e','l','t') : return c_pelt[0];
|
||||
case BIN('c','l','o','a') : return c_cloa[0];
|
||||
case BIN('r','u','n','e') : return c_rune[0];
|
||||
case BIN('c','i','r','c') : return c_circ[0];
|
||||
case BIN('h','p','o','t') : return c_hpot[0];
|
||||
case BIN('m','p','o','t') : return c_mpot[0];
|
||||
case BIN('r','p','o','t') : return c_rpot[0];
|
||||
case BIN('s','p','o','t') : return c_spot[0];
|
||||
case BIN('a','p','o','t') : return c_apot[0];
|
||||
case BIN('w','p','o','t') : return c_wpot[0];
|
||||
case BIN('s','c','h','a') : return c_scha[0];
|
||||
case BIN('m','c','h','a') : return c_mcha[0];
|
||||
case BIN('l','c','h','a') : return c_lcha[0];
|
||||
case BIN('a','b','o','w') : return c_abow[0];
|
||||
case BIN('a','s','p','e') : return c_aspe[0];
|
||||
case BIN('a','j','a','v') : return c_ajav[0];
|
||||
case BIN('m','b','o','q') : return c_mboq[0];
|
||||
case BIN('m','x','b','q') : return c_mxbq[0];
|
||||
case BIN('g','e','m','0') : return c_gem0[0];
|
||||
case BIN('g','e','m','1') : return c_gem1[0];
|
||||
case BIN('g','e','m','2') : return c_gem2[0];
|
||||
case BIN('g','e','m','3') : return c_gem3[0];
|
||||
case BIN('g','e','m','4') : return c_gem4[0];
|
||||
case BIN('g','e','m','a') : return c_gema[0];
|
||||
case BIN('g','e','m','d') : return c_gemd[0];
|
||||
case BIN('g','e','m','e') : return c_geme[0];
|
||||
case BIN('g','e','m','r') : return c_gemr[0];
|
||||
case BIN('g','e','m','s') : return c_gems[0];
|
||||
case BIN('g','e','m','t') : return c_gemt[0];
|
||||
case BIN('g','e','m','z') : return c_gemz[0];
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
char* getTypeAString (WORD id, char* lpText, DWORD size)
|
||||
{
|
||||
ItemTypesBIN* itemTypeData = D2GetItemTypesBIN(id);
|
||||
if (!itemTypeData)
|
||||
{
|
||||
strncpy(lpText, "Bad Type", size);
|
||||
return lpText;
|
||||
}
|
||||
|
||||
const char* string = getTypeString(itemTypeData->code);
|
||||
if (!string)
|
||||
{
|
||||
struct {
|
||||
DWORD code;
|
||||
BYTE zero;
|
||||
} code;
|
||||
code.code = itemTypeData->code;
|
||||
code.zero = 0;
|
||||
strncpy(lpText, (char*)&code, size);
|
||||
} else
|
||||
strncpy(lpText, string, size);
|
||||
|
||||
return lpText;
|
||||
}
|
||||
|
||||
LPWSTR getTypeUString (WORD id, LPWSTR lpText, DWORD size)
|
||||
{
|
||||
ItemTypesBIN* itemTypeData = D2GetItemTypesBIN(id);
|
||||
if (!itemTypeData)
|
||||
{
|
||||
mbstowcs(lpText, "Bad Type", size);
|
||||
return lpText;
|
||||
}
|
||||
const char* string = getTypeString(itemTypeData->code);
|
||||
if (!string)
|
||||
{
|
||||
struct {
|
||||
DWORD code;
|
||||
BYTE zero;
|
||||
} code;
|
||||
code.code = itemTypeData->code;
|
||||
code.zero = 0;
|
||||
mbstowcs(lpText, (char*)&code, size);
|
||||
} else
|
||||
mbstowcs(lpText, string, size);
|
||||
|
||||
return lpText;
|
||||
}
|
||||
/*================================= END OF FILE =================================*/
|
@ -5,9 +5,8 @@
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "customLibraries.h"
|
||||
#include "common.h"
|
||||
|
||||
|
||||
TCustomDll* customDlls=NULL;
|
||||
|
@ -1,5 +1,7 @@
|
||||
/*================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
This file implements some common and useful
|
||||
function related to some Diablo II mechanisms.
|
||||
@ -7,18 +9,17 @@
|
||||
================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "d2functions.h"
|
||||
#include "error.h"
|
||||
|
||||
s_shifting shifting;
|
||||
|
||||
#define D2S(F, I, R, N, P) T##N N;
|
||||
#define D2F(F, I, R, N, P) T##N N;
|
||||
#define E2S(F, A, R, N, P) T##N N;
|
||||
#define E2F(F, A, R, N, P) T##N N;
|
||||
#define E2C(F, A, T, N) T* pt##N;
|
||||
#define F7(X, Z, A,B,C,D,E,F,G, R, N, P) T##N N;
|
||||
#define A7(X, Z, A,B,C,D,E,F,G, R, N, P) T##N N;
|
||||
#define C7(Z, A,B,C,D,E,F,G, T, N) T* pt##N;
|
||||
#define F8(X, Z, A,B,C,D,E,F,G,H,I, R, N, P) T##N N;
|
||||
#define A8(X, Z, A,B,C,D,E,F,G,H,I, R, N, P) T##N N;
|
||||
#define C8(Z, A,B,C,D,E,F,G,H,I, T, N) T* pt##N;
|
||||
|
||||
#include "../Commons/D2Funcs.h"
|
||||
DataTables* SgptDataTables;
|
||||
@ -34,9 +35,9 @@ DataTables* SgptDataTables;
|
||||
////E2F(D2Client,0, void, D2SendToServer13,(BYTE type, DWORD p1, DWORD p2, DWORD p3));//6FAADA70
|
||||
//E2F(D2Game,0, NetClient*, D2GetClient, (Unit* ptUnit, char* lpszErrFile, DWORD ErrLine));//6FCBC2E0
|
||||
//E2F(D2Client,0, void, D2CleanStatMouseUp, ());//6FAABF60
|
||||
#undef F7
|
||||
#undef A7
|
||||
#undef C7
|
||||
#undef F8
|
||||
#undef A8
|
||||
#undef C8
|
||||
#undef D2S
|
||||
#undef D2F
|
||||
#undef E2S
|
||||
@ -49,41 +50,46 @@ D2S(D2Common,10598, ItemStatCostBIN*, D2Common10598, (DWORD itemStatCostID));//O
|
||||
D2S(D2Common,10673, ItemTypesBIN*, D2Common10673, (DWORD itemTypesID));//ONLY in 1.09
|
||||
#undef D2S
|
||||
|
||||
//TD2SetPlayerStat V2SetPlayerStat;
|
||||
TD2AddPlayerStat V2AddPlayerStat;
|
||||
TD2GetPlayerStat V2GetPlayerStat;
|
||||
//TD2GetPlayerStat20 V2GetPlayerStat20;
|
||||
TD2GetPlayerBaseStat V2GetPlayerBaseStat;
|
||||
TD2SetSkillBaseLevel V2SetSkillBaseLevel;
|
||||
TD2SetSkillBaseLevelOnClient V2SetSkillBaseLevelOnClient;
|
||||
TD2PrintStat V2PrintStat;
|
||||
TD2CompileCubeInput V2CompileCubeInput;
|
||||
TD2CompileCubeOutput V2CompileCubeOutput;
|
||||
TD2BroadcastFunction V2BroadcastFunction;
|
||||
TD2GetGameByClientID V2GetGameByClientID;
|
||||
TD2SpawnMonster V2SpawnMonster;
|
||||
TD2VerifIfNotCarry1 V2VerifIfNotCarry1;
|
||||
TD2GameGetObject V2GameGetObject;
|
||||
TD2TestPositionInRoom V2TestPositionInRoom;
|
||||
TD2GetItemTypesBIN V2GetItemTypesBIN;
|
||||
TD2CompileTxtFile compileTxtFile;
|
||||
//TD2SetPlayerStat V2SetPlayerStat;
|
||||
TD2AddPlayerStat V2AddPlayerStat;
|
||||
TD2GetPlayerStat V2GetPlayerStat;
|
||||
//TD2GetPlayerStat20 V2GetPlayerStat20;
|
||||
TD2GetPlayerBaseStat V2GetPlayerBaseStat;
|
||||
TD2SetSkillBaseLevel V2SetSkillBaseLevel;
|
||||
TD2SetSkillBaseLevelOnClient V2SetSkillBaseLevelOnClient;
|
||||
TD2PrintStat V2PrintStat;
|
||||
TD2CompileCubeInput V2CompileCubeInput;
|
||||
//TD2CompileCubeOutput V2CompileCubeOutput;
|
||||
TD2BroadcastFunction V2BroadcastFunction;
|
||||
TD2GetGameByClientID V2GetGameByClientID;
|
||||
TD2SpawnSuperUnique V2SpawnSuperUnique;
|
||||
TD2SpawnMonster V2SpawnMonster;
|
||||
TD2VerifIfNotCarry1 V2VerifIfNotCarry1;
|
||||
TD2GameGetObject V2GameGetObject;
|
||||
TD2TestPositionInRoom V2TestPositionInRoom;
|
||||
TD2GetItemTypesBIN V2GetItemTypesBIN;
|
||||
TD2CompileTxtFile compileTxtFile;
|
||||
WORD (*getDescStrPos) (DWORD statID);
|
||||
//void (*setImage) (sDrawImageInfo* data, void* image);
|
||||
//void (*setFrame) (sDrawImageInfo* data, DWORD frame);
|
||||
TD2SendMsgToAll V2SendMsgToAll;
|
||||
TD2SetColorPopup V2SetColorPopup;
|
||||
TD2LoadImage V2LoadImage;
|
||||
TD2PlaySound V2PlaySound;
|
||||
TD2SendToServer V2SendToServer;
|
||||
TD2GetCharStatsBIN V2GetCharStatsBIN;
|
||||
TD2GetItemStatCostBIN V2GetItemStatCostBIN;
|
||||
TD2SendPacket V2SendPacket;
|
||||
TD2LoadInventory V2LoadInventory;
|
||||
TD2SaveGame V2SaveGame;
|
||||
TD2SendMsgToAll V2SendMsgToAll;
|
||||
TD2SetColorPopup V2SetColorPopup;
|
||||
TD2LoadImage V2LoadImage;
|
||||
TD2PlaySound V2PlaySound;
|
||||
TD2SendToServer V2SendToServer;
|
||||
TD2GetCharStatsBIN V2GetCharStatsBIN;
|
||||
TD2GetItemStatCostBIN V2GetItemStatCostBIN;
|
||||
TD2SendPacket V2SendPacket;
|
||||
TD2LoadInventory V2LoadInventory;
|
||||
TD2SaveGame V2SaveGame;
|
||||
TD2MonsterUseSkill V2MonsterUseSkill;
|
||||
TD2LinkPortal V2LinkPortal;
|
||||
TD2Game235C0 V2Game235C0;
|
||||
TD2ReadFile V2ReadFile;
|
||||
|
||||
//DWORD* ptNbStatDesc
|
||||
//DWORD* ptStatDescTable;
|
||||
//TD2OpenNPCMenu V2OpenNPCMenu;
|
||||
//TD2OpenNPCMenu V2OpenNPCMenu;
|
||||
|
||||
DWORD getStatDescIDFrom (DWORD statID)//FOR 1.09
|
||||
{
|
||||
@ -228,7 +234,7 @@ __declspec(naked) void* STDCALL compileTxtFile_9(DWORD unused, const char* filen
|
||||
PUSH EDX
|
||||
MOV ECX,DWORD PTR SS:[ESP+0x230]
|
||||
LEA EDX,DWORD PTR SS:[ESP+0x28]
|
||||
CALL D2ReadFile
|
||||
CALL V2ReadFile
|
||||
TEST EAX,EAX
|
||||
JNZ continue_compileTxtFile
|
||||
PUSH 0
|
||||
@ -267,7 +273,7 @@ __declspec(naked) void* STDCALL compileTxtFile_10(DWORD unused, const char* file
|
||||
PUSH EDX
|
||||
MOV ECX,DWORD PTR SS:[ESP+0x230]
|
||||
LEA EDX,DWORD PTR SS:[ESP+0x28]
|
||||
CALL D2ReadFile
|
||||
CALL V2ReadFile
|
||||
TEST EAX,EAX
|
||||
JNZ continue_compileTxtFile
|
||||
PUSH 0
|
||||
@ -282,6 +288,109 @@ continue_compileTxtFile:
|
||||
JMP ECX
|
||||
}}
|
||||
|
||||
|
||||
DWORD compileTxtFile114_1;
|
||||
DWORD compileTxtFile114_2;
|
||||
DWORD compileTxtFile114_3;
|
||||
DWORD compileTxtFile114_5;
|
||||
DWORD compileTxtFile114_6;
|
||||
DWORD compileTxtFile114_7;
|
||||
__declspec(naked) void* STDCALL compileTxtFile_114(DWORD unused, const char* filename, BINField* ptFields, DWORD* ptRecordCount, DWORD recordLength)
|
||||
{_asm{
|
||||
PUSH EBP
|
||||
MOV EBP,ESP
|
||||
SUB ESP,0x11C
|
||||
PUSH EBX
|
||||
PUSH ESI
|
||||
PUSH EDI
|
||||
|
||||
MOV EAX,DWORD PTR SS:[EBP+0x10]
|
||||
MOV ECX,DWORD PTR SS:[EBP+0x14]
|
||||
PUSH EBX
|
||||
PUSH ESI
|
||||
MOV ESI,DWORD PTR SS:[EBP+0x8]
|
||||
PUSH EDI
|
||||
MOV EDI,DWORD PTR SS:[EBP+0xC]
|
||||
MOV DWORD PTR SS:[EBP-0x11C],ESI
|
||||
MOV DWORD PTR SS:[EBP-0x10C],EDI
|
||||
MOV DWORD PTR SS:[EBP-0x110],EAX
|
||||
MOV DWORD PTR SS:[EBP-0x118],ECX
|
||||
MOV DWORD PTR SS:[EBP-0x108],0
|
||||
|
||||
PUSH __LINE__
|
||||
PUSH S_compileTxtFile
|
||||
LEA EAX,DWORD PTR SS:[EBP-0x108]
|
||||
PUSH EAX
|
||||
MOV ECX,unused
|
||||
MOV EDX,filename
|
||||
CALL V2ReadFile
|
||||
TEST EAX,EAX
|
||||
JNZ continue_compileTxtFile
|
||||
PUSH __LINE__
|
||||
CALL D2GetInstructionPointer
|
||||
PUSH EAX
|
||||
PUSH S_errorReadTxtFile
|
||||
CALL D2FogAssert
|
||||
ADD ESP,0xC
|
||||
PUSH -1
|
||||
CALL exit
|
||||
continue_compileTxtFile:
|
||||
// EAX : file
|
||||
// ECX : -
|
||||
// EDX : -
|
||||
// EBX : -
|
||||
// MOV ESI,DWORD PTR SS:[EBP+8]
|
||||
// MOV EDI,DWORD PTR SS:[EBP+C]
|
||||
MOV ESI,DWORD PTR SS:[EBP+0xC]
|
||||
|
||||
MOV ECX,DWORD PTR SS:[EBP-0x108]
|
||||
PUSH ECX ; /Arg2
|
||||
PUSH EAX ; |Arg1
|
||||
CALL compileTxtFile114_1 ; \Game.006BD640
|
||||
MOV EDI,EAX
|
||||
PUSH EDI ; /Arg1
|
||||
CALL compileTxtFile114_2 ; \Game.006BCDE0
|
||||
MOV EBX,EAX
|
||||
MOV ESI,EBX
|
||||
IMUL ESI,DWORD PTR SS:[EBP+0x18]
|
||||
PUSH 0 ; /Arg3 = 00000000
|
||||
PUSH 0x904 ; |Arg2 = 00000904
|
||||
PUSH compileTxtFile114_3 ; |Arg1 = 006E6370 ASCII ".\DATATBLS\DataTbls.cpp"
|
||||
MOV EDX,ESI ; |
|
||||
XOR ECX,ECX ; |
|
||||
CALL D2AllocMem ; \Game.0040B430
|
||||
PUSH ESI
|
||||
PUSH 0
|
||||
PUSH EAX
|
||||
MOV DWORD PTR SS:[EBP-0x10C],EAX
|
||||
CALL compileTxtFile114_5
|
||||
MOV EDX,DWORD PTR SS:[EBP+0x18]
|
||||
MOV EAX,DWORD PTR SS:[EBP-0x10C]
|
||||
MOV ECX,DWORD PTR SS:[EBP-0x110]
|
||||
ADD ESP,0xC
|
||||
PUSH EDX
|
||||
PUSH EBX
|
||||
PUSH EAX
|
||||
PUSH ECX
|
||||
PUSH EDI
|
||||
CALL compileTxtFile114_6
|
||||
PUSH EDI ; /Arg1
|
||||
CALL compileTxtFile114_7 ; \Game.006BCDA0
|
||||
|
||||
MOV EAX, DWORD PTR SS:[EBP-0x10C]
|
||||
MOV ECX,DWORD PTR SS:[EBP-0x118]
|
||||
TEST ECX,ECX
|
||||
JE fin
|
||||
MOV DWORD PTR DS:[ECX],EBX
|
||||
fin:
|
||||
POP EDI
|
||||
POP ESI
|
||||
POP EBX
|
||||
MOV ESP,EBP
|
||||
POP EBP
|
||||
RETN 0x14
|
||||
}}
|
||||
|
||||
__declspec(naked) void* STDCALL compileTxtFile_111(DWORD unused, const char* filename, BINField* ptFields, DWORD* ptRecordCount, DWORD recordLength)
|
||||
{_asm{
|
||||
SUB ESP,0x20C
|
||||
@ -303,7 +412,7 @@ __declspec(naked) void* STDCALL compileTxtFile_111(DWORD unused, const char* fil
|
||||
PUSH EDX
|
||||
PUSH EAX
|
||||
LEA EAX,DWORD PTR SS:[ESP+0x20]
|
||||
CALL D2ReadFile
|
||||
CALL V2ReadFile
|
||||
TEST EAX,EAX
|
||||
JNZ continue_compileTxtFile
|
||||
PUSH __LINE__
|
||||
@ -435,6 +544,22 @@ FCT_ASM ( D2GetItemStatCostBIN_111 )
|
||||
JMP V2GetItemStatCostBIN
|
||||
}}
|
||||
|
||||
FCT_ASM( D2SendToServer3_114 )
|
||||
PUSH EDI
|
||||
PUSH EBX
|
||||
PUSH ECX
|
||||
MOV BYTE PTR SS:[ESP],CL
|
||||
MOV WORD PTR SS:[ESP+1],DX
|
||||
MOV EDI,3
|
||||
LEA EDX,DWORD PTR SS:[ESP]
|
||||
PUSH EDX
|
||||
CALL D2SendToServerXX
|
||||
POP ECX
|
||||
POP EBX
|
||||
POP EDI
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2SendToServer3_111 )
|
||||
PUSH EBX
|
||||
PUSH ECX
|
||||
@ -449,6 +574,19 @@ FCT_ASM ( D2SendToServer3_111 )
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2PrintStat_114 )
|
||||
PUSH ESI
|
||||
MOV ESI,DWORD PTR SS:[ESP+0x14]
|
||||
PUSH DWORD PTR SS:[ESP+0x10]
|
||||
PUSH DWORD PTR SS:[ESP+0x10]
|
||||
PUSH DWORD PTR SS:[ESP+0x10]
|
||||
PUSH EDX
|
||||
PUSH ECX
|
||||
CALL V2PrintStat
|
||||
POP ESI
|
||||
RETN 0x10
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2PrintStat_111 )
|
||||
PUSH ESI
|
||||
MOV ESI,DWORD PTR SS:[ESP+0x14]
|
||||
@ -462,6 +600,16 @@ FCT_ASM ( D2PrintStat_111 )
|
||||
RETN 0x10
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2SendPacket_114 )
|
||||
PUSH EDI
|
||||
PUSH DWORD PTR SS:[ESP+8]
|
||||
PUSH EDX
|
||||
MOV EDI,ECX
|
||||
CALL V2SendPacket
|
||||
POP EDI
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2SendPacket_111 )
|
||||
POP EAX
|
||||
PUSH EDX
|
||||
@ -485,15 +633,22 @@ FCT_ASM ( D2CompileCubeInput_111 )
|
||||
RETN 8
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2CompileCubeOutput_111 )
|
||||
PUSH EBX
|
||||
MOV EBX,ECX
|
||||
PUSH EDX
|
||||
CALL V2CompileCubeOutput
|
||||
POP EBX
|
||||
FCT_ASM ( D2CompileCubeInput_114 )
|
||||
PUSH ECX
|
||||
MOV EAX,EDX
|
||||
CALL V2CompileCubeInput
|
||||
RETN 8
|
||||
}}
|
||||
|
||||
//FCT_ASM ( D2CompileCubeOutput_111 )
|
||||
// PUSH EBX
|
||||
// MOV EBX,ECX
|
||||
// PUSH EDX
|
||||
// CALL V2CompileCubeOutput
|
||||
// POP EBX
|
||||
// RETN 8
|
||||
//}}
|
||||
|
||||
FCT_ASM ( D2BroadcastFunction_111 )
|
||||
PUSH EDI
|
||||
PUSH EBX
|
||||
@ -506,7 +661,7 @@ FCT_ASM ( D2BroadcastFunction_111 )
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2SpawnMonster_111 )
|
||||
FCT_ASM ( D2SpawnSuperUnique_111 )
|
||||
PUSH DWORD PTR SS:[ESP+0x18]
|
||||
PUSH DWORD PTR SS:[ESP+0x14]
|
||||
PUSH DWORD PTR SS:[ESP+0x14]
|
||||
@ -514,11 +669,11 @@ FCT_ASM ( D2SpawnMonster_111 )
|
||||
PUSH ECX
|
||||
MOV ECX,DWORD PTR SS:[ESP+0x18]
|
||||
MOV EAX,DWORD PTR SS:[ESP+0x28]
|
||||
CALL V2SpawnMonster
|
||||
CALL V2SpawnSuperUnique
|
||||
RETN 0x18
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2SpawnMonster_111b )
|
||||
FCT_ASM ( D2SpawnSuperUnique_111b )
|
||||
PUSH DWORD PTR SS:[ESP+0x10]
|
||||
PUSH DWORD PTR SS:[ESP+0x10]
|
||||
PUSH DWORD PTR SS:[ESP+0x10]
|
||||
@ -527,6 +682,37 @@ FCT_ASM ( D2SpawnMonster_111b )
|
||||
MOV EAX,DWORD PTR SS:[ESP+0x18]
|
||||
MOV EDX,DWORD PTR SS:[ESP+0x2C]
|
||||
MOV ECX,DWORD PTR SS:[ESP+0x28]//superuniqueID
|
||||
CALL V2SpawnSuperUnique
|
||||
RETN 0x18
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM( D2SpawnSuperUnique_114 )
|
||||
PUSH EBX
|
||||
PUSH EDI
|
||||
MOV EBX, DWORD PTR SS:[ESP+0x1C]
|
||||
MOV EDI, ECX
|
||||
PUSH DWORD PTR SS:[ESP+0x20]
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
PUSH EDX
|
||||
CALL V2SpawnSuperUnique
|
||||
POP EDI
|
||||
POP EBX
|
||||
RETN 0x18
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2SpawnMonster_114 )
|
||||
PUSH DWORD PTR SS:[ESP+0x18]
|
||||
PUSH DWORD PTR SS:[ESP+0x18]
|
||||
PUSH EDX
|
||||
PUSH ECX
|
||||
PUSH DWORD PTR SS:[ESP+0x20]
|
||||
PUSH DWORD PTR SS:[ESP+0x20]
|
||||
MOV EDX,DWORD PTR SS:[ESP+0x20]
|
||||
MOV ECX,DWORD PTR SS:[ESP+0x1C]
|
||||
CALL V2SpawnMonster
|
||||
RETN 0x18
|
||||
}}
|
||||
@ -593,6 +779,63 @@ FCT_ASM ( D2SaveGame_1XX )
|
||||
JMP V2SaveGame
|
||||
}}
|
||||
|
||||
FCT_ASM ( D2MonsterUseSkill_111 )
|
||||
PUSH EBX
|
||||
PUSH EDX
|
||||
MOV EBX,ECX
|
||||
MOV ECX,EDX
|
||||
MOV EAX,DWORD PTR SS:[ESP+0xC]
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
CALL V2MonsterUseSkill
|
||||
// Game sets monsters AiControl args[0] to 0 after this call
|
||||
POP EDX
|
||||
MOV EDX,DWORD PTR DS:[EDX+0x14]
|
||||
MOV EDX,DWORD PTR DS:[EDX+0x28]
|
||||
MOV DWORD PTR DS:[EDX+0x14],0
|
||||
POP EBX
|
||||
RETN 0x14
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM( D2LinkPortal_114 )
|
||||
PUSH ECX
|
||||
MOV ECX,DWORD PTR SS:[ESP+0x8]
|
||||
PUSH DWORD PTR SS:[ESP+0x14]
|
||||
PUSH DWORD PTR SS:[ESP+0x14]
|
||||
PUSH DWORD PTR SS:[ESP+0x14]
|
||||
CALL V2LinkPortal
|
||||
POP ECX
|
||||
RETN 0x10
|
||||
}}
|
||||
|
||||
FCT_ASM( D2Game235C0_114 )
|
||||
POP EAX
|
||||
POP ECX
|
||||
POP EDX
|
||||
PUSH EAX
|
||||
JMP V2Game235C0
|
||||
}}
|
||||
|
||||
FCT_ASM( D2ReadFile_111 )
|
||||
MOV EAX,EDX
|
||||
PUSH DWORD PTR SS:[ESP+4]
|
||||
PUSH ECX
|
||||
CALL V2ReadFile
|
||||
RETN 0xC
|
||||
}}
|
||||
|
||||
/*FCT_ASM( D2SaveSPGame_111 )
|
||||
PUSH DWORD PTR SS:[ESP+0x8]
|
||||
PUSH DWORD PTR SS:[ESP+0x8]
|
||||
PUSH EDX
|
||||
PUSH ECX
|
||||
CALL V2SaveSPGame
|
||||
RETN 8
|
||||
}}*/
|
||||
|
||||
#define SETFCTADDR(F, I, N) setFctAddr((DWORD*)&N, (HMODULE)offset_##F, (LPCSTR)I)
|
||||
void setFctAddr(DWORD* addr, HMODULE module, LPCSTR index)
|
||||
{
|
||||
@ -607,7 +850,7 @@ void setFctAddr(DWORD* addr, HMODULE module, LPCSTR index)
|
||||
*addr = NULL;
|
||||
}
|
||||
|
||||
bool initD2functions()
|
||||
void initD2functions()
|
||||
{
|
||||
// #define D2S(F, I, R, N, P) N = (F##I)GetProcAddress((HMODULE)offset_##F, (LPCSTR)I);
|
||||
// #define D2F(F, I, R, N, P) N = (F##I)GetProcAddress((HMODULE)offset_##F, (LPCSTR)I);
|
||||
@ -616,33 +859,38 @@ bool initD2functions()
|
||||
#define E2S(F, A, R, N, P) N = (T##N)(offset_##F + 0x##A);
|
||||
#define E2F(F, A, R, N, P) N = (T##N)(offset_##F + 0x##A);
|
||||
#define E2C(F, A, T, N) pt##N = (T*)(offset_##F + 0x##A);
|
||||
#define F7(X, Z, A,B,C,D,E,F,G, R, N, P) setFctAddr((DWORD*)&N, (HMODULE)offset_##Z, (LPCSTR)((version_##Z == V113? G : (version_##Z == V112? F : version_##Z == V111b? E : (version_##Z == V111? D : (version_##Z == V110? C : (version_##Z == V109d? B : A)))))));
|
||||
#define A7(X, Z, A,B,C,D,E,F,G, R, N, P) N = (T##N)R7(Z,A,B,C,D,E,F,G);
|
||||
#define C7(Z, A,B,C,D,E,F,G, T, N) pt##N = (T*)R7(Z,A,B,C,D,E,F,G);
|
||||
#define F8(X, Z, A,B,C,D,E,F,G,H,I, R, N, P) if (version_##Z > V113d) { N = (T##N)R8(Z,A,B,C,D,E,F,G,H,I); } else setFctAddr((DWORD*)&N, (HMODULE)offset_##Z, (LPCSTR)(version_##Z == V113d? H : (version_##Z == V113c? G : (version_##Z == V112? F : (version_##Z == V111b? E : (version_##Z == V111? D : (version_##Z == V110? C : (version_##Z == V109d? B : A))))))));
|
||||
#define A8(X, Z, A,B,C,D,E,F,G,H,I, R, N, P) N = (T##N)R8(Z,A,B,C,D,E,F,G,H,I);
|
||||
#define C8(Z, A,B,C,D,E,F,G,H,I, T, N) pt##N = (T*)R8(Z,A,B,C,D,E,F,G,H,I);
|
||||
|
||||
#include "../Commons/D2Funcs.h"
|
||||
SgptDataTables = *(DataTables**) R7(D2Common, 0000, 0000, 96A20, 9B74C, 9EE8C, 9B500, 99E1C);
|
||||
SgptDataTables = *(DataTables**) R8(D2Common, 0000, 0000, 96A20, 9B74C, 9EE8C, 9B500, 99E1C, A33F0, 344304);
|
||||
if (version_D2Common < V110)
|
||||
{
|
||||
D2S(D2Common,10581, CharStatsBIN*, D2Common10581, (DWORD charID));//ONLY in 1.09
|
||||
D2S(D2Common,10598, ItemStatCostBIN*, D2Common10598, (DWORD itemStatCostID));//ONLY in 1.09
|
||||
D2S(D2Common,10673, ItemTypesBIN*, D2Common10673, (DWORD itemTypesID));//ONLY in 1.09
|
||||
}
|
||||
#undef F7
|
||||
#undef A7
|
||||
#undef C7
|
||||
#undef F8
|
||||
#undef A8
|
||||
#undef C8
|
||||
#undef D2S
|
||||
#undef D2F
|
||||
#undef E2S
|
||||
#undef E2F
|
||||
#undef E2C
|
||||
|
||||
|
||||
//////////////// MISC FCT ////////////////
|
||||
//setImage = version_D2Common >= V111 ? setImage_111 : setImage_1XX;
|
||||
//setFrame = version_D2Common >= V111 ? setFrame_111 : setFrame_1XX;
|
||||
getDescStrPos = version_D2Common >= V110 ? getDescStrPos_10 : getDescStrPos_9;
|
||||
compileTxtFile = version_D2Common >= V111 ? compileTxtFile_111 : version_D2Common == V110 ? compileTxtFile_10 : compileTxtFile_9;
|
||||
compileTxtFile114_1 = offset_D2Client + 0x002BD640;
|
||||
compileTxtFile114_2 = offset_D2Client + 0x002BCDE0;
|
||||
compileTxtFile114_3 = offset_D2Client + 0x002E6370;
|
||||
compileTxtFile114_5 = offset_D2Client + 0x00281EF0;
|
||||
compileTxtFile114_6 = offset_D2Client + 0x002BD780;
|
||||
compileTxtFile114_7 = offset_D2Client + 0x002BCDA0;
|
||||
compileTxtFile = version_D2Common >= V114a ? compileTxtFile_114 : version_D2Common >= V111 ? compileTxtFile_111 : version_D2Common == V110 ? compileTxtFile_10 : compileTxtFile_9;
|
||||
|
||||
|
||||
//////////////// SELECT RIGHT ADDR FUNCTION ////////////////
|
||||
@ -836,7 +1084,7 @@ bool initD2functions()
|
||||
//V3(D2LoadSuperuniques, TD2LoadSuperuniques, D2Common, 1F500, 1F510, 29FA0, 71EB0);
|
||||
//V3(D2GetItemStatCostBIN,TD2GetItemStatCostBIN, D2Common, 000, 000, 642B0, 13F0);
|
||||
//V3(D2GetItemTypesBIN, TD2GetItemTypesBIN, D2Common, 000, 000, 2B1A0, 11F0);
|
||||
//V3(D2SpawnMonster, TD2SpawnMonster, D2Game, 000, 000, 3F220, 4ABE0);
|
||||
//V3(D2SpawnSuperUnique, TD2SpawnSuperUnique, D2Game, 000, 000, 3F220, 4ABE0);
|
||||
//V3(D2ReloadGambleScreen,TD2ReloadGambleScreen, D2Game, 000, 000, 000, 8E480);
|
||||
//V3(D2SaveGame, TD2SaveGame, D2Game, 000, 000, 89C0, E2390);
|
||||
//V3(D2ClickOnStashButton,TD2ClickOnStashButton, D2Client, 000, 000, 000, A6520);
|
||||
@ -845,12 +1093,12 @@ bool initD2functions()
|
||||
//V3(D2Game235C0, TD2Game235C0, D2Game, 000, 000, 000, D6D10);
|
||||
//V3(D2OpenPandPortal, TD2OpenPandPortal, D2Game, 000, 000, 000, 9B480);
|
||||
//V3(D2OpenPandFinalPortal,TD2OpenPandFinalPortal,D2Game, 000, 000, 000, 9B470);
|
||||
//V3(D2MephIA, TD2MephIA, D2Game, 000, 000, 000, 84730);
|
||||
//V3(D2DiabloIA, TD2DiabloIA, D2Game, 000, 000, 000, 75980);
|
||||
//V3(D2BaalIA, TD2BaalIA, D2Game, 000, 000, 000, EAB20);
|
||||
//V3(D2UberMephIA, TD2UberMephIA, D2Game, 000, 000, 000, 70320);
|
||||
//V3(D2UberDiabloIA, TD2UberDiabloIA, D2Game, 000, 000, 000, 7F200);
|
||||
//V3(D2UberBaalIA, TD2UberBaalIA, D2Game, 000, 000, 000, E92B0);
|
||||
//V3(D2MephAI, TD2MephAI, D2Game, 000, 000, 000, 84730);
|
||||
//V3(D2DiabloAI, TD2DiabloAI, D2Game, 000, 000, 000, 75980);
|
||||
//V3(D2BaalAI, TD2BaalAI, D2Game, 000, 000, 000, EAB20);
|
||||
//V3(D2UberMephAI, TD2UberMephAI, D2Game, 000, 000, 000, 70320);
|
||||
//V3(D2UberDiabloAI, TD2UberDiabloAI, D2Game, 000, 000, 000, 7F200);
|
||||
//V3(D2UberBaalAI, TD2UberBaalAI, D2Game, 000, 000, 000, E92B0);
|
||||
|
||||
//#undef V3
|
||||
|
||||
@ -872,19 +1120,41 @@ bool initD2functions()
|
||||
V2SendPacket = D2SendPacket;
|
||||
V2LoadInventory = D2LoadInventory;
|
||||
V2CompileCubeInput = D2CompileCubeInput;
|
||||
V2CompileCubeOutput = D2CompileCubeOutput;
|
||||
//V2CompileCubeOutput = D2CompileCubeOutput;
|
||||
V2BroadcastFunction = D2BroadcastFunction;
|
||||
V2GetGameByClientID = D2GetGameByClientID;
|
||||
V2SpawnSuperUnique = D2SpawnSuperUnique;
|
||||
V2SpawnMonster = D2SpawnMonster;
|
||||
V2VerifIfNotCarry1 = D2VerifIfNotCarry1;
|
||||
V2GameGetObject = D2GameGetObject;
|
||||
V2TestPositionInRoom = D2TestPositionInRoom;
|
||||
V2GetItemTypesBIN = D2GetItemTypesBIN;
|
||||
V2SaveGame = D2SaveGame;
|
||||
V2MonsterUseSkill = D2MonsterUseSkill;
|
||||
V2LinkPortal = D2LinkPortal;
|
||||
V2Game235C0 = D2Game235C0;
|
||||
V2ReadFile = D2ReadFile;
|
||||
//V2OpenNPCMenu = D2OpenNPCMenu;
|
||||
//////////////// REDIRECT ON CUSTOM FUNCTIONS ////////////////
|
||||
|
||||
if ( version_D2Client >= V111 )
|
||||
if (version_D2Client == V114d)
|
||||
{
|
||||
D2SendToServer3 = (TD2SendToServer3) D2SendToServer3_114;
|
||||
D2PrintStat = (TD2PrintStat)D2PrintStat_114;
|
||||
D2SendPacket = (TD2SendPacket) D2SendPacket_114;
|
||||
D2CompileCubeInput = (TD2CompileCubeInput) D2CompileCubeInput_114;
|
||||
D2SpawnSuperUnique = (TD2SpawnSuperUnique) D2SpawnSuperUnique_114;
|
||||
D2VerifIfNotCarry1 = (TD2VerifIfNotCarry1)D2VerifIfNotCarry1_111;
|
||||
D2isLODGame = D2isLODGame_111;
|
||||
D2GetMouseX = D2GetMouseX_111;
|
||||
D2GetMouseY = D2GetMouseY_111;
|
||||
D2SpawnMonster = (TD2SpawnMonster)D2SpawnMonster_114;
|
||||
D2LinkPortal = (TD2LinkPortal)D2LinkPortal_114;
|
||||
D2Game235C0 = (TD2Game235C0) D2Game235C0_114;
|
||||
D2GetGameByClientID = (TD2GetGameByClientID) D2GetGameByClientID_1XX;
|
||||
D2SaveGame = (TD2SaveGame) D2SaveGame_1XX;
|
||||
}
|
||||
else if ( version_D2Client >= V111 )
|
||||
{
|
||||
D2SendMsgToAll = (TD2SendMsgToAll) D2SendMsgToAll_111;
|
||||
D2SetColorPopup = (TD2SetColorPopup) D2SetColorPopup_111;
|
||||
@ -900,9 +1170,9 @@ bool initD2functions()
|
||||
D2SendPacket = (TD2SendPacket) D2SendPacket_111;
|
||||
D2LoadInventory = (TD2LoadInventory) D2LoadInventory_111;
|
||||
D2CompileCubeInput = (TD2CompileCubeInput) D2CompileCubeInput_111;
|
||||
D2CompileCubeOutput = (TD2CompileCubeOutput) D2CompileCubeOutput_111;
|
||||
//D2CompileCubeOutput = (TD2CompileCubeOutput) D2CompileCubeOutput_111;
|
||||
D2BroadcastFunction = (TD2BroadcastFunction) D2BroadcastFunction_111;
|
||||
D2SpawnMonster = version_D2Game >= V111b ? (TD2SpawnMonster)D2SpawnMonster_111b : (TD2SpawnMonster)D2SpawnMonster_111;
|
||||
D2SpawnSuperUnique = version_D2Game >= V111b ? (TD2SpawnSuperUnique)D2SpawnSuperUnique_111b : (TD2SpawnSuperUnique)D2SpawnSuperUnique_111;
|
||||
D2VerifIfNotCarry1 = (TD2VerifIfNotCarry1) D2VerifIfNotCarry1_111;
|
||||
D2GameGetObject = (TD2GameGetObject) D2GameGetObject_111;
|
||||
D2GetItemTypesBIN = (TD2GetItemTypesBIN) D2GetItemTypesBIN_111;
|
||||
@ -915,10 +1185,12 @@ bool initD2functions()
|
||||
D2GetClientPlayer = D2GetClientPlayer_111;
|
||||
D2GetRealItem = D2GetRealItem_111;
|
||||
D2CleanStatMouseUp = D2CleanStatMouseUp_111;
|
||||
StatMouse1 = (DWORD*)R7(D2Client, 0000, 0000, 0000, 11C004, 11C2F4, 11C040, 11C3DC);
|
||||
StatMouse2 = (DWORD*)R7(D2Client, 0000, 0000, 0000, 11C008, 11C2F8, 11C044, 11C3E0);
|
||||
StatMouse3 = (DWORD*)R7(D2Client, 0000, 0000, 0000, 11C020, 11C310, 11C05C, 11C3F8);
|
||||
StatMouse4 = (DWORD*)R7(D2Client, 0000, 0000, 0000, 11C024, 11C314, 11C060, 11C3FC);
|
||||
D2MonsterUseSkill = (TD2MonsterUseSkill)D2MonsterUseSkill_111;
|
||||
D2ReadFile = (TD2ReadFile)D2ReadFile_111;
|
||||
StatMouse1 = (DWORD*)R8(D2Client, 0000, 0000, 0000, 11C004, 11C2F4, 11C040, 11C3DC, 11D224, 3A0650);
|
||||
StatMouse2 = (DWORD*)R8(D2Client, 0000, 0000, 0000, 11C008, 11C2F8, 11C044, 11C3E0, 11D228, 3A0654);
|
||||
StatMouse3 = (DWORD*)R8(D2Client, 0000, 0000, 0000, 11C020, 11C310, 11C05C, 11C3F8, 11D240, 3A0658);
|
||||
StatMouse4 = (DWORD*)R8(D2Client, 0000, 0000, 0000, 11C024, 11C314, 11C060, 11C3FC, 11D244, 3A065C);
|
||||
} else {
|
||||
D2SendToServer = (TD2SendToServer) D2SendToServer_1XX;
|
||||
D2GetGameByClientID = (TD2GetGameByClientID) D2GetGameByClientID_1XX;
|
||||
@ -948,15 +1220,14 @@ bool initD2functions()
|
||||
//////////////// STRUCTURE MANAGEMENT ////////////////
|
||||
|
||||
// shifting.ptPYPlayerData = V7(D2Common,118,118,F4,F4,F4,F4,F4);
|
||||
shifting.ptPYPlayerData = *(DWORD*)((DWORD)D2InitPlayerData + V7(D2Common,5D,5D,5D,49,49,49,49));
|
||||
shifting.ptSpecificData = V7(D2Common,70,70,14,14,14,14,14);
|
||||
shifting.ptGame = V7(D2Common,A4,A4,80,80,80,80,80);
|
||||
shifting.ptClientGame = V7(D2Common,170,194,1A8,1A8,1A8,1A8,1A8);
|
||||
shifting.ptInventory = V7(D2Common,84,84,60,60,60,60,60);
|
||||
shifting.ptSkills = V7(D2Common,CC,CC,A8,A8,A8,A8,A8);
|
||||
shifting.ptImage = V7(D2Common,04,04,04,08,08,3C,34);
|
||||
shifting.ptFrame = V7(D2Common,08,08,08,44,44,40,00);
|
||||
return true;
|
||||
shifting.ptPYPlayerData = *(DWORD*)((DWORD)D2InitPlayerData + V8(D2Common,5D,5D,5D,49,49,49,49,49,48));
|
||||
shifting.ptSpecificData = V8(D2Common,70,70,14,14,14,14,14,14,14);
|
||||
shifting.ptGame = V8(D2Common,A4,A4,80,80,80,80,80,80,80);
|
||||
shifting.ptClientGame = V8(D2Common,170,194,1A8,1A8,1A8,1A8,1A8,1A8,1A8);
|
||||
shifting.ptInventory = V8(D2Common,84,84,60,60,60,60,60,60,60);
|
||||
shifting.ptSkills = V8(D2Common,CC,CC,A8,A8,A8,A8,A8,A8,A8);
|
||||
shifting.ptImage = V8(D2Common,04,04,04,08,08,3C,34,34,34);
|
||||
shifting.ptFrame = V8(D2Common,08,08,08,44,44,40,00,00,00);
|
||||
}
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,5 +1,7 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d and DoNotCloseNihlathakPortal by haxifix.
|
||||
|
||||
@file D2wrapper.cpp
|
||||
@brief Main Diablo II extra DLL handler.
|
||||
@ -8,13 +10,7 @@
|
||||
|
||||
=================================================================*/
|
||||
|
||||
// Core Class Headers
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "customLibraries.h"
|
||||
|
||||
/* Beginning of Custom Header */
|
||||
#include "plugYFiles.h" // Install_PlugYFiles()
|
||||
#include "globalVariable.h" // Install_VariableOnRealm()
|
||||
#include "commands.h" // Install_Commands()
|
||||
#include "othersFeatures.h" // Install_ChangeResolution()
|
||||
@ -31,105 +27,84 @@
|
||||
#include "uberQuest.h" // Install_UberQuest()
|
||||
#include "extraOptions.h" // Install_AlwaysRegenMapInSP()
|
||||
#include "language.h" // Install_LanguageManagement()
|
||||
#include "windowed.h" // installed with Install_PrintPlugYVersion()
|
||||
#include "savePlayerData.h" // Install_SavePlayerData()
|
||||
#include "customLibraries.h"
|
||||
#include "common.h"
|
||||
|
||||
|
||||
int version_SmackW32=V113;
|
||||
int version_D2Common=V113;
|
||||
int version_ijl11=V113;
|
||||
int version_D2Gdi=V113;
|
||||
int version_D2Win=V113;
|
||||
int version_D2sound=V113;
|
||||
int version_D2MCPCLI=V113;
|
||||
int version_D2Launch=V113;
|
||||
int version_D2gfx=V113;
|
||||
int version_D2Client=V113;
|
||||
int version_D2Net=V113;
|
||||
int version_D2Lang=V113;
|
||||
int version_D2Game=V113;
|
||||
int version_D2CMP=V113;
|
||||
int version_Bnclient=V113;
|
||||
int version_Fog=V113;
|
||||
int version_Storm=V113;
|
||||
int version_Game = UNKNOWN;
|
||||
//int version_binkw32 = UNKNOWN;
|
||||
//int version_Bnclient = UNKNOWN;
|
||||
int version_D2Client = UNKNOWN;
|
||||
int version_D2CMP = UNKNOWN;
|
||||
int version_D2Common = UNKNOWN;
|
||||
//int version_D2DDraw = UNKNOWN;
|
||||
//int version_D2Direct3D = UNKNOWN;
|
||||
int version_D2Game = UNKNOWN;
|
||||
//int version_D2Gdi = UNKNOWN;
|
||||
int version_D2gfx = UNKNOWN;
|
||||
//int version_D2Glide = UNKNOWN;
|
||||
int version_D2Lang = UNKNOWN;
|
||||
int version_D2Launch = UNKNOWN;
|
||||
//int version_D2MCPClient = UNKNOWN;
|
||||
//int version_D2Multi = UNKNOWN;
|
||||
int version_D2Net = UNKNOWN;
|
||||
//int version_D2sound = UNKNOWN;
|
||||
int version_D2Win = UNKNOWN;
|
||||
int version_Fog = UNKNOWN;
|
||||
//int version_ijl11 = UNKNOWN;
|
||||
//int version_SmackW32 = UNKNOWN;
|
||||
int version_Storm = UNKNOWN;
|
||||
|
||||
DWORD offset_Game = NULL;
|
||||
//DWORD offset_binkw32 = NULL;
|
||||
//DWORD offset_Bnclient = NULL;
|
||||
DWORD offset_D2Client = NULL;
|
||||
DWORD offset_D2CMP = NULL;
|
||||
DWORD offset_D2Common = NULL;
|
||||
//DWORD offset_D2DDraw = NULL;
|
||||
//DWORD offset_D2Direct3D = NULL;
|
||||
DWORD offset_D2Game = NULL;
|
||||
//DWORD offset_D2Gdi = NULL;
|
||||
DWORD offset_D2gfx = NULL;
|
||||
//DWORD offset_D2Glide = NULL;
|
||||
DWORD offset_D2Lang = NULL;
|
||||
DWORD offset_D2Launch = NULL;
|
||||
//DWORD offset_D2MCPClient = NULL;
|
||||
//DWORD offset_D2Multi = NULL;
|
||||
DWORD offset_D2Net = NULL;
|
||||
//DWORD offset_D2sound = NULL;
|
||||
DWORD offset_D2Win = NULL;
|
||||
DWORD offset_Fog = NULL;
|
||||
//DWORD offset_ijl11 = NULL;
|
||||
//DWORD offset_SmackW32 = NULL;
|
||||
DWORD offset_Storm = NULL;
|
||||
|
||||
DWORD offset_SmackW32=NULL;
|
||||
DWORD offset_D2Common=NULL;
|
||||
DWORD offset_ijl11=NULL;
|
||||
DWORD offset_D2Gdi=NULL;
|
||||
DWORD offset_D2Win=NULL;
|
||||
DWORD offset_D2sound=NULL;
|
||||
DWORD offset_D2Multi=NULL;
|
||||
DWORD offset_D2MCPCLI=NULL;
|
||||
DWORD offset_D2Launch=NULL;
|
||||
DWORD offset_D2gfx=NULL;
|
||||
DWORD offset_D2Game=NULL;
|
||||
DWORD offset_D2Client=NULL;
|
||||
DWORD offset_D2Net=NULL;
|
||||
DWORD offset_D2Lang=NULL;
|
||||
DWORD offset_D2CMP=NULL;
|
||||
DWORD offset_Bnclient=NULL;
|
||||
DWORD offset_Fog=NULL;
|
||||
DWORD offset_Storm=NULL;
|
||||
// manque : Game.exe D2DDraw.dll D2Direct3D.dll D2Glide.dll
|
||||
|
||||
const char* S_SmackW32 = "SmackW32.dll";
|
||||
const char* S_D2Common = "D2Common.dll";
|
||||
const char* S_ijl11 = "ijl11.dll";
|
||||
const char* S_D2Gdi = "D2Gdi.dll";
|
||||
const char* S_D2Win = "D2Win.dll";
|
||||
const char* S_D2sound = "D2sound.dll";
|
||||
const char* S_D2Multi = "D2Multi.dll";
|
||||
const char* S_D2MCPCLI = "D2MCPClient.dll";
|
||||
const char* S_D2Launch = "D2Launch.dll";
|
||||
const char* S_D2gfx = "D2gfx.dll";
|
||||
const char* S_D2Game = "D2Game.dll";
|
||||
const char* S_Game = "Game.exe";
|
||||
//const char* S_binkw32 = "binkw32.dll";
|
||||
//const char* S_Bnclient = "Bnclient.dll";
|
||||
const char* S_D2Client = "D2Client.dll";
|
||||
const char* S_D2Net = "D2Net.dll";
|
||||
const char* S_D2Lang = "D2Lang.dll";
|
||||
const char* S_D2CMP = "D2CMP.dll";
|
||||
const char* S_Bnclient = "Bnclient.dll";
|
||||
const char* S_D2Common = "D2Common.dll";
|
||||
//const char* S_D2DDraw = "D2DDraw.dll";
|
||||
//const char* S_D2Direct3D = "D2Direct3D.dll";
|
||||
const char* S_D2Game = "D2Game.dll";
|
||||
//const char* S_D2Gdi = "D2Gdi.dll";
|
||||
const char* S_D2gfx = "D2gfx.dll";
|
||||
//const char* S_D2Glide = "D2Glide.dll";
|
||||
const char* S_D2Lang = "D2Lang.dll";
|
||||
const char* S_D2Launch = "D2Launch.dll";
|
||||
//const char* S_D2MCPClient = "D2MCPClient.dll";
|
||||
//const char* S_D2Multi = "D2Multi.dll";
|
||||
const char* S_D2Net = "D2Net.dll";
|
||||
//const char* S_D2sound = "D2sound.dll";
|
||||
const char* S_D2Win = "D2Win.dll";
|
||||
const char* S_Fog = "Fog.dll";
|
||||
//const char* S_ijl11 = "ijl11.dll";
|
||||
//const char* S_SmackW32 = "SmackW32.dll";
|
||||
const char* S_Storm = "Storm.dll";
|
||||
|
||||
const char* S_CloneBattles ="CloneBattles.dll";
|
||||
const char* S_DarkAlliance ="DarkAlliance.dll";
|
||||
|
||||
DWORD loadLibrary( const char* libraryName)
|
||||
{
|
||||
DWORD offset;
|
||||
/* char currentpath[MAX_PATH];
|
||||
|
||||
if (!strcmp(libraryName,"D2Common.dll") || !strcmp(libraryName,"D2Game.dll") || !strcmp(libraryName,"D2Client.dll"))
|
||||
{
|
||||
GetCurrentDirectory(MAX_PATH,currentpath);
|
||||
strncat(currentpath,"\\",MAX_PATH);
|
||||
strncat(currentpath,libraryName,MAX_PATH);
|
||||
log_msg("Load = %s : ",currentpath);
|
||||
offset = (DWORD)LoadLibrary(currentpath);
|
||||
log_msg("offset = %08X\n",offset);
|
||||
if (offset)
|
||||
{
|
||||
log_msg("%s loaded successfully at: %08X\n", libraryName, offset);
|
||||
return offset;
|
||||
}
|
||||
}*/
|
||||
offset = (DWORD)LoadLibrary(libraryName);
|
||||
if (!offset)
|
||||
{
|
||||
log_msg("Failed to load library : %s\n", libraryName);
|
||||
exit(-1);
|
||||
}
|
||||
log_msg("%s loaded successfully at: %08X\n", libraryName, offset);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
void freeLibrary( DWORD library )
|
||||
{
|
||||
if (library)
|
||||
FreeLibrary((HINSTANCE__ *)library);
|
||||
}
|
||||
|
||||
// Change the protection scheme of a loaded
|
||||
// DLL called libraryName in memory space at address addr+size to allow us to customize it.
|
||||
void hookLibrary(const char* libraryName, DWORD addr)
|
||||
@ -158,55 +133,40 @@ void unhookLibrary(const char* libraryName, DWORD addr)
|
||||
log_msg("%s successfully unhooked. (%08X,%08X)\n", libraryName ,baseOfCode, sizeOfCode);
|
||||
}
|
||||
|
||||
|
||||
void loadD2Libraries ()
|
||||
void freeLibrary( DWORD library )
|
||||
{
|
||||
log_msg("***** Load D2 Libraries *****\n");
|
||||
|
||||
offset_SmackW32 = loadLibrary( S_SmackW32); //0xD000 0x03B90000 Already Loaded -
|
||||
offset_D2Common = loadLibrary( S_D2Common); //0x8D000 0x037A0000 0x7C000
|
||||
offset_ijl11 = loadLibrary( S_ijl11); //0x24000 0x60000000 Already Loaded -
|
||||
offset_D2Gdi = loadLibrary( S_D2Gdi); //0x7000 0x6F830000 Already Loaded -
|
||||
offset_D2Win = loadLibrary( S_D2Win); //0x19000 0x6F8A0000 Already Loaded 0x1C000
|
||||
offset_D2sound = loadLibrary( S_D2sound); //0xC000 0x6F980000 Already Loaded 0xD000
|
||||
// offset_D2Multi = loadLibrary( S_D2Multi); //0x1000 0x6F9A0000 ?
|
||||
// offset_D2MCPCLI = loadLibrary( S_D2MCPCLI); //0x6000 0x6F9F0000 Already Loaded -
|
||||
offset_D2Launch = loadLibrary( S_D2Launch); //0x20000 0x6FA10000 Already Loaded 0x1E000
|
||||
offset_D2gfx = loadLibrary( S_D2gfx); //0xB000 0x6FA70000 Already Loaded -
|
||||
offset_D2Game = loadLibrary( S_D2Game); //0xF6000 0x6FC30000 0xCF000
|
||||
offset_D2Client = loadLibrary( S_D2Client); //0xCC000 0x6FAA0000 0xCA000
|
||||
offset_D2Net = loadLibrary( S_D2Net); //0x6000 0x6FC00000 Already Loaded -
|
||||
offset_D2Lang = loadLibrary( S_D2Lang); //0x0A000 0x6FC10000 Already Loaded -
|
||||
offset_D2CMP = loadLibrary( S_D2CMP); //0x18000 0x6FDF0000 Already Loaded 0x19000
|
||||
offset_Bnclient = loadLibrary( S_Bnclient); //0x15000 0x6FF00000 Already Loaded -
|
||||
offset_Fog = loadLibrary( S_Fog); //0x20000 0x6FF50000 Already Loaded 0x1F000
|
||||
offset_Storm = loadLibrary( S_Storm); //0x30000 0x6FFB0000 Already Loaded -
|
||||
|
||||
log_msg("\n\n");
|
||||
if (library && library != offset_Game)
|
||||
FreeLibrary((HMODULE)library);
|
||||
}
|
||||
|
||||
|
||||
void freeD2Libraries()
|
||||
{
|
||||
if (version_Game >= V114a)
|
||||
return;
|
||||
|
||||
log_msg("***** Free Libraries *****\n");
|
||||
|
||||
freeLibrary( offset_SmackW32 );
|
||||
freeLibrary( offset_D2Common );
|
||||
freeLibrary( offset_ijl11 );
|
||||
freeLibrary( offset_D2Gdi );
|
||||
freeLibrary( offset_D2Win );
|
||||
freeLibrary( offset_D2sound );
|
||||
// freeLibrary( offset_D2Multi );
|
||||
// freeLibrary( offset_D2MCPCLI );
|
||||
freeLibrary( offset_D2Launch );
|
||||
freeLibrary( offset_D2gfx );
|
||||
freeLibrary( offset_D2Game );
|
||||
// freeLibrary( offset_binkw32 );
|
||||
// freeLibrary( offset_Bnclient );
|
||||
freeLibrary( offset_D2Client );
|
||||
freeLibrary( offset_D2Net );
|
||||
freeLibrary( offset_D2Lang );
|
||||
freeLibrary( offset_D2CMP );
|
||||
freeLibrary( offset_Bnclient );
|
||||
freeLibrary( offset_Fog );
|
||||
freeLibrary( offset_D2Common );
|
||||
// freeLibrary( offset_D2DDraw );
|
||||
// freeLibrary( offset_D2Direct3D );
|
||||
freeLibrary( offset_D2Game );
|
||||
// freeLibrary( offset_D2Gdi );
|
||||
freeLibrary( offset_D2gfx );
|
||||
// freeLibrary( offset_D2Glide );
|
||||
freeLibrary( offset_D2Lang );
|
||||
freeLibrary( offset_D2Launch );
|
||||
// freeLibrary( offset_D2MCPClient );
|
||||
// freeLibrary( offset_D2Multi );
|
||||
freeLibrary( offset_D2Net );
|
||||
// freeLibrary( offset_D2sound );
|
||||
freeLibrary( offset_D2Win );
|
||||
freeLibrary( offset_Fog );
|
||||
// freeLibrary( offset_ijl11 );
|
||||
// freeLibrary( offset_SmackW32 );
|
||||
freeLibrary( offset_Storm );
|
||||
|
||||
log_msg("\n\n");
|
||||
@ -216,16 +176,22 @@ void hookLibraries()
|
||||
{
|
||||
log_msg("***** Unprotect Libraries *****\n");
|
||||
|
||||
hookLibrary(S_D2Common, offset_D2Common);
|
||||
hookLibrary(S_D2Client, offset_D2Client);
|
||||
hookLibrary(S_D2Lang, offset_D2Lang);
|
||||
hookLibrary(S_D2Game, offset_D2Game);
|
||||
hookLibrary(S_Fog, offset_Fog);
|
||||
hookLibrary(S_Storm, offset_Storm);
|
||||
// hookLibrary(S_D2Win, offset_D2Win);
|
||||
hookLibrary(S_D2Launch, offset_D2Launch);
|
||||
hookLibrary(S_D2gfx, offset_D2gfx);
|
||||
// hookLibrary(S_D2Gdi, offset_D2Gdi);
|
||||
if (version_Game >= V114a)
|
||||
hookLibrary(S_Game, offset_Game);
|
||||
else
|
||||
{
|
||||
hookLibrary(S_D2Client, offset_D2Client);
|
||||
// hookLibrary(S_D2CMP, offset_D2CMP);
|
||||
hookLibrary(S_D2Common, offset_D2Common);
|
||||
hookLibrary(S_D2Game, offset_D2Game);
|
||||
hookLibrary(S_D2gfx, offset_D2gfx);
|
||||
hookLibrary(S_D2Lang, offset_D2Lang);
|
||||
hookLibrary(S_D2Launch, offset_D2Launch);
|
||||
// hookLibrary(S_D2Net, offset_D2Net);
|
||||
// hookLibrary(S_D2Win, offset_D2Win);
|
||||
hookLibrary(S_Fog, offset_Fog);
|
||||
hookLibrary(S_Storm, offset_Storm);
|
||||
}
|
||||
|
||||
log_msg("\n\n");
|
||||
}
|
||||
@ -234,22 +200,31 @@ void unhookLibraries()
|
||||
{
|
||||
log_msg("***** Reprotect Libraries *****\n");
|
||||
|
||||
unhookLibrary(S_D2Common, offset_D2Common);
|
||||
unhookLibrary(S_D2Client, offset_D2Client);
|
||||
unhookLibrary(S_D2Lang, offset_D2Lang);
|
||||
unhookLibrary(S_D2Game, offset_D2Game);
|
||||
unhookLibrary(S_Fog, offset_Fog);
|
||||
unhookLibrary(S_Storm, offset_Storm);
|
||||
// unhookLibrary(S_D2Win, offset_D2Win);
|
||||
unhookLibrary(S_D2Launch, offset_D2Launch);
|
||||
unhookLibrary(S_D2gfx, offset_D2gfx);
|
||||
// unhookLibrary(S_D2Gdi, offset_D2Gdi);
|
||||
if (version_Game >= V114a)
|
||||
unhookLibrary(S_Game, offset_Game);
|
||||
else
|
||||
{
|
||||
unhookLibrary(S_D2Client, offset_D2Client);
|
||||
// unhookLibrary(S_D2CMP, offset_D2CMP);
|
||||
unhookLibrary(S_D2Common, offset_D2Common);
|
||||
unhookLibrary(S_D2Game, offset_D2Game);
|
||||
unhookLibrary(S_D2gfx, offset_D2gfx);
|
||||
unhookLibrary(S_D2Lang, offset_D2Lang);
|
||||
unhookLibrary(S_D2Launch, offset_D2Launch);
|
||||
// unhookLibrary(S_D2Net, offset_D2Net);
|
||||
// unhookLibrary(S_D2Win, offset_D2Win);
|
||||
unhookLibrary(S_Fog, offset_Fog);
|
||||
unhookLibrary(S_Storm, offset_Storm);
|
||||
}
|
||||
|
||||
log_msg("\n\n");
|
||||
}
|
||||
|
||||
void freeCustomLibraries()
|
||||
{
|
||||
if (!customDlls)
|
||||
return;
|
||||
|
||||
log_msg("***** Free custom libraries *****\n");
|
||||
|
||||
TCustomDll* dll=customDlls;
|
||||
@ -259,7 +234,7 @@ void freeCustomLibraries()
|
||||
dll->release();
|
||||
freeLibrary(dll->offset);
|
||||
nextDll = dll->nextDll;
|
||||
D2FogMemDeAlloc(dll,__FILE__,__LINE__,0);
|
||||
delete(dll);
|
||||
dll = nextDll;
|
||||
}
|
||||
}
|
||||
@ -291,19 +266,21 @@ void loadCustomLibraries()
|
||||
log_msg("No custom libraries to load.\n");
|
||||
else
|
||||
{
|
||||
log_msg("Load custom libraries :\n");
|
||||
while (curString)
|
||||
{
|
||||
if (curString[0])
|
||||
{
|
||||
offset_currentDll = loadLibrary(curString);
|
||||
if (offset_currentDll)
|
||||
log_msg("Load custom library : %s\n", curString);
|
||||
offset_currentDll = (DWORD)LoadLibrary(curString);
|
||||
if (!offset_currentDll)
|
||||
{
|
||||
nextDll = customDlls;
|
||||
customDlls = new(TCustomDll);
|
||||
customDlls->nextDll = nextDll;
|
||||
customDlls->initialize(offset_currentDll);
|
||||
log_msg("Load library %s failed !\n", curString);
|
||||
exit(0);
|
||||
}
|
||||
nextDll = customDlls;
|
||||
customDlls = new(TCustomDll);
|
||||
customDlls->nextDll = nextDll;
|
||||
customDlls->initialize(offset_currentDll);
|
||||
}
|
||||
curString=strtok(NULL,"|");
|
||||
}
|
||||
@ -314,140 +291,401 @@ void loadCustomLibraries()
|
||||
log_msg("\n\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void getVersion(DWORD addr, DWORD addr111, int* ver, DWORD v109b, DWORD v109d, DWORD v110, DWORD v111, DWORD v111a, DWORD v111b, DWORD v112, DWORD v113, const char * filename)
|
||||
void loadLibrary(LPCSTR libName, int* libVersion, DWORD* libOffset, int shift, DWORD v109b, DWORD v109d, DWORD v110, DWORD v111, DWORD v111b, DWORD v112, DWORD v113c)
|
||||
{
|
||||
log_msg("version of %s\t",filename);
|
||||
|
||||
if (addr==v109b) {
|
||||
*ver = V109b;
|
||||
log_msg("1.09b\n");
|
||||
} else if (addr==v109d) {
|
||||
*ver = V109d;
|
||||
log_msg("1.09d\n");
|
||||
} else if (addr==v110) {
|
||||
*ver = V110;
|
||||
log_msg("1.10\n");
|
||||
} else if ((addr==v111) && (addr111==v111a)) {
|
||||
*ver = V111;
|
||||
log_msg("1.11\n");
|
||||
} else if ((addr==v111) && (addr111==v111b)) {
|
||||
*ver = V111b;
|
||||
log_msg("1.11b\n");
|
||||
} else if (addr==v112) {
|
||||
*ver = V112;
|
||||
log_msg("1.12\n");
|
||||
} else if (addr==v113) {
|
||||
*ver = V113;
|
||||
log_msg("1.13\n");
|
||||
} else {
|
||||
*ver = V113;
|
||||
log_msg("unknow, try with 1.13\n");
|
||||
*libOffset = (DWORD)LoadLibrary(libName);
|
||||
if (*libOffset == NULL)
|
||||
{
|
||||
log_msg("Failed to load library : %s\n", libName);
|
||||
exit(-1);
|
||||
}
|
||||
log_msg("%s loaded at:\t%08X (", libName, *libOffset);
|
||||
|
||||
DWORD addr = *(DWORD*)(*libOffset + shift);
|
||||
if (version_Game != UNKNOWN && (version_Game <= V108 || version_Game >= V113d))
|
||||
*libVersion = version_Game;
|
||||
else if (addr==v109b)
|
||||
*libVersion = V109b;
|
||||
else if (addr==v109d)
|
||||
*libVersion = V109d;
|
||||
else if (addr==v110)
|
||||
*libVersion = V110;
|
||||
else if (addr==v111)
|
||||
*libVersion = V111;
|
||||
else if (addr==v111b)
|
||||
*libVersion = V111b;
|
||||
else if (addr==v112)
|
||||
*libVersion = V112;
|
||||
else if (addr==v113c)
|
||||
*libVersion = V113c;
|
||||
else {
|
||||
*libVersion = version_Game != UNKNOWN ? version_Game : V113d;
|
||||
log_msg("unknown, try with ");
|
||||
}
|
||||
log_msg("%s)\n", GetVersionString(*libVersion));
|
||||
}
|
||||
#define GET_VERSION(F,X,Y,A,B,C,D,E,G,H,I) getVersion(*(DWORD*)(offset_##F + 0x##X), *(DWORD*)(offset_##F + 0x##Y), &version_##F, 0x##A, 0x##B, 0x##C, 0x##D, 0x##E, 0x##G, 0x##H, 0x##I, S_##F)
|
||||
bool initD2version()
|
||||
|
||||
#define GET_VERSION(F,S,A,B,C,D,E,G,H) loadLibrary(S_##F, &version_##F, &offset_##F, 0x##S, 0x##A, 0x##B, 0x##C, 0x##D, 0x##E, 0x##G, 0x##H)
|
||||
void initD2modules()
|
||||
{
|
||||
log_msg("***** Get dll versions *****\n");
|
||||
log_msg("***** Get D2 Modules address and version *****\n");
|
||||
offset_Game = (DWORD)GetModuleHandle(NULL);
|
||||
version_Game = GetD2Version((HMODULE)offset_Game);
|
||||
log_msg("Game.exe loaded at:\t%08X (%s)\n", offset_Game, GetVersionString(version_Game));
|
||||
|
||||
|
||||
//GET_VERSION(SmackW32
|
||||
GET_VERSION(D2Common, 80, 108, B03A26A0, 9E3DE7CC, 0355C185, 8402CA7A, 42E6C2E5, 43028BA5, E58C71DA, 00000000);
|
||||
//GET_VERSION(ijl11
|
||||
GET_VERSION(D2Gdi, 80, 108, 90CFD95A, 86CE337B, A8CCC67B, 06059D7D, 42E6C248, 43028B2F, 5D6490A2, 00000000);
|
||||
GET_VERSION(D2Win, 80, 108, B595A0CD, 1995DAD2, A8F5E2FD, B6DAB75A, 42E6C266, 43028B44, 6AA01FF5, 00000000);
|
||||
//GET_VERSION(D2sound
|
||||
//GET_VERSION(D2MCPCLI
|
||||
GET_VERSION(D2Launch, 80, 100, A66532FF, 66678CC5, 686223E5, 80B0E2C6, 42E6C275, 43028B50, 205A4C0F, 00000000);
|
||||
GET_VERSION(D2gfx, 80, 110, 00949FA8, 018866A8, 401526B2, 575C8A5E, 42E6C22A, 43028B19, ACBE1B9E, 00000000);
|
||||
GET_VERSION(D2Client, 80, 108, 03522F39, 6730B639, C9817825, 37EC6E13, 42E6C43F, 43028CA5, 61A3B3D5, 00000000);
|
||||
GET_VERSION(D2Net, 80, 0F0, E60F4DEA, 940E178B, 890FCC0B, C293A9D5, 42E6C20D, 43028B05, 19FA9F76, 00000000);
|
||||
GET_VERSION(D2Lang, 80, 0F8, 111DCCB7, 13978953, DF917353, B91BAEA2, 42E6C213, 43028B09, B7B3978E, 00000000);
|
||||
GET_VERSION(D2Game, 80, 108, B0805792, 8BB2C392, 92FA18E6, 00B6F7B7, 42E6C375, 43028C0D, BD8DD8E5, 00000000);
|
||||
GET_VERSION(D2CMP, 80, 0F8, BA755486, 9A77DFEE, 38F44382, 4059B13F, 42E6C203, 43028AFE, 33A9427B, 00000000);
|
||||
//GET_VERSION(Bnclient
|
||||
GET_VERSION(Fog, 80, 100, 6F16123B, 75990846, 7E7ED3C7, D333B997, 42E6C1F0, 43028AF2, D3BD4F1B, 00000000);
|
||||
GET_VERSION(Storm, E0, 110, 3B4B41D8, 3B8AB1CE, 00004550, 9C2BECC4, 42E6C1CA, 43028AD9, E4FA2944, 00000000);
|
||||
if (version_Game >= V114a)
|
||||
{
|
||||
// offset_Bnclient = offset_Game; version_Bnclient = version_Game;
|
||||
offset_D2Client = offset_Game; version_D2Client = version_Game;
|
||||
offset_D2CMP = offset_Game; version_D2CMP = version_Game;
|
||||
offset_D2Common = offset_Game; version_D2Common = version_Game;
|
||||
// offset_D2DDraw = offset_Game; version_D2DDraw = version_Game;
|
||||
// offset_D2Direct3D = offset_Game; version_D2Direct3D = version_Game;
|
||||
offset_D2Game = offset_Game; version_D2Game = version_Game;
|
||||
// offset_D2Gdi = offset_Game; version_D2Gdi = version_Game;
|
||||
offset_D2gfx = offset_Game; version_D2gfx = version_Game;
|
||||
// offset_D2Glide = offset_Game; version_D2Glide = version_Game;
|
||||
offset_D2Lang = offset_Game; version_D2Lang = version_Game;
|
||||
offset_D2Launch = offset_Game; version_D2Launch = version_Game;
|
||||
// offset_D2MCPClient = offset_Game; version_D2MCPClient = version_Game;
|
||||
// offset_D2Multi = offset_Game; version_D2Multi = version_Game;
|
||||
offset_D2Net = offset_Game; version_D2Net = version_Game;
|
||||
// offset_D2sound = offset_Game; version_D2sound = version_Game;
|
||||
offset_D2Win = offset_Game; version_D2Win = version_Game;
|
||||
offset_Fog = offset_Game; version_Fog = version_Game;
|
||||
offset_Storm = offset_Game; version_Storm = version_Game;
|
||||
}
|
||||
else
|
||||
{
|
||||
// GET_VERSION(Bnclient //0x15000 0x6FF00000 Already Loaded -
|
||||
GET_VERSION(D2Client, 17F, 00000000, 14500000, 12500000, 0D814800, 0D812800, 0DA01000, 0DA03000); //0xCC000 0x6FAA0000 0xCA000
|
||||
GET_VERSION(D2CMP, 1359, 3C686FE0, 38686FE0, 8BF78B56, 4C880424, 07C71824, CCCCCCCC, C7000005); //0x18000 0x6FDF0000 Already Loaded 0x19000
|
||||
GET_VERSION(D2Common, 10CA, A1E86FDC, B1E86FDC, 72D03B42, F883057E, 16746AC6, 00FE81C3, 74FE85DB); //0x8D000 0x037A0000 0x7C000
|
||||
// GET_VERSION(D2DDraw 000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000); //
|
||||
// GET_VERSION(D2Direct3D 000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000); //
|
||||
// GET_VERSION(D2Game, 1010, D22A78A1, D22910A1, D43FB0A1, 03E8506F, 53E8506F, 89E8506F, 63E8506F); //0xF6000 0x6FC30000 0xCF000
|
||||
GET_VERSION(D2Game, 1092, 18968BF1, 38968BF1, 28968BF1, F6335608, C690C5B9, 895FD713, 56535700); //0xF6000 0x6FC30000 0xCF000
|
||||
// GET_VERSION(D2Gdi, 105, B4000000, 0B210E00, E4000000, 48000401, 2F000401, 00000000, B7000401); //0x7000 0x6F830000 Already Loaded -
|
||||
GET_VERSION(D2gfx, 10D, EB000000, 006FA700, 00000010, 2A000401, 19000401, 0B210E00, 00000000); //0xB000 0x6FA70000 Already Loaded -
|
||||
// GET_VERSION(D2Glide 000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000); //
|
||||
GET_VERSION(D2Lang, 126D, FC45048B, F445048B, 02C18313, C4830000, 00C6E045, 8B48408B, 0C75FF0C); //0x0A000 0x6FC10000 Already Loaded -
|
||||
GET_VERSION(D2Launch, 109A, 81E8526F, 01E8526F, 85E8526F, 247C8B00, 00FC6583, 15FF0424, E850E045); //0x20000 0x6FA10000 Already Loaded 0x1E000
|
||||
// GET_VERSION(D2MCPClient 000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000); //0x6000 0x6F9F0000 Already Loaded -
|
||||
// GET_VERSION(D2Multi 000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000); //0x1000 0x6F9A0000 ?
|
||||
GET_VERSION(D2Net, 16E1, 78B8A73C, 68B8A73C, 10244C8B, 5349E808, 5EA9E808, 105D8B72, 53B9E808); //0x6000 0x6FC00000 Already Loaded -
|
||||
// GET_VERSION(D2sound 000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000); //0xC000 0x6F980000 Already Loaded 0xD000
|
||||
GET_VERSION(D2Win, 1699, 88686F8C, 84686F8C, D094686F, F0030000, 001435E8, 8B088F44, 0013F5E8); //0x19000 0x6F8A0000 Already Loaded 0x1C000
|
||||
GET_VERSION(Fog, 102, D0000006, 10000001, 00000006, 000042E6, 00004302, 0000483C, 00004B95); //0x20000 0x6FF50000 Already Loaded 0x1F000
|
||||
GET_VERSION(Storm, 1190, 19E85082, 59E85082, 13C103F6, 0474F685, 8B000321, 3B1074C9, 0D896404); //0x30000 0x6FFB0000 Already Loaded -
|
||||
if (version_Game == UNKNOWN)
|
||||
version_Game = version_D2gfx;
|
||||
}
|
||||
// GET_VERSION(binkw32 000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000); //
|
||||
// GET_VERSION(ijl11 000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000); //0x24000 0x60000000 Already Loaded -
|
||||
// GET_VERSION(SmackW32 000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000); //0xD000 0x03B90000 Already Loaded -
|
||||
|
||||
log_msg("\n\n");
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
void getVersion(DWORD addr, int* ver, DWORD v109b, DWORD v109d, DWORD v110, DWORD v111, DWORD v111b, DWORD v112, DWORD v113, const char * filename)
|
||||
{
|
||||
log_msg("version of %s\t",filename);
|
||||
IMAGE_NT_HEADERS* GetHeader(LPBYTE pBase) {
|
||||
if (pBase == NULL)
|
||||
return NULL;
|
||||
|
||||
if (addr==v109b) {
|
||||
*ver = V109b;
|
||||
log_msg("1.09b\n");
|
||||
} else if (addr==v109d) {
|
||||
*ver = V109d;
|
||||
log_msg("1.09d\n");
|
||||
} else if (addr==v110) {
|
||||
*ver = V110;
|
||||
log_msg("1.10\n");
|
||||
} else if (addr==v111) {
|
||||
*ver = V111;
|
||||
log_msg("1.11\n");
|
||||
} else if (addr==v111b) {
|
||||
*ver = V111b;
|
||||
log_msg("1.11b\n");
|
||||
} else if (addr==v112) {
|
||||
*ver = V112;
|
||||
log_msg("1.12\n");
|
||||
} else if (addr==v113) {
|
||||
*ver = V113;
|
||||
log_msg("1.13\n");
|
||||
} else {
|
||||
*ver = V113;
|
||||
log_msg("unknow, try with 1.13\n");
|
||||
IMAGE_DOS_HEADER* pDosHeader = (IMAGE_DOS_HEADER*)pBase;
|
||||
|
||||
if (IsBadReadPtr(pDosHeader, sizeof(IMAGE_DOS_HEADER)))
|
||||
return NULL;
|
||||
|
||||
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE)
|
||||
return NULL;
|
||||
|
||||
IMAGE_NT_HEADERS* pHeader = (IMAGE_NT_HEADERS*)(pBase + pDosHeader->e_lfanew);
|
||||
if (IsBadReadPtr(pHeader, sizeof(IMAGE_NT_HEADERS)))
|
||||
return NULL;
|
||||
|
||||
if (pHeader->Signature != IMAGE_NT_SIGNATURE)
|
||||
return NULL;
|
||||
|
||||
return pHeader;
|
||||
}
|
||||
|
||||
void initD2modules()
|
||||
{
|
||||
log_msg("***** Get D2 Modules address and version *****\n\n");
|
||||
|
||||
offset_D2Client = (DWORD)LoadLibrary("D2Client.dll");
|
||||
offset_D2CMP = (DWORD)LoadLibrary("D2CMP.dll");
|
||||
offset_D2Common = (DWORD)LoadLibrary("D2Common.dll");
|
||||
offset_D2Game = (DWORD)LoadLibrary("D2Game.dll");
|
||||
offset_D2gfx = (DWORD)LoadLibrary("D2gfx.dll");
|
||||
offset_D2Lang = (DWORD)LoadLibrary("D2Lang.dll");
|
||||
offset_D2Launch = (DWORD)LoadLibrary("D2Launch.dll");
|
||||
offset_D2Net = (DWORD)LoadLibrary("D2Net.dll");
|
||||
offset_D2Win = (DWORD)LoadLibrary("D2Win.dll");
|
||||
offset_Fog = (DWORD)LoadLibrary("Fog.dll");
|
||||
offset_Storm = (DWORD)LoadLibrary("Storm.dll");
|
||||
|
||||
int count_109b = 0;
|
||||
int count_109d = 0;
|
||||
int count_110f = 0;
|
||||
int count_111 = 0;
|
||||
int count_111b = 0;
|
||||
int count_112a = 0;
|
||||
int count_113c = 0;
|
||||
int count_113d = 0;
|
||||
int count_114a = 0;
|
||||
int count_114b = 0;
|
||||
int count_114c = 0;
|
||||
int count_114d = 0;
|
||||
|
||||
IMAGE_NT_HEADERS* pHeader;
|
||||
|
||||
if (offset_D2Client != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_D2Client);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C234D) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C16CD) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C1C1D) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045E6) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045EE) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045FA) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045F6) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000045DE) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_D2CMP != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_D2CMP);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00011361) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00011361) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00010E61) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C23) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_D2Common != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_D2Common);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00074D1D) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00074E2D) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000856DD) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C94) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C8D) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C97) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C8F) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000047C7) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_D2Game != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_D2Game);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C66AC) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000C6D5C) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000EDC2C) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000036E6) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000373D) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000374B) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000373C) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003747) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_D2gfx != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_D2gfx);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000054EB) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000054EB) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000054A5) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001807) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_D2Lang != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_D2Lang);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00005148) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00005138) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00005048) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A6A) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A5B) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A75) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A71) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A5A) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_D2Launch != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_D2Launch);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000172C3) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00017243) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00018DC7) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A84) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A85) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A85) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A87) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001A84) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_D2Net != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_D2Net);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002BCE) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002BCE) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00002C6E) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001676) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001676) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000167E) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001676) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000167E) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_D2Win != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_D2Win);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00014F38) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00014F38) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00012EC0) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000187E) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000187E) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000188E) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000187E) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00001887) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_Fog != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_Fog);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00013658) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000142E7) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000162B0) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003159) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003142) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000314A) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003162) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003142) count_113d++;
|
||||
}
|
||||
|
||||
if (offset_Storm != NULL) {
|
||||
pHeader = GetHeader((LPBYTE)offset_Storm);
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00013658) count_109b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000142E7) count_109d++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x000162B0) count_110f++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003159) count_111++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003142) count_111b++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0000314A) count_112a++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00003162) count_113c++;
|
||||
if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x0003C3E0) count_113d++;
|
||||
}
|
||||
|
||||
int minimum_match_dll = 7;
|
||||
|
||||
if (count_109b >= minimum_match_dll) version_Game = V109b;
|
||||
if (count_109d >= minimum_match_dll) version_Game = V109d;
|
||||
if (count_110f >= minimum_match_dll) version_Game = V110;
|
||||
if (count_111 >= minimum_match_dll) version_Game = V111;
|
||||
if (count_111b >= minimum_match_dll) version_Game = V111b;
|
||||
if (count_112a >= minimum_match_dll) version_Game = V112;
|
||||
if (count_113c >= minimum_match_dll) version_Game = V113c;
|
||||
if (count_113d >= minimum_match_dll) version_Game = V113d;
|
||||
|
||||
//version_SmackW32 = version_Game;
|
||||
version_D2Common = version_Game;
|
||||
//version_ijl11 = version_Game;
|
||||
//version_D2Gdi = version_Game;
|
||||
version_D2Win = version_Game;
|
||||
//version_D2sound = version_Game;
|
||||
//version_D2MCPCLI = version_Game;
|
||||
version_D2Launch = version_Game;
|
||||
version_D2gfx = version_Game;
|
||||
version_D2Client = version_Game;
|
||||
version_D2Net = version_Game;
|
||||
version_D2Lang = version_Game;
|
||||
version_D2Game = version_Game;
|
||||
version_D2CMP = version_Game;
|
||||
//version_Bnclient = version;
|
||||
version_Fog = version_Game;
|
||||
version_Storm = version_Game;
|
||||
|
||||
log_msg("DLL match for version 1.09b :\t%d\n", count_109b);
|
||||
log_msg("DLL match for version 1.09d :\t%d\n", count_109d);
|
||||
log_msg("DLL match for version 1.10f :\t%d\n", count_110f);
|
||||
log_msg("DLL match for version 1.11 :\t%d\n", count_111);
|
||||
log_msg("DLL match for version 1.11b :\t%d\n", count_111b);
|
||||
log_msg("DLL match for version 1.12a :\t%d\n", count_112a);
|
||||
log_msg("DLL match for version 1.13c :\t%d\n", count_113c);
|
||||
log_msg("\n");
|
||||
|
||||
offset_Game = (DWORD)GetModuleHandle("Game.exe");
|
||||
if (offset_Game != NULL) {
|
||||
version_Game = GetD2Version((HMODULE)offset_Game);
|
||||
log_msg("Game.exe loaded at:\t%08X (%s)\n", offset_Game, GetVersionString(version_Game));
|
||||
if (version_Game >= V114a)
|
||||
{
|
||||
//version_SmackW32 = version_Game;
|
||||
version_D2Common = version_Game;
|
||||
//version_ijl11 = version_Game;
|
||||
//version_D2Gdi = version_Game;
|
||||
version_D2Win = version_Game;
|
||||
//version_D2sound = version_Game;
|
||||
//version_D2MCPCLI = version_Game;
|
||||
version_D2Launch = version_Game;
|
||||
version_D2gfx = version_Game;
|
||||
version_D2Client = version_Game;
|
||||
version_D2Net = version_Game;
|
||||
version_D2Lang = version_Game;
|
||||
version_D2Game = version_Game;
|
||||
version_D2CMP = version_Game;
|
||||
//version_Bnclient = version;
|
||||
version_Fog = version_Game;
|
||||
version_Storm = version_Game;
|
||||
}
|
||||
}
|
||||
|
||||
//if (offset_Game != NULL) {
|
||||
// pHeader = GetHeader((LPBYTE)offset_Game);
|
||||
// if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00291342) count_114a++;
|
||||
// if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x002854F2) count_114b++;
|
||||
// if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x002850E2) count_114c++;
|
||||
// if (pHeader->OptionalHeader.AddressOfEntryPoint == 0x00282985) count_114d++;
|
||||
//}
|
||||
|
||||
log_msg("Version game is:\t(%s)\n\n", GetVersionString(version_Game));
|
||||
|
||||
if (version_Game == UNKNOWN)
|
||||
{
|
||||
MessageBoxA(NULL, "This version of Diablo II is not supported by Plugy. Please upgrade or downgrade to a supported version.", "Plugy 14.03", MB_OK);
|
||||
}
|
||||
}
|
||||
#define GET_VERSION(F,X,A,B,C,D,E,G,H) getVersion(*(DWORD*)(offset_##F + 0x##X), &version_##F, 0x##A, 0x##B, 0x##C, 0x##D, 0x##E, 0x##G, 0x##H, S_##F)
|
||||
bool initD2version()
|
||||
|
||||
//////////////////////////////////// EXPORTS FUNCTIONS ////////////////////////////////////
|
||||
|
||||
|
||||
extern "C" __declspec(dllexport) bool __stdcall Release()
|
||||
{
|
||||
log_msg("***** Get dll versions *****\n");
|
||||
log_msg("\n***** FREE LIBRARIES *****\n\n" );
|
||||
|
||||
//GET_VERSION(SmackW32
|
||||
GET_VERSION(D2Common, 10CA, A1E86FDC, B1E86FDC, 72D03B42, F883057E, 16746AC6, 00FE81C3, 74FE85DB);
|
||||
//GET_VERSION(ijl11
|
||||
GET_VERSION(D2Gdi, 105, B4000000, 0B210E00, E4000000, 48000401, 2F000401, 00000000, B7000401);
|
||||
GET_VERSION(D2Win, 1699, 88686F8C, 84686F8C, D094686F, F0030000, 001435E8, 8B088F44, 0013F5E8);
|
||||
//GET_VERSION(D2sound
|
||||
//GET_VERSION(D2MCPCLI
|
||||
GET_VERSION(D2Launch, 109A, 81E8526F, 01E8526F, 85E8526F, 247C8B00, 00FC6583, 15FF0424, E850E045);
|
||||
GET_VERSION(D2gfx, 10D, EB000000, 006FA700, 00000010, 2A000401, 19000401, 0B210E00, 00000000);
|
||||
GET_VERSION(D2Client, 17F, 00000000, 14500000, 12500000, 0D814800, 0D812800, 0DA01000, 0DA03000);
|
||||
GET_VERSION(D2Net, 16E1, 78B8A73C, 68B8A73C, 10244C8B, 5349E808, 5EA9E808, 105D8B72, 53B9E808);
|
||||
GET_VERSION(D2Lang, 126D, FC45048B, F445048B, 02C18313, C4830000, 00C6E045, 8B48408B, 0C75FF0C);
|
||||
// GET_VERSION(D2Game, 1010, D22A78A1, D22910A1, D43FB0A1, 03E8506F, 53E8506F, 89E8506F, 63E8506F);
|
||||
GET_VERSION(D2Game, 1092, 18968BF1, 38968BF1, 28968BF1, F6335608, C690C5B9, 895FD713, 56535700);
|
||||
GET_VERSION(D2CMP, 1359, 3C686FE0, 38686FE0, 8BF78B56, 4C880424, 07C71824, CCCCCCCC, C7000005);
|
||||
//GET_VERSION(Bnclient
|
||||
GET_VERSION(Fog, 102, D0000006, 10000001, 00000006, 000042E6, 00004302, 0000483C, 00004B95);
|
||||
GET_VERSION(Storm, 1190, 19E85082, 59E85082, 13C103F6, 0474F685, 8B000321, 3B1074C9, 0D896404);
|
||||
|
||||
log_msg("\n\n");
|
||||
freeCustomLibraries();
|
||||
freeD2Libraries();
|
||||
log_msg("***** END DIABLO II *****\n" );
|
||||
log_close();
|
||||
return true;
|
||||
}
|
||||
//////////////////////////////////// EXPORTS FUNCTIONS ////////////////////////////////////
|
||||
|
||||
extern "C" __declspec(dllexport) void* __stdcall Init(LPSTR IniName)
|
||||
{
|
||||
if (IniName) log_msg("* PlugY is called from D2mod.dll\n\n");
|
||||
else log_msg("* PlugY is called from D2gfx.dll\n\n");
|
||||
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return NULL;
|
||||
isInstalled=true;
|
||||
|
||||
loadD2Libraries();
|
||||
initD2modules();
|
||||
|
||||
if (!initD2version()) return NULL;
|
||||
if (version_Game < V109 || version_Game > V113d && version_Game != V114d)
|
||||
{
|
||||
log_box("PlugY isn't compatible with this version : %s", GetVersionString(version_Game));
|
||||
Release();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!initD2functions()) return NULL;
|
||||
initD2functions();
|
||||
|
||||
loadParameters();
|
||||
|
||||
@ -459,6 +697,7 @@ extern "C" __declspec(dllexport) void* __stdcall Init(LPSTR IniName)
|
||||
|
||||
log_msg("***** INSTALL FUNCTIONS *****\n");
|
||||
|
||||
Install_PlugYFiles();
|
||||
Install_VariableOnRealm();
|
||||
|
||||
if (active_Commands)
|
||||
@ -470,7 +709,7 @@ extern "C" __declspec(dllexport) void* __stdcall Init(LPSTR IniName)
|
||||
if (active_VersionTextChange)
|
||||
Install_VersionChange();
|
||||
|
||||
if (active_PrintPlugYVersion)
|
||||
if (active_PrintPlugYVersion || active_Windowed)
|
||||
Install_PrintPlugYVersion();
|
||||
|
||||
if (active_StatsPoints)
|
||||
@ -484,6 +723,9 @@ extern "C" __declspec(dllexport) void* __stdcall Init(LPSTR IniName)
|
||||
if (active_changingSavePath)
|
||||
Install_ChangingSavePath();
|
||||
|
||||
if (active_AutoBackup)
|
||||
Install_SavePlayerData();
|
||||
|
||||
if (active_StatsShiftClickLimit)
|
||||
Install_StatsLimitShiftClick();
|
||||
|
||||
@ -535,28 +777,30 @@ extern "C" __declspec(dllexport) void* __stdcall Init(LPSTR IniName)
|
||||
if (active_EnabledCowPortalWhenCowKingWasKill)
|
||||
Install_EnabledCowPortalWhenCowKingWasKill();
|
||||
|
||||
if (active_DoNotCloseNihlathakPortal)
|
||||
Install_DoNotCloseNihlathakPortal();
|
||||
|
||||
if (active_MoveCainNearHarrogathWaypoint)
|
||||
Install_MoveCainNearHarrogathWaypoint();
|
||||
|
||||
if (active_RemoveExperienceDiminushingReturn)
|
||||
Install_RemoveExperienceDiminushingReturn();
|
||||
|
||||
log_msg("\nDLL patched sucessfully.\n\n\n");
|
||||
|
||||
unhookLibraries();
|
||||
|
||||
initCustomLibraries();
|
||||
|
||||
//loadLocalizedStrings(D2GetLang());
|
||||
|
||||
log_msg("***** ENTERING DIABLO II *****\n\n" );
|
||||
|
||||
active_logFile = active_logFile - 1;
|
||||
active_logFile--;
|
||||
if (active_logFile < 1)
|
||||
log_close();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern "C" __declspec(dllexport) bool __stdcall Release()
|
||||
{
|
||||
log_msg("\n***** ENDING DIABLO II *****\n\n" );
|
||||
|
||||
freeCustomLibraries();
|
||||
freeD2Libraries();
|
||||
return true;
|
||||
}
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,41 +1,40 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Error Logger implementation.
|
||||
Error Logger implementation.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "parameters.h"
|
||||
#include "error.h"
|
||||
#include <windows.h>
|
||||
#include <stdio.h> // fopen() fclose() fprintf() vfprintf()
|
||||
#include <stdarg.h> // ...
|
||||
#include <string.h> // strlen() strcat()
|
||||
#include <direct.h> // _getcwd()
|
||||
|
||||
#include "error.h"
|
||||
#include "d2functions.h" // Fog_assert()
|
||||
|
||||
DWORD active_logFile = 1;
|
||||
int active_logFile = 1;
|
||||
|
||||
static char log_file[MAX_PATH] = "";
|
||||
static bool log_init = false;
|
||||
|
||||
static FILE* fLogFile = NULL;
|
||||
|
||||
void log_initfile()
|
||||
{
|
||||
if (log_init) return;
|
||||
|
||||
|
||||
_getcwd( log_file, MAX_PATH );
|
||||
if( log_file[strlen(log_file)] != '\\')
|
||||
strcat(log_file, "\\");
|
||||
strcat(log_file, LOG_FILE);
|
||||
|
||||
FILE* lLog = fopen( log_file, "w" );
|
||||
|
||||
if( lLog != NULL )
|
||||
{
|
||||
fclose(lLog);
|
||||
log_init = true;
|
||||
}
|
||||
|
||||
strcat(log_file, "PlugY.log");
|
||||
|
||||
fLogFile = fopen( log_file, "w" );
|
||||
|
||||
if( fLogFile == NULL )
|
||||
return;
|
||||
|
||||
log_init = true;
|
||||
|
||||
log_msg("<----------------------------------------------->\n"
|
||||
"\n"
|
||||
"\t\tA Plugin by Yohann\n"
|
||||
@ -46,6 +45,15 @@ void log_initfile()
|
||||
,PLUGY_VERSION);
|
||||
}
|
||||
|
||||
void log_close()
|
||||
{
|
||||
if (fLogFile)
|
||||
{
|
||||
fclose(fLogFile);
|
||||
fLogFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void log_box( const char* pFormat, ... )
|
||||
{
|
||||
char buffer[300];
|
||||
@ -61,7 +69,8 @@ void log_box( const char* pFormat, ... )
|
||||
|
||||
void log_msg( const char* pFormat, ... )
|
||||
{
|
||||
if (!active_logFile) return;
|
||||
if (!active_logFile)
|
||||
return;
|
||||
|
||||
if( !log_init )
|
||||
log_initfile();
|
||||
@ -71,13 +80,14 @@ void log_msg( const char* pFormat, ... )
|
||||
va_list lArgs;
|
||||
va_start( lArgs, pFormat );
|
||||
|
||||
FILE *lDebug = fopen( log_file, "a" );
|
||||
if ( fLogFile == NULL )
|
||||
fLogFile = fopen( log_file, "a" );
|
||||
|
||||
if( lDebug != NULL )
|
||||
if( fLogFile != NULL )
|
||||
{
|
||||
vfprintf( lDebug, pFormat, lArgs );
|
||||
fclose( lDebug );
|
||||
}
|
||||
vfprintf( fLogFile, pFormat, lArgs );
|
||||
fflush(fLogFile);
|
||||
}
|
||||
else
|
||||
log_init = false;
|
||||
|
||||
|
@ -1,23 +1,23 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Add an extra save file for each characters.
|
||||
Add an extra save file for each characters.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "extendedSaveFile.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "infinityStash.h"
|
||||
#include "customLibraries.h"
|
||||
#include "extraOptions.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define BUFFER_SIZE 0x4000
|
||||
#define FILE_VERSION 0x3130 //"01"
|
||||
#define FILE_EXTENDED 0x4D545343 //"CSTM"
|
||||
|
||||
|
||||
BYTE * readExtendedSaveFile(char* name, DWORD* size)//WORKS
|
||||
BYTE * readExtendedSaveFile(char* name, DWORD* size)
|
||||
{
|
||||
char filename[512];
|
||||
BYTE* data;
|
||||
@ -45,7 +45,7 @@ BYTE * readExtendedSaveFile(char* name, DWORD* size)//WORKS
|
||||
*size = 14;
|
||||
*((DWORD*)&data[0]) = FILE_EXTENDED; //"CSTM"
|
||||
*((WORD *)&data[4]) = FILE_VERSION;
|
||||
*((DWORD*)&data[6]) = 0;// not used
|
||||
*((DWORD*)&data[6]) = (BYTE)(nbPlayersCommandByDefault == 0 ? 0 : nbPlayersCommandByDefault - 1);
|
||||
*((DWORD*)&data[10]) = 0;// number of stash
|
||||
|
||||
TCustomDll* currentDll = customDlls;
|
||||
@ -59,9 +59,7 @@ BYTE * readExtendedSaveFile(char* name, DWORD* size)//WORKS
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int loadExtendedSaveFile(Unit* ptChar, BYTE data[], DWORD maxSize)//WORKS
|
||||
int loadExtendedSaveFile(Unit* ptChar, BYTE data[], DWORD maxSize)
|
||||
{
|
||||
if (!ptChar || !PCPY || !data) return 0;
|
||||
|
||||
@ -82,7 +80,9 @@ int loadExtendedSaveFile(Unit* ptChar, BYTE data[], DWORD maxSize)//WORKS
|
||||
return 9;
|
||||
}
|
||||
curSize += 2;
|
||||
curSize += 4;
|
||||
nbPlayersCommand = (*(BYTE*)&data[curSize]) + 1;
|
||||
curSize += 1;
|
||||
curSize += 3;
|
||||
|
||||
int ret = loadStashList(ptChar, data, maxSize, &curSize, false);
|
||||
|
||||
@ -93,12 +93,12 @@ int loadExtendedSaveFile(Unit* ptChar, BYTE data[], DWORD maxSize)//WORKS
|
||||
currentDll=currentDll->nextDll;
|
||||
}
|
||||
|
||||
|
||||
PCPY->selfStashIsOpened = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void writeExtendedSaveFile(char* name, BYTE* data, DWORD size)
|
||||
{
|
||||
char szTempName[MAX_PATH];
|
||||
@ -121,28 +121,12 @@ void writeExtendedSaveFile(char* name, BYTE* data, DWORD size)
|
||||
strcat(szSaveName, ".d2x");
|
||||
log_msg("Extended 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 extended save file.");
|
||||
}
|
||||
|
||||
void backupExtendedSaveFile(char* name)
|
||||
{
|
||||
char szBackupName[MAX_PATH];
|
||||
char szSaveName[MAX_PATH];
|
||||
|
||||
D2FogGetSavePath(szSaveName, MAX_PATH);
|
||||
strcat(szSaveName, name);
|
||||
strcat(szSaveName, ".d2x");
|
||||
|
||||
D2FogGetSavePath(szBackupName, MAX_PATH);
|
||||
strcat(szBackupName, name);
|
||||
strcat(szBackupName, ".d2x.backup");
|
||||
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
}
|
||||
|
||||
|
||||
void saveExtendedSaveFile(Unit* ptChar, BYTE** data, DWORD* maxSize, DWORD* curSize)
|
||||
{
|
||||
@ -150,7 +134,7 @@ void saveExtendedSaveFile(Unit* ptChar, BYTE** data, DWORD* maxSize, DWORD* curS
|
||||
*curSize += 4;
|
||||
*(WORD *)(*data + *curSize) = FILE_VERSION;
|
||||
*curSize += 2;
|
||||
*(DWORD *)(*data + *curSize) = 0;
|
||||
*(DWORD *)(*data + *curSize) = (BYTE)(nbPlayersCommand == 0 ? 0 : nbPlayersCommand - 1);
|
||||
*curSize += 4;
|
||||
|
||||
saveStashList(ptChar, PCPY->selfStash, data, maxSize, curSize);
|
||||
|
@ -1,24 +1,29 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d and DoNotCloseNihlathakPortal by haxifix.
|
||||
|
||||
More little options.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "infinityStash.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int active_RunLODs = false;
|
||||
int active_alwaysRegenMapInSP = false;
|
||||
DWORD nbPlayersCommandByDefault = 1;
|
||||
int active_DisplayItemLevel = false;
|
||||
int active_AlwaysDisplayLifeMana = false;
|
||||
int active_EnabledTXTFilesWithMSExcel = false;
|
||||
int active_DisplayBaseStatsValue = false;
|
||||
int active_LadderRunewords = false;
|
||||
int active_EnabledCowPortalWhenCowKingWasKill = false;
|
||||
bool active_DisplayItemLevel = false;
|
||||
DWORD nbPlayersCommandByDefault = 0;
|
||||
DWORD nbPlayersCommand = 0;
|
||||
bool active_alwaysRegenMapInSP = false;
|
||||
bool active_RunLODs = false;
|
||||
int active_AlwaysDisplayLifeMana = 0;
|
||||
bool active_EnabledTXTFilesWithMSExcel = false;
|
||||
bool active_DisplayBaseStatsValue = false;
|
||||
bool active_LadderRunewords = false;
|
||||
bool active_EnabledCowPortalWhenCowKingWasKill = false;
|
||||
bool active_DoNotCloseNihlathakPortal = false;
|
||||
bool active_MoveCainNearHarrogathWaypoint = false;
|
||||
bool active_RemoveExperienceDiminushingReturn = false;
|
||||
|
||||
/****************************************************************************************************/
|
||||
|
||||
@ -26,11 +31,25 @@ void STDCALL displayItemlevel(LPWSTR popup, Unit* ptItem)
|
||||
{
|
||||
if (onRealm && (selectModParam==MOD_NO)) return;
|
||||
WCHAR text[0x50];
|
||||
swprintf(text, L"Item Level: %u\n", D2GetItemLevel(ptItem));
|
||||
_snwprintf(text, 50, L"%s: %u\n", getLocalString(STR_ITEM_LEVEL), D2GetItemLevel(ptItem));
|
||||
D2SetColorPopup(text,WHITE);
|
||||
wcscat(popup,text);
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_displayItemlevel_114 )
|
||||
PUSH ECX
|
||||
PUSH EAX
|
||||
PUSH ECX
|
||||
LEA EAX,DWORD PTR SS:[EBP-0x2434]
|
||||
PUSH EAX
|
||||
CALL displayItemlevel
|
||||
POP EAX
|
||||
POP ECX
|
||||
POP EDX
|
||||
PUSH 0x100
|
||||
JMP EDX
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_displayItemlevel_113 )
|
||||
PUSH ECX
|
||||
PUSH EAX
|
||||
@ -59,6 +78,19 @@ FCT_ASM ( caller_displayItemlevel_111 )
|
||||
JMP EAX
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_displayItemlevelSet_114 )
|
||||
PUSH ECX
|
||||
PUSH EDX
|
||||
PUSH ECX
|
||||
LEA EAX,DWORD PTR SS:[EBP-0x2138]
|
||||
PUSH EAX
|
||||
CALL displayItemlevel
|
||||
POP EDX
|
||||
POP ECX
|
||||
POP EAX
|
||||
PUSH 0x100
|
||||
JMP EAX
|
||||
}}
|
||||
FCT_ASM ( caller_displayItemlevelSet_111 )
|
||||
PUSH ECX
|
||||
PUSH EDX
|
||||
@ -135,28 +167,32 @@ void Install_DisplayItemLevel()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
log_msg("Patch D2Client for display item popup. (DisplayPopup)\n");
|
||||
|
||||
log_msg("Patch D2Client to display item popup. (DisplayPopup)\n");
|
||||
|
||||
// print the text in the final buffer
|
||||
mem_seek R7(D2Client, 3D47C, 3D47C, 438A1, ADD0A, 789DA, AE0AA, 941C0);
|
||||
mem_seek R8(D2Client, 3D47C, 3D47C, 438A1, ADD0A, 789DA, AE0AA, 941C0, 98590, 8E983);
|
||||
memt_byte( 0x68 , 0xE8);
|
||||
MEMT_REF4( 0x100, version_D2Client >= V113 ? caller_displayItemlevel_113 : version_D2Client >= V111 ? caller_displayItemlevel_111 : version_D2Client == V110 ? caller_displayItemlevel : caller_displayItemlevel_9);
|
||||
MEMT_REF4( 0x100, version_D2Client >= V114d ? caller_displayItemlevel_114 : version_D2Client >= V113c ? caller_displayItemlevel_113 : version_D2Client >= V111 ? caller_displayItemlevel_111 : version_D2Client == V110 ? caller_displayItemlevel : caller_displayItemlevel_9);
|
||||
//6FAE38A1 . 68 00010000 PUSH 100
|
||||
//6FB5DD0A |. 68 00010000 PUSH 100
|
||||
//6FB289DA |. 68 00010000 PUSH 100
|
||||
//6FB289DA |. 68 00010000 PUSH 100
|
||||
//6FB5E0AA |. 68 00010000 PUSH 100
|
||||
//6FB441C0 |. 68 00010000 PUSH 100
|
||||
//6FB48590 |. 68 00010000 PUSH 100
|
||||
//0048E983 |. 68 00010000 PUSH 100 ; /Arg1 = 00000100
|
||||
|
||||
// print the text in the final buffer (for set items)
|
||||
mem_seek R7(D2Client, 3C452, 3C452, 427BE, AC773, 77773, ACEB3, 92FE3);
|
||||
mem_seek R8(D2Client, 3C452, 3C452, 427BE, AC773, 77773, ACEB3, 92FE3, 973B3, 8D774);
|
||||
memt_byte( 0x68 , 0xE8);
|
||||
MEMT_REF4( 0x100, version_D2Client >= V111 ? caller_displayItemlevelSet_111 : version_D2Client == V110 ? caller_displayItemlevelSet : caller_displayItemlevelSet_9);
|
||||
MEMT_REF4( 0x100, version_D2Client >= V114d ? caller_displayItemlevelSet_114 : version_D2Client >= V111 ? caller_displayItemlevelSet_111 : version_D2Client == V110 ? caller_displayItemlevelSet : caller_displayItemlevelSet_9);
|
||||
//6FAE27BE . 68 00010000 PUSH 100
|
||||
//6FB5C773 |. 68 00010000 PUSH 100
|
||||
//6FB27773 |. 68 00010000 PUSH 100
|
||||
//6FB5CEB3 |. 68 00010000 PUSH 100
|
||||
//6FB42FE3 |. 68 00010000 PUSH 100
|
||||
//6FB473B3 |. 68 00010000 PUSH 100
|
||||
//0048D774 |. 68 00010000 PUSH 100 ; /Arg1 = 00000100
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
@ -169,6 +205,9 @@ char* msgNBPlayersString = "players %u";
|
||||
DWORD* infoEnabledSendPlayersCommand;
|
||||
void SendPlayersCommand()
|
||||
{
|
||||
if (!needToInit || onRealm) return;
|
||||
needToInit = false;
|
||||
|
||||
#pragma pack(1)
|
||||
struct {
|
||||
BYTE displayType;//0x15 main msg; 0x14: char popup
|
||||
@ -176,29 +215,43 @@ void SendPlayersCommand()
|
||||
BYTE zero;
|
||||
char string[0xFF];
|
||||
char null;
|
||||
char targetName[0x10];
|
||||
char null2;
|
||||
} data;
|
||||
#pragma pack()
|
||||
|
||||
if (!needToInit || onRealm) return;
|
||||
needToInit=0;
|
||||
|
||||
DWORD info = *infoEnabledSendPlayersCommand;
|
||||
if ((info != 0) && (info != 1) && (info != 6) && (info != 8)) return;
|
||||
|
||||
D2SetNbPlayers(nbPlayersCommandByDefault);
|
||||
if (!active_multiPageStash)
|
||||
nbPlayersCommand = nbPlayersCommandByDefault;
|
||||
|
||||
//if (nbPlayersCommand < 2)
|
||||
// return;
|
||||
|
||||
log_msg("SendPlayersCommand %u\n", nbPlayersCommand);
|
||||
|
||||
D2SetNbPlayers(nbPlayersCommand);
|
||||
|
||||
memset(&data,0,sizeof(data));
|
||||
data.displayType=0x15;
|
||||
data.un=1;
|
||||
data.zero=0;//*(BYTE*)(offset_D2Client+0x112CFC); in 1.10
|
||||
sprintf(data.string, msgNBPlayersString, nbPlayersCommand);
|
||||
data.null=NULL;
|
||||
sprintf(data.string, msgNBPlayersString, nbPlayersCommandByDefault);
|
||||
D2SendMsgToAll((BYTE*)&data);
|
||||
}
|
||||
|
||||
//FCT_ASM ( caller_SendPlayersCommand_old )
|
||||
// CALL SendPlayersCommand
|
||||
// JMP D2GetResolution
|
||||
//}}
|
||||
|
||||
FCT_ASM ( caller_SendPlayersCommand )
|
||||
PUSH ECX
|
||||
CALL SendPlayersCommand
|
||||
JMP D2GetResolution
|
||||
POP ECX
|
||||
JMP D2PrintInterface
|
||||
}}
|
||||
|
||||
void Install_SendPlayersCommand()
|
||||
@ -208,13 +261,13 @@ void Install_SendPlayersCommand()
|
||||
|
||||
log_msg("Patch D2Client for init default nb /players. (SendPlayersCommand)\n");
|
||||
|
||||
infoEnabledSendPlayersCommand = (DWORD*)R7(D2Client, 111D60, 110BC0, 107960, 11BFBC, 11C2AC, 11BFF8, 11C394);
|
||||
infoEnabledSendPlayersCommand = (DWORD*)R8(D2Client, 111D60, 110BC0, 107960, 11BFBC, 11C2AC, 11BFF8, 11C394, 11D1DC, 3A0610);
|
||||
if ( version_D2Client >= V110 )
|
||||
msgNBPlayersString = (char*)R7(D2Client, 0000, 0000, D8448, D06A8, D4748, D4680, D4E00);
|
||||
msgNBPlayersString = (char*)R8(D2Client, 0000, 0000, D8448, D06A8, D4748, D4680, D4E00, D470C, 2D7374);
|
||||
|
||||
// Set nb Player to default
|
||||
mem_seek R7(D2Client, 8723B, 865BB, 81B8B, A3602, 66A02, 90162, C39F2);//6FB1C7B7-6FAA0000
|
||||
MEMJ_REF4( D2GetResolution , caller_SendPlayersCommand);
|
||||
// mem_seek R8(D2Client, 8723B, 865BB, 81B8B, A3602, 66A02, 90162, C39F2, 1D3F2, 56EF9);//6FB1C7B7-6FAA0000
|
||||
// MEMJ_REF4( D2GetResolution, caller_SendPlayersCommand_old);
|
||||
//6FB2723A |. E8 7D8E0300 CALL <JMP.&D2gfx.#10005>
|
||||
//6FB265BA |. E8 7D8E0300 CALL <JMP.&D2gfx.#10005>
|
||||
//6FB21B8A . E8 4F9C0400 CALL <JMP.&D2gfx.#10005>
|
||||
@ -222,6 +275,21 @@ void Install_SendPlayersCommand()
|
||||
//6FB16A01 |. E8 AA65FAFF CALL <JMP.&D2gfx.#10063>
|
||||
//6FB40161 |. E8 1ECFF7FF CALL <JMP.&D2gfx.#10043>
|
||||
//6FB739F1 |. E8 B896F4FF CALL <JMP.&D2gfx.#10031>
|
||||
//6FACD3F1 |. E8 EAFBFEFF CALL <JMP.&D2gfx.#10012>
|
||||
//00456EF8 |. E8 63E20900 CALL Game.004F5160
|
||||
|
||||
// Set nb Player to default
|
||||
mem_seek R8(D2Client, 90BA, 90AA, 97DA, 88E4C, 32C8C, 7CB5C, 4437C, 453CC, 4CB04);//6FB1C7B7-6FAA0000
|
||||
MEMC_REF4( D2PrintInterface, caller_SendPlayersCommand);
|
||||
//6FAA90B9 . E8 62E10700 CALL D2Client.6FB27220
|
||||
//6FAA90A9 . E8 F2D40700 CALL D2Client.6FB265A0
|
||||
//6FAA97D9 . E8 92830700 CALL D2Client.6FB21B70
|
||||
//6FB38E4B . E8 A0A70100 CALL D2Client.6FB535F0
|
||||
//6FAE2C8B . E8 603D0300 CALL D2Client.6FB169F0
|
||||
//6FB2CB5B . E8 F0350100 CALL D2Client.6FB40150
|
||||
//6FAF437B . E8 60F60700 CALL D2Client.6FB739E0
|
||||
//6FAF53CB . E8 1080FDFF CALL D2Client.6FACD3E0
|
||||
//0044CB03 |. E8 D8A30000 CALL Game.00456EE0
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
@ -235,17 +303,19 @@ void Install_AlwaysRegenMapInSP()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
|
||||
log_msg("Patch D2Game for always regenerate maps in Single player. (AlwaysRegenMapInSP)\n");
|
||||
|
||||
// Always regenerate maps in Single player
|
||||
mem_seek R7(D2Game, 517ED, 51BFA, 5DE88, 6235D, 2966D, 1E1FE, ED3BE);
|
||||
mem_seek R8(D2Game, 517ED, 51BFA, 5DE88, 6235D, 2966D, 1E1FE, ED3BE, 26D7E, 16A20F);
|
||||
memt_byte( 0x74 , 0xEB); // JMP SHORT D2Game.01FE2368
|
||||
//6FC8DE88 |. 74 09 JE SHORT D2Game.6FC8DE93
|
||||
//01FE235D |. 74 09 JE SHORT D2Game.01FE2368
|
||||
//01FE235D |. 74 09 JE SHORT D2Game.01FE2368
|
||||
//01F9966D |. 74 09 JE SHORT D2Game.01F99678
|
||||
//6FC3E1FE |. 74 09 JE SHORT D2Game.6FC3E209
|
||||
//6FD0D3BE |. 74 09 JE SHORT D2Game.6FD0D3C9
|
||||
//6FC46D7E |. 74 09 JE SHORT D2Game.6FC46D89
|
||||
//0056A20F |. 74 09 JE SHORT Game.0056A21A
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
@ -262,11 +332,13 @@ void Install_RunLODs()
|
||||
log_msg("Patch D2gfx for launch any number of Diablo II game in the same computer. (RunLODs)\n");
|
||||
|
||||
// execute if it's our packet else continue
|
||||
mem_seek R7(D2gfx, 447C, 447C, 446A, 84CF, 84AF, 894F, 85BF);
|
||||
mem_seek R8(D2gfx, 447C, 447C, 446A, 84CF, 84AF, 894F, 85BF, B6B0, F562B);
|
||||
memt_byte( 0x74, 0xEB ); // JMP SHORT D2gfx.6FA884F6
|
||||
//6FA884AF |. 74 45 JE SHORT D2gfx.6FA884F6
|
||||
//6FA8894F |. 74 45 JE SHORT D2gfx.6FA88996
|
||||
//6FA885BF |. 74 45 JE SHORT D2gfx.6FA88606
|
||||
//6FA8B6B0 |. 74 45 JE SHORT D2gfx.6FA8B6F7
|
||||
//004F562B |. 74 45 JE SHORT Game.004F5672
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
@ -275,6 +347,20 @@ void Install_RunLODs()
|
||||
|
||||
/****************************************************************************************************/
|
||||
|
||||
FCT_ASM (caller_AlwaysDisplayLife_114)
|
||||
JNZ displayLife
|
||||
CMP onRealm,0
|
||||
JNZ normalDisplayLife
|
||||
CMP active_AlwaysDisplayLifeMana,0
|
||||
JE normalDisplayLife
|
||||
displayLife:
|
||||
POP EAX
|
||||
ADD EAX,0x24
|
||||
JMP EAX
|
||||
normalDisplayLife:
|
||||
LEA EAX,DWORD PTR DS:[ESI-0x1E]
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM (caller_AlwaysDisplayLife_113)
|
||||
POP EAX
|
||||
@ -320,7 +406,19 @@ normalDisplayLife:
|
||||
RETN
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM (caller_AlwaysDisplayMana_114)
|
||||
CMP onRealm,0
|
||||
JNZ normalDisplayMana
|
||||
CMP active_AlwaysDisplayLifeMana,0
|
||||
JE normalDisplayMana
|
||||
POP EAX
|
||||
ADD EAX,0x23
|
||||
JMP EAX
|
||||
normalDisplayMana:
|
||||
LEA EDI,DWORD PTR DS:[ECX-0x6F]
|
||||
CMP ESI,EDI
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM (caller_AlwaysDisplayMana_113)
|
||||
MOV EAX,DWORD PTR DS:[ptResolutionY]
|
||||
@ -381,22 +479,25 @@ void Install_AlwaysDisplayLifeMana()
|
||||
|
||||
log_msg("Patch D2Client for always display life and mana. (ALwaysPrintLifeMana)\n");
|
||||
|
||||
if ( version_D2Client >= V113 )
|
||||
if ( version_D2Client >= V113c )
|
||||
{
|
||||
mem_seek R7(D2Client, 0000, 0000, 0000, 0000, 0000, 0000, 2764A);
|
||||
memt_byte( 0x0F , 0x90);
|
||||
memt_byte( 0x8C , 0xE8);
|
||||
MEMT_REF4( 0x000000BC, caller_AlwaysDisplayLife_113);
|
||||
mem_seek R8(D2Client, 0000, 0000, 0000, 0000, 0000, 0000, 2764A, 6D6FA, 98183);
|
||||
if (version_D2Client < V114d) memt_byte( 0x0F , 0x90);
|
||||
memt_byte( version_D2Client >= V114d ? 0x75 : 0x8C , 0xE8);
|
||||
MEMT_REF4( version_D2Client >= V114d ? 0xE2468D27 : 0x000000BC, version_D2Client >= V114d ? caller_AlwaysDisplayLife_114 : caller_AlwaysDisplayLife_113);
|
||||
//6FAD764A |. 0F8C BC000000 JL D2Client.6FAD770C
|
||||
//6FAD7650 |. 83FA 6E CMP EDX,6E
|
||||
//6FAD7653 |. 0F8F B3000000 JG D2Client.6FAD770C
|
||||
//6FAD7659 |. A1 4CBCB86F MOV EAX,DWORD PTR DS:[6FB8BC4C]
|
||||
|
||||
//6FAD7667 |. 0F8C A4000000 JL D2Client.6FAD7711
|
||||
|
||||
//6FB1D717 |. 0F8C A4000000 JL D2Client.6FB1D7C1
|
||||
//6FB1D6FA |. 0F8C BC000000 JL D2Client.6FB1D7BC
|
||||
//00498183 |. 75 27 JNZ SHORT Game.004981AC
|
||||
//00498185 |. 8D46 E2 LEA EAX,DWORD PTR DS:[ESI-1E]
|
||||
} else {
|
||||
// Always display life.
|
||||
mem_seek R7(D2Client, 58B32, 58B32, 5F102, 2D713, B5DF3, 81733, 0000);
|
||||
mem_seek R8(D2Client, 58B32, 58B32, 5F102, 2D713, B5DF3, 81733, 0000, 0000, 0000);
|
||||
memt_byte( 0xA1 , 0xE8);
|
||||
MEMT_REF4( ptResolutionY , version_D2Client >= V111 ? caller_AlwaysDisplayLife_111 : caller_AlwaysDisplayLife);
|
||||
//6FADD713 |. A1 605CBA6F MOV EAX,DWORD PTR DS:[6FBA5C60]
|
||||
@ -406,15 +507,15 @@ void Install_AlwaysDisplayLifeMana()
|
||||
|
||||
|
||||
// Always display mana.
|
||||
if ( version_D2Client >= V113 )
|
||||
if ( version_D2Client >= V113c )
|
||||
{
|
||||
//mem_seek R7(D2Client, 0000, 0000, 0000, 0000, 0000, 0000, 27711);
|
||||
//memt_byte( 0x8B , 0x90);
|
||||
//memt_byte( 0x0D , 0xE8);
|
||||
//MEMT_REF4( offset_D2Client + 0x11C4B4 , caller_AlwaysDisplayMana_113);
|
||||
mem_seek R7(D2Client, 0000, 0000, 0000, 0000, 0000, 0000, 2770C);
|
||||
memt_byte( 0xA1 , 0xE8);
|
||||
MEMT_REF4( ptResolutionY , caller_AlwaysDisplayMana_113);
|
||||
mem_seek R8(D2Client, 0000, 0000, 0000, 0000, 0000, 0000, 2770C, 6D7BC, 9825D);
|
||||
memt_byte( version_D2Client >= V114d ? 0x8D : 0xA1 , 0xE8);
|
||||
MEMT_REF4( version_D2Client >= V114d ? 0xF73B9179 : (DWORD)ptResolutionY , version_D2Client >= V114d ? caller_AlwaysDisplayMana_114 : caller_AlwaysDisplayMana_113);
|
||||
//6FAD770C |> A1 4CBCB86F MOV EAX,DWORD PTR DS:[6FB8BC4C]
|
||||
//6FAD7711 |> 8B0D B4C4BC6F MOV ECX,DWORD PTR DS:[6FBCC4B4]
|
||||
|
||||
@ -426,10 +527,13 @@ void Install_AlwaysDisplayLifeMana()
|
||||
//6FAD77CA |. 5B POP EBX
|
||||
//6FAD77CB |. 81C4 28030000 ADD ESP,328
|
||||
//6FAD77D1 \. C3 RETN
|
||||
//6FB1D7BC |> A1 3870BA6F MOV EAX,DWORD PTR DS:[6FB8BC4C]
|
||||
//0049825D |. 8D79 91 LEA EDI,DWORD PTR DS:[ECX-6F]
|
||||
//00498260 |. 3BF7 CMP ESI,EDI
|
||||
}
|
||||
else if ( version_D2Client >= V110 )
|
||||
{
|
||||
mem_seek R7(D2Client, 0000, 0000, 5F1E6, 2D7FB, B5EDB, 8181B, 0000);
|
||||
mem_seek R8(D2Client, 0000, 0000, 5F1E6, 2D7FB, B5EDB, 8181B, 0000, 0000, 0000);
|
||||
memt_byte( 0x5F , 0xE8);
|
||||
MEMT_REF4( 0x815B5D5E , caller_AlwaysDisplayMana);
|
||||
memt_byte( 0xC4 , 0x90); // NOP
|
||||
@ -454,7 +558,7 @@ void Install_AlwaysDisplayLifeMana()
|
||||
//6FB3181F |. 81C4 5C020000 ADD ESP,25C
|
||||
//6FB31825 |. C3 RETN
|
||||
} else {
|
||||
mem_seek R7(D2Client, 58C09, 58C09, 0000, 0000, 0000, 0000, 0000);
|
||||
mem_seek R8(D2Client, 58C09, 58C09, 0000, 0000, 0000, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0xE9 , 0xE8);
|
||||
MEMT_REF4( 0x000000C2 , caller_AlwaysDisplayMana_9);
|
||||
//6FAF8C09 . E9 C2000000 JMP D2Client.6FAF8CD0
|
||||
@ -477,8 +581,8 @@ void Install_EnabledTXTFilesWithMSExcel()
|
||||
|
||||
log_msg("Patch D2Client for enabled the opening of files already opened by MS Excel. (EnabledTXTFilesWithMSExcel)\n");
|
||||
|
||||
mem_seek( (DWORD)D2StormMPQOpenFile + (version_Storm >= V111 ? 0x12A : 0xFF) );
|
||||
memt_byte( 0x01 , 0x03); //; |ShareMode = FILE_SHARE_READ|FILE_SHARE_WRITE
|
||||
mem_seek( (DWORD)D2StormMPQOpenFile + (version_Storm >= V114d ? 0xB4 : version_Storm >= V111 ? 0x12A : 0xFF) );
|
||||
memt_byte( 0x01 , 0x03); //; |ShareMode = FILE_SHARE_READ|FILE_SHARE_WRITE
|
||||
//6FC1C969 |. 6A 01 PUSH 1 ; |ShareMode = FILE_SHARE_READ
|
||||
|
||||
log_msg("\n");
|
||||
@ -512,7 +616,7 @@ void STDCALL printDisplayBaseStatsValue(WORD statID, sDrawImageInfo* data, DWORD
|
||||
if (isOnRect(D2GetMouseX(),D2GetMouseY(),x+5,y+5,32,32))
|
||||
{
|
||||
WCHAR text[100];
|
||||
swprintf(text, getTranslatedString(STR_STATS_BASE_MIN), statValue, minValue);
|
||||
_snwprintf(text, 100, getLocalString(STR_STATS_BASE_MIN), statValue, minValue);
|
||||
D2SetFont(1);
|
||||
D2PrintPopup(text, x+18, y-32, WHITE, 1);
|
||||
}
|
||||
@ -539,23 +643,28 @@ void Install_DisplayBaseStatsValue()
|
||||
log_msg("Patch D2Client for display base stats value. (DisplayBaseStatsValue)\n");
|
||||
|
||||
// Always print stat button images.
|
||||
mem_seek R7(D2Client, 29B12, 29B02, 30073, 82BBA, 8963A, 6B59A, BD1B5);
|
||||
mem_seek R8(D2Client, 29B12, 29B02, 30073, 82BBA, 8963A, 6B59A, BD1B5, BF955, A7FFB);
|
||||
memt_byte( 0x8B, 0xEB ); // JMP SHORT D2Client.6FAD0088
|
||||
memt_byte( 0x4C, V7(D2Client, 12, 12, 13, 13, 13, 13, 13) );
|
||||
memt_byte( 0x24, 0x90 ); // NOP
|
||||
memt_byte( V7(D2Client, 20, 20, 14, 1C, 1C, 1C, 1C), 0x90 ); // NOP (V109d:0x20 , V110:0x14
|
||||
memt_byte( version_D2Client == V114d ? 0x4D : 0x4C, V8(D2Client, 12, 12, 13, 13, 13, 13, 13, 13, 12) );
|
||||
memt_byte( version_D2Client == V114d ? 0xF8 : 0x24, 0x90 ); // NOP
|
||||
if (version_D2Client < V114d) memt_byte( V8(D2Client, 20, 20, 14, 1C, 1C, 1C, 1C, 1C, 53), 0x90 ); // NOP (V109d:0x20 , V110:0x14
|
||||
//6FAD0073 8B4C24 14 MOV ECX,DWORD PTR SS:[ESP+14]
|
||||
//6FB32BBA > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//6FB3963A > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//6FB1B59A > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//6FB6D1B5 |> 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//6FB6F955 |> 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//004A7FFB > 8B4D F8 MOV ECX,DWORD PTR SS:[EBP-8]
|
||||
//004A7FFE . 53 PUSH EBX ; /Arg3
|
||||
|
||||
mem_seek R7(D2Client, 29B9D, 29B8D, 300FD, 82C54, 896D4, 6B637, BD23E);
|
||||
mem_seek R8(D2Client, 29B9D, 29B8D, 300FD, 82C54, 896D4, 6B637, BD23E, BF9DE, A808C);
|
||||
MEMJ_REF4( D2PrintImage, caller_displayBaseStatsValue);
|
||||
//6FB32C53 . E8 82A3F8FF CALL <JMP.&D2gfx.#10047>
|
||||
//6FB396D3 . E8 D238F8FF CALL <JMP.&D2gfx.#10044>
|
||||
//6FB1B636 . E8 431AFAFF CALL <JMP.&D2gfx.#10024>
|
||||
//6FB6D23D |. E8 54FEF4FF |CALL <JMP.&D2gfx.#10041>
|
||||
//6FB6F9DD |. E8 54FEF4FF |CALL <JMP.&D2gfx.#10042>
|
||||
//004A808B . E8 F0E30400 CALL Game.004F6480 ; \Game.004F6480
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
@ -583,13 +692,15 @@ void Install_LadderRunewords()
|
||||
|
||||
log_msg("Patch D2Common for enabled the ladder only runewords. (LadderRunewords)\n");
|
||||
|
||||
mem_seek R7(D2Common, 0000, 0000, 1E965, 61762, 43A72, 5D492, 724B2);
|
||||
mem_seek R8(D2Common, 0000, 0000, 1E965, 61762, 43A72, 5D492, 724B2, 63782, 239C40);
|
||||
MEMC_REF4( D2CompileTxtFile, compileRunesTxt);
|
||||
//01B6E964 |. E8 0714FFFF CALL D2Common.#10578 ; \#10578
|
||||
//6FDB1761 |. E8 FAA8FCFF CALL D2Common.#10653 ; \#10653
|
||||
//6FD93A71 |. E8 EAADFCFF CALL D2Common.#10496 ; \#10496
|
||||
//6FDAD491 |. E8 BA49FEFF CALL D2Common.#10244 ; \#10244
|
||||
//6FDC24B1 |. E8 8ACAFEFF CALL D2Common.#10849 ; \#10849
|
||||
//6FDB3781 |. E8 5A93FAFF CALL D2Common.#10037 ; \#10037
|
||||
//00639C3F |. E8 AC86FDFF CALL Game.006122F0 ; \Game.006122F0
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
@ -607,7 +718,7 @@ void Install_EnabledCowPortalWhenCowKingWasKill()
|
||||
|
||||
log_msg("Patch D2Game for enabled the opening of Cow Portal when player have already kill the cow king in that difficulty. (EnabledCowPortalWhenCowKingWasKill)\n");
|
||||
|
||||
mem_seek R7(D2Game, 5DFF7, 5E457, 6C5E7 , B1278, 5DB68, 75C68, 67508);
|
||||
mem_seek R8(D2Game, 5DFF7, 5E457, 6C5E7 , B1278, 5DB68, 75C68, 67508, EBE8, 194179);
|
||||
memt_byte( 0x85 , 0x33); // XOR EAX,EAX
|
||||
//6FC8DFF7 . 85C0 TEST EAX,EAX
|
||||
//6FC8E457 . 85C0 TEST EAX,EAX
|
||||
@ -616,6 +727,234 @@ void Install_EnabledCowPortalWhenCowKingWasKill()
|
||||
//01FEDB68 |. 85C0 TEST EAX,EAX
|
||||
//6FC95C68 |. 85C0 TEST EAX,EAX
|
||||
//6FC87508 |. 85C0 TEST EAX,EAX
|
||||
//6FC2EBE8 |. 85C0 TEST EAX,EAX
|
||||
//00594179 |. 85C0 TEST EAX,EAX
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
isInstalled = true;
|
||||
}
|
||||
|
||||
/****************************************************************************************************/
|
||||
|
||||
void Install_DoNotCloseNihlathakPortal()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
log_msg("Patch D2Game to not close Nihlathak's portal. (DoNotCloseNihlathakPortal)\n");
|
||||
|
||||
mem_seek R8(D2Game, 76B19, 77019, 86679 , 107C7, 51987, 26B67, 5AE67, 1FF27, 18B9D7);
|
||||
memt_byte(0x0F, 0x90);
|
||||
memt_byte(0x85, 0x90);
|
||||
memt_dword( version_D2Game >= V114d ? 0x000000C5 : version_D2Game >= V111 ? 0x000000BF : 0x000000C1, 0x90909090);
|
||||
//6FCA6B19 . 0F85 C1000000 JNZ D2Game.6FCA6BE0
|
||||
//6FCA7019 . 0F85 C1000000 JNZ D2Game.6FCA70E0
|
||||
//6FCB6679 . 0F85 C1000000 JNZ D2Game.6FCB6740
|
||||
//6FC307C7 . 0F85 BF000000 JNZ D2Game.6FC3088C
|
||||
//6FC71987 . 0F85 BF000000 JNZ D2Game.6FC71A4C
|
||||
//6FC46B67 . 0F85 BF000000 JNZ D2Game.6FC46C2C
|
||||
//6FC7AE67 . 0F85 BF000000 JNZ D2Game.6FC7AF2C
|
||||
//6FC3FF27 . 0F85 BF000000 JNZ D2Game.6FC3FFEC
|
||||
//0058B9D7 |. 0F85 C5000000 JNZ Game.0058BAA2
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
isInstalled = true;
|
||||
}
|
||||
|
||||
/****************************************************************************************************/
|
||||
/* townWest.ds1:
|
||||
129A6 : 4D->76
|
||||
129AA : 56->3A
|
||||
12ACA : 05->04
|
||||
+4 : 4D->76
|
||||
+4 : 56->3A
|
||||
+4 : 4E->76
|
||||
+4 : 58->3A
|
||||
+4 : 01->01
|
||||
+4 : 4C->7B
|
||||
+4 : 57->50
|
||||
+4 : 02->02
|
||||
+4 : 4D->7B
|
||||
+4 : 5D->41
|
||||
+4 : 01->01
|
||||
+4 : 49->7D
|
||||
+4 : 5C->3E
|
||||
+4 : 02->02
|
||||
+4 : 4F->
|
||||
+4 : 5B->
|
||||
+4 : 02->
|
||||
*/
|
||||
|
||||
/*char* FASTCALL usePlugYTownWest(char* filename)
|
||||
{
|
||||
if (onRealm)
|
||||
return filename;
|
||||
|
||||
if (!strcmp(filename, "DATA\\GLOBAL\\TILES\\Expansion\\Town\\townWest.ds1"))
|
||||
return "PlugY\\townWest.ds1";
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_usePlugYTownWest )
|
||||
LEA EAX,DWORD PTR SS:[EBP-0x40]
|
||||
MOV ECX,EAX
|
||||
CALL usePlugYTownWest
|
||||
MOV ECX,EAX
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_usePlugYTownWest_113d )
|
||||
LEA EAX,DWORD PTR SS:[ESP+0x14]
|
||||
MOV ECX,EAX
|
||||
CALL usePlugYTownWest
|
||||
MOV EDX,ESI
|
||||
RETN
|
||||
}}*/
|
||||
|
||||
/****************************************************************************************************/
|
||||
|
||||
void* FASTCALL updateHarrogath(DWORD unused, char* filename, DWORD* size, const char* __CallFile, DWORD __CallLine)
|
||||
{
|
||||
if (onRealm)
|
||||
return D2ReadFile(unused, filename, size, __CallFile, __CallLine);
|
||||
|
||||
if (strcmp(filename, "DATA\\GLOBAL\\TILES\\Expansion\\Town\\townWest.ds1"))
|
||||
return D2ReadFile(unused, filename, size, __CallFile, __CallLine);
|
||||
|
||||
DWORD fileSize = 0;
|
||||
if (size == NULL)
|
||||
size = &fileSize;
|
||||
char* data = (char*)D2ReadFile(unused, filename, size, __FILE__, __LINE__);
|
||||
if (*size > 400 &&
|
||||
*(DWORD*)(data + *size - 0x16C) == 0x0000004D &&
|
||||
*(DWORD*)(data + *size - 0x168) == 0x00000056 &&
|
||||
*(DWORD*)(data + *size - 0x48) == 0x00000005 &&
|
||||
*(DWORD*)(data + *size - 0x44) == 0x0000004D &&
|
||||
*(DWORD*)(data + *size - 0x40) == 0x00000056 &&
|
||||
*(DWORD*)(data + *size - 0x3C) == 0x0000004E &&
|
||||
*(DWORD*)(data + *size - 0x38) == 0x00000058 &&
|
||||
*(DWORD*)(data + *size - 0x34) == 0x00000001 &&
|
||||
*(DWORD*)(data + *size - 0x30) == 0x0000004C &&
|
||||
*(DWORD*)(data + *size - 0x2C) == 0x00000057 &&
|
||||
*(DWORD*)(data + *size - 0x28) == 0x00000002 &&
|
||||
*(DWORD*)(data + *size - 0x24) == 0x0000004D &&
|
||||
*(DWORD*)(data + *size - 0x20) == 0x0000005D &&
|
||||
*(DWORD*)(data + *size - 0x1C) == 0x00000001 &&
|
||||
*(DWORD*)(data + *size - 0x18) == 0x00000049 &&
|
||||
*(DWORD*)(data + *size - 0x14) == 0x0000005C &&
|
||||
*(DWORD*)(data + *size - 0x10) == 0x00000002 &&
|
||||
*(DWORD*)(data + *size - 0x0C) == 0x0000004F &&
|
||||
*(DWORD*)(data + *size - 0x08) == 0x0000005B &&
|
||||
*(DWORD*)(data + *size - 0x04) == 0x00000002)
|
||||
{
|
||||
log_msg("update TownWest to Move Cain near Harrogath waypoint\n");
|
||||
*(DWORD*)(data + *size - 0x16C) = 0x00000076;
|
||||
*(DWORD*)(data + *size - 0x168) = 0x0000003A;
|
||||
*(DWORD*)(data + *size - 0x48) = 0x00000004;
|
||||
*(DWORD*)(data + *size - 0x44) = 0x00000076;
|
||||
*(DWORD*)(data + *size - 0x40) = 0x0000003A;
|
||||
*(DWORD*)(data + *size - 0x3C) = 0x00000076;
|
||||
*(DWORD*)(data + *size - 0x38) = 0x0000003A;
|
||||
*(DWORD*)(data + *size - 0x34) = 0x00000001;
|
||||
*(DWORD*)(data + *size - 0x30) = 0x0000007B;
|
||||
*(DWORD*)(data + *size - 0x2C) = 0x00000050;
|
||||
*(DWORD*)(data + *size - 0x28) = 0x00000002;
|
||||
*(DWORD*)(data + *size - 0x24) = 0x0000007B;
|
||||
*(DWORD*)(data + *size - 0x20) = 0x00000041;
|
||||
*(DWORD*)(data + *size - 0x1C) = 0x00000001;
|
||||
*(DWORD*)(data + *size - 0x18) = 0x0000007D;
|
||||
*(DWORD*)(data + *size - 0x14) = 0x0000003E;
|
||||
*(DWORD*)(data + *size - 0x10) = 0x00000002;
|
||||
*(DWORD*)(data + *size - 0x0C) = 0x00000000;
|
||||
*(DWORD*)(data + *size - 0x08) = 0x00000000;
|
||||
*(DWORD*)(data + *size - 0x04) = 0x00000000;
|
||||
}
|
||||
else
|
||||
log_msg("ERROR : Failed to update TownWest to Move Cain near Harrogath waypoint\n");
|
||||
return data;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_updateHarrogath )
|
||||
MOV ECX,DWORD PTR SS:[ESP+4]
|
||||
PUSH 0
|
||||
PUSH 0
|
||||
PUSH DWORD PTR SS:[ESP+0x10]
|
||||
MOV EDX,EAX
|
||||
CALL updateHarrogath
|
||||
RETN 8
|
||||
}}
|
||||
|
||||
void Install_MoveCainNearHarrogathWaypoint()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
log_msg("Patch D2Common to move Deckard Cain near Waypoint in Harrogath. (MoveCainNearHarrogathWaypoint)\n");
|
||||
mem_seek R8(D2Common, 3653E, 3654E, 45A2E , 82233, 39593, 222A3, B573, 54033, 265972);
|
||||
MEMC_REF4( V2ReadFile, version_D2Common >= V111 && version_D2Common <= V113d? (TD2ReadFile)caller_updateHarrogath : updateHarrogath);
|
||||
//6FD7653D |. E8 62D30300 CALL D2Common.6FDB38A4
|
||||
//6FD7654D |. E8 62D40300 CALL D2Common.6FDB39B4
|
||||
//6FD85A2D |. E8 36E80300 CALL D2Common.6FDC4268
|
||||
//6FDD2232 . E8 A974F8FF CALL D2Common.6FD596E0
|
||||
//6FD89592 . E8 3903FDFF CALL D2Common.6FD598D0
|
||||
//6FD722A2 . E8 5976FEFF CALL D2Common.6FD59900
|
||||
//6FD5B572 . E8 89E3FFFF CALL D2Common.6FD59900
|
||||
//6FDA4032 . E8 A975FBFF CALL D2Common.6FD5B5E0
|
||||
//00665971 |. E8 0317EBFF CALL Game.00517079
|
||||
|
||||
/*
|
||||
mem_seek R8(D2Common, 0000, 0000, 0000 , 0000, 0000, 734AA, 6C75A, 308FA, 21E4F7);
|
||||
memt_byte( 0x8D, 0xE8);
|
||||
MEMT_REF4( version_D2Common >= V114d ? 0xC88BC045 : 0x8B102444, version_D2Common >= V114d ? caller_usePlugYTownWest : caller_usePlugYTownWest_113d);
|
||||
if (version_D2Common < V114d) memt_byte( 0xD6, 0x90);
|
||||
//6FDC34AA |. 8D4424 10 LEA EAX,DWORD PTR SS:[ESP+10]
|
||||
//6FDC34AE |. 8BD6 MOV EDX,ESI
|
||||
//6FDBC75A |. 8D4424 10 LEA EAX,DWORD PTR SS:[ESP+10]
|
||||
//6FDBC75E |. 8BD6 MOV EDX,ESI
|
||||
//6FD808FA |. 8D4424 10 LEA EAX,DWORD PTR SS:[ESP+10]
|
||||
//6FD808FE |. 8BD6 MOV EDX,ESI
|
||||
//0061E4F7 |. 8D45 C0 LEA EAX,DWORD PTR SS:[EBP-40]
|
||||
//0061E4FA |. 8BC8 MOV ECX,EAX
|
||||
*/
|
||||
log_msg("\n");
|
||||
|
||||
isInstalled = true;
|
||||
}
|
||||
|
||||
|
||||
ExperienceBIN* STDCALL modifExperienceBin(ExperienceBIN* ptExperienceBIN)
|
||||
{
|
||||
for (int i=71; i<101; i++)
|
||||
ptExperienceBIN[i].ExpRatio = 1024;
|
||||
return ptExperienceBIN;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_modifExperienceBin )
|
||||
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 modifExperienceBin
|
||||
RETN 0x14
|
||||
}}
|
||||
|
||||
void Install_RemoveExperienceDiminushingReturn()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
log_msg("Patch D2Common to remove experience diminushing return. (RemoveExperienceDiminushingReturn)\n");
|
||||
|
||||
// modification of experienceBIN
|
||||
mem_seek R8(D2Common, 00000, 00000, 00000, 00000, 00000, 00000, 00000, 00000, 213E42);
|
||||
MEMC_REF4( D2CompileTxtFile, caller_modifExperienceBin);
|
||||
//00613E41 |. E8 AAE4FFFF CALL Game.006122F0 ; \Game.006122F0
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
|
@ -1,25 +1,29 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Updating server.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "bigStash.h" // active_bigStash_tested
|
||||
#include "uberQuest.h" //active_UberQuest + resetQuestState()
|
||||
#include "infinityStash.h" //active_UberQuest + resetQuestState()
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "bigStash.h"
|
||||
#include <stdio.h>
|
||||
#include "uberQuest.h"
|
||||
#include "worldEvent.h"
|
||||
|
||||
bool onRealm=false;
|
||||
bool needToInit=false;
|
||||
bool onRealm = false;
|
||||
bool needToInit = false;
|
||||
int previouslyOnRealm = -1;
|
||||
|
||||
void STDCALL BtnPress()
|
||||
// mode 0:SinglePlayer - 1:TCPIP - 2:Battlenet
|
||||
void STDCALL BtnPress(int mode)
|
||||
{
|
||||
needToInit = 1;
|
||||
needToInit = true;
|
||||
|
||||
loadLocalizedStrings(D2GetLang());
|
||||
|
||||
// if (active_WorldEvent)
|
||||
// initWorldEventVariables();
|
||||
if (active_UberQuest)
|
||||
@ -29,11 +33,28 @@ void STDCALL BtnPress()
|
||||
previouslyOnRealm = onRealm;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_BnetBtnPress114 )
|
||||
CMP active_DisableBattleNet,1
|
||||
JE disableBattleNet
|
||||
MOV onRealm,1
|
||||
PUSH EAX
|
||||
PUSH 2
|
||||
CALL BtnPress
|
||||
POP EAX
|
||||
SUB ESP,0x3FC//400
|
||||
JMP DWORD PTR SS:[ESP+0x3FC]
|
||||
disableBattleNet:
|
||||
POP EAX
|
||||
POP EAX
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_BnetBtnPress )
|
||||
CMP active_DisableBattleNet,1
|
||||
JE disableBattleNet
|
||||
MOV onRealm,1
|
||||
PUSH EAX
|
||||
PUSH 2
|
||||
CALL BtnPress
|
||||
POP EAX
|
||||
SUB ESP,0x3FC//400
|
||||
@ -51,8 +72,18 @@ FCT_ASM ( caller_MultiPlayerBtnPress )
|
||||
}}
|
||||
*/
|
||||
|
||||
FCT_ASM ( caller_TCPIPBtnPress114 )
|
||||
MOV onRealm,0
|
||||
PUSH 1
|
||||
CALL BtnPress
|
||||
MOV ECX,DWORD PTR SS:[ESP]
|
||||
ADD ECX,0xB9B0
|
||||
JMP ECX
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_TCPIPBtnPress111 )
|
||||
MOV onRealm,0
|
||||
PUSH 1
|
||||
CALL BtnPress
|
||||
MOV ESI,0x40
|
||||
RETN
|
||||
@ -60,6 +91,7 @@ FCT_ASM ( caller_TCPIPBtnPress111 )
|
||||
|
||||
FCT_ASM ( caller_TCPIPBtnPress )
|
||||
MOV onRealm,0
|
||||
PUSH 1
|
||||
CALL BtnPress
|
||||
MOV EBP,1
|
||||
RETN
|
||||
@ -67,6 +99,7 @@ FCT_ASM ( caller_TCPIPBtnPress )
|
||||
|
||||
FCT_ASM ( caller_SinglePlayerBtnPress )
|
||||
MOV onRealm,0
|
||||
PUSH 0
|
||||
CALL BtnPress
|
||||
MOV EDX,0x400
|
||||
RETN
|
||||
@ -101,11 +134,12 @@ void Install_VariableOnRealm()
|
||||
log_msg("Patch D2Launch for set not on realm variable. (VariableonRealm)\n");
|
||||
|
||||
// click on Battle.net button
|
||||
mem_seek R7(D2Launch, 8195, 81A5, 9915, 129E5, 18AA5, 17D15, 19295);
|
||||
mem_seek R8(D2Launch, 8195, 81A5, 9915, 129E5, 18AA5, 17D15, 19295, 11C65, 3533B);
|
||||
memt_byte( 0x81, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x000400EC, caller_BnetBtnPress);
|
||||
MEMT_REF4( 0x000400EC, version_D2Launch == V114d ? caller_BnetBtnPress114 : caller_BnetBtnPress);
|
||||
memt_byte( 0x00, 0x90 ); // NOP
|
||||
//6FA529E5 . 81EC 00040000 SUB ESP,400
|
||||
//0043533B |. 81EC 00040000 SUB ESP,400
|
||||
|
||||
// click on Multiplayer button
|
||||
// mem_seek R7(D2Launch, D5EC, D5CC, EFFC, 0000, 0000, 0000, 0000);
|
||||
@ -114,11 +148,16 @@ void Install_VariableOnRealm()
|
||||
//6FA1EFFC . B8 01000000 MOV EAX,1
|
||||
|
||||
// click on TCP/IP button
|
||||
mem_seek R7(D2Launch, 87B9, 87C9, 9F99, 11329, 17409, 16659, 17B8E);
|
||||
if (version_D2Launch == V109b || version_D2Launch == V109d || version_D2Launch == V110)
|
||||
mem_seek R8(D2Launch, 87B9, 87C9, 9F99, 11329, 17409, 16659, 17B8E, 1053E, 2FFEC);
|
||||
if (version_D2Launch <= V110)
|
||||
{
|
||||
memt_byte( 0xBD, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x00000001, caller_TCPIPBtnPress);
|
||||
}
|
||||
else if (version_D2Launch >= V114d)
|
||||
{
|
||||
MEMT_REF4( 0x0000B9B0, caller_TCPIPBtnPress114);
|
||||
//0042FFEB . E8 B0B90000 CALL Game.0043B9A0
|
||||
} else {
|
||||
memt_byte( 0xBE, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x00000040, caller_TCPIPBtnPress111);
|
||||
@ -126,16 +165,17 @@ void Install_VariableOnRealm()
|
||||
}
|
||||
|
||||
// click on SinglePlayer button
|
||||
mem_seek R7(D2Launch, D1F6, D1E6, EC16, B726, 117E6, 10A56, 11F36);
|
||||
mem_seek R8(D2Launch, D1F6, D1E6, EC16, B726, 117E6, 10A56, 11F36, A906, 30BC9);
|
||||
memt_byte( 0xBA, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x00000400, caller_SinglePlayerBtnPress);
|
||||
//6FA4B726 . BA 00040000 MOV EDX,400
|
||||
//00430BC9 |. BA 00040000 MOV EDX,400
|
||||
|
||||
if (version_D2Game == V110)
|
||||
{
|
||||
log_msg("\nPatch D2Game for fixing ptClient removing bug. (VariableonRealm)\n");
|
||||
//Bug crash ptClient search fix (for Megalixir Mod).
|
||||
mem_seek R7(D2Game, 0000, 0000, 2B97, 0000, 0000, 0000, 0000);
|
||||
mem_seek R8(D2Game, 0000, 0000, 2B97, 0000, 0000, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0x39 ,0xE8);
|
||||
MEMT_REF4( 0x8B0C7429 , caller_fixClientRemovingBug);
|
||||
memt_byte( 0xC1 ,0x90);
|
||||
|
@ -12,11 +12,9 @@
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "INIfile.h"
|
||||
|
||||
#include "d2functions.h"
|
||||
#include "error.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getprivateprofilestring.asp
|
||||
@ -24,12 +22,10 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/ge
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
// First a few support routines
|
||||
// Utils
|
||||
|
||||
static char *strstri(char *text, char *string)
|
||||
LPSTR strstri(LPSTR text, LPSTR string)
|
||||
{
|
||||
char *found = NULL;
|
||||
|
||||
if(text && string)
|
||||
{
|
||||
int len = strlen(string);
|
||||
@ -37,9 +33,9 @@ static char *strstri(char *text, char *string)
|
||||
{
|
||||
while(*text)
|
||||
{
|
||||
if(strnicmp(string, text, len) == 0)
|
||||
if(_strnicmp(string, text, len) == 0)
|
||||
{
|
||||
found = text;
|
||||
return text;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -47,12 +43,32 @@ static char *strstri(char *text, char *string)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LPCWSTR strstri(LPCWSTR text, LPCWSTR string)
|
||||
{
|
||||
if (text && string)
|
||||
{
|
||||
int len = wcslen(string);
|
||||
if (len)
|
||||
{
|
||||
while (*text)
|
||||
{
|
||||
if (_wcsnicmp(string, text, len) == 0)
|
||||
{
|
||||
return text;
|
||||
break;
|
||||
}
|
||||
|
||||
static BOOL chrcmp(char c, char *string)
|
||||
text++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BOOL chrcmp(char c, char *string)
|
||||
{
|
||||
for(unsigned int i=0; i<strlen(string); i++)
|
||||
{
|
||||
@ -64,7 +80,7 @@ static BOOL chrcmp(char c, char *string)
|
||||
}
|
||||
|
||||
|
||||
static BOOL FileExists(char *name)
|
||||
BOOL FileExists(char *name)
|
||||
{
|
||||
DWORD attr = GetFileAttributes(name);
|
||||
return ( (attr != (DWORD)-1) && !(attr & FILE_ATTRIBUTE_DIRECTORY) );
|
||||
@ -72,17 +88,17 @@ static BOOL FileExists(char *name)
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
INIFile::INIFile()
|
||||
{
|
||||
m_readWrite = 0;
|
||||
m_file = NULL;
|
||||
m_cache = NULL;
|
||||
m_cacheWritePos = 0;
|
||||
m_cache = NULL;
|
||||
m_sectionStart = NULL;
|
||||
m_sectionEnd = NULL;
|
||||
|
||||
|
||||
ZeroMemory((void *)m_path, sizeof(m_path));
|
||||
ZeroMemory((void *)m_currentSection, sizeof(m_currentSection));
|
||||
}
|
||||
@ -98,48 +114,81 @@ INIFile::~INIFile()
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
BOOL INIFile::InitReadWrite(char *path, int readWrite, DWORD writeCacheSize)
|
||||
BOOL INIFile::InitReadWrite(const char *path, int readWrite, DWORD writeCacheSize)
|
||||
{
|
||||
if(path)
|
||||
if (!path)
|
||||
return false;
|
||||
|
||||
m_readWrite = readWrite;
|
||||
m_cacheWritePos = 0;
|
||||
m_sectionStart = NULL;
|
||||
m_sectionEnd = NULL;
|
||||
|
||||
ZeroMemory((void *)m_path, sizeof(m_path));
|
||||
ZeroMemory((void *)m_currentSection, sizeof(m_currentSection));
|
||||
|
||||
strncpy(m_path, path, sizeof(m_path));
|
||||
|
||||
if(m_file)
|
||||
{
|
||||
m_readWrite = readWrite;
|
||||
m_cacheWritePos = 0;
|
||||
m_sectionStart = NULL;
|
||||
m_sectionEnd = NULL;
|
||||
CloseHandle(m_file);
|
||||
m_file = NULL;
|
||||
}
|
||||
|
||||
ZeroMemory((void *)m_path, sizeof(m_path));
|
||||
ZeroMemory((void *)m_currentSection, sizeof(m_currentSection));
|
||||
if(m_cache)
|
||||
{
|
||||
delete [] m_cache;
|
||||
m_cache = NULL;
|
||||
}
|
||||
|
||||
strncpy(m_path, path, sizeof(m_path));
|
||||
|
||||
if(m_file)
|
||||
// If read, the open file and cache content in memory
|
||||
if(m_readWrite == INIFILE_MPQREAD)
|
||||
{
|
||||
void* refFile;
|
||||
if ( D2MPQOpenFile(m_path,&refFile) )
|
||||
{
|
||||
CloseHandle(m_file);
|
||||
m_file = NULL;
|
||||
}
|
||||
|
||||
if(m_cache)
|
||||
{
|
||||
delete [] m_cache;
|
||||
m_cache = NULL;
|
||||
}
|
||||
|
||||
// If read, the open file and cache content in memory
|
||||
if(m_readWrite == INIFILE_MPQREAD)
|
||||
{
|
||||
void* refFile;
|
||||
if ( D2MPQOpenFile(m_path,&refFile) )
|
||||
DWORD fileSize = D2MPQGetSizeFile(refFile, NULL);
|
||||
m_cache = new char[fileSize + 1];
|
||||
if(m_cache)
|
||||
{
|
||||
DWORD fileSize = D2MPQGetSizeFile(refFile, NULL);
|
||||
DWORD read;
|
||||
if(D2MPQReadFile(refFile, (BYTE*)m_cache, fileSize, &read, NULL, NULL, NULL) == 0)
|
||||
{
|
||||
delete [] m_cache;
|
||||
m_cache = NULL;
|
||||
}
|
||||
else
|
||||
m_cache[fileSize] = 0;
|
||||
}
|
||||
D2MPQCloseFile(refFile);
|
||||
if(m_cache)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// if((m_readWrite == INIFILE_MPQREAD) || (m_readWrite == INIFILE_READ))
|
||||
if(m_readWrite == INIFILE_READ)
|
||||
{
|
||||
if(FileExists(m_path))
|
||||
{
|
||||
m_file = CreateFile(m_path,
|
||||
GENERIC_READ,
|
||||
0,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
|
||||
if(m_file != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD fileSize = GetFileSize(m_file, NULL);
|
||||
|
||||
m_cache = new char[fileSize + 1];
|
||||
if(m_cache)
|
||||
{
|
||||
DWORD read;
|
||||
if(D2MPQReadFile(refFile, (BYTE*)m_cache, fileSize, &read, NULL, NULL, NULL) == 0)
|
||||
|
||||
if(ReadFile(m_file, m_cache, fileSize, &read, NULL) == 0)
|
||||
{
|
||||
delete [] m_cache;
|
||||
m_cache = NULL;
|
||||
@ -147,60 +196,23 @@ BOOL INIFile::InitReadWrite(char *path, int readWrite, DWORD writeCacheSize)
|
||||
else
|
||||
m_cache[fileSize] = 0;
|
||||
}
|
||||
D2MPQCloseFile(refFile);
|
||||
|
||||
CloseHandle(m_file);
|
||||
m_file = NULL;
|
||||
|
||||
if(m_cache)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if((m_readWrite == INIFILE_MPQREAD) || (m_readWrite == INIFILE_READ))
|
||||
if(m_readWrite == INIFILE_READ)
|
||||
{
|
||||
if(FileExists(m_path))
|
||||
{
|
||||
m_file = CreateFile(m_path,
|
||||
GENERIC_READ,
|
||||
0,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
// If write, then create write cache memory buffer
|
||||
if(m_readWrite == INIFILE_WRITE)
|
||||
{
|
||||
m_cache = new char[writeCacheSize];
|
||||
|
||||
if(m_file != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD fileSize = GetFileSize(m_file, NULL);
|
||||
|
||||
m_cache = new char[fileSize + 1];
|
||||
if(m_cache)
|
||||
{
|
||||
DWORD read;
|
||||
|
||||
if(ReadFile(m_file, m_cache, fileSize, &read, NULL) == 0)
|
||||
{
|
||||
delete [] m_cache;
|
||||
m_cache = NULL;
|
||||
}
|
||||
else
|
||||
m_cache[fileSize] = 0;
|
||||
}
|
||||
|
||||
CloseHandle(m_file);
|
||||
m_file = NULL;
|
||||
|
||||
if(m_cache)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If write, then create write cache memory buffer
|
||||
if(m_readWrite == INIFILE_WRITE)
|
||||
{
|
||||
m_cache = new char[writeCacheSize];
|
||||
|
||||
if(m_cache)
|
||||
return TRUE;
|
||||
}
|
||||
if(m_cache)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@ -268,19 +280,13 @@ BOOL INIFile::close()
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
static char delimiterEnd[] = "\r\n\0";
|
||||
|
||||
|
||||
int INIFile::GetPrivateProfileString(const char *section, const char *key, const char *def, char *dest, DWORD size)
|
||||
{
|
||||
DWORD copied = 0;
|
||||
|
||||
if((m_cache) && (section && key && dest && size))
|
||||
{
|
||||
if(stricmp(section, m_currentSection) != 0)
|
||||
if(_stricmp(section, m_currentSection) != 0)
|
||||
{
|
||||
strncpy(m_currentSection, section, MAX_SECTIONNAME_LENGTH);
|
||||
|
||||
@ -319,7 +325,7 @@ int INIFile::GetPrivateProfileString(const char *section, const char *key, const
|
||||
{
|
||||
s += strlen(keyString);
|
||||
|
||||
while(*s && (copied < size) && (chrcmp(*s, delimiterEnd) == FALSE))
|
||||
while(*s && copied < size && *s != '\n' && *s != '\r' && *s != NULL)
|
||||
{
|
||||
*dest++ = *s++;
|
||||
copied++;
|
||||
@ -332,8 +338,11 @@ int INIFile::GetPrivateProfileString(const char *section, const char *key, const
|
||||
}
|
||||
}
|
||||
|
||||
if(!copied && def)
|
||||
if (!copied && def)
|
||||
{
|
||||
strncpy(dest, def, size);
|
||||
return strlen(dest);
|
||||
}
|
||||
|
||||
return copied; // Do not include the terminating null character
|
||||
}
|
||||
@ -343,7 +352,7 @@ BOOL INIFile::WritePrivateProfileString(char *section, char *key, char *string)
|
||||
{
|
||||
if(!section || !key || !string) return false;
|
||||
|
||||
if(stricmp(section, m_currentSection) != 0)
|
||||
if(_stricmp(section, m_currentSection) != 0)
|
||||
{
|
||||
if(m_cacheWritePos == 0)
|
||||
m_cacheWritePos += sprintf((m_cache + m_cacheWritePos), "[%s]\r\n", section);
|
||||
@ -356,4 +365,262 @@ BOOL INIFile::WritePrivateProfileString(char *section, char *key, char *string)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
INIFileW::INIFileW()
|
||||
{
|
||||
m_readWrite = 0;
|
||||
m_file = NULL;
|
||||
m_cacheWritePos = 0;
|
||||
m_cache = NULL;
|
||||
m_sectionStart = NULL;
|
||||
m_sectionEnd = NULL;
|
||||
|
||||
ZeroMemory((void *)m_path, sizeof(m_path));
|
||||
ZeroMemory((void *)m_currentSection, sizeof(m_currentSection));
|
||||
}
|
||||
|
||||
INIFileW::~INIFileW()
|
||||
{
|
||||
if (m_file)
|
||||
CloseHandle(m_file);
|
||||
|
||||
if (m_cache)
|
||||
delete[] m_cache;
|
||||
}
|
||||
|
||||
BOOL INIFileW::InitReadWrite(const char *path, int readWrite, DWORD writeCacheSize)
|
||||
{
|
||||
if (!path)
|
||||
return false;
|
||||
|
||||
m_readWrite = readWrite;
|
||||
m_cacheWritePos = 0;
|
||||
m_sectionStart = NULL;
|
||||
m_sectionEnd = NULL;
|
||||
|
||||
ZeroMemory((void *)m_path, sizeof(m_path));
|
||||
ZeroMemory((void *)m_currentSection, sizeof(m_currentSection));
|
||||
|
||||
strncpy(m_path, path, sizeof(m_path));
|
||||
|
||||
if (m_file)
|
||||
{
|
||||
CloseHandle(m_file);
|
||||
m_file = NULL;
|
||||
}
|
||||
|
||||
if (m_cache)
|
||||
{
|
||||
delete[] m_cache;
|
||||
m_cache = NULL;
|
||||
}
|
||||
|
||||
// If read, the open file and cache content in memory
|
||||
if (m_readWrite == INIFILE_MPQREAD)
|
||||
{
|
||||
void* refFile;
|
||||
if (D2MPQOpenFile(m_path, &refFile))
|
||||
{
|
||||
DWORD fileSize = D2MPQGetSizeFile(refFile, NULL);
|
||||
m_cache = new WCHAR[fileSize + 1];
|
||||
if (m_cache)
|
||||
{
|
||||
DWORD read;
|
||||
if (D2MPQReadFile(refFile, (BYTE*)m_cache, fileSize, &read, NULL, NULL, NULL) == 0)
|
||||
{
|
||||
delete[] m_cache;
|
||||
m_cache = NULL;
|
||||
}
|
||||
else
|
||||
m_cache[fileSize] = 0;
|
||||
}
|
||||
D2MPQCloseFile(refFile);
|
||||
if (m_cache)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// if((m_readWrite == INIFILE_MPQREAD) || (m_readWrite == INIFILE_READ))
|
||||
if (m_readWrite == INIFILE_READ)
|
||||
{
|
||||
if (FileExists(m_path))
|
||||
{
|
||||
m_file = CreateFile(m_path,
|
||||
GENERIC_READ,
|
||||
0,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
|
||||
if (m_file != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD fileSize = GetFileSize(m_file, NULL);
|
||||
|
||||
m_cache = new WCHAR[fileSize + 1];
|
||||
if (m_cache)
|
||||
{
|
||||
DWORD read;
|
||||
|
||||
if (ReadFile(m_file, m_cache, fileSize, &read, NULL) == 0)
|
||||
{
|
||||
delete[] m_cache;
|
||||
m_cache = NULL;
|
||||
}
|
||||
else
|
||||
m_cache[fileSize] = 0;
|
||||
}
|
||||
|
||||
CloseHandle(m_file);
|
||||
m_file = NULL;
|
||||
|
||||
if (m_cache)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// If write, then create write cache memory buffer
|
||||
if (m_readWrite == INIFILE_WRITE)
|
||||
{
|
||||
m_cache = new WCHAR[writeCacheSize];
|
||||
|
||||
if (m_cache)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL INIFileW::close()
|
||||
{
|
||||
BOOL success = FALSE;
|
||||
|
||||
// If read, then kill the memory cached settings
|
||||
if (m_readWrite == INIFILE_READ)
|
||||
{
|
||||
// Just to be sure, close the settings file again if it's still open for some reason
|
||||
if (m_file)
|
||||
{
|
||||
CloseHandle(m_file);
|
||||
m_file = NULL;
|
||||
}
|
||||
|
||||
if (m_cache)
|
||||
{
|
||||
delete[] m_cache;
|
||||
m_cache = NULL;
|
||||
|
||||
success = TRUE;
|
||||
}
|
||||
|
||||
// Just to be sure, reset section position markers
|
||||
m_sectionStart = NULL;
|
||||
m_sectionEnd = NULL;
|
||||
}
|
||||
|
||||
// If write, then commit (write) cached settings file to disk
|
||||
if (m_readWrite == INIFILE_WRITE)
|
||||
{
|
||||
if (m_path && m_cache)
|
||||
{
|
||||
m_file = CreateFile(m_path,
|
||||
GENERIC_WRITE,
|
||||
0,
|
||||
NULL,
|
||||
CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
|
||||
if (m_file != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD written;
|
||||
WriteFile(m_file, m_cache, m_cacheWritePos, &written, NULL);
|
||||
|
||||
CloseHandle(m_file);
|
||||
m_file = NULL;
|
||||
|
||||
if (written == m_cacheWritePos)
|
||||
success = TRUE;
|
||||
}
|
||||
|
||||
delete[] m_cache;
|
||||
m_cache = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
int INIFileW::GetPrivateProfileString(LPCWSTR section, LPCWSTR key, LPCWSTR def, LPWSTR dest, DWORD size)
|
||||
{
|
||||
DWORD copied = 0;
|
||||
|
||||
if ((m_cache) && (section && key && dest && size))
|
||||
{
|
||||
if (_wcsicmp(section, m_currentSection) != 0)
|
||||
{
|
||||
wcsncpy(m_currentSection, section, MAX_SECTIONNAME_LENGTH);
|
||||
|
||||
WCHAR headerString[MAX_SECTIONNAME_LENGTH];
|
||||
ZeroMemory((void *)headerString, sizeof(headerString));
|
||||
// _snprintf(headerString, MAX_SECTIONNAME_LENGTH, "[%s]\r\n", section);
|
||||
_snwprintf(headerString, MAX_SECTIONNAME_LENGTH, L"[%s]", section);
|
||||
|
||||
// Locate section start in buffer
|
||||
m_sectionStart = strstri(m_cache, headerString);
|
||||
|
||||
// We found the start section
|
||||
if (m_sectionStart)
|
||||
{
|
||||
// Keys start after the "[" + section + "]" header
|
||||
m_sectionStart += wcslen(section) + 2;
|
||||
// Locate section end in buffer
|
||||
m_sectionEnd = wcsstr(m_sectionStart, L"\r\n[");
|
||||
// If no next section is found, then use end of buffer
|
||||
if (m_sectionEnd == NULL)
|
||||
m_sectionEnd = m_cache + wcslen(m_cache);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_sectionStart && m_sectionEnd)
|
||||
{
|
||||
WCHAR keyString[MAX_KEYNAME_LENGTH];
|
||||
ZeroMemory((void *)keyString, sizeof(keyString));
|
||||
_snwprintf(keyString, MAX_KEYNAME_LENGTH, L"\r\n%s=", key);
|
||||
|
||||
if (LPCWSTR s = strstri(m_sectionStart, keyString))
|
||||
{
|
||||
if (s < m_sectionEnd)
|
||||
{
|
||||
s += wcslen(keyString);
|
||||
|
||||
while (*s && copied < size && *s != '\n' && *s != '\r' && *s != NULL)
|
||||
{
|
||||
*dest++ = *s++;
|
||||
copied++;
|
||||
}
|
||||
|
||||
*dest = 0;
|
||||
copied++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!copied && def)
|
||||
{
|
||||
wcsncpy(dest, def, size);
|
||||
return wcslen(dest);
|
||||
}
|
||||
|
||||
return copied; // Do not include the terminating null character
|
||||
}
|
||||
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -11,9 +11,7 @@
|
||||
©1999-2004 Ultrafunk (www.ultrafunk.com) - info@ultrafunk.com
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _INIFILE_H
|
||||
#define _INIFILE_H
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@ -24,31 +22,48 @@
|
||||
#define MAX_SECTIONNAME_LENGTH 128
|
||||
#define MAX_KEYNAME_LENGTH 128
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
class INIFile
|
||||
{
|
||||
public:
|
||||
INIFile();
|
||||
~INIFile();
|
||||
|
||||
BOOL InitReadWrite(char *path, int readWrite, DWORD writeCacheSize);
|
||||
BOOL close();
|
||||
int GetPrivateProfileString(const char *section, const char *key, const char *def, char *dest, DWORD size);
|
||||
BOOL WritePrivateProfileString(char *section, char *key, char *string);
|
||||
BOOL InitReadWrite(const char *path, int readWrite, DWORD writeCacheSize);
|
||||
BOOL close();
|
||||
int GetPrivateProfileString(const char *section, const char *key, const char *def, char *dest, DWORD size);
|
||||
BOOL WritePrivateProfileString(char *section, char *key, char *string);
|
||||
|
||||
private:
|
||||
char m_currentSection[MAX_SECTIONNAME_LENGTH];
|
||||
char *m_cache;
|
||||
char *m_sectionStart;
|
||||
char *m_sectionEnd;
|
||||
int m_readWrite;
|
||||
char m_path[_MAX_PATH];
|
||||
HANDLE m_file;
|
||||
char *m_cache;
|
||||
DWORD m_cacheWritePos;
|
||||
char *m_sectionStart;
|
||||
char *m_sectionEnd;
|
||||
char m_currentSection[MAX_SECTIONNAME_LENGTH];
|
||||
};
|
||||
|
||||
class INIFileW
|
||||
{
|
||||
public:
|
||||
INIFileW();
|
||||
~INIFileW();
|
||||
|
||||
#endif // _INIFILE_H
|
||||
BOOL InitReadWrite(const char *path, int readWrite, DWORD writeCacheSize);
|
||||
BOOL close();
|
||||
int GetPrivateProfileString(LPCWSTR section, LPCWSTR key, LPCWSTR def, LPWSTR dest, DWORD size);
|
||||
int GetPrivateProfileStringList(LPCWSTR section, LPCWSTR key, DWORD** codes, LPWSTR** values);
|
||||
//BOOL WritePrivateProfileString(char *section, char *key, char *string);
|
||||
LPWSTR m_cache;
|
||||
|
||||
private:
|
||||
WCHAR m_currentSection[MAX_SECTIONNAME_LENGTH];
|
||||
LPCWSTR m_sectionStart;
|
||||
LPCWSTR m_sectionEnd;
|
||||
int m_readWrite;
|
||||
char m_path[_MAX_PATH];
|
||||
HANDLE m_file;
|
||||
DWORD m_cacheWritePos;
|
||||
};
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,32 +1,34 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Gestion of the infinity and shared Stash.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
|
||||
#include "common.h"
|
||||
#include "infinityStash.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "updateClient.h"
|
||||
#include "interface_Stash.h"
|
||||
#include "common.h"
|
||||
|
||||
#define STASH_TAG 0x5453 //"ST"
|
||||
#define JM_TAG 0x4D4A //"JM"
|
||||
#define JM_TAG 0x4D4A //"JM"
|
||||
|
||||
DWORD maxSelfPages = -1;
|
||||
DWORD maxSharedPages = -1;
|
||||
DWORD nbPagesPerIndex = 10;
|
||||
DWORD nbPagesPerIndex2 = 100;
|
||||
bool active_multiPageStash = false;
|
||||
bool autoRenameStashPage = false;
|
||||
int active_SharedStashInMultiPlayer = 0;//0: disabled, 1:shared in SP, 2: shared in SP & TCP/IP
|
||||
bool active_sharedStash = false;
|
||||
bool separateHardSoftStash = false;
|
||||
bool active_sharedGold=false;
|
||||
char* sharedStashFilename = NULL;
|
||||
DWORD saveFileStackSize = 0x2000;
|
||||
|
||||
typedef int (*TchangeToSelectedStash)(Unit* ptChar, Stash* newStash, DWORD bIsClient);
|
||||
typedef int (*TchangeToSelectedStash)(Unit* ptChar, Stash* newStash, DWORD bOnlyItems, DWORD bIsClient);
|
||||
|
||||
Unit* firstClassicStashItem(Unit* ptChar)
|
||||
{
|
||||
@ -40,14 +42,15 @@ Unit* firstClassicStashItem(Unit* ptChar)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DWORD endStashList(Unit* ptChar, Stash* ptStash)//WORKS
|
||||
DWORD endStashList(Unit* ptChar, Stash* ptStash)
|
||||
{
|
||||
Stash* stash = ptStash;
|
||||
|
||||
|
||||
while (stash)
|
||||
{
|
||||
if (stash->ptListItem || ((stash == PCPY->currentStash) && firstClassicStashItem(ptChar))) return 0;
|
||||
stash = stash->nextStash;
|
||||
if (stash->name != NULL && stash->name[0]) return 0;
|
||||
stash = stash->nextStash;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -64,59 +67,64 @@ DWORD endStashList(Unit* ptChar, Stash* ptStash)//WORKS
|
||||
//}
|
||||
|
||||
|
||||
Stash* getLastStash(Stash* ptStash)//WORKS
|
||||
Stash* getLastStash(Stash* ptStash)
|
||||
{
|
||||
Stash* stash = ptStash;
|
||||
|
||||
if (!stash) return NULL;
|
||||
while (stash->nextStash)
|
||||
stash = stash->nextStash;
|
||||
|
||||
return stash;
|
||||
if (!ptStash)
|
||||
return NULL;
|
||||
while (ptStash->nextStash)
|
||||
ptStash = ptStash->nextStash;
|
||||
return ptStash;
|
||||
}
|
||||
|
||||
Stash* newStash(DWORD id)
|
||||
{
|
||||
d2_assert( id == 0xFFFFFFFF , "trop de stash", __FILE__, __LINE__);
|
||||
|
||||
d2_assert( id == 0xFFFFFFFF , "Too much stash", __FILE__, __LINE__);
|
||||
|
||||
Stash* stash = (Stash*)malloc(sizeof(Stash));//D2AllocMem(memPool, sizeof(Stash),__FILE__,__LINE__,0);
|
||||
d2_assert(!stash , "pb de génération de stash", __FILE__, __LINE__);
|
||||
d2_assert(!stash , "Error on stash allocation.", __FILE__, __LINE__);
|
||||
ZeroMemory(stash, sizeof(Stash));
|
||||
stash->id = id;
|
||||
|
||||
|
||||
return stash;
|
||||
}
|
||||
|
||||
Stash* addStash(Unit* ptChar, bool isShared)
|
||||
Stash* addStash(Unit* ptChar, bool isShared, bool autoSetIndex, Stash* previous)
|
||||
{
|
||||
Stash* previous;
|
||||
Stash* stash;
|
||||
// DWORD memPool = PCGame ? PCGame->memoryPool :0;
|
||||
if (isShared)
|
||||
{
|
||||
previous = getLastStash(PCPY->sharedStash);
|
||||
stash = newStash(PCPY->nbSharedPages++);
|
||||
} else {
|
||||
previous = getLastStash(PCPY->selfStash);
|
||||
stash = newStash(PCPY->nbSelfPages++);
|
||||
}
|
||||
|
||||
previous = getLastStash(previous ? previous : isShared ? PCPY->sharedStash : PCPY->selfStash);
|
||||
if (previous)
|
||||
isShared = previous->isShared;
|
||||
|
||||
Stash* stash = newStash(isShared ? PCPY->nbSharedPages++ : PCPY->nbSelfPages++);
|
||||
stash->isShared = isShared;
|
||||
stash->previousStash = previous;
|
||||
|
||||
if (previous)
|
||||
{
|
||||
previous->nextStash = stash;
|
||||
if (autoSetIndex)
|
||||
{
|
||||
stash->isIndex = ((stash->id + 1) % nbPagesPerIndex) == 0;
|
||||
stash->isMainIndex = ((stash->id + 1) % nbPagesPerIndex2) == 0;
|
||||
}
|
||||
}
|
||||
else if (isShared)
|
||||
{
|
||||
PCPY->sharedStash = stash;
|
||||
stash->isIndex = 1;
|
||||
stash->isMainIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
PCPY->selfStash = stash;
|
||||
|
||||
log_msg("AddStash: stash->id=%d\tstash->isShared=%d\tstash->previous=%08X\tnbSelf=%d\tnbShared=%d\n",
|
||||
stash->id,stash->isShared,stash->previousStash,PCPY->nbSelfPages,PCPY->nbSharedPages);
|
||||
|
||||
stash->isIndex = 1;
|
||||
stash->isMainIndex = 1;
|
||||
}
|
||||
|
||||
log_msg("AddStash: stash->id=%d\tstash->isShared=%d\tnbSelf=%d\tnbShared=%d\n", stash->id, stash->isShared, PCPY->nbSelfPages, PCPY->nbSharedPages);
|
||||
return stash;
|
||||
}
|
||||
|
||||
Stash* getStash(Unit* ptChar, DWORD isShared, DWORD id)//WORKS
|
||||
Stash* getStash(Unit* ptChar, DWORD isShared, DWORD id)
|
||||
{
|
||||
Stash* ptStash = isShared ? PCPY->sharedStash : PCPY->selfStash;
|
||||
|
||||
@ -130,15 +138,15 @@ Stash* getStash(Unit* ptChar, DWORD isShared, DWORD id)//WORKS
|
||||
}
|
||||
|
||||
|
||||
int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bIsClient)
|
||||
int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bOnlyItems, DWORD bIsClient)
|
||||
{
|
||||
if (!newStash) return 0;
|
||||
|
||||
log_msg("changeToSelectedStash ID:%d\tshared:%d\tclient:%d\n",newStash->id,newStash->id,bIsClient);
|
||||
|
||||
Stash* currentStash = PCPY->currentStash;
|
||||
if (currentStash == newStash) return 0;
|
||||
|
||||
log_msg("changeToSelectedStash ID:%d\tshared:%d\tonlyItems:%d\tclient:%d\n", newStash->id, newStash->isShared, bOnlyItems, bIsClient);
|
||||
|
||||
d2_assert( currentStash && currentStash->ptListItem, "ERROR : currentStash isn't empty (ptListItem != NULL)",__FILE__,__LINE__);
|
||||
|
||||
// collect items to remove
|
||||
@ -153,7 +161,7 @@ int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bIsClient)
|
||||
{
|
||||
D2SetAnim(D2GetRealItem(ptItem),-1);
|
||||
if (ptPrevItem) {
|
||||
ptPrevItem->CurrentAnim = (DWORD)ptNextItem;//is ptPrevItem->nextNode = ptNextItem;
|
||||
ptPrevItem->mode = (DWORD)ptNextItem;//is ptPrevItem->nextNode = ptNextItem;
|
||||
} else {
|
||||
ptInventory->currentUsedSocket = (DWORD)ptNextItem;//is ptInventory->ptListItem = ptNextItem;
|
||||
}
|
||||
@ -167,7 +175,7 @@ int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bIsClient)
|
||||
if (currentStash)
|
||||
{
|
||||
// ptItem = setNextItem(ptItem, PCPY->currentStash->ptListItem);
|
||||
ptItem->CurrentAnim = (DWORD)currentStash->ptListItem;//is ptItem->nextNode = ptListItem
|
||||
ptItem->mode = (DWORD)currentStash->ptListItem;//is ptItem->nextNode = ptListItem
|
||||
currentStash->ptListItem = ptItem;
|
||||
};
|
||||
} else ptPrevItem = ptItem;
|
||||
@ -175,7 +183,6 @@ int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bIsClient)
|
||||
}
|
||||
|
||||
// add items of new stash
|
||||
PCPY->currentStash = newStash;
|
||||
ptItem = newStash->ptListItem;
|
||||
while (ptItem)
|
||||
{
|
||||
@ -183,20 +190,24 @@ int changeToSelectedStash_9(Unit* ptChar, Stash* newStash, DWORD bIsClient)
|
||||
D2Common10242(PCInventory, D2GetRealItem(ptItem), 1);
|
||||
ptItem = D2UnitGetNextItem(ptItem);
|
||||
}
|
||||
newStash->ptListItem = NULL;
|
||||
if (bOnlyItems)
|
||||
newStash->ptListItem = PCPY->currentStash->ptListItem;
|
||||
else
|
||||
PCPY->currentStash = newStash;
|
||||
PCPY->currentStash->ptListItem = NULL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int changeToSelectedStash_10(Unit* ptChar, Stash* newStash, DWORD bIsClient)
|
||||
int changeToSelectedStash_10(Unit* ptChar, Stash* newStash, DWORD bOnlyItems, DWORD bIsClient)
|
||||
{
|
||||
if (!newStash) return 0;
|
||||
|
||||
log_msg("changeToSelectedStash ID:%d\tshared:%d\tclient:%d\n",newStash->id,newStash->id,bIsClient);
|
||||
|
||||
Stash* currentStash = PCPY->currentStash;
|
||||
if (currentStash == newStash) return 0;
|
||||
|
||||
log_msg("changeToSelectedStash ID:%d\tshared:%d\tonlyItems:%d\tclient:%d\n",newStash->id,newStash->isShared, bOnlyItems,bIsClient);
|
||||
|
||||
d2_assert( currentStash && currentStash->ptListItem, "ERROR : currentStash isn't empty (ptListItem != NULL)",__FILE__,__LINE__);
|
||||
|
||||
// Remove items from current page
|
||||
@ -220,14 +231,17 @@ int changeToSelectedStash_10(Unit* ptChar, Stash* newStash, DWORD bIsClient)
|
||||
}
|
||||
|
||||
// add items of new stash
|
||||
PCPY->currentStash = newStash;
|
||||
ptItem = newStash->ptListItem;
|
||||
while (ptItem)
|
||||
{
|
||||
D2InvAddItem(PCInventory, ptItem, ptItem->path->x, ptItem->path->y, 0xC, bIsClient, 4);
|
||||
ptItem = D2UnitGetNextItem(ptItem);
|
||||
}
|
||||
newStash->ptListItem = NULL;
|
||||
if (bOnlyItems)
|
||||
newStash->ptListItem = PCPY->currentStash->ptListItem;
|
||||
else
|
||||
PCPY->currentStash = newStash;
|
||||
PCPY->currentStash->ptListItem = NULL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -250,52 +264,100 @@ DWORD loadStash(Unit* ptChar, Stash* ptStash, BYTE data[], DWORD startSize, DWOR
|
||||
}
|
||||
curSize += 2;
|
||||
|
||||
// Read flags.
|
||||
int len = strlen((char*)&data[curSize]);
|
||||
if (*(WORD*)&data[curSize + len + 1] != JM_TAG)
|
||||
{
|
||||
ptStash->flags = *(DWORD *)&data[curSize];
|
||||
curSize += 4;
|
||||
}
|
||||
|
||||
// Read Name
|
||||
// if (strlen((char *)&data[curSize]) > 0xF)
|
||||
// *(char *)&data[curSize+0xF] = NULL;
|
||||
if (strlen((char *)&data[curSize]))
|
||||
ptStash->name = (char*)malloc(strlen((char *)&data[curSize]));//D2AllocMem(PCGame->memoryPool, strlen((char *)&data[curSize]),__FILE__,__LINE__,0);
|
||||
ptStash->name = (char*)malloc(strlen((char *)&data[curSize]) + 1);//D2AllocMem(PCGame->memoryPool, strlen((char *)&data[curSize]),__FILE__,__LINE__,0);
|
||||
if (ptStash->name)
|
||||
strcpy(ptStash->name, (char *)&data[curSize]);
|
||||
curSize += strlen((char *)&data[curSize]) + 1;
|
||||
|
||||
// Read inventory.
|
||||
DWORD ret = D2LoadInventory(PCGame, ptChar, (saveBitField*)&data[curSize], 0x60, maxSize-curSize, 0, &nbBytesRead);
|
||||
if (ret) log_msg("loadStash -> D2LoadInventory failed\n");
|
||||
log_msg("Stash loaded (%d : %s)\n", ptStash->id ,ptStash->name);
|
||||
log_msg("Stash loaded (%d : %s)\n", ptStash->id, ptStash->name);
|
||||
|
||||
*retSize=curSize + nbBytesRead;
|
||||
return ret;
|
||||
}
|
||||
|
||||
DWORD loadStashList(Unit* ptChar, BYTE data[], DWORD maxSize, DWORD* curSize, bool isShared)//WORKS
|
||||
void autoSetIndex(Stash* firstStash)
|
||||
{
|
||||
if (!firstStash)
|
||||
return;
|
||||
log_msg("autoSetIndex\n");
|
||||
Stash* stash = firstStash;
|
||||
while (stash)
|
||||
{
|
||||
if (stash->isIndex || stash->isMainIndex)
|
||||
return;
|
||||
stash = stash->nextStash;
|
||||
}
|
||||
stash = firstStash;
|
||||
stash->isIndex = 1;
|
||||
stash->isMainIndex = 1;
|
||||
stash = stash->nextStash;
|
||||
while (stash)
|
||||
{
|
||||
stash->isIndex = ((stash->id + 1) % nbPagesPerIndex) == 0;
|
||||
stash->isMainIndex = ((stash->id + 1) % nbPagesPerIndex2) == 0;
|
||||
stash = stash->nextStash;
|
||||
}
|
||||
}
|
||||
|
||||
DWORD loadStashList(Unit* ptChar, BYTE* data, DWORD maxSize, DWORD* curSize, bool isShared)
|
||||
{
|
||||
DWORD curStash = 0;
|
||||
Stash* newStash;
|
||||
Stash* newStash = NULL;
|
||||
|
||||
DWORD nbStash = *(DWORD*)&data[*curSize];
|
||||
*curSize += 4;
|
||||
|
||||
log_msg("loadStashList nbStash=%d\n", nbStash);
|
||||
|
||||
while (curStash < nbStash)
|
||||
{
|
||||
newStash = addStash(ptChar, isShared);
|
||||
changeToSelectedStash(ptChar, newStash, false);
|
||||
newStash = addStash(ptChar, isShared, false, newStash);
|
||||
changeToSelectedStash(ptChar, newStash, 0, false);
|
||||
DWORD ret = loadStash(ptChar, newStash, data, *curSize, 10000000, curSize);
|
||||
if (ret) return ret;
|
||||
curStash++;
|
||||
}
|
||||
|
||||
if (!isShared && !PCPY->selfStash)
|
||||
|
||||
if (!isShared)
|
||||
{
|
||||
newStash = addStash(ptChar, isShared);
|
||||
PCPY->currentStash = newStash;
|
||||
}
|
||||
|
||||
if (isShared && !PCPY->sharedStash)
|
||||
{
|
||||
newStash = addStash(ptChar, isShared);
|
||||
if (!PCPY->currentStash)
|
||||
if (PCPY->selfStash)
|
||||
autoSetIndex(PCPY->selfStash);
|
||||
else
|
||||
{
|
||||
newStash = addStash(ptChar, isShared, true, newStash);
|
||||
PCPY->currentStash = newStash;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isShared)
|
||||
{
|
||||
if (PCPY->sharedStash)
|
||||
autoSetIndex(PCPY->sharedStash);
|
||||
else
|
||||
{
|
||||
newStash = addStash(ptChar, isShared, true, newStash);
|
||||
if (!PCPY->currentStash)
|
||||
PCPY->currentStash = newStash;
|
||||
}
|
||||
}
|
||||
|
||||
changeToSelectedStash(ptChar, isShared?PCPY->sharedStash:PCPY->selfStash, 0, false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -310,11 +372,14 @@ void saveStash(Unit* ptChar, Stash* ptStash, BYTE** data, DWORD* maxSize, DWORD*
|
||||
//write "ST"
|
||||
SETDATA(WORD, STASH_TAG);
|
||||
|
||||
//Write flags.
|
||||
SETDATA(DWORD, ptStash->flags);
|
||||
|
||||
//save name
|
||||
if (ptStash->name)
|
||||
{
|
||||
int size = strlen(ptStash->name);
|
||||
if (size > 15) size = 15;
|
||||
if (size > 20) size = 20;
|
||||
strncpy((char*)DATA, ptStash->name, size);
|
||||
*curSize += size;
|
||||
}
|
||||
@ -358,7 +423,7 @@ void saveStashList(Unit* ptChar, Stash* ptStash, BYTE** data, DWORD* maxSize, DW
|
||||
|
||||
while(ptStash)
|
||||
{
|
||||
if (*curSize + 0x2000 > *maxSize)
|
||||
if (*curSize + saveFileStackSize > *maxSize)
|
||||
{
|
||||
BYTE* oldData = *data;
|
||||
*maxSize *= 2;
|
||||
@ -375,28 +440,37 @@ void saveStashList(Unit* ptChar, Stash* ptStash, BYTE** data, DWORD* maxSize, DW
|
||||
}
|
||||
|
||||
/////// client
|
||||
void updateSelectedStashClient(Unit* ptChar)//WORKS
|
||||
void updateSelectedStashClient(Unit* ptChar)
|
||||
{
|
||||
Stash* newStash = PCPY->currentStash;
|
||||
if (!newStash)
|
||||
return;
|
||||
updateClient(ptChar, UC_SELECT_STASH, newStash->id, newStash->flags, PCPY->flags);
|
||||
updateClient(ptChar, UC_PAGE_NAME, newStash->name);
|
||||
}
|
||||
|
||||
void setSelectedStashClient(DWORD stashId, DWORD stashFlags, DWORD flags)//WORKS
|
||||
void setSelectedStashClient(DWORD stashId, DWORD stashFlags, DWORD flags, bool bOnlyItems)
|
||||
{
|
||||
log_msg("setSelectedStashClient ID:%d, isShared:%d, flags:%08X\n", stashId, stashFlags&1, flags);
|
||||
log_msg("setSelectedStashClient ID:%d, stashFlags:%d, flags:%08X\n", stashId, stashFlags, flags);
|
||||
Unit* ptChar = D2GetClientPlayer();
|
||||
Stash* newStash = getStash(ptChar, stashFlags&1, stashId);
|
||||
Stash* newStash = getStash(ptChar, (stashFlags & 1) == 1, stashId);
|
||||
if (!newStash) do
|
||||
newStash = addStash(ptChar, stashFlags&1);
|
||||
newStash = addStash(ptChar, (stashFlags & 1) == 1, false, newStash);
|
||||
while (newStash->id < stashId);
|
||||
changeToSelectedStash(ptChar, newStash, 1);
|
||||
newStash->flags = stashFlags;
|
||||
changeToSelectedStash(ptChar, newStash, bOnlyItems, 1);
|
||||
PCPY->flags = flags;
|
||||
}
|
||||
|
||||
|
||||
void selectStash(Unit* ptChar, Stash* newStash)//WORKS
|
||||
void selectStash(Unit* ptChar, Stash* newStash, bool forceUpdate)
|
||||
{
|
||||
changeToSelectedStash(ptChar, newStash, 0);
|
||||
if (!newStash)
|
||||
return;
|
||||
if (!forceUpdate && newStash == PCPY->currentStash)
|
||||
return;
|
||||
log_msg("selectStash ID:%d\tshared:%d\tforceUpdate:%d\n", newStash->id, newStash->isShared, forceUpdate);
|
||||
changeToSelectedStash(ptChar, newStash, 0, 0);
|
||||
updateSelectedStashClient(ptChar);
|
||||
}
|
||||
|
||||
@ -423,6 +497,121 @@ void toggleToSharedStash(Unit* ptChar)
|
||||
}
|
||||
}
|
||||
|
||||
void swapStash(Unit* ptChar, Stash* curStash, Stash* swpStash)
|
||||
{
|
||||
log_msg("swapStash ID:%d\tshared:%d\tonlyItems:%d\tclient:%d\n", swpStash->id, swpStash->isShared, 1, 0);
|
||||
if (!ptChar || !curStash || !swpStash || curStash == swpStash)
|
||||
return;
|
||||
changeToSelectedStash(ptChar, swpStash, 1, 0);
|
||||
updateClient(ptChar, UC_SELECT_STASH, swpStash->id, swpStash->flags | 8, PCPY->flags);
|
||||
}
|
||||
|
||||
void toggleStash(Unit* ptChar, DWORD page)
|
||||
{
|
||||
log_msg("toggle stash page = %u\n", page);
|
||||
Stash* curStash = PCPY->currentStash;
|
||||
Stash* swpStash = curStash->isShared ? PCPY->selfStash : PCPY->sharedStash;
|
||||
swapStash(ptChar, curStash, swpStash);
|
||||
}
|
||||
|
||||
void swapStash(Unit* ptChar, DWORD page, bool toggle)
|
||||
{
|
||||
log_msg("swap stash page = %u, toggle=%u\n", page, toggle);
|
||||
Stash* curStash = PCPY->currentStash;
|
||||
Stash* swpStash = curStash->isShared == toggle ? PCPY->selfStash : PCPY->sharedStash;
|
||||
if (!swpStash)
|
||||
swpStash = addStash(ptChar, !curStash->isShared, true, swpStash);
|
||||
for (DWORD i = 0; i < page; i++)
|
||||
{
|
||||
log_msg("swap stash : %i\n", i);
|
||||
if (swpStash->nextStash == NULL)
|
||||
addStash(ptChar, swpStash->isShared, false, swpStash);
|
||||
swpStash = swpStash->nextStash;
|
||||
}
|
||||
swapStash(ptChar, curStash, swpStash);
|
||||
}
|
||||
|
||||
void insertStash(Unit* ptChar)
|
||||
{
|
||||
Stash* curStash = PCPY->currentStash;
|
||||
Stash* stash = addStash(ptChar, curStash->isShared, false, curStash);
|
||||
while (stash->previousStash != curStash)
|
||||
{
|
||||
stash->flags = stash->previousStash->flags;
|
||||
stash->name = stash->previousStash->name;
|
||||
stash->ptListItem = stash->previousStash->ptListItem;
|
||||
stash = stash->previousStash;
|
||||
}
|
||||
stash->isIndex = 0;
|
||||
stash->isMainIndex = 0;
|
||||
stash->name = NULL;
|
||||
stash->ptListItem = NULL;
|
||||
}
|
||||
|
||||
bool deleteStash(Unit* ptChar, bool isClient)
|
||||
{
|
||||
if (firstClassicStashItem(ptChar) != NULL)
|
||||
return false;
|
||||
//if (D2InventoryGetFirstItem())
|
||||
Stash* stash = PCPY->currentStash;
|
||||
if (stash->nextStash == NULL)
|
||||
{
|
||||
stash->isIndex = 0;
|
||||
stash->isMainIndex = 0;
|
||||
stash->name = NULL;
|
||||
return true;
|
||||
}
|
||||
stash->flags = stash->nextStash->flags;
|
||||
stash->name = stash->nextStash->name;
|
||||
if (stash->nextStash->ptListItem != NULL)
|
||||
{
|
||||
log_msg("deleteStash ID:%d\tshared:%d\tonlyItems:%d\tclient:%d\n", stash->id, stash->isShared, 1, isClient);
|
||||
changeToSelectedStash(ptChar, stash->nextStash, 1, isClient);
|
||||
}
|
||||
stash = stash->nextStash;
|
||||
while (stash->nextStash)
|
||||
{
|
||||
stash->flags = stash->nextStash->flags;
|
||||
stash->name = stash->nextStash->name;
|
||||
stash->ptListItem = stash->nextStash->ptListItem;
|
||||
stash = stash->nextStash;
|
||||
}
|
||||
stash->isIndex = 0;
|
||||
stash->isMainIndex = 0;
|
||||
stash->name = NULL;
|
||||
stash->ptListItem = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void renameCurrentStash(Unit* ptChar, char* name)
|
||||
{
|
||||
log_msg("renameCurrentStash : '%s'\n", name);
|
||||
Stash* stash = PCPY->currentStash;
|
||||
int len = 0;
|
||||
if (name != NULL)
|
||||
len = strlen(name);
|
||||
if (stash->name)
|
||||
D2FogMemDeAlloc(stash->name, __FILE__, __LINE__, 0);
|
||||
if (len > 0)
|
||||
{
|
||||
stash->name = (char *)malloc(len + 1);//D2FogMemAlloc(len,__FILE__,__LINE__,0);
|
||||
strcpy(stash->name, name);
|
||||
}
|
||||
else
|
||||
stash->name = NULL;
|
||||
}
|
||||
|
||||
|
||||
void setCurrentStashIndex(Unit* ptChar, int index)
|
||||
{
|
||||
if (!PCPY->currentStash)
|
||||
return;
|
||||
PCPY->currentStash->isIndex = index >= 1;
|
||||
PCPY->currentStash->isMainIndex = index == 2;
|
||||
updateSelectedStashClient(ptChar);
|
||||
}
|
||||
|
||||
|
||||
void selectPreviousStash(Unit* ptChar)
|
||||
{
|
||||
@ -444,8 +633,8 @@ void selectNextStash(Unit* ptChar)
|
||||
Stash* selStash = PCPY->currentStash;
|
||||
if (!selStash->isShared && (selStash->id >= maxSelfPages)) return;
|
||||
if (selStash->isShared && (selStash->id >= maxSharedPages)) return;
|
||||
|
||||
selStash = selStash->nextStash ? selStash->nextStash : addStash(ptChar, PCPY->showSharedStash);
|
||||
|
||||
selStash = selStash->nextStash ? selStash->nextStash : addStash(ptChar, PCPY->showSharedStash, true, selStash);
|
||||
|
||||
if (selStash && (selStash != PCPY->currentStash))
|
||||
selectStash(ptChar, selStash);
|
||||
@ -472,9 +661,16 @@ void selectPreviousIndexStash(Unit* ptChar)
|
||||
{
|
||||
selectPreviousStash(ptChar);
|
||||
Stash* selStash = PCPY->currentStash;
|
||||
while (selStash->previousStash && ((selStash->id+1) % nbPagesPerIndex != 0))
|
||||
while (selStash && !selStash->isIndex)
|
||||
selStash = selStash->previousStash;
|
||||
|
||||
if (selStash == NULL)
|
||||
{
|
||||
selStash = PCPY->currentStash;
|
||||
while (selStash->previousStash && ((selStash->id + 1) % nbPagesPerIndex != 0))
|
||||
selStash = selStash->previousStash;
|
||||
}
|
||||
|
||||
if (selStash && (selStash != PCPY->currentStash))
|
||||
selectStash(ptChar, selStash);
|
||||
}
|
||||
@ -483,9 +679,16 @@ void selectPreviousIndex2Stash(Unit* ptChar)
|
||||
{
|
||||
selectPreviousStash(ptChar);
|
||||
Stash* selStash = PCPY->currentStash;
|
||||
while (selStash->previousStash && ((selStash->id+1) % nbPagesPerIndex2 != 0))
|
||||
while (selStash && !selStash->isMainIndex)
|
||||
selStash = selStash->previousStash;
|
||||
|
||||
if (selStash == NULL)
|
||||
{
|
||||
selStash = PCPY->currentStash;
|
||||
while (selStash->previousStash && ((selStash->id+1) % nbPagesPerIndex2 != 0))
|
||||
selStash = selStash->previousStash;
|
||||
}
|
||||
|
||||
if (selStash && (selStash != PCPY->currentStash))
|
||||
selectStash(ptChar, selStash);
|
||||
}
|
||||
@ -494,11 +697,18 @@ void selectNextIndexStash(Unit* ptChar)
|
||||
{
|
||||
selectNextStash(ptChar);
|
||||
Stash* selStash = PCPY->currentStash;
|
||||
while ((selStash->id+1) % nbPagesPerIndex != 0)
|
||||
while (selStash && !selStash->isIndex)
|
||||
selStash = selStash->nextStash;
|
||||
|
||||
if (selStash == NULL)
|
||||
{
|
||||
if (!selStash->isShared && (selStash->id >= maxSelfPages)) break;
|
||||
if (selStash->isShared && (selStash->id >= maxSharedPages)) break;
|
||||
selStash = selStash->nextStash ? selStash->nextStash : addStash(ptChar, PCPY->showSharedStash);;
|
||||
selStash = PCPY->currentStash;
|
||||
while ((selStash->id + 1) % nbPagesPerIndex != 0)
|
||||
{
|
||||
if (!selStash->isShared && (selStash->id >= maxSelfPages)) break;
|
||||
if (selStash->isShared && (selStash->id >= maxSharedPages)) break;
|
||||
selStash = selStash->nextStash ? selStash->nextStash : addStash(ptChar, PCPY->showSharedStash, true, selStash);
|
||||
}
|
||||
}
|
||||
if (selStash && (selStash != PCPY->currentStash))
|
||||
selectStash(ptChar, selStash);
|
||||
@ -508,16 +718,142 @@ void selectNextIndex2Stash(Unit* ptChar)
|
||||
{
|
||||
selectNextStash(ptChar);
|
||||
Stash* selStash = PCPY->currentStash;
|
||||
while ((selStash->id+1) % nbPagesPerIndex2 != 0)
|
||||
while (selStash && !selStash->isMainIndex)
|
||||
selStash = selStash->nextStash;
|
||||
|
||||
if (selStash == NULL)
|
||||
{
|
||||
if (!selStash->isShared && (selStash->id >= maxSelfPages)) break;
|
||||
if (selStash->isShared && (selStash->id >= maxSharedPages)) break;
|
||||
selStash = selStash->nextStash ? selStash->nextStash : addStash(ptChar, PCPY->showSharedStash);;
|
||||
selStash = PCPY->currentStash;
|
||||
while ((selStash->id+1) % nbPagesPerIndex2 != 0)
|
||||
{
|
||||
if (!selStash->isShared && (selStash->id >= maxSelfPages)) break;
|
||||
if (selStash->isShared && (selStash->id >= maxSharedPages)) break;
|
||||
selStash = selStash->nextStash ? selStash->nextStash : addStash(ptChar, PCPY->showSharedStash, true, selStash);
|
||||
}
|
||||
}
|
||||
if (selStash && (selStash != PCPY->currentStash))
|
||||
selectStash(ptChar, selStash);
|
||||
}
|
||||
|
||||
|
||||
WCHAR* getDefaultStashName(Unit* ptChar)
|
||||
{
|
||||
if (!autoRenameStashPage)
|
||||
return getLocalString( PCPY->currentStash->isShared ? STR_SHARED_PAGE_NUMBER : STR_PERSONAL_PAGE_NUMBER);
|
||||
|
||||
int onlyOneUnique = -1;
|
||||
int uniqueNameIndex = -1;
|
||||
int onlyOneSet = -1;
|
||||
int setNameIndex = -1;
|
||||
int onlyOneMisc = -1;
|
||||
int miscNameIndex = -1;
|
||||
|
||||
Unit* ptItem = D2InventoryGetFirstItem(PCInventory);
|
||||
int nb = 0;
|
||||
while (ptItem)
|
||||
{
|
||||
if (D2ItemGetPage(ptItem) == 4)
|
||||
{
|
||||
if (onlyOneUnique != 0)
|
||||
{
|
||||
if (ptItem->ptItemData->quality != ITEMQUALITY_UNIQUE)
|
||||
{
|
||||
onlyOneUnique = 0;
|
||||
uniqueNameIndex = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int uniqueId = D2GetUniqueID(ptItem);
|
||||
UniqueItemsBIN* uniqueBIN = SgptDataTables->uniqueItems + uniqueId;
|
||||
if (onlyOneUnique < 0)
|
||||
{
|
||||
onlyOneUnique = 1;
|
||||
uniqueNameIndex = uniqueBIN->uniqueNameId;
|
||||
}
|
||||
else if (setNameIndex != uniqueBIN->uniqueNameId)
|
||||
{
|
||||
onlyOneUnique = 0;
|
||||
uniqueNameIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (onlyOneSet != 0)
|
||||
{
|
||||
if (ptItem->ptItemData->quality != ITEMQUALITY_SET)
|
||||
{
|
||||
onlyOneSet = 0;
|
||||
setNameIndex = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int uniqueID = ptItem->ptItemData->uniqueID;
|
||||
SetItemsBIN* itemBIN = &SgptDataTables->setItems[uniqueID];
|
||||
SetsBIN* setBIN = &SgptDataTables->sets[itemBIN->setId];
|
||||
|
||||
if (onlyOneSet < 0)
|
||||
{
|
||||
onlyOneSet = 1;
|
||||
setNameIndex = setBIN->setNameIndex;
|
||||
}
|
||||
else if (setNameIndex != setBIN->setNameIndex)
|
||||
{
|
||||
onlyOneSet = 0;
|
||||
setNameIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (onlyOneMisc != 0)
|
||||
{
|
||||
if (ptItem->ptItemData->quality != ITEMQUALITY_NORMAL)
|
||||
{
|
||||
onlyOneMisc = 0;
|
||||
miscNameIndex = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemsBIN* ptItemsBin = D2GetItemsBIN(ptItem->nTxtFileNo);
|
||||
if (onlyOneMisc < 0)
|
||||
{
|
||||
onlyOneMisc = 1;
|
||||
miscNameIndex = ptItemsBin->NameStr;
|
||||
}
|
||||
else if (miscNameIndex != ptItemsBin->NameStr)
|
||||
{
|
||||
onlyOneMisc = 0;
|
||||
miscNameIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ptItem = D2UnitGetNextItem(ptItem);
|
||||
}
|
||||
|
||||
if (onlyOneUnique == 1 && uniqueNameIndex >= 0)
|
||||
return StripGender(D2GetStringFromIndex(uniqueNameIndex));
|
||||
if (onlyOneSet == 1 && setNameIndex >= 0)
|
||||
return StripGender(D2GetStringFromIndex(setNameIndex));
|
||||
if (onlyOneMisc == 1 && miscNameIndex >= 0)
|
||||
return StripGender(D2GetStringFromIndex(miscNameIndex));
|
||||
|
||||
return getLocalString( PCPY->currentStash->isShared ? STR_SHARED_PAGE_NUMBER : STR_PERSONAL_PAGE_NUMBER);
|
||||
}
|
||||
|
||||
void getCurrentStashName(WCHAR* buffer, DWORD maxSize, Unit* ptChar)
|
||||
{
|
||||
if (PCPY->currentStash->name && PCPY->currentStash->name[0])
|
||||
{
|
||||
mbstowcs(buffer, PCPY->currentStash->name, maxSize - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
wcsncpy(buffer, getDefaultStashName(ptChar), maxSize - 1);;
|
||||
}
|
||||
buffer[20] = NULL;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
Stash* curStash2;
|
||||
DWORD currentSawStash2;
|
||||
@ -583,7 +919,7 @@ DWORD STDCALL carry1Limit(Unit* ptChar, Unit* ptItemParam, DWORD itemNum, BYTE p
|
||||
{
|
||||
if (!ptChar) return 0;
|
||||
Unit* ptItem = ptItemParam ? ptItemParam : D2GameGetObject(PCGame, UNIT_ITEM, itemNum);
|
||||
if ((page != 4) && (D2GetItemQuality(ptItem) == 7) && ptChar)
|
||||
if ((page != 4) && (D2GetItemQuality(ptItem) == ITEMQUALITY_UNIQUE) && ptChar)
|
||||
{
|
||||
int uniqueID = D2GetUniqueID(ptItem);
|
||||
if ((uniqueID>=0) && (uniqueID < (int)SgptDataTables->nbUniqueItems))
|
||||
@ -601,6 +937,26 @@ DWORD STDCALL carry1Limit(Unit* ptChar, Unit* ptItemParam, DWORD itemNum, BYTE p
|
||||
return 0;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_carry1Limit_114 )
|
||||
PUSH DWORD PTR SS:[ESP+0x08]//page
|
||||
PUSH 0//EDI
|
||||
PUSH DWORD PTR SS:[ESP+0x0C]
|
||||
PUSH ESI//ptChar
|
||||
CALL carry1Limit
|
||||
TEST EAX,EAX
|
||||
JNZ end_carry1Limit
|
||||
JMP D2ItemSetPage
|
||||
end_carry1Limit:
|
||||
ADD ESP,0xC
|
||||
XOR EAX,EAX
|
||||
POP EDI
|
||||
POP EBX
|
||||
POP ESI
|
||||
MOV ESP,EBP
|
||||
POP EBP
|
||||
RETN 8
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_carry1Limit_111 )
|
||||
PUSH DWORD PTR SS:[ESP+0x08]//page
|
||||
PUSH 0//EDI
|
||||
@ -640,6 +996,26 @@ end_carry1Limit:
|
||||
RETN 8
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_carry1LimitSwap_114 )
|
||||
PUSH EAX
|
||||
PUSH DWORD PTR SS:[ESP+0x20]
|
||||
PUSH 0
|
||||
PUSH EDI//ptChar
|
||||
CALL carry1Limit
|
||||
TEST EAX,EAX
|
||||
JNZ end_carry1Limit
|
||||
JMP D2ItemGetPage
|
||||
end_carry1Limit:
|
||||
ADD ESP,8
|
||||
XOR EAX,EAX
|
||||
POP EBX
|
||||
POP EDI
|
||||
POP ESI
|
||||
MOV ESP, EBP
|
||||
POP EBP
|
||||
RETN 8
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_carry1LimitSwap_112 )
|
||||
PUSH EAX
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
@ -717,6 +1093,20 @@ END_carry1LimitWhenDrop:
|
||||
RETN
|
||||
}}*/
|
||||
|
||||
FCT_ASM ( caller_carry1LimitWhenDrop_114 )
|
||||
PUSH 0
|
||||
PUSH 0
|
||||
PUSH DWORD PTR SS:[ESP+0x10] //ptItem
|
||||
PUSH EBX //ptChar
|
||||
CALL carry1Limit
|
||||
TEST EAX,EAX
|
||||
JNZ end_carry1Limit
|
||||
JMP D2CanPutItemInInv
|
||||
end_carry1Limit:
|
||||
XOR EAX,EAX
|
||||
RETN 0x1C
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_carry1LimitWhenDrop_111 )
|
||||
PUSH 0
|
||||
PUSH 0
|
||||
@ -762,6 +1152,20 @@ END_carry1LimitWhenDrop:
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_carry1OutOfStash_114 )
|
||||
PUSH ESI
|
||||
CALL D2ItemGetPage
|
||||
CMP AL,4
|
||||
JNZ continue_carry1OutOfStash
|
||||
//SUB DWORD PTR SS:[ESP],0xC
|
||||
ADD DWORD PTR SS:[ESP],0x17D
|
||||
RETN
|
||||
continue_carry1OutOfStash:
|
||||
MOV EDI,DWORD PTR SS:[EBP-4]
|
||||
TEST EDI,EDI
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_carry1OutOfStash_111 )
|
||||
PUSH EDI
|
||||
CALL D2ItemGetPage
|
||||
@ -804,45 +1208,51 @@ void Install_MultiPageStash()
|
||||
log_msg("Patch D2Game for carry1 unique item. (MultiPageStash)\n");
|
||||
|
||||
// Cannot put 2 items carry1 in inventory
|
||||
mem_seek R7(D2Game, 0000, 0000, 55050, 57CA3, 2FE63, 99B03, CF1E3);
|
||||
MEMJ_REF4( D2ItemSetPage , version_D2Game >= V111 ? caller_carry1Limit_111 : caller_carry1Limit);
|
||||
mem_seek R8(D2Game, 0000, 0000, 55050, 57CA3, 2FE63, 99B03, CF1E3, 6B013, 14AC7F);
|
||||
MEMJ_REF4( D2ItemSetPage , version_D2Game >= V114d ? caller_carry1Limit_114 : version_D2Game >= V111 ? caller_carry1Limit_111 : caller_carry1Limit);
|
||||
//6FC8504F . E8 94670900 CALL <JMP.&D2Common.#10720>
|
||||
//01FD7CA2 . E8 6329FBFF CALL <JMP.&D2Common.#10485>
|
||||
//01F9FE62 . E8 47A8FDFF CALL <JMP.&D2Common.#10608>
|
||||
//6FCB9B02 . E8 9709F7FF CALL <JMP.&D2Common.#10223>
|
||||
//6FCEF1E2 . E8 47B7F3FF CALL <JMP.&D2Common.#10012>
|
||||
//6FC8B012 . E8 13F7F9FF CALL <JMP.&D2Common.#11026>
|
||||
//0054AC7E |. E8 FDD50D00 CALL Game.00628280 ; \Game.00628280
|
||||
|
||||
// Cannot put 2 items carry1 in inventory by swapping
|
||||
mem_seek R7(D2Game, 0000, 0000, 558D9, 58968, 310E8, 9B6E8, D10C8);
|
||||
MEMJ_REF4( D2ItemGetPage , version_D2Game >= V112 ? caller_carry1LimitSwap_112 : version_D2Game >= V111 ? caller_carry1LimitSwap_111 : caller_carry1LimitSwap);
|
||||
mem_seek R8(D2Game, 0000, 0000, 558D9, 58968, 310E8, 9B6E8, D10C8, 6BC78, 14B179);
|
||||
MEMJ_REF4( D2ItemGetPage , version_D2Game >= V114d ? caller_carry1LimitSwap_114 : version_D2Game >= V112 ? caller_carry1LimitSwap_112 : version_D2Game >= V111 ? caller_carry1LimitSwap_111 : caller_carry1LimitSwap);
|
||||
//6FC858D8 . E8 175F0900 CALL <JMP.&D2Common.#10719>
|
||||
//01FD8967 . E8 8E1DFBFF CALL <JMP.&D2Common.#10820>
|
||||
//01FA10E7 . E8 9A96FDFF CALL <JMP.&D2Common.#10505>
|
||||
//6FCBB6E7 . E8 CAEDF6FF CALL <JMP.&D2Common.#10370>
|
||||
//6FCF10C7 . E8 F895F3FF CALL <JMP.&D2Common.#10020>
|
||||
//6FC8BC77 . E8 22E9F9FF CALL <JMP.&D2Common.#10810>
|
||||
//0054B178 |. E8 D3D00D00 CALL Game.00628250 ; \Game.00628250
|
||||
|
||||
if ( version_D2Game >= V111 )
|
||||
{
|
||||
// Cannot put 2 items carry1 in inventory when drop cube
|
||||
mem_seek R7(D2Game, 0000, 0000, 0000, 3D935, 49FD5, 17AD5, D7B75);
|
||||
MEMJ_REF4( D2CanPutItemInInv , caller_carry1LimitWhenDrop_111);
|
||||
mem_seek R8(D2Game, 0000, 0000, 0000, 3D935, 49FD5, 17AD5, D7B75, B7B15, 163A89);
|
||||
MEMJ_REF4( D2CanPutItemInInv , version_D2Game >= V114d ? caller_carry1LimitWhenDrop_114 : caller_carry1LimitWhenDrop_111);
|
||||
//01FBD934 |. E8 5BD3FCFF |CALL <JMP.&D2Common.#10855>
|
||||
//01FB9FD4 |. E8 3912FCFF |CALL <JMP.&D2Common.#10813>
|
||||
//6FC37AD4 |. E8 0535FFFF |CALL <JMP.&D2Common.#10289>
|
||||
//6FCF7B74 |. E8 232FF3FF |CALL <JMP.&D2Common.#10133>
|
||||
//6FCD7B14 |. E8 7D32F5FF |CALL <JMP.&D2Common.#10402>
|
||||
//00563A88 . E8 C37E0D00 CALL Game.0063B950 ; \Game.0063B950
|
||||
} else {
|
||||
// Cannot put 2 items carry1 in inventory when drop cube
|
||||
mem_seek R7(D2Game, 0000, 0000, 14341, 0000, 0000, 0000, 0000);
|
||||
mem_seek R8(D2Game, 0000, 0000, 14341, 0000, 0000, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0xBA ,0xE8);
|
||||
MEMT_REF4( 0x00000806 , caller_carry1LimitWhenDrop);
|
||||
//6FC44341 |. BA 06080000 |MOV EDX,806
|
||||
}
|
||||
|
||||
// Verif only carry1 out of stash page when pick up an item
|
||||
mem_seek R7(D2Game, 0000, 0000, 1299E, 38E3B, 43F0B, 1209B, D211B);
|
||||
mem_seek R8(D2Game, 0000, 0000, 1299E, 38E3B, 43F0B, 1209B, D211B, B301B, 15CADD);
|
||||
memt_byte( 0x8B ,0xE8);
|
||||
MEMT_REF4( version_D2Game >= V111 ? 0x850C2474 : 0x85102444 , version_D2Game >= V111 ? caller_carry1OutOfStash_111 : caller_carry1OutOfStash);
|
||||
memt_byte( version_D2Game >= V111 ? 0xF6 : 0xC0 ,0x90);
|
||||
MEMT_REF4( version_D2Game >= V114d ? 0xFF85FC7D : version_D2Game >= V111 ? 0x850C2474 : 0x85102444 , version_D2Game >= V114d ? caller_carry1OutOfStash_114 : version_D2Game >= V111 ? caller_carry1OutOfStash_111 : caller_carry1OutOfStash);
|
||||
if (version_D2Game < V114d) memt_byte( version_D2Game >= V111 ? 0xF6 : 0xC0 ,0x90);
|
||||
//6FC4299E |. 8B4424 10 |MOV EAX,DWORD PTR SS:[ESP+10]
|
||||
//6FC429A2 |. 85C0 |TEST EAX,EAX
|
||||
//01FB8E3B |. 8B7424 0C |MOV ESI,DWORD PTR SS:[ESP+C]
|
||||
@ -853,6 +1263,10 @@ void Install_MultiPageStash()
|
||||
//6FC3209F |. 85F6 |TEST ESI,ESI
|
||||
//6FCF211B |. 8B7424 0C |MOV ESI,DWORD PTR SS:[ESP+C]
|
||||
//6FCF211F |. 85F6 |TEST ESI,ESI
|
||||
//6FCD301B |. 8B7424 0C |MOV ESI,DWORD PTR SS:[ESP+C]
|
||||
//6FCD301F |. 85F6 |TEST ESI,ESI
|
||||
//0055CADD |> 8B7D FC |MOV EDI,DWORD PTR SS:[EBP-4]
|
||||
//0055CAE0 |. 85FF |TEST EDI,EDI
|
||||
|
||||
log_msg("\n");
|
||||
}
|
||||
|
@ -1,22 +1,22 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Interface functions
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "updateServer.h" // Install_UpdateServer()
|
||||
#include "plugYFiles.h" // Install_PlugYImagesFiles()
|
||||
#include "skillsPoints.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int posXUnassignSkillBtn=-1;
|
||||
int posYUnassignSkillBtn=-1;
|
||||
|
||||
DWORD btnSkillIsDown;
|
||||
DWORD btnSkillIsDown=0;
|
||||
DWORD getXSkillBtn() {return RX(posXUnassignSkillBtn<0? 0x243 : posXUnassignSkillBtn);}
|
||||
#define getLSkillBtn() 32
|
||||
DWORD getYSkillBtn() {return RY(posYUnassignSkillBtn<0 ? 0x1B1 : posYUnassignSkillBtn);}
|
||||
@ -36,7 +36,7 @@ void STDCALL printSkillsPageBtns()
|
||||
|
||||
if ( isOnButtonUnassignSkill(D2GetMouseX(),D2GetMouseY()))
|
||||
{
|
||||
LPWSTR popupText = getTranslatedString(STR_SKILLS_UNASSIGN);
|
||||
LPWSTR popupText = getLocalString(STR_SKILLS_UNASSIGN);
|
||||
D2PrintPopup(popupText, getXSkillBtn()+getLSkillBtn()/2, getYSkillBtn()-getHSkillBtn(), 0, 1);
|
||||
}
|
||||
}
|
||||
@ -46,12 +46,13 @@ Unit* STDCALL skillsPageMouseDown(sWinMessage* msg)
|
||||
{
|
||||
Unit* ptChar = D2GetClientPlayer();
|
||||
|
||||
if ( active_SkillsPoints && !onRealm && D2isLODGame() && isOnButtonUnassignSkill(D2GetMouseX(),D2GetMouseY()))
|
||||
if (active_SkillsPoints && !onRealm && D2isLODGame() && isOnButtonUnassignSkill(D2GetMouseX(),D2GetMouseY()))
|
||||
{
|
||||
log_msg("push down left button unassign skill\n");
|
||||
btnSkillIsDown = 1;
|
||||
//btnSkillIsDown = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
freeMessage(msg);
|
||||
updateServer(US_UNASSIGN_SKILLS);
|
||||
return NULL;
|
||||
}
|
||||
return ptChar;
|
||||
@ -60,10 +61,10 @@ Unit* STDCALL skillsPageMouseDown(sWinMessage* msg)
|
||||
|
||||
void STDCALL skillsPageMouseUp()
|
||||
{
|
||||
if ( active_SkillsPoints && !onRealm && D2isLODGame() && isOnButtonUnassignSkill(D2GetMouseX(),D2GetMouseY()))
|
||||
if (active_SkillsPoints && !onRealm && D2isLODGame() && isOnButtonUnassignSkill(D2GetMouseX(),D2GetMouseY()))
|
||||
{
|
||||
log_msg("push up left button unassign skill\n");
|
||||
if (btnSkillIsDown)
|
||||
if (btnSkillIsDown)
|
||||
updateServer(US_UNASSIGN_SKILLS);
|
||||
}
|
||||
btnSkillIsDown = 0;
|
||||
@ -89,6 +90,17 @@ FCT_ASM ( caller_printSkillsPageBtns )
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_DontPrintSkillPointsRemaining_114 )
|
||||
MOV AL,BYTE PTR DS:[onRealm]
|
||||
TEST AL,AL
|
||||
JNZ dontPrint
|
||||
ADD DWORD PTR SS:[ESP],0x97
|
||||
RETN
|
||||
dontPrint:
|
||||
MOV ECX,0x1083
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_DontPrintSkillPointsRemaining_111 )
|
||||
MOV AL,BYTE PTR DS:[onRealm]
|
||||
TEST AL,AL
|
||||
@ -111,6 +123,12 @@ dontPrint:
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_skillsPageMouseDown_114 )
|
||||
PUSH ESI
|
||||
CALL skillsPageMouseDown
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_skillsPageMouseDown_111 )
|
||||
PUSH EBP
|
||||
CALL skillsPageMouseDown
|
||||
@ -140,7 +158,7 @@ void Install_InterfaceSkills()
|
||||
log_msg("Patch D2Client for skills interface. (InterfaceSkills)\n");
|
||||
|
||||
// Print new buttons images
|
||||
mem_seek R7(D2Client, 7AC20, 7AC20, 77073, 16190, 8A9C0, 7F320, 77F20);
|
||||
mem_seek R8(D2Client, 7AC20, 7AC20, 77073, 16190, 8A9C0, 7F320, 77F20, 2F380, AB7A5);
|
||||
memt_byte( 0x5F, 0xE9 ); // JMP caller_printBtns
|
||||
if ( version_D2Client >= V111 ) {
|
||||
MEMT_REF4( 0xCCC35B5E, caller_printSkillsPageBtns_111);
|
||||
@ -164,6 +182,16 @@ void Install_InterfaceSkills()
|
||||
//6FB27F22 |. 5B POP EBX
|
||||
//6FB27F23 \. C3 RETN
|
||||
//6FB27F24 CC INT3
|
||||
//6FADF380 |> 5F POP EDI
|
||||
//6FADF381 |. 5E POP ESI
|
||||
//6FADF382 |. 5B POP EBX
|
||||
//6FADF383 \. C3 RETN
|
||||
//6FADF384 CC INT3
|
||||
//004AB7A5 |> 5F POP EDI
|
||||
//004AB7A6 |. 5E POP ESI
|
||||
//004AB7A7 |. 5B POP EBX
|
||||
//004AB7A8 \. C3 RETN
|
||||
//004AB7A9 CC INT3
|
||||
} else {
|
||||
MEMT_REF4( 0x835B5D5E, caller_printSkillsPageBtns);
|
||||
memt_byte( 0xC4, 0x90 ); // NOP
|
||||
@ -180,36 +208,44 @@ void Install_InterfaceSkills()
|
||||
if (posXUnassignSkillBtn==-1 && posYUnassignSkillBtn==-1)
|
||||
{
|
||||
// Don't print "Skill Points Remaining"
|
||||
mem_seek R7(D2Client, 7AC30, 7AC30, 77080, 16294, 8AC74, 7ECF4, 78334);
|
||||
mem_seek R8(D2Client, 7AC30, 7AC30, 77080, 16294, 8AC74, 7ECF4, 78334, 2F7E4, AACE0);
|
||||
memt_byte( 0xB9, 0xE8 );
|
||||
MEMT_REF4( 0x00001083, version_D2Client >= V111 ? caller_DontPrintSkillPointsRemaining_111 : caller_DontPrintSkillPointsRemaining);
|
||||
MEMT_REF4( 0x00001083, version_D2Client >= V114d ? caller_DontPrintSkillPointsRemaining_114 : version_D2Client >= V111 ? caller_DontPrintSkillPointsRemaining_111 : caller_DontPrintSkillPointsRemaining);
|
||||
//6FB17080 /$ B9 83100000 MOV ECX,1083
|
||||
//6FAC6294 |. B9 83100000 MOV ECX,1083
|
||||
//6FB3AC74 |. B9 83100000 MOV ECX,1083
|
||||
//6FB2ECF4 |. B9 83100000 MOV ECX,1083
|
||||
//6FB28334 |. B9 83100000 MOV ECX,1083
|
||||
//6FADF7E4 |. B9 83100000 MOV ECX,1083
|
||||
//004AACE0 /$ B9 83100000 MOV ECX,1083
|
||||
}
|
||||
|
||||
// Manage mouse down (Play sound)
|
||||
mem_seek R7(D2Client, 7BBD1, 7BBD1, 780E4, 17BC2, 8C6E2, 808B2, 79C62);
|
||||
mem_seek R8(D2Client, 7BBD1, 7BBD1, 780E4, 17BC2, 8C6E2, 808B2, 79C62, 31112, ABC1A);
|
||||
memt_byte( 0xC7, 0xE8 ); // CALL caller_skillsPageMouseDown
|
||||
MEMT_REF4( version_D2Client >= V111 ? 0x00001845 : 0x00001843, version_D2Client >= V111 ? caller_skillsPageMouseDown_111 : caller_skillsPageMouseDown);
|
||||
MEMT_REF4( version_D2Client >= V114d ? 0x00001846 : version_D2Client >= V111 ? 0x00001845 : 0x00001843, version_D2Client == V114d ? caller_skillsPageMouseDown_114 : version_D2Client >= V111 ? caller_skillsPageMouseDown_111 : caller_skillsPageMouseDown);
|
||||
memt_byte( 0x00, 0x90 ); // NOP
|
||||
memt_byte( 0x00, 0x90 ); // NOP
|
||||
//6FB180E4 > C743 18 00000000 MOV DWORD PTR DS:[EBX+18],0
|
||||
//6FAC7BC2 > C745 18 00000000 MOV DWORD PTR SS:[EBP+18],0
|
||||
//6FB3C6E2 > C745 18 00000000 MOV DWORD PTR SS:[EBP+18],0
|
||||
//6FB308B2 > C745 18 000000>MOV DWORD PTR SS:[EBP+18],0
|
||||
//6FB29C62 > C745 18 000000>MOV DWORD PTR SS:[EBP+18],0
|
||||
//6FB308B2 > C745 18 00000000 MOV DWORD PTR SS:[EBP+18],0
|
||||
//6FB29C62 > C745 18 00000000 MOV DWORD PTR SS:[EBP+18],0
|
||||
//6FAE1112 > C745 18 00000000 MOV DWORD PTR SS:[EBP+18],0
|
||||
//004ABC1A |> C746 18 00000000 MOV DWORD PTR DS:[ESI+18],0
|
||||
|
||||
/* Conflicts with D2ExpRes
|
||||
// Manage mouse up
|
||||
mem_seek R7(D2Client, 7BC40, 7BC40, 78466, 17558, 8C078, 80248, 795F8);
|
||||
mem_seek R8(D2Client, 7BC40, 7BC40, 78466, 17558, 8C078, 80248, 795F8, 30AA8, ABC96);
|
||||
MEMJ_REF4( D2FreeWinMessage, caller_skillsPageMouseUp);//0xFFF93B0A
|
||||
//6FB18465 . E8 C07D0400 CALL <JMP.&Storm.#511>
|
||||
//6FAC7557 .^E9 4248FFFF JMP <JMP.&Storm.#511>
|
||||
//6FB3C077 .^E9 16FDF7FF JMP <JMP.&Storm.#511>
|
||||
//6FB30247 .^E9 2CBCF8FF JMP <JMP.&Storm.#511>
|
||||
//6FB295F7 .^E9 8828F9FF JMP <JMP.&Storm.#511>
|
||||
//6FAE0AA7 .^E9 E0B2FDFF JMP <JMP.&Storm.#511>
|
||||
//004ABC95 |. E8 F645F7FF CALL Game.00420290
|
||||
*/
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,19 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Interface functions
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "plugYFiles.h" // Install_PlugYImagesFiles()
|
||||
#include "statsPoints.h"
|
||||
#include "plugYFiles.h" // Install_PlugYImagesFiles()
|
||||
#include "newInterfaces.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
static struct
|
||||
{
|
||||
union{
|
||||
@ -35,6 +36,7 @@ static struct
|
||||
#define getYNextPageBtn() RY(D2GetResolution()?0x40:0x70)
|
||||
#define getHNextPageBtn() 32
|
||||
#define isOnNextPageBtn(x,y) isOnRect(x, y, getXNextPageBtn(), getYNextPageBtn(), getLNextPageBtn(), getHNextPageBtn())
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -49,7 +51,7 @@ void STDCALL printStatsPageBtns()
|
||||
sDrawImageInfo data;
|
||||
ZeroMemory(&data,sizeof(data));
|
||||
|
||||
if (printBackgroundOnMainPage && D2GetResolution())
|
||||
if (printBackgroundOnMainPage)
|
||||
{
|
||||
setImage(&data, statsBackgroundImages);
|
||||
setFrame(&data, 1);
|
||||
@ -57,23 +59,21 @@ void STDCALL printStatsPageBtns()
|
||||
}
|
||||
|
||||
setImage(&data, D2LoadBuySelBtn());
|
||||
if (D2GetResolution())
|
||||
{
|
||||
setFrame(&data, 12 + isDownBtn.previousPage);
|
||||
D2PrintImage(&data, getXPreviousPageBtn(), getYPreviousPageBtn(), -1, 5, 0);
|
||||
}
|
||||
setFrame(&data, 12 + isDownBtn.previousPage);
|
||||
D2PrintImage(&data, getXPreviousPageBtn(), getYPreviousPageBtn(), -1, 5, 0);
|
||||
|
||||
setFrame(&data, 14 + isDownBtn.nextPage);
|
||||
D2PrintImage(&data, getXNextPageBtn(), getYNextPageBtn(), -1, 5, 0);
|
||||
|
||||
D2SetFont(1);
|
||||
if (D2GetResolution() && isOnPreviousPageBtn(mx,my)) //print popup "previous page"
|
||||
if (isOnPreviousPageBtn(mx,my)) //print popup "previous page"
|
||||
{
|
||||
lpText = getTranslatedString(STR_PREVIOUS_PAGE);
|
||||
lpText = getLocalString(STR_PREVIOUS_PAGE);
|
||||
D2PrintPopup(lpText, getXPreviousPageBtn()+getLPreviousPageBtn()/2, getYPreviousPageBtn()-getHPreviousPageBtn(), WHITE, 1);
|
||||
}
|
||||
else if ( isOnNextPageBtn(mx,my))
|
||||
{
|
||||
lpText = getTranslatedString(STR_NEXT_PAGE);
|
||||
lpText = getLocalString(STR_NEXT_PAGE);
|
||||
D2PrintPopup(lpText, getXNextPageBtn()+getLNextPageBtn()/2, getYNextPageBtn()-getHNextPageBtn(), WHITE, 1);
|
||||
}
|
||||
}
|
||||
@ -84,6 +84,12 @@ Unit* STDCALL statsPageMouseDown(sWinMessage* msg)
|
||||
|
||||
if (!active_newInterfaces || !D2isLODGame() ) return ptChar;
|
||||
|
||||
if (statsLeftDown(msg)) {
|
||||
freeMessage(msg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
if (D2GetResolution() && isOnPreviousPageBtn(msg->x,msg->y))
|
||||
{
|
||||
log_msg("push down left button previous page\n");
|
||||
@ -100,6 +106,7 @@ Unit* STDCALL statsPageMouseDown(sWinMessage* msg)
|
||||
freeMessage(msg);
|
||||
return NULL;
|
||||
}
|
||||
*/
|
||||
return ptChar;
|
||||
}
|
||||
|
||||
@ -110,6 +117,13 @@ Unit* STDCALL statsPageMouseUp(sWinMessage* msg)
|
||||
|
||||
if (!active_newInterfaces || !D2isLODGame() ) return ptChar;
|
||||
|
||||
if (statsLeftUp(msg)) {
|
||||
isDownBtn.all=0;
|
||||
freeMessage(msg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
if (D2GetResolution() && isOnPreviousPageBtn(msg->x,msg->y))
|
||||
{
|
||||
log_msg("push up left button previous page\n");
|
||||
@ -134,11 +148,22 @@ Unit* STDCALL statsPageMouseUp(sWinMessage* msg)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
isDownBtn.all=0;
|
||||
return ptChar;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_printStatsPageBtns_114 )
|
||||
CALL printStatsPageBtns
|
||||
POP EDI
|
||||
POP ESI
|
||||
POP EBX
|
||||
MOV ESP,EBP
|
||||
POP EBP
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_printStatsPageBtns_111 )
|
||||
CALL printStatsPageBtns
|
||||
POP EDI
|
||||
@ -171,6 +196,20 @@ FCT_ASM ( caller_printStatsPageBtns_9 )
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM ( caller_statsPageMouseDown_114 )
|
||||
PUSH DWORD PTR SS:[ESP+0x18]
|
||||
CALL statsPageMouseDown
|
||||
TEST EAX,EAX
|
||||
JE fin_statsPageMouseDown
|
||||
JMP D2GetClientPlayer
|
||||
fin_statsPageMouseDown:
|
||||
ADD ESP,4
|
||||
POP EDI
|
||||
POP ESI
|
||||
POP EBX
|
||||
POP EBP
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_statsPageMouseDown_111 )
|
||||
PUSH DWORD PTR SS:[ESP+0x20]
|
||||
@ -202,6 +241,22 @@ fin_statsPageMouseDown:
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_statsPageMouseUp_114 )
|
||||
PUSH DWORD PTR SS:[EBP+0x8]
|
||||
CALL statsPageMouseUp
|
||||
TEST EAX,EAX
|
||||
JE fin_statsPageMouseUp
|
||||
JMP D2GetClientPlayer
|
||||
fin_statsPageMouseUp:
|
||||
ADD ESP,4
|
||||
POP EDI
|
||||
POP ESI
|
||||
POP EBX
|
||||
MOV ESP, EBP
|
||||
POP EBP
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_statsPageMouseUp )
|
||||
PUSH EBP
|
||||
CALL statsPageMouseUp
|
||||
@ -239,15 +294,15 @@ void Install_InterfaceStats()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
|
||||
Install_PlugYImagesFiles();
|
||||
|
||||
log_msg("Patch D2Client for stats interface. (InterfaceStats)\n");
|
||||
|
||||
// Print new buttons images
|
||||
mem_seek R7(D2Client, 2A7BE, 2A7AE, 30F86, 83636, 8A0B6, 6C016, BDC16);
|
||||
mem_seek R8(D2Client, 2A7BE, 2A7AE, 30F86, 83636, 8A0B6, 6C016, BDC16, C03B6, A8949);
|
||||
memt_byte( 0x5F, 0xE9 ); // JMP
|
||||
MEMT_REF4( 0x815B5D5E, version_D2Client >= V111 ? caller_printStatsPageBtns_111: version_D2Client == V110 ? caller_printStatsPageBtns : caller_printStatsPageBtns_9);
|
||||
MEMT_REF4( version_D2Client >= V114d ? 0xE58B5B5E : 0x815B5D5E, version_D2Client >= V114d ? caller_printStatsPageBtns_114 : version_D2Client >= V111 ? caller_printStatsPageBtns_111: version_D2Client == V110 ? caller_printStatsPageBtns : caller_printStatsPageBtns_9);
|
||||
//6FAD0F86 . 5F POP EDI
|
||||
//6FAD0F87 . 5E POP ESI
|
||||
//6FAD0F88 . 5D POP EBP
|
||||
@ -278,34 +333,58 @@ void Install_InterfaceStats()
|
||||
//6FB6DC19 |. 5B POP EBX
|
||||
//6FB6DC1A |. 81C4 70030000 ADD ESP,370
|
||||
//6FB6DC20 \. C3 RETN
|
||||
//6FB703B6 |. 5F POP EDI
|
||||
//6FB703B7 |. 5E POP ESI
|
||||
//6FB703B8 |. 5D POP EBP
|
||||
//6FB703B9 |. 5B POP EBX
|
||||
//6FB703BA |. 81C4 70030000 ADD ESP,370
|
||||
//6FB703C0 \. C3 RETN
|
||||
//004A8949 . 5F POP EDI
|
||||
//004A894A . 5E POP ESI
|
||||
//004A894B . 5B POP EBX
|
||||
//004A894C . 8BE5 MOV ESP,EBP
|
||||
|
||||
if ( version_D2Client >= V111 )
|
||||
if ( version_D2Client >= V114d )
|
||||
{
|
||||
// Manage mouse down (Play sound)
|
||||
mem_seek R7(D2Client, 2AA6D, 2AA5D, 3133D, 827C8, 89248, 6B1A8, BCDC8);
|
||||
mem_seek R8(D2Client, 2AA6D, 2AA5D, 3133D, 827C8, 89248, 6B1A8, BCDC8, BF568, A77D4);
|
||||
MEMC_REF4( D2GetClientPlayer, caller_statsPageMouseDown_114);
|
||||
//004A77D3 . E8 F8C5FBFF CALL Game.00463DD0
|
||||
|
||||
// Manage mouse up
|
||||
mem_seek R8(D2Client, 2AC43, 2AC33, 3151A, 83853, 8A2D3, 6C233, BDE33, C05D3, A7963);
|
||||
MEMC_REF4( D2GetClientPlayer, caller_statsPageMouseUp_114);
|
||||
//004A7962 |. E8 69C4FBFF CALL Game.00463DD0
|
||||
}
|
||||
else if ( version_D2Client >= V111 )
|
||||
{
|
||||
// Manage mouse down (Play sound)
|
||||
mem_seek R8(D2Client, 2AA6D, 2AA5D, 3133D, 827C8, 89248, 6B1A8, BCDC8, BF568, A77D4);
|
||||
memt_byte( 0xA1, 0xE8 );
|
||||
MEMT_REF4( ptptClientChar, caller_statsPageMouseDown);
|
||||
//6FB327C8 . A1 F0C4BC6F MOV EAX,DWORD PTR DS:[6FBCC4F0]
|
||||
//6FB39248 . A1 E0C1BC6F MOV EAX,DWORD PTR DS:[6FBCC1E0]
|
||||
//6FB1B1A8 . A1 D0C3BC6F MOV EAX,DWORD PTR DS:[6FBCC3D0]
|
||||
//6FB6CDC8 . A1 FCBBBC6F MOV EAX,DWORD PTR DS:[6FBCBBFC]
|
||||
//6FB6F568 . A1 50D0BC6F MOV EAX,DWORD PTR DS:[6FBCD050]
|
||||
|
||||
// Manage mouse up
|
||||
mem_seek R7(D2Client, 2AC43, 2AC33, 3151A, 83853, 8A2D3, 6C233, BDE33);
|
||||
mem_seek R8(D2Client, 2AC43, 2AC33, 3151A, 83853, 8A2D3, 6C233, BDE33, C05D3, A7963);
|
||||
memt_byte( 0xA1, 0xE8 );
|
||||
MEMT_REF4( ptptClientChar, caller_statsPageMouseUp);
|
||||
//6FB33853 . A1 F0C4BC6F MOV EAX,DWORD PTR DS:[6FBCC4F0]
|
||||
//6FB3A2D3 . A1 E0C1BC6F MOV EAX,DWORD PTR DS:[6FBCC1E0]
|
||||
//6FB1C233 . A1 D0C3BC6F MOV EAX,DWORD PTR DS:[6FBCC3D0]
|
||||
//6FB6DE33 . A1 FCBBBC6F MOV EAX,DWORD PTR DS:[6FBCBBFC]
|
||||
//6FB705D3 . A1 50D0BC6F MOV EAX,DWORD PTR DS:[6FBCD050]
|
||||
} else {
|
||||
// Manage mouse down (Play sound)
|
||||
mem_seek R7(D2Client, 2AA6D, 2AA5D, 3133D, 827C8, 89248, 6B1A8, 0000);
|
||||
mem_seek R8(D2Client, 2AA6D, 2AA5D, 3133D, 827C8, 89248, 6B1A8, BCDC8, BF568, A77D4);
|
||||
MEMC_REF4( D2GetClientPlayer, caller_statsPageMouseDown);
|
||||
//6FAD133C . E8 8F700500 CALL D2Client.6FB283D0
|
||||
|
||||
// Manage mouse up
|
||||
mem_seek R7(D2Client, 2AC43, 2AC33, 3151A, 83853, 8A2D3, 6C233, 0000);
|
||||
mem_seek R8(D2Client, 2AC43, 2AC33, 3151A, 83853, 8A2D3, 6C233, BDE33, C05D3, A7963);
|
||||
MEMC_REF4( D2GetClientPlayer, version_D2Client == V110 ? caller_statsPageMouseUp : caller_statsPageMouseUp_9);//0x00056EB2
|
||||
//6FAD1519 . E8 B26E0500 CALL D2Client.6FB283D0
|
||||
}
|
||||
|
@ -1,18 +1,17 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Language management.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "language.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
bool active_ChangeLanguage = true;
|
||||
bool active_ChangeLanguage = false;
|
||||
DWORD selectedLanguage = LNG_ENG;
|
||||
|
||||
bool active_LanguageManagement = false;
|
||||
@ -21,12 +20,17 @@ t_availableLanguages availableLanguages;
|
||||
|
||||
DWORD* ptCurrentLanguage;
|
||||
|
||||
DWORD STDCALL languageManagement ()
|
||||
DWORD STDCALL languageManagement()
|
||||
{
|
||||
if (active_ChangeLanguage) *ptCurrentLanguage = selectedLanguage;
|
||||
if (active_ChangeLanguage)
|
||||
*ptCurrentLanguage = selectedLanguage;
|
||||
|
||||
if (active_LanguageManagement)
|
||||
if ((*ptCurrentLanguage > LNG_RUS) || !((1 << *ptCurrentLanguage) & availableLanguages.all))
|
||||
*ptCurrentLanguage = defaultLanguage;
|
||||
{
|
||||
if ((*ptCurrentLanguage >= LNG_DEF) || !((1 << *ptCurrentLanguage) & availableLanguages.all))
|
||||
*ptCurrentLanguage = defaultLanguage;
|
||||
}
|
||||
|
||||
return *ptCurrentLanguage;
|
||||
}
|
||||
|
||||
@ -35,23 +39,24 @@ void Install_LanguageManagement()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
|
||||
log_msg("Patch D2Lang for language management. (LanguageManagement)\n");
|
||||
|
||||
ptCurrentLanguage = *(DWORD**)((DWORD)D2GetLang + (version_D2Lang >= V111 ? 0x51: 0x5C));
|
||||
ptCurrentLanguage = *(DWORD**)((DWORD)D2GetLang + (version_D2Lang == V114d ? 0x4D : version_D2Lang >= V111 ? 0x51: 0x5C));
|
||||
languageManagement();
|
||||
|
||||
// Language management
|
||||
mem_seek( (DWORD)D2GetLang + (version_D2Lang >= V111 ? 0x3E : 0x49));//6FC13E39-6FC10000
|
||||
mem_seek( (DWORD)D2GetLang + (version_D2Lang == V114d ? 0x4C : version_D2Lang >= V111 ? 0x3E : 0x49));//6FC13E39-6FC10000
|
||||
memt_byte( 0xA1 , 0xE8);
|
||||
MEMT_REF4( ptCurrentLanguage, languageManagement);
|
||||
//6FC13E39 |. A1 EC0CC26F MOV EAX,DWORD PTR DS:[6FC20CEC]
|
||||
//003D91FE |. A1 1C0A3E00 MOV EAX,DWORD PTR DS:[3E0A1C]
|
||||
//003DA0AE |. A1 1C0A3E00 MOV EAX,DWORD PTR DS:[3E0A1C]
|
||||
//0052519C |> A1 EC298800 MOV EAX,DWORD PTR DS:[8829EC]
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
isInstalled = true;
|
||||
}
|
||||
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,16 +1,16 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Load Player Custom Data.
|
||||
Load Player Custom Data.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "infinityStash.h"
|
||||
#include "extendedSaveFile.h"
|
||||
#include "sharedSaveFile.h"
|
||||
#include "common.h"
|
||||
|
||||
|
||||
/************************************ LOADING ***********************************/
|
||||
@ -21,6 +21,8 @@ DWORD STDCALL LoadSPCustomData(Unit* ptChar)
|
||||
BYTE* data;
|
||||
|
||||
log_msg("--- Start LoadSPCustomData ---\n");
|
||||
active_sharedStash = active_SharedStashInMultiPlayer > 0;
|
||||
log_msg("active_sharedStash = %d : %d\n\n", active_sharedStash);
|
||||
|
||||
if (!ptChar)
|
||||
{log_msg("LoadSPCustomData : ptChar == NULL\n");return 0x1B;}//Unknow failure
|
||||
@ -38,7 +40,7 @@ DWORD STDCALL LoadSPCustomData(Unit* ptChar)
|
||||
data = readExtendedSaveFile(PCPlayerData->name, &size);
|
||||
ret = loadExtendedSaveFile(ptChar, data, size);
|
||||
D2FogMemDeAlloc(data,__FILE__,__LINE__,0);
|
||||
if (!ret)
|
||||
if (!ret && active_sharedStash)
|
||||
{
|
||||
data = readSharedSaveFile(PCPlayerData->name, &size);
|
||||
ret = loadSharedSaveFile(ptChar, data, size);
|
||||
@ -52,6 +54,20 @@ DWORD STDCALL LoadSPCustomData(Unit* ptChar)
|
||||
return ret;
|
||||
}
|
||||
|
||||
FCT_ASM (caller_LoadSPPlayerCustomData_114 )
|
||||
MOV EDI,EAX
|
||||
TEST EDI,EDI
|
||||
JNZ JMP_LoadSPPlayerCustomData
|
||||
PUSH DWORD PTR SS:[ESP+0x1C]
|
||||
CALL LoadSPCustomData
|
||||
MOV EDI,EAX
|
||||
TEST EDI,EDI
|
||||
JNZ JMP_LoadSPPlayerCustomData
|
||||
RETN
|
||||
JMP_LoadSPPlayerCustomData:
|
||||
ADD DWORD PTR SS:[ESP],0x14
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM (caller_LoadSPPlayerCustomData )
|
||||
MOV ESI,EAX
|
||||
@ -93,12 +109,12 @@ return value :
|
||||
13:Unable to enter game, a normal character cannot join a game create an harcore character.
|
||||
14:Unable to enter game, an harcore character cannot join a game create by a normal character.
|
||||
15:A dead character cannot join or create any game
|
||||
16:unknow failure
|
||||
16:unknown failure
|
||||
17:Unable to enter game. A D2 Character cannot join an expansion character
|
||||
18:Expansion cannot join D2
|
||||
19:Failures to join game
|
||||
1A:Unable to enter game
|
||||
1B:unknow failure
|
||||
1B:unknown failure
|
||||
*/
|
||||
enum {
|
||||
TS_SAVE_PERSONAL=0,
|
||||
@ -173,31 +189,31 @@ void sendData(BYTE* data, DWORD size, bool isShared)
|
||||
log_msg("\n");
|
||||
}
|
||||
|
||||
static DWORD sizeExtended;
|
||||
static BYTE* dataExtended;
|
||||
static DWORD sizeShared;
|
||||
static BYTE* dataShared;
|
||||
|
||||
void FASTCALL SendSaveFiles (char* ptPath, DWORD maxsize, char* name)
|
||||
{
|
||||
// DWORD size;
|
||||
// BYTE* data;
|
||||
|
||||
D2FogGetSavePath(ptPath,maxsize);
|
||||
|
||||
log_msg("\n--- Start SendSaveFiles ---\n");
|
||||
active_sharedStash = active_SharedStashInMultiPlayer == 2;
|
||||
log_msg("active_sharedStash = %d : %d\n\n", active_sharedStash);
|
||||
|
||||
// Send Extended Save File
|
||||
log_msg("Send Extended Save File\n");
|
||||
dataExtended = readExtendedSaveFile(name, &sizeExtended);
|
||||
DWORD sizeExtended = 0;
|
||||
BYTE* dataExtended = readExtendedSaveFile(name, &sizeExtended);
|
||||
sendData(dataExtended, sizeExtended, false);
|
||||
D2FogMemDeAlloc(dataExtended,__FILE__,__LINE__,0);
|
||||
|
||||
// Send Shared Save File
|
||||
log_msg("Send Shared Save File\n");
|
||||
dataShared = readSharedSaveFile(name, &sizeShared);
|
||||
sendData(dataShared, sizeShared, true);
|
||||
D2FogMemDeAlloc(dataShared,__FILE__,__LINE__,0);
|
||||
//if (active_sharedStash)
|
||||
{
|
||||
log_msg("Send Shared Save File\n");
|
||||
DWORD sizeShared = 0;
|
||||
BYTE* dataShared = readSharedSaveFile(name, &sizeShared);
|
||||
sendData(dataShared, sizeShared, true);
|
||||
D2FogMemDeAlloc(dataShared,__FILE__,__LINE__,0);
|
||||
}
|
||||
|
||||
// Ending load
|
||||
log_msg("End SendSaveFiles.\n\n");
|
||||
@ -210,6 +226,8 @@ DWORD STDCALL ReceiveSaveFiles (DWORD clientID, t_rcvMsg* msg)
|
||||
if( (msg->packID != customPackID) || !msg->isCustom) return msg->packID;
|
||||
|
||||
log_msg("Loading Receive Packet: clientID=%d\t type=%X\t finalSize=%X\t packSize=%02X\t data=%08X\n", clientID, msg->type, msg->finalSize, msg->packSize, msg->data);
|
||||
active_sharedStash = active_SharedStashInMultiPlayer == 2;
|
||||
log_msg("active_sharedStash = %d : %d\n\n", active_sharedStash);
|
||||
|
||||
bool isShared;
|
||||
|
||||
@ -298,6 +316,8 @@ int STDCALL ReceiveSaveFiles_9(DWORD clientID, SOCKET s, char *buf, int len, int
|
||||
DWORD STDCALL LoadMPCustomData(Unit* ptChar)
|
||||
{
|
||||
log_msg("Start LoadMPCustomData\n");
|
||||
active_sharedStash = active_SharedStashInMultiPlayer == 2;
|
||||
log_msg("active_sharedStash = %d : %d\n\n", active_sharedStash);
|
||||
|
||||
if (!ptChar) return NULL;
|
||||
if (!ptChar)
|
||||
@ -338,7 +358,7 @@ DWORD STDCALL LoadMPCustomData(Unit* ptChar)
|
||||
log_msg("is LOD Game\n");
|
||||
if (!ret)
|
||||
ret = loadExtendedSaveFile(ptChar, curSF->dataExtended, curSF->sizeExtended);
|
||||
if (!ret)
|
||||
if (!ret && active_sharedStash)
|
||||
ret = loadSharedSaveFile(ptChar, curSF->dataShared, curSF->sizeShared);
|
||||
} else {
|
||||
log_msg("is not LOD Game\n");
|
||||
@ -351,6 +371,20 @@ DWORD STDCALL LoadMPCustomData(Unit* ptChar)
|
||||
return ret;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_LoadMPPlayerCustomData_114 )
|
||||
PUSH DWORD PTR SS:[EDI]
|
||||
CALL LoadMPCustomData
|
||||
TEST EAX,EAX
|
||||
JNZ JMP_LoadMPlayerCustomData
|
||||
CMP DWORD PTR DS:[EDI],0
|
||||
JNZ Continue_LoadMP
|
||||
ADD DWORD PTR SS:[ESP],0x1D
|
||||
Continue_LoadMP:
|
||||
RETN
|
||||
JMP_LoadMPlayerCustomData:
|
||||
SUB DWORD PTR SS:[ESP],0x10
|
||||
RETN
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM ( caller_LoadMPPlayerCustomData_111 )
|
||||
@ -414,6 +448,18 @@ FCT_ASM ( caller_SendSaveFiles )
|
||||
JMP SendSaveFiles
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_ReceiveSaveFiles_114 )
|
||||
PUSH ECX
|
||||
PUSH EDX
|
||||
LEA EBX,DWORD PTR DS:[ESI+4]
|
||||
PUSH EBX //Message
|
||||
MOV EBX,DWORD PTR SS:[ESI]
|
||||
PUSH EBX //ID client
|
||||
CALL ReceiveSaveFiles
|
||||
POP EDX
|
||||
POP ECX
|
||||
RETN
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM ( caller_ReceiveSaveFiles_111 )
|
||||
@ -471,15 +517,15 @@ go_to_default:
|
||||
void Install_LoadPlayerData()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled || !active_PlayerCustomData) return;
|
||||
if (isInstalled) return;
|
||||
|
||||
log_msg("Patch D2Game & D2Client for load Player's custom data. (LoadPlayerData)\n");
|
||||
|
||||
// Load SP player custom data.
|
||||
mem_seek R7(D2Game, 5046F, 5086F, 5CB0F, BB8ED, 278CD, 465BD, 5638D);
|
||||
mem_seek R8(D2Game, 5046F, 5086F, 5CB0F, BB8ED, 278CD, 465BD, 5638D, 3BCCD, 13447A);
|
||||
memt_byte( 0x8B, 0xE8); // CALL caller_LoadSPPlayerCustomData
|
||||
MEMT_REF4( 0x75F685F0 , caller_LoadSPPlayerCustomData);
|
||||
memt_byte( 0x16, 0x90); // NOP
|
||||
MEMT_REF4( version_D2Game >= V114d ? 0x75FF85F8 : 0x75F685F0 , version_D2Game >= V114d ? caller_LoadSPPlayerCustomData_114 : caller_LoadSPPlayerCustomData);
|
||||
memt_byte( version_D2Game >= V114d ? 0x13 : 0x16, 0x90); // NOP
|
||||
//6FC8CB0F 8BF0 MOV ESI,EAX
|
||||
//6FC8CB11 85F6 TEST ESI,ESI
|
||||
//6FC8CB13 75 16 JNZ SHORT D2Game.6FC8CB2B
|
||||
@ -495,11 +541,17 @@ void Install_LoadPlayerData()
|
||||
//6FC7638D |> 8BF0 MOV ESI,EAX
|
||||
//6FC7638F |. 85F6 TEST ESI,ESI
|
||||
//6FC76391 |. 75 16 JNZ SHORT D2Game.6FC763A9
|
||||
//6FC5BCCD |> 8BF0 MOV ESI,EAX
|
||||
//6FC5BCCF |. 85F6 TEST ESI,ESI
|
||||
//6FC5BCD1 |. 75 16 JNZ SHORT D2Game.6FC5BCE9
|
||||
//0053447A |. 8BF8 MOV EDI,EAX
|
||||
//0053447C |. 85FF TEST EDI,EDI
|
||||
//0053447E |. 75 13 JNZ SHORT Game.00534493
|
||||
|
||||
// Load MP player custom data.
|
||||
mem_seek R7(D2Game, 50790, 50B90, 5CC66, BB777, 27757, 46447, 56217);
|
||||
mem_seek R8(D2Game, 50790, 50B90, 5CC66, BB777, 27757, 46447, 56217, 3BB57, 134572);
|
||||
memt_byte( 0x83, 0xE8);
|
||||
MEMT_REF4( version_D2Game >= V111 ? 0x2174003B : version_D2Game == V110 ? 0x4674003F : 0x1D74003F, version_D2Game >= V111 ? caller_LoadMPPlayerCustomData_111 : version_D2Game == V110 ? caller_LoadMPPlayerCustomData: caller_LoadMPPlayerCustomData_9);
|
||||
MEMT_REF4( version_D2Game >= V114d ? 0x1D74003F : version_D2Game >= V111 ? 0x2174003B : version_D2Game == V110 ? 0x4674003F : 0x1D74003F, version_D2Game >= V114d ? caller_LoadMPPlayerCustomData_114 : version_D2Game >= V111 ? caller_LoadMPPlayerCustomData_111 : version_D2Game == V110 ? caller_LoadMPPlayerCustomData: caller_LoadMPPlayerCustomData_9);
|
||||
//6FC8CC66 . 833F 00 CMP DWORD PTR DS:[EDI],0
|
||||
//6FC8CC69 . 74 46 JE SHORT D2Game.6FC8CCB1
|
||||
//0203B777 |> 833B 00 CMP DWORD PTR DS:[EBX],0
|
||||
@ -510,22 +562,28 @@ void Install_LoadPlayerData()
|
||||
//6FC6644A |. 74 21 JE SHORT D2Game.6FC6646D
|
||||
//6FC76217 |> 833B 00 CMP DWORD PTR DS:[EBX],0
|
||||
//6FC7621A |. 74 21 JE SHORT D2Game.6FC7623D
|
||||
//6FC5BB57 |> 833B 00 CMP DWORD PTR DS:[EBX],0
|
||||
//6FC5BB5A |. 74 21 JE SHORT D2Game.6FC5BB7D
|
||||
//00534572 |> 833F 00 CMP DWORD PTR DS:[EDI],0
|
||||
//00534575 |. 74 1D JE SHORT Game.00534594
|
||||
|
||||
// Send save files to Server.
|
||||
mem_seek R7(D2Client, CF42, CF32, D5A2, 733FC, 5DFDC, 7933C, 1457C);
|
||||
mem_seek R8(D2Client, CF42, CF32, D5A2, 733FC, 5DFDC, 7933C, 1457C, B638C, 7807E);
|
||||
MEMJ_REF4( D2FogGetSavePath, version_D2Game >= V111 ? caller_SendSaveFiles_111 : caller_SendSaveFiles);
|
||||
//6FAAD5A1 |. E8 88D10B00 CALL <JMP.&Fog.#10115>
|
||||
//6FB233FB |. E8 CA8AF9FF CALL <JMP.&Fog.#10115>
|
||||
//6FB0DFDB |. E8 C6DEFAFF CALL <JMP.&Fog.#10115>
|
||||
//6FB2933B |. E8 6A2CF9FF CALL <JMP.&Fog.#10115>
|
||||
//6FAC457B |. E8 187AFFFF CALL <JMP.&Fog.#10115>
|
||||
//6FB6638B |. E8 2E5BF5FF CALL <JMP.&Fog.#10115>
|
||||
//0047807D |. E8 CEEFF8FF CALL Game.00407050
|
||||
|
||||
// Receive save files from client.
|
||||
mem_seek R7(D2Game, 183A, 183A, 191A, 376E9, 703D9, 624D9, CAF39);
|
||||
mem_seek R8(D2Game, 183A, 183A, 191A, 376E9, 703D9, 624D9, CAF39, D53E9, 13F114);
|
||||
memt_byte( 0x8B ,0xE8);
|
||||
if ( version_D2Game >= V111 ) {
|
||||
MEMT_REF4( 0xB60F005D, caller_ReceiveSaveFiles_111);
|
||||
memt_byte( 0x45 ,0x90);
|
||||
MEMT_REF4( version_D2Game >= V114d ? 0x46B60F1E : 0xB60F005D, version_D2Game >= V114d ? caller_ReceiveSaveFiles_114 : caller_ReceiveSaveFiles_111);
|
||||
if (version_D2Game < V114a) memt_byte( 0x45 ,0x90);
|
||||
memt_byte( 0x04 ,0x90);
|
||||
//01FB76E9 |. 8B5D 00 MOV EBX,DWORD PTR SS:[EBP]
|
||||
//01FB76EC |. 0FB645 04 MOVZX EAX,BYTE PTR SS:[EBP+4]
|
||||
@ -535,6 +593,10 @@ void Install_LoadPlayerData()
|
||||
//6FC824DC |. 0FB645 04 MOVZX EAX,BYTE PTR SS:[EBP+4]
|
||||
//6FCEAF39 |. 8B5D 00 MOV EBX,DWORD PTR SS:[EBP]
|
||||
//6FCEAF3C |. 0FB645 04 MOVZX EAX,BYTE PTR SS:[EBP+4]
|
||||
//6FCF53E9 |. 8B5D 00 MOV EBX,DWORD PTR SS:[EBP]
|
||||
//6FCF53EC |. 0FB645 04 MOVZX EAX,BYTE PTR SS:[EBP+4]
|
||||
//0053F114 |. 8B1E MOV EBX,DWORD PTR DS:[ESI]
|
||||
//0053F116 |. 0FB646 04 MOVZX EAX,BYTE PTR DS:[ESI+4]
|
||||
} else {
|
||||
MEMT_REF4( 0x04468A3E, caller_ReceiveSaveFiles);
|
||||
//6FC3191A |. 8B3E MOV EDI,DWORD PTR DS:[ESI]
|
||||
@ -543,7 +605,7 @@ void Install_LoadPlayerData()
|
||||
|
||||
if ( version_Fog <= V109d )
|
||||
{
|
||||
mem_seek R7(Fog, 47DE, 45AE, 0000, 0000, 0000, 0000, 0000);
|
||||
mem_seek R8(Fog, 47DE, 45AE, 0000, 0000, 0000, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0x8B ,0xE8);
|
||||
MEMT_REF4( 0x891C2444, version_Fog == V109b? caller_BugFix109b : caller_BugFix109d);
|
||||
memt_byte( 0x44 ,0x90);
|
||||
|
371
PlugY/LocalizedStrings.cpp
Normal file
371
PlugY/LocalizedStrings.cpp
Normal file
@ -0,0 +1,371 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Localized strings functions.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "INIfile.h"
|
||||
#include "LocalizedStrings.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
const char* LOCALIZED_STRINGS_FILENAME = "PlugY\\LocalizedStrings.ini";
|
||||
|
||||
LPWSTR StripGender(LPWSTR text)
|
||||
{
|
||||
if (text[0] == L' ')
|
||||
text++;
|
||||
if (text[0] != L'[')
|
||||
return text;
|
||||
text++;
|
||||
while (text[0] != L']' && text[0] != NULL)
|
||||
text++;
|
||||
text++;
|
||||
return text;
|
||||
}
|
||||
LPCWSTR StripGender(LPCWSTR text) { return StripGender((LPWSTR)text); }
|
||||
|
||||
///////////////////////////////////////// Get Local Strings /////////////////////////////////////////
|
||||
|
||||
struct LocalizedTypeString
|
||||
{
|
||||
DWORD code;
|
||||
LPSTR itemStr;
|
||||
LPWSTR typeLocalizedString;
|
||||
} *sLocalizedTypeStrings;
|
||||
|
||||
LPWSTR sLocalizedStrings[100];
|
||||
int nbLocalizedTypeString = 0;
|
||||
|
||||
LPWSTR getLocalString(int stringId)
|
||||
{
|
||||
if (stringId < 0 || stringId >= 100)
|
||||
return L"";
|
||||
return sLocalizedStrings[stringId];
|
||||
}
|
||||
|
||||
LPCWSTR getLocalTypeString(DWORD code)
|
||||
{
|
||||
for (int i = 0; i < nbLocalizedTypeString; i++)
|
||||
{
|
||||
if (sLocalizedTypeStrings[i].code == code)
|
||||
{
|
||||
//log_msg("Code=%08X\n", code);
|
||||
if (sLocalizedTypeStrings[i].itemStr)
|
||||
return StripGender(D2GetStringFromString(sLocalizedTypeStrings[i].itemStr));
|
||||
LPWSTR text = StripGender(sLocalizedTypeStrings[i].typeLocalizedString);
|
||||
if (!text || !text[0])
|
||||
break;
|
||||
return text;
|
||||
}
|
||||
}
|
||||
char itemIdx[5];
|
||||
itemIdx[0] = (code) & 0xFF;
|
||||
itemIdx[1] = (code >> 8) & 0xFF;
|
||||
itemIdx[2] = (code >> 16) & 0xFF;
|
||||
itemIdx[3] = (code >> 24) & 0xFF;
|
||||
itemIdx[4] = 0;
|
||||
LPWSTR typeName = StripGender(D2GetStringFromString(itemIdx));
|
||||
if (wcsstr(typeName, L"-not xlated call ken") == NULL)
|
||||
return typeName;
|
||||
|
||||
static WCHAR itemIdxW[5];
|
||||
itemIdxW[0] = (code) & 0xFF;
|
||||
itemIdxW[1] = (code >> 8) & 0xFF;
|
||||
itemIdxW[2] = (code >> 16) & 0xFF;
|
||||
itemIdxW[3] = (code >> 24) & 0xFF;
|
||||
itemIdxW[4] = 0;
|
||||
return itemIdxW;
|
||||
}
|
||||
|
||||
///////////////////////////////////////// Load Strings /////////////////////////////////////////
|
||||
|
||||
#define LOAD(I) loadLocalString(iniFile, I, L#I, key)
|
||||
#define BUFSIZE 0x400
|
||||
|
||||
void loadLocalString(INIFileW *iniFile, int id, LPCWSTR section, LPCWSTR key)
|
||||
{
|
||||
WCHAR buffer[BUFSIZE];
|
||||
iniFile->GetPrivateProfileString(section, key, NULL, buffer, BUFSIZE);
|
||||
int len = wcslen(buffer);
|
||||
if (len == 0)
|
||||
iniFile->GetPrivateProfileString(section, L"ENG", section, buffer, BUFSIZE);
|
||||
len = wcslen(buffer);
|
||||
if (len == 0)
|
||||
{
|
||||
len = wcslen(section);
|
||||
sLocalizedStrings[id] = new WCHAR[len + 1];
|
||||
wcsncpy(sLocalizedStrings[id], section, len);
|
||||
sLocalizedStrings[id][len] = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
int i = 0;
|
||||
if (buffer[0] == L'"' && buffer[len-1] == L'"')
|
||||
{
|
||||
buffer[len-1] = NULL;
|
||||
i++;
|
||||
len -= 2;
|
||||
}
|
||||
sLocalizedStrings[id] = new WCHAR[len + 1];
|
||||
for (; i<len; i++)
|
||||
{
|
||||
if (buffer[i] == L'\\' && buffer[i+1] == L'n')
|
||||
{
|
||||
sLocalizedStrings[id][j++] = L'\n';
|
||||
i++;
|
||||
}
|
||||
else
|
||||
sLocalizedStrings[id][j++] = buffer[i];
|
||||
}
|
||||
sLocalizedStrings[id][j] = NULL;
|
||||
}
|
||||
|
||||
int GetPrivateProfileStringList(LPCWCHAR m_cache, LPCWSTR section, LPCWSTR key)
|
||||
{
|
||||
WCHAR sectionString[MAX_SECTIONNAME_LENGTH];
|
||||
_snwprintf(sectionString, MAX_SECTIONNAME_LENGTH, L"\n[%s", section);
|
||||
WCHAR keyString[MAX_KEYNAME_LENGTH];
|
||||
_snwprintf(keyString, MAX_KEYNAME_LENGTH, L"\n%s=", key);
|
||||
int keyLen = wcslen(keyString);
|
||||
WCHAR defKeyString[MAX_KEYNAME_LENGTH];
|
||||
_snwprintf(defKeyString, MAX_KEYNAME_LENGTH, L"\n%s=", L"ENG");
|
||||
int defKeyLen = wcslen(defKeyString);
|
||||
WCHAR itemKeyString[MAX_KEYNAME_LENGTH];
|
||||
_snwprintf(itemKeyString, MAX_KEYNAME_LENGTH, L"\n%s=", L"ITEM");
|
||||
int itemKeyLen = wcslen(itemKeyString);
|
||||
|
||||
// Get nb TYPE sections.
|
||||
LPCWSTR end;
|
||||
int nb = 0;
|
||||
LPCWSTR cur = m_cache;
|
||||
while ((cur = wcsstr(cur, sectionString)))
|
||||
{
|
||||
cur = wcsstr(cur, L"]") + 1;
|
||||
if (cur == NULL)
|
||||
continue;
|
||||
nb++;
|
||||
}
|
||||
|
||||
// Allocation
|
||||
sLocalizedTypeStrings = new LocalizedTypeString[nb];
|
||||
|
||||
// Search next section.
|
||||
cur = m_cache;
|
||||
LPCWSTR nextHeader = wcsstr(cur, sectionString);
|
||||
|
||||
// Treat next section
|
||||
int i = 0;
|
||||
while (nextHeader && i < nb)
|
||||
{
|
||||
cur = nextHeader + wcslen(sectionString);
|
||||
end = wcsstr(cur, L"]");
|
||||
if (end == NULL)
|
||||
break;
|
||||
nextHeader = wcsstr(end, sectionString);
|
||||
if (cur == end) { cur++; continue; }
|
||||
|
||||
// Fill code
|
||||
sLocalizedTypeStrings[i].code = (*cur & 0xFF); cur++;
|
||||
if (cur != end) { sLocalizedTypeStrings[i].code |= (*cur & 0xFF) << 8; cur++; } else sLocalizedTypeStrings[i].code |= ' ' << 8;
|
||||
if (cur != end) { sLocalizedTypeStrings[i].code |= (*cur & 0xFF) << 16; cur++; } else sLocalizedTypeStrings[i].code |= ' ' << 16;
|
||||
if (cur != end) { sLocalizedTypeStrings[i].code |= (*cur & 0xFF) << 24; cur++; } else sLocalizedTypeStrings[i].code |= ' ' << 24;
|
||||
sLocalizedTypeStrings[i].itemStr = NULL;
|
||||
|
||||
// Search item key
|
||||
cur = wcsstr(end + 1, itemKeyString);
|
||||
if (!(cur == NULL || (nextHeader && cur > nextHeader) || cur[itemKeyLen] == '\r' || cur[itemKeyLen] == '\n' || cur[itemKeyLen] == NULL))// Found
|
||||
{
|
||||
cur += itemKeyLen;
|
||||
end = cur;
|
||||
while (end[0] != '\r' && end[0] != '\n' && end[0] != NULL)
|
||||
end++;
|
||||
sLocalizedTypeStrings[i].itemStr = new char[end - cur + 1];
|
||||
for (int j = 0; j < end - cur; j++)
|
||||
sLocalizedTypeStrings[i].itemStr[j] = (char)cur[j];
|
||||
sLocalizedTypeStrings[i].itemStr[end - cur] = NULL;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Search lng key
|
||||
cur = wcsstr(end + 1, keyString);
|
||||
if (cur == NULL || (nextHeader && cur > nextHeader) || cur[keyLen] == '\r' || cur[keyLen] == '\n' || cur[keyLen] == NULL)// Not found
|
||||
{
|
||||
// Search def key
|
||||
cur = wcsstr(end + 1, defKeyString);
|
||||
if (cur == NULL || (nextHeader && cur > nextHeader) || cur[defKeyLen] == '\r' || cur[defKeyLen] == '\n' || cur[defKeyLen] == NULL)// Not found
|
||||
{
|
||||
sLocalizedTypeStrings[i].typeLocalizedString = new WCHAR[1];
|
||||
sLocalizedTypeStrings[i].typeLocalizedString[0] = NULL;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
cur += defKeyLen;
|
||||
}
|
||||
else
|
||||
cur += keyLen;
|
||||
|
||||
// Search end value.
|
||||
end = cur;
|
||||
while (end[0] && end[0] != '\r' && end[0] != '\n')
|
||||
end++;
|
||||
|
||||
// Strip ""
|
||||
if (cur[0] == '"' && (end - 1)[0] == '"') { cur++; end--; }
|
||||
|
||||
// Strip Gender
|
||||
if (cur[0] == '[')
|
||||
{
|
||||
LPCWSTR tmp = cur;
|
||||
while (tmp[0] && tmp[0] != ']' && tmp[0] != '\r' && tmp[0] != '\n')
|
||||
tmp++;
|
||||
if (tmp[0] == ']')
|
||||
{
|
||||
cur = tmp + 1;
|
||||
end = cur;
|
||||
while (end[0] && end[0] != '[' && end[0] != '\r' && end[0] != '\n' && end[0] != '"')
|
||||
end++;
|
||||
}
|
||||
}
|
||||
|
||||
// Fill value
|
||||
sLocalizedTypeStrings[i].typeLocalizedString = new WCHAR[end - cur + 1];
|
||||
_snwprintf(sLocalizedTypeStrings[i].typeLocalizedString, end - cur, cur);
|
||||
sLocalizedTypeStrings[i].typeLocalizedString[end - cur] = NULL;
|
||||
i++;
|
||||
}
|
||||
return nb;
|
||||
}
|
||||
|
||||
void loadLocalizedStrings(int language)
|
||||
{
|
||||
if (sLocalizedTypeStrings)
|
||||
return;
|
||||
|
||||
INIFileW *iniFile = new INIFileW;
|
||||
|
||||
log_msg("***** Load localized Strings *****\n");
|
||||
if (iniFile->InitReadWrite(LOCALIZED_STRINGS_FILENAME, INIFILE_MPQREAD, 0))//C:\\Jeux\\Blizzard\\D2\\-
|
||||
log_msg("File %s loaded from MPQ.\n\n", LOCALIZED_STRINGS_FILENAME);
|
||||
else if (iniFile->InitReadWrite(LOCALIZED_STRINGS_FILENAME, INIFILE_READ, 0))//C:\\Jeux\\Blizzard\\D2\\-
|
||||
log_msg("File %s loaded from PlugY folder.\n\n", LOCALIZED_STRINGS_FILENAME);
|
||||
else
|
||||
{
|
||||
log_msg("Failed to load %s.\n\n", LOCALIZED_STRINGS_FILENAME);
|
||||
return;
|
||||
}
|
||||
|
||||
LPCWSTR key;
|
||||
switch (language)
|
||||
{
|
||||
case LNG_ENG: key = L"ENG"; break;
|
||||
case LNG_ESP: key = L"ESP"; break;
|
||||
case LNG_DEU: key = L"DEU"; break;
|
||||
case LNG_FRA: key = L"FRA"; break;
|
||||
case LNG_POR: key = L"POR"; break;
|
||||
case LNG_ITA: key = L"ITA"; break;
|
||||
case LNG_JPN: key = L"JPN"; break;
|
||||
case LNG_KOR: key = L"KOR"; break;
|
||||
case LNG_SIN: key = L"SIN"; break;
|
||||
case LNG_CHI: key = L"CHI"; break;
|
||||
case LNG_POL: key = L"POL"; break;
|
||||
case LNG_RUS: key = L"RUS"; break;
|
||||
case LNG_DEF: key = L"ENG"; break;
|
||||
default: key = L"ENG";
|
||||
}
|
||||
|
||||
// Load localized type string
|
||||
nbLocalizedTypeString = GetPrivateProfileStringList(iniFile->m_cache, L"TYPE_", key);
|
||||
|
||||
// PlugY localized string
|
||||
LOAD(STR_STATS_UNASSIGN_WITH_LIMIT);
|
||||
LOAD(STR_STATS_UNASSIGN_WITHOUT_LIMIT);
|
||||
LOAD(STR_STATS_BASE_MIN);
|
||||
LOAD(STR_SKILLS_UNASSIGN);
|
||||
LOAD(STR_STASH_PREVIOUS_PAGE);
|
||||
LOAD(STR_STASH_NEXT_PAGE);
|
||||
LOAD(STR_TOGGLE_TO_PERSONAL);
|
||||
LOAD(STR_TOGGLE_TO_SHARED);
|
||||
LOAD(STR_TOGGLE_MULTI_DISABLED);
|
||||
LOAD(STR_STASH_PREVIOUS_INDEX);
|
||||
LOAD(STR_STASH_NEXT_INDEX);
|
||||
LOAD(STR_PUT_GOLD);
|
||||
LOAD(STR_TAKE_GOLD);
|
||||
LOAD(STR_PERSONAL_PAGE_NUMBER);
|
||||
LOAD(STR_SHARED_PAGE_NUMBER);
|
||||
LOAD(STR_NO_SELECTED_PAGE);
|
||||
LOAD(STR_SHARED_GOLD_QUANTITY);
|
||||
LOAD(STR_PREVIOUS_PAGE);
|
||||
LOAD(STR_NEXT_PAGE);
|
||||
LOAD(STR_PREVIOUS_RUNE);
|
||||
LOAD(STR_NEXT_RUNE);
|
||||
LOAD(STR_ITEM_LEVEL);
|
||||
LOAD(STR_PAGE_TYPE_CHANGE);
|
||||
|
||||
// Cube receipt :
|
||||
LOAD(STR_COW_PORTAL);
|
||||
LOAD(STR_PANDEMONIUM_PORTAL);
|
||||
LOAD(STR_PANDEMONIUM_FINAL_PORTAL);
|
||||
LOAD(STR_FULL);
|
||||
LOAD(STR_REPAIR);
|
||||
LOAD(STR_AND);
|
||||
LOAD(STR_RECHARGE);
|
||||
LOAD(STR_DESTROY_FILLERS);
|
||||
LOAD(STR_REMOVE_FILLERS);
|
||||
LOAD(STR_REGENERATE);
|
||||
LOAD(STR_UPGRADE_TO_EXCEPTIONAL);
|
||||
LOAD(STR_UPGRADE_TO_ELITE);
|
||||
LOAD(STR_ETHERAL);
|
||||
LOAD(STR_NOT_ETHERAL);
|
||||
LOAD(STR_NOT_RUNEWORD);
|
||||
LOAD(STR_BASIC);
|
||||
LOAD(STR_EXCEPTIONAL);
|
||||
LOAD(STR_ELITE);
|
||||
LOAD(STR_CRACKED);
|
||||
LOAD(STR_NORMAL);
|
||||
LOAD(STR_SUPERIOR);
|
||||
LOAD(STR_MAGIC);
|
||||
LOAD(STR_SET);
|
||||
LOAD(STR_RARE);
|
||||
LOAD(STR_UNIQUE);
|
||||
LOAD(STR_CRAFTED);
|
||||
LOAD(STR_TEMPERED);
|
||||
LOAD(STR_ITEM);
|
||||
LOAD(STR_ITEM_SAME_TYPE);
|
||||
LOAD(STR_INCLUDE_UPGRADED);
|
||||
LOAD(STR_WITHOUT_SOCKET);
|
||||
LOAD(STR_WITH_SOCKETS);
|
||||
LOAD(STR_WITH_N_SOCKETS);
|
||||
LOAD(STR_ONLY_N_H);
|
||||
LOAD(STR_ONLY_HELL);
|
||||
LOAD(STR_ONLY_CLASS);
|
||||
|
||||
// Breakpoints :
|
||||
LOAD(STR_MERCENARIES);
|
||||
LOAD(STR_MERC_ACT_1);
|
||||
LOAD(STR_MERC_ACT_2);
|
||||
LOAD(STR_MERC_ACT_3);
|
||||
LOAD(STR_MERC_ACT_5);
|
||||
LOAD(STR_BREAKPOINT);
|
||||
LOAD(STR_BREAKPOINTS);
|
||||
LOAD(STR_BLOCK_FRAMES);
|
||||
LOAD(STR_CASTING_FRAMES);
|
||||
LOAD(STR_HIT_RECOVERY_FRAMES);
|
||||
LOAD(STR_1H_SWINGING_WEAPON);
|
||||
LOAD(STR_OTHER_WEAPONS);
|
||||
LOAD(STR_HUMAN_FORM);
|
||||
LOAD(STR_BEAR_FORM);
|
||||
LOAD(STR_WOLF_FORM);
|
||||
LOAD(STR_VAMPIRE_FORM);
|
||||
LOAD(STR_SPEARS_AND_STAVES);
|
||||
LOAD(STR_LIGHTNING_CHAIN_LIGHTNING);
|
||||
LOAD(STR_OTHER_SPELLS);
|
||||
|
||||
iniFile->close();
|
||||
delete iniFile;
|
||||
}
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
103
PlugY/LocalizedStrings.h
Normal file
103
PlugY/LocalizedStrings.h
Normal file
@ -0,0 +1,103 @@
|
||||
/*==============================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
|
||||
this file implements some common and useful
|
||||
function related to some Diablo II mechanisms.
|
||||
|
||||
/*============================================*/
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
void loadLocalizedStrings(int language);
|
||||
LPWSTR getLocalString(int stringId);
|
||||
LPCWSTR getLocalTypeString(DWORD code);
|
||||
LPWSTR StripGender(LPWSTR text);
|
||||
LPCWSTR StripGender(LPCWSTR text);
|
||||
|
||||
enum eStringList
|
||||
{
|
||||
STR_STATS_UNASSIGN_WITH_LIMIT = 0,
|
||||
STR_STATS_UNASSIGN_WITHOUT_LIMIT,
|
||||
STR_STATS_BASE_MIN,
|
||||
STR_SKILLS_UNASSIGN,
|
||||
STR_STASH_PREVIOUS_PAGE,
|
||||
STR_STASH_NEXT_PAGE,
|
||||
STR_TOGGLE_TO_PERSONAL,
|
||||
STR_TOGGLE_TO_SHARED,
|
||||
STR_TOGGLE_MULTI_DISABLED,
|
||||
STR_STASH_PREVIOUS_INDEX,
|
||||
STR_STASH_NEXT_INDEX,
|
||||
STR_PUT_GOLD,
|
||||
STR_TAKE_GOLD,
|
||||
STR_PERSONAL_PAGE_NUMBER,
|
||||
STR_SHARED_PAGE_NUMBER,
|
||||
STR_NO_SELECTED_PAGE,
|
||||
STR_SHARED_GOLD_QUANTITY,
|
||||
STR_PREVIOUS_PAGE,
|
||||
STR_NEXT_PAGE,
|
||||
STR_PREVIOUS_RUNE,
|
||||
STR_NEXT_RUNE,
|
||||
STR_ITEM_LEVEL,
|
||||
STR_PAGE_TYPE_CHANGE,
|
||||
//
|
||||
STR_COW_PORTAL,
|
||||
STR_PANDEMONIUM_PORTAL,
|
||||
STR_PANDEMONIUM_FINAL_PORTAL,
|
||||
STR_FULL,
|
||||
STR_REPAIR,
|
||||
STR_AND,
|
||||
STR_RECHARGE,
|
||||
STR_DESTROY_FILLERS,
|
||||
STR_REMOVE_FILLERS,
|
||||
STR_REGENERATE,
|
||||
STR_UPGRADE_TO_EXCEPTIONAL,
|
||||
STR_UPGRADE_TO_ELITE,
|
||||
STR_ETHERAL,
|
||||
STR_NOT_ETHERAL,
|
||||
STR_NOT_RUNEWORD,
|
||||
STR_BASIC,
|
||||
STR_EXCEPTIONAL,
|
||||
STR_ELITE,
|
||||
STR_CRACKED,
|
||||
STR_NORMAL,
|
||||
STR_SUPERIOR,
|
||||
STR_MAGIC,
|
||||
STR_SET,
|
||||
STR_RARE,
|
||||
STR_UNIQUE,
|
||||
STR_CRAFTED,
|
||||
STR_TEMPERED,
|
||||
STR_ITEM,
|
||||
STR_ITEM_SAME_TYPE,
|
||||
STR_INCLUDE_UPGRADED,
|
||||
STR_WITHOUT_SOCKET,
|
||||
STR_WITH_SOCKETS,
|
||||
STR_WITH_N_SOCKETS,
|
||||
STR_ONLY_N_H,
|
||||
STR_ONLY_HELL,
|
||||
STR_ONLY_CLASS,
|
||||
|
||||
STR_MERCENARIES,
|
||||
STR_MERC_ACT_1,
|
||||
STR_MERC_ACT_2,
|
||||
STR_MERC_ACT_3,
|
||||
STR_MERC_ACT_5,
|
||||
STR_BREAKPOINT,
|
||||
STR_BREAKPOINTS,
|
||||
STR_BLOCK_FRAMES,
|
||||
STR_CASTING_FRAMES,
|
||||
STR_HIT_RECOVERY_FRAMES,
|
||||
STR_1H_SWINGING_WEAPON,
|
||||
STR_OTHER_WEAPONS,
|
||||
STR_HUMAN_FORM,
|
||||
STR_BEAR_FORM,
|
||||
STR_WOLF_FORM,
|
||||
STR_VAMPIRE_FORM,
|
||||
STR_SPEARS_AND_STAVES,
|
||||
STR_LIGHTNING_CHAIN_LIGHTNING,
|
||||
STR_OTHER_SPELLS
|
||||
};
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,13 +1,15 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Add "plugY v1.00" on screen.
|
||||
Print PlugY version on screen.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "extraOptions.h"
|
||||
#include "windowed.h"
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include <stdio.h>
|
||||
|
||||
char* versionText = "";
|
||||
@ -20,14 +22,29 @@ DWORD newTextBoxData[]={4,0x237,0x243,0xC8,0x14,0,0,0,0,0,0,2};//type,x,y,l,h,?,
|
||||
|
||||
void STDCALL printPlugYVersion(void** childrens, DWORD* sgnNumChildren)
|
||||
{
|
||||
char buf[20];
|
||||
void* textbox = D2CreateTextBox(newTextBoxData);
|
||||
childrens[*sgnNumChildren]=textbox;
|
||||
d2_assert((*sgnNumChildren)++ >= 40,"sgnNumChildren < MAX_CHILDREN", __FILE__, __LINE__);
|
||||
sprintf(buf, "PlugY %s", PLUGY_VERSION);
|
||||
D2PrintLineOnTextBox(textbox, buf, colorOfPlugYVersion);
|
||||
if (active_Windowed)
|
||||
SetWindowedOptions();
|
||||
if (active_PrintPlugYVersion)
|
||||
{
|
||||
char buf[20];
|
||||
void* textbox = D2CreateTextBox(newTextBoxData);
|
||||
childrens[*sgnNumChildren] = textbox;
|
||||
d2_assert((*sgnNumChildren)++ >= 40, "sgnNumChildren < MAX_CHILDREN", __FILE__, __LINE__);
|
||||
sprintf(buf, "PlugY %s", PLUGY_VERSION);
|
||||
D2PrintLineOnTextBox(textbox, buf, colorOfPlugYVersion);
|
||||
}
|
||||
}
|
||||
|
||||
void** childrens;
|
||||
DWORD* sgnNumChildren;
|
||||
FCT_ASM ( caller_printPlugYVersion114 )
|
||||
PUSH sgnNumChildren
|
||||
PUSH childrens
|
||||
CALL printPlugYVersion
|
||||
MOV ECX,0x115
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_printPlugYVersion )
|
||||
POP ESI
|
||||
PUSH DWORD PTR [ESI+2]
|
||||
@ -46,15 +63,26 @@ void Install_PrintPlugYVersion()
|
||||
log_msg("Patch D2Launch to print PlugY version. (PrintPlugYVersion)\n");
|
||||
|
||||
// Print PlugY version.
|
||||
mem_seek R7(D2Launch, 7F5D, 7F7D, 9639, 117C7, 178A7, 16AF7, 18061);
|
||||
MEMJ_REF4( D2CreateTextBox, caller_printPlugYVersion);
|
||||
//6FA19638 |. E8 1BED0000 CALL <JMP.&D2Win.#10017>
|
||||
//6FA517C6 |. E8 6F81FFFF CALL <JMP.&D2Win.#10147>
|
||||
//6FA578A6 |. E8 D71FFFFF CALL <JMP.&D2Win.#10113>
|
||||
//6FA56B1F |. E8 1A2EFFFF CALL <JMP.&D2Win.#10098>
|
||||
//6FA56AF6 |. E8 432EFFFF CALL <JMP.&D2Win.#10098>
|
||||
//6FA58060 |. E8 ED18FFFF CALL <JMP.&D2Win.#10098>
|
||||
|
||||
mem_seek R8(D2Launch, 7F5D, 7F7D, 9639, 117C7, 178A7, 16AF7, 18061, 10A11, 33798);
|
||||
if (version_D2Launch == V114d)
|
||||
{
|
||||
memt_byte(0xB9, 0xE8);
|
||||
MEMT_REF4(0x00000115, caller_printPlugYVersion114);
|
||||
childrens = (void**)(offset_Game + 0x379350);
|
||||
sgnNumChildren = (DWORD*)(offset_Game + 0x379944);
|
||||
//00433798 |. B9 15010000 MOV ECX,115
|
||||
}
|
||||
else
|
||||
{
|
||||
MEMJ_REF4( D2CreateTextBox, caller_printPlugYVersion);
|
||||
//6FA19638 |. E8 1BED0000 CALL <JMP.&D2Win.#10017>
|
||||
//6FA517C6 |. E8 6F81FFFF CALL <JMP.&D2Win.#10147>
|
||||
//6FA578A6 |. E8 D71FFFFF CALL <JMP.&D2Win.#10113>
|
||||
//6FA56B1F |. E8 1A2EFFFF CALL <JMP.&D2Win.#10098>
|
||||
//6FA56AF6 |. E8 432EFFFF CALL <JMP.&D2Win.#10098>
|
||||
//6FA58060 |. E8 ED18FFFF CALL <JMP.&D2Win.#10098>
|
||||
//6FA50A10 |. E8 218FFFFF CALL <JMP.&D2Win.#10164>
|
||||
}
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
@ -68,6 +96,14 @@ void FASTCALL versionChange(void* screen, char* text, DWORD color)
|
||||
D2PrintLineOnTextBox(screen,versionText,modVersionColor);
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_VersionChange_114 )
|
||||
MOV CL, BYTE PTR DS:[modVersionColor]
|
||||
MOV BYTE PTR SS:[ESP+4], CL
|
||||
MOV EDX,versionText
|
||||
MOV ECX,ESI
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_VersionChange_10 )
|
||||
MOV CL, BYTE PTR DS:[modVersionColor]
|
||||
MOV BYTE PTR SS:[ESP+4], CL
|
||||
@ -89,9 +125,17 @@ void Install_VersionChange()// BUG WITH 2MOD if D2Mod started before PlugY ????
|
||||
|
||||
|
||||
// Print LoD/Mod version.
|
||||
if (version_D2Launch >= V110)
|
||||
if (version_D2Launch >= V114d)
|
||||
{
|
||||
mem_seek R7(D2Launch, 00000, 00000, 9723, 1189B, 1797B, 16BCB, 18134);//6FA19721-6FA10000
|
||||
mem_seek R8(D2Launch, 00000, 00000, 9723, 1189B, 1797B, 16BCB, 18134, 10AE4, 337EA);//6FA19721-6FA10000
|
||||
memt_byte(0x8D, 0xE8); // CALL
|
||||
MEMT_REF4(0xCE8BC055, caller_VersionChange_114);
|
||||
//004337EA |. 8D55 C0 LEA EDX,DWORD PTR SS:[EBP-40] ; |
|
||||
//004337ED |. 8BCE MOV ECX,ESI ; |
|
||||
}
|
||||
else if (version_D2Launch >= V110)
|
||||
{
|
||||
mem_seek R8(D2Launch, 00000, 00000, 9723, 1189B, 1797B, 16BCB, 18134, 10AE4, 337EA);//6FA19721-6FA10000
|
||||
memt_byte( 0x8D, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x8B102454 , caller_VersionChange_10);
|
||||
memt_byte( 0xCF, 0x90 ); // NOP
|
||||
@ -105,14 +149,17 @@ void Install_VersionChange()// BUG WITH 2MOD if D2Mod started before PlugY ????
|
||||
//6FA56BCF |. 8BCF MOV ECX,EDI
|
||||
//6FA58134 |. 8D5424 10 LEA EDX,DWORD PTR SS:[ESP+10]
|
||||
//6FA58138 |. 8BCF MOV ECX,EDI
|
||||
//6FA50AE4 |. 8D5424 10 LEA EDX,DWORD PTR SS:[ESP+10]
|
||||
//6FA50AE8 |. 8BCF MOV ECX,EDI
|
||||
} else {
|
||||
mem_seek R7(D2Launch, 801B, 803B, 972A, 118A2, 17982, 16BD2, 1813B);
|
||||
mem_seek R8(D2Launch, 801B, 803B, 972A, 118A2, 17982, 16BD2, 1813B, 10AEB, 00000);
|
||||
MEMJ_REF4( D2PrintLineOnTextBox, versionChange);
|
||||
//6FA19729 |. E8 88EB0000 CALL <JMP.&D2Win.#10046>
|
||||
//6FA518A1 |. E8 267FFFFF CALL <JMP.&D2Win.#10061>
|
||||
//6FA57981 |. E8 781EFFFF CALL <JMP.&D2Win.#10075>
|
||||
//6FA56BD1 |. E8 EA2CFFFF CALL <JMP.&D2Win.#10015>
|
||||
//6FA5813A |. E8 8F17FFFF CALL <JMP.&D2Win.#10022>
|
||||
//6FA50AEA |. E8 DF8CFFFF CALL <JMP.&D2Win.#10051>
|
||||
}
|
||||
log_msg("\n");
|
||||
|
||||
|
@ -5,16 +5,14 @@
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "parameters.h"
|
||||
#include "modifMemory.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
const char* MSG_ERROR_READ_MEMORY = "Error : Read access missing to patch memory at %08X.\nPlease install a clean version of Lord of Destruction\n\n"
|
||||
"You can avoid this error message by setting ActiveCkeckMemory=0 in PlugY.ini\n(WARNING: Be careful when you use it, it shouldn't be used by common user)";
|
||||
const char* MSG_CRITICAL_WRITE_MEMORY = "Error.\nWrite access missing to patch memory at %08X.\n\nPlease install a clean version of Lord of Destruction\n";
|
||||
const char* ERROR_TESTING1 = "Error : BYTE %02X wanted but %02X found to change memory at %08X\n\n";
|
||||
const char* ERROR_TESTING4 = "Error : DWORD %08X wanted but %08X found to change memory at %08X\n\n";
|
||||
const char* MSG_ERROR_READ_MEMORY = "Error : Read access missing to patch memory at %08X.\n\nAn option in PlugY.ini is incompatible with another mod.";
|
||||
const char* MSG_CRITICAL_WRITE_MEMORY = "Error.\nWrite access missing to patch memory at %08X.\n\nAn option in PlugY.ini is incompatible with another mod.";
|
||||
const char* ERROR_TESTING1 = "Error : BYTE %02X wanted but %02X found to change memory at %08X.\n\nAn option in PlugY.ini is incompatible with another mod.";
|
||||
const char* ERROR_TESTING4 = "Error : DWORD %08X wanted but %08X found to change memory at %08X.\n\nAn option in PlugY.ini is incompatible with another mod.";
|
||||
|
||||
|
||||
void* currentMemoryPos = 0;
|
||||
@ -103,11 +101,13 @@ bool testIfAlreadySet(DWORD current, DWORD wanted)
|
||||
void testMemory4(DWORD old, DWORD found)
|
||||
{
|
||||
if (old != found)
|
||||
{
|
||||
if (active_CheckMemory)
|
||||
{
|
||||
log_box(ERROR_TESTING4, old, found, currentMemoryPos);
|
||||
exit(1);
|
||||
} else log_msg(ERROR_TESTING4, old, found, currentMemoryPos);
|
||||
}
|
||||
}
|
||||
|
||||
void memt_dword(DWORD old, DWORD val)
|
||||
|
@ -5,246 +5,267 @@
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "updateClient.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
#include <direct.h> // _getcwd()
|
||||
|
||||
|
||||
const char* CUBEFORMULA_FILE = "cube.txt";
|
||||
const char * STRING_ERROR="***Error***";
|
||||
|
||||
|
||||
#define BUF (&buf[strlen(buf)])
|
||||
const LPCWSTR STRING_ERROR = L"***Error***";
|
||||
bool InNoSocket;
|
||||
|
||||
#define BUF (&buf[*len])
|
||||
#define PRINT *len += swprintf
|
||||
|
||||
/*
|
||||
6FC9275F |. E8 ECCCFFFF |CALL D2Game.6FC8F450 ; \D2Game.6FC8F450
|
||||
|
||||
|
||||
*/
|
||||
void printOutput(CubeOutput* output, char* buf, BYTE* nbOutputs)
|
||||
void printOutputItem(CubeOutput* output, LPWSTR buf, LPINT len, LPINT nbOutputs)
|
||||
{
|
||||
if (!output->outputType)
|
||||
if (output->outputType == 0)
|
||||
return;
|
||||
if (*nbOutputs)
|
||||
sprintf(BUF," + ");
|
||||
if (*nbOutputs > 0)
|
||||
PRINT(BUF, L" + ");
|
||||
*nbOutputs += 1;
|
||||
|
||||
if (output->outputType == 1) {
|
||||
sprintf(BUF,"Cow Portal");
|
||||
PRINT(BUF, getLocalString(STR_COW_PORTAL));
|
||||
return;
|
||||
} else if (output->outputType == 2) {
|
||||
sprintf(BUF,"Pandemonium Portal");
|
||||
PRINT(BUF, getLocalString(STR_PANDEMONIUM_PORTAL));
|
||||
return;
|
||||
} else if (output->outputType == 3) {
|
||||
sprintf(BUF,"Pandemonium Final Portal");
|
||||
PRINT(BUF, getLocalString(STR_PANDEMONIUM_FINAL_PORTAL));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ((output->quantityOrNbSockets>1) && !output->haveSockets)
|
||||
sprintf(BUF,"%u ", output->quantityOrNbSockets);
|
||||
{
|
||||
if (output->quantityOrNbSockets == 255)
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_FULL));
|
||||
else
|
||||
PRINT(BUF, L"%u ", output->quantityOrNbSockets);
|
||||
}
|
||||
|
||||
if (output->repair)
|
||||
sprintf(BUF,"repair ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_REPAIR));
|
||||
|
||||
if (output->repair && output->recharge)
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_AND));
|
||||
|
||||
if (output->recharge)
|
||||
sprintf(BUF,"recharge ");
|
||||
|
||||
if (output->isEthereal)
|
||||
sprintf(BUF,"ethereal ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_RECHARGE));
|
||||
|
||||
if (output->destroysFillers)
|
||||
sprintf(BUF,"destroys Fillers ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_DESTROY_FILLERS));
|
||||
|
||||
if (output->removeFillers)
|
||||
sprintf(BUF,"remove Fillers ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_REMOVE_FILLERS));
|
||||
|
||||
if (output->regeneratesUnique)
|
||||
sprintf(BUF,"regenerate ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_REGENERATE));
|
||||
|
||||
if (output->upgradeToExceptional)
|
||||
sprintf(BUF,"exceptional ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_UPGRADE_TO_EXCEPTIONAL));
|
||||
|
||||
if (output->upgradeToElite)
|
||||
sprintf(BUF,"elite ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_UPGRADE_TO_ELITE));
|
||||
|
||||
if (output->isEthereal)
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_ETHERAL));
|
||||
|
||||
if (output->isSpecificItem) {
|
||||
if (output->quality == ITEMQUALITY_UNIQUE)
|
||||
{
|
||||
UniqueItemsBIN* uniqueItems = SgptDataTables->uniqueItems + output->specificID-1;
|
||||
LPWSTR string = D2GetStringFromIndex(uniqueItems->uniqueNameId);
|
||||
wcstombs(BUF, string, wcslen(string)+1);
|
||||
PRINT(BUF, D2GetStringFromIndex(uniqueItems->uniqueNameId));
|
||||
} else if (output->quality == ITEMQUALITY_SET) {
|
||||
SetItemsBIN* setItems = SgptDataTables->setItems + output->specificID-1;
|
||||
LPWSTR string = D2GetStringFromIndex(setItems->setNameId);
|
||||
wcstombs(BUF, string, wcslen(string)+1);
|
||||
PRINT(BUF, D2GetStringFromIndex(setItems->setNameId));
|
||||
} else {
|
||||
sprintf(BUF,STRING_ERROR);return;
|
||||
PRINT(BUF,STRING_ERROR);return;
|
||||
}
|
||||
} else {
|
||||
switch (output->quality)
|
||||
{
|
||||
case 1:sprintf(BUF,"Cracked ");break;
|
||||
case 2:sprintf(BUF,"Normal ");break;
|
||||
case 3:sprintf(BUF,"Superior ");break;
|
||||
case 4:sprintf(BUF,"Magic ");break;
|
||||
case 5:sprintf(BUF,"Set ");break;
|
||||
case 6:sprintf(BUF,"Rare ");break;
|
||||
case 7:sprintf(BUF,"Unique ");break;
|
||||
case 8:sprintf(BUF,"Crafted ");break;
|
||||
case 9:sprintf(BUF,"Tempered ");break;
|
||||
case 1:PRINT(BUF, L"%s ", getLocalString(STR_CRACKED));break;
|
||||
case 2:PRINT(BUF, L"%s ", getLocalString(STR_NORMAL));break;
|
||||
case 3:PRINT(BUF, L"%s ", getLocalString(STR_SUPERIOR));break;
|
||||
case 4:PRINT(BUF, L"%s ", getLocalString(STR_MAGIC));break;
|
||||
case 5:PRINT(BUF, L"%s ", getLocalString(STR_SET));break;
|
||||
case 6:PRINT(BUF, L"%s ", getLocalString(STR_RARE));break;
|
||||
case 7:PRINT(BUF, L"%s ", getLocalString(STR_UNIQUE));break;
|
||||
case 8:PRINT(BUF, L"%s ", getLocalString(STR_CRAFTED));break;
|
||||
case 9:PRINT(BUF, L"%s ", getLocalString(STR_TEMPERED));break;
|
||||
}
|
||||
ItemsBIN* items;LPWSTR string;
|
||||
switch (output->outputType)
|
||||
{
|
||||
case 0xFC:
|
||||
items = D2GetItemsBIN(output->ID);
|
||||
string = D2GetStringFromIndex(items->NameStr);
|
||||
wcstombs(BUF, string, wcslen(string)+1);
|
||||
break;
|
||||
case 0xFD:
|
||||
getTypeAString(output->ID,BUF,50);
|
||||
// WCHAR string[50];
|
||||
// getTypeString(input->ID,string,50);
|
||||
// wcstombs(BUF, string, wcslen(string)+1);
|
||||
break;
|
||||
case 0xFE: sprintf(BUF,"Item");break;
|
||||
case 0xFF: sprintf(BUF,"Item of the same type");break;
|
||||
default: sprintf(BUF,STRING_ERROR);return;
|
||||
case 0xFC:
|
||||
{
|
||||
ItemsBIN* items = D2GetItemsBIN(output->ID);
|
||||
PRINT(BUF, StripGender(D2GetStringFromIndex(items->NameStr)));
|
||||
break;
|
||||
}
|
||||
case 0xFD:
|
||||
{
|
||||
ItemTypesBIN* itemTypeData = D2GetItemTypesBIN(output->ID);
|
||||
if (!itemTypeData)
|
||||
PRINT(BUF, L"Unknow Item Type");
|
||||
else
|
||||
PRINT(BUF, getLocalTypeString(itemTypeData->code));
|
||||
break;
|
||||
}
|
||||
case 0xFE: PRINT(BUF, L"%s", getLocalString(STR_ITEM)); break;
|
||||
case 0xFF: PRINT(BUF, L"%s", getLocalString(STR_ITEM_SAME_TYPE)); break;
|
||||
default: PRINT(BUF, L"%s ", STRING_ERROR); return;
|
||||
}
|
||||
}
|
||||
if ((output->quantityOrNbSockets>1) && (output->haveSockets==1))
|
||||
sprintf(BUF," with %u sockets", output->quantityOrNbSockets);
|
||||
if (output->haveSockets == 1 || InNoSocket)
|
||||
{
|
||||
PRINT(BUF, L" ");
|
||||
if (output->quantityOrNbSockets >= 1)
|
||||
PRINT(BUF, getLocalString(STR_WITH_N_SOCKETS), output->quantityOrNbSockets);
|
||||
// else if (output->quantityOrNbSockets == 1)
|
||||
// PRINT(BUF, getLocalString(STR_WITH_ONE_SOCKET));
|
||||
else
|
||||
PRINT(BUF, getLocalString(STR_WITH_SOCKETS));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void printInput(CubeInput* input, char* buf, BYTE* nbInputs)//maxsize)
|
||||
void printInputItem(CubeInput* input, LPWSTR buf, LPINT len, LPINT nbInputs)//maxsize)
|
||||
{
|
||||
if (!input->byItemID && !input->byItemTypeID)
|
||||
return;
|
||||
if (*nbInputs)
|
||||
sprintf(BUF," + ");
|
||||
PRINT(BUF, L" + ");
|
||||
|
||||
BYTE nb = input->quantity > 0 ? input->quantity : 1;
|
||||
*nbInputs += nb;
|
||||
if (nb>1)
|
||||
sprintf(BUF,"%u ", nb);
|
||||
if (nb > 1)
|
||||
PRINT(BUF, L"%u ", nb);
|
||||
|
||||
if (input->isEthereal)
|
||||
sprintf(BUF,"ethereal ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_ETHERAL));
|
||||
|
||||
if (input->isNotEthereal)
|
||||
sprintf(BUF,"not ethereal ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_NOT_ETHERAL));
|
||||
|
||||
if (input->isNotRuneword)
|
||||
sprintf(BUF,"not runeword ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_NOT_RUNEWORD));
|
||||
|
||||
if (input->isBasic)
|
||||
sprintf(BUF,"basic ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_BASIC));
|
||||
|
||||
if (input->isExceptional)
|
||||
sprintf(BUF,"exceptional ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_EXCEPTIONAL));
|
||||
|
||||
if (input->isElite)
|
||||
sprintf(BUF,"elite ");
|
||||
PRINT(BUF, L"%s ", getLocalString(STR_ELITE));
|
||||
|
||||
if (input->isSpecificItem) {
|
||||
if (input->quality == ITEMQUALITY_UNIQUE)
|
||||
{
|
||||
UniqueItemsBIN* uniqueItems = SgptDataTables->uniqueItems + input->specificID-1;
|
||||
LPWSTR string = D2GetStringFromIndex(uniqueItems->uniqueNameId);
|
||||
wcstombs(BUF, string, wcslen(string)+1);
|
||||
} else if (input->quality == ITEMQUALITY_SET) {
|
||||
SetItemsBIN* setItems = SgptDataTables->setItems + input->specificID-1;
|
||||
LPWSTR string = D2GetStringFromIndex(setItems->setNameId);
|
||||
wcstombs(BUF, string, wcslen(string)+1);
|
||||
} else {
|
||||
sprintf(BUF,STRING_ERROR);return;
|
||||
UniqueItemsBIN* uniqueItems = SgptDataTables->uniqueItems + input->specificID - 1;
|
||||
PRINT(BUF, StripGender(D2GetStringFromIndex(uniqueItems->uniqueNameId)));
|
||||
}
|
||||
} else {
|
||||
else if (input->quality == ITEMQUALITY_SET) {
|
||||
SetItemsBIN* setItems = SgptDataTables->setItems + input->specificID - 1;
|
||||
PRINT(BUF, StripGender(D2GetStringFromIndex(setItems->setNameId)));
|
||||
}
|
||||
else {
|
||||
PRINT(BUF, L"%s ", STRING_ERROR); return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (input->quality)
|
||||
{
|
||||
case 1:sprintf(BUF,"Cracked ");break;
|
||||
case 2:sprintf(BUF,"Normal ");break;
|
||||
case 3:sprintf(BUF,"Superior ");break;
|
||||
case 4:sprintf(BUF,"Magic ");break;
|
||||
case 5:sprintf(BUF,"Set ");break;
|
||||
case 6:sprintf(BUF,"Rare ");break;
|
||||
case 7:sprintf(BUF,"Unique ");break;
|
||||
case 8:sprintf(BUF,"Crafted ");break;
|
||||
case 9:sprintf(BUF,"Tempered ");break;
|
||||
case 1:PRINT(BUF, L"%s ", getLocalString(STR_CRACKED)); break;
|
||||
case 2:PRINT(BUF, L"%s ", getLocalString(STR_NORMAL)); break;
|
||||
case 3:PRINT(BUF, L"%s ", getLocalString(STR_SUPERIOR)); break;
|
||||
case 4:PRINT(BUF, L"%s ", getLocalString(STR_MAGIC)); break;
|
||||
case 5:PRINT(BUF, L"%s ", getLocalString(STR_SET)); break;
|
||||
case 6:PRINT(BUF, L"%s ", getLocalString(STR_RARE)); break;
|
||||
case 7:PRINT(BUF, L"%s ", getLocalString(STR_UNIQUE)); break;
|
||||
case 8:PRINT(BUF, L"%s ", getLocalString(STR_CRAFTED)); break;
|
||||
case 9:PRINT(BUF, L"%s ", getLocalString(STR_TEMPERED)); break;
|
||||
}
|
||||
if (input->byItemTypeID) {
|
||||
getTypeAString(input->ID,BUF,50);
|
||||
} else if (input->ID == 0xFFFF) {
|
||||
sprintf(BUF,"Item");
|
||||
} else {
|
||||
ItemTypesBIN* itemTypeData = D2GetItemTypesBIN(input->ID);
|
||||
if (!itemTypeData)
|
||||
PRINT(BUF, L"Unknow Item Type");
|
||||
else
|
||||
PRINT(BUF, getLocalTypeString(itemTypeData->code));
|
||||
}
|
||||
else if (input->ID == 0xFFFF) {
|
||||
PRINT(BUF, getLocalString(STR_ITEM));
|
||||
}
|
||||
else {
|
||||
ItemsBIN* items = D2GetItemsBIN(input->ID);
|
||||
LPWSTR string = D2GetStringFromIndex(items->NameStr);
|
||||
wcstombs(BUF, string, wcslen(string)+1);
|
||||
PRINT(BUF, StripGender(D2GetStringFromIndex(items->NameStr)));
|
||||
}
|
||||
}
|
||||
if (input->includeUpgradedVersions && !input->isElite)
|
||||
sprintf(BUF,"(or upgraded) ");
|
||||
PRINT(BUF, L" %s", getLocalString(STR_INCLUDE_UPGRADED));
|
||||
|
||||
if (input->haveNoSocket)
|
||||
sprintf(BUF," with no socket");
|
||||
|
||||
{
|
||||
PRINT(BUF, L" %s", getLocalString(STR_WITHOUT_SOCKET));
|
||||
InNoSocket = true;
|
||||
}
|
||||
if (input->haveSockets)
|
||||
sprintf(BUF," with sockets");
|
||||
PRINT(BUF, L" %s", getLocalString(STR_WITH_SOCKETS));
|
||||
}
|
||||
|
||||
DWORD print(CubeMainBIN* curForm, char* buf, DWORD)//maxsize)
|
||||
DWORD print(CubeMainBIN* curForm, LPWSTR buf, LPINT len, DWORD)//maxsize)
|
||||
{
|
||||
if (!buf || !curForm || !curForm->enabled) return 0;
|
||||
|
||||
BYTE realNbInputs=0;
|
||||
printInput(&curForm->input1, buf, &realNbInputs);
|
||||
printInput(&curForm->input2, buf, &realNbInputs);
|
||||
printInput(&curForm->input3, buf, &realNbInputs);
|
||||
printInput(&curForm->input4, buf, &realNbInputs);
|
||||
printInput(&curForm->input5, buf, &realNbInputs);
|
||||
printInput(&curForm->input6, buf, &realNbInputs);
|
||||
printInput(&curForm->input7, buf, &realNbInputs);
|
||||
InNoSocket = false;
|
||||
int realNbInputs=0;
|
||||
|
||||
printInputItem(&curForm->input1, buf, len, &realNbInputs);
|
||||
printInputItem(&curForm->input2, buf, len, &realNbInputs);
|
||||
printInputItem(&curForm->input3, buf, len, &realNbInputs);
|
||||
printInputItem(&curForm->input4, buf, len, &realNbInputs);
|
||||
printInputItem(&curForm->input5, buf, len, &realNbInputs);
|
||||
printInputItem(&curForm->input6, buf, len, &realNbInputs);
|
||||
printInputItem(&curForm->input7, buf, len, &realNbInputs);
|
||||
|
||||
if (realNbInputs != curForm->numinputs)
|
||||
{
|
||||
sprintf(BUF," *** ERROR : numInputs(%d) != realNbInputs(%d) ***", curForm->numinputs, realNbInputs);
|
||||
return 1;
|
||||
}
|
||||
PRINT(BUF,L" => ");
|
||||
int realNbOutputs=0;
|
||||
|
||||
sprintf(BUF," => ");
|
||||
BYTE realNbOutputs=0;
|
||||
printOutput(&curForm->output1, buf, &realNbOutputs);
|
||||
printOutput(&curForm->output2, buf, &realNbOutputs);
|
||||
printOutput(&curForm->output3, buf, &realNbOutputs);
|
||||
printOutputItem(&curForm->output1, buf, len, &realNbOutputs);
|
||||
printOutputItem(&curForm->output2, buf, len, &realNbOutputs);
|
||||
printOutputItem(&curForm->output3, buf, len, &realNbOutputs);
|
||||
|
||||
|
||||
// if (curForm->ladder)
|
||||
// sprintf(BUF," [ladder only]");
|
||||
|
||||
|
||||
if (curForm->minDiff == 1)
|
||||
sprintf(BUF," [Nightmare and Hell only]");
|
||||
PRINT(BUF, L" %s", getLocalString(STR_ONLY_N_H));
|
||||
else if (curForm->minDiff == 2)
|
||||
sprintf(BUF," [Hell only]");
|
||||
PRINT(BUF, L" %s", getLocalString(STR_ONLY_HELL));
|
||||
|
||||
if (curForm->playerClass != 0xFF)
|
||||
{
|
||||
CharStatsBIN* charStats = D2GetCharStatsBIN(curForm->playerClass);
|
||||
sprintf(BUF, " [%s only]", charStats->name);
|
||||
PRINT(BUF, L" (");
|
||||
PRINT(BUF, getLocalString(STR_ONLY_CLASS), charStats->name);
|
||||
PRINT(BUF, L")");
|
||||
}
|
||||
|
||||
|
||||
if ((curForm->op>0) && (curForm->op!=28))
|
||||
sprintf(BUF, " [op%d(%d,%d)]", curForm->op, curForm->param, curForm->value);
|
||||
PRINT(BUF, L" [op%d(%d,%d)]", curForm->op, curForm->param, curForm->value);
|
||||
|
||||
// if (curForm->version == 100)
|
||||
// sprintf(BUF, " [expansion only]");
|
||||
|
||||
if (realNbInputs != curForm->numinputs)
|
||||
PRINT(BUF, L" *** ERROR : numInputs(%d) != realNbInputs(%d) ***", curForm->numinputs, realNbInputs);
|
||||
|
||||
return 1;
|
||||
}
|
||||
#undef BUF
|
||||
@ -253,54 +274,51 @@ DWORD print(CubeMainBIN* curForm, char* buf, DWORD)//maxsize)
|
||||
|
||||
void listAllCubeFormula()
|
||||
{
|
||||
log_msg("\n\n********** Print all cube formula **********\n");
|
||||
|
||||
char filename[MAX_PATH];
|
||||
_getcwd( filename, MAX_PATH );
|
||||
if( filename[strlen(filename)] != '\\')
|
||||
strcat(filename, "\\");
|
||||
D2FogGetSavePath(filename, MAX_PATH);
|
||||
strcat(filename, CUBEFORMULA_FILE);
|
||||
|
||||
FILE* file = fopen(filename, "w");
|
||||
if (!file)
|
||||
{
|
||||
log_msg("Failed to open save file.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!file) return;
|
||||
|
||||
log_msg("\n\n********** Print all cube formula **********\n");//SgptDataTables->nbCubemain\n"
|
||||
|
||||
int nbLines = D2GetNbCubeMainBIN();//SgptDataTables->nbCubemain
|
||||
int nbLines = D2GetNbCubeMainBIN();
|
||||
log_msg("nbLines : %d\n",nbLines);
|
||||
|
||||
char buf[300];
|
||||
WCHAR buf[512];
|
||||
|
||||
// Print BOM UTF-16
|
||||
//buf[0] = 0xFEFF;
|
||||
//buf[1] = NULL;
|
||||
//write(buf, 2, 2, file);
|
||||
|
||||
// Print BOM UTF-8
|
||||
//printf(file, "");
|
||||
|
||||
int len = 0;
|
||||
int nbCubeReceipt = 0;
|
||||
int line = 0;
|
||||
for (int i=0; i<nbLines; i++)
|
||||
{
|
||||
buf[0]=NULL;
|
||||
DWORD res = print(D2GetCubeMainBIN(i), buf, 300);//SgptDataTables->cubemain + i;
|
||||
if (res) fprintf(file,"%4u: %s\n",i,buf);
|
||||
if (res) fflush(file);
|
||||
DWORD res = 1;
|
||||
len = 0;
|
||||
buf[len] = NULL;
|
||||
res = print(D2GetCubeMainBIN(i), buf, &len, 512);
|
||||
//wcstombs(bufa, buf, 1024);
|
||||
if (res)
|
||||
{
|
||||
nbCubeReceipt++;
|
||||
fwprintf(file, L"%3u: %s\n", ++line, buf);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
log_msg("\n********** Printing over **********\n\n");
|
||||
|
||||
/* _getcwd( filename, MAX_PATH );
|
||||
if( filename[strlen(filename)] != '\\')
|
||||
strcat(filename, "\\");
|
||||
strcat(filename, "tmp.txt");
|
||||
|
||||
file = fopen(filename, "w");
|
||||
|
||||
ItemStatCostBIN* itemStatCost;
|
||||
LPWSTR lpText;
|
||||
for (i=0;i<=STATS_ITEM_CHARGED_SKILL_MOD;i++)
|
||||
{
|
||||
buf[0]='\0';
|
||||
itemStatCost = D2GetItemStatCostBIN(i);
|
||||
lpText = D2GetStringFromIndex(itemStatCost->descstrpos);
|
||||
wcstombs(&buf[0],lpText,100);
|
||||
strcat(buf,"\t - \t");
|
||||
lpText = D2GetStringFromIndex(itemStatCost->descstrneg);
|
||||
wcstombs(&buf[strlen(buf)],lpText,100);
|
||||
fprintf(file,"%03d %03X \t- %s\n",i,i,buf);
|
||||
}
|
||||
fclose(file);*/
|
||||
}
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -5,15 +5,14 @@
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "updateServer.h" // Install_UpdateServer()
|
||||
#include "plugYFiles.h" // Install_PlugYImagesFiles()
|
||||
#include "statsPoints.h"
|
||||
#include "newInterfaces.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
#define NB_RUNES_PER_PAGE 25
|
||||
|
||||
#define getXCloseBtn() 360
|
||||
@ -55,6 +54,7 @@ static struct
|
||||
};
|
||||
};
|
||||
} isDownBtn;
|
||||
*/
|
||||
|
||||
|
||||
void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
@ -66,7 +66,7 @@ void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
D2SetFont(6);
|
||||
DWORD nbPixel = D2GetPixelLen(lpText);
|
||||
DWORD x1 = (nbPixel >= 195) ? 0 : 195-nbPixel;
|
||||
D2PrintString(lpText, x1, 10 + pos*20, GOLD, 0);//MILIEU(0x00,0x70,nbPixel)
|
||||
D2PrintString(lpText, posXRunesList + RX(x1), posYRunesList + 10 + pos*20, GOLD, 0);//MILIEU(0x00,0x70,nbPixel)
|
||||
|
||||
typesList[0]=L'\0';
|
||||
DWORD numItype=0;
|
||||
@ -74,14 +74,15 @@ void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
{
|
||||
WORD type = runesData->Itypes[numItype];
|
||||
if (!type) break;
|
||||
getTypeUString(type,temp,50);
|
||||
ItemTypesBIN* itemTypeData = D2GetItemTypesBIN(type);
|
||||
LPCWSTR typeName = getLocalTypeString(itemTypeData->code);
|
||||
if (numItype) wcscat(typesList,L"/");
|
||||
wcscat(typesList,temp);
|
||||
wcscat(typesList, typeName);
|
||||
numItype++;
|
||||
}
|
||||
nbPixel = D2GetPixelLen(typesList);
|
||||
x1 = (nbPixel >= 195) ? 0 : 195-nbPixel;
|
||||
D2PrintString(typesList, x1, 20 + pos*20, WHITE, 0);//MILIEU(0x70,0xA0,nbPixel)
|
||||
D2PrintString(typesList, posXRunesList + RX(x1), posYRunesList + 20 + pos*20, WHITE, 0);//MILIEU(0x70,0xA0,nbPixel)
|
||||
|
||||
runesList[0]=L'\0';
|
||||
DWORD numRune=0;
|
||||
@ -116,7 +117,7 @@ void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
}
|
||||
|
||||
// x1 = (nbPixel < 145) ? 155 : 300-nbPixel;
|
||||
D2PrintString(runesList, x1, y1 + pos*20, WHITE, 0);//MILIEU(0xD0,0xA0,nbPixel)
|
||||
D2PrintString(runesList, posXRunesList + RX(x1), posYRunesList + y1 + pos*20, WHITE, 0);//MILIEU(0xD0,0xA0,nbPixel)
|
||||
}
|
||||
|
||||
|
||||
@ -124,48 +125,58 @@ void printRuneword(RunesBIN* runesData, DWORD pos)
|
||||
//6FB21FAA
|
||||
void STDCALL printRunewordsPage()
|
||||
{
|
||||
if (!D2isLODGame() || !D2GetResolution()) return D2PrintStatsPage();
|
||||
|
||||
if (!D2isLODGame()) return D2PrintStatsPage();
|
||||
|
||||
LPWSTR lpText;
|
||||
bDontPrintBorder = true;
|
||||
bDontPrintBorder = D2GetResolution()? true : false;
|
||||
|
||||
//Init data for print image
|
||||
sDrawImageInfo data;
|
||||
ZeroMemory(&data,sizeof(data));
|
||||
|
||||
//print background
|
||||
/* setImage(&data, newStatsInterfaceImages);
|
||||
fillRect(RX(0), RY(ResolutionY), 512, 768, 0, 5);
|
||||
setImage(&data, newStatsInterfaceImages);
|
||||
setFrame(&data, 0);
|
||||
D2PrintImage(&data, 0, 256, -1, 5, 0);
|
||||
D2PrintImage(&data, RX(0), RY(ResolutionY-256), -1, 5, 0);
|
||||
setFrame(&data, 1);
|
||||
D2PrintImage(&data, 256,256, -1, 5, 0);
|
||||
D2PrintImage(&data, RX(256),RY(ResolutionY-256), -1, 5, 0);
|
||||
setFrame(&data, 2);
|
||||
D2PrintImage(&data, 0, 512, -1, 5, 0);
|
||||
D2PrintImage(&data, RX(0), RY(ResolutionY-256*2), -1, 5, 0);
|
||||
setFrame(&data, 3);
|
||||
D2PrintImage(&data, 256,512, -1, 5, 0);
|
||||
D2PrintImage(&data, RX(256),RY(ResolutionY-256*2), -1, 5, 0);
|
||||
setFrame(&data, 4);
|
||||
D2PrintImage(&data, 0, 552, -1, 5, 0);
|
||||
D2PrintImage(&data, RX(0), RY(ResolutionY-256*3), -1, 5, 0);
|
||||
setFrame(&data, 5);
|
||||
D2PrintImage(&data, 256,552, -1, 5, 0);
|
||||
*/
|
||||
fillRect(0,0,400,552,0,5);
|
||||
D2PrintImage(&data, RX(256),RY(ResolutionY-256*3), -1, 5, 0);
|
||||
|
||||
if (printBackgroundOnMainPage)
|
||||
{
|
||||
setImage(&data, statsBackgroundImages);
|
||||
setFrame(&data, 1);
|
||||
D2PrintImage(&data, getXPreviousPageBtn()-7, getYPreviousPageBtn()+8, -1, 5, 0);
|
||||
D2PrintImage(&data, getXPrevRunesBtn()-7, getYPrevRunesBtn()+8, -1, 5, 0);
|
||||
}
|
||||
|
||||
//print button close
|
||||
setImage(&data, D2LoadBuySelBtn());
|
||||
setFrame(&data, 10 + isDownBtn.close);
|
||||
D2PrintImage(&data, getXCloseBtn(), getYCloseBtn(), -1, 5, 0);
|
||||
|
||||
|
||||
//print previous page button
|
||||
setFrame(&data, 12 + isDownBtn.previousPage);
|
||||
D2PrintImage(&data, getXPreviousPageBtn(), getYPreviousPageBtn(), -1, 5, 0);
|
||||
|
||||
//print next page button
|
||||
setFrame(&data, isDownBtn.nextPage);
|
||||
setFrame(&data, 14 + isDownBtn.nextPage);
|
||||
D2PrintImage(&data, getXNextPageBtn(), getYNextPageBtn(), -1, 5, 0);
|
||||
|
||||
//print previous runes button
|
||||
setImage(&data, stashBtnsImages);
|
||||
setFrame(&data, isDownBtn.prevRunes);
|
||||
setFrame(&data, 12 + isDownBtn.prevRunes);
|
||||
D2PrintImage(&data, getXPrevRunesBtn(), getYPrevRunesBtn(), -1, 5, 0);
|
||||
|
||||
//print previous runes button
|
||||
setFrame(&data, 2 + isDownBtn.nextRunes);
|
||||
setFrame(&data, 14 + isDownBtn.nextRunes);
|
||||
D2PrintImage(&data, getXNextRunesBtn(), getYNextRunesBtn(), -1, 5, 0);
|
||||
|
||||
D2SetFont(6);
|
||||
@ -175,18 +186,18 @@ void STDCALL printRunewordsPage()
|
||||
RunesBIN* runesFirst = nbRunes>1 ? D2GetRunesBIN(1)-1 : NULL;
|
||||
RunesBIN* runesLast = runesFirst? runesFirst + nbRunes : NULL;
|
||||
// log_msg("nbRunes(%d,%d) runesFirst(%08X, %08X) runesLast(%08X, %08X)",nbRunes,SgptDataTables->nbRunes,runesFirst, SgptDataTables->runes,runesLast,SgptDataTables->runes + SgptDataTables->nbRunes);
|
||||
|
||||
|
||||
int nbRunesCompleted=0;
|
||||
DWORD curNbRunes=0;
|
||||
for ( RunesBIN* runesData = runesFirst; runesData < runesLast; runesData++)
|
||||
{
|
||||
if (!runesData->Complete || runesData->Server) continue;
|
||||
nbRunesCompleted++;
|
||||
if ( (curRunesPage * NB_RUNES_PER_PAGE < nbRunesCompleted) &&
|
||||
(nbRunesCompleted <= (curRunesPage+1) * NB_RUNES_PER_PAGE) )
|
||||
if ( (curRunesPage * runesPerPage < nbRunesCompleted) &&
|
||||
(nbRunesCompleted <= (curRunesPage+1) * runesPerPage) )
|
||||
printRuneword(runesData, curNbRunes++);
|
||||
}
|
||||
maxRunesPage = nbRunesCompleted ? (nbRunesCompleted-1) / NB_RUNES_PER_PAGE : 0;
|
||||
maxRunesPage = nbRunesCompleted ? (nbRunesCompleted-1) / runesPerPage : 0;
|
||||
|
||||
|
||||
//////////////////// POPUP PRINTING ////////////////////
|
||||
@ -198,11 +209,26 @@ void STDCALL printRunewordsPage()
|
||||
{
|
||||
D2PrintPopup(D2GetStringFromIndex(0x1030), getXCloseBtn()+getLCloseBtn()/2, getYCloseBtn()-getHCloseBtn(), WHITE, 1);
|
||||
}
|
||||
else if (isOnPreviousPageBtn(x,y)) //print popup "previous page"
|
||||
{
|
||||
lpText = getLocalString(STR_PREVIOUS_PAGE);
|
||||
D2PrintPopup(lpText, getXPreviousPageBtn()+getLPreviousPageBtn()/2, getYPreviousPageBtn()-getHPreviousPageBtn(), WHITE, 1);
|
||||
}
|
||||
else if (isOnNextPageBtn(x,y)) // print popup "next page"
|
||||
{
|
||||
lpText = getTranslatedString(STR_NEXT_PAGE);
|
||||
lpText = getLocalString(STR_NEXT_PAGE);
|
||||
D2PrintPopup(lpText, getXNextPageBtn()+getLNextPageBtn()/2, getYNextPageBtn()-getHNextPageBtn(), WHITE, 1);
|
||||
}
|
||||
else if (isOnPrevRunesBtn(x,y)) // print popup "previous rune"
|
||||
{
|
||||
lpText = getLocalString(STR_PREVIOUS_RUNE);
|
||||
D2PrintPopup(lpText, getXPrevRunesBtn()+getLPrevRunesBtn()/2, getYPrevRunesBtn()-getHPrevRunesBtn(), WHITE, 1);
|
||||
}
|
||||
else if (isOnNextRunesBtn(x,y)) // print popup "next rune"
|
||||
{
|
||||
lpText = getLocalString(STR_NEXT_RUNE);
|
||||
D2PrintPopup(lpText, getXNextRunesBtn()+getLNextRunesBtn()/2, getYNextRunesBtn()-getHNextRunesBtn(), WHITE, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -211,27 +237,30 @@ DWORD STDCALL mouseRunewordsPageLeftDown(sWinMessage* msg)
|
||||
{
|
||||
if (!D2isLODGame() || !D2GetResolution()) return -1;
|
||||
|
||||
if (!isOnStatsPage(msg->x,msg->y)) return 1;
|
||||
DWORD x = D2GetMouseX();
|
||||
DWORD y = D2GetMouseY();
|
||||
if (!isOnStatsPage(x,y))
|
||||
return 1;
|
||||
|
||||
if (isOnCloseBtn(msg->x,msg->y))
|
||||
if (isOnCloseBtn(x,y))
|
||||
{
|
||||
log_msg("push down left button close\n");
|
||||
isDownBtn.close = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
}
|
||||
else if (isOnNextPageBtn(msg->x,msg->y))
|
||||
else if (isOnNextPageBtn(x,y))
|
||||
{
|
||||
log_msg("push down left button next page\n");
|
||||
isDownBtn.nextPage = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
}
|
||||
else if (isOnPrevRunesBtn(msg->x,msg->y))
|
||||
else if (isOnPrevRunesBtn(x,y))
|
||||
{
|
||||
log_msg("push down left button prev page\n");
|
||||
isDownBtn.prevRunes = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
}
|
||||
else if (isOnNextRunesBtn(msg->x,msg->y))
|
||||
else if (isOnNextRunesBtn(x,y))
|
||||
{
|
||||
log_msg("push down left button next runes\n");
|
||||
isDownBtn.nextRunes = 1;
|
||||
@ -247,24 +276,30 @@ DWORD STDCALL mouseRunewordsPageLeftUp(sWinMessage* msg)
|
||||
{
|
||||
if (!D2isLODGame() || !D2GetResolution()) return -1;
|
||||
|
||||
if (!isOnStatsPage(msg->x,msg->y)) return 1;
|
||||
DWORD x = D2GetMouseX();
|
||||
DWORD y = D2GetMouseY();
|
||||
if (!isOnStatsPage(x,y))
|
||||
return 1;
|
||||
|
||||
if (isOnCloseBtn(msg->x,msg->y))
|
||||
if (isOnCloseBtn(x,y))
|
||||
{
|
||||
log_msg("push up left button close\n");
|
||||
if (isDownBtn.close)
|
||||
D2TogglePage(2,1,0);
|
||||
}
|
||||
else if (isOnNextPageBtn(msg->x,msg->y))
|
||||
else if (isOnNextPageBtn(x,y))
|
||||
{
|
||||
log_msg("push up left button next page\n");
|
||||
if (isDownBtn.nextPage)
|
||||
{
|
||||
GoStatPage(GetCurrentPage()+1);
|
||||
if (extraHiddenPage>1)
|
||||
GoStatPage(GetCurrentPage()+1);
|
||||
else
|
||||
GoStatPage(0);
|
||||
log_msg("next page press\n");
|
||||
}
|
||||
}
|
||||
else if (isOnPrevRunesBtn(msg->x,msg->y))
|
||||
else if (isOnPrevRunesBtn(x,y))
|
||||
{
|
||||
log_msg("push up left button prev runes\n");
|
||||
if (isDownBtn.prevRunes)
|
||||
@ -272,7 +307,7 @@ DWORD STDCALL mouseRunewordsPageLeftUp(sWinMessage* msg)
|
||||
if (curRunesPage) curRunesPage--;
|
||||
}
|
||||
}
|
||||
else if (isOnNextRunesBtn(msg->x,msg->y))
|
||||
else if (isOnNextRunesBtn(x,y))
|
||||
{
|
||||
log_msg("push up left button next runes\n");
|
||||
if (isDownBtn.nextRunes)
|
||||
|
@ -5,16 +5,15 @@
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "updateServer.h" // Install_UpdateServer()
|
||||
#include "plugYFiles.h" // Install_PlugYImagesFiles()
|
||||
#include "statsPoints.h"
|
||||
#include "newInterfaces.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/*
|
||||
#define getXCloseBtn() 360
|
||||
#define getLCloseBtn() 32
|
||||
#define getYCloseBtn() (ResolutionY - 60)
|
||||
@ -94,6 +93,7 @@ void** ptD2AssignStatsPointsBtnImages = (void**)0x6FBB5BB4;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
static struct
|
||||
{
|
||||
union{
|
||||
@ -113,13 +113,14 @@ static struct
|
||||
};
|
||||
};
|
||||
} isDownBtn;
|
||||
*/
|
||||
|
||||
|
||||
void print2Lines(WORD id, LPWSTR lpText, DWORD x, DWORD l, DWORD y)
|
||||
{
|
||||
wcsncpy(lpText, D2GetStringFromIndex(id), 0x63);
|
||||
lpText[0x64]= L'\0';
|
||||
|
||||
|
||||
LPWSTR lptmp = lpText;
|
||||
while (*lptmp)
|
||||
{
|
||||
@ -147,7 +148,7 @@ void print2Lines(WORD id, LPWSTR lpText, DWORD x, DWORD l, DWORD y)
|
||||
void STDCALL printNewStatsPage()
|
||||
{
|
||||
if (!D2isLODGame() || !D2GetResolution()) return D2PrintStatsPage();
|
||||
|
||||
|
||||
WCHAR text[BUFSIZE];
|
||||
LPWSTR lpText;
|
||||
DWORD nbPixel;
|
||||
@ -349,7 +350,7 @@ if (version_D2Client <= V110)
|
||||
|
||||
//print Hit Point
|
||||
curValue = D2GetPlayerStat(ptChar, STATS_HP, 0) / 256;
|
||||
if ((ptChar->CurrentAnim != 0x11) && !curValue) curValue=1;
|
||||
if ((ptChar->mode != UNIT_MODE_DEAD) && !curValue) curValue=UNIT_MODE_NEUTRAL;
|
||||
|
||||
swprintf(text,L"%ld",curValue);
|
||||
|
||||
@ -525,7 +526,7 @@ if (version_D2Client <= V110)
|
||||
D2PrintImage(&data, getXAssVITBtn(), getYAssVITBtn(), -1, 5, 0);
|
||||
D2PrintImage(&data, getXAssENEBtn(), getYAssENEBtn(), -1, 5, 0);
|
||||
}
|
||||
|
||||
|
||||
if (active_StatsPoints && !onRealm)
|
||||
{
|
||||
setImage(&data, D2AssignStatsPointsBoxImages);
|
||||
@ -573,12 +574,12 @@ if (version_D2Client <= V110)
|
||||
}
|
||||
else if (isOnPreviousPageBtn(x,y)) //print popup "previous page"
|
||||
{
|
||||
lpText = getTranslatedString(STR_PREVIOUS_PAGE);
|
||||
lpText = getLocalString(STR_PREVIOUS_PAGE);
|
||||
D2PrintPopup(lpText, getXPreviousPageBtn()+getLPreviousPageBtn()/2, getYPreviousPageBtn()-getHPreviousPageBtn(), WHITE, 1);
|
||||
}
|
||||
else if (isOnNextPageBtn(x,y)) //print popup "next page"
|
||||
{
|
||||
lpText = getTranslatedString(STR_NEXT_PAGE);
|
||||
lpText = getLocalString(STR_NEXT_PAGE);
|
||||
D2PrintPopup(lpText, getXNextPageBtn()+getLNextPageBtn()/2, getYNextPageBtn()-getHNextPageBtn(), WHITE, 1);
|
||||
}
|
||||
else if (isOnRect(x, y, 0xAD, 0x137, 0x15, 0x13))
|
||||
@ -586,9 +587,9 @@ if (version_D2Client <= V110)
|
||||
if ( version_D2Client <= V110 )
|
||||
{
|
||||
DWORD avgChanceMonsterWillHitYou=53;//TODO
|
||||
if (avgChanceMonsterWillHitYou<5) avgChanceMonsterWillHitYou = 5;
|
||||
if (avgChanceMonsterWillHitYou<5) avgChanceMonsterWillHitYou = 5;
|
||||
else if (avgChanceMonsterWillHitYou>95) avgChanceMonsterWillHitYou = 95;
|
||||
|
||||
|
||||
int chanceToBlock = D2GetChanceToBlock(ptChar, D2isLODGame());
|
||||
if (chanceToBlock <= 0)
|
||||
{
|
||||
@ -702,8 +703,8 @@ DWORD STDCALL mouseNewStatsPageLeftDown(sWinMessage* msg)
|
||||
void sendAssignStats(DWORD code, DWORD nbStatPointsRemaining)
|
||||
{
|
||||
DWORD nbPoints = GetKeyState(VK_SHIFT)<0? nbStatPointsRemaining : 1;
|
||||
if (active_StatsShiftClickLimit && (nbPoints>limitValueToShiftClick))
|
||||
nbPoints = limitValueToShiftClick;
|
||||
if (active_StatsShiftClickLimit && (nbPoints>limitValueToShiftClick))
|
||||
nbPoints = limitValueToShiftClick;
|
||||
while ( nbPoints>0 )
|
||||
{
|
||||
DWORD nbTemp = nbPoints > 0x20 ? 0x20 : nbPoints;
|
||||
@ -746,7 +747,7 @@ DWORD STDCALL mouseNewStatsPageLeftUp(sWinMessage* msg)
|
||||
}
|
||||
}
|
||||
else if (nbStatPointsRemaining)
|
||||
{
|
||||
{
|
||||
if (isOnAssSTRBtn(msg->x,msg->y))
|
||||
{
|
||||
log_msg("push up left button assign strengh\n");
|
||||
|
@ -5,15 +5,14 @@
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "updateServer.h"
|
||||
#include "plugYFiles.h"
|
||||
#include "statsPoints.h"
|
||||
#include "newInterfaces.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
#define getXCloseBtn() RX(0x110)
|
||||
#define getLCloseBtn() 32
|
||||
#define getYCloseBtn() RY(0x40)
|
||||
@ -31,10 +30,13 @@
|
||||
#define getYNextPageBtn() RY(0x40)
|
||||
#define getHNextPageBtn() 32
|
||||
#define isOnNextPageBtn(x,y) isOnRect(x, y, getXNextPageBtn(), getYNextPageBtn(), getLNextPageBtn(), getHNextPageBtn())
|
||||
*/
|
||||
|
||||
const char * STATS_INTERFACE_FILENAME = "PlugY\\statsinterface.txt";
|
||||
|
||||
#define BUFSIZE 0x80
|
||||
#define BUFSIZE 0x400
|
||||
|
||||
/*
|
||||
static struct
|
||||
{
|
||||
union{
|
||||
@ -46,6 +48,7 @@ static struct
|
||||
};
|
||||
};
|
||||
} isDownBtn;
|
||||
*/
|
||||
|
||||
|
||||
struct statsInterfaceBIN
|
||||
@ -60,12 +63,12 @@ struct statsInterfaceBIN
|
||||
};
|
||||
|
||||
extern int lastPage;
|
||||
int nbStatsInterface;
|
||||
statsInterfaceBIN* statsInterface;
|
||||
int nbStatsInterface = 0;
|
||||
statsInterfaceBIN* statsInterface = NULL;
|
||||
|
||||
void loadStatsInterfaceDesc(DWORD mempool)
|
||||
{
|
||||
log_msg("loadStatsInterfaceDesc(%d)\n",mempool);
|
||||
log_msg("loadStatsInterfaceDesc(%d)\n", mempool);
|
||||
|
||||
CREATE_TABLE_DESCRIPTION(8);
|
||||
ADD_WORD_FIELD(0, "enabled");
|
||||
@ -77,12 +80,50 @@ void loadStatsInterfaceDesc(DWORD mempool)
|
||||
// ADD_LOOKUP_WORD(10, "stat", lookupItemStatCost);
|
||||
ADD_WORD_FIELD(12, "statID");
|
||||
ADD_TERM_FIELD();
|
||||
BUILD_BIN(statsInterfaceBIN, statsInterface, nbStatsInterface, "PlugY\\statsinterface.txt");
|
||||
BUILD_BIN(statsInterfaceBIN, statsInterface, nbStatsInterface, STATS_INTERFACE_FILENAME);
|
||||
//statsInterface = (statsInterfaceBIN*)compileTxtFile(mempool, STATS_INTERFACE_FILENAME, TableDesc, (DWORD*)&nbStatsInterface, sizeof(statsInterfaceBIN));
|
||||
|
||||
/*
|
||||
int nbSize=0;
|
||||
char* data = (char*)D2ReadFile(mempool, STATS_INTERFACE_FILENAME, (DWORD*)&nbSize, __FILE__, __LINE__);
|
||||
if (!data || nbSize <= 0)
|
||||
{
|
||||
D2FogAssert("statsinterface.txt missing", D2GetInstructionPointer(), __LINE__);
|
||||
exit(1);
|
||||
}
|
||||
//statsInterface = (statsInterfaceBIN*)compileTxtFile(mempool, STATS_INTERFACE_FILENAME, TableDesc, (DWORD*)&nbStatsInterface, sizeof(statsInterfaceBIN));
|
||||
//statsInterface = (statsInterfaceBIN*)compileTxtFile((DWORD)nbSize, data, TableDesc, (DWORD*)&nbStatsInterface, sizeof(statsInterfaceBIN));
|
||||
*/
|
||||
/*
|
||||
nbStatsInterface = 0;
|
||||
for (int i = 0; i<nbSize;i++)
|
||||
if (data[i] == '\n') nbStatsInterface++;
|
||||
if (data[nbSize - 1] != '\n') nbStatsInterface++;
|
||||
nbStatsInterface--;
|
||||
|
||||
statsInterface = (statsInterfaceBIN*)D2FogMemAlloc(nbStatsInterface * sizeof(statsInterfaceBIN),__FILE__,__LINE__,0);
|
||||
|
||||
strtok(data,"\n");
|
||||
for (i=0; i<nbStatsInterface; i++)
|
||||
{
|
||||
strtok(NULL,"\t");
|
||||
statsInterface[i].enabled = atoi(strtok(NULL,"\t"));
|
||||
statsInterface[i].page = atoi(strtok(NULL,"\t"));
|
||||
statsInterface[i].x = atoi(strtok(NULL,"\t"));
|
||||
statsInterface[i].y = atoi(strtok(NULL,"\t"));
|
||||
statsInterface[i].color = atoi(strtok(NULL,"\t"));
|
||||
statsInterface[i].font = atoi(strtok(NULL,"\t"));
|
||||
statsInterface[i].statsID = atoi(strtok(NULL,"\t"));
|
||||
strtok(NULL,"\n");
|
||||
log_msg("stats : %d, %d, %d, %d, %d, %d, %d\n", statsInterface[i].enabled, statsInterface[i].page, statsInterface[i].x, statsInterface[i].y, statsInterface[i].color, statsInterface[i].font, statsInterface[i].statsID);
|
||||
}
|
||||
*/
|
||||
lastPage = 0;
|
||||
for (i=0; i<nbStatsInterface; i++)
|
||||
if (statsInterface[i].page > lastPage)
|
||||
lastPage = statsInterface[i].page;
|
||||
|
||||
log_msg("loadStatsInterfaceDesc - fin\n");
|
||||
}
|
||||
|
||||
void freeStatsInterfaceDesc()
|
||||
@ -97,10 +138,164 @@ void freeStatsInterfaceDesc()
|
||||
}
|
||||
}
|
||||
|
||||
void printCharacterBreakpoints(Unit* ptChar, DWORD x, DWORD y, DWORD color, LPWSTR lpText)
|
||||
{
|
||||
CharStatsBIN* charStatsBIN = D2GetCharStatsBIN(ptChar->nPlayerClass);
|
||||
swprintf(lpText, L"%s : %s", getLocalString(STR_BREAKPOINTS), charStatsBIN->nameU);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=33;
|
||||
D2SetFont(6);
|
||||
|
||||
LPWSTR sBreakpoint = getLocalString(STR_BREAKPOINT);
|
||||
LPWSTR sBlockFrames = getLocalString(STR_BLOCK_FRAMES);
|
||||
LPWSTR sCastingFrames = getLocalString(STR_CASTING_FRAMES);
|
||||
LPWSTR sHitRecoveryFrames = getLocalString(STR_HIT_RECOVERY_FRAMES);
|
||||
|
||||
LPWSTR s1HSwingingWeapon = getLocalString(STR_1H_SWINGING_WEAPON);
|
||||
LPWSTR sOtherWeapon = getLocalString(STR_OTHER_WEAPONS);
|
||||
LPWSTR sHumanForm = getLocalString(STR_HUMAN_FORM);
|
||||
LPWSTR sBearForm = getLocalString(STR_BEAR_FORM);
|
||||
LPWSTR sWolfForm = getLocalString(STR_WOLF_FORM);
|
||||
LPWSTR sVampireForm = getLocalString(STR_VAMPIRE_FORM);
|
||||
|
||||
LPWSTR sHolyShield = D2GetStringFromIndex(0x12EC);
|
||||
LPWSTR sSpearsAndStaves= getLocalString(STR_SPEARS_AND_STAVES);
|
||||
LPWSTR sLightningAndChainLightnings = getLocalString(STR_LIGHTNING_CHAIN_LIGHTNING);
|
||||
|
||||
switch (ptChar->nPlayerClass)
|
||||
{
|
||||
case D2PC_AMAZON:
|
||||
swprintf(lpText, L"%s:%s\n%s - %s: %d", sBreakpoint, L"4 6 11 15 23 29 40 56 80 120 200 480", sBlockFrames, s1HSwingingWeapon, 17);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"13 32 86 600", sBlockFrames, sOtherWeapon, 5);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"7 14 22 32 48 68 99 152", sCastingFrames, 19);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"6 13 20 32 52 86 174 600", sHitRecoveryFrames, 11);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
break;
|
||||
|
||||
case D2PC_ASSASSIN:
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"13 32 86 600", sBlockFrames, 5);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"8 16 27 42 65 102 174", sCastingFrames, 16);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"7 15 27 48 86 200", sHitRecoveryFrames, 9);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
break;
|
||||
|
||||
case D2PC_BARBARIAN:
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"9 20 42 86 280", sBlockFrames, 7);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"9 20 37 63 105 200", sCastingFrames, 13);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"7 15 27 48 86 200", sHitRecoveryFrames, 9);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
break;
|
||||
|
||||
case D2PC_DRUID:
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"6 13 20 32 52 86 174 600", sBlockFrames, sHumanForm, 11);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"5 10 16 27 40 65 109 223", sBlockFrames, sBearForm, 12);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"7 15 27 48 86 200", sBlockFrames, sWolfForm, 9);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"4 10 19 30 46 68 99 163", sCastingFrames, sHumanForm, 18);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"7 15 26 40 63 99 163", sCastingFrames, sBearForm, 16);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"6 14 26 40 60 95 157", sCastingFrames, sWolfForm, 16);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"3 7 13 19 29 42 63 99 174 456", sHitRecoveryFrames, s1HSwingingWeapon, 14);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"5 10 16 26 39 56 86 152 377", sHitRecoveryFrames, sOtherWeapon, 13);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"5 10 16 24 37 54 86 152 360", sHitRecoveryFrames, sBearForm, 13);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"9 20 42 86 280", sHitRecoveryFrames, sWolfForm, 7);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
break;
|
||||
|
||||
case D2PC_NECROMANCER:
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"6 13 20 32 52 86 174 600", sBlockFrames, 11);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"9 18 30 48 75 125", sCastingFrames, sHumanForm, 15);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"6 11 18 24 35 48 65 86 120 180", sCastingFrames, sVampireForm, 23);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"5 10 16 26 39 56 86 152 377", sHitRecoveryFrames, sHumanForm, 13);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"2 6 10 16 24 34 48 72 117", sHitRecoveryFrames, sVampireForm, 15);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
break;
|
||||
|
||||
case D2PC_PALADIN:
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"13 32 86 600", sBlockFrames, 5);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"86", sBlockFrames, sHolyShield, 2);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"9 18 30 48 75 125", sCastingFrames, 15);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"3 7 13 20 32 48 75 129 280", sHitRecoveryFrames, sSpearsAndStaves, 13);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"7 15 27 48 86 200", sHitRecoveryFrames, sOtherWeapon, 9);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
break;
|
||||
|
||||
case D2PC_SORCERESS:
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"7 15 27 48 86 200", sBlockFrames, 9);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"9 20 37 63 105 200", sCastingFrames, 13);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"7 15 23 35 52 78 117 194", sCastingFrames, sLightningAndChainLightnings, 19);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s: %d", sBreakpoint, L"5 9 14 20 30 42 60 86 142 280", sHitRecoveryFrames, 15);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void printMercBreakpoints(Unit* ptChar, DWORD x, DWORD y, DWORD color, LPWSTR lpText)
|
||||
{
|
||||
LPWSTR sBreakpoint = getLocalString(STR_BREAKPOINT);
|
||||
LPWSTR sCastingFrames = getLocalString(STR_CASTING_FRAMES);
|
||||
LPWSTR sHitRecoveryFrames = getLocalString(STR_HIT_RECOVERY_FRAMES);
|
||||
|
||||
swprintf(lpText, L"%s : %s", getLocalString(STR_BREAKPOINTS), getLocalString(STR_MERCENARIES));
|
||||
D2PrintString(lpText, x, y, color, 0); y+=33;
|
||||
D2SetFont(6);
|
||||
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"8 15 26 39 58 86 138", sCastingFrames, getLocalString(STR_MERC_ACT_3), 17);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
y+=13;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"6 13 20 32 52 86 174 600", sHitRecoveryFrames, getLocalString(STR_MERC_ACT_1), 11);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"5 9 14 20 30 42 60 86 142 280", sHitRecoveryFrames, getLocalString(STR_MERC_ACT_2), 15);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"5 8 13 18 24 32 46 63 86 133 232 600", sHitRecoveryFrames, getLocalString(STR_MERC_ACT_3), 17);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
swprintf(lpText, L"%s : %s\n%s - %s: %d", sBreakpoint, L"7 15 27 48 86 200", sHitRecoveryFrames, getLocalString(STR_MERC_ACT_5), 9);
|
||||
D2PrintString(lpText, x, y, color, 0); y+=29;
|
||||
}
|
||||
|
||||
void printStat(Unit* ptChar, DWORD statID, DWORD x, DWORD y, DWORD color, LPWSTR lpText)
|
||||
{
|
||||
LPWSTR text;
|
||||
log_msg("printStat : %d\n", statID);
|
||||
|
||||
switch (statID)
|
||||
{
|
||||
case STATS_FIRERESIST:
|
||||
@ -108,10 +303,16 @@ void printStat(Unit* ptChar, DWORD statID, DWORD x, DWORD y, DWORD color, LPWSTR
|
||||
case STATS_LIGHTRESIST:
|
||||
case STATS_POISONRESIST:
|
||||
text = D2GetStringFromIndex(getDescStrPos(statID));
|
||||
if (wcslen(text) > 50) return;
|
||||
if (wcslen(text) > BUFSIZE) return;
|
||||
swprintf(lpText, L"%s +%i%%", text, D2GetPlayerStat(ptChar,statID,0));
|
||||
break;
|
||||
default:
|
||||
case 10000:
|
||||
printCharacterBreakpoints(ptChar, x, y, color, lpText);
|
||||
return;
|
||||
case 10001:
|
||||
printMercBreakpoints(ptChar, x, y, color, lpText);
|
||||
return;
|
||||
default:
|
||||
D2PrintStat(ptChar, NULL, statID, 0, D2GetPlayerStat(ptChar,statID,0), lpText);//param2=ptChar->ptStats->ptItemStats
|
||||
}
|
||||
// D2SetFont(1);
|
||||
@ -140,8 +341,7 @@ void STDCALL printNewStatsPageTwo(int currentPage)
|
||||
|
||||
WCHAR text[BUFSIZE];
|
||||
LPWSTR lpText;
|
||||
bDontPrintBorder = false;
|
||||
|
||||
bDontPrintBorder = D2GetResolution()? true : false;
|
||||
Unit* ptChar = D2GetClientPlayer();
|
||||
|
||||
d2_assert(!ptChar, "Printing stats page : no character selected",__FILE__,__LINE__);
|
||||
@ -152,16 +352,20 @@ void STDCALL printNewStatsPageTwo(int currentPage)
|
||||
ZeroMemory(&data,sizeof(data));
|
||||
|
||||
//print background
|
||||
fillRect(RX(0),RY(480),320,432,0,5);//552
|
||||
fillRect(RX(0), RY(ResolutionY), 512, 768, 0, 5);
|
||||
setImage(&data, newStatsInterfaceImages);
|
||||
setFrame(&data, 0);
|
||||
D2PrintImage(&data, RX(0), RY(224), -1, 5, 0);
|
||||
D2PrintImage(&data, RX(0), RY(ResolutionY-256), -1, 5, 0);
|
||||
setFrame(&data, 1);
|
||||
D2PrintImage(&data, RX(256),RY(224), -1, 5, 0);//256
|
||||
D2PrintImage(&data, RX(256),RY(ResolutionY-256), -1, 5, 0);
|
||||
setFrame(&data, 2);
|
||||
D2PrintImage(&data, RX(0), RY(48), -1, 5, 0);//432
|
||||
D2PrintImage(&data, RX(0), RY(ResolutionY-256*2), -1, 5, 0);
|
||||
setFrame(&data, 3);
|
||||
D2PrintImage(&data, RX(256),RY(48), -1, 5, 0);
|
||||
D2PrintImage(&data, RX(256),RY(ResolutionY-256*2), -1, 5, 0);
|
||||
setFrame(&data, 4);
|
||||
D2PrintImage(&data, RX(0), RY(ResolutionY-256*3), -1, 5, 0);
|
||||
setFrame(&data, 5);
|
||||
D2PrintImage(&data, RX(256),RY(ResolutionY-256*3), -1, 5, 0);
|
||||
|
||||
D2SetFont(1);
|
||||
for (int i=0; i<nbStatsInterface; i++)
|
||||
@ -195,16 +399,18 @@ void STDCALL printNewStatsPageTwo(int currentPage)
|
||||
D2PrintString(text, x, y, WHITE, 0);
|
||||
*/
|
||||
|
||||
//print background previous/next page buttons
|
||||
setImage(&data, statsBackgroundImages);
|
||||
setFrame(&data, D2GetResolution()?1:0);
|
||||
D2PrintImage(&data, getXPreviousPageBtn()-7, getYPreviousPageBtn()+8, -1, 5, 0);
|
||||
if (printBackgroundOnMainPage) {
|
||||
//print background previous/next page buttons
|
||||
setImage(&data, statsBackgroundImages);
|
||||
setFrame(&data, 1);
|
||||
D2PrintImage(&data, getXPreviousPageBtn()-7, getYPreviousPageBtn()+8, -1, 5, 0);
|
||||
}
|
||||
|
||||
//print button close
|
||||
setImage(&data, D2LoadBuySelBtn());
|
||||
setFrame(&data, 10 + isDownBtn.close);
|
||||
D2PrintImage(&data, getXCloseBtn(), getYCloseBtn(), -1, 5, 0);
|
||||
|
||||
|
||||
//print previous page button
|
||||
setFrame(&data, 12 + isDownBtn.previousPage);
|
||||
D2PrintImage(&data, getXPreviousPageBtn(), getYPreviousPageBtn(), -1, 5, 0);
|
||||
@ -213,12 +419,11 @@ void STDCALL printNewStatsPageTwo(int currentPage)
|
||||
setFrame(&data, 14 + isDownBtn.nextPage);
|
||||
D2PrintImage(&data, getXNextPageBtn(), getYNextPageBtn(), -1, 5, 0);
|
||||
|
||||
|
||||
//////////////////// POPUP PRINTING ////////////////////
|
||||
//set MouseX & MouseY
|
||||
DWORD mx = D2GetMouseX();
|
||||
DWORD my = D2GetMouseY();
|
||||
|
||||
|
||||
D2SetFont(1);
|
||||
|
||||
if (isOnCloseBtn(mx,my)) // print popup "close"
|
||||
@ -227,12 +432,12 @@ void STDCALL printNewStatsPageTwo(int currentPage)
|
||||
}
|
||||
else if (isOnPreviousPageBtn(mx,my)) //print popup "previous page"
|
||||
{
|
||||
lpText = getTranslatedString(STR_PREVIOUS_PAGE);
|
||||
lpText = getLocalString(STR_PREVIOUS_PAGE);
|
||||
D2PrintPopup(lpText, getXPreviousPageBtn()+getLPreviousPageBtn()/2, getYPreviousPageBtn()-getHPreviousPageBtn(), WHITE, 1);
|
||||
}
|
||||
else if (isOnNextPageBtn(mx,my)) //print popup "next page"
|
||||
{
|
||||
lpText = getTranslatedString(STR_NEXT_PAGE);
|
||||
lpText = getLocalString(STR_NEXT_PAGE);
|
||||
D2PrintPopup(lpText, getXNextPageBtn()+getLNextPageBtn()/2, getYNextPageBtn()-getHNextPageBtn(), WHITE, 1);
|
||||
}
|
||||
}
|
||||
|
@ -1,32 +1,60 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Interface functions
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "plugYFiles.h" // Install_PlugYImagesFiles()
|
||||
#include "globalVariable.h"
|
||||
#include "updateServer.h" // Install_UpdateServer()
|
||||
#include "plugYFiles.h" // Install_PlugYImagesFiles()
|
||||
#include "interface_Stats.h"// Install_InterfaceStats()
|
||||
#include "newInterfaces.h"
|
||||
#include "newInterface_Stats.h"
|
||||
#include "newInterface_StatsPageTwo.h"
|
||||
#include "newInterface_Runewords.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
bool active_newInterfaces=false;
|
||||
bool selectMainPageOnOpenning=true;
|
||||
bool printBackgroundOnMainPage=true;
|
||||
|
||||
int posXNextPageBtn = -1;
|
||||
int posYNextPageBtn = -1;
|
||||
int posXPrevPageBtn = -1;
|
||||
int posYPrevPageBtn = -1;
|
||||
int posXClosePageBtn = -1;
|
||||
int posYClosePageBtn = -1;
|
||||
int posXNextRuneBtn = -1;
|
||||
int posYNextRuneBtn = -1;
|
||||
int posXPrevRuneBtn = -1;
|
||||
int posYPrevRuneBtn = -1;
|
||||
int posXRunesList = -1;
|
||||
int posYRunesList = -1;
|
||||
int runesPerPage = -1;
|
||||
|
||||
DWORD getXNextPageBtn() {return RX(posXNextPageBtn);}
|
||||
DWORD getYNextPageBtn() {return RY(posYNextPageBtn);}
|
||||
DWORD getXPreviousPageBtn() {return RX(posXPrevPageBtn);}
|
||||
DWORD getYPreviousPageBtn() {return RY(posYPrevPageBtn);}
|
||||
DWORD getXCloseBtn() {return RX(posXClosePageBtn);}
|
||||
DWORD getYCloseBtn() {return RY(posYClosePageBtn);}
|
||||
DWORD getXNextRunesBtn() {return RX(posXNextRuneBtn);}
|
||||
DWORD getYNextRunesBtn() {return RY(posYNextRuneBtn);}
|
||||
DWORD getXPrevRunesBtn() {return RX(posXPrevRuneBtn);}
|
||||
DWORD getYPrevRunesBtn() {return RY(posYPrevRuneBtn);}
|
||||
|
||||
DWORD bDontPrintBorder=false;
|
||||
|
||||
int selectedPage=0;
|
||||
int lastPage=0;
|
||||
int extraHiddenPage=0;
|
||||
int curRunesPage=0;
|
||||
int maxRunesPage=0xFFFF;
|
||||
BtnState isDownBtn={0};
|
||||
|
||||
void GoNextStatPage()
|
||||
{
|
||||
@ -44,8 +72,12 @@ void GoPreviousStatPage()
|
||||
|
||||
void GoStatPage(int page)
|
||||
{
|
||||
if ( (page >= 0) && (page <= lastPage + (D2GetResolution()? extraHiddenPage : 0)) )
|
||||
if ( (page >= 0) && (page <= (lastPage + extraHiddenPage)) )
|
||||
selectedPage = page;
|
||||
else if (page < 0)
|
||||
selectedPage = lastPage + extraHiddenPage;
|
||||
else
|
||||
selectedPage = 0;
|
||||
}
|
||||
|
||||
int GetCurrentPage()
|
||||
@ -83,6 +115,16 @@ DWORD STDCALL mouseCustomPageLeftDown(sWinMessage* msg)
|
||||
DWORD STDCALL mouseCustomPageLeftUp(sWinMessage* msg)
|
||||
{
|
||||
if(onRealm) return -1;
|
||||
|
||||
if (selectedPage == 0) return -1;
|
||||
if (!isOnStatsPage(msg->x,msg->y)) return 1;
|
||||
statsLeftUp(msg);
|
||||
D2CleanStatMouseUp();
|
||||
freeMessage(msg);
|
||||
isDownBtn.all=0;
|
||||
return 0;
|
||||
|
||||
/*
|
||||
if ( (selectedPage > 0) && (selectedPage <= lastPage) )
|
||||
return mouseNewStatsPageTwoLeftUp(msg);
|
||||
else if (selectedPage == lastPage+1)
|
||||
@ -91,8 +133,103 @@ DWORD STDCALL mouseCustomPageLeftUp(sWinMessage* msg)
|
||||
return mouseNewStatsPageLeftUp(msg);
|
||||
else
|
||||
return -1;
|
||||
*/
|
||||
}
|
||||
|
||||
DWORD STDCALL statsLeftDown(sWinMessage* msg)
|
||||
{
|
||||
if (isOnCloseBtn(msg->x,msg->y) && selectedPage != 0)
|
||||
{
|
||||
log_msg("push down left button close\n");
|
||||
isDownBtn.close = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
return 1;
|
||||
}
|
||||
else if (isOnPreviousPageBtn(msg->x,msg->y))
|
||||
{
|
||||
log_msg("push down left button previous page\n");
|
||||
isDownBtn.previousPage = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
return 1;
|
||||
}
|
||||
else if (isOnNextPageBtn(msg->x,msg->y))
|
||||
{
|
||||
log_msg("push down left button next page\n");
|
||||
isDownBtn.nextPage = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
return 1;
|
||||
}
|
||||
else if (isOnPrevRunesBtn(msg->x,msg->y) && selectedPage == (lastPage + extraHiddenPage))
|
||||
{
|
||||
log_msg("push down left button prev runes\n");
|
||||
isDownBtn.prevRunes = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
return 1;
|
||||
}
|
||||
else if (isOnNextRunesBtn(msg->x,msg->y) && selectedPage == (lastPage + extraHiddenPage))
|
||||
{
|
||||
log_msg("push down left button next runes\n");
|
||||
isDownBtn.nextRunes = 1;
|
||||
D2PlaySound(4,0,0,0,0);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD STDCALL statsLeftUp(sWinMessage* msg)
|
||||
{
|
||||
if (isOnCloseBtn(msg->x,msg->y) && selectedPage != 0)
|
||||
{
|
||||
log_msg("push up left button close\n");
|
||||
if (isDownBtn.close)
|
||||
D2TogglePage(2,1,0);
|
||||
return 1;
|
||||
}
|
||||
else if (isOnPreviousPageBtn(msg->x,msg->y))
|
||||
{
|
||||
log_msg("push up left button previous page\n");
|
||||
if (isDownBtn.previousPage)
|
||||
GoStatPage(selectedPage-1);
|
||||
return 1;
|
||||
}
|
||||
else if (isOnNextPageBtn(msg->x,msg->y))
|
||||
{
|
||||
log_msg("push up left button next page\n");
|
||||
if (isDownBtn.nextPage)
|
||||
GoStatPage(selectedPage+1);
|
||||
return 1;
|
||||
}
|
||||
else if (isOnPrevRunesBtn(msg->x,msg->y) && selectedPage == (lastPage + extraHiddenPage))
|
||||
{
|
||||
log_msg("push up left button prev runes\n");
|
||||
if (isDownBtn.prevRunes && curRunesPage)
|
||||
curRunesPage--;
|
||||
return 1;
|
||||
}
|
||||
else if (isOnNextRunesBtn(msg->x,msg->y) && selectedPage == (lastPage + extraHiddenPage))
|
||||
{
|
||||
log_msg("push up left button next runes\n");
|
||||
if (isDownBtn.nextRunes && (curRunesPage < maxRunesPage))
|
||||
curRunesPage++;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_DontPrintBorder_114 )
|
||||
MOV ECX,bDontPrintBorder
|
||||
TEST ECX,ECX
|
||||
JE printBorder
|
||||
MOV bDontPrintBorder,0
|
||||
ADD DWORD PTR SS:[ESP],0xC1
|
||||
RETN
|
||||
printBorder:
|
||||
POP ECX
|
||||
PUSH 0x48
|
||||
LEA EAX,DWORD PTR SS:[EBP-0x48]
|
||||
JMP ECX
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_DontPrintBorder_111 )
|
||||
MOV ECX,bDontPrintBorder
|
||||
TEST ECX,ECX
|
||||
@ -117,6 +254,30 @@ printBorder:
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_mouseCustomPageLeftDown_114 )
|
||||
PUSH EAX
|
||||
PUSH ESI
|
||||
CALL mouseCustomPageLeftDown
|
||||
TEST EAX,EAX
|
||||
POP EAX
|
||||
JE end_mouseNewPageLDown
|
||||
JG continue_mouseNewPageLDown
|
||||
LEA ECX,DWORD PTR DS:[EAX+0x80]
|
||||
RETN
|
||||
continue_mouseNewPageLDown:
|
||||
POP EAX
|
||||
ADD EAX,0x172
|
||||
PUSH EDI
|
||||
JMP EAX
|
||||
RETN
|
||||
end_mouseNewPageLDown:
|
||||
ADD ESP,4
|
||||
POP ESI
|
||||
POP EBX
|
||||
POP EBP
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM ( caller_mouseCustomPageLeftDown_111 )
|
||||
PUSH EAX
|
||||
@ -186,7 +347,27 @@ end_mouseNewPageLDown:
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM ( caller_mouseCustomPageLeftUp_114 )
|
||||
PUSH EBP
|
||||
CALL mouseCustomPageLeftUp
|
||||
TEST EAX,EAX
|
||||
JE end_mouseNewPageLUp
|
||||
JG continue_mouseNewPageLUp
|
||||
MOV EAX,DWORD PTR DS:[ptWindowStartX]
|
||||
MOV EAX,DWORD PTR DS:[EAX]
|
||||
RETN
|
||||
continue_mouseNewPageLUp:
|
||||
ADD DWORD PTR SS:[ESP],0x17D
|
||||
RETN
|
||||
end_mouseNewPageLUp:
|
||||
ADD ESP,4
|
||||
POP EDI
|
||||
POP ESI
|
||||
POP EBX
|
||||
MOV ESP,EBP
|
||||
POP EBP
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_mouseCustomPageLeftUp_111 )
|
||||
PUSH EBP
|
||||
@ -258,7 +439,18 @@ end_mouseNewPageLUp:
|
||||
|
||||
|
||||
|
||||
|
||||
FCT_ASM ( caller_resetSelected_114 )
|
||||
CMP ECX,2
|
||||
JNZ NO_RESET
|
||||
MOV selectedPage, 0
|
||||
NO_RESET:
|
||||
POP EAX
|
||||
PUSH EBX
|
||||
PUSH ESI
|
||||
PUSH EDI
|
||||
MOV EDI,ECX
|
||||
JMP EAX
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM ( caller_resetSelectedPageByToolBar )
|
||||
@ -307,12 +499,22 @@ void Install_NewInterfaces()
|
||||
|
||||
if (selectMainPageOnOpenning)
|
||||
{
|
||||
if ( version_D2Client >= V111 )
|
||||
if ( version_D2Client >= V114a )
|
||||
{
|
||||
mem_seek R8(D2Client, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 55F24);
|
||||
memt_byte( 0x53, 0xE8 ); // CALL caller_resetSelectedPage
|
||||
MEMT_REF4( 0xF98B5756, caller_resetSelected_114);
|
||||
//00455F24 |. 53 PUSH EBX
|
||||
//00455F25 |. 56 PUSH ESI
|
||||
//00455F26 |. 57 PUSH EDI
|
||||
//00455F27 |. 8BF9 MOV EDI,ECX
|
||||
}
|
||||
else if ( version_D2Client >= V111 )
|
||||
{
|
||||
//Reset selectedPage variable on opening stats page
|
||||
mem_seek R7(D2Client, 0000, 0000, 0000, 4B79E, 8F73E, 55E0E, 65F5E);
|
||||
memt_byte( 0x83, 0xE8 ); // CALL caller_resetSelectedPage
|
||||
MEMT_REF4( 0x1F7426F8, caller_resetSelectedPageByToolBar);
|
||||
mem_seek R8(D2Client, 0000, 0000, 0000, 4B79E, 8F73E, 55E0E, 65F5E, C41FE, 7EC5C);
|
||||
memt_byte( version_D2Client == V114d ? 0xB9 : 0x83, 0xE8 ); // CALL caller_resetSelectedPage
|
||||
MEMT_REF4( version_D2Client == V114d ? 0x00000002 : 0x1F7426F8, caller_resetSelectedPageByToolBar);
|
||||
//6FAFB79E > 83F8 26 CMP EAX,26
|
||||
//6FAFB7A1 . 74 1F JE SHORT D2Client.6FAFB7C2
|
||||
//6FB3F73E > 83F8 26 CMP EAX,26
|
||||
@ -321,8 +523,13 @@ void Install_NewInterfaces()
|
||||
//6FB05E11 . 74 1F JE SHORT D2Client.6FB05E32
|
||||
//6FB15F5E > 83F8 26 CMP EAX,26
|
||||
//6FB15F61 . 74 1F JE SHORT D2Client.6FB15F82
|
||||
//6FB741FE > 83F8 26 CMP EAX,26
|
||||
//6FB74201 . 74 1F JE SHORT D2Client.6FB05E32
|
||||
//6FB741FE > 83F8 26 CMP EAX,26
|
||||
//6FB74201 . 74 1F JE SHORT D2Client.6FB74222
|
||||
//0047EC5C > B9 02000000 MOV ECX,2
|
||||
|
||||
mem_seek R7(D2Client, 0000, 0000, 0000, 1E55A, 6A8FA, A31DA, 3C5EA);
|
||||
mem_seek R8(D2Client, 0000, 0000, 0000, 1E55A, 6A8FA, A31DA, 3C5EA, 3E39A, 0000);
|
||||
memt_byte( 0x55, 0xE8 ); // CALL caller_resetSelectedPage
|
||||
MEMT_REF4( 0xD53BED33, caller_resetSelectedPageByKey);
|
||||
//6FACE55A . 55 PUSH EBP
|
||||
@ -337,7 +544,9 @@ void Install_NewInterfaces()
|
||||
//6FAEC5EA . 55 PUSH EBP
|
||||
//6FAEC5EB . 33ED XOR EBP,EBP
|
||||
//6FAEC5ED . 3BD5 CMP EDX,EBP
|
||||
|
||||
//6FAEE39A . 55 PUSH EBP
|
||||
//6FAEE39B . 33ED XOR EBP,EBP
|
||||
//6FAEE39D . 3BD5 CMP EDX,EBP
|
||||
|
||||
//For Toggle fct : (not used for open the stat page)
|
||||
// mem_seek R7(D2Client, 88B58, 87ED8, 83478, A1FBE, 6571E, 8EF8E, 0000);//((DWORD)D2TogglePage+0x218);
|
||||
@ -355,7 +564,7 @@ void Install_NewInterfaces()
|
||||
//6FB3EF92 |. 3928 CMP DWORD PTR DS:[EAX],EBP
|
||||
} else {
|
||||
//Reset selectedPage variable on opening stats page
|
||||
mem_seek R7(D2Client, 88B58, 87ED8, 83478, A1FBE, 6571E, 8EF8E, 0000);//((DWORD)D2TogglePage+0x218);
|
||||
mem_seek R8(D2Client, 88B58, 87ED8, 83478, A1FBE, 6571E, 8EF8E, 0000, 0000, 0000);//((DWORD)D2TogglePage+0x218);
|
||||
memt_byte( 0x85, 0xE8 ); // CALL caller_resetSelectedPage
|
||||
MEMT_REF4( 0xC2940FC0, caller_resetSelectedPage);
|
||||
//6FB23478 |. 85C0 TEST EAX,EAX
|
||||
@ -365,45 +574,55 @@ void Install_NewInterfaces()
|
||||
}
|
||||
|
||||
// Print custom page
|
||||
mem_seek R7(D2Client, 87697, 86A17, 81FAB, A3759, 66B59, 902B9, C3B49);
|
||||
mem_seek R8(D2Client, 87697, 86A17, 81FAB, A3759, 66B59, 902B9, C3B49, 1D549, 57052);
|
||||
MEMC_REF4( D2PrintStatsPage, printCustomPage);
|
||||
//6FB21FAA . E8 B1DDFAFF CALL D2Client.6FACFD60
|
||||
//6FB53758 . E8 43F1FDFF CALL D2Client.6FB328A0
|
||||
//6FB16B58 |. E8 C3270200 CALL D2Client.6FB39320
|
||||
//6FB402B8 |. E8 C3AFFDFF CALL D2Client.6FB1B280
|
||||
//6FB73B48 |. E8 5393FFFF CALL D2Client.6FB6CEA0
|
||||
//6FACD548 |. E8 F3200A00 CALL D2Client.6FB1B280
|
||||
//00457051 |. E8 AA0C0500 CALL Game.004A7D00
|
||||
|
||||
// Don't print Border
|
||||
mem_seek R7(D2Client, 58EF6, 58EF6, 5F4C6, 2D366, B5A46, 82166, 271C6);
|
||||
memt_byte( 0xB9, 0xE8 ); // CALL caller_DontPrintBorder
|
||||
MEMT_REF4( 0x00000012, version_D2Client >= V111 ? caller_DontPrintBorder_111 : caller_DontPrintBorder);
|
||||
mem_seek R8(D2Client, 58EF6, 58EF6, 5F4C6, 2D366, B5A46, 82166, 271C6, 6D2B6, 98636);
|
||||
memt_byte( version_D2Client >= V114d ? 0x6A : 0xB9, 0xE8 ); // CALL caller_DontPrintBorder
|
||||
MEMT_REF4( version_D2Client >= V114d ? 0xB8458D48 : 0x00000012, version_D2Client >= V114d ? caller_DontPrintBorder_114 : version_D2Client >= V111 ? caller_DontPrintBorder_111 : caller_DontPrintBorder);
|
||||
//6FAFF4C6 > B9 12000000 MOV ECX,12
|
||||
//6FADD366 |. B9 12000000 MOV ECX,12
|
||||
//6FB65A46 |. B9 12000000 MOV ECX,12
|
||||
//6FB32166 |. B9 12000000 MOV ECX,12
|
||||
//6FAD71C6 |. B9 12000000 MOV ECX,12
|
||||
//6FB1D2B6 |. B9 12000000 MOV ECX,12
|
||||
//00498636 |. 6A 48 PUSH 48
|
||||
//00498638 |. 8D45 B8 LEA EAX,DWORD PTR SS:[EBP-48]
|
||||
|
||||
/* Conflicts with D2ExpRes
|
||||
// Manage mouse down (Play sound)
|
||||
mem_seek R7(D2Client, 2A9DC, 2A9CC, 312A5, 82736, 891B6, 6B116, BCD36);
|
||||
mem_seek R8(D2Client, 2A9DC, 2A9CC, 312A5, 82736, 891B6, 6B116, BCD36, BF4D6, A7731);
|
||||
memt_byte( 0x8D, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x00008088, version_D2Client >= V111 ? caller_mouseCustomPageLeftDown_111 : version_D2Client == V110 ? caller_mouseCustomPageLeftDown : caller_mouseCustomPageLeftDown_9);
|
||||
MEMT_REF4( 0x00008088, version_D2Client == V114d ? caller_mouseCustomPageLeftDown_114 : version_D2Client >= V111 ? caller_mouseCustomPageLeftDown_111 : version_D2Client == V110 ? caller_mouseCustomPageLeftDown : caller_mouseCustomPageLeftDown_9);
|
||||
memt_byte( 0x00, 0x90 ); // NOP
|
||||
//6FAD12A5 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//6FB32736 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//6FB391B6 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//6FB1B116 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//6FB6CD36 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//6FB1B116 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//6FB6CD36 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//6FB6F4D6 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
//004A7731 . 8D88 80000000 LEA ECX,DWORD PTR DS:[EAX+80]
|
||||
*/
|
||||
|
||||
// Manage mouse up
|
||||
mem_seek R7(D2Client, 2ABBB, 2ABAB, 3148D, 836D9, 8A159, 6C0B9, BDCB9);
|
||||
mem_seek R8(D2Client, 2ABBB, 2ABAB, 3148D, 836D9, 8A159, 6C0B9, BDCB9, C0459, A78DA);
|
||||
memt_byte( 0xA1, 0xE8 ); // CALL caller_mouseCustomPageLeftUp
|
||||
MEMT_REF4( ptWindowStartX, version_D2Client >= V111 ? caller_mouseCustomPageLeftUp_111 : version_D2Client == V110 ? caller_mouseCustomPageLeftUp : caller_mouseCustomPageLeftUp_9);
|
||||
MEMT_REF4( ptWindowStartX, version_D2Client >= V114d ? caller_mouseCustomPageLeftUp_114 : version_D2Client >= V111 ? caller_mouseCustomPageLeftUp_111 : version_D2Client == V110 ? caller_mouseCustomPageLeftUp : caller_mouseCustomPageLeftUp_9);
|
||||
//6FAD148D . A1 48A7BB6F MOV EAX,DWORD PTR DS:[6FBBA748]
|
||||
//6FB336D9 . A1 24BDBC6F MOV EAX,DWORD PTR DS:[6FBCBD24]
|
||||
//6FB3A159 . A1 F8BEBC6F MOV EAX,DWORD PTR DS:[6FBCBEF8]
|
||||
//6FB1C0B9 . A1 28BDBC6F MOV EAX,DWORD PTR DS:[6FBCBD28]
|
||||
//6FB6DCB9 . A1 A0B9BC6F MOV EAX,DWORD PTR DS:[6FBCB9A0]
|
||||
|
||||
//6FB1C0B9 . A1 28BDBC6F MOV EAX,DWORD PTR DS:[6FBCBD28]
|
||||
//6FB6DCB9 . A1 A0B9BC6F MOV EAX,DWORD PTR DS:[6FBCB9A0]
|
||||
//6FB70459 . A1 54D3BC6F MOV EAX,DWORD PTR DS:[6FBCD354]
|
||||
//004A78DA |. A1 58287A00 MOV EAX,DWORD PTR DS:[7A2858]
|
||||
|
||||
// open page : 6FB23515 |> 892CB5 A8A6BB6>MOV DWORD PTR DS:[ESI*4+6FBBA6A8],EBP
|
||||
//6FB2347D |. 8914B5 A8A6BB6F MOV DWORD PTR DS:[ESI*4+6FBBA6A8],EDX
|
||||
|
@ -6,12 +6,9 @@
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
bool active_othersFeatures = false;
|
||||
|
||||
|
||||
/*
|
||||
// Remove protect on the save file .d2s
|
||||
mem_seek( offset_D2Game + 0x77080);//6FC8DD5E-6FAA0000
|
||||
@ -24,7 +21,7 @@ void Install_ChangeResolution()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
|
||||
log_msg("Patch D2gfx for . (ChangeResolution)\n");
|
||||
|
||||
// execute if it's our packet else continue
|
||||
@ -100,7 +97,7 @@ void Install_Test2()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
|
||||
log_msg("Patch D2Game. (Test)\n");
|
||||
|
||||
// Test
|
||||
@ -113,8 +110,6 @@ void Install_Test2()
|
||||
isInstalled = true;
|
||||
}*/
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void Install_OthersFeatures()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
@ -122,6 +117,7 @@ void Install_OthersFeatures()
|
||||
|
||||
log_msg("Patch. (OthersFeatures)\n");
|
||||
|
||||
// Install_RemoveExperienceDiminushingReturn();
|
||||
// Install_ChangeResolution();
|
||||
// Install_Test();
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,22 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Adding custom data.
|
||||
Save and load infinity & shared Stash
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "updateClient.h"
|
||||
#include "d2functions.h"
|
||||
#include "infinityStash.h"
|
||||
#include "savePlayerData.h" //Install_SavePlayerData()
|
||||
#include "loadPlayerData.h" //Install_LoadPlayerData()
|
||||
#include "common.h"
|
||||
|
||||
bool active_PlayerCustomData = false;
|
||||
bool openSharedStashOnLoading = false;
|
||||
|
||||
bool active_PlayerCustomData = true;
|
||||
|
||||
|
||||
/*********************************** UPDATING ***********************************/
|
||||
@ -26,8 +28,10 @@ Stash* getStashFromItem(Unit* ptChar, Unit* ptItem)
|
||||
while (curStash)
|
||||
{
|
||||
if (curStash == PCPY->currentStash)
|
||||
curItem = D2InventoryGetFirstItem(PCInventory);
|
||||
else curItem = curStash->ptListItem;
|
||||
curItem = D2InventoryGetFirstItem(PCInventory);
|
||||
else
|
||||
curItem = curStash->ptListItem;
|
||||
|
||||
while (curItem)
|
||||
{
|
||||
if (D2GetRealItem(curItem) == ptItem) return curStash;
|
||||
@ -35,7 +39,7 @@ Stash* getStashFromItem(Unit* ptChar, Unit* ptItem)
|
||||
}
|
||||
curStash = curStash->nextStash;
|
||||
}
|
||||
|
||||
|
||||
curStash = PCPY->sharedStash;
|
||||
while (curStash)
|
||||
{
|
||||
@ -59,22 +63,33 @@ Unit* FASTCALL updateItem(Game* ptGame, DWORD type, DWORD itemNum, Unit* ptChar)
|
||||
if (ptGame->isLODGame && (D2ItemGetPage(ptItem) == 4))
|
||||
{
|
||||
Stash* ptStash = getStashFromItem(ptChar, ptItem);
|
||||
//log_msg("- updateItem PCPY->currentStash->id : %d // ptStash->id : %d\n", PCPY->currentStash?PCPY->currentStash->id:-1, ptStash?ptStash->id:-1);
|
||||
if (!ptStash) return NULL;
|
||||
selectStash(ptChar, ptStash);
|
||||
selectStash(ptChar, ptStash, ptStash->id == 0);
|
||||
}
|
||||
return ptItem;
|
||||
}
|
||||
|
||||
void FASTCALL updateItem_111(Unit* ptItem, Unit* ptChar)
|
||||
{
|
||||
if (PCGame->isLODGame && (D2ItemGetPage(ptItem) == 4))
|
||||
{
|
||||
Stash* ptStash = getStashFromItem(ptChar, ptItem);
|
||||
if (ptStash)
|
||||
selectStash(ptChar, ptStash, ptStash->id == 0);
|
||||
}
|
||||
}
|
||||
|
||||
void STDCALL updateClientPlayerOnLoading(Unit* ptChar)
|
||||
{
|
||||
log_msg("--- Start updateClientPlayerOnLoading ---\n");
|
||||
if (PCGame->isLODGame)
|
||||
{
|
||||
selectStash(ptChar, PCPY->selfStash);
|
||||
log_msg("End update client on loading.\n\n");
|
||||
PCPY->showSharedStash = openSharedStashOnLoading && active_sharedStash;
|
||||
selectStash(ptChar, PCPY->showSharedStash ? PCPY->sharedStash : PCPY->selfStash, true);
|
||||
}
|
||||
updateClient(ptChar, UC_SHARED_GOLD, PCPY->sharedGold, 0, 0);
|
||||
log_msg("End update client on loading.\n\n");
|
||||
}
|
||||
|
||||
/**************************** INIT CUSTOM DATA ****************************/
|
||||
@ -139,7 +154,7 @@ Unit* STDCALL getNextItemToFree(Unit* ptChar, Unit* ptItem)
|
||||
return item;//->nUnitType == 4 ? item : NULL;
|
||||
}
|
||||
curStash = curStash->nextStash;
|
||||
}
|
||||
}
|
||||
|
||||
curStash = PCPY->sharedStash;
|
||||
while ( curStash )
|
||||
@ -159,15 +174,12 @@ Unit* STDCALL getNextItemToFree(Unit* ptChar, Unit* ptItem)
|
||||
|
||||
/************************ INSTALL PLAYER CUSTOM DATA ****************************/
|
||||
|
||||
void FASTCALL updateItem_111(Unit* ptItem, Unit* ptChar)
|
||||
{
|
||||
if (PCGame->isLODGame && (D2ItemGetPage(ptItem) == 4))
|
||||
{
|
||||
Stash* ptStash = getStashFromItem(ptChar, ptItem);
|
||||
if (ptStash)
|
||||
selectStash(ptChar, ptStash);
|
||||
}
|
||||
}
|
||||
FCT_ASM ( caller_updateItem_114 )
|
||||
PUSH EDI
|
||||
PUSH DWORD PTR SS:[ESP+0x8]
|
||||
CALL updateItem
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_updateItem_111 )
|
||||
MOV ECX,ESI
|
||||
@ -202,6 +214,16 @@ FCT_ASM ( caller_updateItem_9 )
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_updateClientPlayerOnLoading_114 )
|
||||
PUSH DWORD PTR SS:[ESP+0x14]
|
||||
CALL updateClientPlayerOnLoading
|
||||
POP ECX
|
||||
POP EDI
|
||||
POP ESI
|
||||
XOR EAX,EAX
|
||||
POP EBX
|
||||
JMP ECX
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_updateClientPlayerOnLoading )
|
||||
PUSH DWORD PTR SS:[ESP+0x14]
|
||||
@ -214,6 +236,13 @@ FCT_ASM ( caller_updateClientPlayerOnLoading )
|
||||
JMP ECX
|
||||
}}
|
||||
|
||||
FCT_ASM ( callerServer_getNextItemToFree_114 )
|
||||
PUSH DWORD PTR SS:[ESP+4]
|
||||
PUSH DWORD PTR SS:[EBP-8]
|
||||
CALL getNextItemToFree
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( callerServer_getNextItemToFree_111 )
|
||||
PUSH DWORD PTR SS:[ESP+4]
|
||||
PUSH DWORD PTR SS:[ESP+0x30]
|
||||
@ -235,6 +264,12 @@ FCT_ASM ( callerServer_getNextItemToFree_9 )
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( callerClient_getNextItemToFree_114 )
|
||||
PUSH DWORD PTR SS:[ESP+4]
|
||||
PUSH DWORD PTR SS:[EBP-4]
|
||||
CALL getNextItemToFree
|
||||
RETN 4
|
||||
}}
|
||||
|
||||
FCT_ASM ( callerClient_getNextItemToFree_111 )
|
||||
PUSH DWORD PTR SS:[ESP+4]
|
||||
@ -261,7 +296,7 @@ FCT_ASM ( callerClient_getNextItemToFree_9 )
|
||||
void Install_PlayerCustomData()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled || !active_PlayerCustomData) return;
|
||||
if (isInstalled) return;
|
||||
|
||||
Install_SavePlayerData();
|
||||
Install_LoadPlayerData();
|
||||
@ -270,18 +305,20 @@ void Install_PlayerCustomData()
|
||||
log_msg("Patch D2Game & D2Client & D2Common for Player's custom data. (PlayerCustomData)\n");
|
||||
|
||||
// Initialize custom data.
|
||||
mem_seek( version_D2Client == V113 ? offset_D2Common + 0x309BE : version_D2Client == V112 ? offset_D2Common + 0x585EE : version_D2Client == V111b ? offset_D2Common + 0x5BFCE : version_D2Common == V111 ? offset_D2Common + 0x4ED5E :(DWORD)D2InitPlayerData + 0x62 );
|
||||
mem_seek(version_D2Client == V114d ? offset_D2Common + 0x221FDD : version_D2Client == V113d ? offset_D2Common + 0x170DE : version_D2Client == V113c ? offset_D2Common + 0x309BE : version_D2Client == V112 ? offset_D2Common + 0x585EE : version_D2Client == V111b ? offset_D2Common + 0x5BFCE : version_D2Common == V111 ? offset_D2Common + 0x4ED5E :(DWORD)D2InitPlayerData + 0x62 );
|
||||
MEMJ_REF4( D2AllocMem, init_PlayerCustomData);
|
||||
//01BD0381 |. E8 C03F0000 CALL <JMP.&Fog.#10045>
|
||||
//6FD9ED5D |. E8 94A4FBFF CALL <JMP.&Fog.#10045>
|
||||
//6FDABFCD |. E8 34D2FAFF CALL <JMP.&Fog.#10045>
|
||||
//6FDA85ED |. E8 240CFBFF CALL <JMP.&Fog.#10045>
|
||||
//6FD809BD |. E8 6088FDFF CALL <JMP.&Fog.#10045>
|
||||
//6FD670DD |. E8 0C3EFFFF CALL <JMP.&Fog.#10045>
|
||||
//00621FDC |. E8 4F94DEFF CALL Game.0040B430 ; \Game.0040B430
|
||||
|
||||
if ( version_D2Game >= V111 )
|
||||
if ( version_D2Game >= V111 && version_D2Game <= V113d)
|
||||
{
|
||||
// update item
|
||||
mem_seek R7(D2Game, 10933, 10C03, 1100D, 8BC71, C3C51, 5F2A1, 9BB91);
|
||||
mem_seek R8(D2Game, 10933, 10C03, 1100D, 8BC71, C3C51, 5F2A1, 9BB91, 75C81, 0000);
|
||||
memt_byte( 0x8B ,0xE8); // CALL
|
||||
MEMT_REF4( 0x52182454, caller_updateItem_111);
|
||||
//0200BC71 |> 8B5424 18 |MOV EDX,DWORD PTR SS:[ESP+18]
|
||||
@ -292,8 +329,10 @@ void Install_PlayerCustomData()
|
||||
//6FC7F2A5 |. 52 |PUSH EDX ; /Arg1
|
||||
//6FCBBB91 |> 8B5424 18 |MOV EDX,DWORD PTR SS:[ESP+18]
|
||||
//6FCBBB95 |. 52 |PUSH EDX
|
||||
//6FC95C81 |> 8B5424 18 |MOV EDX,DWORD PTR SS:[ESP+18]
|
||||
//6FC95C85 |. 52 |PUSH EDX
|
||||
|
||||
mem_seek R7(D2Game, 1097B, 10C4B, 11058, 8BCD1, C3CB1, 5F301, 9BBF1);
|
||||
mem_seek R8(D2Game, 1097B, 10C4B, 11058, 8BCD1, C3CB1, 5F301, 9BBF1, 75CE1, 0000);
|
||||
memt_byte( 0x8B ,0xE8); // CALL
|
||||
MEMT_REF4( 0x52182454, caller_updateItemB_111);
|
||||
//0200BCD1 |> 8B5424 18 ||MOV EDX,DWORD PTR SS:[ESP+18]
|
||||
@ -304,21 +343,25 @@ void Install_PlayerCustomData()
|
||||
//6FC7F305 |. 52 ||PUSH EDX ; /Arg1
|
||||
//6FCBBBF1 |> 8B5424 18 ||MOV EDX,DWORD PTR SS:[ESP+18]
|
||||
//6FCBBBF5 |. 52 ||PUSH EDX
|
||||
//6FC95CE1 |> 8B5424 18 ||MOV EDX,DWORD PTR SS:[ESP+18]
|
||||
//6FC95CE5 |. 52 ||PUSH EDX
|
||||
|
||||
} else {
|
||||
// update item
|
||||
mem_seek R7(D2Game, 10933, 10C03, 1100D, 8BC71, C3C51, 5F2A1, 0000);
|
||||
MEMC_REF4( D2GameGetObject, version_D2Game == V110?caller_updateItem: caller_updateItem_9);
|
||||
mem_seek R8(D2Game, 10933, 10C03, 1100D, 8BC71, C3C51, 5F2A1, 0000, 0000, 1978F3);
|
||||
MEMC_REF4( D2GameGetObject, version_D2Game >= V114a ? caller_updateItem_114 : version_D2Game >= V110 ? caller_updateItem : caller_updateItem_9);
|
||||
//6FC4100C |. E8 EFAA0700 |CALL D2Game.6FCBBB00
|
||||
mem_seek R7(D2Game, 1097B, 10C4B, 11058, 8BCD1, C3CB1, 5F301, 0000);
|
||||
MEMC_REF4( D2GameGetObject, version_D2Game == V110?caller_updateItem: caller_updateItem_9);
|
||||
//005978F2 |. E8 69B6FBFF |CALL Game.00552F60 ; \Game.00552F60
|
||||
mem_seek R8(D2Game, 1097B, 10C4B, 11058, 8BCD1, C3CB1, 5F301, 0000, 0000, 197943);
|
||||
MEMC_REF4( D2GameGetObject, version_D2Game >= V114a ? caller_updateItem_114 : version_D2Game >= V110 ? caller_updateItem : caller_updateItem_9);
|
||||
//6FC41057 |. E8 A4AA0700 ||CALL D2Game.6FCBBB00
|
||||
//00597942 |. E8 19B6FBFF |CALL Game.00552F60 ; \Game.00552F60 //005978F2 |. E8 69B6FBFF |CALL Game.00552F60 ; \Game.00552F60
|
||||
}
|
||||
|
||||
// Update client on loading
|
||||
mem_seek R7(D2Game, 23EB, 2426, 25D4, 53482, C6A32, ED502, 4BF12);//6FC325D4-6FC30000
|
||||
mem_seek R8(D2Game, 23EB, 2426, 25D4, 53482, C6A32, ED502, 4BF12, E7548, 139A20);//6FC325D4-6FC30000
|
||||
memt_byte( 0x5F ,0xE8); // CALL
|
||||
MEMT_REF4( 0xC0335D5E , caller_updateClientPlayerOnLoading);
|
||||
MEMT_REF4( version_D2Game >= V114d ? 0x5BC0335E : 0xC0335D5E , version_D2Game >= V114d ? caller_updateClientPlayerOnLoading_114 : caller_updateClientPlayerOnLoading);
|
||||
//6FC325D4 |> 5F POP EDI
|
||||
//6FC325D5 |. 5E POP ESI
|
||||
//6FC325D6 |. 5D POP EBP
|
||||
@ -339,57 +382,73 @@ void Install_PlayerCustomData()
|
||||
//6FC6BF13 |. 5E POP ESI
|
||||
//6FC6BF14 |. 5D POP EBP
|
||||
//6FC6BF15 |. 33C0 XOR EAX,EAX
|
||||
//6FD07548 |> 5F POP EDI
|
||||
//6FD07549 |. 5E POP ESI
|
||||
//6FD0754A |. 5D POP EBP
|
||||
//6FD0754B |. 33C0 XOR EAX,EAX
|
||||
//00539A20 |> 5F POP EDI
|
||||
//00539A21 |. 5E POP ESI
|
||||
//00539A22 |. 33C0 XOR EAX,EAX
|
||||
//00539A24 |. 5B POP EBX
|
||||
|
||||
// Free custom data.
|
||||
mem_seek R7(D2Common, 7055C, 7065C, 80483, 4F82D, 5C9CD, 5856D, 3093D);
|
||||
mem_seek R8(D2Common, 7055C, 7065C, 80483, 4F82D, 5C9CD, 5856D, 3093D, 1705D, 2220DD);
|
||||
MEMJ_REF4( D2FreeMem, free_PlayerCustomData);
|
||||
//01BD0482 |. E8 C53E0000 CALL <JMP.&Fog.#10046>
|
||||
//6FD9F82C |. E8 E399FBFF CALL <JMP.&Fog.#10046>
|
||||
//6FDAC9CC |. E8 3BC8FAFF CALL <JMP.&Fog.#10046>
|
||||
//6FDA856C |. E8 E70CFBFF CALL <JMP.&Fog.#10046>
|
||||
//6FD8093C |. E8 E788FDFF CALL <JMP.&Fog.#10046>
|
||||
//6FD6705C |. E8 CF3EFFFF CALL <JMP.&Fog.#10046>
|
||||
//006220DC |. E8 9F93DEFF CALL Game.0040B480 ; \Game.0040B480
|
||||
|
||||
// Free item in Stash (Server-side)
|
||||
mem_seek R7(D2Game, 7D12B, 7D62B, 8D5A4, 99112, BFDB2, 94242, E1162);
|
||||
MEMJ_REF4( D2UnitGetNextItem, version_D2Game >= V111 ? callerServer_getNextItemToFree_111 : version_D2Game == V110 ? callerServer_getNextItemToFree : callerServer_getNextItemToFree_9);//0x0005E204
|
||||
mem_seek R8(D2Game, 7D12B, 7D62B, 8D5A4, 99112, BFDB2, 94242, E1162, 6F7C2, 155B34);
|
||||
MEMJ_REF4( D2UnitGetNextItem, version_D2Game >= V114a ? callerServer_getNextItemToFree_114 : version_D2Game >= V111 ? callerServer_getNextItemToFree_111 : version_D2Game == V110 ? callerServer_getNextItemToFree : callerServer_getNextItemToFree_9);//0x0005E204
|
||||
//6FCBD5A3 . E8 04E20500 CALL <JMP.&D2Common.#10304>
|
||||
//02019111 |. E8 5016F7FF |CALL <JMP.&D2Common.#10934>
|
||||
//0202FDB1 |. E8 30AAF4FF |CALL <JMP.&D2Common.#11140>
|
||||
//6FCB4241 |. E8 8862F7FF |CALL <JMP.&D2Common.#10770>
|
||||
//6FD01161 |. E8 6693F2FF |CALL <JMP.&D2Common.#10464>
|
||||
//6FC8F7C1 |. E8 44AEF9FF |CALL <JMP.&D2Common.#10879>
|
||||
//00555B33 |. E8 68840E00 |CALL Game.0063DFA0 ; \Game.0063DFA0
|
||||
|
||||
// Free item in Stash (Client-side)
|
||||
mem_seek R7(D2Client, 8EF8F, 8E30F, 89B32, 26404, 4C264, 1F2D4, A5C94);//6FB29B31-6FAA0000
|
||||
MEMJ_REF4( D2UnitGetNextItem, version_D2Game >= V111 ? callerClient_getNextItemToFree_111 : version_D2Game == V110 ? callerClient_getNextItemToFree : callerClient_getNextItemToFree_9);//0x00040F34
|
||||
mem_seek R8(D2Client, 8EF8F, 8E30F, 89B32, 26404, 4C264, 1F2D4, A5C94, 621E4, 66D02);//6FB29B31-6FAA0000
|
||||
MEMJ_REF4( D2UnitGetNextItem, version_D2Game >= V114d ? callerClient_getNextItemToFree_114 : version_D2Game >= V111 ? callerClient_getNextItemToFree_111 : version_D2Game == V110 ? callerClient_getNextItemToFree : callerClient_getNextItemToFree_9);//0x00040F34
|
||||
//6FB29B31 E8 340F0400 CALL <JMP.&D2Common.#10304>
|
||||
//6FAD6403 |. E8 925DFEFF |CALL <JMP.&D2Common.#10934>
|
||||
//6FAFC263 |. E8 38FFFBFF |CALL <JMP.&D2Common.#11140>
|
||||
//6FACF2D3 |. E8 4CD1FEFF |CALL <JMP.&D2Common.#10770>
|
||||
//6FB55C93 |. E8 D068F6FF |CALL <JMP.&D2Common.#10464>
|
||||
//6FB121E3 |. E8 7AA1FAFF |CALL <JMP.&D2Common.#10879>
|
||||
//00466D01 E8 9A721D00 |CALL Game.0063DFA0
|
||||
|
||||
if ( version_D2Common >= V110 )
|
||||
{
|
||||
// Test if it's already removed from inventory
|
||||
mem_seek R7(D2Common, 0000, 0000, 4E689, 26E33, 42133, 6AE93, 21B23);
|
||||
memt_byte( 0x0D , 0x07);
|
||||
mem_seek R8(D2Common, 0000, 0000, 4E689, 26E33, 42133, 6AE93, 21B23, 3B393, 23ADB5);
|
||||
memt_byte( version_D2Common == V114d ? 0x0E : 0x0D , 0x07);
|
||||
//01D2E688 75 0D JNZ SHORT D2Common.01D2E697
|
||||
//6FD76E32 |. 74 0D JE SHORT D2Common.6FD76E41
|
||||
//6FD92132 |. 74 0D JE SHORT D2Common.6FD92141
|
||||
//6FDBAE92 |. 74 0D JE SHORT D2Common.6FDBAEA1
|
||||
//6FD71B22 |. 74 0D JE SHORT D2Common.6FD71B31
|
||||
//6FD8B392 |. 74 0D JE SHORT D2Common.6FD8B3A1
|
||||
//0063ADB4 |. 74 0E JE SHORT Game.0063ADC4
|
||||
} else {
|
||||
mem_seek R7(D2Game, 7D176, 7D676, 0000, 0000, 0000, 0000, 0000);
|
||||
mem_seek R8(D2Game, 7D176, 7D676, 0000, 0000, 0000, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0x74 , 0x90);//MOV EAX,EDI
|
||||
memt_byte( 0x35 , 0x90);//NOP
|
||||
//6FCAD176 |. 74 35 |JE SHORT D2Game.6FCAD1AD
|
||||
|
||||
mem_seek R7(D2Client, 8F0CA, 8E44A, 0000, 0000, 0000, 0000, 0000);
|
||||
mem_seek R8(D2Client, 8F0CA, 8E44A, 0000, 0000, 0000, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0x0F , 0x90);//MOV EAX,EDI
|
||||
memt_byte( 0x84 , 0x90);//NOP
|
||||
memt_dword( 0x000000BF , 0x90909090);//NOP
|
||||
//6FB2F0CA |. 0F84 BF000000 |JE D2Client.6FB2F18F
|
||||
|
||||
mem_seek R7(D2Client, 8F13C, 8E4BC, 0000, 0000, 0000, 0000, 0000);
|
||||
mem_seek R8(D2Client, 8F13C, 8E4BC, 0000, 0000, 0000, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0x74 , 0x90);//MOV EAX,EDI
|
||||
memt_byte( 0x6F , 0x90);//NOP
|
||||
//6FB2F13C |. 74 6F |JE SHORT D2Client.6FB2F1AD
|
||||
|
BIN
PlugY/PlugY.aps
BIN
PlugY/PlugY.aps
Binary file not shown.
@ -1,22 +1,27 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Main file of this DLL
|
||||
Main file of this DLL
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
||||
|
||||
BOOL WINAPI DllMain(HANDLE /*hModule*/, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch(dwReason)
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
BIN
PlugY/PlugY.rc
BIN
PlugY/PlugY.rc
Binary file not shown.
@ -1,6 +1,9 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlugY", "PlugY.vcproj", "{F5E47DA0-4D85-41E4-954D-29237DF8AFCB}"
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.2.32505.173
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlugY", "PlugY.vcxproj", "{EB63DF4E-A019-4522-A140-9E8C7350B331}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -8,12 +11,15 @@ Global
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F5E47DA0-4D85-41E4-954D-29237DF8AFCB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F5E47DA0-4D85-41E4-954D-29237DF8AFCB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F5E47DA0-4D85-41E4-954D-29237DF8AFCB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F5E47DA0-4D85-41E4-954D-29237DF8AFCB}.Release|Win32.Build.0 = Release|Win32
|
||||
{EB63DF4E-A019-4522-A140-9E8C7350B331}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EB63DF4E-A019-4522-A140-9E8C7350B331}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EB63DF4E-A019-4522-A140-9E8C7350B331}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{EB63DF4E-A019-4522-A140-9E8C7350B331}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {83A1632A-5376-46CE-89D9-F2D4E74FFE31}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
BIN
PlugY/PlugY.suo
BIN
PlugY/PlugY.suo
Binary file not shown.
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="9,00"
|
||||
Name="PlugY"
|
||||
ProjectGUID="{F5E47DA0-4D85-41E4-954D-29237DF8AFCB}"
|
||||
ProjectGUID="{EB63DF4E-A019-4522-A140-9E8C7350B331}"
|
||||
RootNamespace="PlugY"
|
||||
Keyword="ExtStoredProcProj"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
@ -17,10 +18,9 @@
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
@ -37,19 +37,16 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_USRDLL;PLUGY_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
@ -57,15 +54,12 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opends60.lib"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
@ -89,21 +83,17 @@
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
|
||||
UseOfMFC="0"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@ -119,41 +109,31 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OmitFramePointers="true"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_DEPRECATE;_CRT_ NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T"
|
||||
StringPooling="false"
|
||||
ExceptionHandling="0"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_USRDLL;PLUGY_EXPORTS"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="0"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opends60.lib"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="false"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
@ -177,12 +157,9 @@
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copy $(TargetPath) "..\PlugYInstaller\PlugY.dll"
copy $(TargetPath) "D:\Jeux\Blizzard\Diablo II\PlugY.dll"
copy $(TargetPath) "D:\www\PlugY.dll"
"
|
||||
CommandLine="copy "$(TargetPath)" "..\PlugYInstaller\PlugY.dll""
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
@ -190,344 +167,374 @@
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;odl;idl;hpj;bat;asm"
|
||||
Name="Fichiers sources"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="BigStash.cpp"
|
||||
RelativePath=".\BigStash.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ClientSaveFile.cpp"
|
||||
RelativePath=".\ClientSaveFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Commands.cpp"
|
||||
RelativePath=".\Commands.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Common.cpp"
|
||||
RelativePath=".\Common.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="CustomLibraries.cpp"
|
||||
RelativePath=".\CustomLibraries.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="D2functions.cpp"
|
||||
RelativePath=".\D2functions.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="D2wrapper.cpp"
|
||||
RelativePath=".\D2wrapper.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Error.cpp"
|
||||
RelativePath=".\Error.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ExtendedSaveFile.cpp"
|
||||
RelativePath=".\ExtendedSaveFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ExtraOptions.cpp"
|
||||
RelativePath=".\ExtraOptions.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="GlobalVariable.cpp"
|
||||
RelativePath=".\GlobalVariable.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="InfinityStash.cpp"
|
||||
RelativePath=".\InfinityStash.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="INIfile.cpp"
|
||||
RelativePath=".\INIfile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Interface_Skills.cpp"
|
||||
RelativePath=".\Interface_Skills.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Interface_Stash.cpp"
|
||||
RelativePath=".\Interface_Stash.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Interface_Stats.cpp"
|
||||
RelativePath=".\Interface_Stats.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Language.cpp"
|
||||
RelativePath=".\Language.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="LoadPlayerData.cpp"
|
||||
RelativePath=".\LoadPlayerData.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="MainScreen.cpp"
|
||||
RelativePath=".\LocalizedStrings.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ModifMemory.cpp"
|
||||
RelativePath=".\MainScreen.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NewInterface_CubeListing.cpp"
|
||||
RelativePath=".\ModifMemory.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NewInterface_Runewords.cpp"
|
||||
RelativePath=".\NewInterface_CubeListing.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NewInterface_Stats.cpp"
|
||||
RelativePath=".\NewInterface_Runewords.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NewInterface_StatsPageTwo.cpp"
|
||||
RelativePath=".\NewInterface_Stats.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NewInterfaces.cpp"
|
||||
RelativePath=".\NewInterface_StatsPageTwo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="OthersFeatures.cpp"
|
||||
RelativePath=".\NewInterfaces.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Parameters.cpp"
|
||||
RelativePath=".\OthersFeatures.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="PlayerCustomData.cpp"
|
||||
RelativePath=".\Parameters.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="PlugY.cpp"
|
||||
RelativePath=".\PlayerCustomData.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="PlugY.rc"
|
||||
RelativePath=".\PlugY.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="PlugYFiles.cpp"
|
||||
RelativePath=".\PlugYFiles.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="SavePath.cpp"
|
||||
RelativePath=".\SavePath.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="SavePlayerData.cpp"
|
||||
RelativePath=".\SavePlayerData.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="SharedSaveFile.cpp"
|
||||
RelativePath=".\SharedSaveFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="SkillPerLevelUp.cpp"
|
||||
RelativePath=".\SkillPerLevelUp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="SkillsPoints.cpp"
|
||||
RelativePath=".\SkillsPoints.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="StatPerLevelUp.cpp"
|
||||
RelativePath=".\StatPerLevelUp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="StatsPoints.cpp"
|
||||
RelativePath=".\StatsPoints.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="UberQuest.cpp"
|
||||
RelativePath=".\UberQuest.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="UpdateClient.cpp"
|
||||
RelativePath=".\UpdateClient.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="UpdateServer.cpp"
|
||||
RelativePath=".\UpdateServer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="WorldEvent.cpp"
|
||||
RelativePath=".\Windowed.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WorldEvent.cpp"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="Commons"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\Commons\VersionInfo.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc"
|
||||
Name="Fichiers d'en-tête"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="bigStash.h"
|
||||
RelativePath=".\bigStash.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="clientSaveFile.h"
|
||||
RelativePath=".\clientSaveFile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="commands.h"
|
||||
RelativePath=".\commands.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="common.h"
|
||||
RelativePath=".\common.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="customData.h"
|
||||
RelativePath=".\customData.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="customLibraries.h"
|
||||
RelativePath=".\customLibraries.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="d2functions.h"
|
||||
RelativePath=".\d2functions.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="error.h"
|
||||
RelativePath=".\d2wrapper.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="extendedSaveFile.h"
|
||||
RelativePath=".\error.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="extraOptions.h"
|
||||
RelativePath=".\extendedSaveFile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="globalVariable.h"
|
||||
RelativePath=".\extraOptions.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="infinityStash.h"
|
||||
RelativePath=".\globalVariable.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="INIfile.h"
|
||||
RelativePath=".\infinityStash.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="interface_Skills.h"
|
||||
RelativePath=".\INIfile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="interface_Stash.h"
|
||||
RelativePath=".\interface_Skills.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="interface_Stats.h"
|
||||
RelativePath=".\interface_Stash.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="language.h"
|
||||
RelativePath=".\interface_Stats.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="loadPlayerData.h"
|
||||
RelativePath=".\language.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mainScreen.h"
|
||||
RelativePath=".\loadPlayerData.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="modifMemory.h"
|
||||
RelativePath=".\LocalizedStrings.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="newInterface_CubeListing.h"
|
||||
RelativePath=".\mainScreen.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="newInterface_Runewords.h"
|
||||
RelativePath=".\modifMemory.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="newInterface_Stats.h"
|
||||
RelativePath=".\newInterface_CubeListing.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="newInterface_StatsPageTwo.h"
|
||||
RelativePath=".\newInterface_Runewords.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="newInterfaces.h"
|
||||
RelativePath=".\newInterface_Stats.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="othersFeatures.h"
|
||||
RelativePath=".\newInterface_StatsPageTwo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="parameters.h"
|
||||
RelativePath=".\newInterfaces.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="playerCustomData.h"
|
||||
RelativePath=".\othersFeatures.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="plugYFiles.h"
|
||||
RelativePath=".\parameters.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="resource.h"
|
||||
RelativePath=".\playerCustomData.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="savePath.h"
|
||||
RelativePath=".\plugYFiles.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="savePlayerData.h"
|
||||
RelativePath=".\resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="sharedSaveFile.h"
|
||||
RelativePath=".\savePath.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="skillPerLevelUp.h"
|
||||
RelativePath=".\savePlayerData.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="skillsPoints.h"
|
||||
RelativePath=".\sharedSaveFile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="statPerLevelUp.h"
|
||||
RelativePath=".\skillPerLevelUp.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="statsPoints.h"
|
||||
RelativePath=".\skillsPoints.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="uberQuest.h"
|
||||
RelativePath=".\statPerLevelUp.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="updateClient.h"
|
||||
RelativePath=".\statsPoints.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="updateServer.h"
|
||||
RelativePath=".\targetver.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="worldEvent.h"
|
||||
RelativePath=".\uberQuest.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\updateClient.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\updateServer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\windowed.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\worldEvent.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
@ -561,12 +568,21 @@
|
||||
RelativePath="..\Commons\updatingConst.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Commons\VersionInfo.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
Name="Fichiers de ressources"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\PlugY.rc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
|
@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioUserFile
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
ShowAllFiles="false"
|
||||
>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<DebugSettings
|
||||
Command=""
|
||||
WorkingDirectory=""
|
||||
CommandArguments=""
|
||||
Attach="false"
|
||||
DebuggerType="3"
|
||||
Remote="1"
|
||||
RemoteMachine="ATHLON64"
|
||||
RemoteCommand=""
|
||||
HttpUrl=""
|
||||
PDBPath=""
|
||||
SQLDebugging=""
|
||||
Environment=""
|
||||
EnvironmentMerge="true"
|
||||
DebuggerFlavor=""
|
||||
MPIRunCommand=""
|
||||
MPIRunArguments=""
|
||||
MPIRunWorkingDirectory=""
|
||||
ApplicationCommand=""
|
||||
ApplicationArguments=""
|
||||
ShimCommand=""
|
||||
MPIAcceptMode=""
|
||||
MPIAcceptFilter=""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<DebugSettings
|
||||
Command=""
|
||||
WorkingDirectory=""
|
||||
CommandArguments=""
|
||||
Attach="false"
|
||||
DebuggerType="3"
|
||||
Remote="1"
|
||||
RemoteMachine="ATHLON64"
|
||||
RemoteCommand=""
|
||||
HttpUrl=""
|
||||
PDBPath=""
|
||||
SQLDebugging=""
|
||||
Environment=""
|
||||
EnvironmentMerge="true"
|
||||
DebuggerFlavor=""
|
||||
MPIRunCommand=""
|
||||
MPIRunArguments=""
|
||||
MPIRunWorkingDirectory=""
|
||||
ApplicationCommand=""
|
||||
ApplicationArguments=""
|
||||
ShimCommand=""
|
||||
MPIAcceptMode=""
|
||||
MPIAcceptFilter=""
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
</VisualStudioUserFile>
|
@ -1,15 +1,15 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Adding custom data.
|
||||
Save and load infinity & shared Stash
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "plugYFiles.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
//#include "newInterfaces.h"
|
||||
@ -30,12 +30,14 @@ DWORD STDCALL isModFile (char* filename)
|
||||
{
|
||||
if (strstr(filename, modDataDirectory) )
|
||||
{
|
||||
log_msg("Load custom file : %s\n", filename);
|
||||
if ((GetFileAttributesA(filename) & 0x10) == 0)
|
||||
return true;
|
||||
char fileTemp[0x104];
|
||||
log_msg("Load custom file : %s", filename);
|
||||
strcpy(fileTemp,filename);
|
||||
D2FogGetInstallPath(filename,0x104-strlen(filename));
|
||||
strcat(filename,fileTemp);
|
||||
log_msg("-> %s\n", filename);
|
||||
log_msg("Load custom file full path : %s\n", filename);
|
||||
if ((GetFileAttributesA(filename) & 0x10) == 0)
|
||||
return true;
|
||||
}
|
||||
@ -43,6 +45,17 @@ DWORD STDCALL isModFile (char* filename)
|
||||
}
|
||||
|
||||
|
||||
DWORD STDCALL isModFile_114 (char* filename)
|
||||
{
|
||||
if (strstr(filename, modDataDirectory) )
|
||||
{
|
||||
log_msg("Load custom file : %s\n", filename);
|
||||
if ((GetFileAttributesA(filename) & 0x10) == 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_isModFile )
|
||||
TEST ESI,ESI
|
||||
JNZ ISNOTMODDATA
|
||||
@ -79,6 +92,39 @@ FCT_ASM ( caller_isModFile_111 )
|
||||
ISNOTMODDATA:
|
||||
JMP DWORD PTR CS:[LeaveCriticalSection]
|
||||
}}
|
||||
/*
|
||||
FCT_ASM ( caller_isModFile_114 )
|
||||
TEST ESI,ESI
|
||||
JNZ ISNOTMODDATA
|
||||
MOV ESI, DWORD PTR SS:[ESP+0x130]
|
||||
PUSH ESI
|
||||
CALL isModFile
|
||||
TEST EAX,EAX
|
||||
JE ISNOTMODDATA
|
||||
MOV BL, BYTE PTR SS:[ESP+0x134]
|
||||
POP EAX
|
||||
POP EAX
|
||||
MOV EAX,D2StormMPQOpenFile
|
||||
ADD EAX,0x93
|
||||
MOV EBP,GetFileAttributesA
|
||||
JMP EAX
|
||||
ISNOTMODDATA:
|
||||
JMP DWORD PTR CS:[LeaveCriticalSection]
|
||||
}}
|
||||
*/
|
||||
|
||||
FCT_ASM( caller_isModFile_114 )
|
||||
PUSH EDX
|
||||
PUSH EBX
|
||||
CALL isModFile_114
|
||||
POP EDX
|
||||
TEST EAX,EAX
|
||||
JE ISNOTMODDATA
|
||||
MOV EDX,1 // Active -direct command
|
||||
ISNOTMODDATA:
|
||||
LEA EAX,DWORD PTR SS:[EBP-0x108]
|
||||
RETN
|
||||
}}
|
||||
|
||||
void Install_PlugYFiles()
|
||||
{
|
||||
@ -88,16 +134,25 @@ void Install_PlugYFiles()
|
||||
log_msg("Patch Storm to found custom file. (PlugYFiles)\n");
|
||||
|
||||
// Try in Diablo II\PlugY\ if file not found
|
||||
mem_seek R7(Storm, 192C6, 19296, 18677, 2CC69, 14259, 121E9, 28D89);//( (DWORD)D2Storm268 + V7(Storm, 01A8, 01A8, 01AB, 0429, 0429, 0429, 0000) );
|
||||
memt_byte( 0xFF ,0x90); // NOP
|
||||
memt_byte( 0x15 ,0xE8); // CALL
|
||||
MEMD_REF4( LeaveCriticalSection, version_Storm >= V111 ? caller_isModFile_111 : caller_isModFile);
|
||||
//6FFC8677 |. FF15 F411FE6F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//6FC1CC69 |. FF15 3832C36F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//6FC04259 |. FF15 3832C36F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//6FC021E9 |. FF15 4432C36F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//6FC18D89 |. FF15 5832C36F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
|
||||
mem_seek R8(Storm, 192C6, 19296, 18677, 2CC69, 14259, 121E9, 28D89, 2DA79, 19369);//( (DWORD)D2Storm268 + V7(Storm, 01A8, 01A8, 01AB, 0429, 0429, 0429, 0000) );
|
||||
if ( version_Storm >= V114a )
|
||||
{
|
||||
memt_byte( 0x8D ,0x90); // NOP
|
||||
memt_byte( 0x85 ,0xE8); // CALL
|
||||
MEMT_REF4(0xFFFFFEF8, caller_isModFile_114);
|
||||
//00419369 |. 8D85 F8FEFFFF LEA EAX,DWORD PTR SS:[EBP-108]
|
||||
} else {
|
||||
memt_byte( 0xFF ,0x90); // NOP
|
||||
memt_byte( 0x15 ,0xE8); // CALL
|
||||
MEMD_REF4( LeaveCriticalSection, version_Storm >= V114a ? caller_isModFile_114 : version_Storm >= V111 ? caller_isModFile_111 : caller_isModFile);
|
||||
//6FFC8677 |. FF15 F411FE6F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//6FC1CC69 |. FF15 3832C36F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//6FC04259 |. FF15 3832C36F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//6FC021E9 |. FF15 4432C36F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//6FC18D89 |. FF15 5832C36F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//6FC1DA79 |. FF15 3C32C36F CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
//0041BC81 |. FF15 14C26C00 CALL DWORD PTR DS:[<&KERNEL32.LeaveCriti>; \LeaveCriticalSection
|
||||
}
|
||||
|
||||
log_msg("\n" );
|
||||
|
||||
@ -128,32 +183,45 @@ void loadImagesFile(void** images, const char* name)
|
||||
|
||||
void STDCALL loadCustomImages()
|
||||
{
|
||||
if ( active_SkillsPoints ) loadImagesFile(&unassignSkillsBtnImages, "UnassignSkillsBtns");
|
||||
if ( active_StatsPoints ) loadImagesFile(&unassignStatsBtnImages, "UnassignStatsBtns");
|
||||
if ( active_SkillsPoints ) loadImagesFile(&unassignSkillsBtnImages, "UnassignSkillsBtns");
|
||||
if ( active_StatsPoints ) loadImagesFile(&unassignStatsBtnImages, "UnassignStatsBtns");
|
||||
if ( active_multiPageStash || active_newInterfaces) loadImagesFile(&stashBtnsImages, "StashBtns");
|
||||
if ( active_sharedGold) loadImagesFile(&sharedGoldBtnsImages, "SharedGoldBtns");
|
||||
if ( active_newInterfaces ) loadImagesFile(&newStatsInterfaceImages, "EmptyPage");
|
||||
if ( active_newInterfaces ) loadImagesFile(&statsBackgroundImages, "StatsBackground");
|
||||
if ( active_sharedGold) loadImagesFile(&sharedGoldBtnsImages, "SharedGoldBtns");
|
||||
if ( active_newInterfaces ) loadImagesFile(&newStatsInterfaceImages, "EmptyPage");
|
||||
if ( active_newInterfaces ) loadImagesFile(&statsBackgroundImages, "StatsBackground");
|
||||
}
|
||||
|
||||
#define freeImagesFile(I) if(I) {D2FreeImage(I);I=NULL;}
|
||||
#define FREE_IMAGE_FILE(I) if(I) {D2FreeImage(I);I=NULL;}
|
||||
|
||||
void STDCALL freeCustomImages()
|
||||
{
|
||||
freeImagesFile(unassignSkillsBtnImages);
|
||||
freeImagesFile(unassignStatsBtnImages);
|
||||
freeImagesFile(stashBtnsImages);
|
||||
freeImagesFile(sharedGoldBtnsImages);
|
||||
freeImagesFile(newStatsInterfaceImages);
|
||||
freeImagesFile(statsBackgroundImages);
|
||||
FREE_IMAGE_FILE(unassignSkillsBtnImages);
|
||||
FREE_IMAGE_FILE(unassignStatsBtnImages);
|
||||
FREE_IMAGE_FILE(stashBtnsImages);
|
||||
FREE_IMAGE_FILE(sharedGoldBtnsImages);
|
||||
FREE_IMAGE_FILE(newStatsInterfaceImages);
|
||||
FREE_IMAGE_FILE(statsBackgroundImages);
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_loadCustomImages_114 )
|
||||
PUSH ECX
|
||||
CALL loadCustomImages
|
||||
POP ECX
|
||||
JMP D2LoadResImage
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_loadCustomImages )
|
||||
CALL loadCustomImages
|
||||
MOV ECX,0x0C
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_freeCustomImages_114 )
|
||||
CALL freeCustomImages
|
||||
CALL D2FreeResImages
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_freeCustomImages )
|
||||
CALL freeCustomImages
|
||||
MOV ECX,0x0C
|
||||
@ -170,24 +238,38 @@ void Install_PlugYImagesFiles()
|
||||
log_msg("Patch D2Client to load/free custom images. (PlugYImagesFiles)\n");
|
||||
|
||||
// Load custom images
|
||||
mem_seek R7(D2Client, 57E21, 57E21, 5E4B1, 2E101, B67E1, 82761, 27EAE);
|
||||
memt_byte( 0xB9 ,0xE8);
|
||||
MEMT_REF4( 0x0000000C , caller_loadCustomImages);
|
||||
//6FAFE4B1 |. B9 0C000000 MOV ECX,0C
|
||||
//6FADE101 |. B9 0C000000 MOV ECX,0C
|
||||
//6FB667E1 |. B9 0C000000 MOV ECX,0C
|
||||
//6FB32761 |. B9 0C000000 MOV ECX,0C
|
||||
//6FAD7EAE |. B9 0C000000 MOV ECX,0C
|
||||
mem_seek R8(D2Client, 57E21, 57E21, 5E4B1, 2E101, B67E1, 82761, 27EAE, 6E0BE, 9692F);
|
||||
if (version_D2Client == V114d)
|
||||
{
|
||||
MEMC_REF4( D2LoadResImage , caller_loadCustomImages_114);
|
||||
//0049692E |. E8 8DB7FBFF CALL Game.004520C0
|
||||
} else {
|
||||
memt_byte( 0xB9 ,0xE8);
|
||||
MEMT_REF4( 0x0000000C , caller_loadCustomImages);
|
||||
//6FAFE4B1 |. B9 0C000000 MOV ECX,0C
|
||||
//6FADE101 |. B9 0C000000 MOV ECX,0C
|
||||
//6FB667E1 |. B9 0C000000 MOV ECX,0C
|
||||
//6FB32761 |. B9 0C000000 MOV ECX,0C
|
||||
//6FAD7EAE |. B9 0C000000 MOV ECX,0C
|
||||
//6FB1E0BE |. B9 0C000000 MOV ECX,0C
|
||||
}
|
||||
|
||||
// Free custom images
|
||||
mem_seek R7(D2Client, 57FA9, 57FA9, 5E639, 2D12D, B580D, 8158D, 26F8D);
|
||||
memt_byte( 0xB9 ,0xE8);
|
||||
MEMT_REF4( 0x0000000C , caller_freeCustomImages);
|
||||
//6FAFE639 |> B9 0C000000 MOV ECX,0C
|
||||
//6FADD12D |> B9 0C000000 MOV ECX,0C
|
||||
//6FB6580D |> B9 0C000000 MOV ECX,0C
|
||||
//6FB3158D |> B9 0C000000 MOV ECX,0C
|
||||
//6FAD6F8D |> B9 0C000000 MOV ECX,0C
|
||||
mem_seek R8(D2Client, 57FA9, 57FA9, 5E639, 2D12D, B580D, 8158D, 26F8D, 6D07D, 56DED);
|
||||
if (version_D2Client == V114d)
|
||||
{
|
||||
MEMC_REF4( D2FreeResImages , caller_freeCustomImages_114);
|
||||
//00456DEC . E8 9FFB0300 CALL Game.00496990
|
||||
} else {
|
||||
memt_byte( 0xB9 ,0xE8);
|
||||
MEMT_REF4( 0x0000000C , caller_freeCustomImages);
|
||||
//6FAFE639 |> B9 0C000000 MOV ECX,0C
|
||||
//6FADD12D |> B9 0C000000 MOV ECX,0C
|
||||
//6FB6580D |> B9 0C000000 MOV ECX,0C
|
||||
//6FB3158D |> B9 0C000000 MOV ECX,0C
|
||||
//6FAD6F8D |> B9 0C000000 MOV ECX,0C
|
||||
//6FB1D07D |> B9 0C000000 MOV ECX,0C
|
||||
}
|
||||
|
||||
log_msg("\n" );
|
||||
|
||||
@ -196,12 +278,36 @@ void Install_PlugYImagesFiles()
|
||||
|
||||
|
||||
/****************************************************************************************************/
|
||||
/*char* STDCALL isModCompileFile (char* filename)
|
||||
{
|
||||
if (strstr(filename, modDataDirectory) )
|
||||
return ".";
|
||||
return NULL;
|
||||
}
|
||||
char * fff = "%s";
|
||||
FCT_ASM( caller_compileExcel_114 )
|
||||
PUSH ECX
|
||||
PUSH EDX
|
||||
PUSH EDX
|
||||
CALL isModCompileFile
|
||||
POP EDX
|
||||
POP ECX
|
||||
TEST EAX,EAX
|
||||
JE ISNOTMODDATA
|
||||
POP EAX
|
||||
MOV DWORD PTR SS:[ESP],EDX
|
||||
PUSH fff
|
||||
ADD EAX,5
|
||||
PUSH EAX
|
||||
ISNOTMODDATA:
|
||||
LEA EAX,DWORD PTR SS:[EBP-0x108]
|
||||
RETN
|
||||
}}*/
|
||||
|
||||
void loadStatsInterfaceDesc(DWORD mempool);
|
||||
void freeStatsInterfaceDesc();
|
||||
|
||||
|
||||
|
||||
void FASTCALL loadTxtFiles(DWORD mempool)
|
||||
{
|
||||
loadStatsInterfaceDesc(mempool);
|
||||
@ -230,7 +336,6 @@ FCT_ASM ( caller_freeTxtFiles )
|
||||
JMP D2Fog10212
|
||||
}}
|
||||
|
||||
|
||||
void Install_PlugYTxtFiles()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
@ -243,8 +348,8 @@ void Install_PlugYTxtFiles()
|
||||
// lookupItemStatCost = (void*)R7(D2Common, A1D70, A1D70, AA1D8, 0000, 0000, 0000, 0000);
|
||||
|
||||
// Load custom txt files
|
||||
mem_seek R7(D2Common, 7F4B, 7F4B, 2F7D7, 76854, 37444, 81C44, 5D6E4);
|
||||
MEMC_REF4( D2LoadSuperuniques, version_D2Common >= V111 ? caller_loadTxtFiles_111 : caller_loadTxtFiles );
|
||||
mem_seek R8(D2Common, 7F4B, 7F4B, 2F7D7, 76854, 37444, 81C44, 5D6E4, 855E4, 25A560);
|
||||
MEMC_REF4( D2LoadSuperuniques, version_D2Common >= V111 && version_D2Common < V114a ? caller_loadTxtFiles_111 : caller_loadTxtFiles );
|
||||
//6FD47F4A |. E8 B1750100 CALL D2Common.6FD5F500
|
||||
//6FD47F4A |. E8 C1750100 CALL D2Common.6FD5F510
|
||||
//01B6F7D6 |. E8 C5A7FFFF CALL D2Common.01B69FA0
|
||||
@ -252,9 +357,11 @@ void Install_PlugYTxtFiles()
|
||||
//6FD87443 |. E8 58B6FFFF CALL D2Common.6FD82AA0 ; \D2Common.6FD82AA0
|
||||
//6FDD1C43 |. E8 58B6FFFF CALL D2Common.6FDCD2A0 ; \D2Common.6FDCD2A0
|
||||
//6FDAD6E3 |. E8 88C1FFFF CALL D2Common.6FDA9870 ; \D2Common.6FDA9870
|
||||
//6FDD55E3 |. E8 58B6FFFF CALL D2Common.6FDD0C40 ; \D2Common.6FDD0C40
|
||||
//0065A55F |. E8 7CADFFFF CALL Game.006552E0
|
||||
|
||||
// Free custom txt files
|
||||
mem_seek R7(D2Common, 79EC, 79EC, 10186, 332B3, 15AB3, 44E13, 5E8B3);
|
||||
mem_seek R8(D2Common, 79EC, 79EC, 10186, 332B3, 15AB3, 44E13, 5E8B3, FAA3, 25A1C8);
|
||||
MEMJ_REF4( D2Fog10212, caller_freeTxtFiles );
|
||||
//6FD479EB . E8 C8C00600 CALL <JMP.&Fog.#10212>
|
||||
//6FD479EB . E8 C8C00600 CALL <JMP.&Fog.#10212>
|
||||
@ -263,6 +370,17 @@ void Install_PlugYTxtFiles()
|
||||
//6FD65AB2 |. E8 B537FFFF CALL <JMP.&Fog.#10212>
|
||||
//6FD94E12 |. E8 1744FCFF CALL <JMP.&Fog.#10212>
|
||||
//6FDAE8B2 |. E8 8FA9FAFF CALL <JMP.&Fog.#10212>
|
||||
//6FD5FAA2 |. E8 5FB4FFFF CALL <JMP.&Fog.#10212>
|
||||
//0065A1C7 . E8 E42E0600 CALL Game.006BD0B0 ; \Game.006BD0B0
|
||||
|
||||
/*if ( version_D2Client >= V114a )
|
||||
{
|
||||
mem_seek R8(Storm, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 2122A2);
|
||||
memt_byte( 0x8D ,0x90); // NOP
|
||||
memt_byte( 0x85 ,0xE8); // CALL
|
||||
MEMT_REF4(0xFFFFFEF8, caller_compileExcel_114);
|
||||
//006122A2 |. 8D85 F8FEFFFF LEA EAX,DWORD PTR SS:[EBP-108] ; |
|
||||
}*/
|
||||
|
||||
log_msg("\n" );
|
||||
|
||||
|
@ -1,52 +0,0 @@
|
||||
Parameters.h et PlugY.rc => version changing
|
||||
|
||||
A faire :
|
||||
|
||||
A tester :
|
||||
|
||||
UPDATED :
|
||||
DONE D2funcs.h
|
||||
DONE BigStash.cpp
|
||||
DONE ClientSaveFile.cpp
|
||||
DONE Commands.cpp
|
||||
DONE Common.cpp
|
||||
DONE CustomLibraries.cpp
|
||||
DONE D2functions.cpp
|
||||
DONE D2wrapper.cpp
|
||||
DONE Error.cpp
|
||||
DONE ExtendedSaveFile.cpp
|
||||
DONE ExtraOptions.cpp
|
||||
DONE GlobalVariable.cpp
|
||||
DONE InfinityStash.cpp
|
||||
DONE INIfile.cpp
|
||||
DONE Interface_Skills.cpp
|
||||
DONE Interface_Stash.cpp
|
||||
DONE Interface_Stats.cpp
|
||||
DONE Language.cpp
|
||||
DONE LoadPlayerData.cpp
|
||||
DONE MainScreen.cpp
|
||||
DONE ModifMemory.cpp
|
||||
DONE NewInterface_CubeListing.cpp
|
||||
DONE NewInterface_Runewords.cpp
|
||||
DONE NewInterface_Stats.cpp
|
||||
DONE NewInterface_StatsPageTwo.cpp
|
||||
DONE NewInterfaces.cpp
|
||||
DONE OthersFeatures.cpp
|
||||
DONE Parameters.cpp
|
||||
DONE PlayerCustomData.cpp
|
||||
DONE PlugY.cpp
|
||||
DONE PlugY.rc
|
||||
DONE PlugYFiles.cpp
|
||||
DONE SavePath.cpp
|
||||
DONE SavePlayerData.cpp
|
||||
DONE SharedSaveFile.cpp
|
||||
DONE SkillPerLevelUp.cpp
|
||||
DONE SkillsPoints.cpp
|
||||
DONE StatPerLevelUp.cpp
|
||||
DONE StatsPoints.cpp
|
||||
DONE UberQuest.cpp
|
||||
DONE UpdateClient.cpp
|
||||
DONE UpdateServer.cpp
|
||||
DONE WorldEvent.cpp
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Changing the current save path.
|
||||
|
||||
@ -7,8 +9,6 @@
|
||||
|
||||
#include "savePath.h"
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
char* savePath = NULL;
|
||||
bool active_changingSavePath = false;
|
||||
@ -50,6 +50,50 @@ END_CHANGESP:
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM( changeSavePath_114 )
|
||||
PUSH EAX
|
||||
PUSH EDI
|
||||
PUSH EDX
|
||||
PUSH ESI
|
||||
MOV ESI, EBX
|
||||
MOV EDI,DWORD PTR DS:[savePath]
|
||||
XOR AL,AL
|
||||
CLD
|
||||
OR ECX,0xFFFFFFFF
|
||||
REPNE SCAS BYTE PTR ES:[EDI]
|
||||
NOT ECX
|
||||
SUB EDI,ECX
|
||||
XCHG EDI,ESI
|
||||
CMP BYTE PTR [ESI+1],':'
|
||||
JE END_CHANGESP
|
||||
//RELATIVE_PATH:
|
||||
MOV EDX,ECX
|
||||
OR ECX,0xFFFFFFFF
|
||||
REPNE SCAS BYTE PTR ES:[EDI]
|
||||
DEC EDI
|
||||
CMP BYTE PTR [EDI-1],'\\'
|
||||
JE NEXT
|
||||
MOV BYTE PTR [EDI],'\\'
|
||||
INC EDI
|
||||
NEXT:
|
||||
MOV ECX,EDX
|
||||
END_CHANGESP:
|
||||
REP MOVS BYTE PTR ES:[EDI],BYTE PTR DS:[ESI]
|
||||
POP ESI
|
||||
POP EDX
|
||||
POP EDI
|
||||
POP EAX
|
||||
PUSH EBX
|
||||
CALL DWORD PTR[GetFileAttributesA]
|
||||
CMP EAX,-1
|
||||
JE DONOT_JMP
|
||||
ADD DWORD PTR SS:[ESP],0x5
|
||||
RETN
|
||||
DONOT_JMP:
|
||||
ADD DWORD PTR SS:[ESP],0x1D
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM( changeSavePath_111 )
|
||||
PUSH EAX
|
||||
PUSH EDI
|
||||
@ -89,6 +133,7 @@ DONOT_JMP:
|
||||
RETN
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM ( forCreateSavePath )
|
||||
PUSH EDI
|
||||
MOV EDI,DWORD PTR DS:[savePath]
|
||||
@ -112,7 +157,6 @@ END_CREATESP:
|
||||
}}
|
||||
|
||||
|
||||
|
||||
void Install_ChangingSavePath()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
@ -122,10 +166,10 @@ void Install_ChangingSavePath()
|
||||
|
||||
if (version_Fog >= V111)
|
||||
{
|
||||
// Appel de notre fct d'ajout d'un sous-répertoire
|
||||
mem_seek R7(Fog, 000, 000, 000, 185F6, 1C106, 1F086, 17F86);
|
||||
// Call funtion to manage subfolder
|
||||
mem_seek R8(Fog, 000, 000, 000, 185F6, 1C106, 1F086, 17F86, 1E146, 71A6);
|
||||
memt_byte( 0x83 ,0xE8); // CALL changeSavePath
|
||||
MEMT_REF4( 0x0575FFF8, changeSavePath_111);
|
||||
MEMT_REF4( 0x0575FFF8, version_Fog == V114d ? changeSavePath_114 : changeSavePath_111);
|
||||
//6FF685F6 . 83F8 FF CMP EAX,-1
|
||||
//6FF685F9 . 75 05 JNZ SHORT fog.6FF68600
|
||||
//6FF6C106 . 83F8 FF CMP EAX,-1
|
||||
@ -134,21 +178,29 @@ void Install_ChangingSavePath()
|
||||
//6FF6F089 . 75 05 JNZ SHORT Fog.6FF6F090
|
||||
//6FF67F86 . 83F8 FF CMP EAX,-1
|
||||
//6FF67F89 . 75 05 JNZ SHORT Fog.6FF67F90
|
||||
//6FF6E146 . 83F8 FF CMP EAX,-1
|
||||
//6FF6E149 . 75 05 JNZ SHORT Fog.6FF50F64
|
||||
//004071A6 |. 83F8 FF CMP EAX,-1
|
||||
//004071A9 |. 75 05 JNZ SHORT Game.004071B0
|
||||
|
||||
// Pour créer le bon chemin de sauvegarde
|
||||
mem_seek R7(Fog, 000, 000, 000, 18616, 1C126, 1F0A6, 17FA6);
|
||||
MEMJ_REF4( D2Storm503, forCreateSavePath);
|
||||
//6FF68615 . E8 A246FFFF CALL <JMP.&Storm.#503>
|
||||
//6FF6C125 . E8 C20BFFFF CALL <JMP.&Storm.#503>
|
||||
//6FF6F0A5 . E8 34DDFEFF CALL <JMP.&Storm.#503>
|
||||
//6FF67FA5 . E8 504EFFFF CALL <JMP.&Storm.#503>
|
||||
|
||||
// Create the right save path
|
||||
if (version_Fog < V114a)
|
||||
{
|
||||
mem_seek R8(Fog, 000, 000, 000, 18616, 1C126, 1F0A6, 17FA6, 1E166, 71CA);
|
||||
MEMJ_REF4( D2Storm503, forCreateSavePath);
|
||||
//6FF68615 . E8 A246FFFF CALL <JMP.&Storm.#503>
|
||||
//6FF6C125 . E8 C20BFFFF CALL <JMP.&Storm.#503>
|
||||
//6FF6F0A5 . E8 34DDFEFF CALL <JMP.&Storm.#503>
|
||||
//6FF67FA5 . E8 504EFFFF CALL <JMP.&Storm.#503>
|
||||
//6FF6E165 . E8 6AEBFEFF CALL <JMP.&Storm.#503>
|
||||
//004071C9 |. E8 82C50000 CALL Game.00413750 ; \Game.00413750
|
||||
}
|
||||
|
||||
// Remove registry update
|
||||
mem_seek R7(Fog, 000, 000, 000, 1861A, 1C12A, 1F0AA, 17FAA);
|
||||
memt_byte( 0x56 ,0xEB); // JMP SHORT fog.6FF6862C
|
||||
mem_seek R8(Fog, 000, 000, 000, 1861A, 1C12A, 1F0AA, 17FAA, 1E16A, 71E9);
|
||||
memt_byte( version_Fog == V114d ? 0x53 : 0x56 ,0xEB); // JMP SHORT fog.6FF6862C
|
||||
memt_byte( 0x6A ,0x10); //
|
||||
memt_byte( 0x00 ,0x90); // NOP
|
||||
memt_byte( version_Fog == V114d ? 0x01 : 0x00 ,0x90); // NOP
|
||||
//6FF6861A . 56 PUSH ESI
|
||||
//6FF6861B . 6A 00 PUSH 0
|
||||
//6FF6861D . 68 7C7BF76F PUSH fog.6FF77B7C ; ASCII "Save Path"
|
||||
@ -166,10 +218,12 @@ void Install_ChangingSavePath()
|
||||
//6FF6F0B7 . E8 58DDFEFF CALL <JMP.&Storm.#425>
|
||||
//6FF67FAA . 56 PUSH ESI
|
||||
//6FF67FAB . 6A 00 PUSH 0
|
||||
|
||||
//6FF6E16A . 56 PUSH ESI
|
||||
//6FF6E16B . 6A 00 PUSH 0
|
||||
//004071E9 |> 53 PUSH EBX ; /Arg4
|
||||
//004071EA |. 6A 01 PUSH 1 ; |Arg3 = 00000001
|
||||
} else {
|
||||
|
||||
// Appel de notre fct d'ajout d'un sous-répertoire
|
||||
// Call funtion to manage subfolder
|
||||
mem_seek( (DWORD)D2FogGetSavePath + 0x28);//6FF61928-6FF50000
|
||||
memt_byte( 0x56 ,0x90); // NOP
|
||||
memt_byte( 0xFF ,0xE8); // CALL changeSavePath
|
||||
@ -178,14 +232,14 @@ void Install_ChangingSavePath()
|
||||
//6FF61929 FFD5 CALL EBP
|
||||
//6FF6192B 83F8 FF CMP EAX,-1
|
||||
|
||||
// Pour créer le bon chemin de sauvegarde
|
||||
// Create the right save path
|
||||
mem_seek( (DWORD)D2FogGetSavePath + 0xBD);//6FF619BC
|
||||
MEMJ_REF4( D2Storm503, forCreateSavePath);
|
||||
//6FF619BC . E8 5D2A0000 CALL <JMP.&Storm.#503>
|
||||
|
||||
// Remove registry update
|
||||
mem_seek( (DWORD)D2FogGetSavePath + 0xC1);//6FF619C1-6FF50000
|
||||
memt_byte( 0x56 ,0xEB); // JMP SHORT FOG.6FF619D2
|
||||
memt_byte( 0x56 ,0xEB); // JMP SHORT FOG.6FF619D2
|
||||
memt_byte( 0x53 ,0x0F); //6FF619C3-6FF619D2
|
||||
//6FF619C1 56 PUSH ESI
|
||||
//6FF619C2 53 PUSH EBX
|
||||
|
@ -1,17 +1,158 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
|
||||
Save Player Custom Data.
|
||||
Save Player Custom Data.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include "infinityStash.h"
|
||||
#include "extendedSaveFile.h"
|
||||
#include "sharedSaveFile.h"
|
||||
#include "common.h"
|
||||
|
||||
bool active_AutoBackup = false;
|
||||
int maxBackupPerCharacter = 20;
|
||||
|
||||
/*backup
|
||||
Save SP :
|
||||
00530441 |. E8 CAC5FFFF CALL Game.0052CA10
|
||||
0052CA5A |. E8 A1590000 |CALL Game.00532400 ; \Game.00532400
|
||||
005324EB |. E8 50FDFFFF CALL Game.00532240 ; \Game.00532240
|
||||
00532275 |. E8 B6C95256 CALL PlugY.caller_SaveSPPlayerCustomData
|
||||
00530503 |. E8 98980000 |CALL Game.00539DA0
|
||||
00539E03 . E8 F82AFFFF CALL Game.0052C900
|
||||
0052C93B |. E8 C05A0000 CALL Game.00532400 ; \Game.00532400
|
||||
005324EB |. E8 50FDFFFF CALL Game.00532240 ; \Game.00532240
|
||||
00532275 |. E8 B6C95256 CALL PlugY.caller_SaveSPPlayerCustomData
|
||||
Save MP :
|
||||
00530441 |. E8 CAC5FFFF CALL Game.0052CA10
|
||||
0052CA5A |. E8 A1590000 |CALL Game.00532400 ; \Game.00532400
|
||||
005324FD |. E8 3EFEFFFF CALL Game.00532340 ; \Game.00532340
|
||||
00532399 |. E8 62D15256 CALL PlugY.caller_SendSaveFilesToSave_11>
|
||||
00530503 |. E8 98980000 |CALL Game.00539DA0
|
||||
00539E03 . E8 F82AFFFF CALL Game.0052C900
|
||||
0052C93B |. E8 C05A0000 CALL Game.00532400 ; \Game.00532400
|
||||
005324FD |. E8 3EFEFFFF CALL Game.00532340 ; \Game.00532340
|
||||
*/
|
||||
void backupSaveFiles(char* name, int isHardCoreGame)
|
||||
{
|
||||
if (!active_AutoBackup)
|
||||
return;
|
||||
|
||||
char savePath[MAX_PATH];
|
||||
char backupPath[MAX_PATH];
|
||||
char szSaveName[MAX_PATH];
|
||||
char szBackupName[MAX_PATH];
|
||||
|
||||
D2FogGetSavePath(savePath, MAX_PATH);
|
||||
|
||||
// backupfiles
|
||||
time_t t = time(NULL);
|
||||
struct tm* tm = localtime(&t);
|
||||
sprintf(backupPath, "%sbackup", savePath);
|
||||
CreateDirectory(backupPath, NULL);
|
||||
sprintf(backupPath, "%sbackup\\%s_%04d%02d%02d_%02d%02d%02d\\", savePath, name, tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
CreateDirectory(backupPath, NULL);
|
||||
log_msg("backup directory:%s isHardcore:%d\n", backupPath, isHardCoreGame);
|
||||
|
||||
sprintf(szSaveName, "%s%s.d2s", savePath, name);
|
||||
sprintf(szBackupName, "%s%s.d2s", backupPath, name);
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
|
||||
sprintf(szSaveName, "%s%s.d2x", savePath, name);
|
||||
sprintf(szBackupName, "%s%s.d2x", backupPath, name);
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
|
||||
sprintf(szSaveName, "%s%s.ma0", savePath, name);
|
||||
sprintf(szBackupName, "%s%s.ma0", backupPath, name);
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
|
||||
sprintf(szSaveName, "%s%s.ma1", savePath, name);
|
||||
sprintf(szBackupName, "%s%s.ma1", backupPath, name);
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
|
||||
sprintf(szSaveName, "%s%s.ma2", savePath, name);
|
||||
sprintf(szBackupName, "%s%s.ma2", backupPath, name);
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
|
||||
sprintf(szSaveName, "%s%s.ma3", savePath, name);
|
||||
sprintf(szBackupName, "%s%s.ma3", backupPath, name);
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
|
||||
sprintf(szSaveName, "%s%s.map", savePath, name);
|
||||
sprintf(szBackupName, "%s%s.map", backupPath, name);
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
|
||||
if (separateHardSoftStash && isHardCoreGame != 0)
|
||||
{
|
||||
sprintf(szSaveName, "%s%s%s.sss", savePath, "_LOD_HC_", sharedStashFilename);
|
||||
sprintf(szBackupName, "%s%s%s.sss", backupPath, "_LOD_HC_", sharedStashFilename);
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
}
|
||||
if (!separateHardSoftStash || isHardCoreGame != 1)
|
||||
{
|
||||
sprintf(szSaveName, "%s%s%s.sss", savePath, separateHardSoftStash && isHardCoreGame != 0? "_LOD_HC_" : "_LOD_", sharedStashFilename);
|
||||
sprintf(szBackupName, "%s%s%s.sss", backupPath, separateHardSoftStash && isHardCoreGame != 0? "_LOD_HC_" : "_LOD_", sharedStashFilename);
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
}
|
||||
|
||||
// delete older backup
|
||||
if (maxBackupPerCharacter > 0)
|
||||
{
|
||||
sprintf(szBackupName, "%sbackup\\%s_*", savePath, name);
|
||||
WIN32_FIND_DATA FindFileData;
|
||||
HANDLE hFind = FindFirstFile(szBackupName, &FindFileData);
|
||||
if (hFind)
|
||||
{
|
||||
// Count nb backup folders
|
||||
int nbFolders = (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY;
|
||||
while(FindNextFile(hFind, &FindFileData))
|
||||
nbFolders += (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY;
|
||||
|
||||
// delete nbFolders - maxfolder
|
||||
log_msg("Backup nbFolders: %d\n", nbFolders);
|
||||
nbFolders -= maxBackupPerCharacter;
|
||||
if (nbFolders > 0)
|
||||
{
|
||||
hFind = FindFirstFile(szBackupName, &FindFileData);
|
||||
do
|
||||
{
|
||||
if ((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
sprintf(backupPath, "%sbackup\\%s\\", savePath, FindFileData.cFileName);
|
||||
log_msg("Delete backup : %s\n", backupPath);
|
||||
|
||||
sprintf(szBackupName, "%s%s.d2s", backupPath, name);
|
||||
DeleteFile(szBackupName);
|
||||
sprintf(szBackupName, "%s%s.d2x", backupPath, name);
|
||||
DeleteFile(szBackupName);
|
||||
sprintf(szBackupName, "%s%s.ma0", backupPath, name);
|
||||
DeleteFile(szBackupName);
|
||||
sprintf(szBackupName, "%s%s.ma1", backupPath, name);
|
||||
DeleteFile(szBackupName);
|
||||
sprintf(szBackupName, "%s%s.ma2", backupPath, name);
|
||||
DeleteFile(szBackupName);
|
||||
sprintf(szBackupName, "%s%s.ma3", backupPath, name);
|
||||
DeleteFile(szBackupName);
|
||||
sprintf(szBackupName, "%s%s.map", backupPath, name);
|
||||
DeleteFile(szBackupName);
|
||||
sprintf(szBackupName, "%s_LOD_%s.sss", backupPath, sharedStashFilename);
|
||||
DeleteFile(szBackupName);
|
||||
sprintf(szBackupName, "%s_LOD_HC_%s.sss", backupPath, sharedStashFilename);
|
||||
DeleteFile(szBackupName);
|
||||
RemoveDirectory(backupPath);
|
||||
nbFolders--;
|
||||
}
|
||||
FindNextFile(hFind, &FindFileData);
|
||||
}
|
||||
while (nbFolders > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void STDCALL SaveSPPlayerCustomData(Unit* ptChar)
|
||||
{
|
||||
@ -19,40 +160,69 @@ void STDCALL SaveSPPlayerCustomData(Unit* ptChar)
|
||||
|
||||
log_msg("\n--- Start SaveSPPlayerCustomData ---\n");
|
||||
|
||||
if (PCPY->selfStashIsOpened)
|
||||
NetClient* ptClient = D2GetClient(ptChar,__FILE__,__LINE__);
|
||||
backupSaveFiles(PCPlayerData->name, ptClient->isHardCoreGame);
|
||||
|
||||
if (active_PlayerCustomData)
|
||||
{
|
||||
DWORD curSizeExt = 0;
|
||||
DWORD maxSizeExt = 0x4000;
|
||||
BYTE* dataExt = (BYTE *)D2AllocMem(PCGame->memoryPool, maxSizeExt,__FILE__,__LINE__,0);
|
||||
d2_assert(!dataExt, "Error : Memory allocation Extended SaveFile", __FILE__, __LINE__);
|
||||
saveExtendedSaveFile(ptChar, &dataExt, &maxSizeExt, &curSizeExt);
|
||||
writeExtendedSaveFile(PCPlayerData->name, dataExt, curSizeExt);
|
||||
D2FreeMem(PCGame->memoryPool, dataExt,__FILE__,__LINE__,0);
|
||||
if (PCPY->selfStashIsOpened)
|
||||
{
|
||||
DWORD curSizeExt = 0;
|
||||
DWORD maxSizeExt = 0x4000;
|
||||
BYTE* dataExt = (BYTE *)D2AllocMem(PCGame->memoryPool, maxSizeExt,__FILE__,__LINE__,0);
|
||||
d2_assert(!dataExt, "Error : Memory allocation Extended SaveFile", __FILE__, __LINE__);
|
||||
saveExtendedSaveFile(ptChar, &dataExt, &maxSizeExt, &curSizeExt);
|
||||
writeExtendedSaveFile(PCPlayerData->name, dataExt, curSizeExt);
|
||||
D2FreeMem(PCGame->memoryPool, dataExt,__FILE__,__LINE__,0);
|
||||
}
|
||||
|
||||
if (active_sharedStash && PCPY->sharedStashIsOpened)
|
||||
{
|
||||
DWORD curSizeShr = 0;
|
||||
DWORD maxSizeShr = 0x4000;
|
||||
BYTE* dataShr = (BYTE *)D2AllocMem(PCGame->memoryPool, maxSizeShr,__FILE__,__LINE__,0);
|
||||
d2_assert(!dataShr, "Error : Memory allocation Shared SaveFile", __FILE__, __LINE__);
|
||||
saveSharedSaveFile(ptChar, &dataShr, &maxSizeShr, &curSizeShr);
|
||||
|
||||
writeSharedSaveFile(PCPlayerData->name, dataShr, curSizeShr, ptClient->isHardCoreGame );
|
||||
D2FreeMem(PCGame->memoryPool, dataShr,__FILE__,__LINE__,0);
|
||||
}
|
||||
}
|
||||
|
||||
if (active_sharedStash && PCPY->sharedStashIsOpened)
|
||||
{
|
||||
DWORD curSizeShr = 0;
|
||||
DWORD maxSizeShr = 0x4000;
|
||||
BYTE* dataShr = (BYTE *)D2AllocMem(PCGame->memoryPool, maxSizeShr,__FILE__,__LINE__,0);
|
||||
d2_assert(!dataShr, "Error : Memory allocation Shared SaveFile", __FILE__, __LINE__);
|
||||
saveSharedSaveFile(ptChar, &dataShr, &maxSizeShr, &curSizeShr);
|
||||
|
||||
NetClient* ptClient = D2GetClient(ptChar,__FILE__,__LINE__);
|
||||
writeSharedSaveFile(PCPlayerData->name, dataShr, curSizeShr, ptClient->isHardCoreGame );
|
||||
D2FreeMem(PCGame->memoryPool, dataShr,__FILE__,__LINE__,0);
|
||||
}
|
||||
|
||||
log_msg("End saving.\n\n");
|
||||
}
|
||||
|
||||
|
||||
FCT_ASM ( caller_SaveSPPlayerCustomData_114 )
|
||||
MOV EAX,DWORD PTR SS:[ESP+8]
|
||||
TEST EAX,EAX
|
||||
JE next
|
||||
PUSH ECX
|
||||
PUSH EDX
|
||||
PUSH EDX
|
||||
CALL SaveSPPlayerCustomData
|
||||
POP EDX
|
||||
POP ECX
|
||||
next:
|
||||
JMP D2SaveSPChar
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_SaveSPPlayerCustomData_111 )
|
||||
MOV EAX,DWORD PTR SS:[ESP+0x14]
|
||||
TEST EAX,EAX
|
||||
JE next
|
||||
PUSH DWORD PTR SS:[ESP+0x8]
|
||||
CALL SaveSPPlayerCustomData
|
||||
next:
|
||||
JMP D2SaveSPChar
|
||||
}}
|
||||
|
||||
|
||||
/*FCT_ASM ( caller_SaveSPPlayerCustomData_111 )
|
||||
CALL D2FogGetSavePath
|
||||
PUSH DWORD PTR SS:[ESP+0x2608]
|
||||
CALL SaveSPPlayerCustomData
|
||||
RETN
|
||||
}}
|
||||
}}*/
|
||||
|
||||
FCT_ASM ( caller_SaveSPPlayerCustomData )
|
||||
CALL D2FogGetSavePath
|
||||
@ -187,7 +357,7 @@ void STDCALL SendSaveFilesToSave( Unit* ptChar )
|
||||
dataToSend->sizeShared = curSizeShr;
|
||||
dataToSend->curShared = 0;
|
||||
dataToSend->dataShared = dataShr;
|
||||
log_msg("clientID=%d\t init=%d\t sizeExtended=%X\t curExtended=%X\t dataExtended=%X\t sizeShared=%X\t curShared=%X\t dataShared=%08X\n",
|
||||
log_msg("SendSaveFilesToSave : clientID=%d\t init=%d\t sizeExtended=%d\t curExtended=%d\t dataExtended=%d\t sizeShared=%d\t curShared=%d\t dataShared=%08X\n",
|
||||
dataToSend->clientID, dataToSend->init, dataToSend->sizeExtended, dataToSend->curExtended, dataToSend->dataExtended, dataToSend->sizeShared, dataToSend->curShared, dataToSend->dataShared);
|
||||
|
||||
/* NetClient* ptClient = D2GetClient(ptChar,__FILE__,__LINE__);
|
||||
@ -202,19 +372,19 @@ void STDCALL SendSaveFilesToSave( Unit* ptChar )
|
||||
D2FreeMem(PCGame->memoryPool, dataShr,__FILE__,__LINE__,0);
|
||||
}
|
||||
*/
|
||||
log_msg("End SendSaveFilesToSave.\n\n");
|
||||
log_msg("SendSaveFilesToSave : End\n\n");
|
||||
}
|
||||
|
||||
|
||||
DWORD STDCALL ManageNextPacketToSend(NetClient* ptClient)
|
||||
{
|
||||
log_msg("ManageNextPacketToSend: ");
|
||||
log_msg("ManageNextPacketToSend\n");
|
||||
s_dataToSend* dataToSend = ptDataToSend;
|
||||
while (dataToSend && (dataToSend->clientID != ptClient->clientID))
|
||||
dataToSend = dataToSend->next;
|
||||
if (!dataToSend) return 1;
|
||||
|
||||
log_msg("clientID=%d\t init=%d\t sizeExtended=%X\t curExtended=%X\t dataExtended=%X\t sizeShared=%X\t curShared=%X\t dataShared=%08X\n",
|
||||
log_msg("ManageNextPacketToSend : clientID=%d\t init=%d\t sizeExtended=%d\t curExtended=%d\t dataExtended=%08X\t sizeShared=%d\t curShared=%d\t dataShared=%08X\n",
|
||||
dataToSend->clientID, dataToSend->init, dataToSend->sizeExtended, dataToSend->curExtended, dataToSend->dataExtended, dataToSend->sizeShared, dataToSend->curShared, dataToSend->dataShared);
|
||||
|
||||
if (dataToSend->sizeExtended && dataToSend->dataExtended && (dataToSend->curExtended < dataToSend->sizeExtended))
|
||||
@ -228,7 +398,7 @@ DWORD STDCALL ManageNextPacketToSend(NetClient* ptClient)
|
||||
msg->isCustom = true;
|
||||
msg->packSize = remainingData > 0xFE ? 0xFF : (BYTE)remainingData + 1;
|
||||
CopyMemory(msg->data, &dataToSend->dataExtended[dataToSend->curExtended], msg->packSize);
|
||||
log_msg("Saving Send Packet: type=%X\t init=%d\t finalSize=%X\t packSize=%02X\t data=%08X\n", msg->type, msg->init, msg->finalSize, msg->packSize, msg->data);
|
||||
log_msg("ManageNextPacketToSend : type=%d\t init=%d\t finalSize=%d\t packSize=%d\t data=%08X\n", msg->type, msg->init, msg->finalSize, msg->packSize, msg->data);
|
||||
D2SendToClient(0, dataToSend->clientID, msg, msg->packSize+7);
|
||||
dataToSend->init = false;
|
||||
dataToSend->curExtended += msg->packSize - 1;
|
||||
@ -240,7 +410,7 @@ DWORD STDCALL ManageNextPacketToSend(NetClient* ptClient)
|
||||
D2FreeMem(PClientGame->memoryPool, dataToSend->dataExtended,__FILE__,__LINE__,0);
|
||||
dataToSend->dataExtended = NULL;
|
||||
}
|
||||
log_msg("End Send Packet\n");
|
||||
log_msg("ManageNextPacketToSend : End\n");
|
||||
return 0;//ManageNextPacketToSend(ptClient);//return 0;
|
||||
}
|
||||
|
||||
@ -255,7 +425,7 @@ DWORD STDCALL ManageNextPacketToSend(NetClient* ptClient)
|
||||
msg->isCustom = true;
|
||||
msg->packSize = remainingData > 0xFE ? 0xFF : (BYTE)remainingData + 1;
|
||||
CopyMemory(msg->data, &dataToSend->dataShared[dataToSend->curShared], msg->packSize);
|
||||
log_msg("Saving Send Packet: type=%X\t init=%d\t finalSize=%X\t packSize=%02X\t data=%08X\n", msg->type, msg->init, msg->finalSize, msg->packSize, msg->data);
|
||||
log_msg("ManageNextPacketToSend : type=%d\t init=%d\t finalSize=%d\t packSize=%d\t data=%08X\n", msg->type, msg->init, msg->finalSize, msg->packSize, msg->data);
|
||||
D2SendToClient(0, dataToSend->clientID, msg, msg->packSize+7);
|
||||
dataToSend->init = false;
|
||||
dataToSend->curShared += msg->packSize - 1;
|
||||
@ -267,11 +437,11 @@ DWORD STDCALL ManageNextPacketToSend(NetClient* ptClient)
|
||||
D2FreeMem(PClientGame->memoryPool, dataToSend->dataShared,__FILE__,__LINE__,0);
|
||||
dataToSend->dataShared = NULL;
|
||||
}
|
||||
log_msg("End Send Packet\n");
|
||||
log_msg("ManageNextPacketToSend : End\n");
|
||||
return 0;//ManageNextPacketToSend(ptClient);//return 0;
|
||||
}
|
||||
|
||||
log_msg("End Send Packet\n");
|
||||
log_msg("ManageNextPacketToSend : End\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -280,7 +450,7 @@ DWORD STDCALL ReceiveSaveFilesToSave(t_rcvMsg* msg)
|
||||
{
|
||||
if( (msg->packID != customPackID) || !msg->isCustom) return 0;
|
||||
|
||||
log_msg("Saving Receive Packet: type=%X\t init=%d\t finalSize=%X\t packSize=%02X\t data=%08X\n", msg->type, msg->init, msg->finalSize, msg->packSize, msg->data);
|
||||
log_msg("ReceiveSaveFilesToSave : Receive Packet - type=%d\t init=%d\t finalSize=%d\t packSize=%d\t data=%08X\n", msg->type, msg->init, msg->finalSize, msg->packSize, msg->data);
|
||||
|
||||
bool isShared;
|
||||
|
||||
@ -295,10 +465,10 @@ DWORD STDCALL ReceiveSaveFilesToSave(t_rcvMsg* msg)
|
||||
{
|
||||
D2FogMemDeAlloc(receivedSaveFiles.dataExtended,__FILE__,__LINE__,0);
|
||||
D2FogMemDeAlloc(receivedSaveFiles.dataShared,__FILE__,__LINE__,0);
|
||||
ZeroMemory(&receivedSaveFiles, sizeof(receivedSaveFiles));//TODO
|
||||
ZeroMemory(&receivedSaveFiles, sizeof(receivedSaveFiles));
|
||||
}
|
||||
|
||||
log_msg("receivedSaveFiles: sizeExtended=%d\t curExtended=%d\t dataExtended=%08X\t sizeShared=%d\t curShared=%d\t dataShared=%08X\n", receivedSaveFiles.sizeExtended, receivedSaveFiles.curExtended, receivedSaveFiles.dataExtended, receivedSaveFiles.sizeShared, receivedSaveFiles.curShared, receivedSaveFiles.dataShared);
|
||||
log_msg("ReceiveSaveFilesToSave : sizeExtended=%d\t curExtended=%d\t dataExtended=%08X\t sizeShared=%d\t curShared=%d\t dataShared=%08X\n", receivedSaveFiles.sizeExtended, receivedSaveFiles.curExtended, receivedSaveFiles.dataExtended, receivedSaveFiles.sizeShared, receivedSaveFiles.curShared, receivedSaveFiles.dataShared);
|
||||
|
||||
DWORD size = msg->packSize - 1;
|
||||
if (isShared)
|
||||
@ -325,38 +495,44 @@ DWORD STDCALL ReceiveSaveFilesToSave(t_rcvMsg* msg)
|
||||
CopyMemory(&receivedSaveFiles.dataExtended[receivedSaveFiles.curExtended], msg->data, size);
|
||||
receivedSaveFiles.curExtended += size;
|
||||
}
|
||||
log_msg("End Save Receive Packet\n");
|
||||
log_msg("ReceiveSaveFilesToSave : End\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void STDCALL SaveMPPlayerCustomData(BYTE* dataD2Savefile )
|
||||
{
|
||||
log_msg("Start SaveMPPlayerCustomData.\n");
|
||||
log_msg("SaveMPPlayerCustomData - Start.\n");
|
||||
|
||||
Unit* ptChar = D2GetClientPlayer();
|
||||
if( receivedSaveFiles.sizeExtended && (receivedSaveFiles.sizeExtended == receivedSaveFiles.curExtended) && receivedSaveFiles.sizeShared && (receivedSaveFiles.sizeShared == receivedSaveFiles.curShared) )
|
||||
backupSaveFiles(PCPlayerData->name, (dataD2Savefile[0x24] & 4) == 4);
|
||||
|
||||
if (active_PlayerCustomData)
|
||||
{
|
||||
log_msg("Saving can start\n");
|
||||
if (ptChar)
|
||||
if( receivedSaveFiles.sizeExtended && (receivedSaveFiles.sizeExtended == receivedSaveFiles.curExtended) && (!active_sharedStash || receivedSaveFiles.sizeShared && (receivedSaveFiles.sizeShared == receivedSaveFiles.curShared)) )
|
||||
{
|
||||
writeExtendedSaveFile(PCPlayerData->name, receivedSaveFiles.dataExtended, receivedSaveFiles.sizeExtended);
|
||||
D2FogMemDeAlloc(receivedSaveFiles.dataExtended,__FILE__,__LINE__,0);
|
||||
if (active_sharedStash)
|
||||
writeSharedSaveFile(PCPlayerData->name, receivedSaveFiles.dataShared, receivedSaveFiles.sizeShared, (dataD2Savefile[0x24] & 4) == 4);//6FBAB9A4-6FAA0000
|
||||
D2FogMemDeAlloc(receivedSaveFiles.dataShared,__FILE__,__LINE__,0);
|
||||
ZeroMemory(&receivedSaveFiles,sizeof(receivedSaveFiles));
|
||||
}
|
||||
log_msg("Receive Savefiles completed\n\n");
|
||||
} else {
|
||||
if (ptChar)
|
||||
{
|
||||
log_box("Connection error : back up current save file then save with client data.");
|
||||
backupSharedSaveFile();
|
||||
backupExtendedSaveFile(PCPlayerData->name);
|
||||
SaveSPPlayerCustomData(ptChar);
|
||||
log_msg("SaveMPPlayerCustomData - Saving can start\n");
|
||||
if (ptChar)
|
||||
{
|
||||
writeExtendedSaveFile(PCPlayerData->name, receivedSaveFiles.dataExtended, receivedSaveFiles.sizeExtended);
|
||||
D2FogMemDeAlloc(receivedSaveFiles.dataExtended,__FILE__,__LINE__,0);
|
||||
if (active_sharedStash)
|
||||
{
|
||||
writeSharedSaveFile(PCPlayerData->name, receivedSaveFiles.dataShared, receivedSaveFiles.sizeShared, (dataD2Savefile[0x24] & 4) == 4);//6FBAB9A4-6FAA0000
|
||||
D2FogMemDeAlloc(receivedSaveFiles.dataShared,__FILE__,__LINE__,0);
|
||||
}
|
||||
ZeroMemory(&receivedSaveFiles,sizeof(receivedSaveFiles));
|
||||
}
|
||||
log_msg("SaveMPPlayerCustomData - Receive Savefiles completed\n\n");
|
||||
} else {
|
||||
if (ptChar)
|
||||
{
|
||||
log_box("Connection error : save with client data.");
|
||||
SaveSPPlayerCustomData(ptChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
log_msg("--- End SaveMPPlayerCustomData. ---\n\n");
|
||||
log_msg("--- SaveMPPlayerCustomData End ---\n\n");
|
||||
}
|
||||
|
||||
|
||||
@ -427,7 +603,12 @@ end_caller_ManageNextPacketToSend_9d:
|
||||
RETN
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM( caller_SendSaveFilesToSave_114 )
|
||||
PUSH DWORD PTR SS:[ESP+0x4]
|
||||
CALL SendSaveFilesToSave
|
||||
MOV EDI,DWORD PTR SS:[EBP-0x2008]
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM( caller_SendSaveFilesToSave_111 )
|
||||
PUSH DWORD PTR SS:[ESP+0x2014]
|
||||
@ -453,6 +634,21 @@ FCT_ASM( caller_SendSaveFilesToSave_9 )
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_ReceivedSaveFilesToSave_114 )
|
||||
CMP EDX,-1
|
||||
JE continue_rcvFct
|
||||
PUSH ECX
|
||||
PUSH EDX
|
||||
PUSH ECX
|
||||
CALL ReceiveSaveFilesToSave
|
||||
POP EDX
|
||||
POP ECX
|
||||
TEST EAX,EAX
|
||||
JE continue_rcvFct
|
||||
RETN
|
||||
continue_rcvFct:
|
||||
JMP D2ReceivePacket
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_ReceivedSaveFilesToSave_111 )
|
||||
LEA EAX,DWORD PTR SS:[ESP+0x10]
|
||||
@ -499,8 +695,6 @@ FCT_ASM ( caller_SaveMPPlayerCustomData_111 )
|
||||
RETN
|
||||
}}
|
||||
|
||||
|
||||
|
||||
FCT_ASM ( caller_SaveMPPlayerCustomData )
|
||||
PUSH ECX
|
||||
PUSH ECX
|
||||
@ -512,69 +706,107 @@ FCT_ASM ( caller_SaveMPPlayerCustomData )
|
||||
}}
|
||||
|
||||
|
||||
|
||||
void Install_SavePlayerData()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled || !active_PlayerCustomData) return;
|
||||
if (isInstalled) return;
|
||||
|
||||
log_msg("Patch D2Game & D2Client for save Player's custom data. (SavePlayerData)\n");
|
||||
|
||||
//Save single player custom data.
|
||||
mem_seek R7(D2Game, 4DF04, 4E304, 5A624, B9365, 25475, 44165, 53F35);
|
||||
MEMJ_REF4( D2FogGetSavePath, version_D2Game >= V111 ? caller_SaveSPPlayerCustomData_111 : version_D2Game != V109b ? caller_SaveSPPlayerCustomData : caller_SaveSPPlayerCustomData_9);
|
||||
//6FC8A623 E8 3E210900 CALL <JMP.&Fog.#10115>
|
||||
//02039364 |. E8 3B0FF5FF CALL <JMP.&Fog.#10115>
|
||||
//01F95474 |. E8 C34EFEFF CALL <JMP.&Fog.#10115>
|
||||
//6FC64164 |. E8 EB61FCFF CALL <JMP.&Fog.#10115>
|
||||
//6FC73F34 |. E8 DD63FBFF CALL <JMP.&Fog.#10115>
|
||||
if (version_D2Game >= V111)
|
||||
{
|
||||
mem_seek R8(D2Game, 0000, 0000, 0000, B9801, 25911, 44601, 543D1, 39CD1, 1324EC);
|
||||
MEMC_REF4( D2SaveSPChar, version_D2Game >= V114a ? caller_SaveSPPlayerCustomData_114 : version_D2Game >= V111 ? caller_SaveSPPlayerCustomData_111 : version_D2Game != V109b ? caller_SaveSPPlayerCustomData : caller_SaveSPPlayerCustomData_9);
|
||||
//6FCD9800 |. E8 3BFBFFFF CALL D2Game.6FCD9340
|
||||
//6FC45910 |. E8 3BFBFFFF CALL D2Game.6FC45450
|
||||
//6FC64600 |. E8 3BFBFFFF CALL D2Game.6FC64140
|
||||
//6FC743D0 |. E8 3BFBFFFF CALL D2Game.6FC73F10
|
||||
//6FC59CD0 |. E8 3BFBFFFF CALL D2Game.6FC59810
|
||||
//005324EB |. E8 50FDFFFF CALL Game.00532240 ; \Game.00532240
|
||||
}
|
||||
else
|
||||
{
|
||||
mem_seek R8(D2Game, 4DF04, 4E304, 5A624, B9365, 25475, 44165, 53F35, 39835, 132276);
|
||||
MEMJ_REF4( D2FogGetSavePath, /*version_D2Game >= V114a ? caller_SaveSPPlayerCustomData : version_D2Game >= V111 ? caller_SaveSPPlayerCustomData_111 :*/ version_D2Game != V109b ? caller_SaveSPPlayerCustomData : caller_SaveSPPlayerCustomData_9);
|
||||
//6FC8A623 E8 3E210900 CALL <JMP.&Fog.#10115>
|
||||
//02039364 |. E8 3B0FF5FF CALL <JMP.&Fog.#10115>
|
||||
//01F95474 |. E8 C34EFEFF CALL <JMP.&Fog.#10115>
|
||||
//6FC64164 |. E8 EB61FCFF CALL <JMP.&Fog.#10115>
|
||||
//6FC73F34 |. E8 DD63FBFF CALL <JMP.&Fog.#10115>
|
||||
//6FC59834 |. E8 FB0AFDFF CALL <JMP.&Fog.#10115>
|
||||
//00532275 |. E8 D64DEDFF CALL Game.00407050
|
||||
}
|
||||
|
||||
//Send SaveFiles
|
||||
mem_seek R7(D2Game, 4DFFA, 4E3FA, 5A720, B92DB, 253EB, 440DB, 53EAB);
|
||||
memt_byte( 0x8B ,0x90); // NOP
|
||||
memt_byte( version_D2Game >= V111 ? 0x44 : version_D2Game != V109b ? 0x7C : 0x74 ,0xE8); // CALL
|
||||
MEMT_REF4( version_D2Game >= V111 ? 0xC0850424 : version_D2Game != V109b ? 0xFF851024 : 0xF6851024, version_D2Game >= V111 ? caller_SendSaveFilesToSave_111 : version_D2Game != V109b ? caller_SendSaveFilesToSave : caller_SendSaveFilesToSave_9);
|
||||
//6FC8A720 |. 8B7C24 10 MOV EDI,DWORD PTR SS:[ESP+10]
|
||||
//6FC8A724 |. 85FF TEST EDI,EDI
|
||||
//020392DB |. 8B4424 04 MOV EAX,DWORD PTR SS:[ESP+4]
|
||||
//020392DF |. 85C0 TEST EAX,EAX
|
||||
//01F953EB |. 8B4424 04 MOV EAX,DWORD PTR SS:[ESP+4]
|
||||
//01F953EF |. 85C0 TEST EAX,EAX
|
||||
//6FC640DB |. 8B4424 04 MOV EAX,DWORD PTR SS:[ESP+4]
|
||||
//6FC640DF |. 85C0 TEST EAX,EAX
|
||||
//6FC73EAB |. 8B4424 04 MOV EAX,DWORD PTR SS:[ESP+4]
|
||||
//6FC73EAF |. 85C0 TEST EAX,EAX
|
||||
if (active_PlayerCustomData)
|
||||
{
|
||||
//Send SaveFiles
|
||||
mem_seek R8(D2Game, 4DFFA, 4E3FA, 5A720, B92DB, 253EB, 440DB, 53EAB, 397AB, 132398);
|
||||
memt_byte( 0x8B ,0x90); // NOP
|
||||
memt_byte( version_D2Game >= V114d ? 0xBD : version_D2Game >= V111 ? 0x44 : version_D2Game != V109b ? 0x7C : 0x74, 0xE8); // CALL
|
||||
MEMT_REF4( version_D2Game >= V114d ? 0xFFFFDFF8 : version_D2Game >= V111 ? 0xC0850424 : version_D2Game != V109b ? 0xFF851024 : 0xF6851024, version_D2Game >= V114d ? caller_SendSaveFilesToSave_114 : version_D2Game >= V111 ? caller_SendSaveFilesToSave_111 : version_D2Game != V109b ? caller_SendSaveFilesToSave : caller_SendSaveFilesToSave_9);
|
||||
//6FC8A720 |. 8B7C24 10 MOV EDI,DWORD PTR SS:[ESP+10]
|
||||
//6FC8A724 |. 85FF TEST EDI,EDI
|
||||
//020392DB |. 8B4424 04 MOV EAX,DWORD PTR SS:[ESP+4]
|
||||
//020392DF |. 85C0 TEST EAX,EAX
|
||||
//01F953EB |. 8B4424 04 MOV EAX,DWORD PTR SS:[ESP+4]
|
||||
//01F953EF |. 85C0 TEST EAX,EAX
|
||||
//6FC640DB |. 8B4424 04 MOV EAX,DWORD PTR SS:[ESP+4]
|
||||
//6FC640DF |. 85C0 TEST EAX,EAX
|
||||
//6FC73EAB |. 8B4424 04 MOV EAX,DWORD PTR SS:[ESP+4]
|
||||
//6FC73EAF |. 85C0 TEST EAX,EAX
|
||||
//6FC597AB |. 8B4424 04 MOV EAX,DWORD PTR SS:[ESP+4]
|
||||
//6FC597AF |. 85C0 TEST EAX,EAX
|
||||
//00532398 |. 8BBD F8DFFFFF MOV EDI,DWORD PTR SS:[EBP-2008]
|
||||
|
||||
mem_seek R7(D2Game, 7993, 7A13, 7BBB, E2943, E6D83, A89D3, 2D173);
|
||||
memt_byte( 0x8B ,0x90); // NOP
|
||||
memt_byte( version_D2Game >= V110 ? 0x8E : 0x86 ,0xE8); // CALL
|
||||
MEMT_REF4( version_D2Game >= V110 ? 0x0000017C : version_D2Game == V109d ? 0x0000174 : 0x00000150, version_D2Game >= V110 ? caller_ManageNextPacketToSend : version_D2Game == V109d ? caller_ManageNextPacketToSend_9d : caller_ManageNextPacketToSend_9);
|
||||
//6FC37BBB |> 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//02062943 |. 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//02056D83 |. 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//6FCC89D3 |. 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//6FC4D173 |. 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
mem_seek R8(D2Game, 7993, 7A13, 7BBB, E2943, E6D83, A89D3, 2D173, BEDD3, 12E13E);
|
||||
memt_byte( 0x8B ,0x90); // NOP
|
||||
memt_byte( version_D2Game >= V110 ? 0x8E : 0x86 ,0xE8); // CALL
|
||||
MEMT_REF4( version_D2Game >= V110 ? 0x0000017C : version_D2Game == V109d ? 0x0000174 : 0x00000150, version_D2Game >= V110 ? caller_ManageNextPacketToSend : version_D2Game == V109d ? caller_ManageNextPacketToSend_9d : caller_ManageNextPacketToSend_9);
|
||||
//6FC37BBB |> 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//02062943 |. 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//02056D83 |. 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//6FCC89D3 |. 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//6FC4D173 |. 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//6FCDEDD3 |. 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
//0052E13E |> 8B8E 7C010000 MOV ECX,DWORD PTR DS:[ESI+17C]
|
||||
|
||||
// mem_seek R7(D2Game, 7B82, 7C05, 7DCF, 0000, 0000, 0000, 0000);//117FC, 117EC, 11DBC
|
||||
// memt_byte( 0x8B ,0xE8); // CALL
|
||||
// MEMT_REF4( (version_D2Game == V110) ? 0x50CD8BD3 : 0x50CF8BD3, (version_D2Game == V110) ? caller_SendSaveFilesToSave : caller_SendSaveFilesToSave_9);
|
||||
//6FC37DCF |. 8BD3 |MOV EDX,EBX
|
||||
//6FC37DD1 |. 8BCD |MOV ECX,EBP
|
||||
//6FC37DD3 |. 50 |PUSH EAX
|
||||
// mem_seek R7(D2Game, 7B82, 7C05, 7DCF, 0000, 0000, 0000, 0000);//117FC, 117EC, 11DBC
|
||||
// memt_byte( 0x8B ,0xE8); // CALL
|
||||
// MEMT_REF4( (version_D2Game == V110) ? 0x50CD8BD3 : 0x50CF8BD3, (version_D2Game == V110) ? caller_SendSaveFilesToSave : caller_SendSaveFilesToSave_9);
|
||||
//6FC37DCF |. 8BD3 |MOV EDX,EBX
|
||||
//6FC37DD1 |. 8BCD |MOV ECX,EBP
|
||||
//6FC37DD3 |. 50 |PUSH EAX
|
||||
|
||||
//Received SaveFiles
|
||||
mem_seek R8(D2Client, 116F0, 116E0, 11CB0, 89246, 32076, 7BCD6, 43946, 448E6, 4C70D);
|
||||
if ( version_D2Game >= V114a )
|
||||
{
|
||||
MEMC_REF4( D2ReceivePacket, caller_ReceivedSaveFilesToSave_114);
|
||||
//0044C70C |. E8 3F010100 |CALL Game.0045C850
|
||||
}
|
||||
else if ( version_D2Game >= V111 )
|
||||
{
|
||||
memt_byte( 0x0F ,0xE8);
|
||||
MEMT_REF4( 0x0C2444B6, caller_ReceivedSaveFilesToSave_111);
|
||||
//6FB39246 |. 0FB64424 0C |MOVZX EAX,BYTE PTR SS:[ESP+C]
|
||||
//6FAE2076 |. 0FB64424 0C |MOVZX EAX,BYTE PTR SS:[ESP+C]
|
||||
//6FB2BCD6 |. 0FB64424 0C |MOVZX EAX,BYTE PTR SS:[ESP+C]
|
||||
//6FAF3946 |. 0FB64424 0C |MOVZX EAX,BYTE PTR SS:[ESP+C]
|
||||
//6FAF48E6 |. 0FB64424 0C |MOVZX EAX,BYTE PTR SS:[ESP+C]
|
||||
} else {
|
||||
//Received SaveFiles
|
||||
memt_byte( 0x81 ,0x90); // NOP
|
||||
memt_byte( 0xEC ,0xE8); // CALL
|
||||
MEMT_REF4( 0x000005F4, caller_ReceivedSaveFilesToSave);
|
||||
//6FAB1CB0 |$ 81EC F4050000 SUB ESP,5F4
|
||||
}
|
||||
}
|
||||
|
||||
if ( version_D2Game >= V111 )
|
||||
{
|
||||
//Received SaveFiles
|
||||
mem_seek R7(D2Client, 116F0, 116E0, 11CB0, 89246, 32076, 7BCD6, 43946);
|
||||
memt_byte( 0x0F ,0xE8);
|
||||
MEMT_REF4( 0x0C2444B6, caller_ReceivedSaveFilesToSave_111);
|
||||
//6FB39246 |. 0FB64424 0C |MOVZX EAX,BYTE PTR SS:[ESP+C]
|
||||
//6FAE2076 |. 0FB64424 0C |MOVZX EAX,BYTE PTR SS:[ESP+C]
|
||||
//6FB2BCD6 |. 0FB64424 0C |MOVZX EAX,BYTE PTR SS:[ESP+C]
|
||||
//6FAF3946 |. 0FB64424 0C |MOVZX EAX,BYTE PTR SS:[ESP+C]
|
||||
|
||||
// Save multiplayer player custom data.
|
||||
mem_seek R7(D2Client, 117FC, 117EC, 11DBC, 99AE2, BD7F2, 64A22, AC572);
|
||||
mem_seek R8(D2Client, 117FC, 117EC, 11DBC, 99AE2, BD7F2, 64A22, AC572, 829C2, 5C565);
|
||||
memt_byte( 0x81 ,0xE8); // CALL
|
||||
MEMT_REF4( 0x55AA55F9, caller_SaveMPPlayerCustomData_111);
|
||||
memt_byte( 0xAA ,0x90); // CALL
|
||||
@ -582,16 +814,11 @@ void Install_SavePlayerData()
|
||||
//6FB6D7F2 |. 81F9 55AA55AA CMP ECX,AA55AA55
|
||||
//6FB14A22 |. 81F9 55AA55AA CMP ECX,AA55AA55
|
||||
//6FB5C572 |. 81F9 55AA55AA CMP ECX,AA55AA55
|
||||
//6FB329C2 |. 81F9 55AA55AA CMP ECX,AA55AA55
|
||||
//0045C565 |. 81F9 55AA55AA CMP ECX,AA55AA55
|
||||
} else {
|
||||
//Received SaveFiles
|
||||
mem_seek R7(D2Client, 116F0, 116E0, 11CB0, 89246, 32076, 7BCD6, 0000);
|
||||
memt_byte( 0x81 ,0x90); // NOP
|
||||
memt_byte( 0xEC ,0xE8); // CALL
|
||||
MEMT_REF4( 0x000005F4, caller_ReceivedSaveFilesToSave);
|
||||
//6FAB1CB0 |$ 81EC F4050000 SUB ESP,5F4
|
||||
|
||||
// Save multiplayer player custom data.
|
||||
mem_seek R7(D2Client, 117FC, 117EC, 11DBC, 99AE2, BD7F2, 64A22, 0000);
|
||||
mem_seek R8(D2Client, 117FC, 117EC, 11DBC, 99AE2, BD7F2, 64A22, 0000, 0000, 0000);
|
||||
memt_byte( 0x8B ,0xE8); // CALL
|
||||
MEMT_REF4( 0x04518B01, caller_SaveMPPlayerCustomData);
|
||||
//6FAB1DBC |. 8B01 MOV EAX,DWORD PTR DS:[ECX]
|
||||
|
@ -1,24 +1,21 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Add an extra save file shared by all own characters.
|
||||
Add an extra save file shared by all own characters.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "sharedSaveFile.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "infinityStash.h"
|
||||
#include "customLibraries.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define FILE_SHAREDSTASH 0x00535353 //"SSS "
|
||||
#define BUFFER_SIZE 0x4000
|
||||
#define FILE_VERSION 0x3230 //"02"
|
||||
|
||||
//6FC8CE8A |. E8 A16BFAFF CALL D2Game.6FC33A30
|
||||
//$+C0 > 1F 00 00 00 03 00 00 06 .....
|
||||
// 28 0010 1000
|
||||
|
||||
BYTE* readSharedSaveFile(char* name, DWORD* size)
|
||||
{
|
||||
char filename[512];
|
||||
@ -152,46 +149,12 @@ void writeSharedSaveFile(char* name, BYTE* data, DWORD size, bool isHardcore)
|
||||
strcat(szSaveName,".sss");
|
||||
log_msg("Shared 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 shared save file.");
|
||||
}
|
||||
|
||||
void backupSharedSaveFile()
|
||||
{
|
||||
char szBackupName[MAX_PATH];
|
||||
char szSaveName[MAX_PATH];
|
||||
|
||||
D2FogGetSavePath( szSaveName, MAX_PATH-30);
|
||||
strcat(szSaveName, "_LOD_");
|
||||
strcat(szSaveName, sharedStashFilename);
|
||||
strcat(szSaveName,".sss");
|
||||
|
||||
D2FogGetSavePath( szBackupName, MAX_PATH-30);
|
||||
strcat(szBackupName, "_LOD_");
|
||||
strcat(szBackupName, sharedStashFilename);
|
||||
strcat(szBackupName,".sss.backup");
|
||||
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
|
||||
if (separateHardSoftStash)
|
||||
{
|
||||
D2FogGetSavePath( szSaveName, MAX_PATH-30);
|
||||
strcat(szSaveName, "_LOD_HC_");
|
||||
strcat(szSaveName, sharedStashFilename);
|
||||
strcat(szSaveName,".sss");
|
||||
|
||||
D2FogGetSavePath( szBackupName, MAX_PATH-30);
|
||||
strcat(szBackupName, "_LOD_HC_");
|
||||
strcat(szBackupName, sharedStashFilename);
|
||||
strcat(szBackupName,".sss.backup");
|
||||
|
||||
CopyFile(szSaveName, szBackupName, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void saveSharedSaveFile(Unit* ptChar, BYTE** data, DWORD* maxSize, DWORD* curSize)
|
||||
{
|
||||
*(DWORD *)(*data + *curSize) = FILE_SHAREDSTASH;
|
||||
|
@ -1,18 +1,25 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Change Skill win per level up.
|
||||
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "skillPerLevelUp.h"
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
bool active_SkillPerLevelUpChange=0;
|
||||
DWORD skillPerLevelUp=1;
|
||||
|
||||
FCT_ASM ( caller_changeSkillPerLevelUp_114 )
|
||||
MOV EAX,skillPerLevelUp
|
||||
IMUL EAX,EDI
|
||||
MOV DWORD PTR SS:[ESP+0xC], EAX
|
||||
JMP V2AddPlayerStat
|
||||
}}
|
||||
|
||||
|
||||
FCT_ASM ( caller_changeSkillPerLevelUp_111 )
|
||||
MOV EAX,skillPerLevelUp
|
||||
@ -33,17 +40,18 @@ void Install_SkillPerLevelUp()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
|
||||
log_msg("Patch D2Game for change Skill points win per level up. (SkillPerLevelUp)\n");
|
||||
|
||||
mem_seek R7(D2Game, 42261, 42651, 4ED60, D7AE5, 79695, AA455, EB1E5);
|
||||
MEMJ_REF4( V2AddPlayerStat, version_D2Game >= V111 ? caller_changeSkillPerLevelUp_111 : caller_changeSkillPerLevelUp);
|
||||
mem_seek R8(D2Game, 42261, 42651, 4ED60, D7AE5, 79695, AA455, EB1E5, EDCA5, 1709D1);
|
||||
MEMJ_REF4( V2AddPlayerStat, version_D2Game >= V114d ? caller_changeSkillPerLevelUp_114 : version_D2Game >= V111 ? caller_changeSkillPerLevelUp_111 : caller_changeSkillPerLevelUp);
|
||||
//6FC7ED5F |. E8 56CB0900 CALL <JMP.&D2Common.#10518>
|
||||
//02057AE4 |. E8 9F28F3FF CALL <JMP.&D2Common.#10109>
|
||||
//01FE9694 |. E8 1B0DF9FF CALL <JMP.&D2Common.#10627>
|
||||
//6FCCA454 |. E8 5F01F6FF CALL <JMP.&D2Common.#10762>
|
||||
//6FD0B1E4 |. E8 E9F2F1FF CALL <JMP.&D2Common.#10551>
|
||||
|
||||
//6FD0DCA4 |. E8 FDC6F1FF CALL <JMP.&D2Common.#10645>
|
||||
//005709D0 |. E8 DB680B00 CALL Game.006272B0 ; \Game.006272B0
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
|
@ -5,14 +5,12 @@
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
#include "updateServer.h"
|
||||
#include "interface_Skills.h" // Install_InterfaceSkills()
|
||||
#include "common.h"
|
||||
|
||||
bool active_SkillsPoints=0;
|
||||
bool unassignSkillsPointsOneByOne=0;
|
||||
bool unassignSkillsPointsOneForOne=0;
|
||||
|
||||
int (*getskPoint)(SkillData* ptSkill);
|
||||
int (*getCharClass)(SkillData* ptSkill);
|
||||
@ -42,8 +40,10 @@ void UnassignAllSkillsPoints(Unit* ptChar)
|
||||
DWORD skillID, keepBonus, maxSkillLevel;
|
||||
int skpoints;
|
||||
DWORD nbPoints = 0;
|
||||
|
||||
void* ptClient = D2GetClient(ptChar,__FILE__,__LINE__);
|
||||
SkillData* ptSkill = PCSkills->ptFirstSkill;
|
||||
|
||||
while (ptSkill)
|
||||
{
|
||||
if (getCharClass(ptSkill) == ptChar->nPlayerClass)//ptSkill->ptSkillBin->charclass
|
||||
@ -53,7 +53,7 @@ void UnassignAllSkillsPoints(Unit* ptChar)
|
||||
keepBonus = !getSingleSkillValue(ptChar, STATS_ITEM_SINGLESKILL, skillID);
|
||||
maxSkillLevel = D2GetSkillLevel(ptChar, ptSkill, 0);
|
||||
skpoints = getskPoint(ptSkill);
|
||||
if (skpoints == -1 || unassignSkillsPointsOneByOne)
|
||||
if (skpoints == -1 || unassignSkillsPointsOneForOne)
|
||||
{
|
||||
D2SetSkillBaseLevel(ptChar, skillID, 0, keepBonus, __FILE__, __LINE__);
|
||||
nbPoints += maxSkillLevel;
|
||||
|
@ -1,5 +1,7 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Change Stat win per level up.
|
||||
|
||||
@ -7,12 +9,17 @@
|
||||
|
||||
#include "statPerLevelUp.h"
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
bool active_StatPerLevelUpChange=0;
|
||||
DWORD statPerLevelUp=5;
|
||||
|
||||
FCT_ASM ( caller_changeStatPerLevelUp_114 )
|
||||
MOV EAX,statPerLevelUp
|
||||
IMUL EAX,EDI
|
||||
MOV DWORD PTR SS:[ESP+0xC], EAX
|
||||
JMP V2AddPlayerStat
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_changeStatPerLevelUp_111 )
|
||||
MOV EAX,statPerLevelUp
|
||||
IMUL EAX,EBX
|
||||
@ -31,16 +38,18 @@ void Install_StatPerLevelUp()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
|
||||
log_msg("Patch D2Game for change Stat points win per level up. (StatPerLevelUp)\n");
|
||||
|
||||
mem_seek R7(D2Game, 42258, 42648, 4ED55, D7ADA, 7968A, AA44A, EB1DA);
|
||||
MEMJ_REF4( V2AddPlayerStat, version_D2Game >= V111 ? caller_changeStatPerLevelUp_111 : caller_changeStatPerLevelUp);
|
||||
mem_seek R8(D2Game, 42258, 42648, 4ED55, D7ADA, 7968A, AA44A, EB1DA, EDC9A, 1709C6);
|
||||
MEMJ_REF4( V2AddPlayerStat, version_D2Game >= V114d ? caller_changeStatPerLevelUp_114 : version_D2Game >= V111 ? caller_changeStatPerLevelUp_111 : caller_changeStatPerLevelUp);
|
||||
//6FC7ED54 |. E8 61CB0900 CALL <JMP.&D2Common.#10518>
|
||||
//02057AD9 |. E8 AA28F3FF CALL <JMP.&D2Common.#10109>
|
||||
//01FE9689 |. E8 260DF9FF CALL <JMP.&D2Common.#10627>
|
||||
//6FCCA449 |. E8 6A01F6FF CALL <JMP.&D2Common.#10762>
|
||||
//6FD0B1D9 |. E8 F4F2F1FF CALL <JMP.&D2Common.#10551>
|
||||
//6FD0DC99 |. E8 08C7F1FF CALL <JMP.&D2Common.#10645>
|
||||
//005709C5 |. E8 E6680B00 CALL Game.006272B0 ; \Game.006272B0
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Unassign Stats Point for futher re-assignment.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
#include "plugYFiles.h" // Install_PlugYImagesFiles()
|
||||
#include "interface_Stats.h" // Install_InterfaceStats()
|
||||
#include "updateServer.h"
|
||||
#include "extraOptions.h"
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
bool active_StatsPoints=0;
|
||||
@ -42,7 +42,7 @@ void UnassignDex(Unit* ptChar, int nb)
|
||||
|
||||
int currentDex, removePtsNb;
|
||||
CharStatsBIN* charStats = D2GetCharStatsBIN(ptChar->nPlayerClass);
|
||||
|
||||
|
||||
currentDex = D2GetPlayerBaseStat( ptChar, STATS_DEXTERITY, 0 );
|
||||
if (currentDex <= charStats->baseDEX) return;
|
||||
removePtsNb = currentDex - charStats->baseDEX >= nb ? nb : currentDex - charStats->baseDEX;
|
||||
@ -59,14 +59,14 @@ void UnassignVit(Unit* ptChar, int nb)
|
||||
|
||||
int currentVit, removePtsNb, removeVitNb, removeStaNb;
|
||||
CharStatsBIN* charStats = D2GetCharStatsBIN(ptChar->nPlayerClass);
|
||||
|
||||
|
||||
currentVit = D2GetPlayerBaseStat( ptChar, STATS_VITALITY, 0 );
|
||||
if (currentVit <= charStats->baseVIT) return;
|
||||
removePtsNb = currentVit - charStats->baseVIT >= nb ? nb : currentVit - charStats->baseVIT;
|
||||
if (currentVit - removePtsNb < 1) removePtsNb = currentVit - 1;
|
||||
removeVitNb = removePtsNb * (charStats->lifePerVitality << 6);
|
||||
removeStaNb = removePtsNb * (charStats->staminaPerVitality << 6);
|
||||
|
||||
|
||||
log_msg("Start Unassign Vitality (cur %d, base %d, rem %d)\n",currentVit,charStats->baseVIT,removePtsNb);
|
||||
D2AddPlayerStat( ptChar, STATS_VITALITY, -removePtsNb ,0 );
|
||||
D2AddPlayerStat( ptChar, STATS_MAXHP, -removeVitNb ,0 );
|
||||
@ -80,13 +80,13 @@ void UnassignEne(Unit* ptChar, int nb)
|
||||
|
||||
int currentEne, removePtsNb, removeManNb;
|
||||
CharStatsBIN* charStats = D2GetCharStatsBIN(ptChar->nPlayerClass);
|
||||
|
||||
|
||||
currentEne = D2GetPlayerBaseStat( ptChar, STATS_ENERGY, 0);
|
||||
if (currentEne <= charStats->baseENE) return;
|
||||
removePtsNb = currentEne - charStats->baseENE >= nb ? nb : currentEne - charStats->baseENE;
|
||||
if (currentEne - removePtsNb < 1) removePtsNb = currentEne - 1;
|
||||
removeManNb = removePtsNb * (charStats->manaPerMagic << 6);
|
||||
|
||||
|
||||
log_msg("Start Unassign Energy (cur %d, base %d, rem %d)\n",currentEne,charStats->baseENE,removePtsNb);
|
||||
D2AddPlayerStat( ptChar, STATS_ENERGY, -removePtsNb ,0 );
|
||||
D2AddPlayerStat( ptChar, STATS_MAXMANA, -removeManNb ,0 );
|
||||
@ -161,11 +161,15 @@ void STDCALL printDisabledStatsBtn(WORD statID, sDrawImageInfo* data, DWORD x, D
|
||||
{
|
||||
WCHAR text[100];
|
||||
if (active_StatsShiftClickLimit)
|
||||
swprintf(text, getTranslatedString(STR_STATS_UNASSIGN_WITH_LIMIT),limitValueToShiftClick);
|
||||
_snwprintf(text, sizeof(text) - 1, getLocalString(STR_STATS_UNASSIGN_WITH_LIMIT), limitValueToShiftClick);
|
||||
else
|
||||
swprintf(text, getTranslatedString(STR_STATS_UNASSIGN_WITHOUT_LIMIT));
|
||||
wcscat(text,L"\n");
|
||||
swprintf(text+wcslen(text), getTranslatedString(STR_STATS_BASE_MIN), statValue, minValue);
|
||||
_snwprintf(text, sizeof(text) - 1, getLocalString(STR_STATS_UNASSIGN_WITHOUT_LIMIT));
|
||||
if (active_DisplayBaseStatsValue)
|
||||
{
|
||||
wcscat(text,L"\n");
|
||||
int len = wcslen(text);
|
||||
_snwprintf(text + len, sizeof(text) - len, getLocalString(STR_STATS_BASE_MIN), statValue, minValue);
|
||||
}
|
||||
D2SetFont(1);
|
||||
D2PrintPopup(text, x+18, y-32, WHITE, 1);
|
||||
}
|
||||
@ -250,6 +254,13 @@ END_UNASSGNSTATS:
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_setValue_114 )
|
||||
MOV CL,0x3A
|
||||
OR DX,WORD PTR DS:[ESI]
|
||||
ADD DL, currentMsgID
|
||||
MOV CH, DL
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_setValue_111 )
|
||||
ADD CL,currentMsgID
|
||||
@ -289,6 +300,21 @@ DWORD STDCALL pushDown (DWORD num)
|
||||
return 0;
|
||||
}
|
||||
|
||||
FCT_ASM( caller_pushDown_114 )
|
||||
PUSH EDX
|
||||
PUSH DWORD PTR SS:[EBP+0x8]
|
||||
CALL pushDown
|
||||
POP EDX
|
||||
TEST EAX, EAX
|
||||
JNZ end_pushDown
|
||||
SUB DWORD PTR SS:[ESP],0x22
|
||||
RETN
|
||||
end_pushDown :
|
||||
MOV EAX, DWORD PTR SS:[EBP+8]
|
||||
LEA ECX, DWORD PTR DS:[EAX*8]
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_pushDown_111 )
|
||||
PUSH EDX
|
||||
PUSH EDX
|
||||
@ -328,42 +354,59 @@ void Install_StatsPoints()
|
||||
Install_UpdateServer();
|
||||
|
||||
log_msg("Patch D2Client for unassign stat points when specified key is press. (StatsPoints)\n");
|
||||
//if ( version_D2Client < V113 )
|
||||
{
|
||||
|
||||
// Always print stat button images.
|
||||
mem_seek R7(D2Client, 29B12, 29B02, 30073, 82BBA, 8963A, 6B59A, BD1B5);
|
||||
mem_seek R8(D2Client, 29B12, 29B02, 30073, 82BBA, 8963A, 6B59A, BD1B5, BF955, A7FFB);
|
||||
memt_byte( 0x8B, 0xEB ); // JMP SHORT D2Client.6FAD0088
|
||||
memt_byte( 0x4C, V7(D2Client, 12, 12, 13, 13, 13, 13, 13) );
|
||||
memt_byte( 0x24, 0x90 ); // NOP
|
||||
memt_byte( V7(D2Client, 20, 20, 14, 1C, 1C, 1C, 1C), 0x90 ); // NOP (V109d:0x20 , V110:0x14
|
||||
memt_byte( version_D2Client == V114d ? 0x4D : 0x4C, V8(D2Client, 12, 12, 13, 13, 13, 13, 13, 13, 12) );
|
||||
memt_byte( version_D2Client == V114d ? 0xF8 : 0x24, 0x90 ); // NOP
|
||||
if (version_D2Client < V114a) memt_byte( V8(D2Client, 20, 20, 14, 1C, 1C, 1C, 1C, 1C, 53), 0x90 ); // NOP (V109d:0x20 , V110:0x14
|
||||
//6FAD0073 8B4C24 14 MOV ECX,DWORD PTR SS:[ESP+14]
|
||||
//6FB32BBA > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//6FB3963A > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//6FB1B59A > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//6FB6D1B5 |> 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//6FB6F955 > 8B4C24 1C MOV ECX,DWORD PTR SS:[ESP+1C]
|
||||
//004A7FFB > 8B4D F8 MOV ECX,DWORD PTR SS:[EBP-8]
|
||||
//004A7FFE . 53 PUSH EBX ; /Arg3
|
||||
|
||||
//print our buttons
|
||||
mem_seek R7(D2Client, 29B9D, 29B8D, 300FD, 82C54, 896D4, 6B637, BD23E);
|
||||
mem_seek R8(D2Client, 29B9D, 29B8D, 300FD, 82C54, 896D4, 6B637, BD23E, BF9DE, A808C);
|
||||
MEMJ_REF4( D2PrintImage, caller_printUnassignStatsBtn);
|
||||
//6FB32C53 . E8 82A3F8FF CALL <JMP.&D2gfx.#10047>
|
||||
//6FB396D3 . E8 D238F8FF CALL <JMP.&D2gfx.#10044>
|
||||
//6FB1B636 . E8 431AFAFF CALL <JMP.&D2gfx.#10024>
|
||||
//6FB6D23D . E8 54FEF4FF CALL <JMP.&D2gfx.#10041>
|
||||
//6FB6F9DD . E8 ECD5F4FF CALL <JMP.&D2gfx.#10042>
|
||||
//004A808B . E8 F0E30400 CALL Game.004F6480 ; \Game.004F6480
|
||||
|
||||
// Always manage push down.
|
||||
mem_seek R7(D2Client, 2AA7B, 2AA6B, 3134D, 827D9, 89259, 6B1B9, BCDD9);
|
||||
mem_seek R8(D2Client, 2AA7B, 2AA6B, 3134D, 827D9, 89259, 6B1B9, BCDD9, BF579, A77E4);
|
||||
memt_byte( 0x74, 0x90 ); // NOP
|
||||
memt_byte( 0x4E, 0x90 ); // NOP
|
||||
//6FAD134D 74 4E JE SHORT D2Client.6FAD139D
|
||||
memt_byte( version_D2Client == V114d ? 0x62 : 0x4E, 0x90 ); // NOP
|
||||
//6FAD134D 74 4E JE SHORT D2Client.6FAD139D
|
||||
//6FB327D9 . 74 4E JE SHORT D2Client.6FB32829
|
||||
//6FB39259 . 74 4E JE SHORT D2Client.6FB392A9
|
||||
//6FB1B1B9 74 4E JE SHORT D2Client.6FB1B209
|
||||
//6FB1B1B9 74 4E JE SHORT D2Client.6FB1B209
|
||||
//6FB6CDD9 . 74 4E JE SHORT D2Client.6FB6CE29
|
||||
//6FB6F579 . 74 4E JE SHORT D2Client.6FB6F5C9
|
||||
//004A77E4 . 74 62 JE SHORT Game.004A7848
|
||||
|
||||
if ( version_D2Client >= V111 )
|
||||
if ( version_D2Client >= V114d )
|
||||
{
|
||||
// On Push down.
|
||||
mem_seek R7(D2Client, 2AAE6, 2AAD6, 313B8, 82844, 892C4, 6B224, BCE44);
|
||||
mem_seek R8(D2Client, 2AAE6, 2AAD6, 313B8, 82844, 892C4, 6B224, BCE44, BF5E4, A7863);
|
||||
memt_byte(0x8B, 0xE8);
|
||||
MEMT_REF4(0x0C8D0845, caller_pushDown_114);
|
||||
memt_byte(0xC5, 0x90);
|
||||
memt_dword(0x00000000, 0x90909090);
|
||||
//004A7863 > 8B45 08 MOV EAX,DWORD PTR SS:[EBP+8]
|
||||
//004A7866 . 8D0CC5 0000000>LEA ECX,DWORD PTR DS:[EAX*8]
|
||||
}
|
||||
else if ( version_D2Client >= V111 )
|
||||
{
|
||||
// On Push down.
|
||||
mem_seek R8(D2Client, 2AAE6, 2AAD6, 313B8, 82844, 892C4, 6B224, BCE44, BF5E4, A7863);
|
||||
memt_byte( 0x6B, 0xE8 );
|
||||
MEMT_REF4( 0x01BF0ED2, caller_pushDown_111);
|
||||
memt_byte( 0x00, 0x6B ); // IMUL EDX,EDX,0E
|
||||
@ -377,10 +420,12 @@ void Install_StatsPoints()
|
||||
//6FB1B227 BF 01000000 MOV EDI,1
|
||||
//6FB6CE44 > 6BD2 0E IMUL EDX,EDX,0E
|
||||
//6FB6CE47 . BF 01000000 MOV EDI,1
|
||||
//6FB6F5E4 > 6BD2 0E IMUL EDX,EDX,0E
|
||||
//6FB6F5E7 . BF 01000000 MOV EDI,1
|
||||
|
||||
} else {
|
||||
// On Push down.
|
||||
mem_seek R7(D2Client, 2AAE6, 2AAD6, 313B8, 82844, 892C4, 0000, 0000);
|
||||
mem_seek R8(D2Client, 2AAE6, 2AAD6, 313B8, 82844, 892C4, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0x8D, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x0000D504, caller_pushDown);
|
||||
memt_byte( 0x00, 0x90 ); // NOP
|
||||
@ -392,17 +437,20 @@ void Install_StatsPoints()
|
||||
if ( version_D2Client >= V110 )
|
||||
{
|
||||
// Always manage push up.
|
||||
mem_seek R7(D2Client, 0000, 0000, 3152E, 83869, 8A2E9, 6C249, BDE49);
|
||||
memt_byte( 0x74, 0x90 ); // NOP
|
||||
memt_byte( version_D2Client >= V111 ? 0x65 : 0x68, 0x90 ); // NOP
|
||||
mem_seek R8(D2Client, 0000, 0000, 3152E, 83869, 8A2E9, 6C249, BDE49, C05E9, A7976);
|
||||
memt_byte( version_D2Client == V114d ? 0x0F : 0x74, 0x90 ); // NOP
|
||||
memt_byte( version_D2Client == V114d ? 0x84 : version_D2Client >= V111 ? 0x65 : 0x68, 0x90 ); // NOP
|
||||
if (version_D2Client == V114d) memt_dword(0x000000BB, 0x90909090);
|
||||
//6FAD152E 74 68 JE SHORT D2Client.6FAD1598
|
||||
//6FB33869 . 74 65 JE SHORT D2Client.6FB338D0
|
||||
//6FB3A2E9 . 74 65 JE SHORT D2Client.6FB3A350
|
||||
//6FB1C249 74 65 JE SHORT D2Client.6FB1C2B0
|
||||
//6FB1C249 74 65 JE SHORT D2Client.6FB1C2B0
|
||||
//6FB6DE49 . 74 65 JE SHORT D2Client.6FB6DEB0
|
||||
//6FB705E9 . 74 65 JE SHORT D2Client.6FB70650
|
||||
//004A7976 |. 0F84 BB000000 JE Game.004A7A37
|
||||
|
||||
// Unassign stats point when ctrl is push.
|
||||
mem_seek R7(D2Client, 0000, 0000, 315D3, 8391B, 8A39B, 6C2FB, BDEFB);
|
||||
mem_seek R8(D2Client, 0000, 0000, 315D3, 8391B, 8A39B, 6C2FB, BDEFB, C069B, A79F2);
|
||||
memt_byte( 0x66, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x077CC085, caller_UnassignStats);
|
||||
//6FAD15D3 . 66:85C0 TEST AX,AX
|
||||
@ -415,35 +463,42 @@ void Install_StatsPoints()
|
||||
//6FB1C2FE . 7C 07 JL SHORT D2Client.6FB1C307
|
||||
//6FB6DEFB . 66:85C0 TEST AX,AX
|
||||
//6FB6DEFE . 7C 07 JL SHORT D2Client.6FB6DF07
|
||||
//6FB7069B . 66:85C0 TEST AX,AX
|
||||
//6FB7069E . 7C 07 JL SHORT D2Client.6FB706A7
|
||||
//004A79F2 |. 66:85C0 TEST AX,AX
|
||||
//004A79F5 |. 7C 07 JL SHORT Game.004A79FE
|
||||
} else {
|
||||
// Always manage push up.
|
||||
mem_seek R7(D2Client, 2AC55, 2AC45, 0000, 0000, 0000, 0000, 0000);
|
||||
mem_seek R8(D2Client, 2AC55, 2AC45, 0000, 0000, 0000, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0x0F, 0x90 ); // NOP
|
||||
memt_byte( 0x84, 0x90 ); // NOP
|
||||
memt_dword( 0x000000AE, 0x90909090 ); // NOP NOP NOP NOP
|
||||
//6FACAC45 . 0F84 AE000000 JE D2Client.6FACACF9
|
||||
|
||||
// Unassign stats point when ctrl is push.
|
||||
mem_seek R7(D2Client, 2ACD9, 2ACC9, 0000, 0000, 0000, 0000, 0000);
|
||||
mem_seek R8(D2Client, 2ACD9, 2ACC9, 0000, 0000, 0000, 0000, 0000, 0000, 0000);
|
||||
memt_byte( 0xB8, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x00000001, caller_UnassignStats_9);
|
||||
//6FACACC9 . B8 01000000 MOV EAX,1
|
||||
}
|
||||
|
||||
// Set the id for the calling function.
|
||||
mem_seek R7(D2Client, 2AD02, 2ACF2, 31611, 8395E, 8A3DE, 6C33E, BDF3E);
|
||||
mem_seek R8(D2Client, 2AD02, 2ACF2, 31611, 8395E, 8A3DE, 6C33E, BDF3E, C06DE, A7A29);
|
||||
if ( version_D2Client >= V111 ) {
|
||||
memt_byte( 0x66, 0xE8 ); // CALL
|
||||
MEMT_REF4( 0x15244C89, caller_setValue_111);
|
||||
memt_byte( version_D2Client == V114d ? 0xB1 : 0x66, 0xE8 ); // CALL
|
||||
MEMT_REF4( version_D2Client == V114d ? 0x160B663A : 0x15244C89, version_D2Client == V114d ? caller_setValue_114 : caller_setValue_111);
|
||||
//6FB3395E . 66:894C24 15 MOV WORD PTR SS:[ESP+15],CX
|
||||
//6FB3A3DE . 66:894C24 15 MOV WORD PTR SS:[ESP+15],CX
|
||||
//6FB1C33E . 66:894C24 15 MOV WORD PTR SS:[ESP+15],CX ; |
|
||||
//6FB6DF3E . 66:894C24 15 MOV WORD PTR SS:[ESP+15],CX ; |
|
||||
//6FB706DE . 66:894C24 15 MOV WORD PTR SS:[ESP+15],CX ; |
|
||||
//004A7A29 |. B1 3A |MOV CL,3A
|
||||
//004A7A2B |. 66:0B16 |OR DX,WORD PTR DS:[ESI]
|
||||
} else {
|
||||
MEMC_REF4( D2SendToServer3, caller_setValue);
|
||||
//6FAD1610 . E8 7BC3FDFF CALL D2Client.6FAAD990
|
||||
}
|
||||
} log_msg("\n");
|
||||
log_msg("\n");
|
||||
|
||||
isInstalled = true;
|
||||
}
|
||||
@ -475,7 +530,7 @@ void Install_StatsLimitShiftClick()
|
||||
log_msg("Patch D2Client for limit the assigment of stat points when shift is used. (LimitShift)\n");
|
||||
|
||||
// Limit the assigment of stat points.
|
||||
mem_seek R7(D2Client, 2ACD0, 2ACC0, 315CD, 83915, 8A395, 6C2F5, BDEF5);
|
||||
mem_seek R8(D2Client, 2ACD0, 2ACC0, 315CD, 83915, 8A395, 6C2F5, BDEF5, C0695, A79EC);
|
||||
memt_byte( 0xFF, 0x90 ); // NOP
|
||||
memt_byte( 0x15, 0xE8 ); // CALL
|
||||
MEMD_REF4( GetKeyState, version_D2Client >= V111 ? caller_LimitShift_111 : caller_LimitShift);
|
||||
@ -484,6 +539,8 @@ void Install_StatsLimitShiftClick()
|
||||
//6FB3A395 . FF15 08F1B76F CALL DWORD PTR DS:[<&USER32.GetKeyState>]
|
||||
//6FB1C2F5 . FF15 10F1B76F CALL DWORD PTR DS:[<&USER32.GetKeyState>>; \GetKeyState
|
||||
//6FB6DEF5 . FF15 04F1B76F CALL DWORD PTR DS:[<&USER32.GetKeyState>>; \GetKeyState
|
||||
//6FB70695 . FF15 2001B86F CALL DWORD PTR DS:[<&USER32.GetKeyState>>; \GetKeyState
|
||||
//004A79EC |. FF15 5CC46C00 CALL DWORD PTR DS:[<&USER32.GetKeyState>>; \GetKeyState
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
|
@ -1,56 +1,70 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Uber Quest Management.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include <math.h>
|
||||
#include "uberQuest.h"
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
bool active_UberQuest=0;
|
||||
|
||||
/*
|
||||
void* ptQuest = D2GetPlayerData(ptChar)->ptQuest[ptGame->difficultyLevel];
|
||||
if (D2CheckQuestState(ptGame->game10F4[0xC],4,0xB) ||
|
||||
D2CheckQuestState(ptQuest,4,0xA) ||
|
||||
ptGame->ptIsLodGame && !D2CheckQuestState(ptQuest,0x28,0)
|
||||
// !ptGame->ptIsLodGame && D2CheckQuestState(ptQuest,0x1A,0)TODO for !ptGame->ptIsLodGame...
|
||||
{
|
||||
// d2_assert(!ptChar,"openPandPortal : ptChar==NULL",__FILE__,__LINE__);
|
||||
// ptChar->v6E = 0x14;
|
||||
// ptChar->v70 = ptChar;
|
||||
// D2Common10148(ptChar);
|
||||
// ptChar->flag400 = 1;
|
||||
// return 0;
|
||||
}
|
||||
Room* = ptRoom = D2GetRoom(ptChar);
|
||||
if (D2GetLevelID(ptRoom) != 1) return 0;
|
||||
Position pos1;
|
||||
D2GetPosition(ptChar, &pos1);
|
||||
void* ptPortal = NULL;
|
||||
D2Game02059FE0(ptRoom,&pos1,3,0x400,&ptPortal,0x64);
|
||||
if (!ptPortal) return 0;
|
||||
Position pos2;
|
||||
pos2.x = pos1.x;
|
||||
pos2.y = pos1.y;
|
||||
testing crash useless...
|
||||
D2GetDropRoom(ptRoom, &pos2, &pos2,3,0x3E01,0xC01,0);
|
||||
*/
|
||||
|
||||
/*
|
||||
void* FASTCALL D2Game01F81090(Room* ptRoom, DWORD x, DWORD y);//0x1090
|
||||
|
||||
*/
|
||||
|
||||
#define OBJECT_PERMANENT_PORTAL 0x3C
|
||||
#define LEVEL_ACT5TOWN 109
|
||||
#define LEVEL_ACT5TOWN 109
|
||||
#define LEVEL_ACT5_PANDEMONIUM1 133
|
||||
#define LEVEL_ACT5_PANDEMONIUM2 134
|
||||
#define LEVEL_ACT5_PANDEMONIUM3 135
|
||||
#define LEVEL_ACT5_PANDEMONIUM_FINAL 136
|
||||
|
||||
#define UBER_IZUAL_ID 706
|
||||
#define UBER_ANDARIEL_ID 707
|
||||
#define UBER_DURIEL_ID 708
|
||||
#define UBER_MEPHISTO_ID 704
|
||||
#define UBER_DIABLO_ID 705
|
||||
#define UBER_BAAL_ID 709
|
||||
|
||||
#define UBER_MEPHISTO_SQUELETON 725
|
||||
#define UBER_MEPHISTO_ARCHER 726
|
||||
#define UBER_MEPHISTO_FIRE 727
|
||||
#define UBER_MEPHISTO_LIGHTNING 728
|
||||
#define UBER_MEPHISTO_COLD 729
|
||||
#define UBER_MEPHISTO_POISON 730
|
||||
#define UBER_BAAL_DARK_LORD 731
|
||||
#define UBER_BAAL_SPECTER 732
|
||||
#define UBER_DIABLO_PIT_LORD 711
|
||||
|
||||
|
||||
bool active_UberQuest = false;
|
||||
DWORD UberMephistoX = 25130;
|
||||
DWORD UberMephistoY = 5143;
|
||||
DWORD UberDiabloX = 25139;
|
||||
DWORD UberDiabloY = 5139;
|
||||
DWORD UberBaalX = 25139;
|
||||
DWORD UberBaalY = 5135;
|
||||
|
||||
bool active_UberMinions = true;
|
||||
DWORD UberMephistoNbMinions = 6;
|
||||
DWORD UberMephistoMinions[] = {UBER_MEPHISTO_SQUELETON, UBER_MEPHISTO_ARCHER, UBER_MEPHISTO_FIRE, UBER_MEPHISTO_LIGHTNING, UBER_MEPHISTO_COLD, UBER_MEPHISTO_POISON};
|
||||
int UberMephistoSpawnPercent = 80;
|
||||
DWORD UberMephistoSpawnRadius = 30;
|
||||
DWORD UberBaalNbMinions = 2;
|
||||
DWORD UberBaalMinions[] = {UBER_BAAL_DARK_LORD, UBER_BAAL_SPECTER};
|
||||
int UberBaalSpawnPercent = 30;
|
||||
DWORD UberBaalSpawnRadius = 30;
|
||||
DWORD UberDiabloNbMinions = 1;
|
||||
DWORD UberDiabloMinions[] = {UBER_DIABLO_PIT_LORD};
|
||||
int UberDiabloSpawnPercent = 30;
|
||||
DWORD UberDiabloSpawnRadius = 30;
|
||||
|
||||
bool active_UberDiabloRushTweekAI = false;
|
||||
bool active_UberBaalTeleportTweekAI = false;
|
||||
bool active_UberBaalChillingArmorTweekAI = false;
|
||||
int uberBaalChillingArmorTimer = 6000;
|
||||
|
||||
int uberBaalChillingArmorLastFrame = 0;
|
||||
|
||||
static struct
|
||||
{
|
||||
union{
|
||||
@ -71,39 +85,48 @@ static struct
|
||||
int count1;
|
||||
int count2;
|
||||
int count3;
|
||||
int count4;
|
||||
int count5;
|
||||
int count6;
|
||||
Room* room1;
|
||||
Room* room2;
|
||||
Room* room3;
|
||||
Room* room4;
|
||||
Room* room5;
|
||||
Room* room6;
|
||||
} questState;
|
||||
|
||||
|
||||
int GetNbMonsters(Level* level, Position position, int radius);
|
||||
int GetNbMonsters(Level* level);
|
||||
|
||||
bool IsInRoom(Room* ptRoom, DWORD x, DWORD y)
|
||||
{
|
||||
DWORD startX = version_D2Game > V112 ? ptRoom->startX : *((DWORD*)ptRoom + 6);
|
||||
DWORD startY = version_D2Game > V112 ? ptRoom->startY : *((DWORD*)ptRoom + 7);
|
||||
DWORD sizeX = version_D2Game > V112 ? ptRoom->sizeX : *((DWORD*)ptRoom + 8);
|
||||
DWORD sizeY = version_D2Game > V112 ? ptRoom->sizeY : *((DWORD*)ptRoom + 9);
|
||||
return x >= startX && x <= startX + sizeX &&
|
||||
y >= startY && y <= startY + sizeY;
|
||||
}
|
||||
|
||||
double Distance(Position p1, Position p2)
|
||||
{
|
||||
return sqrt((double)(p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) * (p2.y - p1.y));
|
||||
}
|
||||
|
||||
void resetQuestState()
|
||||
{
|
||||
ZeroMemory(&questState,sizeof(questState));
|
||||
questState.count1 = 10 + RANDOM(10);
|
||||
questState.count2 = 20 + RANDOM(40);
|
||||
questState.count3 = 10 + RANDOM(20);
|
||||
int value = 5 + RANDOM(10);
|
||||
questState.count4 = value + RANDOM(4);
|
||||
questState.count5 = value + RANDOM(4);
|
||||
questState.count6 = value + RANDOM(4);
|
||||
log_msg("Uber Quest State : %d %d %d %d %d %d\n",questState.count1, questState.count2, questState.count3, questState.count4, questState.count5, questState.count6);
|
||||
uberBaalChillingArmorLastFrame = 0;
|
||||
log_msg("Uber Quest State : %d %d %d\n",questState.count1, questState.count2, questState.count3);
|
||||
}
|
||||
|
||||
DWORD openPortalOnLevel(Game* ptGame, Unit* ptChar, DWORD levelID)
|
||||
{
|
||||
log_msg("openning portal to level %d\n",levelID);
|
||||
log_msg("Open portal to level %d\n", levelID);
|
||||
Room* ptRoom = D2GetRoom(ptChar);
|
||||
if ( D2GetLevelID(ptRoom) != LEVEL_ACT5TOWN ) return 0;
|
||||
|
||||
//Get position in the room
|
||||
Position pos;
|
||||
D2GetPosition(ptChar, &pos);
|
||||
log_msg("ptChar pos : %d %d\n", pos.x, pos.y);
|
||||
|
||||
if (!D2GetDropRoom(ptRoom, &pos, &pos, 3, 0x3E01, 0xC01, 0)) return 0;
|
||||
ptRoom = D2TestPositionInRoom(ptRoom, pos.x, pos.y);
|
||||
if (!ptRoom) return 0;
|
||||
@ -123,11 +146,10 @@ DWORD openPortalOnLevel(Game* ptGame, Unit* ptChar, DWORD levelID)
|
||||
DWORD FASTCALL openPandPortal(Game* ptGame, Unit* ptChar)
|
||||
{
|
||||
log_msg("openPandPortal\n");
|
||||
Position pos;
|
||||
D2GetPosition(ptChar, &pos);
|
||||
log_msg("ptChar pos : %d %d\n",pos.x,pos.y);
|
||||
|
||||
if (ptGame->difficultyLevel != D2DM_HELL) return 0;
|
||||
if (ptGame->difficultyLevel != D2DM_HELL)
|
||||
return 0;
|
||||
|
||||
int available[3];
|
||||
int nbAvailable=0;
|
||||
if (!questState.portal1Opened) available[nbAvailable++]=LEVEL_ACT5_PANDEMONIUM1;
|
||||
@ -140,45 +162,30 @@ DWORD FASTCALL openPandPortal(Game* ptGame, Unit* ptChar)
|
||||
|
||||
int ret = openPortalOnLevel(ptGame, ptChar, selectedTargetLevel);
|
||||
|
||||
|
||||
if (ret)
|
||||
{
|
||||
if (selectedTargetLevel == LEVEL_ACT5_PANDEMONIUM1) questState.portal1Opened = 1;
|
||||
else if (selectedTargetLevel == LEVEL_ACT5_PANDEMONIUM2) questState.portal2Opened = 1;
|
||||
else if (selectedTargetLevel == LEVEL_ACT5_PANDEMONIUM3) questState.portal3Opened = 1;
|
||||
}
|
||||
log_msg("openPandPortal ending\n\n");
|
||||
return ret;//normally return ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
DWORD FASTCALL openPandFinalPortal(Game* ptGame, Unit* ptChar)
|
||||
{
|
||||
log_msg("openPandFinalPortal\n");
|
||||
Position pos;
|
||||
D2GetPosition(ptChar, &pos);
|
||||
log_msg("ptChar pos : %d %d",pos.x,pos.y);
|
||||
int ret = openPortalOnLevel(ptGame, ptChar, LEVEL_ACT5_PANDEMONIUM_FINAL);
|
||||
log_msg("openPandFinalPortal ending\n");
|
||||
return ret;//normally return ret;
|
||||
}
|
||||
|
||||
Room* selectRoom(Game* ptGame, Room* ptCurrentRoom, DWORD level)
|
||||
{
|
||||
/* Room* tab[200];
|
||||
nbRoom=0;
|
||||
Room* ptRoom = ptGame->mapAct[5]->ptFirstRoom;
|
||||
while (ptRoom);
|
||||
if(!ptCurrentRoom->nbNearRooms) return ptCurrentRoom;
|
||||
int targetRoomNum = RANDOM(ptCurrentRoom->nbNearRooms);
|
||||
Room* ptRoom = ptCurrentRoom->ptNearRooms;
|
||||
while (targetRoomNum--)
|
||||
ptRoom = ptRoom->ptNextRoom;*/
|
||||
return ptCurrentRoom;
|
||||
if (ptGame->difficultyLevel != D2DM_HELL)
|
||||
return 0;
|
||||
|
||||
return openPortalOnLevel(ptGame, ptChar, LEVEL_ACT5_PANDEMONIUM_FINAL);
|
||||
}
|
||||
|
||||
void STDCALL spawnUber(Game* ptGame, Room* ptRoom)
|
||||
{
|
||||
log_msg("Uber Quest State : %d %d %d %d %d %d\n",questState.count1, questState.count2, questState.count3, questState.count4, questState.count5, questState.count6);
|
||||
log_msg("Uber Quest State : %d %d %d\n",questState.count1, questState.count2, questState.count3);
|
||||
log_msg("Uber Quest questState spawn : %d %d %d %d %d %d\n",questState.uber1Spawned, questState.uber2Spawned, questState.uber3Spawned, questState.uber4Spawned, questState.uber5Spawned, questState.uber6Spawned);
|
||||
switch(D2GetLevelID(ptRoom))
|
||||
{
|
||||
case LEVEL_ACT5_PANDEMONIUM1:
|
||||
@ -186,8 +193,7 @@ void STDCALL spawnUber(Game* ptGame, Room* ptRoom)
|
||||
{
|
||||
if (questState.count1) questState.count1--;
|
||||
else {
|
||||
Room* ptTargetRoom = selectRoom(ptGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
if (D2SpawnMonster(ptGame, ptTargetRoom, 0, 0, 0, -1, 707, 0))
|
||||
if (D2SpawnSuperUnique(ptGame, ptRoom, 0, 0, 0, -1, UBER_ANDARIEL_ID, 0))
|
||||
questState.uber1Spawned = 1;
|
||||
}
|
||||
}
|
||||
@ -197,8 +203,7 @@ void STDCALL spawnUber(Game* ptGame, Room* ptRoom)
|
||||
{
|
||||
if (questState.count2) questState.count2--;
|
||||
else {
|
||||
Room* ptTargetRoom = selectRoom(ptGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
if (D2SpawnMonster(ptGame, ptTargetRoom, 0, 0, 0, -1, 708, 0))
|
||||
if (D2SpawnSuperUnique(ptGame, ptRoom, 0, 0, 0, -1, UBER_DURIEL_ID, 0))
|
||||
questState.uber2Spawned = 1;
|
||||
}
|
||||
}
|
||||
@ -208,8 +213,7 @@ void STDCALL spawnUber(Game* ptGame, Room* ptRoom)
|
||||
{
|
||||
if (questState.count3) questState.count3--;
|
||||
else {
|
||||
Room* ptTargetRoom = selectRoom(ptGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
if (D2SpawnMonster(ptGame, ptTargetRoom, 0, 0, 0, -1, 706, 0))
|
||||
if (D2SpawnSuperUnique(ptGame, ptRoom, 0, 0, 0, -1, UBER_IZUAL_ID, 0))
|
||||
questState.uber3Spawned = 1;
|
||||
}
|
||||
}
|
||||
@ -217,103 +221,241 @@ void STDCALL spawnUber(Game* ptGame, Room* ptRoom)
|
||||
case LEVEL_ACT5_PANDEMONIUM_FINAL:
|
||||
if (!questState.uber4Spawned)
|
||||
{
|
||||
if (questState.count4) questState.count4--;
|
||||
else {
|
||||
Room* ptTargetRoom = selectRoom(ptGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
if (D2SpawnMonster(ptGame, ptTargetRoom, 0, 0, 0, -1, 704, 0))
|
||||
log_msg("Spawn Mephisto ptRoom: startX:%d - startY:%d / x:%d y:%d\n", ptRoom->startX, ptRoom->startY, ptRoom->sizeX, ptRoom->sizeY);
|
||||
if (IsInRoom(ptRoom, UberMephistoX, UberMephistoY))
|
||||
{
|
||||
log_msg("Spawn Mephisto ptRoom: startX:%d - startY:%d / x:%d y:%d\n", ptRoom->startX, ptRoom->startY, ptRoom->sizeX, ptRoom->sizeY);
|
||||
if (D2SpawnSuperUnique(ptGame, ptRoom, 0, UberMephistoX, UberMephistoY, -1, UBER_MEPHISTO_ID, 0))
|
||||
questState.uber4Spawned = 1;
|
||||
}
|
||||
}
|
||||
if (!questState.uber5Spawned)
|
||||
{
|
||||
if (questState.count5) questState.count5--;
|
||||
else {
|
||||
Room* ptTargetRoom = selectRoom(ptGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
if (D2SpawnMonster(ptGame, ptTargetRoom, 0, 0, 0, -1, 705, 0))
|
||||
questState.uber5Spawned = 1;
|
||||
if (IsInRoom(ptRoom, UberDiabloX, UberDiabloY))
|
||||
{
|
||||
log_msg("Spawn Diablo ptRoom: startX:%d - startY:%d / x:%d y:%d\n", ptRoom->startX, ptRoom->startY, ptRoom->sizeX, ptRoom->sizeY);
|
||||
if (D2SpawnSuperUnique(ptGame, ptRoom, 0, UberDiabloX, UberDiabloY, -1, UBER_DIABLO_ID, 0))
|
||||
questState.uber4Spawned = 1;
|
||||
}
|
||||
}
|
||||
if (!questState.uber6Spawned)
|
||||
{
|
||||
if (questState.count6) questState.count6--;
|
||||
else {
|
||||
Room* ptTargetRoom = selectRoom(ptGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
if (D2SpawnMonster(ptGame, ptTargetRoom, 0, 0, 0, -1, 709, 0))
|
||||
questState.uber6Spawned = 1;
|
||||
if (IsInRoom(ptRoom, UberBaalX, UberBaalY))
|
||||
{
|
||||
log_msg("Spawn Baal ptRoom: startX:%d - startY:%d / x:%d y:%d\n", ptRoom->startX, ptRoom->startY, ptRoom->sizeX, ptRoom->sizeY);
|
||||
if (D2SpawnSuperUnique(ptGame, ptRoom, 0, UberBaalX, UberBaalY, -1, UBER_BAAL_ID, 0))
|
||||
questState.uber4Spawned = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// D2SpawnMonster(PCGame, ptRoom, 0, 25113, 5138, -1, 704, 0);
|
||||
// D2SpawnMonster(PCGame, ptRoom, 0, 25125, 5150, -1, 705, 0);
|
||||
// D2SpawnMonster(PCGame, ptRoom, 0, 25135, 5140, -1, 709, 0);
|
||||
}
|
||||
D2Game235C0(ptGame, ptRoom);
|
||||
}
|
||||
|
||||
/*DWORD STDCALL spawnUber(Path* ptPath, Unit* ptChar, Room* ptRoom, DWORD x, DWORD y)
|
||||
{
|
||||
if (!D2WarpPlayer(ptPath, ptChar, ptRoom, x, y)) return 0;
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
switch(D2GetLevelID(ptRoom))
|
||||
int GetNbMonsters(Level* level)
|
||||
{
|
||||
int nbMonsters = 0;
|
||||
for (RoomEx* roomEx = level->ptFirstRoomEx; roomEx; roomEx = roomEx->ptNextRoomEx)
|
||||
{
|
||||
case LEVEL_ACT5_PANDEMONIUM1:
|
||||
if (!questState.uber1Spawned)
|
||||
if (roomEx->ptRoom)
|
||||
{
|
||||
Room* ptTargetRoom = selectRoom(PCGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
D2SpawnMonster(PCGame, ptTargetRoom, 0, 0, 0, -1, 707, 0);
|
||||
questState.uber1Spawned = 1;
|
||||
}
|
||||
break;
|
||||
case LEVEL_ACT5_PANDEMONIUM2:
|
||||
if (!questState.uber2Spawned)
|
||||
{
|
||||
Room* ptTargetRoom = selectRoom(PCGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
D2SpawnMonster(PCGame, ptTargetRoom, 0, 0, 0, -1, 708, 0);
|
||||
questState.uber2Spawned = 1;
|
||||
}
|
||||
break;
|
||||
case LEVEL_ACT5_PANDEMONIUM3:
|
||||
if (!questState.uber3Spawned)
|
||||
{
|
||||
Room* ptTargetRoom = selectRoom(PCGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
D2SpawnMonster(PCGame, ptTargetRoom, 0, 0, 0, -1, 706, 0);
|
||||
questState.uber3Spawned = 1;
|
||||
}
|
||||
break;
|
||||
case LEVEL_ACT5_PANDEMONIUM_FINAL:
|
||||
if (!questState.uber4Spawned)
|
||||
{
|
||||
Room* ptTargetRoom = selectRoom(PCGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
D2SpawnMonster(PCGame, ptTargetRoom, 0, 0, 0, -1, 704, 0);
|
||||
ptTargetRoom = selectRoom(PCGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
D2SpawnMonster(PCGame, ptTargetRoom, 0, 0, 0, -1, 705, 0);
|
||||
ptTargetRoom = selectRoom(PCGame, ptRoom, LEVEL_ACT5_PANDEMONIUM1);
|
||||
D2SpawnMonster(PCGame, ptTargetRoom, 0, 0, 0, -1, 709, 0);
|
||||
// D2SpawnMonster(PCGame, ptRoom, 0, 25113, 5138, -1, 704, 0);
|
||||
// D2SpawnMonster(PCGame, ptRoom, 0, 25125, 5150, -1, 705, 0);
|
||||
// D2SpawnMonster(PCGame, ptRoom, 0, 25135, 5140, -1, 709, 0);
|
||||
questState.uber4Spawned = 1;
|
||||
for (Unit* unit = roomEx->ptRoom->ptFirstUnit; unit; unit = unit->ptNextUnitInRoom)
|
||||
{
|
||||
if (unit->nUnitType == UNIT_MONSTER && unit->mode != UNIT_MODE_KICK && unit->nTxtFileNo != 711)
|
||||
{
|
||||
//log_msg("GetNbMonsters ++ / type:%d - id:%d - mode:%d\n", unit->nUnitType, unit->nTxtFileNo, unit->mode);
|
||||
nbMonsters++;
|
||||
}
|
||||
//else log_msg("GetNbMonsters no / type:%d - id:%d - mode:%d\n", unit->nUnitType, unit->nTxtFileNo, unit->mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
void FASTCALL uberMephIA(Game* ptGame, Unit* ptMonster, DWORD* ptData)
|
||||
{
|
||||
D2MephIA(ptGame, ptMonster, ptData);
|
||||
return nbMonsters;
|
||||
}
|
||||
|
||||
void FASTCALL uberDiabloIA(Game* ptGame, Unit* ptMonster, DWORD* ptData)
|
||||
int GetNbMonsters(Level* level, Position position, int radius)
|
||||
{
|
||||
D2DiabloIA(ptGame, ptMonster, ptData);
|
||||
int nbMonsters = 0;
|
||||
for (RoomEx* roomEx = level->ptFirstRoomEx; roomEx; roomEx = roomEx->ptNextRoomEx)
|
||||
{
|
||||
if (roomEx->ptRoom)
|
||||
{
|
||||
for (Unit* unit = roomEx->ptRoom->ptFirstUnit; unit; unit = unit->ptNextUnitInRoom)
|
||||
{
|
||||
if (unit->nUnitType == UNIT_MONSTER && unit->mode != UNIT_MODE_KICK && unit->nTxtFileNo != 711)
|
||||
{
|
||||
Position p;
|
||||
D2GetPosition(unit, &p);
|
||||
if (Distance(position, p) <= radius)
|
||||
nbMonsters++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nbMonsters;
|
||||
}
|
||||
|
||||
|
||||
void FASTCALL uberBaalIA(Game* ptGame, Unit* ptMonster, DWORD* ptData)
|
||||
bool CastSummonMonster(Game* ptGame, Unit* ptMonster, DWORD x, DWORD y, DWORD* minions, int minionsSize, int mode)
|
||||
{
|
||||
D2BaalIA(ptGame, ptMonster, ptData);
|
||||
DWORD minionId = minions[RANDOM(minionsSize)];
|
||||
log_msg("CastSummonMonster: id:%d x:%d y:%d mode:%d\n", minionId, x, y, mode);
|
||||
|
||||
Room* ptRoom = D2GetRoom(ptMonster);
|
||||
|
||||
// Check nb of monsters
|
||||
Level* ptLevel = ptRoom->ptRoomEx->ptLevel;
|
||||
int monstersInLevel = GetNbMonsters(ptLevel);
|
||||
Position position;
|
||||
D2GetPosition(ptMonster, &position);
|
||||
int monstersNearby = GetNbMonsters(ptLevel, position, 25);
|
||||
|
||||
log_msg("CastSummonMonster nbMonsters: %d - %d\n", monstersNearby, monstersInLevel);
|
||||
if (monstersNearby > 16 || monstersInLevel > 100)
|
||||
return false;
|
||||
|
||||
// Spawn Monster
|
||||
log_msg("CastSummonMonster D2SpawnMonster(%d, %d, %08X, %08X, %d, %d, %d, %d)\n", minionId, mode, ptGame, ptRoom, x, y, 1, 0);
|
||||
Unit* monster = D2SpawnMonster(minionId, mode, ptGame, ptRoom, x, y, 1, 0);
|
||||
log_msg("CastSummonMonster D2SpawnMonster end\n");
|
||||
if (monster)
|
||||
return true;
|
||||
|
||||
// Try in near rooms
|
||||
log_msg("CastSummonMonster Try in near rooms: %d - %d\n", ptRoom->startX, ptRoom->startY);
|
||||
for(int i = 0; i < ptRoom->nbNearRooms; i++)
|
||||
{
|
||||
Room* ptRoom2 = ptRoom->ptNearRooms[i];
|
||||
if (IsInRoom(ptRoom2, x, y))
|
||||
{
|
||||
log_msg("CastSummonMonster D2SpawnMonster(%d, %d, %08X, %08X, %d, %d, %d, %d)\n", minionId, mode, ptGame, ptRoom2, x, y, 1, 0);
|
||||
monster = D2SpawnMonster(minionId, mode, ptGame, ptRoom2, x, y, 1, 0);
|
||||
log_msg("CastSummonMonster D2SpawnMonster end\n");
|
||||
if (monster)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
log_msg("CastSummonMonster end: %d - %d\n", ptRoom->startX, ptRoom->startY);
|
||||
return false;
|
||||
}
|
||||
|
||||
void RandInCircle(Position* position, DWORD radius)
|
||||
{
|
||||
double theta = RANDOMF() * 6.283185;
|
||||
double r = sqrt(RANDOMF()) * radius;
|
||||
position->x += (DWORD)(r * cos(theta));
|
||||
position->y += (DWORD)(r * sin(theta));
|
||||
}
|
||||
|
||||
void FASTCALL uberMephAI(Game* ptGame, Unit* ptMonster, AIParam* ptAIArgs)
|
||||
{
|
||||
log_msg("UberMephAI called.\n");
|
||||
|
||||
// Spawn Minions
|
||||
if (active_UberMinions && RANDOM(100) < UberMephistoSpawnPercent && ptAIArgs->distanceToTarget < UberMephistoSpawnRadius)
|
||||
{
|
||||
Position pos;
|
||||
D2GetPosition(ptAIArgs->target, &pos);
|
||||
CastSummonMonster(ptGame, ptMonster, pos.x, pos.y, UberMephistoMinions, UberMephistoNbMinions, 8);
|
||||
}
|
||||
|
||||
log_msg("Uber Mephisto AI activated.\n");
|
||||
D2MephAI(ptGame, ptMonster, ptAIArgs);
|
||||
}
|
||||
|
||||
void FASTCALL uberDiabloAI(Game* ptGame, Unit* ptMonster, AIParam* ptAIArgs)
|
||||
{
|
||||
log_msg("UberDiabloAI called.\n");
|
||||
|
||||
// Spawn Minions
|
||||
if (active_UberMinions && RANDOM(100) < UberDiabloSpawnPercent && ptAIArgs->distanceToTarget < UberDiabloSpawnRadius)
|
||||
{
|
||||
Position pos;
|
||||
D2GetPosition(ptAIArgs->target, &pos);
|
||||
RandInCircle(&pos, 3);
|
||||
CastSummonMonster(ptGame, ptMonster, pos.x, pos.y, UberDiabloMinions, UberDiabloNbMinions, 1);
|
||||
}
|
||||
|
||||
// Tweek Diablo AI Rush
|
||||
if (active_UberDiabloRushTweekAI && RANDOM(100) < (int)ptAIArgs->distanceToTarget - 10)
|
||||
{
|
||||
if (RANDOM(3) > 0)//67% to Rush
|
||||
{
|
||||
log_msg("Uber Diablo Run activated.\n");
|
||||
int diabloRunSkillId = 4;
|
||||
D2MonsterUseSkill(ptGame, ptMonster, ptAIArgs->ptMonStatsBIN->skillArg[diabloRunSkillId], ptAIArgs->ptMonStatsBIN->skill[diabloRunSkillId], ptAIArgs->target, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
log_msg("Uber Diablo Move activated.\n");
|
||||
Position pos;
|
||||
D2GetPosition(ptAIArgs->target, &pos);
|
||||
D2MonsterMove(ptGame, ptMonster, NULL, 2, pos.x, pos.y, 1, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
log_msg("Uber Diablo AI activated.\n");
|
||||
D2DiabloAI(ptGame, ptMonster, ptAIArgs);
|
||||
}
|
||||
|
||||
void FASTCALL uberBaalAI(Game* ptGame, Unit* ptMonster, AIParam* ptAIArgs)
|
||||
{
|
||||
log_msg("UberBaalAI called.\n");
|
||||
|
||||
if (active_UberMinions && RANDOM(100) < UberBaalSpawnPercent && ptAIArgs->distanceToTarget < UberBaalSpawnRadius)
|
||||
{
|
||||
Position pos;
|
||||
D2GetPosition(ptAIArgs->target, &pos);
|
||||
RandInCircle(&pos, 3);
|
||||
CastSummonMonster(ptGame, ptMonster, pos.x, pos.y, UberBaalMinions, UberBaalNbMinions, 1);
|
||||
}
|
||||
|
||||
// Tweek Baal AI Chilling Armor
|
||||
if (active_UberBaalChillingArmorTweekAI)
|
||||
{
|
||||
if (uberBaalChillingArmorLastFrame == 0 || ((int)ptGame->gameFrame - uberBaalChillingArmorLastFrame > uberBaalChillingArmorTimer))
|
||||
{
|
||||
log_msg("Uber Baal Chilling Armor activated.\n");
|
||||
uberBaalChillingArmorLastFrame = ptGame->gameFrame;
|
||||
const int baalChillingArmorSkillId = 7;
|
||||
D2MonsterUseSkill(ptGame, ptMonster, ptAIArgs->ptMonStatsBIN->skillArg[baalChillingArmorSkillId], ptAIArgs->ptMonStatsBIN->skill[baalChillingArmorSkillId], NULL, 0, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Tweek Baal AI Teleport
|
||||
if (active_UberBaalTeleportTweekAI && RANDOM(100) < (int)ptAIArgs->distanceToTarget - 10)
|
||||
{
|
||||
if (RANDOM(3) > 0)//67% to teleport
|
||||
{
|
||||
log_msg("Uber Baal Teleport activated.\n");
|
||||
const int baalTeleportSkillId = 4;
|
||||
Position pos;
|
||||
D2GetPosition(ptAIArgs->target, &pos);
|
||||
D2MonsterUseSkill(ptGame, ptMonster, ptAIArgs->ptMonStatsBIN->skillArg[baalTeleportSkillId], ptAIArgs->ptMonStatsBIN->skill[baalTeleportSkillId], NULL/*ptAIArgs->target*/, pos.x, pos.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
log_msg("Uber Baal Move activated.\n");
|
||||
Position pos;
|
||||
D2GetPosition(ptAIArgs->target, &pos);
|
||||
D2MonsterMove(ptGame, ptMonster, NULL, 2, pos.x, pos.y, 1, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
log_msg("Uber Baal AI activated.\n");
|
||||
D2BaalAI(ptGame, ptMonster, ptAIArgs);
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_spawnUber )
|
||||
PUSH EDX
|
||||
PUSH ECX
|
||||
CALL spawnUber
|
||||
RETN
|
||||
}}
|
||||
|
||||
void Install_UberQuest()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
@ -327,75 +469,52 @@ void Install_UberQuest()
|
||||
DWORD oldProtection;
|
||||
|
||||
// open Red Portal
|
||||
VirtualProtect((LPVOID)R7(D2Game,0,0,0,FA480,FA7B8, FA228, FA5F0), 8, PAGE_EXECUTE_READWRITE, &oldProtection);
|
||||
mem_seek R7(D2Game, 0000, 0000, 0000, FA480, FA7B8, FA228, FA5F0);
|
||||
VirtualProtect((LPVOID)R8(D2Game,0,0,0,FA480,FA7B8, FA228, FA5F0, FA2C4, 2E11D0), 8, PAGE_EXECUTE_READWRITE, &oldProtection);
|
||||
mem_seek R8(D2Game, 0000, 0000, 0000, FA480, FA7B8, FA228, FA5F0, FA2C4, 2E11D0);
|
||||
MEMT_DWORD( D2OpenPandPortal , openPandPortal);
|
||||
MEMT_DWORD( D2OpenPandFinalPortal , openPandFinalPortal);
|
||||
//0201E357 |. FFD0 |CALL EAX
|
||||
//01FA77E7 |. FFD0 |CALL EAX
|
||||
//6FCF3CC7 |. FFD0 |CALL EAX
|
||||
//6FC92437 |. FFD0 |CALL EAX
|
||||
VirtualProtect((LPVOID)R7(D2Game,0,0,0,FA480,FA7B8, FA228, FA5F0), 8, oldProtection, &oldProtection);
|
||||
//6FCB7127 |. FFD0 |CALL EAX
|
||||
//00565D45 . FFD0 CALL EAX
|
||||
VirtualProtect((LPVOID)R8(D2Game,0,0,0,FA480,FA7B8, FA228, FA5F0, FA2C4, 2E11D0), 8, oldProtection, &oldProtection);
|
||||
|
||||
|
||||
// manage uberIA (fct table at 0209E7E8)
|
||||
VirtualProtect((LPVOID)(R7(D2Game,0,0,0,10E7E8,10ECD0,10EF58,10E788) + 145*0x10), 0x30, PAGE_EXECUTE_READWRITE, &oldProtection);
|
||||
mem_seek R7(D2Game, 0000, 0000, 0000, 10F100, 10F5E8, 10F870, 10F0A0);
|
||||
MEMT_DWORD( D2UberBaalIA , uberBaalIA);
|
||||
mem_seek R7(D2Game, 0000, 0000, 0000, 10F110, 10F5F8, 10F880, 10F0B0);
|
||||
MEMT_DWORD( D2UberMephIA , uberMephIA);
|
||||
mem_seek R7(D2Game, 0000, 0000, 0000, 10F120, 10F608, 10F890, 10F0C0);
|
||||
MEMT_DWORD( D2UberDiabloIA , uberDiabloIA);
|
||||
VirtualProtect((LPVOID)(R7(D2Game,0,0,0,10E7E8,10ECD0,10EF58,10E788) + 145*0x10), 0x30, oldProtection, &oldProtection);
|
||||
VirtualProtect((LPVOID)(R8(D2Game,0,0,0,10E7E8,10ECD0,10EF58,10E788, 10ED00, 33CA18) + 145*0x10), 0x30, PAGE_EXECUTE_READWRITE, &oldProtection);
|
||||
mem_seek R8(D2Game, 0000, 0000, 0000, 10F100, 10F5E8, 10F870, 10F0A0, 10F618, 33D330);
|
||||
MEMT_DWORD( D2UberBaalAI , uberBaalAI);
|
||||
mem_seek R8(D2Game, 0000, 0000, 0000, 10F110, 10F5F8, 10F880, 10F0B0, 10F628, 33D340);
|
||||
MEMT_DWORD( D2UberMephAI , uberMephAI);
|
||||
mem_seek R8(D2Game, 0000, 0000, 0000, 10F120, 10F608, 10F890, 10F0C0, 10F638, 33D350);
|
||||
MEMT_DWORD( D2UberDiabloAI , uberDiabloAI);
|
||||
VirtualProtect((LPVOID)(R8(D2Game,0,0,0,10E7E8,10ECD0,10EF58,10E788, 10ED00, 33CA18) + 145*0x10), 0x30, oldProtection, &oldProtection);
|
||||
//0202ADA7 |> B8 E8E70902 MOV EAX,D2Game.0209E7E8
|
||||
//01FD2BE7 |> B8 D0EC0702 MOV EAX,D2Game.0207ECD0
|
||||
//6FC3B597 |> B8 58EFD26F MOV EAX,D2Game.6FD2EF58
|
||||
//6FCBD157 |> B8 88E7D26F MOV EAX,D2Game.6FD2E788
|
||||
//6FC5C617 |> B8 00EDD26F MOV EAX,D2Game.6FD2ED00
|
||||
//005B163D |. B8 18CA7300 MOV EAX,Game.0073CA18
|
||||
|
||||
// spawn Uber
|
||||
// mem_seek R7(D2Game, 0000, 0000, 0000, 98DAD, 0000, 0000, 0000);
|
||||
// MEMJ_REF4( D2WarpPlayer , spawnUber);
|
||||
//02028DAC |. E8 491CF7FF CALL <JMP.&D2Common.#10872>
|
||||
|
||||
mem_seek R7(D2Game, 0000, 0000, 0000, E26E2, E6B52, A850B, 2CCAB);
|
||||
MEMC_REF4( D2Game235C0 , spawnUber);
|
||||
mem_seek R8(D2Game, 0000, 0000, 0000, E26E2, E6B52, A850B, 2CCAB, BE9AB, 12D1DC);
|
||||
MEMC_REF4( V2Game235C0 , version_D2Game >= V114d ? (DWORD)caller_spawnUber : (DWORD)spawnUber);
|
||||
//020726E1 |. E8 2A46FFFF ||CALL D2Game.02066D10
|
||||
//02056B51 |. E8 6ACAF3FF ||CALL D2Game.01F935C0
|
||||
//6FCC850A |. E8 014FF6FF ||CALL D2Game.6FC2D410
|
||||
//6FC4CCAA |. E8 3134FFFF ||CALL D2Game.6FC400E0
|
||||
//6FCDE9AA |. E8 D1AFF9FF ||CALL D2Game.6FC79980
|
||||
//0052D1DB |. E8 60590100 ||CALL Game.00542B40
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
isInstalled = true;
|
||||
}
|
||||
/*
|
||||
call fct to manage TP :
|
||||
0201E33E |. 8B048D 78A4070>|MOV EAX,DWORD PTR DS:[ECX*4+207A478] ; D2Game.0201B480
|
||||
0201E345 |. 85C0 |TEST EAX,EAX
|
||||
0201E347 |. 74 14 |JE SHORT D2Game.0201E35D
|
||||
0201E349 |. 8B9424 2C01000>|MOV EDX,DWORD PTR SS:[ESP+12C]
|
||||
0201E350 |. 8B8C24 2801000>|MOV ECX,DWORD PTR SS:[ESP+128]
|
||||
0201E357 |. FFD0 |CALL EAX
|
||||
0201E359 |. 894424 38 |MOV DWORD PTR SS:[ESP+38],EAX
|
||||
|
||||
DWORD FASTCALL openPortal (Unit* ptGame, Unit* ptChar)
|
||||
0201C6D0 : CowPortal
|
||||
0201B480 : Pand. Portal return 0 !!
|
||||
0201B470 : Pand. FInal Portal
|
||||
|
||||
manage IA
|
||||
0202AD8B |> 66:8B46 1E MOV AX,WORD PTR DS:[ESI+1E]
|
||||
0202AD8F |. 66:85C0 TEST AX,AX
|
||||
0202AD92 |. 7C 13 JL SHORT D2Game.0202ADA7
|
||||
0202AD94 |. 66:3D 9400 CMP AX,94
|
||||
0202AD98 |. 73 0D JNB SHORT D2Game.0202ADA7
|
||||
0202AD9A |. 0FBFC0 MOVSX EAX,AX
|
||||
0202AD9D |. C1E0 04 SHL EAX,4
|
||||
0202ADA0 |. 05 E8E70902 ADD EAX,D2Game.0209E7E8
|
||||
0202ADA5 |. 5E POP ESI
|
||||
0202ADA6 |. C3 RETN
|
||||
0202ADA7 |> B8 E8E70902 MOV EAX,D2Game.0209E7E8
|
||||
0202ADAC |. 5E POP ESI
|
||||
0202ADAD \. C3 RETN
|
||||
*/
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,18 +1,16 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Updating client.
|
||||
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "updateClient.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
#include "infinityStash.h"
|
||||
#include "commands.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void updateClient(Unit* ptChar, DWORD mFunc, DWORD p1, DWORD p2, DWORD p3)
|
||||
{
|
||||
@ -35,18 +33,53 @@ void updateClient(Unit* ptChar, DWORD mFunc, DWORD p1, DWORD p2, DWORD p3)
|
||||
D2SendPacket(ptNetClient, &packet, sizeof(DataPacket));
|
||||
}
|
||||
|
||||
void updateClient(Unit* ptChar, DWORD mFunc, char* msg)
|
||||
{
|
||||
void* ptNetClient;
|
||||
DataPacket packet;
|
||||
|
||||
// Intialize the packet to send to client
|
||||
ZeroMemory(&packet, sizeof(DataPacket));
|
||||
packet.mType = 0x9D;
|
||||
packet.mFunc = (BYTE)mFunc;
|
||||
packet.mSize = sizeof(DataPacket);
|
||||
packet.mPlayerID = ptChar->nUnitId;
|
||||
if (msg != NULL && strlen(msg) > 20)
|
||||
return;
|
||||
if (msg != NULL)
|
||||
strncpy((char*)&packet.mItemID, msg, 20);
|
||||
|
||||
ptNetClient = D2GetClient(ptChar, __FILE__, __LINE__);
|
||||
|
||||
// Send packet to client for remove placed skills
|
||||
D2SendPacket(ptNetClient, &packet, sizeof(DataPacket));
|
||||
}
|
||||
|
||||
DWORD FASTCALL handleClientUpdate(DataPacket* packet)
|
||||
{
|
||||
log_msg("[CLIENT] Received custom message: %d with param: %08X , %08X , %08X\n",packet->mFunc,packet->mParam1,packet->mParam2,packet->mParam3);
|
||||
switch (packet->mFunc)
|
||||
{
|
||||
case UC_SELECT_STASH : setSelectedStashClient(packet->mParam1,packet->mParam2,packet->mParam3); return 1;
|
||||
case UC_SHARED_GOLD : updateSharedGold(packet->mParam1); return 1;
|
||||
case UC_SELECT_STASH: setSelectedStashClient(packet->mParam1, packet->mParam2, packet->mParam3, (packet->mParam2 & 8) == 8); return 1;
|
||||
case UC_SHARED_GOLD : updateSharedGold(packet->mParam1); return 1;
|
||||
case UC_PAGE_NAME:
|
||||
{
|
||||
char pageName[21];
|
||||
strncpy(pageName, (char*)&packet->mItemID, 20);
|
||||
pageName[20] = NULL;
|
||||
renameCurrentStash(D2GetClientPlayer(), pageName); return 1;
|
||||
}
|
||||
default : return 0;
|
||||
}
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_handleClientUpdate_114 )
|
||||
LEA ECX,DWORD PTR SS:[ESP]
|
||||
CALL handleClientUpdate
|
||||
MOV ESP,EBP
|
||||
POP EBP
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_handleClientUpdate_111 )
|
||||
LEA ECX,DWORD PTR SS:[ESP+8]
|
||||
@ -70,17 +103,19 @@ void Install_UpdateClient()
|
||||
{
|
||||
static int isInstalled = false;
|
||||
if (isInstalled) return;
|
||||
|
||||
|
||||
log_msg("Patch D2Client for received Item packet. (UpdateClient)\n");
|
||||
|
||||
// execute if it's our packet else continue
|
||||
mem_seek R7(D2Client, 14236, 14226, 145B6, 9C6B6, BFE86, 66E06, AE896);
|
||||
MEMT_REF4( version_D2Client >= V111 ? 0x000000CF : 0x000000D6, version_D2Client >= V111 ? caller_handleClientUpdate_111 : caller_handleClientUpdate);
|
||||
mem_seek R8(D2Client, 14236, 14226, 145B6, 9C6B6, BFE86, 66E06, AE896, 84D96, 5EC99);
|
||||
MEMT_REF4( version_D2Client >= V114d ? 0x000000CE : version_D2Client >= V111 ? 0x000000CF : 0x000000D6, version_D2Client >= V114d ? caller_handleClientUpdate_114 : version_D2Client >= V111 ? caller_handleClientUpdate_111 : caller_handleClientUpdate);
|
||||
//6FAB45B4 |. 0F87 D6000000 JA D2Client.6FAB4690
|
||||
//6FB4C6B4 |. 0F87 CF000000 JA D2Client.6FB4C789
|
||||
//6FB6FE84 |. 0F87 CF000000 JA D2Client.6FB6FF59
|
||||
//6FB16E04 |. 0F87 CF000000 JA D2Client.6FB16ED9
|
||||
//6FB5E894 |. 0F87 CF000000 JA D2Client.6FB5E969
|
||||
//6FB34D94 |. 0F87 CF000000 JA D2Client.6FB34E69
|
||||
//0045EC97 |. 0F87 CE000000 JA Game.0045ED6B
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
|
@ -1,25 +1,37 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
Updating server.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "common.h"
|
||||
#include "updateServer.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
#include "statsPoints.h"
|
||||
#include "skillsPoints.h"
|
||||
#include "infinityStash.h"
|
||||
#include "commands.h"
|
||||
#include "common.h"
|
||||
|
||||
|
||||
void updateServer(WORD p)
|
||||
{
|
||||
if (!onRealm)
|
||||
D2SendToServer3(0x3A, p);
|
||||
}
|
||||
|
||||
|
||||
int renameIndex = 0;
|
||||
char renameString[21];
|
||||
DWORD PageSwap;
|
||||
|
||||
int STDCALL handleServerUpdate(Unit* ptChar, WORD param)
|
||||
{
|
||||
log_msg("Received custom message: %X\n", param);
|
||||
switch(param & 0xFF)
|
||||
int type = param & 0xFF;
|
||||
DWORD arg = (param & 0xFF00) >> 8;
|
||||
log_msg("Received custom message: type=%i, arg=%i\n", type, arg);
|
||||
switch(type)
|
||||
{
|
||||
case US_UNASSIGN_STR_POINT : UnassignStrPoint( ptChar ); return 1;
|
||||
case US_UNASSIGN_ENE_POINT : UnassignEnePoint( ptChar ); return 1;
|
||||
@ -30,29 +42,87 @@ int STDCALL handleServerUpdate(Unit* ptChar, WORD param)
|
||||
case US_UNASSIGN_DEX_POINTS : UnassignDexPoints( ptChar ); return 1;
|
||||
case US_UNASSIGN_VIT_POINTS : UnassignVitPoints( ptChar ); return 1;
|
||||
case US_UNASSIGN_SKILLS : UnassignAllSkillsPoints( ptChar ); return 1;
|
||||
|
||||
case US_SET_INDEX: setCurrentStashIndex(ptChar, 1); return 1;
|
||||
case US_SET_MAIN_INDEX: setCurrentStashIndex(ptChar, 2); return 1;
|
||||
case US_RESET_INDEX: setCurrentStashIndex(ptChar, 0); return 1;
|
||||
case US_SELECT_PREVIOUS : selectPreviousStash( ptChar ); return 1;
|
||||
case US_SELECT_NEXT : selectNextStash( ptChar ); return 1;
|
||||
case US_SELECT_SELF : if (active_sharedStash) toggleToSelfStash( ptChar ); return 1;
|
||||
case US_SELECT_SHARED : if (active_sharedStash) toggleToSharedStash( ptChar ); return 1;
|
||||
case US_SELECT_PREVIOUS_INDEX : selectPreviousIndexStash( ptChar ); return 1;
|
||||
case US_SELECT_NEXT_INDEX : selectNextIndexStash( ptChar ); return 1;
|
||||
|
||||
case US_SELECT_PREVIOUS2 : selectPrevious2Stash( ptChar ); return 1;
|
||||
case US_SELECT_NEXT2 : selectNext2Stash( ptChar ); return 1;
|
||||
case US_SELECT_PREVIOUS_INDEX2: selectPreviousIndex2Stash( ptChar ); return 1;
|
||||
case US_SELECT_NEXT_INDEX2 : selectNextIndex2Stash( ptChar ); return 1;
|
||||
case US_INSERT_PAGE: insertStash(ptChar); selectNextStash(ptChar); return 1;
|
||||
case US_DELETE_PAGE: deleteStash(ptChar, false); return 1;
|
||||
|
||||
case US_STARTSAVE : savePlayers( ptChar ); return 1;
|
||||
case US_SAVE : savePlayers( ptChar ); return 1;
|
||||
|
||||
case US_MAXGOLD : maxGold(ptChar); return 1;
|
||||
case US_PUTGOLD : putGold(ptChar, 0); return 1;
|
||||
case US_TAKEGOLD : takeGold(ptChar, 0); return 1;
|
||||
default : return 0;
|
||||
case US_SWAP3 : PageSwap = arg << 24; return 1;
|
||||
case US_SWAP2 : PageSwap |= arg << 16; return 1;
|
||||
case US_SWAP1 : PageSwap |= arg << 8; return 1;
|
||||
case US_SWAP0: swapStash(ptChar, PageSwap | arg, false); PageSwap = 0; return 1;
|
||||
case US_SWAP0_TOGGLE : swapStash(ptChar, PageSwap | arg, true); PageSwap = 0; return 1;
|
||||
case US_RENAME :
|
||||
if (renameIndex == 0)
|
||||
ZeroMemory(renameString, sizeof(renameString));
|
||||
if (arg != NULL && renameIndex < 15)
|
||||
renameString[renameIndex++] = (char)arg;
|
||||
if (arg == NULL)
|
||||
{
|
||||
renameString[renameIndex] = NULL;
|
||||
renameIndex = 0;
|
||||
log_msg("Rename on Server : %s -> %s\n", PCPlayerData->name, renameString);
|
||||
strcpy(PCPlayerData->name, renameString);
|
||||
strcpy(PCPlayerData->ptNetClient->name, renameString);
|
||||
}
|
||||
return 1;
|
||||
case US_PAGENAME:
|
||||
if (renameIndex == 0)
|
||||
ZeroMemory(renameString, sizeof(renameString));
|
||||
if (arg != NULL && renameIndex < 20)
|
||||
renameString[renameIndex++] = (char)arg;
|
||||
if (arg == NULL)
|
||||
{
|
||||
renameString[renameIndex] = NULL;
|
||||
renameIndex = 0;
|
||||
log_msg("Rename current page on Server : %s -> %s\n", PCPY->currentStash->name, renameString);
|
||||
renameCurrentStash(ptChar, renameString);
|
||||
}
|
||||
return 1;
|
||||
default :
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
FCT_ASM( caller_handleServerUpdate_114)
|
||||
PUSH ESI
|
||||
PUSH EBX
|
||||
CALL handleServerUpdate
|
||||
TEST EAX,EAX
|
||||
JNZ END_RCM
|
||||
MOV EAX,ESI
|
||||
AND EAX,0xFF
|
||||
SHR ESI,8
|
||||
MOV EDI,EAX
|
||||
RETN
|
||||
END_RCM:
|
||||
ADD ESP,8
|
||||
POP EDI
|
||||
POP ESI
|
||||
XOR EAX,EAX
|
||||
POP EBX
|
||||
RETN 8
|
||||
}}
|
||||
|
||||
FCT_ASM( caller_handleServerUpdate)
|
||||
PUSH EAX
|
||||
PUSH ESI
|
||||
PUSH EBX
|
||||
CALL handleServerUpdate
|
||||
TEST EAX,EAX
|
||||
@ -100,11 +170,11 @@ void Install_UpdateServer()
|
||||
log_msg("Patch D2Game for received button click message. (UpdateServer)\n");
|
||||
|
||||
// manage button click message from Client.
|
||||
mem_seek R7(D2Game, 4A702, 4AAC2, 56EA2, 54AE3, 2C773, 975C3, CC983);
|
||||
mem_seek R8(D2Game, 4A702, 4AAC2, 56EA2, 54AE3, 2C773, 975C3, CC983, 676C3, 14BD38);
|
||||
if (version_D2Game >= V111) {
|
||||
memt_byte( 0xC1, 0x57 ); // PUSH EDI
|
||||
memt_byte( 0xEE, 0xE8 ); // CALL caller_handleServerUpdate
|
||||
MEMT_REF4( 0xF88B5708, caller_handleServerUpdate);
|
||||
MEMT_REF4( 0xF88B5708, version_D2Game == V114d ? caller_handleServerUpdate_114 : caller_handleServerUpdate);
|
||||
//01FD4AE3 . C1EE 08 SHR ESI,8
|
||||
//01FD4AE6 . 57 PUSH EDI
|
||||
//01FD4AE7 . 8BF8 MOV EDI,EAX
|
||||
@ -117,6 +187,12 @@ void Install_UpdateServer()
|
||||
//6FCEC983 . C1EE 08 SHR ESI,8
|
||||
//6FCEC986 . 57 PUSH EDI
|
||||
//6FCEC987 . 8BF8 MOV EDI,EAX
|
||||
//066A76C3 |. C1EE 08 SHR ESI,8
|
||||
//066A76C6 |. 57 PUSH EDI
|
||||
//066A76C7 |. 8BF8 MOV EDI,EAX
|
||||
//0054BD38 |. C1EE 08 SHR ESI,8
|
||||
//0054BD3B |. 57 PUSH EDI
|
||||
//0054BD3C |. 8BF8 MOV EDI,EAX
|
||||
} else if (version_D2Game == V110) {
|
||||
memt_byte( 0xC1, 0xE8 ); // CALL caller_handleServerUpdate
|
||||
MEMT_REF4( 0xF88B08EE, caller_handleServerUpdate);
|
||||
|
98
PlugY/Windowed.cpp
Normal file
98
PlugY/Windowed.cpp
Normal file
@ -0,0 +1,98 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Windowed mode options.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "windowed.h"
|
||||
#include "common.h"
|
||||
|
||||
int active_Windowed = false;
|
||||
int setWindowedOptionsDone = false;
|
||||
int active_RemoveBorder = false;
|
||||
int active_WindowOnTop = false;
|
||||
int active_Maximized = false;
|
||||
int active_SetWindowPos = false;
|
||||
int windowedX = 0;
|
||||
int windowedY = 0;
|
||||
int windowedWidth = 800;
|
||||
int windowedHeight = 600;
|
||||
int active_LockMouseOnStartup = false;
|
||||
|
||||
void unlockMouseCursor()
|
||||
{
|
||||
ClipCursor(NULL);
|
||||
}
|
||||
|
||||
void lockMouseCursor(int width, int height)
|
||||
{
|
||||
RECT clientRect;
|
||||
RECT rect;
|
||||
HWND hwnd = GetActiveWindow();
|
||||
GetClientRect(hwnd, &clientRect);
|
||||
GetWindowRect(hwnd, &rect);
|
||||
int shiftX = (rect.right - rect.left - clientRect.right) / 2;
|
||||
int shiftY = rect.bottom - rect.top - clientRect.bottom - shiftX;
|
||||
log_msg("Windows size : %i, %i, %i, %i\n", rect.left, rect.top, rect.right, rect.bottom);
|
||||
rect.left += shiftX;
|
||||
rect.right = rect.left + width;
|
||||
rect.top += shiftY;
|
||||
rect.bottom = rect.top + height;
|
||||
//no resize : 560, 231, 1360, 831
|
||||
//resized : 240, 0, 1040, 600
|
||||
log_msg("Lock Mouse Cursor : %i, %i, %i, %i\n", rect.left, rect.top, rect.right, rect.bottom);
|
||||
ClipCursor(&rect);
|
||||
}
|
||||
|
||||
void lockMouseCursor() { lockMouseCursor(ResolutionX, ResolutionY); }
|
||||
|
||||
void SetWindowedOptions()
|
||||
{
|
||||
if (setWindowedOptionsDone)
|
||||
return;
|
||||
HWND hwnd = GetActiveWindow();
|
||||
RECT clientRect;
|
||||
GetClientRect(hwnd, &clientRect);
|
||||
|
||||
if (active_RemoveBorder)
|
||||
{
|
||||
LONG lStyle = GetWindowLong(hwnd, GWL_STYLE);
|
||||
lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU);
|
||||
SetWindowLong(hwnd, GWL_STYLE, lStyle);
|
||||
SetWindowPos(hwnd, NULL, 0, 0, clientRect.right, clientRect.bottom, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
|
||||
}
|
||||
|
||||
if (active_Maximized && !active_SetWindowPos)
|
||||
{
|
||||
RECT screen;
|
||||
GetWindowRect(GetDesktopWindow(), &screen);
|
||||
log_msg("Screen size : %i, %i, %i, %i\n", screen.left, screen.top, screen.right, screen.bottom);
|
||||
int w = screen.bottom * clientRect.right / clientRect.bottom;
|
||||
int h = w * clientRect.bottom / clientRect.right;
|
||||
if (screen.right < w)
|
||||
{
|
||||
h = screen.right * clientRect.bottom / clientRect.right;
|
||||
w = h * clientRect.right / clientRect.bottom;
|
||||
}
|
||||
windowedX = (screen.right - w) / 2;
|
||||
windowedY = (screen.bottom - h) / 2;
|
||||
windowedWidth = w;
|
||||
windowedHeight = h;
|
||||
}
|
||||
|
||||
if (active_SetWindowPos || active_Maximized)
|
||||
{
|
||||
if (active_WindowOnTop)
|
||||
SetWindowPos(hwnd, HWND_TOPMOST, windowedX, windowedY, windowedWidth, windowedHeight, SWP_FRAMECHANGED);
|
||||
else
|
||||
SetWindowPos(hwnd, NULL, windowedX, windowedY, windowedWidth, windowedHeight, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOOWNERZORDER);
|
||||
}
|
||||
else if (active_WindowOnTop)
|
||||
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, clientRect.right, clientRect.bottom, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
|
||||
|
||||
if (active_LockMouseOnStartup)
|
||||
lockMouseCursor(clientRect.right, clientRect.bottom);
|
||||
|
||||
setWindowedOptionsDone = true;
|
||||
}
|
@ -1,13 +1,14 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
World Event Management.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#include "worldEvent.h"
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "d2functions.h"
|
||||
|
||||
#pragma pack(1)
|
||||
struct s_WEdata
|
||||
@ -27,14 +28,14 @@ DWORD WEactive = 0;
|
||||
DWORD DCloneSpawned = 0;
|
||||
|
||||
DWORD nbSOJSold = 0;
|
||||
DWORD nbNeedSOJSold = 100;
|
||||
DWORD nbNeedSOJSold = 0;
|
||||
DWORD nbManagedSOJSold = 0;
|
||||
|
||||
DWORD nbTicksForNextSOJSold = 0;
|
||||
DWORD prevTicks = 0;
|
||||
|
||||
DWORD showSOJSoldCounterInAllDiff=0;
|
||||
char* itemsToSell="The Stone of Jordan";
|
||||
char* itemsToSell="The Stone of Jordan";
|
||||
DWORD worldEventmonsterID = 333;
|
||||
DWORD valueOfOwnSOJSold=100;
|
||||
DWORD valueInitSOJSoldMin=200;
|
||||
@ -79,21 +80,26 @@ Game* STDCALL WEManagement(DWORD clientID)
|
||||
if (!ptGame) return ptGame;
|
||||
|
||||
if (active_AutomaticSell)
|
||||
while (GetTickCount() - prevTicks >= nbTicksForNextSOJSold)
|
||||
{
|
||||
nbSOJSold++;
|
||||
prevTicks = prevTicks + nbTicksForNextSOJSold;
|
||||
nbTicksForNextSOJSold = getTicksForNextSOJSold();
|
||||
while (GetTickCount() - prevTicks >= nbTicksForNextSOJSold)
|
||||
{
|
||||
nbSOJSold++;
|
||||
prevTicks = prevTicks + nbTicksForNextSOJSold;
|
||||
nbTicksForNextSOJSold = getTicksForNextSOJSold();
|
||||
}
|
||||
}
|
||||
|
||||
if (nbSOJSold == nbManagedSOJSold) return ptGame;
|
||||
if (nbSOJSold == nbManagedSOJSold)
|
||||
return ptGame;
|
||||
|
||||
DWORD newWE;
|
||||
if (!WEactive && (ptGame->difficultyLevel == D2DM_HELL) && (nbSOJSold >= nbNeedSOJSold))
|
||||
{
|
||||
newWE = 1;
|
||||
WEactive = 1;
|
||||
} else newWE = 0;
|
||||
}
|
||||
else
|
||||
newWE = 0;
|
||||
|
||||
if ( showSOJSoldCounterInAllDiff || (ptGame->difficultyLevel == D2DM_HELL))
|
||||
worldEventBroadcast(ptGame, newWE, nbSOJSold);
|
||||
@ -108,10 +114,11 @@ DWORD FASTCALL spawnDClone(Game* ptGame, Room* ptRoom, DWORD p3, DWORD p4, DWORD
|
||||
if (WEactive && (ptGame->difficultyLevel == D2DM_HELL) && !DCloneSpawned)
|
||||
{
|
||||
DCloneSpawned=1;
|
||||
D2SpawnMonster(ptGame,ptRoom,p3,p4,p5,p6,worldEventmonsterID,p8);
|
||||
D2SpawnSuperUnique(ptGame,ptRoom,p3,p4,p5,p6,worldEventmonsterID,p8);
|
||||
return 0;//no minions
|
||||
}
|
||||
else return D2SpawnMonster(ptGame,ptRoom,p3,p4,p5,p6,monsterID,p8);
|
||||
else
|
||||
return D2SpawnSuperUnique(ptGame,ptRoom,p3,p4,p5,p6,monsterID,p8);
|
||||
}
|
||||
|
||||
DWORD STDCALL verifIfWEItem (Unit* ptItem, DWORD flags, DWORD line, const char* filename)
|
||||
@ -123,18 +130,18 @@ DWORD STDCALL verifIfWEItem (Unit* ptItem, DWORD flags, DWORD line, const char*
|
||||
|| (itemNeeded.byItemID && (itemNeeded.ID == 0xFFFF))
|
||||
|| (itemNeeded.byItemID && !itemNeeded.includeUpgradedVersions && ((DWORD)itemNeeded.ID == ptItem->nTxtFileNo))
|
||||
|| (itemNeeded.byItemID && itemNeeded.includeUpgradedVersions) && (
|
||||
(ptItemStats->ItemCode == ptItemStats->NormCode) && (ptItemStats->ItemCode == ptWantedItemStats->NormCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->UberCode) && (ptItemStats->ItemCode == ptWantedItemStats->NormCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->UberCode) && (ptItemStats->ItemCode == ptWantedItemStats->UberCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->HellCode) && (ptItemStats->ItemCode == ptWantedItemStats->NormCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->HellCode) && (ptItemStats->ItemCode == ptWantedItemStats->UberCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->HellCode) && (ptItemStats->ItemCode == ptWantedItemStats->HellCode)
|
||||
))
|
||||
(ptItemStats->ItemCode == ptItemStats->NormCode) && (ptItemStats->ItemCode == ptWantedItemStats->NormCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->UberCode) && (ptItemStats->ItemCode == ptWantedItemStats->NormCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->UberCode) && (ptItemStats->ItemCode == ptWantedItemStats->UberCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->HellCode) && (ptItemStats->ItemCode == ptWantedItemStats->NormCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->HellCode) && (ptItemStats->ItemCode == ptWantedItemStats->UberCode)
|
||||
|| (ptItemStats->ItemCode == ptItemStats->HellCode) && (ptItemStats->ItemCode == ptWantedItemStats->HellCode)
|
||||
))
|
||||
if(!(itemNeeded.isSpecificItem && (D2GetUniqueID(ptItem) != itemNeeded.specificID-1))
|
||||
&& !(itemNeeded.haveNoSocket && (D2GetPlayerStat(ptItem, STATS_ITEM_NUMSOCKETS, 0) > 0))
|
||||
&& !(itemNeeded.haveSockets && (D2GetPlayerStat(ptItem, STATS_ITEM_NUMSOCKETS, 0) == 0))
|
||||
&& !(itemNeeded.isNotEthereal && D2isEtheral(ptItem))
|
||||
&& !(itemNeeded.isEthereal && !D2isEtheral(ptItem))
|
||||
&& !(itemNeeded.isNotEthereal && ptItem->ptItemData->isEtheral)
|
||||
&& !(itemNeeded.isEthereal && !ptItem->ptItemData->isEtheral)
|
||||
&& !(itemNeeded.isBasic && (ptItemStats->ItemCode != ptWantedItemStats->NormCode))
|
||||
&& !(itemNeeded.isExceptional && (ptItemStats->ItemCode != ptWantedItemStats->UberCode))
|
||||
&& !(itemNeeded.isElite && (ptItemStats->ItemCode != ptWantedItemStats->HellCode))
|
||||
@ -160,9 +167,16 @@ void initWorldEventVariables()
|
||||
WEactive = 0;
|
||||
|
||||
while (nbSOJSold >= nbNeedSOJSold)
|
||||
nbNeedSOJSold += (DWORD)(rand()/(RAND_MAX+1.0)*triggerAtSolJSoldDelta+triggerAtSolJSoldMin);
|
||||
nbNeedSOJSold += (DWORD)(rand()/(RAND_MAX+1.0)*triggerAtSolJSoldDelta + triggerAtSolJSoldMin);
|
||||
|
||||
log_msg("initWorldEventVariables - nbSOJSold = %d, nbNeedSOJSold = %d\n", nbSOJSold, nbNeedSOJSold);
|
||||
}
|
||||
|
||||
FCT_ASM ( caller_WEManagement_114 )
|
||||
PUSH ECX
|
||||
CALL WEManagement
|
||||
RETN
|
||||
}}
|
||||
|
||||
FCT_ASM ( caller_WEManagement_1XX )
|
||||
POP EAX
|
||||
@ -197,6 +211,30 @@ FCT_ASM ( caller_spawnDClone_111b )
|
||||
RETN 0x14
|
||||
}}
|
||||
|
||||
FCT_ASM( caller_spawnDClone_114 )
|
||||
PUSH EBX
|
||||
PUSH ECX
|
||||
PUSH EDX
|
||||
PUSH EDI
|
||||
PUSH ESI
|
||||
|
||||
PUSH 0
|
||||
PUSH EBX
|
||||
PUSH 0xFFFFFFFF
|
||||
PUSH DWORD PTR SS : [ESP + 0x30]
|
||||
PUSH DWORD PTR SS : [ESP + 0x30]
|
||||
PUSH DWORD PTR SS : [ESP + 0x30]
|
||||
MOV ECX, EDI
|
||||
MOV EDX, EAX
|
||||
CALL spawnDClone
|
||||
|
||||
POP ESI
|
||||
POP EDI
|
||||
POP EDX
|
||||
POP ECX
|
||||
POP EBX
|
||||
RETN 0x18
|
||||
}}
|
||||
FCT_ASM( caller_addClientForWE_111 )
|
||||
PUSH EAX
|
||||
CALL initWorldEventVariables
|
||||
@ -221,7 +259,7 @@ void Install_WorldEvent()
|
||||
if ( version_D2Game < V110 )
|
||||
return;
|
||||
|
||||
nbSOJSold = (DWORD)(rand()/(RAND_MAX+1.0)*valueInitSOJSoldDelta+valueInitSOJSoldMin);
|
||||
nbSOJSold = (DWORD)(rand()/(RAND_MAX+1.0)*valueInitSOJSoldDelta + valueInitSOJSoldMin);
|
||||
if (active_AutomaticSell)
|
||||
{
|
||||
prevTicks = GetTickCount();
|
||||
@ -231,40 +269,49 @@ void Install_WorldEvent()
|
||||
log_msg("Patch D2Game for active World Event. (WorldEvent)\n");
|
||||
|
||||
// spawn DClone
|
||||
mem_seek R7(D2Game, 0000, 0000, 3F720, 4BCB1, ECF10, 41570, 25280);
|
||||
MEMC_REF4( V2SpawnMonster , version_D2Game >= V111b ? (DWORD)caller_spawnDClone_111b : version_D2Game == V111 ? (DWORD)caller_spawnDClone_111 : (DWORD)spawnDClone);
|
||||
mem_seek R8(D2Game, 0000, 0000, 3F720, 4BCB1, ECF10, 41570, 25280, CFBD0, 1A4A4F);
|
||||
MEMC_REF4( V2SpawnSuperUnique , version_D2Game >= V114a ? (DWORD)caller_spawnDClone_114 : version_D2Game >= V111b ? (DWORD)caller_spawnDClone_111b : version_D2Game == V111 ? (DWORD)caller_spawnDClone_111 : (DWORD)spawnDClone);
|
||||
//6FC6F71F |. E8 FCFAFFFF CALL D2Game.6FC6F220
|
||||
//01FCBCB0 |. E8 2BEFFFFF CALL D2Game.01FCABE0 ; \D2Game.01FCABE0
|
||||
//0205CF0F |. E8 CCF8FFFF CALL D2Game.0205C7E0 ; \D2Game.0205C7E0
|
||||
//6FC6156F |. E8 1CF6FFFF CALL D2Game.6FC60B90 ; \D2Game.6FC60B90
|
||||
//6FC4527F |. E8 CCF6FFFF CALL D2Game.6FC44950 ; \D2Game.6FC44950
|
||||
//6FCEFBCF |. E8 4CE2FFFF CALL D2Game.6FCEDE20 ; \D2Game.6FCEDE20
|
||||
//005A4A4E |. E8 8DBFFFFF CALL Game.005A09E0 ; \Game.005A09E0
|
||||
|
||||
// verify if the item sold is a trigger of WE
|
||||
mem_seek R7(D2Game, 0000, 0000, 977D0, 8E799, 92859, 84499, BFB29);
|
||||
mem_seek R8(D2Game, 0000, 0000, 977D0, 8E799, 92859, 84499, BFB29, 72BE9, 179667);
|
||||
MEMJ_REF4( D2TestFlags , verifIfWEItem);
|
||||
//6FCC77CF |. E8 32400500 CALL <JMP.&D2Common.#10707>
|
||||
//0200E798 |. E8 E9BDF7FF CALL <JMP.&D2Common.#10911>
|
||||
//02002858 |. E8 E57DF7FF CALL <JMP.&D2Common.#10303>
|
||||
//6FCA4498 |. E8 3B62F8FF CALL <JMP.&D2Common.#10989>
|
||||
//6FCDFB28 |. E8 77ADF4FF CALL <JMP.&D2Common.#10202>
|
||||
//6FC92BE8 |. E8 DD7AF9FF CALL <JMP.&D2Common.#10458>
|
||||
//00579666 |. E8 35EA0A00 CALL Game.006280A0 ; \Game.006280A0
|
||||
|
||||
// management of the WorldEvent
|
||||
mem_seek R7(D2Game, 0000, 0000, 3CE0, 51F01, C5681, EBF41, 4A791);
|
||||
MEMC_REF4( V2GetGameByClientID , version_D2Game >= V111 ? (DWORD)WEManagement : (DWORD)caller_WEManagement_1XX);
|
||||
mem_seek R8(D2Game, 0000, 0000, 3CE0, 51F01, C5681, EBF41, 4A791, E5F51, 12FEED);
|
||||
MEMC_REF4( V2GetGameByClientID , version_D2Game >= V114a ? (DWORD)caller_WEManagement_114 : version_D2Game >= V111 ? (DWORD)WEManagement : (DWORD)caller_WEManagement_1XX);
|
||||
//6FC33CDF . E8 FC570000 CALL D2Game.6FC394E0
|
||||
//01FD1F00 |. E8 1BE60800 CALL D2Game.02060520
|
||||
//02035680 |. E8 1BF30100 CALL D2Game.020549A0
|
||||
//6FD0BF40 |. E8 1BA4FBFF CALL D2Game.6FCC6360
|
||||
//6FC6A790 |. E8 4B03FEFF CALL D2Game.6FC4AAE0
|
||||
//6FD05F50 |. E8 AB67FDFF CALL D2Game.6FCDC700
|
||||
//0052FEEC |. E8 6FE9FFFF CALL Game.0052E860
|
||||
//to check : 005389B0 |. E8 2B75FFFF CALL Game.0052FEE0
|
||||
|
||||
// add client for the WorldEvent
|
||||
mem_seek R7(D2Game, 0000, 0000, 1AEF, 3786A, 7055A, 6265F, CB0BF);
|
||||
MEMC_REF4( D2AddClient , version_D2Game >= V111 ? caller_addClientForWE_111 : caller_addClientForWE);
|
||||
mem_seek R8(D2Game, 0000, 0000, 1AEF, 3786A, 7055A, 6265F, CB0BF, D556F, 13F2D2);
|
||||
MEMC_REF4( D2AddClient , version_D2Game >= V111 && version_D2Game <= V113d ? caller_addClientForWE_111 : caller_addClientForWE);
|
||||
//6FC31AEE |. E8 6D510000 CALL D2Game.6FC36C60
|
||||
//01FB7869 |. E8 32C50A00 CALL D2Game.02063DA0
|
||||
//01FE0559 |. E8 B27C0700 CALL D2Game.02058210
|
||||
//6FC8265E |. E8 FD890800 CALL D2Game.6FD0B060
|
||||
//6FCEB0BE |. E8 6DE8F7FF CALL D2Game.6FC69930
|
||||
//6FCF556E |. E8 FDFA0000 CALL D2Game.6FD05070
|
||||
//0053F2D1 |. E8 7AD2FEFF CALL Game.0052C550
|
||||
|
||||
log_msg("\n");
|
||||
|
||||
|
@ -4,16 +4,13 @@
|
||||
Use a more big stash
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __BIGSTASH_HPP__INCLUDED
|
||||
#define __BIGSTASH_HPP__INCLUDED
|
||||
|
||||
#include <windows.h>
|
||||
#include "common.h"
|
||||
|
||||
extern bool active_bigStash;
|
||||
extern bool active_bigStash_tested;
|
||||
|
||||
void Install_BigStash();
|
||||
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,16 +1,14 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Add an extra save file for each characters.
|
||||
Add an extra save file for each characters.
|
||||
|
||||
=================================================================*/
|
||||
/*
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
#include "common.h"
|
||||
|
||||
DWORD loadClientSaveFile();
|
||||
DWORD saveClientSaveFile();
|
||||
|
||||
|
||||
*/
|
||||
/*================================= END OF FILE =================================*/
|
@ -4,9 +4,9 @@
|
||||
Commands directly in game.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __COMMANDS_H__INCLUDED
|
||||
#define __COMMANDS_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
extern bool active_Commands;
|
||||
|
||||
@ -18,4 +18,4 @@ void updateSharedGold(DWORD goldAmount);
|
||||
|
||||
void Install_Commands();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
137
PlugY/common.h
137
PlugY/common.h
@ -1,149 +1,32 @@
|
||||
/*==============================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
this file implements some common and useful
|
||||
function related to some Diablo II mechanisms.
|
||||
Add support 1.13d by L'Autour.
|
||||
|
||||
/*============================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
||||
|
||||
#include "../Commons/d2Constants.h"
|
||||
#include "../Commons/d2BinFile.h"
|
||||
#include "../Commons/d2Struct.h"
|
||||
#include "../Commons/d2StringTblStruct.h"
|
||||
#include "../Commons/D2UnitStruct.h"
|
||||
#include "../Commons/updatingConst.h"
|
||||
#include "../Commons/VersionInfo.h"
|
||||
|
||||
#include "customData.h"
|
||||
#include "error.h"
|
||||
#include "modifMemory.h"
|
||||
#include "parameters.h"
|
||||
#include "globalVariable.h"
|
||||
#include "d2wrapper.h"
|
||||
#include "playerCustomData.h" // include common.h
|
||||
#include "globalVariable.h" // include common.h
|
||||
|
||||
//#ifdef MSVC
|
||||
#define FASTCALL __fastcall
|
||||
//#else
|
||||
//#define FASTCALL __msfastcall
|
||||
//#endif
|
||||
#define STDCALL __stdcall
|
||||
#define FCT_ASM(N) __declspec(naked) void N() {__asm{
|
||||
#define RANDOM(V) ((int)(rand()/(RAND_MAX+1.0)*(V)))
|
||||
//#define RANDOM(V) (rand()%(V))
|
||||
|
||||
// Convertion to 1.09
|
||||
struct s_shifting {
|
||||
DWORD ptInventory;
|
||||
DWORD ptSpecificData;
|
||||
DWORD ptPYPlayerData;
|
||||
DWORD ptGame;
|
||||
DWORD ptClientGame;
|
||||
DWORD ptSkills;
|
||||
DWORD ptImage;
|
||||
DWORD ptFrame;
|
||||
};
|
||||
extern s_shifting shifting;
|
||||
|
||||
//#define PY(C) (*(PYPlayerData**)((BYTE*)(ptChar)+shifting.ptPYPlayerData))
|
||||
#define PCPlayerData (*(PlayerData**)((DWORD)(ptChar)+shifting.ptSpecificData)) //->ptPlayerData
|
||||
#define PCGame (*(Game**)((DWORD)(ptChar)+shifting.ptGame)) //->ptGame
|
||||
#define PClientGame (*(Game**)((DWORD)(ptClient)+shifting.ptClientGame)) //ptClient->ptGame
|
||||
#define PCInventory (*(Inventory**)((DWORD)(ptChar)+shifting.ptInventory)) //->ptInventory
|
||||
//#define PIItemData (*(ItemData**)((DWORD)(ptItem)+shifting.ptSpecificData)) //->ptItemData
|
||||
//#define PCPY (*(PYPlayerData**)((DWORD)(ptChar)+shifting.ptPYPlayerData)) //->ptPYPlayerData
|
||||
#define PCPY ((PYPlayerData*)((DWORD)PCPlayerData+shifting.ptPYPlayerData)) //->ptPYPlayerData
|
||||
#define PCSkills (*(Skills**)((DWORD)(ptChar)+shifting.ptSkills)) //->ptSkills
|
||||
|
||||
#define R7(Z,A,B,C,D,E,F,G) (offset_##Z + (version_##Z == V113? 0x##G : (version_##Z == V112? 0x##F : (version_##Z == V111b? 0x##E : (version_##Z == V111? 0x##D : (version_##Z == V110? 0x##C : (version_##Z == V109d? 0x##B : 0x##A)))))))
|
||||
#define V7(Z,A,B,C,D,E,F,G) (version_##Z == V113? 0x##G : (version_##Z == V112? 0x##F : (version_##Z == V111b? 0x##E : (version_##Z == V111? 0x##D : (version_##Z == V110? 0x##C : (version_##Z == V109d? 0x##B : 0x##A))))))
|
||||
|
||||
|
||||
// Convert 4 char code in a DWORD code
|
||||
#define BIN(A,B,C,D) ((DWORD)A) + (((DWORD)B) << 8) + (((DWORD)C) << 16) + (((DWORD)D) << 24)
|
||||
|
||||
|
||||
#define RX(v) (WindowStartX+(v))
|
||||
#define RY(v) (ResolutionY+NegWindowStartY-(v))
|
||||
|
||||
|
||||
enum eFileVersion
|
||||
{
|
||||
V109b=0,
|
||||
V109d,
|
||||
V110,
|
||||
V111,
|
||||
V111b,
|
||||
V112,
|
||||
V113
|
||||
};
|
||||
|
||||
extern int version_SmackW32;
|
||||
extern int version_D2Common;
|
||||
extern int version_ijl11;
|
||||
extern int version_D2Gdi;
|
||||
extern int version_D2Win;
|
||||
extern int version_D2sound;
|
||||
extern int version_D2MCPCLI;
|
||||
extern int version_D2Launch;
|
||||
extern int version_D2gfx;
|
||||
extern int version_D2Client;
|
||||
extern int version_D2Net;
|
||||
extern int version_D2Lang;
|
||||
extern int version_D2Game;
|
||||
extern int version_D2CMP;
|
||||
extern int version_Bnclient;
|
||||
extern int version_Fog;
|
||||
extern int version_Storm;
|
||||
|
||||
|
||||
// Address in memory of external DLL
|
||||
extern DWORD offset_SmackW32;
|
||||
extern DWORD offset_D2Common;
|
||||
extern DWORD offset_ijl11;
|
||||
extern DWORD offset_D2Gdi;
|
||||
extern DWORD offset_D2Win;
|
||||
extern DWORD offset_D2sound;
|
||||
extern DWORD offset_D2MCPCLI;
|
||||
extern DWORD offset_D2Launch;
|
||||
extern DWORD offset_D2gfx;
|
||||
extern DWORD offset_D2Client;
|
||||
extern DWORD offset_D2Net;
|
||||
extern DWORD offset_D2Lang;
|
||||
extern DWORD offset_D2Game;
|
||||
extern DWORD offset_D2CMP;
|
||||
extern DWORD offset_Bnclient;
|
||||
extern DWORD offset_Fog;
|
||||
extern DWORD offset_Storm;
|
||||
|
||||
extern const char* S_CloneBattles;
|
||||
extern const char* S_DarkAlliance;
|
||||
|
||||
LPWSTR getTranslatedString(int stringID);
|
||||
enum eStringList
|
||||
{
|
||||
STR_STATS_UNASSIGN_WITH_LIMIT=0,
|
||||
STR_STATS_UNASSIGN_WITHOUT_LIMIT,
|
||||
STR_STATS_BASE_MIN,
|
||||
STR_SKILLS_UNASSIGN,
|
||||
STR_STASH_PREVIOUS_PAGE,
|
||||
STR_STASH_NEXT_PAGE,
|
||||
STR_TOGGLE_TO_PERSONAL,
|
||||
STR_TOGGLE_TO_SHARED,
|
||||
STR_STASH_PREVIOUS_INDEX,
|
||||
STR_STASH_NEXT_INDEX,
|
||||
STR_PERSONAL_PAGE_NUMBER,
|
||||
STR_SHARED_PAGE_NUMBER,
|
||||
STR_NO_SELECTED_PAGE,
|
||||
STR_PUT_GOLD,
|
||||
STR_TAKE_GOLD,
|
||||
STR_SHARED_GOLD_QUANTITY,
|
||||
STR_PREVIOUS_PAGE,
|
||||
STR_NEXT_PAGE
|
||||
};
|
||||
#include "d2functions.h"
|
||||
#include "LocalizedStrings.h"
|
||||
|
||||
bool isOnRect(DWORD x, DWORD y, DWORD x0, DWORD y0, DWORD l, DWORD h);
|
||||
void freeMessage(sWinMessage* msg);
|
||||
LPWSTR getTypeUString (WORD id, LPWSTR lpText, DWORD size);
|
||||
char* getTypeAString (WORD id, char* lpText, DWORD size);
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,10 +1,9 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Data added to D2 base-stucture
|
||||
Data added to D2 base-stucture
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "playerCustomData.h"
|
||||
|
@ -4,9 +4,10 @@
|
||||
Language management.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
|
||||
typedef int (STDCALL *TsaveSaveFile) (Unit* ptChar, BYTE** data, DWORD* maxSize, DWORD* curSize);
|
||||
typedef int (STDCALL *TloadSaveFile) (Unit* ptChar, BYTE* data, DWORD maxSize, DWORD* curSize);
|
||||
typedef int (STDCALL *TinitSaveFile) (BYTE** data, DWORD* maxSize, DWORD* curSize);
|
||||
@ -42,5 +43,4 @@ private:
|
||||
|
||||
extern TCustomDll* customDlls;
|
||||
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,23 +1,64 @@
|
||||
/*================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add support 1.13d by L'Autour.
|
||||
Add support 1.14d by haxifix.
|
||||
|
||||
This file implements some common and useful
|
||||
function related to some Diablo II mechanisms.
|
||||
|
||||
================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
// Convertion to 1.09
|
||||
struct s_shifting {
|
||||
DWORD ptInventory;
|
||||
DWORD ptSpecificData;
|
||||
DWORD ptPYPlayerData;
|
||||
DWORD ptGame;
|
||||
DWORD ptClientGame;
|
||||
DWORD ptSkills;
|
||||
DWORD ptImage;
|
||||
DWORD ptFrame;
|
||||
};
|
||||
extern s_shifting shifting;
|
||||
|
||||
//#ifdef MSVC
|
||||
#define FASTCALL __fastcall
|
||||
//#else
|
||||
//#define FASTCALL __msfastcall
|
||||
//#endif
|
||||
#define STDCALL __stdcall
|
||||
#define FCT_ASM(N) __declspec(naked) void N() {__asm{
|
||||
#define RANDOM(V) ((int)(rand()/(RAND_MAX+1.0)*(V)))
|
||||
#define RANDOMF() ((double)rand() / (double)RAND_MAX)
|
||||
//#define RANDOM(V) (rand()%(V))
|
||||
|
||||
//#define PY(C) (*(PYPlayerData**)((BYTE*)(ptChar)+shifting.ptPYPlayerData))
|
||||
#define PCPlayerData (*(PlayerData**)((DWORD)(ptChar)+shifting.ptSpecificData)) //->ptPlayerData
|
||||
#define PCGame (*(Game**)((DWORD)(ptChar)+shifting.ptGame)) //->ptGame
|
||||
#define PClientGame (*(Game**)((DWORD)(ptClient)+shifting.ptClientGame)) //ptClient->ptGame
|
||||
#define PCInventory (*(Inventory**)((DWORD)(ptChar)+shifting.ptInventory)) //->ptInventory
|
||||
//#define PIItemData (*(ItemData**)((DWORD)(ptItem)+shifting.ptSpecificData)) //->ptItemData
|
||||
//#define PCPY (*(PYPlayerData**)((DWORD)(ptChar)+shifting.ptPYPlayerData)) //->ptPYPlayerData
|
||||
#define PCPY ((PYPlayerData*)((DWORD)PCPlayerData+shifting.ptPYPlayerData)) //->ptPYPlayerData
|
||||
#define PCSkills (*(Skills**)((DWORD)(ptChar)+shifting.ptSkills)) //->ptSkills
|
||||
|
||||
#define R8(Z,A,B,C,D,E,F,G,H,I) (offset_##Z + (version_##Z == V114d? 0x##I : (version_##Z == V113d? 0x##H : (version_##Z == V113c? 0x##G : (version_##Z == V112? 0x##F : (version_##Z == V111b? 0x##E : (version_##Z == V111? 0x##D : (version_##Z == V110? 0x##C : (version_##Z == V109d? 0x##B : 0x##A)))))))))
|
||||
#define V8(Z,A,B,C,D,E,F,G,H,I) (version_##Z == V114d? 0x##I : (version_##Z == V113d? 0x##H : (version_##Z == V113c? 0x##G : (version_##Z == V112? 0x##F : (version_##Z == V111b? 0x##E : (version_##Z == V111? 0x##D : (version_##Z == V110? 0x##C : (version_##Z == V109d? 0x##B : 0x##A))))))))
|
||||
|
||||
#define RX(v) (WindowStartX+(v))
|
||||
#define RY(v) (ResolutionY+NegWindowStartY-(v))
|
||||
|
||||
|
||||
|
||||
#define D2S(F, I, R, N, P) typedef R (STDCALL *T##N) P; extern T##N N;//static D N = (D)(A);
|
||||
#define D2F(F, I, R, N, P) typedef R (FASTCALL *T##N) P; extern T##N N;//static D N = (D)(A);
|
||||
#define E2S(F, A, R, N, P) typedef R (STDCALL *T##N) P; extern T##N N;
|
||||
#define E2F(F, A, R, N, P) typedef R (FASTCALL *T##N) P; extern T##N N;
|
||||
#define E2C(F, A, T, N) extern T* pt##N;
|
||||
#define F7(X, Z, A,B,C,D,E,F,G, R, N, P) typedef R (X##CALL *T##N) P; extern T##N N;
|
||||
#define A7(X, Z, A,B,C,D,E,F,G, R, N, P) typedef R (X##CALL *T##N) P; extern T##N N;
|
||||
#define C7(Z, A,B,C,D,E,F,G, T, N) extern T* pt##N;
|
||||
#define F8(X, Z, A,B,C,D,E,F,G,H,I, R, N, P) typedef R (X##CALL *T##N) P; extern T##N N;
|
||||
#define A8(X, Z, A,B,C,D,E,F,G,H,I, R, N, P) typedef R (X##CALL *T##N) P; extern T##N N;
|
||||
#define C8(Z, A,B,C,D,E,F,G,H,I, T, N) extern T* pt##N;
|
||||
|
||||
#include "../Commons/D2Funcs.h"
|
||||
extern DataTables* SgptDataTables;
|
||||
@ -36,9 +77,9 @@ extern DataTables* SgptDataTables;
|
||||
//E2F(D2Client,0, void, D2CleanStatMouseUp, ());
|
||||
|
||||
|
||||
#undef F7
|
||||
#undef A7
|
||||
#undef C7
|
||||
#undef F8
|
||||
#undef A8
|
||||
#undef C8
|
||||
#undef D2S
|
||||
#undef D2F
|
||||
#undef E2S
|
||||
@ -47,7 +88,10 @@ extern DataTables* SgptDataTables;
|
||||
|
||||
extern TD2AddPlayerStat V2AddPlayerStat;
|
||||
extern TD2GetGameByClientID V2GetGameByClientID;
|
||||
extern TD2SpawnSuperUnique V2SpawnSuperUnique;
|
||||
extern TD2SpawnMonster V2SpawnMonster;
|
||||
extern TD2Game235C0 V2Game235C0;
|
||||
extern TD2ReadFile V2ReadFile;
|
||||
//extern TD2SetColorPopup V2SetColorPopup;
|
||||
extern WORD (*getDescStrPos) (DWORD statID);
|
||||
extern void* (STDCALL *compileTxtFile)(DWORD unused, const char* filename, BINField* ptFields, DWORD* ptRecordCount, DWORD recordLength);
|
||||
@ -62,14 +106,15 @@ void __inline fillRect(DWORD x, DWORD y, DWORD Width, DWORD Height, DWORD color,
|
||||
#define WindowStartX (*ptWindowStartX)
|
||||
#define GameTypeMode (*ptGameTypeMode)
|
||||
#define ClientTable (*ptClientTable)
|
||||
|
||||
//#define CurrentNPCNum (*ptCurrentNPCNum)
|
||||
#define IsLodGame (*ptIsLodGame)
|
||||
#define DifficultyLevel (*ptDifficultyLevel)
|
||||
#define MouseY (*ptMouseY)
|
||||
#define MouseX (*ptMouseX)
|
||||
#define ptClientChar (*ptptClientChar)
|
||||
//#define CurrentNPCNum (*ptCurrentNPCNum)
|
||||
#define InputCommandLen (*ptInputCommandLen)
|
||||
#define InputCommand (*ptInputCommand)
|
||||
|
||||
bool initD2functions();
|
||||
void initD2functions();
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
58
PlugY/d2wrapper.h
Normal file
58
PlugY/d2wrapper.h
Normal file
@ -0,0 +1,58 @@
|
||||
/******************************************************************************
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Main Diablo II extra DLL handler.
|
||||
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
extern int version_Game;
|
||||
//extern int version_binkw32;
|
||||
//extern int version_Bnclient;
|
||||
extern int version_D2Client;
|
||||
extern int version_D2CMP;
|
||||
extern int version_D2Common;
|
||||
//extern int version_D2DDraw;
|
||||
//extern int version_D2Direct3D;
|
||||
extern int version_D2Game;
|
||||
//extern int version_D2Gdi;
|
||||
extern int version_D2gfx;
|
||||
//extern int version_D2Glide;
|
||||
extern int version_D2Lang;
|
||||
extern int version_D2Launch;
|
||||
//extern int version_D2MCPClient;
|
||||
//extern int version_D2Multi;
|
||||
extern int version_D2Net;
|
||||
//extern int version_D2sound;
|
||||
extern int version_D2Win;
|
||||
extern int version_Fog;
|
||||
//extern int version_ijl11;
|
||||
//extern int version_SmackW32;
|
||||
extern int version_Storm;
|
||||
|
||||
// Address in memory of external DLL
|
||||
extern DWORD offset_Game;
|
||||
//extern DWORD offset_binkw32;
|
||||
//extern DWORD offset_Bnclient;
|
||||
extern DWORD offset_D2Client;
|
||||
extern DWORD offset_D2CMP;
|
||||
extern DWORD offset_D2Common;
|
||||
//extern DWORD offset_D2DDraw;
|
||||
//extern DWORD offset_D2Direct3D;
|
||||
extern DWORD offset_D2Game;
|
||||
//extern DWORD offset_D2Gdi;
|
||||
extern DWORD offset_D2gfx;
|
||||
//extern DWORD offset_D2Glide;
|
||||
extern DWORD offset_D2Lang;
|
||||
extern DWORD offset_D2Launch;
|
||||
//extern DWORD offset_D2MCPClient;
|
||||
//extern DWORD offset_D2Multi;
|
||||
extern DWORD offset_D2Net;
|
||||
//extern DWORD offset_D2sound;
|
||||
extern DWORD offset_D2Win;
|
||||
extern DWORD offset_Fog;
|
||||
//extern DWORD offset_ijl11;
|
||||
//extern DWORD offset_SmackW32;
|
||||
extern DWORD offset_Storm;
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -4,21 +4,20 @@
|
||||
@file error.hpp
|
||||
@brief Error logger definition.
|
||||
|
||||
This file defiens various functions related to
|
||||
This file defiens various functions related to
|
||||
error handling in D2External functions.
|
||||
|
||||
==============================================*/
|
||||
|
||||
#ifndef __ERROR_H__INCLUDED__
|
||||
#define __ERROR_H__INCLUDED__
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
extern DWORD active_logFile;
|
||||
extern int active_logFile;
|
||||
|
||||
void log_initfile();
|
||||
void log_close();
|
||||
void log_box( const char* pFormat, ... );
|
||||
void log_msg( const char* pFormat, ... );
|
||||
void d2_assert( bool pCondition, char* pLocation, char* pMessage, int pLineNbr );
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,14 +1,12 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Add an extra save file for each characters.
|
||||
Add an extra save file for each characters.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
BYTE* readExtendedSaveFile(char* name, DWORD* size);
|
||||
void writeExtendedSaveFile(char* name, BYTE* data, DWORD size);
|
||||
|
@ -1,31 +1,39 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
Add DoNotCloseNihlathakPortal by haxifix.
|
||||
|
||||
More little options.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __EXTRAOPTIONS_H__INCLUDED
|
||||
#define __EXTRAOPTIONS_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
extern int active_RunLODs;
|
||||
extern int active_alwaysRegenMapInSP;
|
||||
extern bool active_DisplayItemLevel;
|
||||
extern DWORD nbPlayersCommandByDefault;
|
||||
extern int active_DisplayItemLevel;
|
||||
extern DWORD nbPlayersCommand;
|
||||
extern bool active_alwaysRegenMapInSP;
|
||||
extern bool active_RunLODs;
|
||||
extern int active_AlwaysDisplayLifeMana;
|
||||
extern int active_EnabledTXTFilesWithMSExcel;
|
||||
extern int active_DisplayBaseStatsValue;
|
||||
extern int active_LadderRunewords;
|
||||
extern int active_EnabledCowPortalWhenCowKingWasKill;
|
||||
extern bool active_EnabledTXTFilesWithMSExcel;
|
||||
extern bool active_DisplayBaseStatsValue;
|
||||
extern bool active_LadderRunewords;
|
||||
extern bool active_EnabledCowPortalWhenCowKingWasKill;
|
||||
extern bool active_DoNotCloseNihlathakPortal;
|
||||
extern bool active_MoveCainNearHarrogathWaypoint;
|
||||
extern bool active_RemoveExperienceDiminushingReturn;
|
||||
|
||||
void Install_RunLODs();
|
||||
void Install_AlwaysRegenMapInSP();
|
||||
void Install_SendPlayersCommand();
|
||||
void Install_DisplayItemLevel();
|
||||
void Install_SendPlayersCommand();
|
||||
void Install_AlwaysRegenMapInSP();
|
||||
void Install_RunLODs();
|
||||
void Install_AlwaysDisplayLifeMana();
|
||||
void Install_EnabledTXTFilesWithMSExcel();
|
||||
void Install_DisplayBaseStatsValue();
|
||||
void Install_LadderRunewords();
|
||||
void Install_EnabledCowPortalWhenCowKingWasKill();
|
||||
void Install_DoNotCloseNihlathakPortal();
|
||||
void Install_MoveCainNearHarrogathWaypoint();
|
||||
void Install_RemoveExperienceDiminushingReturn();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -4,13 +4,13 @@
|
||||
Set global variable.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __GLOBAL_VARIABLE_H__INCLUDED
|
||||
#define __GLOBAL_VARIABLE_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
extern bool onRealm;
|
||||
extern bool needToInit;
|
||||
|
||||
void Install_VariableOnRealm();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,10 +1,9 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
infinity Stash gestion
|
||||
infinity Stash gestion
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
@ -14,17 +13,62 @@ extern DWORD maxSharedPages;
|
||||
extern DWORD nbPagesPerIndex;
|
||||
extern DWORD nbPagesPerIndex2;
|
||||
extern bool active_multiPageStash;
|
||||
extern int active_SharedStashInMultiPlayer;
|
||||
extern bool active_sharedStash;
|
||||
extern bool active_sharedGold;
|
||||
extern bool separateHardSoftStash;
|
||||
extern char* sharedStashFilename;
|
||||
extern DWORD saveFileStackSize;
|
||||
|
||||
extern bool displaySharedSetItemNameInGreen;
|
||||
extern int posXPreviousBtn,posYPreviousBtn,posXNextBtn,posYNextBtn,posXSharedBtn,posYSharedBtn,posXPreviousIndexBtn,posYPreviousIndexBtn,posXNextIndexBtn,posYNextIndexBtn,posXPutGoldBtn,posYPutGoldBtn,posXTakeGoldBtn,posYTakeGoldBtn;
|
||||
extern int posXPreviousBtn;
|
||||
extern int posYPreviousBtn;
|
||||
extern int posWPreviousBtn;
|
||||
extern int posHPreviousBtn;
|
||||
extern int posXNextBtn;
|
||||
extern int posYNextBtn;
|
||||
extern int posWNextBtn;
|
||||
extern int posHNextBtn;
|
||||
extern int posXSharedBtn;
|
||||
extern int posYSharedBtn;
|
||||
extern int posWSharedBtn;
|
||||
extern int posHSharedBtn;
|
||||
extern int posXPreviousIndexBtn;
|
||||
extern int posYPreviousIndexBtn;
|
||||
extern int posWPreviousIndexBtn;
|
||||
extern int posHPreviousIndexBtn;
|
||||
extern int posXNextIndexBtn;
|
||||
extern int posYNextIndexBtn;
|
||||
extern int posWNextIndexBtn;
|
||||
extern int posHNextIndexBtn;
|
||||
extern int posXPutGoldBtn;
|
||||
extern int posYPutGoldBtn;
|
||||
extern int posWPutGoldBtn;
|
||||
extern int posHPutGoldBtn;
|
||||
extern int posXTakeGoldBtn;
|
||||
extern int posYTakeGoldBtn;
|
||||
extern int posWTakeGoldBtn;
|
||||
extern int posHTakeGoldBtn;
|
||||
extern int posXStashNameField;
|
||||
extern int posYStashNameField;
|
||||
extern int posWStashNameField;
|
||||
extern int posHStashNameField;
|
||||
extern int posXStashGoldField;
|
||||
extern int posYStashGoldField;
|
||||
extern int posWStashGoldField;
|
||||
extern int posHStashGoldField;
|
||||
|
||||
extern bool autoRenameStashPage;
|
||||
extern DWORD PersonalNormalPageColor;
|
||||
extern DWORD PersonalIndexPageColor;
|
||||
extern DWORD PersonalMainIndexPageColor;
|
||||
extern DWORD SharedNormalPageColor;
|
||||
extern DWORD SharedIndexPageColor;
|
||||
extern DWORD SharedMainIndexPageColor;
|
||||
|
||||
void toggleToSharedStash(Unit* ptChar);
|
||||
void toggleToSelfStash(Unit* ptChar);
|
||||
void setCurrentStashIndex(Unit* ptChar, int index);
|
||||
void selectPreviousStash(Unit* ptChar);
|
||||
void selectNextStash(Unit* ptChar);
|
||||
void selectPreviousIndexStash(Unit* ptChar);
|
||||
@ -33,14 +77,22 @@ void selectPrevious2Stash(Unit* ptChar);
|
||||
void selectNext2Stash(Unit* ptChar);
|
||||
void selectPreviousIndex2Stash(Unit* ptChar);
|
||||
void selectNextIndex2Stash(Unit* ptChar);
|
||||
void swapStash(Unit* ptChar, DWORD page, bool toggle);
|
||||
void renameCurrentStash(Unit* ptChar, char* name);
|
||||
void insertStash(Unit* ptChar);
|
||||
bool deleteStash(Unit* ptChar, bool isClient);
|
||||
|
||||
void selectStash(Unit* ptChar, Stash* newStash);
|
||||
void setSelectedStashClient(DWORD stashId, DWORD stashFlags, DWORD flags);
|
||||
void updateSelectedStashClient(Unit* ptChar);
|
||||
void selectStash(Unit* ptChar, Stash* newStash, bool forceUpdate = false);
|
||||
void setSelectedStashClient(DWORD stashId, DWORD stashFlags, DWORD flags, bool bOnlyItems);
|
||||
|
||||
Stash* addStash(Unit* ptChar, bool isShared);
|
||||
Stash* addStash(Unit* ptChar, bool isShared, bool autoSetIndex, Stash* ptStash = NULL);
|
||||
DWORD loadStashList(Unit* ptChar, BYTE* data, DWORD maxSize, DWORD* curSize, bool isShared);
|
||||
void saveStashList(Unit* ptChar, Stash* ptStash, BYTE** data, DWORD* maxSize, DWORD* curSize);
|
||||
|
||||
void getCurrentStashName(WCHAR* buffer, DWORD maxSize, Unit* ptChar);
|
||||
WCHAR* getDefaultStashName(Unit* ptChar);
|
||||
|
||||
void Install_MultiPageStash();
|
||||
|
||||
/*================================= END OF FILE =================================*/
|
@ -4,10 +4,10 @@
|
||||
Interface Skills functions
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTERFACE_SKILLS_HPP__INCLUDED
|
||||
#define __INTERFACE_SKILLS_HPP__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
void Install_InterfaceSkills();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -4,10 +4,10 @@
|
||||
Interface functions
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTERFACE_STASH_HPP__INCLUDED
|
||||
#define __INTERFACE_STASH_HPP__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
void Install_InterfaceStash();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -4,10 +4,10 @@
|
||||
Interface Stats functions
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __INTERFACE_STATS_HPP__INCLUDED
|
||||
#define __INTERFACE_STATS_HPP__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
void Install_InterfaceStats();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
||||
|
@ -4,9 +4,9 @@
|
||||
Language management.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __LANGUAGE_H__INCLUDED
|
||||
#define __LANGUAGE_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
extern bool active_ChangeLanguage;
|
||||
extern DWORD selectedLanguage;
|
||||
@ -36,4 +36,4 @@ extern t_availableLanguages availableLanguages;
|
||||
|
||||
void Install_LanguageManagement();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,13 +1,13 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Load Player Custom Data.
|
||||
Load Player Custom Data.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __LOADPLAYERDATA_H__INCLUDED
|
||||
#define __LOADPLAYERDATA_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
void Install_LoadPlayerData();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
||||
|
@ -1,14 +1,12 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Add "plugY v1.00" on screen.
|
||||
Print PlugY version on screen.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __MAINSCREEN_H__INCLUDED
|
||||
#define __MAINSCREEN_H__INCLUDED
|
||||
|
||||
#include <windows.h>
|
||||
#include "common.h"
|
||||
|
||||
extern bool active_VersionTextChange;
|
||||
extern char* versionText;
|
||||
@ -19,4 +17,4 @@ extern BYTE colorOfPlugYVersion;
|
||||
void Install_PrintPlugYVersion();
|
||||
void Install_VersionChange();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
||||
|
@ -2,11 +2,12 @@
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Modification of code in memory functions.
|
||||
|
||||
/*============================================*/
|
||||
|
||||
/*============================================*/
|
||||
#pragma once
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
extern void* currentMemoryPos;
|
||||
DWORD mem_seek(DWORD newPos);
|
||||
|
||||
@ -19,7 +20,7 @@ void memt_dword(DWORD old, DWORD val);
|
||||
void memt_ref4(DWORD old, DWORD ref);
|
||||
|
||||
//CALL <JMP.&D2gfx.#10047>
|
||||
#define MEMJ_REF4(O, R) memj_ref4((DWORD)(O), (DWORD)(R))
|
||||
#define MEMJ_REF4(O, R) if (version_Game < V114a) memj_ref4((DWORD)(O), (DWORD)(R)); else memc_ref4((DWORD)(O), (DWORD)(R))
|
||||
void memj_ref4(DWORD old, DWORD ref);
|
||||
|
||||
//CALL D2Common.6FD5F500
|
||||
|
@ -4,10 +4,10 @@
|
||||
Cube Listing functions
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __NEWINTERFACE_CUBELISTING_H__INCLUDED
|
||||
#define __NEWINTERFACE_CUBELISTING_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
void listAllCubeFormula();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
||||
|
@ -4,12 +4,12 @@
|
||||
New runeword Interface
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __NEWINTERFACE_RUNEWORDS_H__INCLUDED
|
||||
#define __NEWINTERFACE_RUNEWORDS_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
void STDCALL printRunewordsPage();
|
||||
DWORD STDCALL mouseRunewordsPageLeftDown(sWinMessage* msg);
|
||||
DWORD STDCALL mouseRunewordsPageLeftUp(sWinMessage* msg);
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
||||
|
@ -4,12 +4,12 @@
|
||||
New Stat Interface
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __NEWINTERFACE_STATS_H__INCLUDED
|
||||
#define __NEWINTERFACE_STATS_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
void STDCALL printNewStatsPage();
|
||||
DWORD STDCALL mouseNewStatsPageLeftDown(sWinMessage* msg);
|
||||
DWORD STDCALL mouseNewStatsPageLeftUp(sWinMessage* msg);
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
||||
|
@ -4,12 +4,12 @@
|
||||
New Stat Interface Page 2
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __NEWINTERFACE_STATSPAGETWO_H__INCLUDED
|
||||
#define __NEWINTERFACE_STATSPAGETWO_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
void STDCALL printNewStatsPageTwo(int currentPage);
|
||||
DWORD STDCALL mouseNewStatsPageTwoLeftDown(sWinMessage* msg);
|
||||
DWORD STDCALL mouseNewStatsPageTwoLeftUp(sWinMessage* msg);
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -4,24 +4,99 @@
|
||||
New Interfaces functions
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __NEW_INTERFACES_H__INCLUDED
|
||||
#define __NEW_INTERFACES_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
#define MILIEU(X,L,N) (X + ((N<L)? (L-N)/2 : 0))
|
||||
#define isOnStatsPage(x,y) ((x<400) && (y<553))
|
||||
#define isOnStatsPage(x,y) (x<RX(512))
|
||||
|
||||
extern DWORD bDontPrintBorder;
|
||||
extern int selectedPage;
|
||||
extern int extraHiddenPage;
|
||||
extern int curRunesPage;
|
||||
extern int maxRunesPage;
|
||||
|
||||
void GoNextStatPage();
|
||||
void GoPreviousStatPage();
|
||||
void GoStatPage(int page);
|
||||
int GetCurrentPage();
|
||||
|
||||
struct BtnState
|
||||
{
|
||||
union{
|
||||
DWORD all;
|
||||
struct{
|
||||
DWORD AssSTR:1;
|
||||
DWORD AssDEX:1;
|
||||
DWORD AssVIT:1;
|
||||
DWORD AssENE:1;
|
||||
DWORD UnaSTR:1;
|
||||
DWORD UnaDEX:1;
|
||||
DWORD UnaVIT:1;
|
||||
DWORD UnaENE:1;
|
||||
DWORD close:1;
|
||||
DWORD previousPage:1;
|
||||
DWORD nextPage:1;
|
||||
DWORD prevRunes:1;
|
||||
DWORD nextRunes:1;
|
||||
};
|
||||
};
|
||||
};
|
||||
extern BtnState isDownBtn;
|
||||
|
||||
extern bool active_newInterfaces;
|
||||
extern bool selectMainPageOnOpenning;
|
||||
extern bool printBackgroundOnMainPage;
|
||||
|
||||
extern int posXNextPageBtn;
|
||||
extern int posYNextPageBtn;
|
||||
extern int posXPrevPageBtn;
|
||||
extern int posYPrevPageBtn;
|
||||
extern int posXClosePageBtn;
|
||||
extern int posYClosePageBtn;
|
||||
extern int posXNextRuneBtn;
|
||||
extern int posYNextRuneBtn;
|
||||
extern int posXPrevRuneBtn;
|
||||
extern int posYPrevRuneBtn;
|
||||
extern int posXRunesList;
|
||||
extern int posYRunesList;
|
||||
extern int runesPerPage;
|
||||
|
||||
DWORD getXNextPageBtn();
|
||||
DWORD getYNextPageBtn();
|
||||
DWORD getXPreviousPageBtn();
|
||||
DWORD getYPreviousPageBtn();
|
||||
DWORD getXCloseBtn();
|
||||
DWORD getYCloseBtn();
|
||||
DWORD getXNextRunesBtn();
|
||||
DWORD getYNextRunesBtn();
|
||||
DWORD getXPrevRunesBtn();
|
||||
DWORD getYPrevRunesBtn();
|
||||
|
||||
#define getLCloseBtn() 32
|
||||
#define getHCloseBtn() 32
|
||||
#define isOnCloseBtn(x,y) isOnRect(x, y, getXCloseBtn(), getYCloseBtn(), getLCloseBtn(), getHCloseBtn())
|
||||
|
||||
#define getLPreviousPageBtn() 32
|
||||
#define getHPreviousPageBtn() 32
|
||||
#define isOnPreviousPageBtn(x,y) isOnRect(x, y, getXPreviousPageBtn(), getYPreviousPageBtn(), getLPreviousPageBtn(), getHPreviousPageBtn())
|
||||
|
||||
#define getLNextPageBtn() 32
|
||||
#define getHNextPageBtn() 32
|
||||
#define isOnNextPageBtn(x,y) isOnRect(x, y, getXNextPageBtn(), getYNextPageBtn(), getLNextPageBtn(), getHNextPageBtn())
|
||||
|
||||
#define getLPrevRunesBtn() 32
|
||||
#define getHPrevRunesBtn() 32
|
||||
#define isOnPrevRunesBtn(x,y) isOnRect(x, y, getXPrevRunesBtn(), getYPrevRunesBtn(), getLPrevRunesBtn(), getHPrevRunesBtn())
|
||||
|
||||
#define getLNextRunesBtn() 32
|
||||
#define getHNextRunesBtn() 32
|
||||
#define isOnNextRunesBtn(x,y) isOnRect(x, y, getXNextRunesBtn(), getYNextRunesBtn(), getLNextRunesBtn(), getHNextRunesBtn())
|
||||
|
||||
DWORD STDCALL statsLeftDown(sWinMessage* msg);
|
||||
DWORD STDCALL statsLeftUp(sWinMessage* msg);
|
||||
|
||||
void Install_NewInterfaces();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -4,13 +4,13 @@
|
||||
Others features.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __OTHERSFEATURES_H__INCLUDED
|
||||
#define __OTHERSFEATURES_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
extern bool active_othersFeatures;
|
||||
|
||||
void Install_OthersFeatures();
|
||||
void Install_ChangeResolution();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,15 +1,12 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Loading parameters from ini file.
|
||||
Loading parameters from ini file.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define PLUGY_VERSION "10.00"
|
||||
|
||||
#define LOG_FILE "PlugY.log"
|
||||
#define PLUGY_VERSION "14.03 HD"
|
||||
|
||||
enum TargetMod
|
||||
{
|
||||
|
@ -1,26 +1,29 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Data added to Player base-stucture
|
||||
Data added to Player base-stucture
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
|
||||
extern bool active_PlayerCustomData;
|
||||
extern bool openSharedStashOnLoading;
|
||||
|
||||
struct Unit;
|
||||
|
||||
struct Stash
|
||||
{
|
||||
DWORD id;
|
||||
union {
|
||||
DWORD flags;
|
||||
struct {
|
||||
union {
|
||||
DWORD flags;
|
||||
struct {
|
||||
DWORD isShared:1; //
|
||||
};
|
||||
DWORD isIndex:1; //
|
||||
DWORD isMainIndex:1; //
|
||||
DWORD isReserved:1; // For swap items comand
|
||||
};
|
||||
};
|
||||
char* name;
|
||||
Unit* ptListItem;
|
||||
@ -32,13 +35,13 @@ struct Stash
|
||||
struct PYPlayerData
|
||||
{
|
||||
union {
|
||||
DWORD flags;
|
||||
struct {
|
||||
DWORD flags;
|
||||
struct {
|
||||
DWORD selfStashIsOpened:1; //
|
||||
DWORD sharedStashIsOpened:1;//
|
||||
DWORD showSharedStash:1; //
|
||||
// DWORD notOnRealm:1; //set to 1 when the player is load from client or in SP
|
||||
};
|
||||
};
|
||||
};
|
||||
DWORD sharedGold;
|
||||
DWORD nbSelfPages;
|
||||
|
@ -1,12 +1,13 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Data added to D2 base-stucture
|
||||
Data added to D2 base-stucture
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
|
||||
extern void* unassignSkillsBtnImages;
|
||||
extern void* unassignStatsBtnImages;
|
||||
extern void* stashBtnsImages;
|
||||
|
@ -1,13 +1,12 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by PlugY.rc
|
||||
//
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 106
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
|
@ -1,16 +1,16 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Changing the current save path.
|
||||
Changing the current save path.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __SAVEPATH_H__INCLUDED
|
||||
#define __SAVEPATH_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
extern char* savePath;
|
||||
extern bool active_changingSavePath;
|
||||
|
||||
void Install_ChangingSavePath();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,13 +1,17 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Save Player Custom Data.
|
||||
Save Player Custom Data.
|
||||
|
||||
=================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef __SAVEPLAYERDATA_H__INCLUDED
|
||||
#define __SAVEPLAYERDATA_H__INCLUDED
|
||||
#include "common.h"
|
||||
|
||||
extern bool active_AutoBackup;
|
||||
extern int maxBackupPerCharacter;
|
||||
|
||||
void backupSaveFiles(char* name, int isHardCoreGame);
|
||||
void Install_SavePlayerData();
|
||||
|
||||
#endif
|
||||
/*================================= END OF FILE =================================*/
|
@ -1,14 +1,12 @@
|
||||
/*=================================================================
|
||||
File created by Yohann NICOLAS.
|
||||
|
||||
Add an extra save file shared by all own characters.
|
||||
Add an extra save file shared by all own characters.
|
||||
|
||||
=================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
BYTE* readSharedSaveFile(char* name, DWORD* size);
|
||||
void writeSharedSaveFile(char* name, BYTE* data, DWORD size, bool isHardcore);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user