Alignment

From: David Cole (tiznor@hotmail.com)
Date: 11/27/01


Got another one for you guys, instead of alignment being set to 0 when a
character is create, i've made it wherer the character's alignment is set
depending apon there class and race. I've wrote a little function that sets
the alignment, but im having a problem with one of them, also i dont know if
this is the best way to do it, but i'll let you guys be the judge of that:

ALIGN_GOOD = 1000
ALIGN_NEUTRAL = 0
ALIGN_EVIL = -1000

void set_alignment(struct descriptor_data *d)
{
   switch (GET_RACE(d->character)) {
  case RACE_HUMAN:
   GET_ALIGNMENT(d->character) = ALIGN_GOOD;
    return;
  case RACE_BARBARIAN:
   GET_ALIGNMENT(d->character) = ALIGN_NEUTRAL;
    return;
  case RACE_DROW:
   GET_ALIGNMENT(d->character) = ALIGN_EVIL;
    return;
  case RACE_ELF:
   GET_ALIGNMENT(d->character) = ALIGN_GOOD;
    return;
  case RACE_DWARF:
   GET_ALIGNMENT(d->character) = ALIGN_GOOD;
    return;
  case RACE_DUERGAR:
   GET_ALIGNMENT(d->character) = ALIGN_EVIL;
    return;
  case RACE_KENDER:
   GET_ALIGNMENT(d->character) = ALIGN_GOOD;
    return;
  case RACE_GNOME:
   GET_ALIGNMENT(d->character) = ALIGN_GOOD;
    return;
  case RACE_OGRE:
   GET_ALIGNMENT(d->character) = ALIGN_EVIL;
    return;
  case RACE_TROLL:
   GET_ALIGNMENT(d->character) = ALIGN_EVIL;
    return;
  case RACE_HALF_ELF:
   GET_ALIGNMENT(d->character) = ALIGN_GOOD;
    return;
  case RACE_HALF_KENDER:
   GET_ALIGNMENT(d->character) = ALIGN_GOOD;
    return;
  case RACE_ORC:
   GET_ALIGNMENT(d->character) = ALIGN_EVIL;
    return;
  case RACE_HALF_ORC:
   GET_ALIGNMENT(d->character) = ALIGN_EVIL;
    return;
   }
   switch (GET_CLASS(d->character)) {
  case CLASS_NECROMANCER:
   GET_ALIGNMENT(d->character) = ALIGN_EVIL;
    return;
   }
}

My problem is that when a human necromancer is created, the alignment is set
to good, when it needs to be set to evil, however humans are a neautral
class in all respects, but necromancers are an evil class but welcome in all
towns on our mud, evil, or good.

I've tryed a vew different ways, the above, and also replacing the entire
case for HUMAN with this:

  case RACE_HUMAN:
    if (GET_CLASS(d->character, CLASS_NECROMANCER)) {
   GET_ALIGNMENT(d->character) = ALIGN_EVIL;
   } else {
   GET_ALIGNMENT(d->character) = ALIGN_GOOD;
    return;

However both of them failed. Any advice?

David Cole

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST