|
Code for parse_class() [by fantasia] |
|
|
|
Posted Wednesday, August 12th @ 11:25:18 PM, by George Greer in the Players dept.
. Click the link below to read it or download it.
From: fantasia <eagle@virtual.zipnet.net>
Subject: parse_class()
This is my parse_class() to demonstrate how to limit classes to certain
races, you can throw in checks in parse_class() to limit classes by
attributes also.
int parse_class(struct char_data * ch, char arg)
{
arg = LOWER(arg);
switch (arg) {
case 'm':
if (GET_RACE(ch) != RACE_DWARF) {
return CLASS_MAGIC_USER;
} else {
return CLASS_UNDEFINED;
}
break;
case 'c':
if (GET_RACE(ch) != RACE_DWARF) {
return CLASS_MAGIC_USER;
} else {
return CLASS_UNDEFINED;
}
return CLASS_CLERIC;
break;
case 'w':
return CLASS_WARRIOR;
break;
case 't':
return CLASS_THIEF;
break;
default:
return CLASS_UNDEFINED;
break;
}
}
<< Cleric Special [by Necro] | Reply | View as text | Flattened | Coke Machine Special Procedure [by Sliver] >> |
|
Related Links |
|
|
|
CircleMUD Snippets |
|
|
Note: Not all of these snippets will work perfectly with
your version of code, so be prepared to fix one
or two bugs that may arise, and please let me know
what you needed to do to fix it. Sending a corrected
version is always welcome.
|
Finally, if you wish to use any of the snippets from this
page, you are more than welcome, just mention the
authors in your credits. If you wish to release any
of these snippets to the public on another site,
contact me FIRST.
|
|
|
|
|
|
|