Manual:DIL Manual/unequip()

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:16, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

unequip()

Procedure. Takes off an object a character is wearing.

unequip(u : unitptr)

The object stays in the character's inventory but is no longer worn: its light stops counting for the wearer and its transfer affects come off the wearer. Like addequip() it is silent: no messages, and it isn't the remove command.

Parameters

Name Type Meaning
u unitptr The worn object.

Notes

  • Nothing happens when u is null, isn't an object, or isn't worn. So unequip(equipment(ch, WEAR_WIELD)) is safe when nothing is wielded.
  • To take the object away from the character as well, link() it somewhere after unequipping it.

Example

dilbegin disarm(victim : unitptr);
var
   wpn : unitptr;
code
{
   wpn := equipment(victim, WEAR_WIELD);
   if (wpn == null)
      return;
   unequip(wpn);
   link(wpn, victim.outside);
   act("$1n knocks $2n out of $3n's hands.", A_ALWAYS, self, wpn, victim, TO_ROOM);
   act("$1n knocks $2n out of your hands.", A_ALWAYS, self, wpn, victim, TO_VICT);
}
dilend

Takes the wielded weapon from a character and drops it on the floor.

See also