31 Jul, 2009, Xrakisis wrote in the 1st comment:
Votes: 0
Hi All,
I would like to have Draconians be able to become a dragon once they've reached 1K mob kills. Im not really sure how to do this.. i think id know how to write the function for changing, but im not sure how to work it in the race_table and the pc_race_table so that the regular dragon races wont be available in creation but will work fine later on.. Any help would be greatly appreciated..
Thanks,
Xrakisis, Ian Shirm.
31 Jul, 2009, Hades_Kane wrote in the 2nd comment:
Votes: 0
We have "racial templates" implemented on our ROM MUD.

The main driving factor behind how we allow people to "change" their race is to use an ACT_ or PLR_ flag, and have all checks that have to do with race take that into consideration.

This mostly affects the aesthetic aspect of the characters… any string that would normally say "Human" says "Vampire" instead, for example, and it also affects the racial skills they can gain further on. It's also important for our system, though, for original aspects of the original race to remain… you may not need that. If you don't have racial skills and such, it ought to be relatively simple if the main thing you are wanting to do is just to have the string "Draconian" be "Dragon" instead. If you are needing more functionality than that, you might share what you have in mind and we can maybe offer some better or more fine-tuned-to-your-needs suggestions.
31 Jul, 2009, Xrakisis wrote in the 3rd comment:
Votes: 0
I wrote a function (below), but in my alts pfile it says…
Race templar default~

and in who, as you might have guessed.. it has a blank space for race.. any suggestions?


