// Set up general stuff
IfSpawned
  tmpargument = 0
  SetState

// Make it lie on the floor
//IfDropped
//  KeepAction
//  tmpargument = ACTIONJB
//  DoAction

//Maybe the character identifies the plant?
IfUsed
  IfStateIs0
          
  //Characters with nature lore finds it out easly
    tmpargument = [ELFF]
    IfTargetHasID
      tmpargument = 1
      SetState
      tmpargument = 100
      SetTime
      tmpargument = 2
      SendMessageNear
      MakeNameKnown
      MakeUsageKnown
      tmpargument = 20
      tmpdistance = EXPSECRET
      GiveExperienceToTarget
        
    Else
      IfStateIs0
        //Intelligence checks show if others find it out
        tmpx = targetint
        tmpy = rand & 255 * 10 + 2850
        IfXIsMoreThanY
          // Character identifies the gem
          tmpargument = 2
          SendMessageNear
          MakeNameKnown
          tmpargument = 10
          tmpdistance = EXPSECRET
          GiveExperienceToTarget
          tmpargument = 2
          SetState
          tmpargument = 100
          SetTime
        Else
          tmpargument = 6
          SendMessageNear
          tmpargument = 4
          SetState
          tmpargument = 100
          SetTime            

//This is a ingredient
  IfStateIs1
    tmpargument = 5
    SendMessageNear
    tmpargument = 3
    SetState
    tmpargument = 100
    SetTime

IfTimeOut
  IfStateIs2
    tmpargument = 1
    SetState

  IfStateIs3
    tmpargument = 1
    SetState

  IfStateIs4
    tmpargument = 0
    SetState

// Alert others to draw
IfTakenOut
  SetTargetToWhoeverIsHolding
  IfTargetIsAPlayer
    tmpargument = 3
    SendMessageNear

// Tell them what they've won...
IfGrabbed
  SetTargetToWhoeverIsHolding
  IfTargetIsAPlayer
    tmpargument = 0
    SendMessageNear

// Finish up
End
