// Gong sound
IfCleanedUp
  tmpargument = 1
  tmpdistance = 8000
  PlayFullSound


// Talk to player
IfBored
  tmpx = rand & 1
  tmpargument = tmpx + 7
  SendMessageNear
  tmpargument = tmpx + 5
  tmpdistance = rand & 1023 + 11000
  PlaySound
  tmpargument = ACTIONMC
  DoAction
IfTooMuchBaggage
  tmpargument = 6
  SendMessageNear
  tmpargument = 8
  tmpdistance = rand & 1023 + 11000
  PlaySound


// Heal sound
IfUsed
  tmpargument = 0
  tmpdistance = 11025
  PlayFullSound
  tmpargument = 25
  SetReloadTime



// Handle death
IfKilled
  // Sound
  tmpargument = 7
  tmpdistance = rand & 1023 + 11000
  PlaySound

  // Message
  tmpargument = 3
  IfArmorIs
    tmpargument = MESSAGECOSTUME
  Else
    tmpargument = MESSAGEDEATH
  IfTargetIsOnSameTeam
    tmpargument = MESSAGEFRAG
    IfTargetIsSelf
      tmpargument = MESSAGEACCIDENT
  SendMessage


  // Misc.
  tmpargument = selflevel*selflevel*100		//The money loss formula
  DropMoney
  DropKeys
  tmpargument = 45
  SetBumpHeight

  tmpx = 9999			//Special healer power
  IfXIsEqualToY
    SetTargetToSelf
    RespawnTarget
    tmpargument = 9
    SendMessageNear

//------------------------------------------------------------------------------
//Invoke special power if enough xp gained
SetTargetToSelf
tmpx = targetexp
tmpy = 9998
IfXIsMoreThanY
  UndoEnchant		//Hinder looping of same enchant
  SetOwnerToTarget
  EnchantTarget		//Give the special bonus
  tmpargument = 4	//Spawn some fancy sparklies
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  SpawnExactParticle
Else
  UndoEnchant		//Remove if needed xp is lost


// Just because...
IfLeaderKilled
  BecomeLeader


// Yell at friends
IfAttacked
  SetTargetToWhoeverAttacked
  IfTargetIsOnSameTeam
    tmpargument = MESSAGEOUCH
    SendMessage
    tmpargument = 4
    tmpdistance = rand & 1023 + 11000
    PlaySound
  Else
    tmpargument = rand & 1 + 2
    tmpdistance = rand & 1023 + 11000
    PlaySound


// All done
End
