Sleep spell problems

From: Mud Admin (empire@www.cedarnet.com)
Date: 07/05/96


I made sleep castable in combat, and I want it to work out so that if 
your target was put to sleep combat stops. It sorta works.

However, the target that should be asleep is not. Not really, they are 
affected by sleep for the correct duration, but they do not actually 
'fall asleep' as it were. They can look around, and move and so forth.

<code to follow>

  case SPELL_SLEEP:
    if (!pk_allowed && !IS_NPC(ch) && !IS_NPC(victim))
      return;
    if (IS_UNDEAD(victim) || MOB_FLAGGED(victim, MOB_NOSLEEP)) {
      send_to_char("Your magic seems ineffective!\r\n", ch);
      return;
      }
    if (mag_savingthrow(victim, savetype)) {
      send_to_char("Your magic seems ineffective!\r\n", ch);
      return;
      }
      dam = dice(0, 100);
 
    if ((IS_HALF(victim) && (dam <= 30)) || (IS_ELF(victim) && (dam <= 
90)) ) {
      send_to_char("Your elven blood prevents the spell from affecting 
you.\r\n", victim);
      send_to_char("Your magic seems ineffective!\r\n", ch);
      return;
      }
 
    af[0].duration = 4 + (GET_LEVEL(ch) >> 2);
    af[0].bitvector = AFF_SLEEP;
 
    if (GET_POS(victim) > POS_SLEEPING) {
      act("You feel very sleepy...  Zzzz......", FALSE, victim, 0, 0, 
TO_CHAR);
      act("$n goes to sleep.", TRUE, victim, 0, 0, TO_ROOM);
      GET_POS(victim) = POS_SLEEPING;
      }
    if (FIGHTING(victim)) {
      stop_fighting(victim);
      stop_fighting(ch);
      }
    break;


Anyone got any useful insights?

--Ziz, NetShamen



This archive was generated by hypermail 2b30 : 12/07/00 PST