spec_pro question

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


I am trying to write a cleric spec_pro so they cast in combat, I based it 
on the magic_user spec_pro that I just rewrote. The magic_user spec_proc 
works great, but clerics will not cast in combat.

<code to follow>

SPECIAL(cleric_ao)
{
        int num_used, tmp = 0;
        struct char_data *vict;
 
        if (cmd || GET_POS(ch) != POS_FIGHTING)
         return FALSE;
 
   /* pseudo-randomly choose someone in the room who is fighting me */
  for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room)
--More--(52%)
    if (FIGHTING(vict) == ch && !number(0, 4))
      break;
 
  /* if I didn't pick any of those, then just slam the guy I'm fighting */
  if (vict == NULL)
    vict = FIGHTING(ch);
 
        num_used = 8;
        tmp = number(1, 10);
 
        if ((tmp == 4) || (tmp == 5)) {
        tmp = number(1, num_used);
 
        if ((tmp == 1) && (GET_LEVEL(ch) > 13)) {
         cast_spell(ch, vict, NULL, SPELL_EARTHQUAKE);
         return TRUE;
         }
 
        if ((tmp == 2) && ((GET_LEVEL(ch) > 8) && IS_EVIL(vict))) {
         cast_spell(ch, vict, NULL, SPELL_DISPEL_EVIL);
         return TRUE;
         }
--More--(54%)
 
        if ((tmp == 3) && ((GET_LEVEL(ch) > 8) && IS_GOOD(vict))) {
         cast_spell(ch, vict, NULL, SPELL_DISPEL_GOOD);
         return TRUE;
         }
 
        if ((tmp == 4) && (GET_LEVEL(ch) > 4 && affected_by_spell(ch, 
SPELL_CURSE))) {
         cast_spell(ch, ch, NULL, SPELL_REMOVE_CURSE);
         return TRUE;
         }
 
        if ((tmp == 5) && (GET_LEVEL(ch) > 6 && affected_by_spell(ch, 
SPELL_POISON))) {
         cast_spell(ch, ch, NULL, SPELL_REMOVE_POISON);
         return TRUE;
         }
 
        if (tmp == 6) {
         cast_spell(ch, ch, NULL, SPELL_CURE_LIGHT);
         return TRUE;
         }
--More--(57%)
 
        if (tmp == 7 && GET_LEVEL(ch) > 8) {
         cast_spell(ch, ch, NULL, SPELL_CURE_CRITIC);
         return TRUE;
         }
 
        if (tmp == 8 && GET_LEVEL(ch) > 10) {
         cast_spell(ch, ch, NULL, SPELL_HEAL);
         return TRUE;
         }
        }
return FALSE;
 
}
 
 
--Ziz, NetShamen



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