[Code Info] Knocking a Weapon out of a Players hand.

From: Mud Administration (mudadmin@unix.aardvarkol.com)
Date: 12/24/96


I THINK I made a process to allow a MOB to knock a weapon out of 
someone's Hand....  Lemme know if ya like it or what I need to do to fix 
it up more....  I took "some" of the code a Minute ago from Sammy's 
"Switcher" code....  But I though this May help some...  I know I wanted it.

If you would....  If you have any additions to this code, or Fixes to 
this code...  Please mail them to the list so that others can share in it...

Then maybe in the heartbeat() function, you can write a code to call this 
function....

But anyways...  Here's My "UnTested" Code....  Use at your own risk...  <g>

void knock_wield(struct char_data * ch)
{
  struct char_data *tch;
  struct obj_data *obj;

  if (!(obj = GET_EQ(ch, pos))) {
    log("Error in perform_remove: bad pos passed.");
    return;
  }

  if(FIGHTING(ch))
    for(tch = world[ch->in_room].people; tch;tch = tch->next_in_room)
      if(tch && (tch != ch) && FIGHTING(tch) == ch && !number(0, 30)) {
        obj_to_room(unequip_char(tch, WEAR_WIELD), ch->in_room);
        act("You stop using $p.", FALSE, ch, obj, 0, TO_CHAR);
        act("$n stops using $p.", TRUE, ch, obj, 0, TO_ROOM);
      }
}

Thanks....

 Mud Administrator at "Lost Order of the DAMNED!"
     (telnet://206.151.13.163 6000)

+-----------------------------------------------------------+
| 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