//-----------------------------------------------------------------------------
// Alchemy special abillity
SetTargetToSelf
IfTargetIsAlive
  SetTargetToTargetLeftHand	//Check left hand first
    tmpargument = [POTI]
    IfTargetHasID
      IdentifyTarget		//Identify potions
      SetTargetToSelf
    tmpargument = [FLAS]
    IfTargetHasID
      IdentifyTarget		//And flasks
  SetTargetToTargetRightHand	//Repeat with other hand
    tmpargument = [POTI]
    IfTargetHasID
      IdentifyTarget		//Identify potions
    tmpargument = [FLAS]
    IfTargetHasID
      IdentifyTarget		//And flasks


//-----------------------------------------------------------------------------
//Snake phobia =)
IfStateIs0
  SetTargetToWideEnemy
  tmpargument = [SNAK]
  IfTargetHasID
    tmpargument = rand & 1 + 11
    PlayFullSound
    tmpargument = 1
    SetState
    SendMessage
    SetTargetToSelf
    tmpargument = 5
    DazeTarget
    tmpargument = 1500		//1,5 minutes
    SetTime

IfTimeOut
  tmpargument = 0
  SetState



//-----------------------------------------------------------------------------
// ZZ> Auto jump over corpses
IfBumped
  SetTargetToWhoeverBumped
  IfTargetIsAlive
    DoNothing
  Else
    tmpargument = LATCHJUMP
    PressLatchButton


//-----------------------------------------------------------------------------
// ZZ> Gong sound
IfCleanedUp
  tmpargument = 2
  PlayFullSound

//-----------------------------------------------------------------------------
//Invoke special power if enough xp gained
SetTargetToSelf
tmpx = targetexp
tmpy = 9998
IfXIsMoreThanY
  tmpargument = 0
  IfContentIs

    //Spawn some fancy sparklies
    tmpargument = 2	
    tmpx = selfx
    tmpy = selfy
    tmpdistance = selfz
    SpawnExactParticle
    SetOwnerToTarget
    EnchantTarget		//Give the special bonus
    tmpargument = 1
    SetContent
Else
  UndoEnchant		//Hinder looping of same enchant
  tmpargument = 0
  SetContent

//------------------------------------------------------------------------------
// ZZ> Yell at player
IfTooMuchBaggage
  tmpargument = 7
  SendMessageNear
  tmpargument = 7
  PlaySound
  tmpargument = 50		//Reuse speed
  SetReloadTime


//------------------------------------------------------------------------------
// ZZ> Scream and shout
IfUsed
  tmpargument = rand & 1 + 8
  PlaySound


//------------------------------------------------------------------------------
// ZZ> Handle being bored by cheering or sneezing
IfBored
  tmpargument = ACTIONMC
  DoAction
    tmpargument = 6
    SendMessageNear
    tmpargument = 10
    PlaySound


//------------------------------------------------------------------------------
// ZZ> Handle death by sending a message and other stuff
IfKilled
  tmpargument = 5
  PlaySound
  tmpargument = 3
  IfArmorIs
    tmpargument = 5
  Else
    tmpargument = 0
  IfTargetIsOnSameTeam
    tmpargument = 3
    IfTargetIsSelf
      tmpargument = 4
  SendMessage

  // Drop goodies
  tmpargument = selflevel*selflevel*100
  DropMoney
  DropKeys

  // Make the character body
  tmpargument = 45
  SetBumpHeight


//------------------------------------------------------------------------------
// ZZ> For helper AIs
IfLeaderKilled
  BecomeLeader


//------------------------------------------------------------------------------
// ZZ> Handle being attacked by blocking or countering or running away
IfAttacked
  SetTargetToWhoeverAttacked
  IfTargetIsOnSameTeam
    tmpargument = 6
    PlaySound
    tmpargument = 2
    SendMessageNear
  Else
    tmpargument = rand & 1 + 3
    PlaySound



//------------------------------------------------------------------------------
End
//------------------------------------------------------------------------------
