function trigger_slot_21() /* entry=394 class_id=0x0A18 slot=0x21 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    ref, /* [BP+0Ah] type=0x69 */
    cmd, /* [BP-02h] type=0x69 */
    qHi, /* [BP-04h] type=0x69 */
    npcNum, /* [BP-06h] type=0x69 */
    mapNum, /* [BP-08h] type=0x69 */
    searchtype, /* [BP-0Ah] type=0x69 */
    aitem, /* [BP-0Ch] type=0x24 */
    baseLink, /* [BP-0Eh] type=0x69 */
    newLink; /* [BP-10h] type=0x69 */

  set_info(0x021B, 0);
  aitem = ref;
  baseLink = Item.getQLo(aitem);
  newLink = baseLink;
  qHi = Item.getQHi(aitem);
  mapNum = Item.getMapArray(aitem);
  npcNum = Item.getNPCNum(aitem);
  searchtype = (((mapNum & 0x00E0) * 8) + npcNum);
  if (mapNum == 0) {
    return;
  }
  else if (!(mapNum & 4)) {
    if (!Item.isCrusTypeNPC(searchtype)) {
      if (baseLink == 0x00FF) {
        if (searchtype == 0) {
          spawn TRIGGER.slot_2A(pid, searchtype, baseLink, mapNum, npcNum, qHi, ref, arg_06);
          suspend;
        }
      }
      else if (searchtype == 0x07FE) {
        spawn TRIGGER.slot_2B(pid, searchtype, baseLink, mapNum, npcNum, qHi, ref, arg_06);
        suspend;
      }
      else if (searchtype == 0) {
        spawn TRIGGER.slot_29(pid, searchtype, baseLink, mapNum, npcNum, qHi, ref, arg_06);
        suspend;
      }
    }
    else if (baseLink == 0x00FF) {
      if (searchtype == 0) {
        spawn TRIGGER.slot_25(pid, searchtype, baseLink, mapNum, npcNum, qHi, ref, arg_06);
        suspend;
        /* dword_to_word  */
        newLink = process_result;
      }
    }
    else if (searchtype == 0x07FF) {
      spawn TRIGGER.slot_24(pid, searchtype, baseLink, mapNum, npcNum, qHi, ref, arg_06);
      suspend;
      /* dword_to_word  */
      newLink = process_result;
    }
    else if (searchtype == 0) {
      spawn TRIGGER.slot_23(pid, searchtype, baseLink, mapNum, npcNum, qHi, ref, arg_06);
      suspend;
      /* dword_to_word  */
      newLink = process_result;
    }
  }
  else if (baseLink == 0x00FF) {
    if (searchtype == 0) {
      spawn TRIGGER.slot_28(pid, searchtype, baseLink, mapNum, npcNum, qHi, ref, arg_06);
      suspend;
      /* dword_to_word  */
      newLink = process_result;
    }
  }
  else if (searchtype == 0x07FF) {
    spawn TRIGGER.slot_27(pid, searchtype, baseLink, mapNum, npcNum, qHi, ref, arg_06);
    suspend;
    /* dword_to_word  */
    newLink = process_result;
  }
  else if (searchtype == 0) {
    spawn TRIGGER.slot_26(pid, searchtype, baseLink, mapNum, npcNum, qHi, ref, arg_06);
    suspend;
    /* dword_to_word  */
    newLink = process_result;
  }
  /* word_to_dword  */
  /* pop_result  */
  return;
  return;
}
