function surcamns_slot_22() /* entry=269 class_id=0x04C6 slot=0x22 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    eventTrigger, /* [BP+0Ah] type=0x24 */
    n, /* [BP-02h] type=0x24 */
    foundGun; /* [BP-03h] type=0x62 */

  set_info(0x00F0, 0);
  /* loop_selector n in selector_0x42(arg0=0x04C8, arg1=0x01CD, arg2=(50 * 32), origin=eventTrigger) */
  while (!condition) {
    if (!Actor.isNPC(n)) {
      foundGun = 1;
    }
    /* loopnext  */
  }
  /* global_address global_id=0x3C */
  spawn FREE.waitNTimerTicks(pid, 10, 0x00000000);
  suspend;
  if (!foundGun) {
    while (getTargetNPCNumMaybe() == 1) {
      spawn FREE.waitNTimerTicks(pid, 5, 0x00000000);
      suspend;
    }
  }
  else {
    spawn FREE.waitNTimerTicks(pid, 0x00C8, 0x00000000);
    suspend;
  }
  /* global_address global_id=0x3C */
  /* global_address global_id=0x3C */
  /* global_address global_id=0x3C */
  /* global_address global_id=0x3C */
  return;
}
