Re: item cast spell on proc

From: Daniel Koepke (dkoepke@california.com)
Date: 02/09/97


On Sun, 9 Feb 1997, Brian Williams - Nashak wrote:

> okay.. I'm boggled.. :P how would I get it so that if yer wielding
> a certain item with a proc on it.. and you say something.. i.e.
> say destiny
> then it say like "Your weapon hums in yer hand!"
> and then cast the spell from the proc
> not like wpn.w.spell.patch, just a proc for a single weapon..

Just like normal.  Catch the 'say' command in your spec-proc, call
do_say() so that it actually executes the say command, then check
the argument for what was passed.  If it's "destiny", then show the
message, and cast the spell.  The following, when wielding a weapon
with the "example_spec" spec proc set on it and fighting and saying
"fireball" will cast the fireball spell at level 12 on the opponent.
Written in mailer (but then again, how often do I post code that
isn't? :)).

  SPECIAL(example_spec) {
    struct obj_data *obj = (struct obj_data *) me;
   
    if (!obj->worn_by || obj->worn_on != WEAR_WIELD || !FIGHTING(ch) ||
        !CMD_IS("say") || !str_cmp(argument, "fireball"))
      return FALSE;

    do_say(ch, argument, 0, 0);
    act("$p hums powerfully in your hands!", FALSE, ch, obj, 0, TO_CHAR);
    act("$p hums powerfully in $n's hands!", FALSE, ch, obj, 0, TO_ROOM);
    call_magic(ch, FIGHTING(ch), NULL, SPELL_FIREBALL, 12, CAST_SPELL);
  }


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


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



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