//THIS CREDIT CARD JUST EXIST IN THE STARTER MODULE
//IT NEVER SNAPS SO IT MAKES SURE THAT THE STARTER MODULE IS
//ALWAYS BEATABLE AND TURNS INTO A NORMAL CREDIT CARD

//ZZ> This function makes an item fall to the floor when spawned
IfSpawned				//
  tmpargument = ACTIONJB		  //
  DoAction				  //
  KeepAction				  //
  
  //Reset difficulity counter
  tmpargument = 0
  SetContent

IfGrabbed
  SetTargetToWhoeverIsHolding		  //
  IfTargetIsAPlayer			  //
    tmpargument = 0			  //
    SendMessageNear			  //

IfUsed
  tmpargument = 50                //1 second cooldown
  SetReloadTime
  SetTargetToWhoeverIsHolding
  tmpargument = [TOUR]
  IfTargetHasID
    tmpargument = [LOCK]
    tmpdistance = 14 // Items, Friends, and Enemies
    SetTargetToWideBlahID
      tmpx = targetdistance
      tmpy = 128
      IfXIsLessThanY
        IfFacingTarget
          GetTargetState
          tmpx = tmpargument
          tmpy = 0
          IfXIsEqualToY
            SetOldTarget
            SetTargetToWhoeverIsHolding
            tmpargument = ACTIONMG
            TargetDoAction

            GetContent
            tmpx = targetdex > 7   //2% per dex
            tmpy = rand % 100 + tmpargument       //Gets harder each time failed
            //tmpargument = 6
            //SendMessage             //Uncomment for see the actual % results ingame
            IfXIsMoreThanY
              
              //Award some xp
              tmpargument = 20
              tmpdistance = EXPROLEPLAY
              GiveExperienceToTarget
              
              //Tell it was a success!
              tmpargument = 1
              PlaySound
              tmpargument = 3
              SendMessageNear
              
              //Open it up!
              SetTargetToOldTarget

              tmpargument = 491 // The special unlock order
              OrderTarget
              
              /This turns it into a real breakable credit card
              SetTargetToSelf
              tmpargument = 51
              ChangeTargetClass
            Else
              tmpargument = 4     //Need more practice
              SendMessageNear
              tmpargument = 2
              PlaySound
          Else
            tmpargument = 1
            SendMessageNear
        Else
          tmpargument = 1
          SendMessageNear
      Else
        tmpargument = 1             //Bah, there is a better way to do this
        SendMessageNear
    Else
      tmpargument = 1               //but I'm too lazy right now (use states)
      SendMessageNear
  Else
    tmpargument = 2
    SendMessageNear

IfHitGround				// Make a sound
  tmpargument = 0			  //
  PlaySound				  //

End					// All done
