Re: SpecProc's for weapons.

From: DeMONTRios (
Date: 07/20/95

>From:           Skylar <>
>Subject:        Re: SpecProc's for weapons.
>To:    (Mark Crichton)
>Date sent:      Wed, 19 Jul 1995 22:27:17 -0400 (EDT)
>Copies to:

>>   I'm currently tinkering with Circle 3bpl8 and was trying to add a
>> special proc. for some items.  What I wanted the proc to do is during
>> combat, the item would automagically cast an offensive spell at the 
>> opponent.  Unfortunately, all I've gotten the proc to do is to cast the
>> spell when I wield/unwield the weapon in question.  This has caused...well..
>> some interesting side effects (namely when someone flees, and I unwield at the 
>> right moment, they die in another room, and get no exp/gold).
>> What I'd like to know is where I should start looking to fix this minor 
>> annoyance and/or what I need to hack up to make this work.
>I dont know where you'd look to fix that... actually I'm not even sure
>how you got it to activate on wield/unwield without explicitly trying to,
>but here's a quick hack to do what I think you want... (BTW I think it
>is debatable whether or not using a special process for this is the most
>efficiant way to have weapons cast spells in combat - I would/do use an
>APPLY_ for this sort of thing, with the spell contained therein, and stick
>it somewhere between the calculation of hitting and dammage.  
> * All this does is check if the weapon in question is equipped, and
> * if the person using it is fighting, then it grabs value 0 (which
> * is unused in weapons) as a spell number and casts it on whoever
> * is fighting the person using the "magical" weapon.
> **/
>  struct obj_data *weapon = me;
>  if (!weapon->worn_by || GET_POS(weapon->worn_by != POS_FIGHTING)
>    return 0;
>  else
>    cast_spell(weapon->worn_by, FIGHTING(weapon->worn_by, NULL, GET_OBJ_VAL(weapon, 0), NULL);
>  return 1;
>         Sky

Another manner to have it is to created another flag to objects, like 
SPELLEQ of something, with 6 fields:

- 1st : A spell which is cast upon the character which is wearing the 

- 2nd : Msg to self.

- 3rd : Msg to room.

- 4th : A offensive spell which is cast during the battle.

- 5th : Msg to self.

- 6th : Msg to room.

So, it would be this way:
a dark staff.
a scroll of identify.

'prompt'>rec identify staff

You feel informed.
Object: 'A dark staff' , Item type : WEAPON
Weight: 24, Value:100000, Rent: 33300
Defensive spells cast on user: Protection from good
Offensive spells cast during battle: Dispel good
Damage Dice is '3D4' for an average per-round damage of 7.5
Can affect you as:
    AFFECTS: DEX by -4
It's just an idea, but I think it is a better, much elegant and much 
general way to do this.

Demetrius aka Akuma

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