//Special abillities
//LEVEL		ABILLITY
//1			Immune vs Grog and Daze
//2			n/a
//3			Immune vs. Banishment
//4			n/a
//5			Immune vs. Kurses
//6			n/a
//7			Life Steal attack
//8			n/a
//9			Butcher Form
//10		n/a
//11		Daze attacks
//12		n/a
//13		Explosive Death attack
//Each level up increases unarmed attack speed and life steal effect.
//-----------------------------------------------------------------------------
//Reset
IfSpawned
  tmpargument = 0
  SetState
  SetContent

//-----------------------------------------------------------------------------
//Special attack powers
IfScoredAHit
  SetTargetToLastItemUsed
  IfTargetIsSelf
    tmpx = selflevel
    tmpy = 5
    IfXIsMoreThanY				//Gain lifesteal at 7th level
      tmpargument = rand & 30 + selflevel*10		//Effect increases with level
      HealSelf

    tmpy = 9
    IfXIsMoreThanY				//Gain daze attack at 11th level
      SetTargetToWhoeverWasHit
      tmpargument = 1
      DazeTarget

//-----------------------------------------------------------------------------
//Immune vs. kurses abillity
tmpx = selflevel
tmpy = 3
IfXIsMoreThanY					//Gain abillity at 5th level
  SetTargetToSelf
  UnkurseTargetInventory

//------------------------------------------------------------------------------
//Yell at player
IfTooMuchBaggage
  tmpargument = 7
  SendMessageNear
  tmpargument = 2
  PlaySound
  tmpargument = 50
  SetReloadTime

//------------------------------------------------------------------------------
// ZZ> Scream and shout
IfUsed
  tmpargument = rand & 2 + 3
  PlaySound

  //Slow attacks
  tmpargument = 15 - selflevel*3		//Attack speed increases with level
  SetReloadTime

//------------------------------------------------------------------------------
// ZZ> Handle being bored by cheering or sneezing
IfBored
  tmpargument = ACTIONMG
  DoAction
  tmpargument = 6
  SendMessageNear
  tmpargument = rand & 1 + 9
  PlaySound

//------------------------------------------------------------------------------
// ZZ> Handle death by sending a message and other stuff
IfKilled

  //Explosive death
  tmpx = selflevel
  tmpy = 11
  IfXIsMoreThanY			//Only gain abillity at 13th level
    tmpargument = 3
    tmpx = rand % 50 + selfx - 25
    tmpy = rand % 50 + selfy - 25
    tmpdistance = selfz
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    SpawnExactParticle
    tmpargument = 8			//Explosive sound
    PlayFullSound

  tmpargument = 4
  PlaySound
  tmpargument = 1
  IfArmorIs
    tmpargument = 5
  Else
    tmpargument = 0
  IfTargetIsOnSameTeam
    tmpargument = 3
    IfTargetIsSelf
      tmpargument = 4
  SendMessage

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

  // Make the character body
  tmpargument = 45
  SetBumpHeight

//------------------------------------------------------------------------------
//For helper AIs
IfLeaderKilled
  BecomeLeader

//------------------------------------------------------------------------------
//Say ouch
IfAttacked
  SetTargetToWhoeverAttacked
  IfTargetIsOnSameTeam
    tmpargument = 2
    SendMessageNear

  //Different ouch sounds in Butcher form
  tmpargument = 0
  IfArmorIs
    tmpargument = rand & 1 + 3
    PlaySound
  Else
    tmpargument = rand & 1 + 11
    PlaySound
  
  //Holy damage causes confusion
  tmpx = 3
  tmpy = selflevel
  IfXIsLessThanY			//Immune to banishment after 3rd level
    GetDamageType
    tmpx = tmpargument
    tmpy = DAMAGEHOLY
    IfXIsEqualToY
      tmpargument = 1
      SendMessageNear
      SetTargetToSelf
      tmpargument = 6
      DazeTarget

//------------------------------------------------------------------------------
//Change to butcher form at level 9 and above
SetTargetToSelf
tmpx = selflevel
tmpy = 7                //9th level and above
IfXIsMoreThanY
  IfStateIs0
    tmpargument = 1
    SetState
    SetOwnerToTarget
    EnchantTarget		//Give the special bonus
    tmpargument = 1
    ChangeArmor

//Spawn and respawn effects
IfSpawned
  tmpargument = ACTIONMD	//Rise from the dead
  ChildDoActionOverride
  BecomeLeader
  tmpargument = 0
  PlayFullSound
  tmpargument = 8
  SendMessage

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