builder's lessons » alignment checks

Alignment checks

There are several different ways to check alignment. The first way is to check the alignment number. See the mobile alignment lesson for details on the specific numbers. The disadvantage of this method is if you are checking for a specific alignment, old characters from the first year that the game was running may not have that set number. When the game first opened, actions affected alignment. This was later changed to having a chosen alignment that didn't change and a hidden alignment that did.

>greet_prog 100~
if align($n) == 1000 
or align($n) == 650 
or align($n) == 200 
  mpecho do things for people who can be accepted 
else 
  mpecho do things for people who cannot be accepted 
endif
~

The above checks for the specific numbers which will work for most, but not all characters.

>greet_prog 100~
if align($n) < 100 
  mpecho do things for people who cannot be accepted 
else 
  if align($n) > 600 
  or align($n) < 300 
    mpecho do things for people who can be accepted 
  else 
    mpecho do things for people who cannot be accepted 
  endif 
endif
~
|

The above checks for a range of alignments.

There is a simpler way to check alignments by using the if isevil, if isgood checks etc.

if questr(16500,0,5,$n) == 3
  sayto $n So, you have come to me to be tested. Very
  sayto $n well, let's see if you are worthy of the 
  sayto $n City Watch.
  mpechoat $n $I prays as he makes strange gestures toward you.
  mpechoaround $n $I prays as he makes strange gestures towards $N.
  if islawful($n)
    if isgood($n)
    or isneutral($n)
      sayto $n Very good, you possess the qualities
      sayto $n we seek for Watch members. 
      sayto $n Please return to the Headmaster.
      mpmset $n questr 16500 0 5 4
    else
      sayto $n I am sorry, but you do not 
      sayto $n have the qualities we are   
      sayto $n seeking. 
      sayto $n Please return to the Headmaster.
      mpmset $n questr 16500 0 5 5
    endif
  else
    sayto $n I am sorry, but you do not 
    sayto $n have the qualities we are   
    sayto $n seeking. 
    sayto $n Please return to the Headmaster.
    mpmset $n questr 16500 0 5 5  
  endif 
endif
~

The above needed to know if the PC was either Lawful Good or Lawful Neutral in alignment. First we checked to see if the PC was lawful, and the to see if they were good or neutral.

The available checks for this are: isgood, isneutral, isevil, islawful, ischaotic, isunconcerned. When you combine these checks you can determine the alignment of a PC. To determine True Neutral you need to combine isneutral and isunconcerned.