[Circle] Mobprogs & spells

From: Linebacker (linebacker@microlink.net)
Date: 08/17/96


What is the exact syntax for a mobprog that will cast spells.

I have tried:

cast 'shooting stars' $n

cast shooting stars $n

my complete prog looked something like this:

if rand(25)
if ispc($n)
if check for fighting (can't remember at the moment)
mpecho blah blah
cast 'shooting stars' $n
endif
endif
endif
~
|

The mpecho works fine but it will not cast the spell. I thought at first
that mana
was the reason, so I set the mob's mana to 1000. (the spell needs only 350)
And yes
the spell shooting stars is not the problem, it works fine with the players.
Just to
be safe I tried this with stock spells and still to no avail.

Thanks for any help,

Chuck

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+


X-SystemInfo: MyE-Mail: EMail
X-Message-No: 3775 (database)
From: Per Nielsen <lk4150@krull.dk>
To: cod <cod@utfbbs.utelfla.com>
Subject: Deck of Many things
Date: Sat, 17 Aug 96 21:34:00
Message-ID: <12832.6803T1294T481@krull.dk>
MIME-Version: 1.0
X-Mailer: THOR 2.31 (Amiga;TCP/IP) *UNREGISTERED*

SPECIAL (deck_of_many_things)
{
   void die(struct char_data * ch, struct char_data *killer);
   struct obj_data *obj = (struct obj_data *) me;
   int card, jester = 0, fool = 0;
   int number_to_draw;
   int i,ii;
   struct obj_data *j, *t;
   struct char_data *tmpch;
   struct affected_type af;
   ACMD (do_save);

   if (CMD_IS("put") || CMD_IS("give") || CMD_IS("drop"))  {
     strcpy (buf,argument);
     half_chop(buf,buf1,buf2);
     if (isname(buf1,obj->name))
     {
       sprintf(buf,"You are unable to let go off %s.",obj->short_description);
       send_to_char(buf,ch);
       return TRUE;
     }
   }
   if (!CMD_IS("draw"))
     return 0;

    if (GET_EQ(ch,WEAR_HOLD) != obj)
    {
      send_to_char ("You have to hold the deck to be able to draw from
it.\r\n",ch);
      return 1;
    }

   if (!*argument)
   {
     send_to_char("You have state the number of cards you wish to
draw.\r\n",ch);
     return TRUE;
   }

   if ((number_to_draw = atoi(argument)) <= 0)
   {
     send_to_char("How many cards do you wanna draw ?\r\n",ch);
     return TRUE;
   }

   if (number_to_draw > 4)
   {
     send_to_char("You are only allowed to draw a max of 4 cards.\r\n",ch);
     return TRUE;
   }

   if (IS_IMMORTAL(ch))
   {
     send_to_char("You are not allowed to use this object.\r\n",ch);
     return TRUE;
   }

   for (i = 0; i < number_to_draw;i++)
   {
   card = number (1,22);

   switch (card) {
     case 1:
       send_to_char ("You draw The Sun.\r\n",ch);
       act("$n draws The Sun from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 2:
       send_to_char ("You draw The Moon.\r\n",ch);
       act("$n draws The Moon from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 3:
       send_to_char ("You draw The Star.\r\n",ch);
       act("$n draws The Star from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 4:
       send_to_char ("You draw The Comet.\r\n",ch);
       act("$n draws The Comet from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 5:
       send_to_char ("You draw The Throne.\r\n",ch);
       act("$n draws The Throne from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 6:
       send_to_char ("You draw The Key.\r\n",ch);
       act("$n draws The Key from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 7:
       send_to_char ("You draw The Knight.\r\n",ch);
       act("$n draws The Knight from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 8:
       send_to_char ("You draw The Gem.\r\n",ch);
       act("$n draws The Gem from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 9:
       send_to_char ("You draw THE VOID.\r\n",ch);
       act("$n draws THE VOID from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 10:
       send_to_char ("You draw The Flames.\r\n",ch);
       act("$n draws The Flames from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 11:
       send_to_char ("You draw The Skull.\r\n",ch);
       act("$n draws The Skull from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 12:
       send_to_char ("You draw The Talons.\r\n",ch);
       act("$n draws The Talons from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 13:
       send_to_char ("You draw The Ruin.\r\n",ch);
       act("$n draws The Ruin from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 14:
       send_to_char ("You draw The Euryale.\r\n",ch);
       act("$n draws The Euryale from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 15:
       send_to_char ("You draw The Rogue.\r\n",ch);
       act("$n draws The Rogue from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 16:
       send_to_char ("You draw The Balance.\r\n",ch);
       act("$n draws The Balance from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 17:
       if (jester == 0) {
         jester ++;
         send_to_char ("You draw The Jester.\r\n",ch);
         act("$n draws The Jester from $p.",FALSE,ch,obj,0,TO_ROOM);
       }  else {
        i--;
        continue;
       }
       break;
     case 18:
       if (fool == 0)  {
         fool++;
         send_to_char ("You draw The Fool.\r\n",ch);
         act("$n draws The Fool from $p.",FALSE,ch,obj,0,TO_ROOM);
       } else {
        i--;
        continue;
       }
       break;
     case 19:
       send_to_char ("You draw The Vizier.\r\n",ch);
       act("$n draws The Vizier from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 20:
       send_to_char ("You draw The Idiot.\r\n",ch);
       act("$n draws The Idiot from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 21:
       send_to_char ("You draw The DONJON.\r\n",ch);
       act("$n draws The DONJON from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     case 22:
       send_to_char ("You draw The Balance.\r\n",ch);
       act("$n draws The Balance from $p.",FALSE,ch,obj,0,TO_ROOM);
       break;
     }

    switch (card) {
      case 1:
        j = read_object(31058, VIRTUAL);
        obj_to_char(j,ch);
        GET_EXP(ch) += 500000;
        send_to_char("A ring suddenly appears in your hands.\r\n",ch);
        act("A ring appears in $n's hands.",FALSE,ch,0,0,TO_ROOM);
        break;
      case 2:
        send_to_char("You feel more powerfull.\r\n",ch);
        act("$n seems more powerfull.",FALSE,ch,0,0,TO_ROOM);
        GET_MAX_HIT(ch) += number (15,30);
        GET_MAX_MANA(ch) += number (15,30);
        break;
      case 3:
        Gain_Ability(ch,2,GAIN_NONE);
        break;
      case 4:
        send_to_char("You feel almost ready to level. Maybe on more
kill!",ch);
        act("$n gains tons of experience.",FALSE,ch,0,0,TO_ROOM);
        GET_EXP(ch) = titles[(int) GET_CLASS(ch)][(int) (GET_LEVEL(ch)+1)].exp
-5;
        break;
      case 5:
        send_to_char("You feel like a true leader.\r\n",ch);
        act("$n suddenly look like a true leader.",FALSE,ch,0,0,TO_ROOM);
        ch->real_abils.cha = ((ubyte) 18);
        ch->aff_abils = ch->real_abils;
        break;
      case 6:
        send_to_char("A sword appears in your hand.\r\n",ch);
        act("A sword appears in $n's hands.",FALSE,ch,0,0,TO_ROOM);
        j = read_object(31020, VIRTUAL);
        obj_to_char(j,ch);
        break;
      case 7:
        send_to_char("You gain the service of a fighter.\r\n",ch);
        act("A fighter appears to assist $n on $s
quests.",FALSE,ch,0,0,TO_ROOM);
        tmpch = read_mobile(3060,VIRTUAL);
        char_to_room(tmpch,ch->in_room);
        add_follower(tmpch, ch);
        SET_BIT(AFF_FLAGS(tmpch), AFF_CHARM);
        break;
      case 8:
        send_to_char("You gain 50.000 gold coins.\r\n",ch);
        act("A lot of gold fall into the hands of $n.",FALSE,ch,0,0,TO_ROOM);
        GET_GOLD(ch) += 50000;
        break;
      case 9:
        send_to_char("You stupid mother..., you drew the wrong card. YOU
DIE.\r\n",ch);
        act("$n dies in screams of pain.",FALSE,ch,0,0,TO_ROOM);
        for (i = 0; i < NUM_WEARS; i++)
          if (GET_EQ(ch, i))
            extract_obj(unequip_char(ch,i));
        while (ch->carrying) {
          j = ch->carrying;
          extract_obj(j);
        }
        GET_EXP(ch) = GET_EXP(ch) / 2;
        die(ch,NULL);
        return TRUE;
        break;
      case 10:
        send_to_char("Your armour feels very hot.\r\n",ch);
        act("$n's armour starts to smoke.",FALSE,ch,0,0,TO_ROOM);
        af.type      = SPELL_HEAT_STUFF;
        af.duration  = 2400;
        af.modifier  = 0;
        af.location  = 0;
        af.bitvector = 0;
        if (!affected_by_spell(ch,SPELL_HEAT_STUFF))
          affect_to_char (ch,&af);
        break;
      case 11:
        tmpch = read_mobile(6999,VIRTUAL);
        SET_BIT(MOB_FLAGS(tmpch), MOB_CALL);
        j = read_object(6999,VIRTUAL);
        equip_char(tmpch,j,16);
        char_to_room(tmpch,ch->in_room);
        hit(ch,tmpch,TYPE_UNDEFINED);
        send_to_char("You must face Death.\r\n",ch);
        act("Death appears and attacks $n.",FALSE,ch,0,0,TO_ROOM);
        break;
      case 12:
        send_to_char("All your magic items are destroyed.\r\n",ch);
        act("Some of $n's equipment suddenly
disappears.",FALSE,ch,0,0,TO_ROOM);
        for (ii = 0; ii < NUM_WEARS; ii++)
          if (GET_EQ(ch, ii) && IS_OBJ_STAT(GET_EQ(ch, ii),ITEM_MAGIC))
          {
            t = unequip_char(ch,ii);
            extract_obj(t);
          }
        for (j = ch->carrying; j; j = j->next_content)
          if (IS_OBJ_STAT(j,ITEM_MAGIC))
        {
          obj_from_char(j);
          extract_obj(j);
        }
        break;
      case 13:
        send_to_char("You are stripped of all your gold.\r\n",ch);
        act("The gold in $n's pockets disintegrate.",FALSE,ch,0,0,TO_ROOM);
        GET_GOLD(ch) = 0;
        GET_BANK_GOLD(ch) = 0;
        break;
      case 14:
        send_to_char("Your ability to avoid magic is reduced.\r\n",ch);
        act("$n seems more vulnerable to magic.",FALSE,ch,0,0,TO_ROOM);
        af.type      = SPELL_DECK_OF_THINGS;
        af.duration  = 2400;
        af.modifier  = 3;
        af.location  = APPLY_SAVING_PETRI;
        af.bitvector = 0;
        if (!affected_by_spell(ch,SPELL_DECK_OF_THINGS))
          affect_to_char (ch,&af);
        break;
      case 15:
        send_to_char("A henchman appears and attacks you.",ch);
        act("A henchman appears and attacks $n",FALSE,ch,0,0,TO_ROOM);
        tmpch = read_mobile(3068,VIRTUAL);
        char_to_room(tmpch,ch->in_room);
        hit (tmpch,ch,TYPE_UNDEFINED);
        break;
      case 16:
        if (IS_EVIL(ch))  {
          send_to_char("You feel divine.\r\n",ch);
          act("$n becomes devine.",FALSE,ch,0,0,TO_ROOM);
          GET_ALIGNMENT(ch) = 1000;
        } else
         if (IS_GOOD(ch)) {
            send_to_char("You feel evil.\r\n",ch);
            act("$n becomes evil.",FALSE,ch,0,0,TO_ROOM);
            GET_ALIGNMENT(ch) = -1000;
         } else {
           switch (number(0,1))  {
            case 0:
              GET_ALIGNMENT(ch) = -1000;
              send_to_char("You feel evil.\r\n",ch);
              act("$n becomes evil.",FALSE,ch,0,0,TO_ROOM);
              break;
            case 1:
              GET_ALIGNMENT(ch) = 1000;
              send_to_char("You feel divine.\r\n",ch);
              act("$n becomes devine.",FALSE,ch,0,0,TO_ROOM);
              break;
           }
         }
        break;
      case 17:
        switch (number(0,1))  {
          case 0:
            send_to_char("You become more experienced.\r\n",ch);
            act("$n seems more experienced.",FALSE,ch,0,0,TO_ROOM);
            GET_EXP(ch) += 100000;
            break;
          case 1:
            send_to_char("You have to draw 2 more cards.\r\n",ch);
            act("$n is forced to draw 2 more cards.",FALSE,ch,0,0,TO_ROOM);
            i -= 2;
            break;
        }
        break;
      case 18:
        send_to_char("You become less experienced, and must draw again.",ch);
        act("$n becomed less experienced, and must draw a new
card.",FALSE,ch,0,0,TO_ROOM);
        GET_EXP(ch) -= 500000;
        i--;
        break;
      case 19:
        send_to_char("You get a high fever.\r\n",ch);
        act("All of a sudden $n seems to get a high
fever.",FALSE,ch,0,0,TO_ROOM);
        af.type      = SPELL_PLAQUE;
        af.duration  = 2400;
        af.modifier  = 0;
        af.location  = 0;
        af.bitvector = 0;;
        if (!affected_by_spell(ch,SPELL_PLAQUE))
          affect_to_char (ch,&af);
        break;
      case 20:
        send_to_char("You become more stupid.\n\r",ch);
        act("$n gets a look of incompetence in his
eyes.",FALSE,ch,0,0,TO_ROOM);
        ch->real_abils.intel -= number(1,4);
        if (ch->real_abils.intel < 3)
          ch->real_abils.intel = 3;
        break;
      case 21:
        send_to_char("You feel less powerfull.\r\n",ch);
        act("$n seems less powerfull.",FALSE,ch,0,0,TO_ROOM);
        GET_MAX_HIT(ch) -= number (20,40);
        GET_MAX_MANA(ch) -= number (20,40);
        break;
      case 22:
        send_to_char("You become Paralyzed.\r\n",ch);
        act("$n becomes paralyzed.",FALSE,ch,0,0,TO_ROOM);
        for (ii = 0; ii < NUM_WEARS; ii++)
          if (GET_EQ(ch, ii) && IS_OBJ_STAT(GET_EQ(ch, ii),ITEM_MAGIC))
          {
            t = unequip_char(ch,ii);
            extract_obj(t);
          }
        af.type      = SPELL_DECK_OF_THINGS;
        af.duration  = 2400;
        af.modifier  = 0;
        af.location  = 0;
        af.bitvector = AFF_PARALYSIS;
        if (!affected_by_spell(ch,SPELL_DECK_OF_THINGS))
          affect_to_char (ch,&af);
        break;
    }  /* Switch */

  } /* for */
  act ("$p disappears in a puff of smoke.",FALSE,ch,obj,0,TO_CHAR);
  act ("$p disappears in a puff of smoke.",FALSE,ch,obj,0,TO_ROOM);
  j = unequip_char(ch,WEAR_HOLD);
  extract_obj(j);
  do_save(ch,"",0,0);
  return TRUE;
}



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