//Special prurple glow
IfSpawned
  tmpargument = -1
  SetBlueShift
  SetGreenShift

//This makes boss invincible until the idol is broken
//Heal and sparklies
IfTimeOut
  tmpargument = [LICH]
  tmpdistance = BLAHFRIENDS + BLAHENEMIES
  SetTargetToNearestBlahID
    tmpargument = 2560         //10 hp!
    HealTarget
    tmpargument = 1
    tmpx = targetx
    tmpy = targety
    tmpdistance = targetz
    SpawnExactParticle
  tmpargument = 50
  SetTime
  
  //Flashy!
  SetTargetToSelf
  FlashTarget

//Need at least 2 damage in 1 hit to die
IfSpawned
  tmpargument = 511
  SetDamageThreshold
  
IfKilled
  tmpargument = 3
  SendMessage
  tmpargument = 48
  SetContent
  
  // 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
