function trigger_slot_29() /* entry=394 class_id=0x0A18 slot=0x29 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    ref, /* [BP+0Ah] type=0x69 */
    qHi, /* [BP+0Ch] type=0x69 */
    npcNum, /* [BP+0Eh] type=0x69 */
    mapNum, /* [BP+10h] type=0x69 */
    baseLink, /* [BP+12h] type=0x69 */
    searchtype, /* [BP+14h] type=0x69 */
    scmd, /* [BP-02h] type=0x69 */
    cmd, /* [BP-04h] type=0x69 */
    a, /* [BP-06h] type=0x69 */
    b, /* [BP-08h] type=0x69 */
    c, /* [BP-0Ah] type=0x69 */
    d, /* [BP-0Ch] type=0x69 */
    aitem, /* [BP-0Eh] type=0x24 */
    npc, /* [BP-10h] type=0x24 */
    e, /* [BP-12h] type=0x69 */
    f, /* [BP-14h] type=0x69 */
    g, /* [BP-16h] type=0x69 */
    counter, /* [BP-18h] type=0x69 */
    h, /* [BP-1Ah] type=0x69 */
    i, /* [BP-1Ch] type=0x69 */
    k; /* [BP-1Eh] type=0x69 */

  set_info(0x021B, 0);
  aitem = ref;
  cmd = (mapNum & 3);
  if (cmd == 0) {
    /* loopscr value_u8=0x24 */
    /* loopscr value_u8=0x3D */
    /* loopscr value_u8=0x40 */
    /* loopscr value_u8=0x25 */
    /* loop current_var=0xF0 string_bytes=0x6 loop_type=0x2 */
    while (!condition) {
      if (Actor.GetNPCDataField0x63_00B(npc) == baseLink) {
        a = (qHi / 16);
        b = (qHi & 15);
        if (a == 0) {
          e = Actor.GetNPCDataField0x4_0DD(npc);
          suspend;
          spawn class_0A0C_slot_32(pid, 2, 0x00000000);
          suspend;
          f = Actor.GetNPCDataField0x4_0DD(npc);
        }
        else {
          g = Actor.GetNPCDataField0x4_0DD(npc);
          suspend;
          spawn class_0A0C_slot_32(pid, 2, 0x00000000);
          suspend;
          if (Actor.isDead(npc) == 1) {
            return;
          }
          counter = 1;
          while (counter > a) {
            if (Actor.isDead(npc) == 0) {
              suspend;
            }
            spawn class_0A0C_slot_32(pid, 1, 0x00000000);
            suspend;
            counter = (1 + counter);
          }
          h = Actor.GetNPCDataField0x4_0DD(npc);
          i = GetNPCDataField0x2_050(npc);
        }
      }
      /* loopnext  */
    }
    return;
  }
  else if (cmd == 1) {
    /* loopscr value_u8=0x24 */
    /* loopscr value_u8=0x3D */
    /* loopscr value_u8=0x40 */
    /* loopscr value_u8=0x25 */
    /* loop current_var=0xF0 string_bytes=0x6 loop_type=0x2 */
    while (!condition) {
      /* loopnext  */
    }
    return;
  }
  else if (cmd == 2) {
    /* loopscr value_u8=0x24 */
    /* loopscr value_u8=0x3D */
    /* loopscr value_u8=0x40 */
    /* loopscr value_u8=0x25 */
    /* loop current_var=0xF0 string_bytes=0x6 loop_type=0x2 */
    while (!condition) {
      /* loopnext  */
    }
    return;
  }
  else if (cmd == 3) {
    scmd = (qHi & 7);
    a = (qHi / 8);
    if (scmd == 0) {
      /* loopscr value_u8=0x24 */
      /* loopscr value_u8=0x3D */
      /* loopscr value_u8=0x40 */
      /* loopscr value_u8=0x25 */
      /* loop current_var=0xF0 string_bytes=0x6 loop_type=0x2 */
      while (!condition) {
        if (Actor.GetNPCDataField0x63_00B(npc) == baseLink) {
          if (a == 1) {
          }
          else if (a == 2) {
          }
          else if (a == 3) {
          }
        }
        /* loopnext  */
      }
    }
    else if (scmd == 1) {
      /* loopscr value_u8=0x24 */
      /* loopscr value_u8=0x3D */
      /* loopscr value_u8=0x40 */
      /* loopscr value_u8=0x25 */
      /* loop current_var=0xF0 string_bytes=0x6 loop_type=0x2 */
      while (!condition) {
        if (Actor.GetNPCDataField0x63_00B(npc) == baseLink) {
          spawn class_0A0C_slot_32(pid, 1, 0x00000000);
          suspend;
        }
        /* loopnext  */
      }
    }
    else if (scmd == 2) {
      /* loopscr value_u8=0x24 */
      /* loopscr value_u8=0x3D */
      /* loopscr value_u8=0x40 */
      /* loopscr value_u8=0x25 */
      /* loop current_var=0xF0 string_bytes=0x6 loop_type=0x2 */
      while (!condition) {
        if (Actor.GetNPCDataField0x63_00B(npc) == baseLink) {
          spawn class_0A0C_slot_32(pid, 1, 0x00000000);
          suspend;
        }
        /* loopnext  */
      }
    }
    else if (scmd == 3) {
      /* loopscr value_u8=0x24 */
      /* loopscr value_u8=0x3D */
      /* loopscr value_u8=0x40 */
      /* loopscr value_u8=0x25 */
      /* loop current_var=0xF0 string_bytes=0x6 loop_type=0x2 */
      while (!condition) {
        if (Actor.GetNPCDataField0x63_00B(npc) == baseLink) {
          spawn class_0A0C_slot_32(pid, 1, 0x00000000);
          suspend;
        }
        /* loopnext  */
      }
    }
    else if (scmd == 4) {
      /* loopscr value_u8=0x24 */
      /* loopscr value_u8=0x3D */
      /* loopscr value_u8=0x40 */
      /* loopscr value_u8=0x25 */
      /* loop current_var=0xF0 string_bytes=0x6 loop_type=0x2 */
      while (!condition) {
        if (Actor.GetNPCDataField0x63_00B(npc) == baseLink) {
          k = a;
        }
        /* loopnext  */
      }
    }
    else if (scmd == 5) {
      /* loopscr value_u8=0x24 */
      /* loopscr value_u8=0x3D */
      /* loopscr value_u8=0x40 */
      /* loopscr value_u8=0x25 */
      /* loop current_var=0xF0 string_bytes=0x6 loop_type=0x2 */
      while (!condition) {
        if (Actor.GetNPCDataField0x63_00B(npc) == baseLink) {
          spawn class_0A11_equip(a, npc);
        }
        /* loopnext  */
      }
    }
    return;
  }
  return;
}
