Re: casting-weapons spec_proc

From: Amiga at Tietgen (pro08@dec51.tietgen.dk)
Date: 11/28/95


On Tue, 28 Nov 1995 SROWAN@WVNVAXA.WVNET.EDU wrote:

> Just wondering if anyone has coded a spec_proc for weapons to cast spells,
> and if so, would you be willing to show me how you did it..
> Thanks
> 
> Steve
> @
> 

Well, I have done this rather simply, but at least it works :)

First add a check in perform_violence, right after the check for mobs 
spec_procs that look something like this. It will check any weapon 
wielded for a spec_proc, and if its there call it.

if (GET_EQ(ch,WEAR_WIELD) && GET_OBJ_SPEC(GET_EQ(ch,WEAR_WIELD)) != NULL)
 (obj_index[GET_EQ(ch,WEAR_WIELD)->item_number].func) (ch,GET_EQ(ch,WEAR_WIELD),0,"");


Next, make the spec_proc for the weapon, like the one below, which is a 
sword casting blindness.
Don't forget to make the assign in spec_assigns.

SPECIAL (joshua_sword)
{
  int lev;

  if (cmd)
    return FALSE;

  if (GET_POS(ch) != POS_FIGHTING)
    return FALSE;

  if (GET_EQ(ch,WEAR_WIELD) != me)
    return FALSE;

  if (IS_SET(AFF_FLAGS(FIGHTING(ch)),AFF_BLIND))
    return FALSE;

  if (number(1,100) < 65)
  {
       lev = GET_LEVEL(ch);
       if (lev < 15)
         lev = 15;
       call_magic(ch, FIGHTING(ch), 0, SPELL_BLINDNESS, lev, CAST_SPELL);
       return FALSE;
  }
  return FALSE;
}

Well that's all there is to it.

Amiga



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