
//G'NOME
//-------------------------------------------
//Level       Abillity
//1			Use Technological Items, Read G'nomish, Immune vs. Grog, Poison Resistance, Literate
//2			n/a
//3			n/a
//4			Chemistry skill
//5			n/a
//6			n/a
//7			Tech knowledge
//8			n/a
//9			n/a
//10		Tech Mastery
//11		n/a
//12		n/a
//13    n/a
//14    n/a
//15    n/a
//16    n/a
//17    n/a
//18    n/a
//19    n/a
//20    Class Mastery

//-----------------------------------------------------------------------------
//Reset
IfSpawned
  tmpargument = 0
  SetState
  SetContent
  
//-----------------------------------------------------------------------------
// Chemistry skill - does not identify magic objects
tmpx = selflevel
tmpy = 2
IfXIsMoreThanY          //Need level 4

  SetTargetToTargetLeftHand	//Check left hand first
    tmpargument = [FLAS]
    IfTargetHasID
      IdentifyTarget		//And flasks

  SetTargetToTargetRightHand	//Repeat with other hand
    tmpargument = [FLAS]
    IfTargetHasID
      IdentifyTarget		//And flasks

  
//-----------------------------------------------------------------------------
// Tech knowledge - does not identify magic objects
tmpx = selflevel
tmpy = 5
IfXIsMoreThanY          //Need level 7

  SetTargetToTargetLeftHand	//Check left hand first
    tmpargument = [TECH]
    IfTargetHasID
      IdentifyTarget		// Identify all tech items

  SetTargetToTargetRightHand	//Repeat with other hand
    tmpargument = [TECH]
    IfTargetHasID
      IdentifyTarget		// Identify all tech items

  
//------------------------------------------------------------------------------
//Invoke Class Mastery if enough xp gained
SetTargetToSelf
tmpx = selflevel
tmpy = 18              //Need level 20
IfXIsMoreThanY

  tmpargument = 0
  IfContentIs
    SetOwnerToTarget
    EnchantTarget 	//Give the special bonus
    tmpargument = 1
    SetContent      //Dont repeat
  Else
    tmpargument = 2	//Spawn some fancy sparklies
    tmpx = selfx
    tmpy = selfy
    tmpdistance = selfz
    SpawnExactParticle

Else

  tmpargument = 1
  IfContentIs
    UndoEnchant		//Remove if needed xp is lost

    tmpargument = 0
    SetContent      //Dont repeat

//-----------------------------------------------------------------------------
IfKilled				// This reduces the height of the char
  tmpargument = 2			  // Death sound
  tmpdistance = rand & 2047 + 13000	  //
  PlaySound				  //
  tmpargument = 3
  IfArmorIs
    tmpargument = MESSAGECOSTUME
  Else
    tmpargument = MESSAGEDEATH		  // Last words...
  IfTargetIsOnSameTeam			  // Fragged!
    tmpargument = MESSAGEFRAG		    //
    IfTargetIsSelf			    // No, just a damage tile
      tmpargument = MESSAGEACCIDENT           //
  SendMessage				  //
  tmpargument = selflevel*selflevel*100		//The money loss formula
  DropMoney				  //
  DropKeys
  tmpargument = 45			  //
  SetBumpHeight				  //

//-----------------------------------------------------------------------------
// 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 = 3
  IfArmorIs
    tmpargument = [CLAW]
    IfHoldingItemID
      tmpargument = 256
      HealSelf
  tmpargument = 200     //every 4 seconds
  SetTime

  //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
//------------------------------------------------------------------------------

