DEVTOOLS: Add Bellbot script responses to create_titanic

This commit is contained in:
Paul Gilbert 2016-05-31 20:52:16 -04:00
parent cf0051caf7
commit ec33749157
4 changed files with 179 additions and 5 deletions

View file

@ -36,7 +36,7 @@
#include "common/rect.h"
#include "winexe_pe.h"
#include "file.h"
#include "script_tags.h"
#include "script_responses.h"
/**
* Format of the access.dat file that will be created:
@ -356,7 +356,48 @@ void writeData() {
writeAllScriptTags();
}
// Support method used for translating IDA debugger's output for
// an NPC's chooseResponse method tag list to a format for inclusion
// in this tool's script_respones.cpp file
void createScriptResponses() {
Common::File inFile;
char line[80];
char c[2];
c[0] = c[1] = '\0';
inFile.open("d:\\temp\\bellbot.txt");
printf("static const int xxxx_RESPONSES[][5] = {\n");
do {
strcpy(line, "");
while (!inFile.eof()) {
c[0] = inFile.readByte();
if (c[0] == '\n')
c[0] = ' ';
else if (c[0] == '\r')
continue;
strcat(line, c);
if (inFile.eof() || strlen(line) == (5 * 9))
break;
}
int tag, v1, v2, v3, v4;
sscanf(line, "%x %x %x %x %x", &tag, &v1, &v2, &v3, &v4);
printf("\t{ MKTAG('%c', '%c', '%c', '%c'), %d, %d, %d, %d },\n",
(tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff,
v1, v2, v3, v4);
} while (!inFile.eof());
printf("};\r\n");
inFile.close();
}
int main(int argc, char *argv[]) {
createScriptResponses();
if (argc != 3) {
printf("Format: %s ST.exe titanic.dat\n", argv[0]);
exit(0);

View file

@ -4,7 +4,7 @@ MODULE := devtools/create_titanic
MODULE_OBJS := \
create_titanic_dat.o \
hashmap.o \
script_tags.o \
script_responses.o \
str.o \
winexe.o \
winexe_pe.o

View file

@ -30,9 +30,9 @@
#endif // main
#include "file.h"
#include "script_tags.h"
#include "script_responses.h"
static const int DESKBOT_TAGS[128][5] = {
static const int DESKBOT_RESPONSES[128][5] = {
{ MKTAG('P', 'K', 'U', 'P'), 240573, 0, 0, 0 },
{ MKTAG('S', 'E', 'X', '1'), 240573, 0, 0, 0 },
{ MKTAG('R', 'E', 'S', '1'), 240354, 0, 0, 0 },
@ -175,6 +175,138 @@ static const int DESKBOT_TAGS[128][5] = {
{ MKTAG('W', 'W', 'E', 'B'), 241172, 0, 0, 0 }
};
static const int BELLBOT_RESPONSES[130][5] = {
{ MKTAG('A', 'C', 'T', 'R'), 200505, 0, 0, 0 },
{ MKTAG('A', 'C', 'T', 'S'), 200505, 0, 0, 0 },
{ MKTAG('F', 'A', 'M', 'E'), 200532, 200585, 0, 0 },
{ MKTAG('A', 'D', 'V', 'T'), 200506, 0, 0, 0 },
{ MKTAG('L', 'I', 'Q', 'D'), 200507, 200527, 0, 0 },
{ MKTAG('F', 'A', 'U', 'N'), 200511, 0, 0, 0 },
{ MKTAG('H', 'B', 'B', 'Y'), 200514, 0, 0, 0 },
{ MKTAG('N', 'I', 'K', 'E'), 200514, 0, 0, 0 },
{ MKTAG('B', 'R', 'N', 'D'), 200514, 0, 0, 0 },
{ MKTAG('P', 'G', 'R', 'P'), 200514, 0, 0, 0 },
{ MKTAG('R', 'C', 'K', 'T'), 200514, 0, 0, 0 },
{ MKTAG('D', 'R', 'U', 'G'), 200528, 0, 0, 0 },
{ MKTAG('F', 'A', 'S', 'H'), 200533, 0, 0, 0 },
{ MKTAG('T', 'O', 'Y', 'S'), 200533, 0, 0, 0 },
{ MKTAG('F', 'O', 'O', 'D'), 202270, 0, 0, 0 },
{ MKTAG('J', 'F', 'O', 'D'), 202270, 0, 0, 0 },
{ MKTAG('A', 'R', 'T', 'I'), 200538, 0, 0, 0 },
{ MKTAG('A', 'R', 'T', 'Y'), 200538, 0, 0, 0 },
{ MKTAG('L', 'I', 'T', 'R'), 200538, 0, 0, 0 },
{ MKTAG('C', 'R', 'I', 'M'), 200538, 0, 0, 0 },
{ MKTAG('C', 'S', 'P', 'Y'), 200538, 0, 0, 0 },
{ MKTAG('W', 'E', 'A', 'T'), 200538, 0, 0, 0 },
{ MKTAG('M', 'U', 'S', 'I'), 200539, 0, 0, 0 },
{ MKTAG('S', 'O', 'N', 'G'), 200539, 0, 0, 0 },
{ MKTAG('F', 'I', 'L', 'M'), 200534, 0, 0, 0 },
{ MKTAG('B', 'L', 'F', '1'), 200535, 0, 0, 0 },
{ MKTAG('B', 'L', 'F', '2'), 200536, 0, 0, 0 },
{ MKTAG('M', 'A', 'G', 'S'), 200542, 0, 0, 0 },
{ MKTAG('P', 'H', 'I', 'L'), 200557, 0, 0, 0 },
{ MKTAG('P', 'L', 'A', 'N'), 200562, 0, 0, 0 },
{ MKTAG('E', 'A', 'R', 'T'), 200562, 202252, 0, 0 },
{ MKTAG('P', 'L', 'A', 'C'), 200562, 202252, 0, 0 },
{ MKTAG('F', 'L', 'O', 'R'), 200570, 0, 0, 0 },
{ MKTAG('P', 'T', 'I', 'C'), 200571, 0, 0, 0 },
{ MKTAG('B', 'L', 'P', '1'), 200577, 0, 0, 0 },
{ MKTAG('B', 'L', 'P', '2'), 200575, 0, 0, 0 },
{ MKTAG('B', 'L', 'P', '3'), 200576, 0, 0, 0 },
{ MKTAG('B', 'L', 'P', '4'), 200578, 0, 0, 0 },
{ MKTAG('K', 'N', 'O', 'B'), 200579, 0, 0, 0 },
{ MKTAG('B', 'L', 'R', '1'), 200580, 0, 0, 0 },
{ MKTAG('B', 'L', 'R', '2'), 200581, 0, 0, 0 },
{ MKTAG('S', 'E', 'X', '1'), 200582, 0, 0, 0 },
{ MKTAG('S', 'P', 'R', 'T'), 200584, 0, 0, 0 },
{ MKTAG('T', 'E', 'A', 'M'), 200584, 0, 0, 0 },
{ MKTAG('H', 'E', 'R', 'O'), 200585, 0, 0, 0 },
{ MKTAG('T', 'W', 'A', 'T'), 200588, 0, 0, 0 },
{ MKTAG('S', 'W', 'E', 'R'), 200590, 200336, 0, 0 },
{ MKTAG('T', 'R', 'A', '2'), 200594, 0, 0, 0 },
{ MKTAG('T', 'R', 'A', '3'), 200594, 0, 0, 0 },
{ MKTAG('T', 'V', 'S', 'H'), 200595, 0, 0, 0 },
{ MKTAG('S', 'O', 'A', 'P'), 200595, 0, 0, 0 },
{ MKTAG('C', 'O', 'M', 'D'), 200595, 0, 0, 0 },
{ MKTAG('C', 'O', 'O', 'K'), 200595, 0, 0, 0 },
{ MKTAG('C', 'O', 'P', 'S'), 200595, 0, 0, 0 },
{ MKTAG('D', 'C', 'T', 'R'), 200595, 0, 0, 0 },
{ MKTAG('S', 'F', 'S', 'F'), 200595, 0, 0, 0 },
{ MKTAG('H', 'O', 'S', 'T'), 200595, 0, 0, 0 },
{ MKTAG('B', 'L', 'T', '1'), 200596, 0, 0, 0 },
{ MKTAG('B', 'L', 'T', '2'), 200597, 0, 0, 0 },
{ MKTAG('B', 'L', 'T', '3'), 200598, 0, 0, 0 },
{ MKTAG('B', 'L', 'T', '4'), 200599, 0, 0, 0 },
{ MKTAG('B', 'L', 'T', '5'), 200600, 0, 0, 0 },
{ MKTAG('W', 'E', 'A', 'P'), 200601, 0, 0, 0 },
{ MKTAG('A', 'U', 'T', 'H'), 200605, 0, 0, 0 },
{ MKTAG('H', 'H', 'L', 'D'), 200536, 0, 0, 0 },
{ MKTAG('W', 'W', 'E', 'B'), 200608, 0, 0, 0 },
{ MKTAG('M', 'L', 'T', 'Y'), 200608, 0, 0, 0 },
{ MKTAG('P', 'K', 'U', 'P'), 200067, 0, 0, 0 },
{ MKTAG('S', 'U', 'C', '1'), 200067, 0, 0, 0 },
{ MKTAG('B', 'E', 'L', '1'), 200684, 0, 0, 0 },
{ MKTAG('B', 'E', 'L', '2'), 200887, 0, 0, 0 },
{ MKTAG('B', 'E', 'L', '3'), 200610, 0, 0, 0 },
{ MKTAG('B', 'E', 'L', '4'), 200015, 0, 0, 0 },
{ MKTAG('B', 'E', 'L', '5'), 200043, 0, 0, 0 },
{ MKTAG('B', 'E', 'L', '6'), 200333, 0, 0, 0 },
{ MKTAG('B', 'E', 'L', '7'), 200884, 0, 0, 0 },
{ MKTAG('H', 'H', 'G', 'Q'), 200516, 0, 0, 0 },
{ MKTAG('C', 'H', 'A', 'N'), 200961, 0, 0, 0 },
{ MKTAG('B', 'Y', 'Z', 'A'), 201271, 0, 0, 0 },
{ MKTAG('F', 'I', 'S', 'H'), 201242, 0, 0, 0 },
{ MKTAG('S', 'A', 'S', 'S'), 201256, 0, 0, 0 },
{ MKTAG('S', 'I', 'C', 'K'), 201704, 0, 0, 0 },
{ MKTAG('N', 'H', 'R', 'O'), 201704, 0, 0, 0 },
{ MKTAG('S', 'C', 'I', 'E'), 201675, 0, 0, 0 },
{ MKTAG('S', 'C', 'I', 'T'), 201676, 0, 0, 0 },
{ MKTAG('T', 'D', 'V', 'P'), 200490, 0, 0, 0 },
{ MKTAG('H', 'A', 'H', 'A'), 200950, 0, 0, 0 },
{ MKTAG('S', 'U', 'C', '1'), 200582, 0, 0, 0 },
{ MKTAG('T', 'L', 'A', ' '), 201243, 0, 0, 0 },
{ MKTAG('J', 'O', 'K', 'E'), 201244, 0, 0, 0 },
{ MKTAG('C', 'H', 'S', 'E'), 202270, 0, 0, 0 },
{ MKTAG('C', 'L', 'U', 'B'), 201654, 0, 0, 0 },
{ MKTAG('S', 'L', 'O', 'W'), 201877, 0, 0, 0 },
{ MKTAG('T', 'H', 'R', 'T'), 201238, 201269, 201982, 200336 },
{ MKTAG('A', 'N', 'S', 'W'), 200139, 0, 0, 0 },
{ MKTAG('B', 'A', 'R', '1'), 202051, 200473, 200229, 0 },
{ MKTAG('B', 'A', 'R', 'K'), 200510, 201326, 0, 0 },
{ MKTAG('B', 'A', 'R', 'U'), 200510, 201326, 0, 0 },
{ MKTAG('B', 'O', 'D', 'Y'), 201704, 0, 0, 0 },
{ MKTAG('C', 'M', 'N', 'T'), 202270, 0, 0, 0 },
{ MKTAG('D', 'E', 'S', '2'), 201529, 0, 0, 0 },
{ MKTAG('D', 'N', 'C', 'E'), 200952, 200953, 200960, 0 },
{ MKTAG('D', 'O', 'R', '2'), 200372, 0, 0, 0 },
{ MKTAG('F', 'U', 'L', 'N'), 202035, 202044, 0, 0 },
{ MKTAG('H', 'O', 'M', 'E'), 202252, 0, 0, 0 },
{ MKTAG('I', 'S', 'H', 'E'), 201609, 0, 0, 0 },
{ MKTAG('J', 'N', 'A', 'M'), 202035, 0, 0, 0 },
{ MKTAG('L', 'I', 'F', '1'), 201704, 0, 0, 0 },
{ MKTAG('L', 'I', 'F', '2'), 201704, 0, 0, 0 },
{ MKTAG('L', 'I', 'F', '3'), 201704, 0, 0, 0 },
{ MKTAG('M', 'A', 'D', '1'), 201238, 0, 0, 0 },
{ MKTAG('M', 'A', 'D', '4'), 200292, 0, 0, 0 },
{ MKTAG('M', 'A', 'D', '5'), 200140, 0, 0, 0 },
{ MKTAG('M', 'A', 'D', '6'), 200968, 0, 0, 0 },
{ MKTAG('M', 'C', 'P', 'Y'), 200514, 0, 0, 0 },
{ MKTAG('M', 'I', 'N', 'S'), 200541, 0, 0, 0 },
{ MKTAG('N', 'A', 'U', 'T'), 200529, 0, 0, 0 },
{ MKTAG('N', 'O', 'N', 'O'), 200127, 0, 0, 0 },
{ MKTAG('N', 'P', 'L', 'C'), 200234, 201625, 0, 0 },
{ MKTAG('O', 'R', 'D', '1'), 200473, 0, 0, 0 },
{ MKTAG('O', 'R', 'D', '2'), 200473, 0, 0, 0 },
{ MKTAG('O', 'R', 'D', '3'), 200473, 0, 0, 0 },
{ MKTAG('O', 'R', 'D', '4'), 200473, 0, 0, 0 },
{ MKTAG('O', 'R', 'D', '5'), 200473, 0, 0, 0 },
{ MKTAG('S', 'U', 'C', '2'), 200024, 0, 0, 0 },
{ MKTAG('S', 'U', 'M', 'S'), 200139, 0, 0, 0 },
{ MKTAG('T', 'I', 'T', 'A'), 200606, 0, 0, 0 },
{ MKTAG('W', 'T', 'H', 'R'), 201094, 201097, 201092, 0 },
{ MKTAG('Y', 'E', 'S', 'S'), 201525, 201529, 0, 0 },
};
void writeScriptTags(const char *name, const int *tags, uint count) {
outputFile.seek(dataOffset);
@ -186,5 +318,6 @@ void writeScriptTags(const char *name, const int *tags, uint count) {
}
void writeAllScriptTags() {
writeScriptTags("Tags/103", &DESKBOT_TAGS[0][0], 128);
writeScriptTags("Responses/Deskbot", &DESKBOT_RESPONSES[0][0], 128);
writeScriptTags("Responses/Bellbot", &BELLBOT_RESPONSES[0][0], 130);
}