void do_becomedragon(CHAR_DATA *ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg1 [MAX_INPUT_LENGTH];
int race;

race = ch->race;

argument = one_argument( argument, arg1 );

if (IS_NPC(ch)) return;

if (ch->race != 5)
{
send_to_char("You must be a Draconian to become a Dragon.\n\r",ch);
return;
}
if (ch->pcdata->mkills < 1000)
{
send_to_char("You must have at least 1000 mob kills to become a Dragon.\n\r",ch);
return;
}


if ( arg1[0] == '\0' )
{
stc("Type becomedragon <color> to become that dragon type.\n\r",ch);
stc("{G*****************{x\n\r",ch);
stc("{Y–{CBlack Dragon\n\r",ch);
stc("{Y–{CBlue Dragon\n\r",ch);
stc("{Y–{CRed Dragon\n\r",ch);
stc("{Y–{CGreen Dragon\n\r",ch);
stc("{Y–{CWhite Dragon\n\r",ch);
stc("{Y–{CBrass Dragon\n\r",ch);
stc("{Y–{CGold Dragon\n\r",ch);
stc("{Y–{CSilver Dragon\n\r",ch);
stc("{Y–{CBronze Dragon\n\r",ch);
stc("{Y–{CCopper Dragon\n\r",ch);
stc("{G*****************{n\n\r",ch);
return;
}
if (!str_cmp(arg1,"black"))
{
ch->race = 30;
send_to_char("You have become a Black Dragon.\n\r", ch);
sprintf(buf,"%s has become a Black Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"blue"))
{
ch->race = 31;
send_to_char("You have become a Blue Dragon.\n\r", ch);
sprintf(buf,"%s has become a Blue Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"red"))
{
ch->race = 32;
send_to_char("You have become a Red Dragon.\n\r", ch);
sprintf(buf,"%s has become a Red Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"green"))
{
ch->race = 33;
send_to_char("You have become a Green Dragon.\n\r", ch);
sprintf(buf,"%s has become a Green Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"white"))
{
ch->race = 34;
send_to_char("You have become a White Dragon.\n\r", ch);
sprintf(buf,"%s has become a White Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"brass"))
{
ch->race = 35;
send_to_char("You have become a Brass Dragon.\n\r", ch);
sprintf(buf,"%s has become a Brass Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"gold"))
{
ch->race = 36;
send_to_char("You have become a Gold Dragon.\n\r", ch);
sprintf(buf,"%s has become a Gold Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"silver"))
{
ch->race = 37;
send_to_char("You have become a Silver Dragon.\n\r", ch);
sprintf(buf,"%s has become a Silver Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"bronze"))
{
ch->race = 38;
send_to_char("You have become a Bronze Dragon.\n\r", ch);
sprintf(buf,"%s has become a Bronze Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"copper"))
{
ch->race = 39;
send_to_char("You have become a Copper Dragon.\n\r", ch);
sprintf(buf,"%s has become a Copper Dragon.", ch->name);
do_info(ch,buf);
}

ch->affected_by = ch->affected_by | race_table[race].aff;
ch->imm_flags = ch->imm_flags | race_table[race].imm;
ch->res_flags = ch->res_flags | race_table[race].res;
ch->vuln_flags = ch->vuln_flags | race_table[race].vuln;
ch->form = race_table[race].form;
ch->parts = race_table[race].parts;
ch->weight = pc_race_table[race].weight;
ch->height = pc_race_table[race].height;

return;
}
31 Jul, 2009, Kline wrote in the 4th comment:
Votes: 0
First question: do you have all the races (30 … 39) in place; those are the correct numbers for them, etc? You'd have an easier time to make them all #defines someplace so you can refer to them as RACE_BLACK_DRAGON or something similar – easier to read and less prone to "magic number" typo syndrome.

Also, did you mean to assign race = ch->race at the beginning and then at the end of the function, after changing ch->race, set the values of ch->weight/height/etc back to their previous (Draconian, I assume) values?
31 Jul, 2009, KaVir wrote in the 5th comment:
Votes: 0
What would happen to all the draconian's equipment though? A draconian is humanoid and could presumably wear regular armour and wield weapons - but a dragon couldn't very well walk around wearing a shirt, trousers and shoes…
31 Jul, 2009, Xrakisis wrote in the 6th comment:
Votes: 0
No kline, i made a mistake.. i didnt mean to set a dragons stats back to draconian.. i changed it to this (below), but now its just keeping the char a Draconian…

void do_becomedragon(CHAR_DATA *ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg1 [MAX_INPUT_LENGTH];
int race;

race = ch->race;

argument = one_argument( argument, arg1 );

if (IS_NPC(ch)) return;

if (ch->race != 5)
{
send_to_char("You must be a Draconian to become a Dragon.\n\r",ch);
return;
}
if (ch->pcdata->mkills < 1000)
{
send_to_char("You must have at least 1000 mob kills to become a Dragon.\n\r",ch);
return;
}


if ( arg1[0] == '\0' )
{
stc("Type becomedragon <color> to become that dragon type.\n\r",ch);
stc("{G*****************{x\n\r",ch);
stc("{Y–{CBlack Dragon\n\r",ch);
stc("{Y–{CBlue Dragon\n\r",ch);
stc("{Y–{CRed Dragon\n\r",ch);
stc("{Y–{CGreen Dragon\n\r",ch);
stc("{Y–{CWhite Dragon\n\r",ch);
stc("{Y–{CBrass Dragon\n\r",ch);
stc("{Y–{CGold Dragon\n\r",ch);
stc("{Y–{CSilver Dragon\n\r",ch);
stc("{Y–{CBronze Dragon\n\r",ch);
stc("{Y–{CCopper Dragon\n\r",ch);
stc("{G*****************{n\n\r",ch);
return;
}
if (!str_cmp(arg1,"black"))
{
race = 30;
send_to_char("You have become a Black Dragon.\n\r", ch);
sprintf(buf,"%s has become a Black Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"blue"))
{
race = 31;
send_to_char("You have become a Blue Dragon.\n\r", ch);
sprintf(buf,"%s has become a Blue Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"red"))
{
race = 32;
send_to_char("You have become a Red Dragon.\n\r", ch);
sprintf(buf,"%s has become a Red Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"green"))
{
race = 33;
send_to_char("You have become a Green Dragon.\n\r", ch);
sprintf(buf,"%s has become a Green Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"white"))
{
race = 34;
send_to_char("You have become a White Dragon.\n\r", ch);
sprintf(buf,"%s has become a White Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"brass"))
{
race = 35;
send_to_char("You have become a Brass Dragon.\n\r", ch);
sprintf(buf,"%s has become a Brass Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"gold"))
{
race = 36;
send_to_char("You have become a Gold Dragon.\n\r", ch);
sprintf(buf,"%s has become a Gold Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"silver"))
{
race = 37;
send_to_char("You have become a Silver Dragon.\n\r", ch);
sprintf(buf,"%s has become a Silver Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"bronze"))
{
race = 38;
send_to_char("You have become a Bronze Dragon.\n\r", ch);
sprintf(buf,"%s has become a Bronze Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"copper"))
{
race = 39;
send_to_char("You have become a Copper Dragon.\n\r", ch);
sprintf(buf,"%s has become a Copper Dragon.", ch->name);
do_info(ch,buf);
}

ch->affected_by = ch->affected_by | race_table[race].aff;
ch->imm_flags = ch->imm_flags | race_table[race].imm;
ch->res_flags = ch->res_flags | race_table[race].res;
ch->vuln_flags = ch->vuln_flags | race_table[race].vuln;
ch->form = race_table[race].form;
ch->parts = race_table[race].parts;
ch->weight = pc_race_table[race].weight;
ch->height = pc_race_table[race].height;

return;
}
31 Jul, 2009, Kline wrote in the 7th comment:
Votes: 0
Ok, but now you're not actually changing ch->race to anything different, you're just applying the new racial bonuses to the ch.
31 Jul, 2009, Xrakisis wrote in the 8th comment:
Votes: 0
shouldnt race = 30; change ch->race to that of a dragon? and its not even changing the bonuses…
31 Jul, 2009, Koron wrote in the 9th comment:
Votes: 0
Xrakisis said:
Hi All,
I would like to have Draconians be able to become a dragon once they've reached 1K mob kills. Im not really sure how to do this.. i think id know how to write the function for changing, but im not sure how to work it in the race_table and the pc_race_table so that the regular dragon races wont be available in creation but will work fine later on.. Any help would be greatly appreciated..
Thanks,
Xrakisis, Ian Shirm.


The problem with your question is that it's a bit like asking a room full of people how to make a sandwich. Each person has his or her own sandwich preferences and even if two people both love grilled cheese above all else, they probably make it differently anyhow. You could do it a lot of ways. Anyhow, it looks like you're making progress and now that you are, it'll be a bit easier to get your questions answered, I think.
31 Jul, 2009, Kline wrote in the 10th comment:
Votes: 0
If race was a pointer to ch->race, yes, but right now it's just a local variable within your function. The easiest way would be to check ch->race is Draconian (which you do already). Then change ch->race to one of the new types, and then just use ch->race (since it is now changed) at the bottom in your table lookups for bonuses.
31 Jul, 2009, Koron wrote in the 11th comment:
Votes: 0
Xrakisis said:
shouldnt race = 30; change ch->race to that of a dragon? and its not even changing the bonuses…

No, because race is a locally declared int. You need to make ch->race = 30;

Edit: Snipe and a half!
31 Jul, 2009, Xrakisis wrote in the 12th comment:
Votes: 0
I changed it.. and now..

In the pfile..
Race templar default~


void do_becomedragon(CHAR_DATA *ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
char arg1 [MAX_INPUT_LENGTH];
int race;

race = ch->race;

argument = one_argument( argument, arg1 );

if (IS_NPC(ch)) return;

if (ch->race != 5)
{
send_to_char("You must be a Draconian to become a Dragon.\n\r",ch);
return;
}
if (ch->pcdata->mkills < 1000)
{
send_to_char("You must have at least 1000 mob kills to become a Dragon.\n\r",ch);
return;
}


if ( arg1[0] == '\0' )
{
stc("Type becomedragon <color> to become that dragon type.\n\r",ch);
stc("{G*****************{x\n\r",ch);
stc("{Y–{CBlack Dragon\n\r",ch);
stc("{Y–{CBlue Dragon\n\r",ch);
stc("{Y–{CRed Dragon\n\r",ch);
stc("{Y–{CGreen Dragon\n\r",ch);
stc("{Y–{CWhite Dragon\n\r",ch);
stc("{Y–{CBrass Dragon\n\r",ch);
stc("{Y–{CGold Dragon\n\r",ch);
stc("{Y–{CSilver Dragon\n\r",ch);
stc("{Y–{CBronze Dragon\n\r",ch);
stc("{Y–{CCopper Dragon\n\r",ch);
stc("{G*****************{n\n\r",ch);
return;
}
if (!str_cmp(arg1,"black"))
{
ch->race = 30;
send_to_char("You have become a Black Dragon.\n\r", ch);
sprintf(buf,"%s has become a Black Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"blue"))
{
ch->race = 31;
send_to_char("You have become a Blue Dragon.\n\r", ch);
sprintf(buf,"%s has become a Blue Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"red"))
{
ch->race = 32;
send_to_char("You have become a Red Dragon.\n\r", ch);
sprintf(buf,"%s has become a Red Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"green"))
{
ch->race = 33;
send_to_char("You have become a Green Dragon.\n\r", ch);
sprintf(buf,"%s has become a Green Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"white"))
{
ch->race = 34;
send_to_char("You have become a White Dragon.\n\r", ch);
sprintf(buf,"%s has become a White Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"brass"))
{
ch->race = 35;
send_to_char("You have become a Brass Dragon.\n\r", ch);
sprintf(buf,"%s has become a Brass Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"gold"))
{
ch->race = 36;
send_to_char("You have become a Gold Dragon.\n\r", ch);
sprintf(buf,"%s has become a Gold Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"silver"))
{
ch->race = 37;
send_to_char("You have become a Silver Dragon.\n\r", ch);
sprintf(buf,"%s has become a Silver Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"bronze"))
{
ch->race = 38;
send_to_char("You have become a Bronze Dragon.\n\r", ch);
sprintf(buf,"%s has become a Bronze Dragon.", ch->name);
do_info(ch,buf);
}
else if (!str_cmp(arg1,"copper"))
{
ch->race = 39;
send_to_char("You have become a Copper Dragon.\n\r", ch);
sprintf(buf,"%s has become a Copper Dragon.", ch->name);
do_info(ch,buf);
}

ch->affected_by = ch->affected_by | race_table[ch->race].aff;
ch->imm_flags = ch->imm_flags | race_table[ch->race].imm;
ch->res_flags = ch->res_flags | race_table[ch->race].res;
ch->vuln_flags = ch->vuln_flags | race_table[ch->race].vuln;
ch->form = race_table[ch->race].form;
ch->parts = race_table[ch->race].parts;
ch->weight = pc_race_table[ch->race].weight;
ch->height = pc_race_table[ch->race].height;

return;
}
31 Jul, 2009, Kline wrote in the 13th comment:
Votes: 0
What race number is Templar? Also, possibly could you post your race_table?
31 Jul, 2009, Xrakisis wrote in the 14th comment:
Votes: 0
race tables..


/* race table */
const struct race_type race_table[] = {
/*
{
name, pc_race?,
act bits, aff_by bits, off bits,
imm, res, vuln,
form, parts
},
*/
{"unique", FALSE, 0, 0, 0, 0, 0, 0, 0, 0},

/* 1 */
{
"human", TRUE,
0, 0, 0,
0, 0, 0,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 2 */
{
"elf", TRUE,
0, AFF_INFRARED, 0,
0, RES_CHARM, VULN_IRON,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 3 */
{
"dwarf", TRUE,
0, AFF_INFRARED, 0,
0, RES_POISON | RES_DISEASE, VULN_DROWNING,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 4 */
{
"giant", TRUE,
0, 0, 0,
0, RES_FIRE | RES_COLD, VULN_MENTAL | VULN_LIGHTNING,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 5 */
{
"draconian", TRUE,
0, 0, 0,
0, RES_FIRE | RES_COLD, RES_WEAPON | VULN_MAGIC,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 6 */
{
"gnome", TRUE,
0, 0, 0,
0, IMM_MENTAL, VULN_WEAPON,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 7 */
{
"hobbit", TRUE,
0, 0, 0,
0, VULN_BASH, VULN_POISON,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 8 */
{
"kender", TRUE,
0, 0, 0,
0, VULN_BASH, VULN_POISON,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 9 */
{
"troll", TRUE,
0, 0, 0,
0, VULN_FIRE, RES_WEAPON,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 10 */
{
"pixie", TRUE,
0, 0, 0,
0, VULN_BASH, VULN_POISON,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

{ /* 11 */
"half-elf", TRUE,
0, AFF_INFRARED, 0,
0, RES_CHARM, VULN_IRON,
A|H|M|V,A|B|C|D|E|F|G|H|I|J|K
},

/* 12 */
{
"half-giant", TRUE,
0, AFF_INFRARED, 0,
0, RES_POISON | RES_DISEASE, VULN_DROWNING,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 13 */
{
"half-orc", TRUE,
0, AFF_INFRARED, 0,
0, RES_POISON | RES_DISEASE, VULN_DROWNING,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 14 */
{
"duergar", TRUE,
0, AFF_INFRARED, 0,
0, RES_POISON | RES_DISEASE, VULN_DROWNING,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 15 */
{
"minotaur", TRUE,
0, 0, 0,
0, RES_FIRE | RES_COLD, VULN_MENTAL | VULN_LIGHTNING,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 16 */
{
"centaur", TRUE,
0, 0, 0,
0, RES_FIRE | RES_COLD, VULN_MENTAL | VULN_LIGHTNING,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 17 */
{
"drow", TRUE,
0, AFF_INFRARED, 0,
0, RES_CHARM, VULN_IRON,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

/* 18 */
{
"storm giant", TRUE,
0, AFF_FLYING, 0,
0, RES_LIGHTNING, VULN_MENTAL|VULN_COLD|VULN_FIRE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 19 */
"cloud giant", TRUE,
0, AFF_FLYING, 0,
0, RES_WEAPON, VULN_MENTAL|VULN_LIGHTNING,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 20 */
"fire giant", TRUE,
0, 0, 0,
0, RES_FIRE, VULN_MENTAL|VULN_LIGHTNING|VULN_COLD,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 21 */
"frost giant", TRUE,
0, 0, 0,
0, RES_COLD, VULN_MENTAL|VULN_LIGHTNING|VULN_FIRE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 22 */
"cyclops", TRUE,
0, 0, 0,
0, 0, VULN_MENTAL|VULN_MAGIC,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 23 */
"hydra", TRUE,
0, 0, 0,
0, RES_BASH, VULN_MENTAL|VULN_MAGIC,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 24 */
"rockseer", TRUE,
0, AFF_INFRARED|AFF_SNEAK|AFF_PASS_DOOR, 0,
0, RES_CHARM, VULN_WOOD,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 25 */
"svirfnebli", TRUE,
0, AFF_INFRARED, 0,
0, RES_MAGIC|RES_POISON|RES_DISEASE, VULN_BASH,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},
{ /* 26 */
"arial", TRUE,
0, AFF_FLYING, 0,
0, 0, 0,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},
{ /* 27 */
"felar", TRUE,
0, AFF_INFRARED, OFF_TAIL,
0, RES_LIGHT|RES_COLD, VULN_FIRE|VULN_DROWNING,
A|H|M|V, A|C|D|E|F|H|J|K|Q|U|V
},

{ /* 28 */
"githyanki", TRUE,
0, AFF_INFRARED, 0,
0, 0, 0,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 29 */
"satyr", TRUE,
0, AFF_INFRARED, 0,
0, RES_WOOD|RES_DISEASE, 0,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},
{ /* 30 */
"black dragon", TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_ACID, VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 31 */
"blue dragon", TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_LIGHTNING,
VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 32 */
"green dragon", TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_POISON, VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 33 */
"red dragon", TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_FIRE, VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 34 */
"white dragon", TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_COLD, VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 35 */
"brass dragon", TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_FIRE, VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 36 */
"gold dragon", TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_FIRE|RES_POISON,
VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 37 */
"silver dragon",TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_COLD, VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 38 */
"bronze dragon", TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_LIGHTNING,
VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},

{ /* 39 */
"copper dragon",TRUE,
0, AFF_SANCTUARY|AFF_INFRARED|AFF_FLYING, 0,
0, RES_BASH|RES_CHARM|RES_ACID, VULN_PIERCE,
A|H|M|V, A|B|C|D|E|F|G|H|I|J|K
},



{
"bat", FALSE,
0, AFF_FLYING | AFF_DARK_VISION, OFF_DODGE | OFF_FAST,
0, 0, VULN_LIGHT,
A | G | V, A | C | D | E | F | H | J | K | P},

{
"bear", FALSE,
0, 0, OFF_CRUSH | OFF_DISARM | OFF_BERSERK,
0, RES_BASH | RES_COLD, 0,
A | G | V, A | B | C | D | E | F | H | J | K | U | V},

{
"cat", FALSE,
0, AFF_DARK_VISION, OFF_FAST | OFF_DODGE,
0, 0, 0,
A | G | V, A | C | D | E | F | H | J | K | Q | U | V},

{
"centipede", FALSE,
0, AFF_DARK_VISION, 0,
0, RES_PIERCE | RES_COLD, VULN_BASH,
A | B | G | O, A | C | K},

{
"dog", FALSE,
0, 0, OFF_FAST,
0, 0, 0,
A | G | V, A | C | D | E | F | H | J | K | U | V},

{
"doll", FALSE,
0, 0, 0,
IMM_COLD | IMM_POISON | IMM_HOLY | IMM_NEGATIVE | IMM_MENTAL |
IMM_DISEASE | IMM_DROWNING, RES_BASH | RES_LIGHT,
VULN_SLASH | VULN_FIRE | VULN_ACID | VULN_LIGHTNING | VULN_ENERGY,
E | J | M | cc, A | B | C | G | H | K},

{"dragon", FALSE,
0, AFF_INFRARED | AFF_FLYING, 0,
0, RES_FIRE | RES_BASH | RES_CHARM,
VULN_PIERCE | VULN_COLD,
A | H | Z, A | C | D | E | F | G | H | I | J | K | P | Q | U | V | X},

{
"fido", FALSE,
0, 0, OFF_DODGE | ASSIST_RACE,
0, 0, VULN_MAGIC,
A | B | G | V, A | C | D | E | F | H | J | K | Q | V},

{
"fox", FALSE,
0, AFF_DARK_VISION, OFF_FAST | OFF_DODGE,
0, 0, 0,
A | G | V, A | C | D | E | F | H | J | K | Q | V},

{
"goblin", FALSE,
0, AFF_INFRARED, 0,
0, RES_DISEASE, VULN_MAGIC,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

{
"hobgoblin", FALSE,
0, AFF_INFRARED, 0,
0, RES_DISEASE | RES_POISON, 0,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K | Y},

{
"kobold", FALSE,
0, AFF_INFRARED, 0,
0, RES_POISON, VULN_MAGIC,
A | B | H | M | V, A | B | C | D | E | F | G | H | I | J | K | Q},

{
"lizard", FALSE,
0, 0, 0,
0, RES_POISON, VULN_COLD,
A | G | X | cc, A | C | D | E | F | H | K | Q | V},

{
"modron", FALSE,
0, AFF_INFRARED, ASSIST_RACE | ASSIST_ALIGN,
IMM_CHARM | IMM_DISEASE | IMM_MENTAL | IMM_HOLY | IMM_NEGATIVE,
RES_FIRE | RES_COLD | RES_ACID, 0,
H, A | B | C | G | H | J | K},

{
"orc", FALSE,
0, AFF_INFRARED, 0,
0, RES_DISEASE, VULN_LIGHT,
A | H | M | V, A | B | C | D | E | F | G | H | I | J | K},

{
"pig", FALSE,
0, 0, 0,
0, 0, 0,
A | G | V, A | C | D | E | F | H | J | K},

{
"rabbit", FALSE,
0, 0, OFF_DODGE | OFF_FAST,
0, 0, 0,
A | G | V, A | C | D | E | F | H | J | K},

{
"school monster", FALSE,
ACT_NOALIGN, 0, 0,
IMM_CHARM | IMM_SUMMON, 0, VULN_MAGIC,
A | M | V, A | B | C | D | E | F | H | J | K | Q | U},

{
"snake", FALSE,
0, 0, 0,
0, RES_POISON, VULN_COLD,
A | G | X | Y | cc, A | D | E | F | K | L | Q | V | X},

{
"song bird", FALSE,
0, AFF_FLYING, OFF_FAST | OFF_DODGE,
0, 0, 0,
A | G | W, A | C | D | E | F | H | K | P},

{
"troll", FALSE,
0, AFF_REGENERATION | AFF_INFRARED | AFF_DETECT_HIDDEN,
OFF_BERSERK,
0, RES_CHARM | RES_BASH, VULN_FIRE | VULN_ACID,
A | B | H | M | V, A | B | C | D | E | F | G | H | I | J | K | U | V},

{
"water fowl", FALSE,
0, AFF_SWIM | AFF_FLYING, 0,
0, RES_DROWNING, 0,
A | G | W, A | C | D | E | F | H | K | P},

{
"wolf", FALSE,
0, AFF_DARK_VISION, OFF_FAST | OFF_DODGE,
0, 0, 0,
A | G | V, A | C | D | E | F | J | K | Q | V},

{
"wyvern", FALSE,
0, AFF_FLYING | AFF_DETECT_INVIS | AFF_DETECT_HIDDEN,
OFF_BASH | OFF_FAST | OFF_DODGE,
IMM_POISON, 0, VULN_LIGHT,
A | B | G | Z, A | C | D | E | F | H | J | K | Q | V | X},

{
"unique", FALSE,
0, 0, 0,
0, 0, 0,
0, 0},


{
NULL, 0, 0, 0, 0, 0, 0}
};

const struct pc_race_type pc_race_table[] = {
{"null race", "", 0, {100, 100, 100, 100},
70, 140, {""}, {13, 13, 13, 13, 13}, {18, 18, 18, 18, 18}, 0},

/*
{
"race name", short name, points, { class multipliers },
"height", "weight", { bonus skills },
{ base stats }, { max stats }, size
},
*/
{
"human", "Human ", 0, {100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
70, 140, {""},
{13, 13, 13, 13, 13}, {18, 18, 18, 18, 18}, SIZE_MEDIUM},

{
"elf", "Elf ", 20, {100, 125, 100, 120, 120, 120, 100, 120, 125, 100},
72, 130, {"sneak", "hide"},
{12, 14, 13, 15, 11}, {16, 20, 18, 21, 15}, SIZE_SMALL},

{
"dwarf", "Dwarf ", 20, {150, 100, 125, 100, 100, 100, 150, 100, 100, 130},
40, 170, {"berserk"},
{14, 12, 14, 10, 15}, {20, 16, 19, 14, 21}, SIZE_MEDIUM},

{
"giant", "Giant ", 25, {200, 150, 150, 105, 120, 120, 200, 120, 150, 175},
120, 250, {"bash", "fast healing"},
{16, 11, 13, 11, 14}, {22, 15, 18, 15, 20}, SIZE_LARGE},

{
"draconian", "Draconian", 20, {100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
80, 170, {""},
{16, 12, 13, 11, 16}, {22, 15, 18, 15, 20}, SIZE_MEDIUM},

{
"gnome", "Gnome ", 10, {100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
35, 80, {""},
{12, 14, 13, 15, 11}, {16, 20, 18, 21, 15}, SIZE_SMALL},

{
"hobbit", "Hobbit ", 10, {100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
40, 150, {""},
{12, 14, 13, 15, 11}, {16, 20, 18, 21, 15}, SIZE_SMALL},

{
"kender", "Kender ", 10, {100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
35, 75, {""},
{12, 14, 13, 15, 11}, {16, 20, 18, 21, 15}, SIZE_SMALL},

{
"troll", "Troll ", 25, {200, 150, 150, 105, 100, 100, 200, 100, 150, 175},
95, 220, {"bash", "fast healing"},
{16, 11, 13, 11, 14}, {23, 15, 18, 15, 22}, SIZE_LARGE},

{
"pixie", "Pixie ", 10, {100, 125, 100, 120, 120, 120, 100, 120, 125, 100},
6, 1, {"sneak", "hide"},
{12, 14, 13, 15, 11}, {16, 20, 18, 21, 15}, SIZE_SMALL},

{
"half-elf", "Half-elf ", 20, {100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
70, 140, {""},
{13, 13, 13, 13, 13}, {18, 18, 18, 18, 18}, SIZE_MEDIUM},

{
"half-giant", "Hlf-Giant", 25, {125, 100, 125, 100, 100, 100, 125, 100, 100, 125},
80, 220, {"berserk"},
{14, 12, 14, 10, 15}, {20, 16, 19, 14, 21}, SIZE_LARGE},

{
"half-orc", "Half-Orc ", 20, {150, 100, 125, 100, 100, 100, 150, 100, 100, 125},
70, 150, {"berserk"},
{14, 12, 14, 10, 15}, {20, 16, 19, 14, 21}, SIZE_MEDIUM},

{
"duergar", "Duergar ", 20, {150, 100, 125, 100, 100, 100, 150, 100, 100, 130},
40, 160, {"berserk"},
{14, 12, 14, 10, 15}, {20, 16, 19, 14, 21}, SIZE_MEDIUM},

{
"minotaur", "Minotaur ", 20, {200, 150, 150, 105, 100, 100, 200, 100, 150, 150},
85, 230, {"bash", "fast healing"},
{16, 11, 13, 11, 14}, {22, 15, 18, 15, 20}, SIZE_LARGE},

{
"centaur", "Centaur ", 10, {100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
85, 260, {"berserk"},
{14, 12, 14, 10, 15}, {20, 16, 19, 14, 21}, SIZE_LARGE},

{
"drow", "Dark Elf ", 20, {100, 125, 100, 120, 120, 120, 100, 120, 125, 100},
80, 120, {"sneak", "hide"},
{12, 14, 13, 15, 11}, {16, 20, 18, 21, 15}, SIZE_MEDIUM},

{
"storm giant", "StormGia ",30,{200, 150, 150, 105, 100, 100, 200, 100, 150, 150},
168, 600, { "bash"," enhanced damage" , "sword" },
{15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25 }, SIZE_HUGE},

{
"cloud giant", "CloudGia ", 30,{200, 150, 150, 105, 100, 100, 200, 100, 150, 150},
168, 600, { "bash"," enhanced damage" , "sword" },
{15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25 }, SIZE_HUGE},

{
"fire giant", "FireGia ",30 ,{200, 150, 150, 105, 100, 100, 200, 100, 150, 150},
168, 600, { "bash"," enhanced damage" , "sword" },
{15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25 }, SIZE_HUGE},

{
"frost giant", "FrostGia ",30,{200, 150, 150, 105, 100, 100, 200, 100, 150, 150},
168, 600, { "bash"," enhanced damage" , "sword" },
{15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25 }, SIZE_HUGE},

{
"cyclops", "Cyclops ",30,{200, 150, 150, 105, 100, 100, 200, 100, 150, 150},
168, 600, { "bash"," enhanced damage" , "sword" },
{15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25 }, SIZE_HUGE},

{
"hydra", "Hydra ",20,{200, 150, 150, 105, 100, 100, 200, 100, 150, 150},
168, 600, { "bash"," enhanced damage" , "sword" },
{15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25 }, SIZE_HUGE},

{
"rockseer","Rockseer ",20,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
70, 150, { "wand" },
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_MEDIUM},

{
"svirfnebli", "Svirf ",20,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
50, 120, { "lore", "identify" },
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_SMALL},

{
"arial", "Arial ",10,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
70, 150, { "" },
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_MEDIUM},
{
"felar", "Felar ",20,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
70, 150,{ "hand to hand" },
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_MEDIUM},
{
"githyanki", "Githy ",20,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
70, 150,{ "sword" ,"dagger"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_MEDIUM},

{
"satyr","Satyr ",20,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
70, 150, { "camouflage" ,"ambush", "steal" },
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_MEDIUM},
{
"black dragon","BlaDr ",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT},

{
"blue dragon","BluDr ",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT},

{
"green dragon","GReDr ",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT},

{
"red dragon","RedDr ",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT},

{
"white dragon","WhiteDrag",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT},

{
"brass dragon","BrassDrag",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT},

{
"gold dragon","GoldDrag ",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT},

{
"silver dragon","SilverDr ",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT},

{
"bronze dragon","BronzeDr ",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT},

{
"copper dragon","CopperDr ",30,{100, 100, 100, 100, 100, 100, 100, 100, 100, 100},
170, 800, { "hand to hand" , "bash"},
{ 15, 15, 15, 15, 15}, { 25, 25, 25, 25, 25}, SIZE_GIANT}

};
31 Jul, 2009, Xrakisis wrote in the 15th comment:
Votes: 0
and templar default isnt a race.. its a class group
31 Jul, 2009, Kline wrote in the 16th comment:
Votes: 0
Well your code matches your tables fine – so the player's race *should* be changing, however, if "templar default" is a class group you might want to go check your pfile save routine. It's apparently saving your "class group" data where your race should be. In fwrite_char() and fread_char() (I hope those are right for ROM) check to see where ch->race is actually being written to file and where it gets read back in.
31 Jul, 2009, Xrakisis wrote in the 17th comment:
Votes: 0
the pfile saving should be fine.. it does fine with races, with the exception of this function.
01 Aug, 2009, Hades_Kane wrote in the 18th comment:
Votes: 0
This probably won't help your particular issue, but something I did notice is that you have no fail-safe against someone typing something that isn't one of the correct values… ie: if I typed 'blah' as my argument, I see nothing that would tell the character their argument isn't valid, it would just continue to the bottom, change those values, and continue on.

I would suggest after this bit:
else if (!str_cmp(arg1,"copper"))
{
ch->race = 39;
send_to_char("You have become a Copper Dragon.\n\r", ch);
sprintf(buf,"%s has become a Copper Dragon.", ch->name);
do_info(ch,buf);
}


adding something like this:

else
{
stc("Invalid type.\r\n",ch);
stc("Type becomedragon <color> to become that dragon type.\n\r",ch);
stc("{G*****************{x\n\r",ch);
stc("{Y–{CBlack Dragon\n\r",ch);
stc("{Y–{CBlue Dragon\n\r",ch);
stc("{Y–{CRed Dragon\n\r",ch);
stc("{Y–{CGreen Dragon\n\r",ch);
stc("{Y–{CWhite Dragon\n\r",ch);
stc("{Y–{CBrass Dragon\n\r",ch);
stc("{Y–{CGold Dragon\n\r",ch);
stc("{Y–{CSilver Dragon\n\r",ch);
stc("{Y–{CBronze Dragon\n\r",ch);
stc("{Y–{CCopper Dragon\n\r",ch);
stc("{G*****************{n\n\r",ch);
return;
}


And then also forcing a save immediately after the character changes.

In the event of a crash or something right after this, the character would have to do that all over again, so I would personally recommend that any major changes to a pfile like this ought to have a call to save the character at the end of the function before the final return.

Maybe typos on the end user's part could be part of your problem. If you add that final else to make sure you've covered your bases on someone not typing the correct color, that might help you eliminate one possibility at least.
01 Aug, 2009, Lobotomy wrote in the 19th comment:
Votes: 0
Hades_Kane said:
stc("Invalid type.\r\n",ch);
stc("Type becomedragon <color> to become that dragon type.\n\r",ch);
stc("{G*****************{x\n\r",ch);
stc("{Y–{CBlack Dragon\n\r",ch);
stc("{Y–{CBlue Dragon\n\r",ch);
stc("{Y–{CRed Dragon\n\r",ch);
stc("{Y–{CGreen Dragon\n\r",ch);
stc("{Y–{CWhite Dragon\n\r",ch);
stc("{Y–{CBrass Dragon\n\r",ch);
stc("{Y–{CGold Dragon\n\r",ch);
stc("{Y–{CSilver Dragon\n\r",ch);
stc("{Y–{CBronze Dragon\n\r",ch);
stc("{Y–{CCopper Dragon\n\r",ch);
stc("{G*****************{n\n\r",ch);

Just as a subnote to HK's post, I want to again emphasise with regards to functions like this that you can use a multi-line string literal and avoid having your program unnecessarily call a function repeated times, as they will all be concatenated into a single string automatically. I.e:

stc( "Invalid type.\r\n"
"Type becomedragon <color> to become that dragon type.\n\r"
"{G*****************{x\n\r"
"{Y–{CBlack Dragon\n\r"
"{Y–{CBlue Dragon\n\r"
"{Y–{CRed Dragon\n\r"
"{Y–{CGreen Dragon\n\r"
"{Y–{CWhite Dragon\n\r"
"{Y–{CBrass Dragon\n\r"
"{Y–{CGold Dragon\n\r"
"{Y–{CSilver Dragon\n\r"
"{Y–{CBronze Dragon\n\r"
"{Y–{CCopper Dragon\n\r"
"{G*****************{n\n\r", ch );
01 Aug, 2009, Igabod wrote in the 20th comment:
Votes: 0
did you take into consideration that draconians are a twisted form of dragons? They were originally dragon eggs that were corrupted by black magic and therefore they don't change into dragons. They are a new race all together. Draconians barely even look like dragons. They are bipedal with stunted wings and are only slightly taller than humans. They can't fly, they can barely even glide with their crappy wings. They don't breathe fire or any other type of dragon breath. Having them change into dragons is a bit like having a monkey change into a human. And doing it when they get 1000 mob kills would be entirely too quick as well.

If you insist on having them change into dragons at a certain point, why not base it on level? Or if you're set on doing it based on mkills then you should make that number much higher. A dragon is a significant improvement over a draconian in power and abilities so getting that upgrade at such an early point would be insane.
0.0/26