Go to the documentation of this file.
219 #include <sys/stat.h>
220 #include <sys/types.h>
351 for (test = 0; test <
list->count; test++) {
352 if (
list->races[test] == race)
357 if (
list->allocated ==
list->count) {
358 list->allocated += 50;
375 static int sizes[] = {32, 16, 8, 4, 2};
377 #define size_large sizes[0]
378 #define size_small sizes[1]
495 #define S_CONTAINER 2
524 if (
item->name ==
item->arch->clone.name &&
item->title ==
item->arch->clone.title)
619 namepl =
item->name_pl;
622 if (
item->artifact != NULL) {
640 item->name = base->name;
641 item->name_pl = base->name_pl;
642 item->nrof = base->nrof;
651 object_free(base, FREE_OBJ_NO_DESTROY_CALLBACK | FREE_OBJ_FREE_INVENTORY);
658 item->name_pl = namepl;
661 if (add->
diff == NULL || strcmp(add->
diff,
"") == 0) {
702 int c =
l->power-
r->power;
749 if (monster->head && monster != monster->head)
752 map->min_monster =
MIN(monster->level,
map->min_monster);
753 map->max_monster =
MAX(monster->level,
map->max_monster);
784 const char *roads[] = {
790 const char *partial[] = {
794 for (test = 0; partial[test] != NULL; test++) {
795 if (strstr(
item->arch->name, partial[test]) != NULL)
802 for (test = 0; roads[test] != NULL; test++) {
803 if (strcmp(
item->arch->name, roads[test]) == 0)
833 return gdImageColorResolve(elevationmap, 200*elevation/
elevation_max, 0, 0);
835 return gdImageColorResolve(elevationmap, 0, 0, 200*elevation/
elevation_min);
851 if (sscanf(
map->path,
"/world/world_%d_%d", &
x, &
y) != 2)
862 if (test->type == EXIT || test->type == TELEPORTER) {
873 }
else if (test->move_slow != 0)
878 int32_t elevation = atoi(selevation);
901 return (strcmp(*(
const char **)
a, *(
const char **)
b));
917 source = realloc(source, strlen(source)+strlen(add)+1);
937 if (stat(
name, &info)) {
938 printf(
"Couldn't stat template %s!\n",
name);
942 (*buffer) = calloc(1, info.st_size+1);
944 printf(
"Template %s calloc failed!\n",
name);
948 if (info.st_size == 0) {
955 printf(
"Couldn't open template %s!\n",
name);
959 if (fread(*buffer, info.st_size, 1,
file) != 1) {
960 printf(
"Couldn't read template %s!\n",
name);
985 static char *
do_template(
const char *
template,
const char **vars,
const char **values) {
987 const char *sharp =
template;
991 char *current_result;
994 while ((sharp = strchr(sharp,
'#')) != NULL) {
999 return strdup(
template);
1001 printf(
"Malformed template, mismatched #!\n");
1002 return strdup(
template);
1005 while (vars[var] != NULL) {
1006 if (strlen(values[var]) > maxlen)
1007 maxlen = strlen(values[var]);
1010 result = calloc(1, strlen(
template)+maxlen*(
count/2)+1);
1013 current_result = result;
1016 while ((sharp = strchr(sharp,
'#')) != NULL) {
1017 end = strchr(sharp+1,
'#');
1018 strncpy(current_result,
template, sharp-
template);
1019 if (end == sharp+1) {
1020 strcat(current_result,
"#");
1023 current_result = current_result+strlen(current_result);
1025 while (vars[var] != NULL && (strncmp(vars[var], sharp+1, end-sharp-1) || (strlen(vars[var]) != end-sharp-1)))
1028 if (vars[var] == NULL)
1029 printf(
"Wrong tag: %s\n", sharp);
1031 strcpy(current_result, values[var]);
1033 current_result = current_result+strlen(current_result);
1037 strcat(current_result,
template);
1059 fslash = strchr(from+1,
'/');
1061 strcpy(result, to+1);
1065 rslash = strchr(to+1,
'/');
1066 while (fslash && rslash && (fslash-from == rslash-to) && strncmp(from, to, fslash-from+1) == 0) {
1069 fslash = strchr(fslash+1,
'/');
1070 rslash = strchr(rslash+1,
'/');
1074 strcat(result,
"../");
1075 fslash = strchr(fslash+1,
'/');
1077 if (strlen(result) && result[strlen(result)-1] ==
'/' && *to ==
'/')
1078 result[strlen(result)-1] =
'\0';
1093 const char *
l = *(
const char **)left;
1094 const char *
r = *(
const char **)right;
1095 const char *sl = strrchr(
l,
'/');
1096 const char *sr = strrchr(
r,
'/');
1164 int c =
l->level-
r->level;
1213 list->allocated = 0;
1217 if (
list->count ==
list->allocated) {
1218 list->allocated += 10;
1331 printf(
"warning, multiple quest definition for %s, found in %s and %s.\n",
quest->name,
quest->mainmap ?
quest->mainmap->path :
"(unknown map)", mainmap->
path);
1334 quest->description = strdup(description);
1335 while (strlen(
quest->description) &&
quest->description[strlen(
quest->description)-1] ==
'\n')
1336 quest->description[strlen(
quest->description)-1] =
'\0';
1337 quest->mainmap = mainmap;
1347 char *start, *end, *
next;
1349 char description[500];
1351 start = strstr(
map->lore,
"@def");
1353 description[0] =
'\0';
1355 end = strstr(start,
"\n");
1357 strncpy(
name, start+5, end-start-5);
1358 name[end-start-5] =
'\0';
1360 end = strstr(
next,
"@end");
1362 strncpy(description,
next, end-
next);
1363 description[end-
next] =
'\0';
1365 memcpy(start, end+4, strlen(
map->lore)-(end-start+3));
1369 strcpy(description,
next);
1374 strcpy(
name, start);
1380 start = end ? strstr(end,
"@def") : NULL;
1383 start = strstr(
map->lore,
"@quest");
1385 description[0] =
'\0';
1387 end = strstr(start,
"\n");
1389 strncpy(
name, start+7, end-start-7);
1390 name[end-start-7] =
'\0';
1392 end = strstr(
next,
"@end");
1394 strncpy(description,
next, end-
next);
1395 description[end-
next] =
'\0';
1397 memcpy(start, end+4, strlen(
map->lore)-(end-start+3));
1401 strcpy(description,
next);
1406 strcpy(
name, start);
1412 start = end ? strstr(end,
"@quest") : NULL;
1424 char mainmappath[500];
1426 const char *map_vars[] = {
"MAPPATH",
"MAPNAME",
"MAPTEXT", NULL };
1427 const char *map_vals[] = { mappath, NULL, NULL, NULL };
1428 const char *quest_vars[] = {
"QUESTNAME",
"QUESTTEXT",
"QUESTMAPS",
"QUESTID",
"MAINMAPPATH",
"MAINMAPNAME", NULL };
1429 const char *quest_vals[] = { NULL, NULL, NULL, questid, mainmappath, NULL, NULL };
1430 const char *idx_vars[] = {
"QUESTS", NULL };
1431 const char *idx_vals[] = { NULL, NULL };
1432 char *text_map = NULL;
1433 char *text_quest = NULL;
1434 char *text_idx = NULL;
1436 printf(
"Writing quest index...");
1441 snprintf(mappath,
sizeof(mappath),
"%s.html",
quests[
quest]->
maps.list[
map]->map->path+1);
1447 text_map = strdup(
"");
1451 quest_vals[2] = text_map;
1452 snprintf(questid,
sizeof(questid),
"quest_%d",
quests[
quest]->number);
1454 snprintf(mainmappath,
sizeof(mainmappath),
"%s.html",
quests[
quest]->mainmap->path+1);
1457 snprintf(mainmappath,
sizeof(mainmappath),
"#");
1466 text_quest = strdup(
"No quest.");
1468 idx_vals[0] = text_quest;
1474 fprintf(
out,
"%s", text_idx);
1495 list->allocated = 0;
1510 info->
name = strdup(
npc->name);
1526 if (
list->count ==
list->allocated) {
1527 list->allocated += 50;
1554 if (
list->count ==
list->allocated) {
1555 list->allocated += 50;
1616 add_map(change, &
map->tiled_group->tiled_maps);
1629 printf(
"tiled_map not in tiled_map_list!");
1680 printf(
"Map processed but not found in directory reading? %s\n",
path);
1698 if (
regions[test]->reg == reg)
1711 if (sscanf(
map->path,
"/world/world_%d_%d", &
x, &
y) == 2) {
1729 gdImagePng(pic,
file);
1754 snprintf(
entry,
sizeof(
entry),
"%s -> %s [ label = \"%s\" ]\n", s->
name, d->
name, linkname);
1780 return (
item->type == LOCKED_DOOR ||
item->type == SPECIAL_KEY ||
item->type == CONTAINER ||
item->type == CHECK_INV);
1806 add->
slaying = strdup(slaying);
1846 if (
item->type == LOCKED_DOOR)
1848 else if (
item->type == SPECIAL_KEY)
1850 else if (
item->type == CONTAINER)
1887 struct stat statspic;
1888 char exit_path[500];
1898 printf(
" processing map %s\n", info->
path);
1902 printf(
"couldn't load map %s\n", info->
path);
1911 info->
level =
m->difficulty;
1913 info->
lore = strdup(
m->maplore);
1917 isworld = (sscanf(info->
path,
"/world/world_%d_%d", &
x, &
y) == 2);
1920 info->
name = strdup(
m->name);
1935 stat(tmppath, &stats);
1936 if (stat(picpath[0], &statspic) || (statspic.st_mtime < stats.st_mtime))
1949 for (
x = 0;
x < 4;
x++)
1950 if (
m->tile_path[
x] != NULL) {
1953 if (stat(tmppath, &stats)) {
1954 printf(
" map %s doesn't exist in map %s, for tile %d.\n", exit_path, info->
path,
x);
1965 if (link && link !=
m) {
2006 if (
item->type == EXIT ||
item->type == TELEPORTER ||
item->type == PLAYER_CHANGER) {
2010 if (!
item->slaying) {
2013 printf(
" exit without any path at %d, %d on %s\n",
item->x,
item->y, info->
path);
2016 if (strcmp(
item->slaying,
"/!"))
2020 printf(
" random map without message in %s at %d, %d\n", info->
path,
item->x,
item->y);
2023 start = strstr(
item->msg,
"\nfinal_map ");
2024 if (!start && strncmp(
item->msg,
"final_map", strlen(
"final_map")) == 0)
2028 char *end = strchr(start+1,
'\n');
2030 start += strlen(
"final_map")+2;
2031 strncpy(ep, start, end-start);
2039 if (stat(tmppath, &stats)) {
2040 printf(
" map %s doesn't exist in map %s, at %d, %d.\n", ep, info->
path,
item->x,
item->y);
2049 if (link && link !=
m) {
2075 }
else if ((
item->type == SIGN ||
item->type == BOOK) && (
item->msg !=
item->arch->clone.msg) && (
item->msg != NULL)) {
2079 if (
item->invisible)
2097 if (
gdfaces[
item->face->number] != NULL && ((!
item->head && !
item->more) || (
item->arch->clone.x+hx == 0 &&
item->arch->clone.y+hy == 0))) {
2106 out = fopen(picpath[0],
"wb+");
2113 out = fopen(picpath[i],
"wb+");
2116 gdImageDestroy(small);
2119 gdImageDestroy(pic);
2149 const char *template_page,
const char *template_letter,
2150 const char *template_map,
const char **vars,
2151 const char **values) {
2158 char lettercount[50];
2160 const char **idx_vars;
2161 const char **idx_values;
2164 char index_path[500];
2165 char *mapstext = NULL;
2167 int basevalues, realcount = 0;
2174 for (basevalues = 0; vars[basevalues] != NULL; basevalues++)
2179 idx_vars = malloc(
sizeof(
char *)*(basevalues+
VARSADD));
2180 idx_vars[0] =
"MAPCOUNT";
2181 memcpy(&idx_vars[1], vars,
sizeof(
char *)*basevalues);
2182 idx_vars[basevalues+
VARSADD-1] = NULL;
2184 idx_values = malloc(
sizeof(
char *)*(basevalues+
VARSADD-1));
2185 memcpy(&idx_values[1], values,
sizeof(
char *)*basevalues);
2189 idx_values[0] =
count;
2193 idx_vars[basevalues+1] =
"MAPNAME";
2194 idx_vars[basevalues+2] =
"MAPPATH";
2195 idx_vars[basevalues+3] =
"MAPHTML";
2196 idx_vars[basevalues+4] = NULL;
2201 str_letter[0] =
'\0';
2202 str_letter[1] =
'\0';
2204 strcpy(index_path,
"/");
2205 strcat(index_path,
dest);
2210 if (mapstext != NULL) {
2211 idx_vars[basevalues+1] =
"MAPS";
2212 idx_vars[basevalues+2] =
"LETTER";
2213 idx_vars[basevalues+3] =
"LETTERCOUNT";
2214 idx_vars[basevalues+4] = NULL;
2215 idx_values[basevalues+1] = mapstext;
2216 idx_values[basevalues+2] = str_letter;
2217 snprintf(lettercount,
sizeof(lettercount),
"%d", byletter);
2218 idx_values[basevalues+3] = lettercount;
2222 idx_values[basevalues+2] = NULL;
2225 str_letter[0] = last_letter;
2236 idx_vars[basevalues+1] =
"MAPNAME";
2237 idx_vars[basevalues+2] =
"MAPPATH";
2238 idx_vars[basevalues+3] =
"MAPHTML";
2241 strcpy(maphtml, mappath);
2242 strcat(maphtml,
".html");
2243 idx_values[basevalues+2] = mappath;
2244 idx_values[basevalues+3] = maphtml;
2248 if (last_letter !=
'\0') {
2249 idx_vars[basevalues+1] =
"MAPS";
2250 idx_vars[basevalues+2] =
"LETTER";
2251 idx_vars[basevalues+3] =
"LETTERCOUNT";
2252 idx_vars[basevalues+4] = NULL;
2253 idx_values[basevalues+1] = mapstext;
2254 idx_values[basevalues+2] = str_letter;
2255 snprintf(lettercount,
sizeof(lettercount),
"%d", byletter);
2256 idx_values[basevalues+3] = lettercount;
2260 idx_values[basevalues+2] = NULL;
2263 snprintf(
count,
sizeof(
count),
"%d", realcount);
2264 idx_values[basevalues+1] = string;
2265 idx_vars[basevalues+1] =
"LETTERS";
2266 idx_vars[basevalues+2] = NULL;
2287 const char *vars[] = {
"REGIONNAME",
"REGIONHTML",
"REGIONLONGNAME",
"REGIONDESC", NULL };
2288 const char *values[] = { reg->
reg->
name, html, NULL, NULL };
2290 printf(
"Generating map index for region %s...", reg->
reg->
name);
2296 strcat(html,
".html");
2303 strcat(html,
".html");
2304 index = fopen(html,
"w+");
2305 fprintf(
index,
"%s",
string);
2329 char index_path[500];
2333 printf(
"Generating global map index in maps.html...");
2337 strcpy(index_path,
root);
2338 strcat(index_path,
"/maps.html");
2339 index = fopen(index_path,
"w+");
2357 const char *vars[] = {
"REGIONCOUNT",
"REGIONFILE",
"REGIONNAME", NULL };
2358 const char *values[] = {
count,
file, NULL };
2361 printf(
"Generating regions index in regions.html...");
2372 vars[1] =
"REGIONS";
2379 strcat(
file,
"/regions.html");
2381 fprintf(
out,
"%s",
final);
2400 char mapleft[10], maptop[10], mapright[10], mapbottom[10];
2401 const char *vars[] = { NULL, NULL,
"MAPLEFT",
"MAPTOP",
"MAPRIGHT",
"MAPBOTTOM", NULL };
2402 const char *values[] = { NULL, NULL, mapleft, maptop, mapright, mapbottom, NULL };
2404 char mappath[500], mapraw[500], mapregion[500];
2413 printf(
"Generating world map in world.html...");
2416 pic = gdImageCreateTrueColor(
SIZE*30,
SIZE*30);
2419 strcat(
file,
"/world.html");
2424 for (
y = 0;
y < 30;
y++) {
2425 for (
x = 0;
x < 30;
x++) {
2427 vars[0] =
"MAPNAME";
2428 vars[1] =
"MAPPATH";
2429 values[1] = mappath,
2430 snprintf(
name,
sizeof(
name),
"world_%d_%d", wx, wy);
2431 snprintf(mappath,
sizeof(mappath),
"world/%s.html",
name);
2432 snprintf(mapleft,
sizeof(mapleft),
"%d",
SIZE*
x);
2433 snprintf(maptop,
sizeof(maptop),
"%d",
SIZE*
y);
2434 snprintf(mapright,
sizeof(mapright),
"%d",
SIZE*(
x+1)-1);
2435 snprintf(mapbottom,
sizeof(mapbottom),
"%d",
SIZE*(
y+1)-1);
2441 out = fopen(mappath,
"rb");
2443 printf(
"\n warning: large pic not found for world_%d_%d", wx, wy);
2448 small = gdImageCreateFromPng(
out);
2450 small = gdImageCreateFromJpeg(
out);
2453 printf(
"\n warning: pic not found for world_%d_%d", wx, wy);
2457 gdImageCopyResized(pic, small,
SIZE*
x,
SIZE*
y, 0, 0,
SIZE,
SIZE, small->sx, small->sy);
2458 gdImageDestroy(small);
2477 values[1] = mappath;
2478 vars[1] =
"WORLDMAP";
2480 vars[2] =
"WORLDRAW";
2481 values[3] = mapregion;
2482 vars[3] =
"WORLDREGIONS";
2492 out = fopen(mappath,
"wb+");
2497 small = gdImageCreateTrueColor(
SIZE*30,
SIZE*30);
2498 font = gdFontGetGiant();
2499 color = gdImageColorAllocateAlpha(pic, 255, 0, 0, 20);
2516 out = fopen(mappath,
"wb+");
2519 gdImageDestroy(small);
2522 out = fopen(mappath,
"wb+");
2525 gdImageDestroy(pic);
2547 char mapsmallpic[500];
2548 char indexpath[500];
2549 char regionpath[500];
2550 char regionname[500];
2551 char regionindexpath[500];
2552 char worldmappath[500];
2553 char exit_path[500];
2554 char maplevel[5], minmonster[5], maxmonster[5];
2556 char questpath[500], questtemp[500];
2557 const char *quest_vars[] = {
"NAME",
"PATH",
"TEXT", NULL };
2558 const char *quest_vals[] = { NULL, questpath, NULL, NULL };
2559 const char *q_vars[] = {
"QUESTS", NULL };
2560 const char *q_vals[] = { NULL, NULL };
2561 const char *m_vars[] = {
"NAME", NULL };
2562 const char *m_vals[] = { NULL, NULL };
2563 const char *vars[] = {
"NAME",
"MAPPATH",
"MAPNAME",
"MAPPIC",
"MAPSMALLPIC",
"MAPEXITFROM",
"INDEXPATH",
"REGIONPATH",
"REGIONNAME",
"REGIONINDEXPATH",
"WORLDMAPPATH",
"MAPLORE",
"MAPEXITTO",
"MAPLEVEL",
"QUESTS",
"MONSTERS",
"MINMONSTER",
"MAXMONSTER", NULL, NULL, NULL };
2564 const char *values[] = {
map->path, htmlpath,
map->name, mappic, mapsmallpic,
"", indexpath, regionpath, regionname, regionindexpath, worldmappath,
"",
"", maplevel, NULL,
"", minmonster, maxmonster, NULL, NULL, NULL };
2567 while (vars[vars_count])
2570 snprintf(minmonster,
sizeof(minmonster),
"%d",
map->min_monster);
2571 snprintf(maxmonster,
sizeof(maxmonster),
"%d",
map->max_monster);
2577 if (
map->cfregion) {
2579 strcpy(exit_path,
"/");
2580 strcat(exit_path,
map->cfregion->name);
2581 strcat(exit_path,
".html");
2585 snprintf(regionname,
sizeof(regionname),
"(map was not processed)");
2591 snprintf(htmlpath,
sizeof(htmlpath),
"%s%s.html",
root,
map->path);
2596 snprintf(maplevel,
sizeof(maplevel),
"%d",
map->level);
2597 if (
map->lore &&
map->lore[0] !=
'\0') {
2598 values[11] =
map->lore;
2603 values[11] = maplore;
2605 if (
map->exits_from.count) {
2606 char *one_exit = NULL;
2610 vars[vars_count] =
"EXITNAME";
2611 vars[vars_count+1] =
"EXITFILE";
2614 for (exit = 0; exit <
map->exits_from.count; exit++) {
2616 values[vars_count] =
map->exits_from.maps[exit]->name;
2617 strcat(relative,
".html");
2618 values[vars_count+1] = relative;
2621 vars[vars_count] =
"EXIT";
2622 vars[vars_count+1] = NULL;
2623 values[vars_count] = one_exit;
2630 values[5] = exits_text;
2632 if (
map->exits_to.count) {
2633 char *one_exit = NULL;
2637 vars[vars_count] =
"EXITNAME";
2638 vars[vars_count+1] =
"EXITFILE";
2641 for (exit = 0; exit <
map->exits_to.count; exit++) {
2643 values[vars_count] =
map->exits_to.maps[exit]->name;
2644 strcat(relative,
".html");
2645 values[vars_count+1] = relative;
2648 vars[vars_count] =
"EXIT";
2649 vars[vars_count+1] = NULL;
2650 values[vars_count] = one_exit;
2656 values[12] = exits_to;
2658 if (
map->quests.count) {
2662 for (
q = 0;
q <
map->quests.count;
q++) {
2663 quest_vals[0] =
map->quests.list[
q]->quest->name;
2665 snprintf(questpath,
sizeof(questpath),
"%s#quest_%d", questtemp,
map->quests.list[
q]->quest->number);
2666 quest_vals[2] =
map->quests.list[
q]->description;
2678 if (
map->monsters.count) {
2684 for (
m = 0;
m <
map->monsters.count;
m++) {
2685 m_vals[0] =
map->monsters.races[
m]->name;
2687 if (
m !=
map->monsters.count-1)
2693 values[15] = monsters;
2695 vars[vars_count] = NULL;
2696 out = fopen(htmlpath,
"w+");
2716 printf(
"map without path!\n");
2737 printf(
"empty tiled map group!");
2741 snprintf(
name,
sizeof(
name),
"tiled_map_group_%d",
map);
2755 printf(
"*** warning: tiled maps %s and %s not in same region (%s and %s).\n",
2778 slash = strrchr(
name,
'/');
2876 printf(
"Writing map pages...");
2891 if (stat(picpath, &stats))
2895 if (stat(picpath, &stats))
2898 for (test = 0; test <
map->tiled_maps.count; test++) {
2899 if (
map->tiled_maps.maps[test]->pic_was_done)
2918 int xmin = 0, xmax = 0, ymin = 0, ymax = 0, tiled,
count, last;
2920 gdImagePtr small, large, load;
2927 printf(
" Generating composite map for %s...",
map->name);
2931 printf(
" already uptodate.\n");
2937 printf(
"Tiled map without tiled maps?\n");
2940 map->tiled_maps.maps[0]->processed = 1;
2941 map->tiled_maps.maps[0]->tiled_x_from = 0;
2942 map->tiled_maps.maps[0]->tiled_y_from = 0;
2947 for (tiled = 0; tiled <
map->tiled_maps.count; tiled++) {
2954 if ((
current->tiles[0]) && (
current->tiles[0]->processed == 0)) {
2955 current->tiles[0]->processed = 1;
2959 if ((
current->tiles[1]) && (
current->tiles[1]->processed == 0)) {
2960 current->tiles[1]->processed = 1;
2964 if ((
current->tiles[2]) && (
current->tiles[2]->processed == 0)) {
2965 current->tiles[2]->processed = 1;
2969 if ((
current->tiles[3]) && (
current->tiles[3]->processed == 0)) {
2970 current->tiles[3]->processed = 1;
2976 if (last ==
count) {
2977 printf(
"do_tiled_map_picture: didn't process any map in %s (%d left)??\n",
map->path, last);
2982 for (tiled = 0; tiled <
map->tiled_maps.count; tiled++) {
2983 if (
map->tiled_maps.maps[tiled]->tiled_x_from < xmin)
2984 xmin =
map->tiled_maps.maps[tiled]->tiled_x_from;
2985 if (
map->tiled_maps.maps[tiled]->tiled_y_from < ymin)
2986 ymin =
map->tiled_maps.maps[tiled]->tiled_y_from;
2987 if (
map->tiled_maps.maps[tiled]->tiled_x_from+
map->tiled_maps.maps[tiled]->width > xmax)
2988 xmax =
map->tiled_maps.maps[tiled]->tiled_x_from+
map->tiled_maps.maps[tiled]->width;
2989 if (
map->tiled_maps.maps[tiled]->tiled_y_from+
map->tiled_maps.maps[tiled]->height > ymax)
2990 ymax =
map->tiled_maps.maps[tiled]->tiled_y_from+
map->tiled_maps.maps[tiled]->height;
2996 for (tiled = 0; tiled <
map->tiled_maps.count; tiled++) {
2999 out = fopen(picpath,
"rb");
3001 printf(
"\n do_tiled_map_picture: warning: pic file %s not found for %s (errno=%d)\n", picpath,
map->tiled_maps.maps[tiled]->path, errno);
3005 load = gdImageCreateFromPng(
out);
3007 load = gdImageCreateFromJpeg(
out);
3010 printf(
"\n do_tiled_map_picture: warning: pic not found for %s\n",
map->tiled_maps.maps[tiled]->path);
3013 gdImageCopy(large, load,
size_large*(
map->tiled_maps.maps[tiled]->tiled_x_from-xmin),
size_large*(
map->tiled_maps.maps[tiled]->tiled_y_from-ymin), 0, 0, load->sx, load->sy);
3014 gdImageDestroy(load);
3017 out = fopen(picpath,
"rb");
3019 load = gdImageCreateFromPng(
out);
3021 load = gdImageCreateFromJpeg(
out);
3024 printf(
"\n do_tiled_map_picture: warning: small pic not found for %s\n",
map->tiled_maps.maps[tiled]->path);
3027 gdImageCopy(small, load,
size_small*(
map->tiled_maps.maps[tiled]->tiled_x_from-xmin),
size_small*(
map->tiled_maps.maps[tiled]->tiled_y_from-ymin), 0, 0, load->sx, load->sy);
3028 gdImageDestroy(load);
3032 out = fopen(picpath,
"wb+");
3037 out = fopen(picpath,
"wb+");
3041 gdImageDestroy(small);
3042 gdImageDestroy(large);
3061 printf(
"Writing tiled map information...\n");
3075 char *letters = NULL;
3081 const char *val_vars[] = {
"LEVEL",
"MAPS", NULL };
3082 const char *val_values[] = { strlevel, NULL, NULL };
3083 const char *map_vars[] = {
"MAPNAME",
"MAPPATH", NULL };
3084 const char *map_values[] = { NULL, mappath, NULL };
3085 const char *idx_vars[] = {
"COUNT",
"LEVELS", NULL };
3086 const char *idx_values[] = { strcount, NULL, NULL };
3091 printf(
"Writing map index by level...");
3093 snprintf(
name,
sizeof(
name),
"%s/index_by_level.html",
root);
3101 snprintf(strlevel,
sizeof(strlevel),
"%d", lastlevel);
3102 val_values[1] =
maps;
3111 if (last_tiled && last_tiled ==
process->tiled_group)
3119 last_tiled =
process->tiled_group;
3121 map_values[0] =
process->name;
3122 snprintf(mappath,
sizeof(mappath),
"%s.html",
process->path+1);
3126 snprintf(strlevel,
sizeof(strlevel),
"%d", lastlevel);
3127 val_values[1] =
maps;
3132 snprintf(strcount,
sizeof(strcount),
"%d", levelcount);
3133 idx_values[1] = letters;
3153 printf(
"Generating special equipment list..");
3161 fprintf(
out,
"<html><head><title>Item list</title></head><body><h1>Special items found in maps</h1>\n");
3162 fprintf(
out,
"<table border=\"1\"><tr><th>Name</th><th>Map(s)</th><th>Item power</th><th>Calc item power</th><th>Description</th></tr>\n");
3172 fprintf(
out,
"</table></body></html>\n");
3186 printf(
"Generating monster list...");
3191 snprintf(
name,
sizeof(
name),
"%s/monsters.html",
root);
3194 fprintf(
out,
"<html><head><title>Monster list</title></head><body><h1>Monsters found in maps</h1>\n");
3195 fprintf(
out,
"<table border=\"1\"><tr><th>Name</th><th>Count</th><th>Map(s)</th></tr>\n");
3205 fprintf(
out,
"</ul></td></tr>\n");
3207 fprintf(
out,
"</table></body></html>\n");
3240 struct stat statbuf;
3242 char path[1024], full[1024];
3245 for (ignore = 0;
ignore_path[ignore] != NULL; ignore++) {
3256 for (ignore = 0;
ignore_name[ignore] != NULL; ignore++) {
3263 snprintf(full,
sizeof(full),
"%s/%s",
path,
file->d_name);
3265 status = stat(full, &statbuf);
3266 if ((
status != -1) && (S_ISDIR(statbuf.st_mode))) {
3267 snprintf(full,
sizeof(full),
"%s/%s", from,
file->d_name);
3275 snprintf(full,
sizeof(full),
"%s/%s", from,
file->d_name);
3288 snprintf(
path,
sizeof(
path),
"%s/%s",
root,
"maps.unused");
3291 printf(
"Unable to open file maps.unused!\n");
3302 printf(
"%d unused maps.\n",
found);
3310 gdImagePtr elevationmap;
3315 printf(
"Saving exit/blocking/road information...");
3325 puts(
"Error: Could not save elevation world map due to not finding any minimum or maximum elevation.");
3329 elevationmap = gdImageCreateTrueColor(30*50, 30*50);;
3331 for (
x = 0;
x < 30*50;
x++) {
3332 for (
y = 0;
y < 30*50;
y++) {
3337 printf(
"Saving elevation world map...");
3343 gdImageDestroy(elevationmap);
3344 elevationmap = NULL;
3356 printf(
"Writing regions link file...");
3357 snprintf(
path,
sizeof(
path),
"%s/%s",
root,
"region_links.dot");
3359 fprintf(
file,
"digraph {\n");
3362 fprintf(
file,
"}\n");
3376 fprintf(
file,
"<a href=\"%s.html\">%s</a> (full map path: %s)",
map->tiled_group ?
map->tiled_group->path+1 :
map->path+1,
map->name,
map->path);
3398 fprintf(
file,
"%s", without);
3404 fprintf(
file,
"%s", with);
3405 fprintf(
file,
"<ul>\n");
3407 fprintf(
file,
"\t<li>");
3409 fprintf(
file,
"</li>\n");
3411 fprintf(
file,
"</ul>\n");
3440 printf(
"Writing slaying info file...");
3444 snprintf(
path,
sizeof(
path),
"%s/%s",
root,
"slaying_info.html");
3447 fprintf(
file,
"<html>\n<head>\n<title>Slaying information</title>\n</head>\n<body>\n");
3448 fprintf(
file,
"<p>This is a list of various slaying fields on keys, containers, doors, detectors.</p>");
3455 fprintf(
file,
"No door, container or detector matching this slaying.<br />\n");
3464 fprintf(
file,
"</body>\n</html>\n");
3478 printf(
"Writing NPC info file...");
3482 snprintf(
path,
sizeof(
path),
"%s/%s",
root,
"npc_info.html");
3485 fprintf(
file,
"<html>\n<head>\n<title>NPCs who have a special message</title>\n</head>\n<body>\n");
3486 fprintf(
file,
"<p>This is a list of NPCs having a special message.</p>");
3487 fprintf(
file,
"<ul>\n");
3496 fprintf(
file,
"</ul>\n</li>\n");
3499 fprintf(
file,
"</ul>\n");
3500 fprintf(
file,
"</body>\n</html>\n");
3514 printf(
"Writing readable info file...");
3516 snprintf(
path,
sizeof(
path),
"%s/%s",
root,
"readable_info.html");
3519 fprintf(
file,
"<html>\n<head>\n<title>SIGN and BOOK with a special message</title>\n</head>\n<body>\n");
3520 fprintf(
file,
"<p>This is a list of SIGN and BOOK with a special message.</p>");
3521 fprintf(
file,
"<ul>\n");
3530 fprintf(
file,
"</ul>\n</li>\n");
3533 fprintf(
file,
"</ul>\n");
3534 fprintf(
file,
"</body>\n</html>\n");
3558 fprintf(
file,
"<li>%s (%s)%s\n",
quest->quest_title,
quest->quest_code,
quest->quest_is_system ?
" (system quest)":
"");
3559 if (
quest->quest_description)
3560 fprintf(
file,
"<p>%s</p>\n",
quest->quest_description);
3564 size_t steps_count = 0;
3567 steps[steps_count++] = step;
3572 fprintf(
file,
"<ul>\n");
3573 for (
size_t s = 0; s < steps_count; s++)
3574 fprintf(
file,
"<li>%s%s</li>\n", steps[s]->step_description, steps[s]->is_completion_step ?
"(end)" :
"");
3575 fprintf(
file,
"</ul>\n");
3579 fprintf(
file,
"<p>Linked maps:</p>\n");
3580 fprintf(
file,
"<ul>\n");
3581 for (
size_t i = 0; i < sq->
maps.
count; i++) {
3585 fprintf(
file,
"</ul>\n");
3589 fprintf(
file,
"</li>\n");
3602 printf(
"Writing defined quests info file...");
3604 snprintf(
path,
sizeof(
path),
"%s/%s",
root,
"quests_list.html");
3607 fprintf(
file,
"<html>\n<head>\n<title>Defined quests</title>\n</head>\n<body>\n");
3609 fprintf(
file,
"<ul>\n");
3615 fprintf(
file,
"</ul>\n");
3616 fprintf(
file,
"</body>\n</html>\n");
3629 printf(
"Crossfire Mapper will generate pictures of maps, and create indexes for all maps and regions.\n\n");
3630 printf(
"Syntax: %s\n\n", program);
3631 printf(
"Optional arguments:\n");
3632 printf(
" -nopics don't generate pictures.\n");
3633 printf(
" -noindex don't generate global map index.\n");
3634 printf(
" -root=<path> destination path. Default 'html'.\n");
3635 printf(
" -limit=<number> stop processing after this number of maps, -1 to do all maps (default).\n");
3636 printf(
" -showmaps outputs the name of maps as they are processed.\n");
3637 printf(
" -jpg[=quality] generate jpg pictures, instead of default png. Quality should be 0-95, -1 for automatic.\n");
3638 printf(
" -forcepics force to regenerate pics, even if pics's date is after map's.\n");
3639 printf(
" -addmap=<map> adds a map to process. Path is relative to map's directory root.\n");
3640 printf(
" -rawmaps generates maps pics without items on random (shop, treasure) tiles.\n");
3641 printf(
" -warnnopath inform when an exit has no path set.\n");
3642 printf(
" -listunusedmaps finds all unused maps in the maps directory.\n");
3643 printf(
" -noworldmap don't write the world map in world.png.\n");
3644 printf(
" -noregionslink don't generate regions relation file.\n");
3645 printf(
" -regionslink generate regions relation file.\n");
3646 printf(
" -noexitmap don't generate map of exits.\n");
3647 printf(
" -exitmap generate map of exits.\n");
3648 printf(
" -tileset=<number> use specified tileset to generate the pictures. Default 0 (standard).\n");
3649 printf(
" -details-quests list all quests steps. Default no.\n");
3650 printf(
" -list-system-quests include 'system' quests in quest list. Default no.\n");
3669 while (arg < argc) {
3670 if (strcmp(argv[arg],
"-nopics") == 0)
3672 else if (strcmp(argv[arg],
"-noindex") == 0)
3674 else if (strncmp(argv[arg],
"-root=", 6) == 0)
3675 strncpy(
root, argv[arg]+6, 500);
3676 else if (strncmp(argv[arg],
"-limit=", 7) == 0)
3678 else if (strcmp(argv[arg],
"-showmaps") == 0)
3680 else if (strcmp(argv[arg],
"-jpg") == 0) {
3682 if (argv[arg][4] ==
'=') {
3688 else if (strcmp(argv[arg],
"-forcepics") == 0)
3690 else if (strncmp(argv[arg],
"-addmap=", 8) == 0) {
3691 if (*(argv[arg]+8) ==
'/')
3692 strncpy(
path, argv[arg]+8, 500);
3694 snprintf(
path, 500,
"/%s", argv[arg]+8);
3697 else if (strcmp(argv[arg],
"-rawmaps") == 0)
3699 else if (strcmp(argv[arg],
"-warnnopath") == 0)
3701 else if (strcmp(argv[arg],
"-listunusedmaps") == 0)
3703 else if (strcmp(argv[arg],
"-noworldmap") == 0)
3705 else if (strcmp(argv[arg],
"-noregionslink") == 0)
3707 else if (strcmp(argv[arg],
"-regionslink") == 0)
3709 else if (strcmp(argv[arg],
"-noexitmap") == 0)
3711 else if (strcmp(argv[arg],
"-exitmap") == 0)
3713 else if (strncmp(argv[arg],
"-tileset=", 9) == 0) {
3716 }
else if (strcmp(argv[arg],
"-detail-quests") == 0) {
3718 }
else if (strcmp(argv[arg],
"-list-system-quests") == 0) {
3725 strcpy(
root,
"html");
3738 strcpy(dummy,
root);
3739 strcat(dummy,
"/a");
3752 return (
value ?
"yes" :
"no");
3756 int current_map = 0, i;
3767 printf(
"Initializing Crossfire data...\n");
3787 printf(
"\n\n done.\n\n");
3790 printf(
"Erreor: invalid tileset %d!\n",
tileset);
3842 strcpy(
max,
"(none)");
3843 printf(
"Crossfire map browser generator\n");
3844 printf(
"-------------------------------\n\n");
3845 printf(
"Parameters:\n");
3846 printf(
" path to write files: %s\n",
root);
3847 printf(
" maximum number of maps to process: %s\n",
max);
3867 printf(
"listing all maps...");
3874 infomap = gdImageCreateTrueColor(30*50, 30*50);
3881 for (i = 0; i < 50*30; i++)
3886 printf(
"browsing maps...\n");
3892 if (current_map%100 == 0) {
3896 printf(
" --- map limit reached, stopping ---\n");
3901 printf(
" finished map parsing, %d maps processed, %d map pictures created, %d map pictures were uptodate. Total %d faces used.\n", current_map,
created_pics,
cached_pics,
pics_allocated);
3950 while ((invtmp->stats.hp--) > 0)
3952 invtmp->randomitems = NULL;
3955 && invtmp->type != TREASURE
3956 && invtmp->type != SPELL
3957 && invtmp->type != CLASS
3963 invtmp->randomitems = NULL;
3976 if (
tmp->type == WAND
3978 ||
tmp->type == SCROLL
3979 ||
tmp->type == FIREWALL
3980 ||
tmp->type == POTION
3981 ||
tmp->type == ALTAR
3982 ||
tmp->type == SPELLBOOK)
3983 tmp->randomitems = NULL;
3989 while ((
tmp->stats.hp--) > 0)
3991 tmp->randomitems = NULL;
3992 }
else if (
tmp->type == TIMED_GATE) {
3993 object *head = HEAD(
tmp);
4008 &&
tmp->type != PLAYER
4009 &&
tmp->type != TREASURE
4010 &&
tmp->type != SPELL
4011 &&
tmp->type != PLAYER_CHANGER
4012 &&
tmp->type != CLASS
4015 tmp->randomitems = NULL;
4023 && (
tmp->type == TRIGGER_BUTTON ||
tmp->type == TRIGGER_PEDESTAL))
4028 #ifndef DOXYGEN_SHOULD_SKIP_THIS
4035 fprintf(
logfile,
"%s\n", txt);
4041 va_start(ap, format);
4042 vfprintf(
logfile, format, ap);
4047 fprintf(
logfile,
"ext_info_map: %s\n", str1);
4117 while ((
op->stats.hp--) > 0)
4127 if (
op->env &&
tmp->type != BOOK)
struct struct_map_info * tiles[4]
static void write_maps_index(void)
mapstruct * ready_map_name(const char *name, int flags)
static int do_regions_link
static int sort_map_info(const void *left, const void *right)
#define HAS_RANDOM_ITEMS(op)
void move_firewall(object *ob)
static struct_race_list races
static char * map_one_quest_template
void quest_for_each(quest_op op, void *user)
static int is_special_equipment(object *item)
void object_free(object *ob, int flags)
void object_remove(object *op)
static char * map_monster_after_template
StringBuffer * stringbuffer_new(void)
static void add_monster(object *monster, struct_map_info *map)
static int sort_map_info_by_level(const void *left, const void *right)
static int regions_link_allocated
void give_artifact_abilities(object *op, const object *artifact)
static const char * ignore_path[]
static std::unordered_map< std::string, mapzone * > maps
static const char * output_extensions[]
static char * index_region_region_template
struct struct_map_info * tiled_group
struct struct_race_list struct_race_list
static void do_quest_item(const quest_definition *quest, FILE *file)
static void do_exit_map(mapstruct *map)
static void write_race_index(void)
#define QUERY_FLAG(xyz, p)
struct_map_in_quest_list maps
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
void clean_tmp_files(void)
static void fix_map_names(void)
struct struct_npc_info struct_npc_info
static int color_blocking
int calc_item_power(const object *op)
static event_registration c
static char * quest_map_template
static char * map_monster_one_template
static int dump(const std::set< std::string > &items, const char *name)
void get_ob_diff(StringBuffer *sb, const object *op, const object *op2)
static char * map_exit_template
static int region_allocated
void do_auto_apply(mapstruct *m)
face_sets * find_faceset(int id)
static const quest_definition * system_quests[500]
static void init_struct_map_in_quest_list(struct_map_in_quest_list *list)
const char * get_region_longname(const region *r)
void account_char_save(const char *account, Account_Char *chars)
static void write_region_page(struct_region_info *reg)
static char * index_region_template
static char * world_row_template
struct_map_list maps[S_MAX]
static void write_slaying_map_name(FILE *file, struct_map_info *map)
static char * map_template
static void write_world_info(void)
void emergency_save(int x)
char * create_pathname(const char *name, char *buf, size_t size)
static void write_all_regions(void)
static void write_map_page(struct_map_info *map)
static char * region_map_template
char * path_combine_and_normalize(const char *src, const char *dst, char *path, size_t size)
static void do_tiled_map_picture(struct_map_info *map)
static char * world_template
static int sort_equipment(const void *a, const void *b)
static void write_slaying_info(void)
static char * map_no_monster_template
player * find_player_partial_name(const char *name)
static struct_map_info * create_map_info(void)
static int found_maps_allocated
static const flag_definition flags[]
EXTERN char first_map_path[MAX_BUF]
static char ** found_maps
static struct_map_info * get_map_info(const char *path)
struct struct_region_info struct_region_info
static bool detail_quests
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
static void add_race_to_list(struct_race *race, struct_race_list *list, int check)
void account_char_free(Account_Char *chars)
static void find_maps(const char *from)
void apply_auto_fix(mapstruct *m)
int is_valid_faceset(int fsn)
static int is_road(object *item)
static void fix_exits_for_map(struct_map_info *current, struct_map_list *from, int is_from)
static struct_equipment * get_equipment(void)
static int is_blocking(object *item)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *txt)
void make_path_to_file(const char *filename)
static int sort_system_quest_step(const void *a, const void *b)
struct struct_map_in_quest struct_map_in_quest
const artifact * find_artifact(const object *op, const char *name)
static void process_map_lore(struct_map_info *map)
static struct_map_info * create_tiled_map(void)
static int is_slaying(object *item)
struct struct_quest * quest
const char * object_get_value(const object *op, const char *const key)
#define FLAG_IS_A_TEMPLATE
object * identify(object *op)
static char * map_with_quests_template
static int generate_index
static char * do_template(const char *template, const char **vars, const char **values)
static event_registration m
void esrv_del_item(player *pl, object *ob)
static const char * ignore_name[]
DIR * opendir(const char *)
static void write_regions_link(void)
struct quest_step_definition * next
static char ** regions_link
void set_darkness_map(mapstruct *m)
static int sort_race(const void *a, const void *b)
static char * do_map_index(const char *dest, struct_map_list *maps_list, const char *template_page, const char *template_letter, const char *template_map, const char **vars, const char **values)
struct_map_list exits_from
struct artifactstruct artifact
static gdImagePtr infomap
static int equipment_allocated
static int equipment_count
static char * map_no_exit_to_template
struct struct_map_info struct_map_info
static void do_parameters(int argc, char **argv)
static char * quest_template
static void add_map(struct_map_info *info, struct_map_list *list)
static int sort_slaying(const void *left, const void *right)
static const int num_sizes
static char * world_map_template
static int sortbyname(const void *a, const void *b)
static int color_unlinked_exit
void rod_adjust(object *rod)
SockList * player_get_delayed_buffer(player *pl)
struct dirent * readdir(DIR *)
static int regions_link_count
object * find_skill_by_number(object *who, int skillno)
static int get_elevation_color(int elevation, gdImagePtr elevationmap)
static struct_map_list tiled_map_list
struct_map_in_quest_list quests
void command_help(object *ob, const char *params)
static void write_tiled_map_page(struct_map_info *map)
char * stringbuffer_finish(StringBuffer *sb)
static void check_equipment(object *item, struct_map_info *map)
static int color_linked_exit
static char * map_with_exit_template
static struct_race * get_race(const char *name)
struct struct_race ** races
static void add_npc_to_map(struct_npc_list *list, const object *npc)
const typedef char * sstring
#define FLAG_UNAGGRESSIVE
static struct_quest * get_quest_info(const char *name)
void object_give_identified_properties(object *op)
void esrv_update_spells(player *pl)
static void write_quests_page(void)
static void add_to_struct_map_in_quest_list(struct_map_in_quest_list *list, struct_map_in_quest *item)
int apply_auto(object *op)
static void write_world_map(void)
static void write_maps_by_level(void)
struct struct_map_info ** maps
void delete_map(mapstruct *m)
struct struct_equipment struct_equipment
static void dump_unused_maps(void)
static char * map_no_quest_template
static char * level_map_template
static char * cat_template(char *source, char *add)
struct_map_info * mainmap
static void read_template(const char *name, char **buffer)
static struct_quest ** quests
void object_get_multi_size(const object *ob, int *sx, int *sy, int *hx, int *hy)
static char * map_no_lore_template
static struct_equipment * ensure_unique(struct_equipment *item)
static int pics_allocated
static void define_quest(const char *name, struct_map_info *mainmap, const char *description)
static char * region_template
static int world_exit_info
static bool list_system_quests
static void write_region_index(void)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
static char * map_no_exit_template
static void process_map(struct_map_info *info)
static void quest_callback(const quest_definition *quest, void *user)
static char * map_with_exit_to_template
static void list_map(const char *path)
struct struct_quest struct_quest
int main(int argc, char **argv)
static struct_equipment ** special_equipment
region * get_region_by_map(mapstruct *m)
static struct_npc_info * create_npc_info(const object *npc)
static int tiled_map_need_pic(struct_map_info *map)
static void do_help(const char *program)
void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
struct struct_race struct_race
static void init_map_list(struct_map_list *list)
static void save_picture(FILE *file, gdImagePtr pic)
static void relative_path(const char *from, const char *to, char *result)
struct_map_list maps_list
void LOG(LogLevel logLevel, const char *format,...)
int get_face_fallback(int faceset, uint16_t imageno)
static void write_npc_list(void)
static void add_map_to_quest(struct_map_info *map, const char *name, const char *description)
void esrv_update_item(int flags, object *pl, object *op)
static struct struct_region_info ** regions
struct_race_list monsters
archetype * find_archetype(const char *name)
static void add_one_item(object *item, struct_map_info *map)
region * get_region_struct(void)
static int found_maps_count
static struct_slaying_info ** slaying_info
static int quests_allocated
static void free_equipment(struct_equipment *equip)
static enum output_format_type output_format
struct_map_list tiled_maps
static char * map_monster_between_template
#define CLEAR_FLAG(xyz, p)
static void merge_tiled_maps(struct_map_info *map, int tile, struct_map_info *tiled_map)
struct struct_map_in_quest ** list
static void add_map_to_slaying(struct_slaying_info *info, int item, struct_map_info *map)
object * object_insert_in_ob(object *op, object *where)
void object_update_speed(object *op)
object * arch_to_object(archetype *at)
int strcasecmp(const char *s1, const char *s2)
static void write_quests_list(void)
static int sort_region(const void *left, const void *right)
static char * region_letter_template
static int sort_struct_map_in_quest(const void *left, const void *right)
const char * get_region_msg(const region *r)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
void object_free_drop_inventory(object *ob)
void esrv_send_item(object *ob, object *obx)
static gdImagePtr * gdfaces
static char * map_monster_before_template
void dragon_ability_gain(object *ob, int x, int y)
static int sort_mapname(const void *left, const void *right)
static char * map_exit_to_template
static void write_readable_list(void)
static int compare_map_info(const struct_map_info *left, const struct_map_info *right)
static int sort_system_quest(const void *a, const void *b)
object * generate_treasure(treasurelist *t, int difficulty)
static int list_unused_maps
static char * index_template
static size_t system_quests_count
static void add_region_link(mapstruct *source, mapstruct *dest, const char *linkname)
static void write_equipment_index(void)
static void init_race_list(struct_race_list *list)
static const char * yesno(int value)
static char * index_letter
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
static void write_one_slaying_info(FILE *file, struct_slaying_info *info, int item, const char *with, const char *without)
static struct_slaying_info * get_slaying_struct(const char *slaying)
static void check_slaying_inventory(struct_map_info *map, object *item)
EXTERN region * first_region
static void fix_tiled_map_monsters(void)
static void write_all_maps(void)
static void fix_exits_to_tiled_maps(void)
static char * map_lore_template
static char * level_value_template
#define FOR_INV_PREPARE(op_, it_)
static void init_npc_list(struct_npc_list *list)
static char * index_quest_template
static void write_tiled_maps(void)
static void add_map_to_region(struct_map_info *map, region *reg)
static struct_map_list maps_list
static int slaying_allocated
static void fix_tiled_map(void)
struct struct_npc_list struct_npc_list
Account_Char * account_char_load(const char *account_name)
static int ** elevation_info
static void create_destination(void)
static void add_slaying(struct_map_info *map, object *item)
static struct_quest * find_quest_info(const char *name)
static char * level_template