Skip to content

Commit

Permalink
Enabled ladder unique items
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishimura-Katsuo committed Sep 10, 2020
1 parent d997ca5 commit 429c503
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
15 changes: 12 additions & 3 deletions features/TxtOverride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using D2::Types::RunesTable;
using D2::Types::ItemRatioTable;
using D2::Types::UniqueItemsTable;

ASMPTR CreateTxtTableArray_Rejoin = 0x6122f9;
ASMPTR CreateTxtTableArray_Original = 0x6122f0;
Expand All @@ -24,17 +25,17 @@ void* __stdcall CreateTxtTableArray_Intercept(void* pMemory, char* szTableName,
if (strcmp(szTableName, "runes") == 0) {
int tableSize = *nTxtTableSize;
RunesTable* runes = (RunesTable*)table;
gamelog << "Enabling ladder runewords!" << std::endl;
gamelog << "Enabling ladder runewords." << std::endl;
runes = (RunesTable*)table;

for (int c = 0; c < tableSize; c++) {
runes[c].Server = 0;
}
}
if (strcmp(szTableName, "itemratio") == 0) {
else if (strcmp(szTableName, "itemratio") == 0) {
int tableSize = *nTxtTableSize;
ItemRatioTable* itemratio = (ItemRatioTable*)table;
gamelog << "Increasing item drop rates!" << std::endl;
gamelog << "Balancing drop rates for single player." << std::endl;

for (int c = 0; c < tableSize; c++) {
itemratio[c].unique.divisor = itemratio[c].set.divisor = itemratio[c].rare.divisor = itemratio[c].magic.divisor;
Expand All @@ -43,6 +44,14 @@ void* __stdcall CreateTxtTableArray_Intercept(void* pMemory, char* szTableName,
itemratio[c].set.value = itemratio[c].rare.value = itemratio[c].magic.value * 2;
}
}
else if (strcmp(szTableName, "uniqueitems") == 0) {
gamelog << "Enabling ladder unique items." << std::endl;
int tableSize = *nTxtTableSize;
UniqueItemsTable* uniqueitems = (UniqueItemsTable*)table;
for (int c = 0; c < tableSize; c++) {
uniqueitems[c].ladder = false;
}
}

return table;

Expand Down
18 changes: 18 additions & 0 deletions headers/D2Structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,24 @@ namespace D2 {
BYTE uber, classSpecific;
};

struct UniqueItemsTable
{
WORD index;
BYTE name[0x20];
WORD namestr;
WORD version;
BYTE uk2[0x6];
union {
BYTE flag;
struct { // bit fields I guess?
bool enabled : 1;
bool nolimit : 1;
bool carry1 : 1;
bool ladder : 1;
};
};
BYTE uk3[0x11F];
};
}
}

Expand Down

0 comments on commit 429c503

Please sign in to comment.