New KNOW ALIGNMENT spell

From: russ brown (russelltbrown@netzero.net)
Date: 01/23/01


Hey everyone,

Here is a new spell that i just coded for my mud that i thought I would
share with the list.  I wrote this for my mage classes as an alternative
to detect alignment, which I now only give to priests. You have to cast
this spell on a specific creature or player to learn its alignment, but
the upside is that you can also cast it on objs to see if  they are
antigood or antievil or any combination thereof.


**in spell_parser.c  add this in with the other spello calls:

spello(SPELL_KNOW_ALIGN, "know alignment", 20, 10, 2, POS_STANDING,
        TAR_CHAR_ROOM | TAR_OBJ_INV | TAR_OBJ_ROOM | TAR_OBJ_EQUIP,
        FALSE, MAG_MANUAL);

then find the switch statement with MANUAL_SPELL calls and add:

case SPELL_KNOW_ALIGN: MANUAL_SPELL(spell_know_align); break;

**in spells.h dont forget to:
#define SPELL_KNOW_ALIGN <some number>

and near the end:
ASPELL(spell_know_align);

**in spells.c add this function:

ASPELL(spell_know_align)
{

  if ((victim == NULL) && (obj == NULL))
    return;

  if (victim) {
    if IS_EVIL(victim) {
      if (GET_ALIGNMENT(victim) <= -800)
        act("$N is evil incarnate!", FALSE, ch, 0, victim, TO_CHAR |
ACT_RED);
      else
        act("$N is evil!", FALSE, ch, 0, victim, TO_CHAR | ACT_RED);
    }
    else if IS_GOOD(victim) {
      if (GET_ALIGNMENT(victim) >= 800)
 act("$N is the personification of goodness!", FALSE, ch, 0, victim,
     TO_CHAR | ACT_CYN);
      else
 act("$N is good!", FALSE, ch, 0, victim, TO_CHAR | ACT_CYN);
    }
    else /* must be neutral */
      act("$N is neutral!", FALSE, ch, 0, victim, TO_CHAR | ACT_WHT);
  }

  if (obj) {
    if (OBJ_FLAGGED(obj, ITEM_ANTI_EVIL) &&
 OBJ_FLAGGED(obj, ITEM_ANTI_NEUTRAL) &&
 OBJ_FLAGGED(obj, ITEM_ANTI_GOOD))
      act("$p is mis-flagged, please report with BUG command!",
   FALSE, ch, obj, 0, TO_CHAR);
    else if (OBJ_FLAGGED(obj, ITEM_ANTI_EVIL) &&
 OBJ_FLAGGED(obj, ITEM_ANTI_NEUTRAL))
      act("$p is strictly good!", FALSE, ch, obj, 0, TO_CHAR | ACT_CYN);
    else if (OBJ_FLAGGED(obj, ITEM_ANTI_GOOD) &&
      OBJ_FLAGGED(obj, ITEM_ANTI_NEUTRAL))
      act("$p is strictly evil!", FALSE, ch, obj, 0, TO_CHAR | ACT_RED);
    else if (OBJ_FLAGGED(obj, ITEM_ANTI_GOOD) &&
      OBJ_FLAGGED(obj, ITEM_ANTI_EVIL))
      act("$p is strictly neutral!", FALSE, ch, obj, 0, TO_CHAR | ACT_WHT);
    else if (OBJ_FLAGGED(obj, ITEM_ANTI_EVIL))
      act("$p is anti-evil!", FALSE, ch, obj, 0, TO_CHAR | ACT_CYN);
    else if (OBJ_FLAGGED(obj, ITEM_ANTI_GOOD))
      act("$p is anti-good!", FALSE, ch, obj, 0, TO_CHAR | ACT_RED);
    else if (OBJ_FLAGGED(obj, ITEM_ANTI_NEUTRAL))
      act("$p is anti-neutral!", FALSE, ch, obj, 0, TO_CHAR | ACT_YEL);
    else
      act("$p has no alignment!", FALSE, ch, obj, 0, TO_CHAR | ACT_YEL);
  }
}




Shop online without a credit card
http://www.rocketcash.com
RocketCash, a NetZero subsidiary

--
   +---------------------------------------------------------------+
   | 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/03/01 PST