//G'NOME
//-------------------------------------------
//Level       Abillity
//1			Use Technological Items, Read G'nomish, Immune vs. Grog, Poison Resistance, Literate
//2			n/a
//3			n/a
//4			Listen
//5			n/a
//6			n/a
//7			Crackshot
//8			n/a
//9			n/a
//10		Sharpshooter
//11		n/a
//12		n/a
//13    Hardy
//14    n/a
//15    n/a
//16    Ancient Blud
//17    n/a
//18    n/a
//19    n/a
//20    Things that go Boom
//-----------------------------------------------------------------------------
//Reset
IfSpawned
  tmpargument = 0
  SetState
  SetContent
  
//-----------------------------------------------------------------------------
//Listen skill
tmpx = selflevel
tmpy = 2            //At least level 4
IfXIsMoreThanY
  EnableListenSkill
  
//-----------------------------------------------------------------------------
//Nuclear blast death (Things that go Boom skill)
IfKilled
  tmpx = selflevel
  tmpy = 18           //Level 20 or above
  IfXIsMoreThanY
    tmpargument = 2
    tmpx = selfx
    tmpy = selfy
    tmpdistance = selfz
    SpawnExactParticle
    tmpargument = 9
    SpawnExactParticle
    
    tmpargument = 13
    tmpdistance = 150
    PlaySoundVolume

//-----------------------------------------------------------------------------
//Sharpshooter skill
tmpx = selflevel
tmpy = 8            //Need level 10
IfXIsMoreThanY
  IfScoredAHit
    SetTargetToLastItemUsed
      tmpargument = [TECH]
      IfTargetHasSkillID
        SetTargetToWhoeverWasHit
        tmpargument = 256
        DamageTarget
  
//-----------------------------------------------------------------------------
//Crackshot skill
tmpx = selflevel
tmpy = 5            //Need level 7
IfXIsMoreThanY
  IfScoredAHit
    SetTargetToLastItemUsed
      tmpargument = [TECH]
      IfTargetHasSkillID
        tmpx = rand % 100
        tmpy = selfint > 9              //% chance equal to int/2
        IfXIsLessThanY
          SetTargetToWhoeverWasHit
          tmpargument = selflevel > 2   //+1 every 4 levels
          DazeTarget
          
          //Draw the text
          tmpdistance = 3         //Duration
          tmpargument = 1         //Message 9
          tmpturn = WHITE         //Message color
          DrawBillboard

//-----------------------------------------------------------------------------
//Damage resist skill
tmpx = selflevel
tmpy = 11            //At least level 13
IfXIsMoreThanY
  tmpargument = selflevel * 20       //Reduce all damage by 1/12 per level
  SetDamageThreshold

//-----------------------------------------------------------------------------
// ZZ> Yell at the player
IfTooMuchBaggage
  tmpargument = 12
  PlaySound
  tmpargument = 11
  SendMessageNear
  tmpargument = 100
  SetReloadTime

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

//------------------------------------------------------------------------------
// ZZ> Handle healing factor
IfTimeOut
  tmpargument = 200     //every 4 seconds
  SetTime
  
  tmpargument = 3
  IfArmorIs
    tmpargument = [CLAW]
    IfHoldingItemID
      tmpargument = 256
      HealSelf

  //Ancient blud skill
  tmpx = selflevel
  tmpy = 14            //Need level 16
  IfXIsMoreThanY
    tmpargument = 192   //regenerate 3/4 life point every 4 seconds
    HealSelf
  
  
//------------------------------------------------------------------------------
// ZZ> Scream and shout
IfUsed
  tmpargument = tmpdistance & 1 + 9
  PlaySound

//------------------------------------------------------------------------------
// ZZ> Handle being bored by cheering or sneezing
IfBored
  tmpx = rand & 1
  tmpy = 0
  IfXIsEqualToY
    tmpargument = 10
    SendMessageNear
    tmpargument = 8
    PlaySound
  Else
    tmpargument = 9
    SendMessageNear
    tmpargument = 2
    PlaySound
    tmpargument = ACTIONDB
    DoAction

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

  // Drop goodies
  tmpargument = 1+selflevel*selflevel*100		//The money loss formula
  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
  // Pick either 0 or 7, Parry or Combat
  SetTargetToWhoeverAttacked
  IfTargetIsOnSameTeam
    tmpargument = 3
    PlaySound
    tmpargument = MESSAGEOUCH
    SendMessageNear
  Else
    tmpargument = rand & 1 + 5
    PlaySound

//------------------------------------------------------------------------------
// ZZ> Handle being healed by spitting out a message and stopping retreat
IfHealed
  tmpargument = 8
  SendMessageNear
  tmpargument = 7
  PlaySound

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