function crumorph_equip() /* entry=173 class_id=0x0318 slot=0x0A */
{
  var
    referent, /* [BP+00h] type=0x69 */
    var, /* [BP+0Ah] type=0x69 */
    n, /* [BP-02h] type=0x24 */
    lastAct; /* [BP-04h] type=0x69 */

  set_info(0x0211, *(arg_06));
  process_exclude();
  /* loop_selector n in nearby_items(family=6, origin=arg_06) */
  while (!condition) {
    if (!Actor.isNPC(n)) {
      if (Actor.GetNPCDataField0x63_00B(n) == Item.getQLo(arg_06)) {
        if (Actor.isDead(n) == 0) {
          NPC.slot_2B(n);
          if (retval) {
            return;
          }
          lastAct = GetNPCDataField0x2_050(n);
          spawn FREE.waitNTimerTicks(pid, 3, 0x00000000);
          suspend;
          spawn NPC.slot_28(pid, n);
          suspend;
          while (getTargetNPCNumMaybe() <= 1) {
            spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
            suspend;
          }
          if (Actor.isDead(n) == 0) {
            spawn TRIGGER.slot_20(pid, 0, *(arg_06), arg_06);
            suspend;
          }
          else {
            spawn TRIGGER.slot_20(pid, 1, *(arg_06), arg_06);
            suspend;
          }
          return;
        }
      }
    }
    /* loopnext  */
  }
  return;
}
