|
|
|
@ -3037,21 +3037,47 @@ void RecreateEar(int ii, WORD ic, int iseed, int Id, int dur, int mdur, int ch, |
|
|
|
void items_427A72() |
|
|
|
void items_427A72() |
|
|
|
{ |
|
|
|
{ |
|
|
|
PkItemStruct id; |
|
|
|
PkItemStruct id; |
|
|
|
|
|
|
|
char hexId[sizeof(PkItemStruct) * 2 + 1]; |
|
|
|
|
|
|
|
BYTE *buffer; |
|
|
|
|
|
|
|
|
|
|
|
if (CornerStone.activated) { |
|
|
|
if (CornerStone.activated) { |
|
|
|
if (CornerStone.item.IDidx >= 0) { |
|
|
|
if (CornerStone.item.IDidx >= 0) { |
|
|
|
PackItem(&id, &CornerStone.item); |
|
|
|
PackItem(&id, &CornerStone.item); |
|
|
|
setIniValue("Hellfire", off_4A5AC4, (char *)&id, 19); |
|
|
|
buffer = (BYTE *)&id; |
|
|
|
|
|
|
|
for (int i = 0; i < sizeof(PkItemStruct); i++) { |
|
|
|
|
|
|
|
sprintf(&hexId[i * 2], "%02X", buffer[i]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setIniValue("Hellfire", off_4A5AC4, hexId, sizeof(hexId)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setIniValue("Hellfire", off_4A5AC4, (char *)"", 1); |
|
|
|
setIniValue("Hellfire", off_4A5AC4, "", 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int char2int(char input) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (input >= '0' && input <= '9') |
|
|
|
|
|
|
|
return input - '0'; |
|
|
|
|
|
|
|
if (input >= 'A' && input <= 'F') |
|
|
|
|
|
|
|
return input - 'A' + 10; |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void hex2bin(const char *src, int bytes, char *target) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (int i = 0; i < bytes; i++, src += 2) { |
|
|
|
|
|
|
|
target[i] = (char2int(*src) << 4) | char2int(src[1]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void items_427ABA(int x, int y) |
|
|
|
void items_427ABA(int x, int y) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int i, ii; |
|
|
|
int i, ii; |
|
|
|
int dwSize; |
|
|
|
int dwSize; |
|
|
|
PkItemStruct PkSItem; |
|
|
|
PkItemStruct PkSItem; |
|
|
|
|
|
|
|
char hexPkSItem[sizeof(PkItemStruct) * 2 + 1]; |
|
|
|
|
|
|
|
BYTE *buffer; |
|
|
|
|
|
|
|
|
|
|
|
if (CornerStone.activated || x == 0 || y == 0) { |
|
|
|
if (CornerStone.activated || x == 0 || y == 0) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
@ -3070,8 +3096,9 @@ void items_427ABA(int x, int y) |
|
|
|
dItem[x][y] = 0; |
|
|
|
dItem[x][y] = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
dwSize = 0; |
|
|
|
dwSize = 0; |
|
|
|
if (getIniValue("Hellfire", off_4A5AC4, (char *)&PkSItem, sizeof(PkSItem), &dwSize)) { |
|
|
|
if (getIniValue("Hellfire", off_4A5AC4, hexPkSItem, sizeof(hexPkSItem), &dwSize)) { |
|
|
|
if (dwSize == sizeof(PkSItem)) { |
|
|
|
if (dwSize >= sizeof(PkItemStruct) * 2) { |
|
|
|
|
|
|
|
hex2bin(hexPkSItem, sizeof(PkItemStruct), (char *)&PkSItem); |
|
|
|
ii = itemavail[0]; |
|
|
|
ii = itemavail[0]; |
|
|
|
dItem[x][y] = ii + 1; |
|
|
|
dItem[x][y] = ii + 1; |
|
|
|
itemavail[0] = itemavail[MAXITEMS - numitems - 1]; |
|
|
|
itemavail[0] = itemavail[MAXITEMS - numitems - 1]; |
|
|
|
|