00001 /************************************************************************/ 00002 /* mlkesl@stthomas.edu =====> Ascii Automapper utility */ 00003 /* Let me know if you use this. Give a newbie some _credit_, */ 00004 /* at least I'm not asking how to add classes... */ 00005 /* Also, if you fix something could ya send me mail about, thanks */ 00006 /* PLEASE mail me if you use this or like it, that way I will keep it up*/ 00007 /************************************************************************/ 00008 /* MapArea -> when given a room, ch, x, and y,... */ 00009 /* this function will fill in values of map as it should */ 00010 /* ShowMap -> will simply spit out the contents of map array */ 00011 /* Would look much nicer if you built your own areas */ 00012 /* without all of the overlapping stock Rom has */ 00013 /* do_map -> core function, takes map size as argument */ 00014 /************************************************************************/ 00015 /* To install:: */ 00016 /* remove all occurances of "u1." (unless your exits are unioned) */ 00017 /* add do_map prototypes to interp.c and merc.h (or interp.h) */ 00018 /* customize the first switch with your own sectors (add road :) */ 00019 /* remove the color codes or change to suit your own color coding */ 00020 /* Other stuff:: */ 00021 /* make a skill, call from do_move (only if ch is not in city etc) */ 00022 /* allow players to actually make ITEM_MAP objects */ 00023 /* change your areas to make them more suited to map code! :) */ 00024 /* I WILL be making MANY enhancements as they come but a lot of */ 00025 /* people want the code, and want it now :p */ 00026 /* Kermit's page also has this snippet, mail me for any q's though */ 00027 /************************************************************************/ 00028 /* mlk update: map is now a 2 dimensional array of integers */ 00029 /* uses SECT_MAX for null */ 00030 /* uses SECT_MAX+1 for mazes or one ways to SECT_ENTER */ 00031 /* use the SECTOR numbers to represent sector types :) */ 00032 /************************************************************************/ 00033 #include <ctype.h> /* for isalpha */ 00034 #include <string.h> 00035 #include <stdlib.h> 00036 #include <stdio.h> 00037 #include <time.h> 00038 #include "merc.h" 00039 #include "olc.h" 00040 00041 #define MAX_MAP 160 00042 #define MAX_MAP_DIR 4 00043 00044 int map[MAX_MAP][MAX_MAP]; 00045 int offsets[4][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0,-1} }; 00046 00047 void MapArea 00048 (ROOM_INDEX_DATA *room, CHAR_DATA *ch, int x, int y, int min, int max) 00049 { 00050 ROOM_INDEX_DATA *prospect_room; 00051 EXIT_DATA *pexit; 00052 int door; 00053 00054 /* marks the room as visited */ 00055 map[x][y]=room->sector_type; 00056 00057 for ( door = 0; door < MAX_MAP_DIR; door++ ) 00058 { /* cycles through for each exit */ 00059 if ( 00060 (pexit = room->exit[door]) != NULL 00061 && pexit->u1.to_room != NULL 00062 && can_see_room(ch,pexit->u1.to_room) /* optional */ 00063 && !IS_SET(pexit->exit_info, EX_CLOSED) 00064 ) 00065 { /* if exit there */ 00066 00067 if ((x<min)||(y<min)||(x>max)||(y>max)) return; 00068 00069 prospect_room = pexit->u1.to_room; 00070 00071 if ( prospect_room->exit[rev_dir[door]] && 00072 prospect_room->exit[rev_dir[door]]->u1.to_room!=room) 00073 { /* if not two way */ 00074 map[x][y]=SECT_MAX+1; /* one way into area OR maze */ 00075 return; 00076 } /* end two way */ 00077 00078 /* if ( IS_NPC(ch) 00079 ||(!IS_SET(ch->act,PLR_HOLYLIGHT)) 00080 ||(!IS_IMMORTAL(ch)) 00081 ) */ 00082 if( (prospect_room->sector_type==SECT_MOUNTAIN) 00083 ||(prospect_room->sector_type==SECT_HILLS) 00084 ||(prospect_room->sector_type==SECT_CITY) 00085 ||(prospect_room->sector_type==SECT_INSIDE) 00086 00087 ) 00088 { /* players cant see past these */ 00089 map[x+offsets[door][0]][y+offsets[door][1]]=prospect_room->sector_type; 00090 /* ^--two way into area */ 00091 /*if (door!=0) return;*//*not needed for my mud becuz of euclid world map*/ 00092 /* ^--takes care of stopping when north is one of sectors you cant see past */ 00093 } 00094 00095 if (map[x+offsets[door][0]][y+offsets[door][1]]==SECT_MAX) { 00096 MapArea (pexit->u1.to_room,ch, 00097 x+offsets[door][0], y+offsets[door][1],min,max); 00098 } 00099 00100 } /* end if exit there */ 00101 } 00102 return; 00103 } 00104 00105 /* mlk :: shows a map, specified by size */ 00106 void ShowMap( CHAR_DATA *ch, int min, int max) 00107 { 00108 int x,y; 00109 00110 for (x = min; x < max; ++x) 00111 { /* every row */ 00112 for (y = min; y < max; ++y) 00113 { /* every column */ 00114 if ( (y==min) || (map[x][y-1]!=map[x][y]) ) 00115 switch(map[x][y]) 00116 { 00117 case SECT_MAX: send_to_char(" ",ch); break; 00118 case SECT_FOREST: send_to_char("{g@",ch); break; 00119 case SECT_FIELD: send_to_char("{G\"",ch); break; 00120 case SECT_HILLS: send_to_char("{G^",ch); break; 00121 //case SECT_ROAD: send_to_char("{m+",ch); break; 00122 case SECT_MOUNTAIN: send_to_char("{y^",ch); break; 00123 case SECT_WATER_SWIM: send_to_char("{B:",ch); break; 00124 case SECT_WATER_NOSWIM: send_to_char("{b:",ch); break; 00125 case SECT_UNUSED: send_to_char("{DX",ch); break; 00126 case SECT_AIR: send_to_char("{C%",ch); break; 00127 case SECT_DESERT: send_to_char("{Y=",ch); break; 00128 //case SECT_ENTER: send_to_char("{W@",ch); break; 00129 case SECT_INSIDE: send_to_char("{W%",ch); break; 00130 case SECT_CITY: send_to_char("{W#",ch); break; 00131 //case SECT_ROCK_MOUNTAIN:send_to_char("{D^",ch); break; 00132 //case SECT_SNOW_MOUNTAIN:send_to_char("{W^",ch); break; 00133 //case SECT_SWAMP: send_to_char("{D&",ch); break; 00134 //case SECT_JUNGLE: send_to_char("{g&",ch); break; 00135 //case SECT_RUINS: send_to_char("{D#",ch); break; 00136 case (SECT_MAX+1): send_to_char("{D?",ch); break; 00137 default: send_to_char("{R*",ch); 00138 } /* end switch1 */ 00139 else 00140 switch(map[x][y]) 00141 { 00142 case SECT_MAX: send_to_char(" ",ch); break; 00143 case SECT_FOREST: send_to_char("@",ch); break; 00144 case SECT_FIELD: send_to_char("\"",ch); break; 00145 case SECT_HILLS: send_to_char("^",ch); break; 00146 //case SECT_ROAD: send_to_char("+",ch); break; 00147 case SECT_MOUNTAIN: send_to_char("^",ch); break; 00148 case SECT_WATER_SWIM: send_to_char(":",ch); break; 00149 case SECT_WATER_NOSWIM: send_to_char(":",ch); break; 00150 case SECT_UNUSED: send_to_char("X",ch); break; 00151 case SECT_AIR: send_to_char("%",ch); break; 00152 case SECT_DESERT: send_to_char("=",ch); break; 00153 //case SECT_ENTER: send_to_char("@",ch); break; 00154 case SECT_INSIDE: send_to_char("%",ch); break; 00155 case SECT_CITY: send_to_char("#",ch); break; 00156 //case SECT_ROCK_MOUNTAIN:send_to_char("^",ch); break; 00157 //case SECT_SNOW_MOUNTAIN:send_to_char("^",ch); break; 00158 //case SECT_SWAMP: send_to_char("&",ch); break; 00159 //case SECT_JUNGLE: send_to_char("&",ch); break; 00160 //case SECT_RUINS: send_to_char("#",ch); break; 00161 case (SECT_MAX+1): send_to_char("?",ch); break; 00162 default: send_to_char("*",ch); 00163 } /* end switch2 */ 00164 } /* every column */ 00165 00166 send_to_char("\n\r",ch); 00167 } /*every row*/ 00168 00169 return; 00170 } 00171 00172 /* mlk :: shows map compacted, specified by size */ 00173 void ShowHalfMap( CHAR_DATA *ch, int min, int max) 00174 { 00175 int x,y; 00176 00177 for (x = min; x < max; x+=2) 00178 { /* every row */ 00179 for (y = min; y < max; y+=2) 00180 { /* every column */ 00181 00182 /* mlk prioritizes*/ 00183 //if (map[x][y-1]==SECT_ROAD) map[x][y]=SECT_ROAD; 00184 //if (map[x][y-1]==SECT_ENTER) map[x][y]=SECT_ENTER; 00185 00186 if ( (y==min) || (map[x][y-2]!=map[x][y]) ) 00187 switch(map[x][y]) 00188 { 00189 case SECT_MAX: send_to_char(" ",ch); break; 00190 case SECT_FOREST: send_to_char("{g@",ch); break; 00191 case SECT_FIELD: send_to_char("{G\"",ch); break; 00192 case SECT_HILLS: send_to_char("{G^",ch); break; 00193 //case SECT_ROAD: send_to_char("{m+",ch); break; 00194 case SECT_MOUNTAIN: send_to_char("{y^",ch); break; 00195 case SECT_WATER_SWIM: send_to_char("{B:",ch); break; 00196 case SECT_WATER_NOSWIM: send_to_char("{b:",ch); break; 00197 case SECT_UNUSED: send_to_char("{DX",ch); break; 00198 case SECT_AIR: send_to_char("{C%",ch); break; 00199 case SECT_DESERT: send_to_char("{Y=",ch); break; 00200 //case SECT_ENTER: send_to_char("{W@",ch); break; 00201 case SECT_INSIDE: send_to_char("{W%",ch); break; 00202 case SECT_CITY: send_to_char("{W#",ch); break; 00203 //case SECT_ROCK_MOUNTAIN:send_to_char("{D^",ch); break; 00204 //case SECT_SNOW_MOUNTAIN:send_to_char("{W^",ch); break; 00205 //case SECT_SWAMP: send_to_char("{D&",ch); break; 00206 //case SECT_JUNGLE: send_to_char("{g&",ch); break; 00207 //case SECT_RUINS: send_to_char("{D#",ch); break; 00208 case (SECT_MAX+1): send_to_char("{D?",ch); break; 00209 default: send_to_char("{R*",ch); 00210 } /* end switch1 */ 00211 else 00212 switch(map[x][y]) 00213 { 00214 case SECT_MAX: send_to_char(" ",ch); break; 00215 case SECT_FOREST: send_to_char("@",ch); break; 00216 case SECT_FIELD: send_to_char("\"",ch); break; 00217 case SECT_HILLS: send_to_char("^",ch); break; 00218 //case SECT_ROAD: send_to_char("+",ch); break; 00219 case SECT_MOUNTAIN: send_to_char("^",ch); break; 00220 case SECT_WATER_SWIM: send_to_char(":",ch); break; 00221 case SECT_WATER_NOSWIM: send_to_char(":",ch); break; 00222 case SECT_UNUSED: send_to_char("X",ch); break; 00223 case SECT_AIR: send_to_char("%",ch); break; 00224 case SECT_DESERT: send_to_char("=",ch); break; 00225 //case SECT_ENTER: send_to_char("@",ch); break; 00226 case SECT_INSIDE: send_to_char("%",ch); break; 00227 case SECT_CITY: send_to_char("#",ch); break; 00228 /*case SECT_ROCK_MOUNTAIN:send_to_char("^",ch); break; 00229 case SECT_SNOW_MOUNTAIN:send_to_char("^",ch); break; 00230 case SECT_SWAMP: send_to_char("&",ch); break; 00231 case SECT_JUNGLE: send_to_char("&",ch); break; 00232 case SECT_RUINS: send_to_char("#",ch); break;*/ 00233 case (SECT_MAX+1): send_to_char("?",ch); break; 00234 default: send_to_char("*",ch); 00235 } /* end switch2 */ 00236 } /* every column */ 00237 00238 send_to_char("\n\r",ch); 00239 } /*every row*/ 00240 00241 return; 00242 } 00243 00244 /*printing function*/ 00245 void do_printmap(CHAR_DATA *ch, char *argument) 00246 { 00247 int x,y,min=-1,max=MAX_MAP-1; 00248 FILE *fp; 00249 00250 if (strcmp(ch->name,"Kroudar")) 00251 { 00252 send_to_char("Curiousity is a disease...",ch); 00253 return; 00254 } 00255 00256 for (x = 0; x < MAX_MAP; ++x) 00257 for (y = 0; y < MAX_MAP; ++y) 00258 map[x][y]=SECT_MAX; 00259 00260 MapArea(ch->in_room, ch, 80, 80, min, max); 00261 00262 fclose (fpReserve); 00263 00264 fp = fopen("WILDERNESS_MAP","w"); 00265 for (x = min; x < max; ++x) 00266 { /* every row */ 00267 for (y = min; y < max; ++y) 00268 { /* every column */ 00269 switch(map[x][y]) 00270 { 00271 case SECT_MAX: fprintf(fp," "); break; 00272 case SECT_FOREST: fprintf(fp,"@"); break; 00273 case SECT_FIELD: fprintf(fp,"\""); break; 00274 case SECT_HILLS: fprintf(fp,"^"); break; 00275 //case SECT_ROAD: fprintf(fp,"+"); break; 00276 case SECT_MOUNTAIN: fprintf(fp,"^"); break; 00277 case SECT_WATER_SWIM: fprintf(fp,":"); break; 00278 case SECT_WATER_NOSWIM: fprintf(fp,":"); break; 00279 case SECT_UNUSED: fprintf(fp,"X"); break; 00280 case SECT_AIR: fprintf(fp,"~"); break; 00281 case SECT_DESERT: fprintf(fp,"="); break; 00282 //case SECT_ENTER: fprintf(fp,"$"); break; 00283 case SECT_INSIDE: fprintf(fp,"I"); break; 00284 case SECT_CITY: fprintf(fp,"#"); break; 00285 /*case SECT_ROCK_MOUNTAIN:fprintf(fp,"^"); break; 00286 case SECT_SNOW_MOUNTAIN:fprintf(fp,"^"); break; 00287 case SECT_SWAMP: fprintf(fp,"&"); break; 00288 case SECT_JUNGLE: fprintf(fp,"&"); break; 00289 case SECT_RUINS: fprintf(fp,"#"); break;*/ 00290 case (SECT_MAX+1): fprintf(fp,"?"); break; 00291 default: fprintf(fp,"*"); 00292 } /* end switch2 */ 00293 } /* every column */ 00294 00295 fprintf(fp,"\n"); 00296 } /*every row*/ 00297 00298 fclose(fp); 00299 fpReserve = fopen( NULL_FILE, "r" ); 00300 00301 return; 00302 } 00303 00304 /* will put a small map with current room desc and title */ 00305 void ShowRoom( CHAR_DATA *ch, int min, int max) 00306 { 00307 int x,y,str_pos=0,desc_pos=0,start; 00308 char buf[500]; 00309 char desc[500]; 00310 char line[100]; 00311 00312 strcpy(desc,ch->in_room->description); 00313 00314 map[min][min]=SECT_MAX;map[max-1][max-1]=SECT_MAX; /* mlk :: rounds edges */ 00315 map[min][max-1]=SECT_MAX;map[max-1][min]=SECT_MAX; 00316 00317 for (x = min; x < max; ++x) 00318 { /* every row */ 00319 for (y = min; y < max; ++y) 00320 { /* every column */ 00321 if ( (y==min) || (map[x][y-1]!=map[x][y]) ) 00322 switch(map[x][y]) 00323 { 00324 case SECT_MAX: send_to_char(" ",ch); break; 00325 case SECT_FOREST: send_to_char("{g@",ch); break; 00326 case SECT_FIELD: send_to_char("{G\"",ch); break; 00327 case SECT_HILLS: send_to_char("{G^",ch); break; 00328 //case SECT_ROAD: send_to_char("{m+",ch); break; 00329 case SECT_MOUNTAIN: send_to_char("{y^",ch); break; 00330 case SECT_WATER_SWIM: send_to_char("{B:",ch); break; 00331 case SECT_WATER_NOSWIM: send_to_char("{b:",ch); break; 00332 case SECT_UNUSED: send_to_char("{DX",ch); break; 00333 case SECT_AIR: send_to_char("{C%",ch); break; 00334 case SECT_DESERT: send_to_char("{Y=",ch); break; 00335 //case SECT_ENTER: send_to_char("{W@",ch); break; 00336 case SECT_INSIDE: send_to_char("{W%",ch); break; 00337 case SECT_CITY: send_to_char("{W#",ch); break; 00338 /*case SECT_ROCK_MOUNTAIN:send_to_char("{D^",ch); break; 00339 case SECT_SNOW_MOUNTAIN:send_to_char("{W^",ch); break; 00340 case SECT_SWAMP: send_to_char("{D&",ch); break; 00341 case SECT_JUNGLE: send_to_char("{g&",ch); break; 00342 case SECT_RUINS: send_to_char("{D#",ch); break;*/ 00343 case (SECT_MAX+1): send_to_char("{D?",ch); break; 00344 default: send_to_char("{R*",ch); 00345 } /* end switch1 */ 00346 else 00347 switch(map[x][y]) 00348 { 00349 case SECT_MAX: send_to_char(" ",ch); break; 00350 case SECT_FOREST: send_to_char("@",ch); break; 00351 case SECT_FIELD: send_to_char("\"",ch); break; 00352 case SECT_HILLS: send_to_char("^",ch); break; 00353 //case SECT_ROAD: send_to_char("+",ch); break; 00354 case SECT_MOUNTAIN: send_to_char("^",ch); break; 00355 case SECT_WATER_SWIM: send_to_char(":",ch); break; 00356 case SECT_WATER_NOSWIM: send_to_char(":",ch); break; 00357 case SECT_UNUSED: send_to_char("X",ch); break; 00358 case SECT_AIR: send_to_char("%",ch); break; 00359 case SECT_DESERT: send_to_char("=",ch); break; 00360 //case SECT_ENTER: send_to_char("@",ch); break; 00361 case SECT_INSIDE: send_to_char("%",ch); break; 00362 case SECT_CITY: send_to_char("#",ch); break; 00363 /*case SECT_ROCK_MOUNTAIN:send_to_char("^",ch); break; 00364 case SECT_SNOW_MOUNTAIN:send_to_char("^",ch); break; 00365 case SECT_SWAMP: send_to_char("&",ch); break; 00366 case SECT_JUNGLE: send_to_char("&",ch); break; 00367 case SECT_RUINS: send_to_char("#",ch); break;*/ 00368 case (SECT_MAX+1): send_to_char("?",ch); break; 00369 default: send_to_char("*",ch); 00370 } /* end switch2 */ 00371 } /* every column */ 00372 00373 if (x==min) { 00374 sprintf(buf,"{x {C%s{x",ch->in_room->name); 00375 send_to_char(buf,ch); 00376 00377 /* mlk :: no brief in wilderness, ascii map is automatic, autoexits off too 00378 if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT) ) { 00379 send_to_char( " {b",ch);do_exits( ch, "auto" );send_to_char( "{x",ch); 00380 } */ 00381 00382 if (IS_IMMORTAL(ch) && (IS_NPC(ch) || IS_SET(ch->act,PLR_HOLYLIGHT))) 00383 { /* for showing certain people room vnum */ 00384 sprintf(buf," {c[Room %d]{x",ch->in_room->vnum); 00385 send_to_char(buf,ch); 00386 } 00387 } 00388 else 00389 { 00390 start=str_pos; 00391 for (desc_pos = desc_pos ; desc[desc_pos]!='\0' ; desc_pos++) 00392 { 00393 if (desc[desc_pos]=='\n') { 00394 line[str_pos-start]='\0';str_pos+=3; 00395 desc_pos += 2; 00396 break; 00397 } 00398 else if (desc[desc_pos]=='\r') { 00399 line[str_pos-start]='\0';str_pos+=2; 00400 break; 00401 } 00402 else { 00403 line[str_pos-start]=desc[desc_pos]; 00404 str_pos+=1; 00405 } 00406 } 00407 /* set the final character to \0 for descs that are longer than 5 lines? */ 00408 line[str_pos-start]='\0'; /* best way to clear string? */ 00409 /* maybe do strcpy(line," "); instead? */ 00410 /* not needed here because the for loops stop at \0 ?? */ 00411 if (x==min+1) send_to_char(" ",ch); 00412 send_to_char(" {c",ch); 00413 send_to_char(line,ch); 00414 send_to_char("{x",ch); 00415 00416 } /*else*/ 00417 00418 send_to_char("\n\r",ch); 00419 } /*every row*/ 00420 00421 send_to_char("\n\r",ch); /* puts a line between contents/people */ 00422 return; 00423 } 00424 00425 void do_map( CHAR_DATA *ch, char *argument ) 00426 { 00427 int size,center,x,y,min,max; 00428 char arg1[10]; 00429 00430 one_argument( argument, arg1 ); 00431 size = atoi (arg1); 00432 00433 size=URANGE(6,size,MAX_MAP); 00434 center=MAX_MAP/2; 00435 00436 min = MAX_MAP/2-size/2; 00437 max = MAX_MAP/2+size/2; 00438 00439 for (x = 0; x < MAX_MAP; ++x) 00440 for (y = 0; y < MAX_MAP; ++y) 00441 map[x][y]=SECT_MAX; 00442 00443 /* starts the mapping with the center room */ 00444 MapArea(ch->in_room, ch, center, center, min-1, max-1); 00445 00446 /* marks the center, where ch is */ 00447 map[center][center]=SECT_MAX+2; /* can be any number above SECT_MAX+1 */ 00448 /* switch default will print out the * */ 00449 00450 if ( (!IS_IMMORTAL(ch))||(IS_NPC(ch)) ) 00451 { 00452 if ( !IS_SET(ch->in_room->room_flags, ROOM_WILDERNESS) ) 00453 {send_to_char("{CYou can not do that here{x.\n\r",ch);return;} 00454 if ( room_is_dark( ch->in_room ) ) 00455 {send_to_char( "{bThe wilderness is pitch black at night... {x\n\r", ch );return;} 00456 else 00457 {ShowRoom(ch,MAX_MAP/2-3,MAX_MAP/2+3);return;} 00458 } 00459 /* mortals not in city, enter or inside will always get a ShowRoom */ 00460 if (IS_IMMORTAL(ch)) { 00461 if (arg1[0]=='\0') ShowRoom (ch, min, max); 00462 else ShowMap (ch, min, max); 00463 return; 00464 } 00465 00466 send_to_char("{CHuh?{x\n\r",ch); 00467 return; 00468 } 00469 00470 void do_smallmap( CHAR_DATA *ch, char *argument ) 00471 { 00472 int size,center,x,y,min,max; 00473 char arg1[10]; 00474 00475 one_argument( argument, arg1 ); 00476 size = atoi (arg1); 00477 00478 size=URANGE(6,size,MAX_MAP); 00479 center=MAX_MAP/2; 00480 00481 min = MAX_MAP/2-size/2; 00482 max = MAX_MAP/2+size/2; 00483 00484 for (x = 0; x < MAX_MAP; ++x) 00485 for (y = 0; y < MAX_MAP; ++y) 00486 map[x][y]=SECT_MAX; 00487 00488 /* starts the mapping with the center room */ 00489 MapArea(ch->in_room, ch, center, center, min-1, max-1); 00490 00491 /* marks the center, where ch is */ 00492 map[center][center]=SECT_MAX+2; /* can be any number above SECT_MAX+1 */ 00493 /* switch default will print out the * */ 00494 00495 if (IS_IMMORTAL(ch)) { 00496 ShowHalfMap (ch, min, max); 00497 return; 00498 } 00499 00500 send_to_char("{CHuh?{x\n\r",ch); 00501 return; 00502 } 00503 00504 /* mlk :: pass it (SECTOR_XXX,"") and get back the sector ascii 00505 in a roleplaying format of course, not mountain_snow etc */ 00506 char *get_sector_name(int sector) 00507 { 00508 char *sector_name; 00509 00510 sector_name="movement"; 00511 00512 switch (sector) 00513 { 00514 case SECT_FOREST: sector_name="some trees";break; 00515 case SECT_FIELD: sector_name="a field";break; 00516 case SECT_HILLS: sector_name="some rolling hills";break; 00517 //case SECT_ROAD: sector_name="a road";break; 00518 case SECT_WATER_SWIM: sector_name="shallow water";break; 00519 case SECT_WATER_NOSWIM: sector_name="deep water";break; 00520 case SECT_AIR: sector_name="the sky";break; 00521 case SECT_DESERT: sector_name="a lot of sand";break; 00522 case SECT_MOUNTAIN: sector_name="some mountainous terrain";break; 00523 /*case SECT_ROCK_MOUNTAIN:sector_name="a rocky mountain";break; 00524 case SECT_SNOW_MOUNTAIN:sector_name="snow covered mountains";break; 00525 case SECT_SWAMP: sector_name="bleak swampland";break; 00526 case SECT_JUNGLE: sector_name="thick jungle";break; 00527 case SECT_RUINS: sector_name="ruins of some sort";break;*/ 00528 case SECT_INSIDE: sector_name="movement";break; 00529 case SECT_CITY: sector_name="movement";break; 00530 //case SECT_ENTER: sector_name="movement";break; 00531 } /*switch1*/ 00532 00533 return(strdup(sector_name)); 00534 } 00535 00536 /* mlk :: 00537 when given (int array[5]) with vnum in [0], it will return 00538 1 north sector_type, 00539 2 east sector_type, 00540 3 south sector_type, 00541 4 east_sector_type & 00542 5 number of exits leading to rooms of the same sector 00543 */ 00544 int *get_exit_sectors(int *exit_sectors) 00545 { 00546 ROOM_INDEX_DATA *room; 00547 EXIT_DATA *pexit; 00548 int door; 00549 00550 room=get_room_index(exit_sectors[0]); 00551 exit_sectors[4]=0; 00552 00553 for ( door = 0; door < MAX_MAP_DIR; door++ ) 00554 { /* cycles through for each exit */ 00555 if ( 00556 (pexit = room->exit[door]) != NULL 00557 && pexit->u1.to_room != NULL 00558 ) 00559 { 00560 exit_sectors[door]=pexit->u1.to_room->sector_type; 00561 if ((pexit->u1.to_room->sector_type)==(room->sector_type)) 00562 exit_sectors[4]+=1; 00563 } 00564 else 00565 exit_sectors[door]=-1; 00566 } 00567 00568 return(exit_sectors); 00569 } 00570 00571 /* will assign default values for NAME and DESC of wilderness */ 00572 /* 00573 void set_wilderness(CHAR_DATA *ch, char *argument) 00574 { 00575 char arg1[10],name[50],desc[300],buf[MAX_STRING_LENGTH]; 00576 ROOM_INDEX_DATA *room; 00577 int vnum,exit[5],exitsum; 00578 int CHANCE=10; 00579 00580 00581 00582 one_argument( argument, arg1 ); 00583 vnum = atoi (arg1); 00584 00585 if ( argument[0] == '\0' ) { 00586 vnum=(ch->in_room->vnum); 00587 } 00588 00589 room=get_room_index(vnum); 00590 00591 if (!IS_BUILDER(ch,room->area)) 00592 { 00593 send_to_char("Wset: Insufficient Security",ch); 00594 return; 00595 } 00596 00597 if ( !IS_SET(room->room_flags, ROOM_WILDERNESS) ) 00598 return; 00599 00600 exit[0]=vnum; 00601 get_exit_sectors(exit); 00602 exitsum=exit[4]; 00603 switch (room->sector_type) 00604 { 00605 case SECT_FOREST: 00606 00607 strcpy(name,"In a Forest"); 00608 strcpy(desc,"You are in a forest teeming with life. All around are the sure signs of nature."); 00609 if (exitsum==4) { 00610 strcpy(name,"Within a Forest"); 00611 strcpy(desc,"You are deep within in a forest, surrounded on all sides by trees. Dead leaves blanket the ground and the lush canopy prevents much light from getting though."); 00612 } 00613 if 00614 (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 00615 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00616 strcat(desc,buf);strcpy(buf," "); 00617 } 00618 if 00619 (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 00620 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00621 strcat(desc,buf);strcpy(buf," "); 00622 } 00623 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 00624 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00625 strcat(desc,buf);strcpy(buf," "); 00626 } 00627 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 00628 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00629 strcat(desc,buf);strcpy(buf," "); 00630 } 00631 break; 00632 00633 case SECT_FIELD: 00634 00635 strcpy(name,"In a Field"); 00636 strcpy(desc,"You are in a field of grass. Prairie flora and shrubs are \ 00637 scattered throughout adding to the inviting aroma."); 00638 if (exitsum==4) { 00639 strcpy(name,"On the Plains"); 00640 strcpy(desc,"You are on the plains. All around is grass, but not just \ 00641 any grass. Out here it comes in many shapes, sizes, and even colors. \ 00642 Insects fly through the air in occasional swarms."); 00643 } 00644 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 00645 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00646 strcat(desc,buf);strcpy(buf," "); 00647 } 00648 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 00649 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00650 strcat(desc,buf);strcpy(buf," "); 00651 } 00652 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 00653 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00654 strcat(desc,buf);strcpy(buf," "); 00655 } 00656 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 00657 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00658 strcat(desc,buf);strcpy(buf," "); 00659 } 00660 break; 00661 00662 case SECT_HILLS: 00663 strcpy(name,"On a Hill"); 00664 strcpy(desc,"You are on a large and rather high hill. You can see \ 00665 much of the surrounding area in full now more clearly."); 00666 if (exitsum==4) { 00667 strcpy(name,"In the Foothills"); 00668 strcpy(desc,"You are within the highlands. \ 00669 All that surrounds is much of the same. Hills and more hills, rolling \ 00670 across the land. Definitely not the best route of travel. \ 00671 "); 00672 } 00673 if 00674 (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE+20))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 00675 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00676 strcat(desc,buf);strcpy(buf," "); 00677 } 00678 00679 if(((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE+20))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 00680 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00681 strcat(desc,buf);strcpy(buf," "); 00682 } 00683 00684 if(((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE+20))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 00685 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00686 strcat(desc,buf);strcpy(buf," "); 00687 } 00688 00689 if(((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE+20))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 00690 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00691 strcat(desc,buf);strcpy(buf," "); 00692 } 00693 break; 00694 00695 case SECT_ROAD: 00696 strcpy(name,"A Road"); 00697 strcpy(desc,"You are on a dirt road. Being an easier and much safer \ 00698 way to travel, many would not think of leaving the safety of the road. \ 00699 Hence it is somewhat highly trafficked. \ 00700 "); 00701 if (exitsum==4) { 00702 strcpy(name,"At a Four Way"); 00703 strcpy(desc,"\ 00704 You are at a four way on the road. There are roads in every direction. \ 00705 The dirt road is trod down pretty well here and equally so in each \ 00706 direction. \ 00707 "); 00708 } 00709 else if (exitsum==3) { 00710 strcpy(name,"At a Fork in the Road"); 00711 strcpy(desc,"You are at a fork in the road, there are two paths to \ 00712 choose from and no indication whatsoever which would be best. \ 00713 "); 00714 } 00715 else if (exitsum==2) { 00716 strcpy(name,"A Road"); 00717 strcpy(desc,"You are on a dirt road. Being an easier and much safer \ 00718 way to travel, many would not think of leaving the safety of the road. \ 00719 "); 00720 if (exit[0]==SECT_ROAD) { 00721 sprintf(buf,"The road continues north and "); 00722 strcat(desc,buf);strcpy(buf," "); 00723 if (exit[1]==SECT_ROAD) { 00724 sprintf(buf,"east."); 00725 strcat(desc,buf);strcpy(buf," ");break; 00726 } 00727 if (exit[2]==SECT_ROAD) { 00728 sprintf(buf,"south."); 00729 strcat(desc,buf);strcpy(buf," ");break; 00730 } 00731 if (exit[3]==SECT_ROAD) { 00732 sprintf(buf,"west."); 00733 strcat(desc,buf);strcpy(buf," ");break; 00734 } 00735 } 00736 if (exit[1]==SECT_ROAD) { 00737 sprintf(buf,"The road continues east and "); 00738 strcat(desc,buf);strcpy(buf," "); 00739 if (exit[0]==SECT_ROAD) { 00740 sprintf(buf,"north."); 00741 strcat(desc,buf);strcpy(buf," ");break; 00742 } 00743 if (exit[2]==SECT_ROAD) { 00744 sprintf(buf,"south."); 00745 strcat(desc,buf);strcpy(buf," ");break; 00746 } 00747 if (exit[3]==SECT_ROAD) { 00748 sprintf(buf,"west."); 00749 strcat(desc,buf);strcpy(buf," ");break; 00750 } 00751 } 00752 if (exit[2]==SECT_ROAD) { 00753 sprintf(buf,"The road continues south and "); 00754 strcat(desc,buf);strcpy(buf," "); 00755 if (exit[0]==SECT_ROAD) { 00756 sprintf(buf,"north."); 00757 strcat(desc,buf);strcpy(buf," ");break; 00758 } 00759 if (exit[1]==SECT_ROAD) { 00760 sprintf(buf,"east."); 00761 strcat(desc,buf);strcpy(buf," ");break; 00762 } 00763 if (exit[3]==SECT_ROAD) { 00764 sprintf(buf,"west."); 00765 strcat(desc,buf);strcpy(buf," ");break; 00766 } 00767 } 00768 if (exit[3]==SECT_ROAD) { 00769 sprintf(buf,"The road continues west and "); 00770 strcat(desc,buf);strcpy(buf," "); 00771 if (exit[1]==SECT_ROAD) { 00772 sprintf(buf,"east."); 00773 strcat(desc,buf);strcpy(buf," ");break; 00774 } 00775 if (exit[2]==SECT_ROAD) { 00776 sprintf(buf,"south."); 00777 strcat(desc,buf);strcpy(buf," ");break; 00778 } 00779 if (exit[0]==SECT_ROAD) { 00780 sprintf(buf,"north."); 00781 strcat(desc,buf);strcpy(buf," ");break; 00782 } 00783 00784 } 00785 00786 if 00787 (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE-20))||(exit[0]==SECT_RUINS)||(exit[0]!=SECT_ROAD)) { 00788 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00789 strcat(desc,buf);strcpy(buf," "); 00790 } 00791 if 00792 (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE-20))||(exit[1]==SECT_RUINS)||(exit[1]!=SECT_ROAD)){ 00793 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00794 strcat(desc,buf);strcpy(buf," "); 00795 } 00796 if 00797 (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE-20))||(exit[2]==SECT_RUINS)||(exit[2]!=SECT_ROAD)){ 00798 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00799 strcat(desc,buf);strcpy(buf," "); 00800 } 00801 if 00802 (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE-20))||(exit[3]==SECT_RUINS)||(exit[3]!=SECT_ROAD)){ 00803 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00804 strcat(desc,buf);strcpy(buf," "); 00805 } 00806 break; 00807 00808 case SECT_WATER_SWIM: 00809 strcpy(name,"Shallow Water"); 00810 strcpy(desc,"The water here is rather shallow. You can see many little fish in the water, speeding to and fro in schools."); 00811 if (exitsum==4) { 00812 strcpy(name,"Shallow Basin"); 00813 strcpy(desc,"You are surrounded by shallow water. All around in the water affluent marine life comes through, giving quite a show with the occasional leap above the waters surface. "); 00814 } 00815 if (exitsum==2) { 00816 strcpy(name,"Shallow Water"); 00817 strcpy(desc,"You are on shallow water. All around in the water affluent marine life comes through, giving quite a show with the occasional leap above the waters surface. "); 00818 } 00819 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 00820 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00821 strcat(desc,buf);strcpy(buf," "); 00822 } 00823 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 00824 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00825 strcat(desc,buf);strcpy(buf," "); 00826 } 00827 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 00828 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00829 strcat(desc,buf);strcpy(buf," "); 00830 } 00831 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 00832 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00833 strcat(desc,buf);strcpy(buf," "); 00834 } 00835 00836 break; 00837 00838 case SECT_WATER_NOSWIM: 00839 strcpy(name,"Deep Water"); 00840 strcpy(desc,"The water here is of unknown depth and fairly dark.\ 00841 The currents here are strong and the waves equally striking.\ 00842 "); 00843 if (exitsum==4) { 00844 strcpy(name,"On a Sea"); 00845 strcpy(desc,"You are on a dark sea, surrounded completely by more of the same. \ 00846 Denizens of this dark water occasionaly make themselves seen \ 00847 out of curiousity, or perhaps necessity. \ 00848 "); 00849 } 00850 if (exitsum==2) { 00851 strcpy(name,"On Deep Water"); 00852 strcpy(desc,"The water is is rather dark and \ 00853 not terribly temperate. However, it seems very clean. \ 00854 "); 00855 } 00856 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 00857 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00858 strcat(desc,buf);strcpy(buf," "); 00859 } 00860 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 00861 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00862 strcat(desc,buf);strcpy(buf," "); 00863 } 00864 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 00865 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00866 strcat(desc,buf);strcpy(buf," "); 00867 } 00868 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 00869 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00870 strcat(desc,buf);strcpy(buf," "); 00871 } 00872 00873 break; 00874 00875 case SECT_AIR: 00876 strcpy(name,"In the Air"); 00877 strcpy(desc,"You are in the air."); 00878 if (exitsum==4) { 00879 strcpy(name,"In the Air"); 00880 strcpy(desc,"\ 00881 You are in the air, completed surrounded by more air. Wisps of cloud-like \ 00882 moisture blows by and droplets of water condense in fatal collision with \ 00883 one another.\ 00884 "); 00885 } 00886 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 00887 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00888 strcat(desc,buf);strcpy(buf," "); 00889 } 00890 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 00891 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00892 strcat(desc,buf);strcpy(buf," "); 00893 } 00894 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 00895 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00896 strcat(desc,buf);strcpy(buf," "); 00897 } 00898 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 00899 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00900 strcat(desc,buf);strcpy(buf," "); 00901 } 00902 break; 00903 00904 case SECT_DESERT: 00905 strcpy(name,"Desert Wasteland"); 00906 strcpy(desc,"You are surrounded by sand dunes. The occasional blooming \ 00907 cactus and sandstone formation give the land a simple beauty.\ 00908 "); 00909 if (exitsum==4) { 00910 strcpy(name,"Deep Within the Desert"); 00911 strcpy(desc,"\ 00912 You are deep within a barren desert. Sand swept by the chaotic winds forms \ 00913 sand dunes that stretch on seemingly forever. The shadow of overhead \ 00914 vultures indirectly warn of the danger in this place.\ 00915 "); 00916 } 00917 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 00918 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00919 strcat(desc,buf);strcpy(buf," "); 00920 } 00921 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 00922 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00923 strcat(desc,buf);strcpy(buf," "); 00924 } 00925 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 00926 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00927 strcat(desc,buf);strcpy(buf," "); 00928 } 00929 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 00930 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00931 strcat(desc,buf);strcpy(buf," "); 00932 } 00933 break; 00934 00935 case SECT_MOUNTAIN: 00936 strcpy(name,"On a Mountain"); 00937 strcpy(desc,"You are on a tranquil mountain. Though not even remotely \ 00938 dangerous, this land has its share of cliffs and gorges. \ 00939 "); 00940 if (exitsum==4) { 00941 strcpy(name,"In the Mountains"); 00942 strcpy(desc,"You are deep within the mountains. An occasional cliff \ 00943 add to the illusory nature of this once buried rock. Yet, nature still \ 00944 makes every use of the land here. Trees, shrubs and hardy animal all \ 00945 make their lives here. \ 00946 "); 00947 } 00948 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 00949 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00950 strcat(desc,buf);strcpy(buf," "); 00951 } 00952 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 00953 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00954 strcat(desc,buf);strcpy(buf," "); 00955 } 00956 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 00957 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00958 strcat(desc,buf);strcpy(buf," "); 00959 } 00960 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 00961 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00962 strcat(desc,buf);strcpy(buf," "); 00963 } 00964 break; 00965 00966 case SECT_ROCK_MOUNTAIN: 00967 strcpy(name,"On a Mountain of Rock"); 00968 strcpy(desc,"You are on a dangerous mountain. \ 00969 The rock juts from the ground like a broken bone from skin, \ 00970 and is just as jagged and dangerous. \ 00971 "); 00972 if (exitsum==4) { 00973 strcpy(name,"Within Dangerous Mountains"); 00974 strcpy(desc,"You are withing a dangerous rocky mountain range. There \ 00975 is no way to see a way out from here. Travel in any direction would either \ 00976 have you climbing a rocky cliff or falling down one. \ 00977 "); 00978 } 00979 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 00980 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 00981 strcat(desc,buf);strcpy(buf," "); 00982 } 00983 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 00984 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 00985 strcat(desc,buf);strcpy(buf," "); 00986 } 00987 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 00988 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 00989 strcat(desc,buf);strcpy(buf," "); 00990 } 00991 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 00992 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 00993 strcat(desc,buf);strcpy(buf," "); 00994 } 00995 break; 00996 00997 case SECT_SNOW_MOUNTAIN: 00998 strcpy(name,"On a Snowy Peak"); 00999 strcpy(desc,"You are on a desolate snowy mountain. It is freezing cold \ 01000 here and devoid of all life, except your own. However, even that could \ 01001 change in the blink of an eye here. If not by the gold then by a snowy \ 01002 crevasse or avalanche. \ 01003 "); 01004 if (exitsum==4) { 01005 strcpy(name,"Within Snowy Mountains"); 01006 strcpy(desc,"You are on a desolate snowy mountain. It is freezing cold \ 01007 here and devoid of all life, except your own. However, even that could \ 01008 be changed. If not by the cold then by a icy \ 01009 crevasse or avalanche. \ 01010 "); 01011 } 01012 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 01013 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 01014 strcat(desc,buf);strcpy(buf," "); 01015 } 01016 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 01017 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 01018 strcat(desc,buf);strcpy(buf," "); 01019 } 01020 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 01021 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 01022 strcat(desc,buf);strcpy(buf," "); 01023 } 01024 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 01025 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 01026 strcat(desc,buf);strcpy(buf," "); 01027 } 01028 break; 01029 01030 case SECT_SWAMP: 01031 strcpy(name,"Swamps Edge"); 01032 strcpy(desc,"You are in a dank swamps edge. The smell and humidity make 01033 this a repelling place to say the least. 01034 "); 01035 if (exitsum==4) { 01036 strcpy(name,"Swampland"); 01037 strcpy(desc,"You are in a dank swampland. All around is murky water \ 01038 and decadent mud. Occasional trees and grass mar this sickeningly beautiful \ 01039 work of nature. \ 01040 "); 01041 } 01042 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 01043 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 01044 strcat(desc,buf);strcpy(buf," "); 01045 } 01046 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 01047 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 01048 strcat(desc,buf);strcpy(buf," "); 01049 } 01050 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 01051 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 01052 strcat(desc,buf);strcpy(buf," "); 01053 } 01054 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 01055 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 01056 strcat(desc,buf);strcpy(buf," "); 01057 } 01058 break; 01059 01060 case SECT_JUNGLE: 01061 strcpy(name,"At a Jungle"); 01062 strcpy(desc,"You are at the edge of a jungle. An assortment of rare and 01063 unique plant life grow in abundance here, making it nearly impassable. \ 01064 "); 01065 if (exitsum==4) { 01066 strcpy(name,"Within a Jungle"); 01067 strcpy(desc,"You are deep within in a jungle, \ 01068 surrounded by extravagant tropical fauna. It seems there is no way out \ 01069 and no end to the wall of plant life in every direction. \ 01070 "); 01071 } 01072 if (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)||(exit[0]==SECT_RUINS)){ 01073 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 01074 strcat(desc,buf);strcpy(buf," "); 01075 } 01076 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)||(exit[1]==SECT_RUINS)){ 01077 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 01078 strcat(desc,buf);strcpy(buf," "); 01079 } 01080 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)||(exit[2]==SECT_RUINS)){ 01081 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 01082 strcat(desc,buf);strcpy(buf," "); 01083 } 01084 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)||(exit[3]==SECT_RUINS)){ 01085 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 01086 strcat(desc,buf);strcpy(buf," "); 01087 } 01088 break; 01089 01090 case SECT_RUINS: 01091 strcpy(name,"A Ruin"); 01092 strcpy(desc,"You have stumbled upon something of yore."); 01093 if (exitsum==4) { 01094 strcpy(name,"Some Ruins"); 01095 strcpy(desc,"You have managed to find some ruins."); 01096 } 01097 if 01098 (((exit[0]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[0]==SECT_ROAD)){ 01099 sprintf(buf,"You see %s to the north.",get_sector_name(exit[0])); 01100 strcat(desc,buf);strcpy(buf," "); 01101 } 01102 if (((exit[1]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[1]==SECT_ROAD)){ 01103 sprintf(buf,"To the east you can see %s.",get_sector_name(exit[1])); 01104 strcat(desc,buf);strcpy(buf," "); 01105 } 01106 if (((exit[2]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[2]==SECT_ROAD)){ 01107 sprintf(buf,"South of you, you can see %s.",get_sector_name(exit[2])); 01108 strcat(desc,buf);strcpy(buf," "); 01109 } 01110 if (((exit[3]!=(room->sector_type))&&(number_percent()<CHANCE))||(exit[3]==SECT_ROAD)){ 01111 sprintf(buf,"%s can be seen to the west.",get_sector_name(exit[3])); 01112 strcat(desc,buf);strcpy(buf," "); 01113 } 01114 break; 01115 } 01116 01117 SET_BIT( ch->in_room->area->area_flags, AREA_CHANGED ); 01118 01119 free_string( room->name ); 01120 room->name = str_dup( name ); 01121 01122 free_string( room->description ); 01123 room->description= str_dup ( desc ); 01124 01125 format_string(room->description); 01126 01127 return; 01128 } 01129 01130 01131 void do_set_wilderness_all(CHAR_DATA *ch, char *argument) 01132 { 01133 ROOM_INDEX_DATA *room; 01134 int start,end,current; 01135 start=20001; 01136 end =29600; 01137 01138 room=get_room_index(start); 01139 01140 if (!IS_BUILDER(ch,room->area)) 01141 { 01142 send_to_char("Wset_all: Insufficient Security",ch); 01143 return; 01144 } 01145 01146 for (current=start ; current <= end ; current++) 01147 { 01148 01149 room=get_room_index(current); 01150 char_to_room( ch, room ); 01151 set_wilderness(ch,""); 01152 char_from_room( ch ); 01153 01154 } 01155 01156 char_to_room( ch, room ); 01157 01158 return; 01159 } 01160 01161 */
1.4.0