Does anyone have a snippet for alignment based races, classes, and hometowns for ROM 2.4b6?
Alignment based Races, Classes, Hometowns snippet?
Posted by LunaticStriker on Tue 06 Sep 2005 01:31 AM — 3 posts, 14,784 views.
Well, I don't have a snippet per se, but I can tell you the basic idea of making it work.. First off, us something like
ALIGN_G ALIGN_N ALIGN_E
Add this to your races in const.c.
Add something like this "sh_int align;" to your struct class_type to set align for specific classes.. And add it to your struct pc_race_type to set align for specific races.
Now in comm.c under CON_GET_ALIGNMENT, change that to meet the requirements for the ALIGN_G ALIGN_N ALIGN_E, and example of such would be something like this...
if ((pc_race_table[ch->race].align == ALIGN_G && class_table[ch->class].align == ALIGN_N)
|| (pc_race_table[ch->race].align == ALIGN_ANY && class_table[ch->class].align == ALIGN_GE)
|| (pc_race_table[ch->race].align == ALIGN_GE && class_table[ch->class].align == ALIGN_ANY))
{
write_to_buffer(d, "\n\r", 2);
write_to_buffer(d, "Alignment?\n\rgood or neutral?\n\r", 0);
Not sure how clear that will come out, I wrote in in textpad and then pasted it in here... Hope that gives you an idea to expand on.
ALIGN_G ALIGN_N ALIGN_E
Add this to your races in const.c.
Add something like this "sh_int align;" to your struct class_type to set align for specific classes.. And add it to your struct pc_race_type to set align for specific races.
Now in comm.c under CON_GET_ALIGNMENT, change that to meet the requirements for the ALIGN_G ALIGN_N ALIGN_E, and example of such would be something like this...
if ((pc_race_table[ch->race].align == ALIGN_G && class_table[ch->class].align == ALIGN_N)
|| (pc_race_table[ch->race].align == ALIGN_ANY && class_table[ch->class].align == ALIGN_GE)
|| (pc_race_table[ch->race].align == ALIGN_GE && class_table[ch->class].align == ALIGN_ANY))
{
write_to_buffer(d, "\n\r", 2);
write_to_buffer(d, "Alignment?\n\rgood or neutral?\n\r", 0);
Not sure how clear that will come out, I wrote in in textpad and then pasted it in here... Hope that gives you an idea to expand on.
Actually, sorry, those GE's don't belong there, not sure what happened, but this is what it should look like:
if ((pc_race_table[ch->race].align == ALIGN_G && class_table[ch->class].align == ALIGN_N)
|| (pc_race_table[ch->race].align == ALIGN_N && class_table[ch->class].align == ALIGN_G))
{
write_to_buffer(d, "\n\r", 2);
write_to_buffer(d, "Alignment?\n\rgood or neutral\n\r", 0);
}
There, that makes more sense. Sorry about that last post, but hope that helps.
if ((pc_race_table[ch->race].align == ALIGN_G && class_table[ch->class].align == ALIGN_N)
|| (pc_race_table[ch->race].align == ALIGN_N && class_table[ch->class].align == ALIGN_G))
{
write_to_buffer(d, "\n\r", 2);
write_to_buffer(d, "Alignment?\n\rgood or neutral\n\r", 0);
}
There, that makes more sense. Sorry about that last post, but hope that helps.