/*
* Randomised name creation.
*/
void name_replacer(char *format, char *first, char *last, char *out)
{
char buf[MSL]={'\0'};
char *str;
char *i;
char *point;
if(format == NULL)
return;
point = buf;
str = str_dup(format);
// we should never reach this if format is null.
if(str == NULL)
return;
/* replace $f with first and $l with last. */
while ( *str != '\0' )
{
if ( *str != '$' )
{
*point++ = *str++;
continue;
}
++str;
switch ( *str )
{
default: bug( "[*****] BUG: Rand_name: bad code %d.", *str );
i = " Dave "; break;
case 'f': i = first;
break;
case 'l': i = last;
break;
case ' ': i = "$";
break;
case '$': i = "$";
break;
}
++str;
while ( ( *point = *i ) != '\0' )
++point, ++i;
}
*point++ = '\0';
/* Removed to try to fix name changing bug.
return str_dup(buf);
*/
strcpy(out, buf);
return;
}
#define MAX_NAMES 103
char* male_names [MAX_NAMES] =
{
"Michael", "Matthew", "Nicholas", "Christopher", "Joshua", "Austin", "Tyler", "Brandon",
"Joseph", "Andrew", "Daniel", "Ryan", "Zachary", "Anthony", "Dylan", "David", "Jonathan",
"William", "James", "John", "Alexander", "Justin", "Jordan", "Noah", "Robert", "Brian",
"Jose", "Steven", "Kyle", "Kevin", "Christian", "Samuel", "Eric", "Benjamin", "Thomas",
"Hunter", "Ethan", "Sean", "Devin", "Cameron", "Nathan", "Aaron", "Caleb", "Connor", "Cody",
"Jason", "Luis", "Timothy", "Isaac", "Adam", "Jared", "Charles", "Richard", "Gabriel",
"Mark", "Jack", "Isaiah", "Juan", "Logan", "Alex", "Antonio", "Carlos", "Elijah", "Jesse",
"Brendan", "Patrick", "Luke", "Angel", "Dakota", "Lucas", "Chase", "Cole", "Seth",
"Nathaniel", "Jeremy", "Alejandro", "Ian", "Tristan", "Jeffrey", "Jake", "Garrett",
"Victor", "Jackson", "Marcus", "Trevor", "Bradley", "Brett", "Bryce", "Adrian", "Evan",
"Gavin", "Paul", "Tanner", "Colton", "Dalton", "Kenneth", "Spencer", "Xavier", "Peter",
"Dave", "Mick", "Matt", "Bernard"
};
char* female_names [MAX_NAMES] =
{
"Emily", "Sarah", "Brianna", "Samantha", "Hailey", "Ashley", "Kaitlyn", "Madison", "Hannah",
"Alexis", "Jessica", "Alyssa", "Abigail", "Kayla", "Megan", "Katherine", "Taylor",
"Elizabeth", "Makayla", "Rachel", "Jasmine", "Olivia", "Victoria", "Emma", "Anna",
"Rebecca", "Natalie", "Courtney", "Lauren", "Sydney", "Amanda", "Nicole", "Destiny", "Stephanie", "Morgan", "Julia", "Sierra", "Brittany", "Grace", "Danielle", "Jennifer",
"Kaylee", "Mackenzie", "Alexandra", "Savannah", "Amber", "Jordan", "Kylie", "Shelby",
"Christina", "Jacqueline", "Gabriella", "Maria", "Erica", "Gabrielle", "Madeline", "Erin",
"Mary", "Marissa", "Andrea", "Vanessa", "Kimberly", "Michelle", "Riley", "Brooke", "Bailey",
"Kiara", "Cassandra", "Chloe", "Sophia", "Alexandria", "Cassidy", "Kelly", "Melissa",
"Kelsey", "Laura", "Miranda", "Jade", "Paige", "Sabrina", "Casey", "Molly", "Katie",
"Alicia", "Isabel", "Leslie", "Lily", "Alexa", "Caroline", "Mariah", "Jenna", "Angela",
"Veronica", "Chelsea", "Autumn", "Diana", "Faith", "Shannon", "Bethany", "Bianca",
"Stacey", "Magrat", "Sarah"
};
char* last_names [MAX_NAMES] =
{
"Smith", "Johnson", "Williams", "Brown", "Davis", "Miller", "Wilson", "Moore", "Taylor",
"Morrison", "Black", "White", "Grossman", "Thall", "Finklestein", "Bevill", "McGuinn",
"Olson", "Wiater", "Convey", "Sabaitis", "Brothers", "Kotiw", "Carraway", "Jennings",
"Major", "Watts", "Bendig", "Abbott", "Abene", "Zurek", "Zarov", "Yurchak", "Vogt", "Ulum",
"Tzanetopoulos", "Turner", "Swanson", "Strong", "Stoffer", "Rozen", "Roy", "Rosenthal",
"RoonieQuinn", "Qazi", "Putman", "Pulman", "Pruitt", "Overstreet", "Owen", "Nutile",
"Norman", "Noelle", "Musso", "Mulvihill", "Morgan", "Mitchels", "Lynn", "Luber", "Liva",
"Krueger", "Kozlowski", "Koffmann", "June", "Jones", "Jensen", "Isztok", "Hutchins",
"Hughes", "Howard", "Griffin", "Green", "Greenan", "Gould", "Giles", "Froemel", "Flynn",
"Fishman", "Esposito", "Emerson", "Edgeson", "Drozd", "Downs", "Dohra", "Curley", "Crosby",
"Coote", "Collins", "Burger", "Bruns", "Blunt", "Blackmond", "Barnett", "Fitzgerald",
"Wood", "Smyth", "Stryker", "Sweet", "Sutherland", "Cohen",
"Dredd", "O'Reily", "Kilborn"
};
char *name_select(char *table[MAX_NAMES])
{
int i;
char *a;
i = number_range(0, MAX_NAMES - 1);
/* Removed to try to fix name changing bug.
a = str_dup(table[i]);
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*/
a = table[i];
return a;
}
void rand_name(CHAR_DATA *ch)
{
char *first;
char *last;
char out[4*MSL]={'\0'};
if(ch->sex == SEX_FEMALE)
{
first = name_select(female_names);
last = name_select(last_names);
}
else
{
first = name_select(male_names);
last = name_select(last_names);
}
PURGE_DATA(ch->name);
name_replacer(ch->pIndexData->player_name, first, last, out);
ch->name = str_dup(out);
PURGE_DATA(ch->short_descr);
name_replacer(ch->pIndexData->short_descr, first, last, out);
ch->short_descr = str_dup(out);
PURGE_DATA(ch->long_descr);
name_replacer(ch->pIndexData->long_descr, first, last, out);
ch->long_descr = str_dup(out);
PURGE_DATA(ch->description);
name_replacer(ch->pIndexData->description, first, last, out);
ch->description = str_dup(out);
}
int size_of(char *arr[]) {
int size = 0;
while (arr[size] != NULL) size++;
return size;
}
char *one_of(char *arr[]) {
return arr[number(0, size_of(arr)-2)];
}
/* Bedlam mercenary random personal names */
void name_the_mercenaries(int merc_room) {
static char *merc_syl_closed[] = { "gob", "gup", "gad", "got", "dan", "sil", "ban", "vig", "zom", "rak", "dob", "mag", "tog", "vat", "gam",
"bok", "jok", "rok", "mek", "dim", "ris", "tok", "tan", "tor", "mar", "mor", "vig", "rem",
"sal", "sel", "les", "rit", "vel", "vir", "lin", "don", "dar", "dir", "mir", "lir",
"ties", "mael", "fein", "man", "fin", "dyr", "lyr", "nyr", "vyr", NULL };
static char *merc_syl_open[] = { "ara", "arca", "anka", "eva", "ena", "ega", "oma", "ik", "era", "ida",
"oda", "ami", "oka", "ipa", "ina", "osa", "abi", "ea", "ai", "amai",
"ata", "isa", "ira", "ara", "ala", "ela", "ula", "asa", "esa", "eta", NULL };
static char *merc_syl_edge[] = { "p", "n", "m", "k", "s", "t", "u", "z", "r", "b", "g", "l", "t", "f", "x", NULL };
static char *merc_syl_opening[] = { "sa", "mi", "fa", "li", "fe", "si", "bri", "ty", "ly", NULL };
static char *merc_syl_closing[] = { "af", "ip", "es", "il", "am", "in", "an", "ir", "el", "et", "yl", NULL };
struct char_data *merc;
char *name;
for (merc = world[merc_room].people; merc; merc = merc->next_in_room) {
name = strdup("");
if (GET_SEX(merc) == SEX_MALE) {
if (!number(0, 2)) {
strcat(name, one_of(merc_syl_open));
strcat(name, one_of(merc_syl_edge));
strcat(name, one_of(merc_syl_closing));
}
else if (!number(0, 1)) {
strcat(name, one_of(merc_syl_closing));
strcat(name, one_of(merc_syl_open));
strcat(name, one_of(merc_syl_edge));
}
else {
if (number(0, 1)) strcat(name, one_of(merc_syl_edge));
strcat(name, one_of(merc_syl_open));
if (number(0, 3))
strcat(name, one_of(merc_syl_closed));
else
strcat(name, one_of(merc_syl_edge));
}
}
else {
if (!number(0, 3)) {
strcat(name, one_of(number(0, 1)?merc_syl_closed:merc_syl_edge));
strcat(name, one_of(merc_syl_open));
}
else if (!number(0, 2)) {
strcat(name, one_of(merc_syl_opening));
strcat(name, one_of(merc_syl_edge));
strcat(name, one_of(merc_syl_open));
}
else if (!number(0, 1)) {
strcat(name, one_of(merc_syl_edge));
strcat(name, one_of(merc_syl_closing));
strcat(name, one_of(merc_syl_open));
}
else {
strcat(name, one_of(merc_syl_opening));
strcat(name, one_of(merc_syl_open));
}
}
free(GET_MNAME(merc));
free(GET_MSHORT(merc));
free(GET_MLONG(merc));
sprintf(buf, "mercenary %s", name);
GET_MNAME(merc) = strdup(buf);
sprintf(buf, "%s the Mercenary", CAP(name));
GET_MSHORT(merc) = strdup(buf);
sprintf(buf, "%s is here.\r\n", GET_MSHORT(merc));
GET_MLONG(merc) = strdup(buf);
free(name);
}
}
int size_of(char *arr[])
{
int size = 0;
while (arr[size] != NULL) size++;
return size;
}
char *one_of(char *arr[])
{
return arr[number_range(0, size_of(arr)-2)];
}
/* Code derived from Bedlam's mercenary random personal names by Diablos of/for End of Time (eotmud.com:4000) */
char *generate_name(int gender, int type)
{
static char *standard_syl_closed[] = { "gob", "gup", "gad", "got", "dan", "sil", "ban", "vig", "zom", "rak", "dob", "mag", "tog", "vat", "gam",
"bok", "jok", "rok", "mek", "dim", "ris", "tok", "tan", "tor", "mar", "mor", "vig", "rem",
"sal", "sel", "les", "rit", "vel", "vir", "lin", "don", "dar", "dir", "mir", "lir",
"ties", "mael", "fein", "man", "fin", "dyr", "lyr", "nyr", "vyr", NULL };
static char *standard_syl_open[] = { "ara", "arca", "anka", "eva", "ena", "ega", "oma", "ik", "era", "ida",
"oda", "ami", "oka", "ipa", "ina", "osa", "abi", "ea", "ai", "amai",
"ata", "isa", "ira", "ara", "ala", "ela", "ula", "asa", "esa", "eta", NULL };
static char *standard_syl_edge[] = { "p", "n", "m", "k", "s", "t", "u", "z", "r", "b", "g", "l", "t", "f", "x", NULL };
static char *standard_syl_opening[] = { "sa", "mi", "fa", "li", "fe", "si", "bri", "ty", "ly", NULL };
static char *standard_syl_closing[] = { "af", "ip", "es", "il", "am", "in", "an", "ir", "el", "et", "yl", NULL };
static char *fantasy_syl_closed[] = { "ban", "bar", "cut", "dan", "dar", "del", "der", "fin", "jed", "kan", "kar", "ker", "mar", "mer", "van", "var", "tyr",
"bet", "cut", "tor", "ris", "tok", "vel", "lin", "lyr", "vyr", "beth", "bett", "dell", "kurr", "tsal", "tser", "tsir", NULL };
static char *fantasy_syl_open[] = { "ina", "ala", "aelle", "oro", "ara", "ona", "ola", "asa", "ora", "aera", "ana", NULL };
static char *fantasy_syl_edge[] = { "l", "n", "r", "s", "m", "w", "x", "d", NULL };
static char *fantasy_syl_opening[] = { "ly", "we", "la", "fa", "ja", "jo", "mo", "lo", "de", "da", NULL };
static char *fantasy_syl_closing[] = { "an", "ar", "or", "al", "en", "eo", "el", "ol", "ess", "in", "il", NULL };
static char *norse_syl_closed[] = { "nid", "heim", "far", "mir", "nar", "nir", "rir", "sil", "sir", "ttir", "gud", "hag", "jot", "jut", "tun", "var", "tys", "vol", "ygg",
"nar", "din", "tal", "gar", NULL };
static char *norse_syl_open[] = { "ala", "ae", "ali", "iva", "aea", "ana", "oda", "odi", "olu", NULL };
static char *norse_syl_edge[] = { "h", "g", "v", "t", "r", "d", "n", "s", "n", NULL };
static char *norse_syl_opening[] = { "bi", "fe", "ha", "jo", "ma", "mu", "nu", "ta", "va", "vo", "da", NULL };
static char *norse_syl_closing[] = { "ad", "ald", "agr", "ar", "ard", "eyr", "far", "heim", "ar", "ir", "urd", "an", "yr", "al", "in", "agg", NULL };
static char *celtic_syl_closed[] = { "dan", "del", "mor", "nem", "rig", "ren", "fig", "nan", "lun", "leg", "fyn", "lyn", "myn", "tal", "wyn", "del", "ker", "wyr",
"kyn", "kel", "kyl", "cil", "cal", NULL };
static char *celtic_syl_open[] = { "ae", "ela", "ora", "io", "ama", "eka", "oka", "ala", "ola", NULL };
static char *celtic_syl_edge[] = { "r", "g", "k", "l", "w", "y", "f", NULL };
static char *celtic_syl_opening[] = { "ra", "ka", "la", "fi", "so", "re", "do", "li", "io", "nae", "fae", "mae", "tae", NULL };
static char *celtic_syl_closing[] = { "ig", "ach", "eth", "ed", "em", "og", "or", "orn", "yn", "gus", "aid", "ain", "an", NULL };
static char *dwarven_syl_closed[] = { "bom", "dar", "gar", "gim", "jor", "kil", "mar", "nal", "ras", "ren", "tar", "tel", "wer", "von", "wer", "yur",
"rok", "nok", "lok", "fon", "fin", "nik", "rit", "tin", "vad", "fun", "tal", "vad", NULL };
static char *dwarven_syl_open[] = { "aka", "ara", "ono", "efa", "uga", "uri", "uda", NULL };
static char *dwarven_syl_edge[] = { "k", "r", "t", "n", "y", "s", NULL };
static char *dwarven_syl_opening[] = { "ga", "da", "ra", "ka", "ty", "ry", "gu", NULL };
static char *dwarven_syl_closing[] = { "et", "ur", "ek", "al", "as", "ar", NULL };
char *name;
int number = 0;
number = number_range(1,3);
name = strdup("");
if (gender == 1)
{
if (number == 3)
{
if(type == 1) // standard
{
strcat(name, one_of(standard_syl_open));
strcat(name, one_of(standard_syl_edge));
strcat(name, one_of(standard_syl_closing));
}
else if(type == 2) // fantasy
{
strcat(name, one_of(fantasy_syl_open));
strcat(name, one_of(fantasy_syl_edge));
strcat(name, one_of(fantasy_syl_closing));
}
else if(type == 3) // norse
{
strcat(name, one_of(norse_syl_open));
strcat(name, one_of(norse_syl_edge));
strcat(name, one_of(norse_syl_closing));
}
else if(type == 4) // celtic
{
strcat(name, one_of(celtic_syl_open));
strcat(name, one_of(celtic_syl_edge));
strcat(name, one_of(celtic_syl_closing));
}
else if(type == 5) // dwarven
{
strcat(name, one_of(dwarven_syl_open));
strcat(name, one_of(dwarven_syl_edge));
strcat(name, one_of(dwarven_syl_closing));
}
}
else if (number == 2)
{
if(type == 1) // standard
{
strcat(name, one_of(standard_syl_closing));
strcat(name, one_of(standard_syl_open));
strcat(name, one_of(standard_syl_edge));
}
else if(type == 2) // fantasy
{
strcat(name, one_of(fantasy_syl_closing));
strcat(name, one_of(fantasy_syl_open));
strcat(name, one_of(fantasy_syl_edge));
}
else if(type == 3) // norse
{
strcat(name, one_of(norse_syl_closing));
strcat(name, one_of(norse_syl_open));
strcat(name, one_of(norse_syl_edge));
}
else if(type == 4) // celtic
{
strcat(name, one_of(celtic_syl_closing));
strcat(name, one_of(celtic_syl_open));
strcat(name, one_of(celtic_syl_edge));
}
else if(type == 5) // dwarven
{
strcat(name, one_of(dwarven_syl_closing));
strcat(name, one_of(dwarven_syl_open));
strcat(name, one_of(dwarven_syl_edge));
}
}
else
{
if(type == 1) // standard
{
if (number == 1) strcat(name, one_of(standard_syl_edge));
strcat(name, one_of(standard_syl_open));
if (number == 3)
strcat(name, one_of(standard_syl_closed));
else
strcat(name, one_of(standard_syl_edge));
}
else if(type == 2) // fantasy
{
if (number == 1) strcat(name, one_of(fantasy_syl_edge));
strcat(name, one_of(fantasy_syl_open));
if (number == 3)
strcat(name, one_of(fantasy_syl_closed));
else
strcat(name, one_of(fantasy_syl_edge));
}
else if(type == 3) // norse
{
if (number == 1) strcat(name, one_of(norse_syl_edge));
strcat(name, one_of(norse_syl_open));
if (number == 3)
strcat(name, one_of(norse_syl_closed));
else
strcat(name, one_of(norse_syl_edge));
}
else if(type == 4) // celtic
{
if (number == 1) strcat(name, one_of(celtic_syl_edge));
strcat(name, one_of(celtic_syl_open));
if (number == 3)
strcat(name, one_of(celtic_syl_closed));
else
strcat(name, one_of(celtic_syl_edge));
}
else if(type == 5) // dwarven
{
if (number == 1) strcat(name, one_of(dwarven_syl_edge));
strcat(name, one_of(dwarven_syl_open));
if (number == 3)
strcat(name, one_of(dwarven_syl_closed));
else
strcat(name, one_of(dwarven_syl_edge));
}
}
}
else
{
if (number == 3)
{
if(type == 1) // standard
{
strcat(name, one_of(number == 1?standard_syl_closed:standard_syl_edge));
strcat(name, one_of(standard_syl_open));
}
else if(type == 2) // fantasy
{
strcat(name, one_of(number == 1?fantasy_syl_closed:fantasy_syl_edge));
strcat(name, one_of(fantasy_syl_open));
}
else if(type == 3) // norse
{
strcat(name, one_of(number == 1?norse_syl_closed:norse_syl_edge));
strcat(name, one_of(norse_syl_open));
}
else if(type == 4) // celtic
{
strcat(name, one_of(number == 1?celtic_syl_closed:celtic_syl_edge));
strcat(name, one_of(celtic_syl_open));
}
else if(type == 5) // dwarven
{
strcat(name, one_of(number == 1?dwarven_syl_closed:dwarven_syl_edge));
strcat(name, one_of(dwarven_syl_open));
}
}
else if (number == 2)
{
if(type == 1) // standard
{
strcat(name, one_of(standard_syl_opening));
strcat(name, one_of(standard_syl_edge));
strcat(name, one_of(standard_syl_open));
}
else if(type == 2) // fantasy
{
strcat(name, one_of(fantasy_syl_opening));
strcat(name, one_of(fantasy_syl_edge));
strcat(name, one_of(fantasy_syl_open));
}
else if(type == 3) // norse
{
strcat(name, one_of(norse_syl_opening));
strcat(name, one_of(norse_syl_edge));
strcat(name, one_of(norse_syl_open));
}
else if(type == 4) // celtic
{
strcat(name, one_of(celtic_syl_opening));
strcat(name, one_of(celtic_syl_edge));
strcat(name, one_of(celtic_syl_open));
}
else if(type == 5) // dwarven
{
strcat(name, one_of(dwarven_syl_opening));
strcat(name, one_of(dwarven_syl_edge));
strcat(name, one_of(dwarven_syl_open));
}
}
else if (number == 1)
{
if(type == 1) // standard
{
strcat(name, one_of(standard_syl_edge));
strcat(name, one_of(standard_syl_closing));
strcat(name, one_of(standard_syl_open));
}
else if(type == 2) // fantasy
{
strcat(name, one_of(fantasy_syl_edge));
strcat(name, one_of(fantasy_syl_closing));
strcat(name, one_of(fantasy_syl_open));
}
else if(type == 3) // norse
{
strcat(name, one_of(norse_syl_edge));
strcat(name, one_of(norse_syl_closing));
strcat(name, one_of(norse_syl_open));
}
else if(type == 4) // celtic
{
strcat(name, one_of(celtic_syl_edge));
strcat(name, one_of(celtic_syl_closing));
strcat(name, one_of(celtic_syl_open));
}
else if(type == 5) // dwarven
{
strcat(name, one_of(dwarven_syl_edge));
strcat(name, one_of(dwarven_syl_closing));
strcat(name, one_of(dwarven_syl_open));
}
}
else
{
if(type == 1) // standard
{
strcat(name, one_of(standard_syl_opening));
strcat(name, one_of(standard_syl_open));
}
else if(type == 2) // fantasy
{
strcat(name, one_of(fantasy_syl_opening));
strcat(name, one_of(fantasy_syl_open));
}
else if(type == 3) // norse
{
strcat(name, one_of(norse_syl_opening));
strcat(name, one_of(norse_syl_open));
}
else if(type == 4) // celtic
{
strcat(name, one_of(celtic_syl_opening));
strcat(name, one_of(celtic_syl_open));
}
else if(type == 5) // dwarven
{
strcat(name, one_of(dwarven_syl_opening));
strcat(name, one_of(dwarven_syl_open));
}
}
}
return capitalize(name);
}
void do_genname( CHAR_DATA *ch, char *argument )
{
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
char arg3[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];
char output[MAX_STRING_LENGTH];
int gender = 0;
int type = 0;
int count = 0;
int number = 0;
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
argument = one_argument( argument, arg3 );
if ( arg1[0] == '\0')
{
gender = number_range(1,2);
}
else
{
if(!is_number(arg1))
{
if(!str_cmp(arg1,"male"))
gender = 1;
else if(!str_cmp(arg1,"female"))
gender = 2;
else
{
send_to_char("That is not a valid gender.\r\n1 = male, 2 = female\r\n",ch);
return;
}
}
else
gender = atoi(arg1);
if(gender < 1 || gender > 2)
{
send_to_char("That is not a valid gender.\r\n1 = male, 2 = female\r\n",ch);
return;
}
}
if ( arg2[0] == '\0')
{
type = number_range(1,5);
}
else
{
if(is_number(arg2))
type = atoi(arg2);
else
{
if(!str_prefix(arg2,"standard"))
type = 1;
else if(!str_prefix(arg2,"fantasy"))
type = 2;
else if(!str_prefix(arg2,"norse"))
type = 3;
else if(!str_prefix(arg2,"celtic"))
type = 4;
else if(!str_prefix(arg2,"dwarven") || !str_prefix(arg2,"dwarf") )
type = 5;
else
{
send_to_char("That is not a valid type.\r\n1 = standard, 2 = fantasy, 3 = norse, 4 = celtic, 5 = dwarven\r\n",ch);
return;
}
}
if(type < 1 || type > 5)
{
send_to_char("That is not a valid type.\r\n1 = standard, 2 = fantasy, 3 = norse, 4 = celtic, 5 = dwarven\r\n",ch);
return;
}
}
buf2[0] = '\0';
output[0] = '\0';
if ( arg3[0] != '\0' && is_number(arg3))
{
number = atoi(arg3);
if(number > 20)
{
send_to_char("That number is too high, defaulting to 20 names.\r\n",ch);
number = 20;
}
if(number < 1)
number = 1;
for (count = 0; count < number; count++)
{
sprintf(output,"%s%s",generate_name(gender, type), number > 1 ? " " : "");
strcat(buf2,output);
}
sprintf(buf,"Random %s Name%s: %s\r\n",gender == 1 ? "Male" : "Female",number > 1 ? "s" : "",buf2);
}
else
sprintf(buf,"Random %s Name: %s\r\n",gender == 1 ? "Male" : "Female",generate_name(gender, type));
send_to_char(buf,ch);
return;
}
genname male standard 20
Random Male Names: Tevaf Amaiuil Fatal Ilalam Amairip Elarag Kelaz Tisap Ilalal Etodat Amairam Nokat Okasaf Afarat Irodar Sulaz Tipal Kodal Arcazir Enazin
genname female fantasy 20
Random Female Names: Delina Xora Xola Lasina Faxola Larara Wala Waraera Nalaera Mowala Salaelle Saelle Sasa Welaelle Roro Monina Wenala Wemora Mola Dewala
genname male norse 20
Random Male Names: Todid Ivaturd Odinard Rodig Alateyr Inalat Rodih Alival Anadard Tivag Saev Odaran Eyrodid Haes Ralit Aralan Ralih Ivaheyr Alavar Hivad
genname female celtic 20
Random Female Names: Fiwela Fiwama Yigio Kayama Yora Gala Regela Rekora Kora Lirela Weka Rachio Wemala Naeroka Liwala Gama Lemela Dorama Naelela Kala
genname male dwarven 20
Random Male Names: Ekefak Ronor Uriket Rakay Uganek Asugak Refat Ugakas Asugay Eturin Uritas Urinet Urugak Urirek Nefak Kurin Konot Urarar Urarak Akarur
char *GenerateName( void )
{
static char Result[128];
static const char *StartTable[] = { "Ra", "Ka", "Ash", "Mys", "Vin", "Bre", "Pol", "Nys", "Cal", "Wi", "Zi", NULL };
static const char *MiddleTable[] = { "", "", "", "", "", "san", "der", "jar", "zen", "shan", "ston", "peth", NULL };
static const char *EndTable[] = { "nar", "ia", "ith", "ion", "eth", "oth", "un", "eon", NULL };
static int MaxStart = 0, MaxMiddle = 0, MaxEnd = 0;
if ( !MaxStart ) {
for ( MaxStart = 0; StartTable[MaxStart] != NULL; ++MaxStart );
for ( MaxMiddle = 0; MiddleTable[MaxMiddle] != NULL; ++MaxMiddle );
for ( MaxEnd = 0; EndTable[MaxEnd] != NULL; ++MaxEnd );
}
sprintf( Result, "%s%s%s", StartTable[NumberRange(0,MaxStart-1)],
MiddleTable[NumberRange(0,MaxMiddle-1)], EndTable[NumberRange(0,MaxEnd-1)]);
return Result;
}
Long shot I figure, but it would be a neat tool for players to have without having to go to an external source like a website.