i tried this and it compiles just fine. But casting the spell gives me the right message for case 4 but no spell is cast.
case SPELL_TESTSPELL:
if (IS_MAGIC_USER(ch))
send_to_char(ch, "\r\n");
act("$n", FALSE, ch, NULL, NULL, TO_ROOM);
switch (rand_number(1, 4)) {
case 1:dam=10;
act("$N", FALSE, ch, NULL, victim, TO_NOTVICT);
act("", TRUE, ch, NULL, victim, TO_VICT);
act("$N", FALSE, ch, NULL, victim, TO_CHAR);
break;
case 2:dam=20;
act("$N", FALSE, ch, NULL, victim, TO_NOTVICT);
act("", TRUE, ch, NULL, victim, TO_VICT);
act("$N", FALSE, ch, NULL, victim, TO_CHAR);
break;
case 3:dam=30;
act("$N", FALSE, ch, NULL, victim, TO_NOTVICT);
act("", TRUE, ch, NULL, victim, TO_VICT);
act("$N", FALSE, ch, NULL, victim, TO_CHAR);
break;
case 4:dam=0;
act("$N", FALSE, ch, NULL, victim, TO_NOTVICT);
act("", TRUE, ch, NULL, victim, TO_VICT);
act("$N", FALSE, ch, NULL, victim, TO_CHAR);
call_magic(victim, FIGHTING(ch), 0, SPELL_POISON, GET_LEVEL(ch), CAST_SPELL); I tried switching around victim and ch, didn't work either.
break;
default:
dam=100;
break;
}
break;
Any ideas ?