// Set up general stuff
IfSpawned
  tmpargument = ACTIONJB
  DoAction
  KeepAction
  MakeCrushValid
  MakeAmmoKnown

// Make it poof
IfCrushed
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 0
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  SpawnExactParticle
  GoPoof
  tmpargument = 1
  SendMessageNear

// Make it lie on the floor
IfDropped
  KeepAction

// Play a clink or clang
IfHitGround
  tmpargument = 0
  PlaySound

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

// Tell them what they've won...
IfGrabbed
  SetTargetToWhoeverIsHolding
  IfTargetIsAPlayer
    
    //Tech folks know what it is
    tmpargument = [TECH]
    IfTargetHasSkillID
      MakeNameKnown
      
    tmpargument = 0
    SendMessageNear
    

// REfill the lamp
IfUsed
  tmpargument = 30
  SetReloadTime
  SetTargetToWhoeverIsHolding
  IfHeldInLeftHand
    SetTargetToTargetRightHand
  Else
    SetTargetToTargetLeftHand
  tmpargument = [LAMP]
  IfTargetHasID
    SetTargetToWhoeverIsHolding
    tmpargument = [LAMP]
    RestockTargetAmmoIDFirst
    tmpargument = 3
    SendMessageNear
    CostAmmo
    IfAmmoOut
      GoPoof
  Else
    SetTargetToWhoeverIsHolding
    IfNameIsKnown
      tmpargument = 4
      SendMessageNear
      tmpx = selfx	//Where to spawn the object
      tmpy = selfy
      tmpturn = selfturn
      tmpdistance = 0	//Velocity speed of the spawned object
      SpawnCharacter	//Spawn a copy of the flask
        tmpargument = 1
        SetChildAmmo
        CostAmmo
        IfAmmoOut
          GoPoof
    Else
      tmpargument = 5
      SendMessageNear
      MakeSimilarNamesKnown		//Ugh he drank it...
      CostAmmo

//Explode when in contact with fire
IfReaffirmed
  tmpargument = 6
  SendMessageNear
  tmpx = selfx
  tmpy = selfy
  tmpdistance = selfz
  tmpargument = 1
  SpawnExactParticle
  GoPoof
  tmpargument = 2
  PlaySound
  tmpargument = [WAKE]
  OrderSpecialID

// Finish up
End
