Re: [CODE] Problems with disarm skill...

From: Leonardo Herrera (leherrer@ENTELCHILE.NET)
Date: 02/13/98


John Evans wrote:
>
> On Thu, 12 Feb 1998, S. Mead wrote:
>
> > I have added a SKILL_DISARM and it works fine, up until my mud freezes
> > during combat, not crashes, but freezes and dumps out the core with some
> > missing tic error after about 5 minutes...
> >
> > Here is what I am using for disarm:
> >
> > ACMD(do_disarm)
> > {
> [snip]
> >     damage(ch, vict, 0, SKILL_DISARM);
> >     obj_to_room(GET_EQ(vict, WEAR_WIELD), ch->in_room);
> >     WAIT_STATE(ch, 2*PULSE_VIOLENCE);
> [snip]
> > }
>
> Try:
>
> obj_to_room(unequip_char(vict, GET_EQ(vict, WEAR_WIELD)), vict->in_room);
>
> Also,
>         Make sure that your improve skill doesn't have an infinte loop
> in it.
>
> John Evans <evansj@hi-line.net>  --  http://www.hi-line.net/~evansj/
>
> Any sufficiently advanced technology is indistinguishable from magic.
> --Arthur C. Clarke

Hum... from my code:

[...]

  if (GET_EQ(vict, WEAR_WIELD))
  {
    if (GET_LEVEL(vict) >= LVL_IMMORT && GET_LEVEL(ch) < LVL_IMPL)
    {
       send_to_char( "Are you funny today?\r\n", ch );
       return;
    }
    if (GET_POS(vict) > POS_STUNNED && !FIGHTING(vict)) {
      set_fighting(vict, ch);
      if (MOB_FLAGGED(vict, MOB_MEMORY) && !IS_NPC(ch) &&
          (GET_LEVEL(ch) < LVL_IMMORT))
        remember(vict, ch);
    }
    if (prob)
    {

  /* Please correct the messages... My code is in spanish... */


      obj = unequip_char(vict, WEAR_WIELD);
      obj_to_room( obj, ch->in_room);
      send_to_char(CCRED(vict, C_CMP), vict );

      act( "$N disarms you!", FALSE, vict, 0, ch, TO_CHAR );
      send_to_char(CCNRM(vict, C_CMP), vict );

      act( "$N disarms $n making $p fly out the room!", FALSE, vict,
obj, ch, TO_ROOM );
      act( "You disarm $N and $p fly out!", FALSE, ch, obj, vict,
TO_CHAR );

    }
    else
    {
      act("You fail!", FALSE, ch, 0, 0, TO_CHAR );
    }
  }
  else
  {
    send_to_char( "But he has no weapon!\r\n", ch );
  }
}


Well, this code works, but you can get it from my page :)

http://www.geocities.com/TimesSquare/Castle/4515/Disarm.txt

Bye!

--
Leonardo Herrera L.
mailto:leherrer@entelchile.net
http://www.geocities.com/TimesSquare/Castle/4515/
  "Me voy a subai, me voy a costai, me voy a tapai y
me voy a hacei tuto."
        -- Ruy


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



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