//Need at least 2 damage in 1 hit to die
IfSpawned
  tmpargument = 511
  SetDamageThreshold
  
IfKilled
  // Smash open
  tmpargument = [GOOD]
  IfTargetHasSpecialID
    tmpargument = 20
    tmpdistance = EXPROLEPLAY
    GiveExperienceToTarget
    tmpturn = 0
  Else
    tmpturn = 1

  // Check for passages to open
  tmpx = passage
  tmpy = 0
  IfXIsEqualToY
    // Play the break sound
    tmpargument = 2
    PlaySound
  Else
    tmpargument = tmpx
    OpenPassage
    
    // Play the secret music
    tmpargument = 1
    PlaySound
    
    // Give experience
    tmpargument = 20
    tmpdistance = EXPSECRET
    GiveExperienceToTarget
    tmpturn = 2
  tmpargument = tmpturn
  SendMessageNear

  // Drop goodies
  DropItems
  tmpargument = selfmoney
  DropMoney
  DropKeys

  // Replace self with an imposter...
  tmpargument = selfcontent
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpturn = selfturn
  SpawnExactCharacterXYZ
  GoPoof
End
