Only change the data that has a multiplier set

main
Síle Ekaterin Liszka 2021-05-26 20:06:08 -05:00
parent 2f20dfc5cf
commit bafba01c24
1 changed files with 38 additions and 32 deletions

View File

@ -310,43 +310,49 @@ void Exdeath::applyMultipliers(QFile *file) {
unsigned short data = 0; unsigned short data = 0;
// XP // XP
file->seek(monster_block + (i * 36) + 0xC); if (XP > 1) {
file->read(temp, 2); file->seek(monster_block + (i * 36) + 0xC);
data = (temp[1] << 8) + temp[0]; file->read(temp, 2);
if ((data * XP) > 65535) { data = (temp[1] << 8) + temp[0];
data = 65535; if ((data * XP) > 65535) {
} else { data = 65535;
data *= XP; } else {
data *= XP;
}
temp[1] = (data >> 8) & 0xFF;
temp[0] = data & 0xFF;
file->seek(monster_block + (i * 36) + 0xC);
file->write(temp, 2);
} }
temp[1] = (data >> 8) & 0xFF;
temp[0] = data & 0xFF;
file->seek(monster_block + (i * 36) + 0xC);
file->write(temp, 2);
// Gil // Gil
file->seek(monster_block + (i * 36) + 0xE); if (Gil > 1) {
file->read(temp, 2); file->seek(monster_block + (i * 36) + 0xE);
data = (temp[1] << 8) + temp[0]; file->read(temp, 2);
if ((data * Gil) > 65535) { data = (temp[1] << 8) + temp[0];
data = 65535; if ((data * Gil) > 65535) {
} else { data = 65535;
data *= Gil; } else {
data *= Gil;
}
temp[1] = (data >> 8) & 0xFF;
temp[0] = data & 0xFF;
file->seek(monster_block + (i * 36) + 0xE);
file->write(temp, 2);
} }
temp[1] = (data >> 8) & 0xFF;
temp[0] = data & 0xFF;
file->seek(monster_block + (i * 36) + 0xE);
file->write(temp, 2);
} }
for (int i = 0; i < 512; i++) { if (AP > 1) {
char temp[2]; for (int i = 0; i < 512; i++) {
file->seek(form_block + (i * 28) + 2); char temp[2];
file->read(temp, 1); file->seek(form_block + (i * 28) + 2);
if ((temp[0] * AP) > 255) { file->read(temp, 1);
temp[0] = -1; // 255, but this API doesn't support unsigned char. if ((temp[0] * AP) > 255) {
} else { temp[0] = -1; // 255, but this API doesn't support unsigned char.
temp[0] *= AP; } else {
temp[0] *= AP;
}
file->seek(form_block + (i * 28) + 2);
file->write(temp, 1);
} }
file->seek(form_block + (i * 28) + 2);
file->write(temp, 1);
} }
} }