home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 42 / CDGAMER42.iso / Egoboo / egoboo.exe / egoboo / modules / healer.mod / objects / fchest.obj / script.txt < prev    next >
Text File  |  2000-03-04  |  5KB  |  202 lines

  1. // Someone cast an unlock spell
  2. IfOrdered
  3.   tmpx = selforder
  4.   tmpy = 491  // The unique code for an unlock order
  5.   IfXIsEqualToY
  6.     // Is it closed?
  7.     tmpargument = 0
  8.     IfStateIs
  9.       // Open it up
  10.       tmpargument = ACTIONMG
  11.       DoAction
  12.         tmpargument = 1
  13.         SetState
  14.         tmpargument = 60
  15.         SetBumpHeight
  16.         KeepAction
  17.         tmpargument = 0
  18.         tmpdistance = 11025
  19.         PlaySound
  20.         // Wait a while
  21.         tmpargument = 40
  22.         SetTime
  23.         // Tell the players...
  24.         tmpargument = 3
  25.         SendMessageNear
  26.  
  27.  
  28. // Someone is trying to open it
  29. IfBumped
  30.   // Can they open the chest?
  31.   SetTargetToWhoeverBumped
  32.   IfTargetCanOpenStuff
  33.  
  34.  
  35.     // Is it closed?
  36.     tmpargument = 0
  37.     IfStateIs
  38.  
  39.  
  40.       // Are they in front?
  41.       IfFacingTarget
  42.  
  43.  
  44.         // Make target crouch
  45.         tmpargument = ACTIONMG
  46.         TargetDoAction
  47.  
  48.  
  49.         // Give some experience
  50.         tmpargument = 5
  51.         tmpdistance = EXPDARE
  52.         GiveExperienceToTarget
  53.  
  54.  
  55.         // Open it up
  56.         tmpargument = ACTIONMG
  57.         DoAction
  58.           tmpargument = 1
  59.           SetState
  60.           tmpargument = 60
  61.           SetBumpHeight
  62.           KeepAction
  63.           tmpargument = 0
  64.           tmpdistance = 11025
  65.           PlaySound
  66.           // Wait a while
  67.           tmpargument = 40
  68.           SetTime
  69.           // Tell the players...
  70.           tmpargument = 4
  71.           SendMessageNear
  72.     Else
  73.       // Wait before allowing a swap
  74.       IfTimeOut
  75.         // Reset the timer
  76.         tmpargument = 40
  77.         SetTime
  78.  
  79.  
  80.         // Make target crouch
  81.         tmpargument = ACTIONMG
  82.         TargetDoAction
  83.  
  84.  
  85.  
  86.  
  87.         // Say it's empty...  Or check for false bottom
  88.         IfStateIs2
  89.           // Say the chest is empty...
  90.           tmpargument = 0
  91.           SendMessageNear
  92.           // Content... 0 is normal chest, 2 is false bottom
  93.           GetContent
  94.           tmpargument = tmpargument & 2
  95.           SetState
  96.           IfStateIs2
  97.             // It has a false bottom
  98.             tmpargument = [DISA]
  99.             IfTargetHasSkillID
  100.               // Character easily finds the false bottom
  101.               tmpargument = 1
  102.               SendMessageNear
  103.  
  104.  
  105.               // Give some experience
  106.               tmpargument = 15
  107.               tmpdistance = EXPROLEPLAY
  108.               GiveExperienceToTarget
  109.  
  110.  
  111.               // Figure out what to drop...  Opposite of first drop
  112.               GetContent
  113.               tmpargument = tmpargument & 1
  114.               SetState
  115.               IfStateIs0
  116.                 DropItems
  117.               Else
  118.                 tmpargument = selfmoney
  119.                 DropMoney
  120.  
  121.  
  122.  
  123.               // No more false bottom
  124.               tmpargument = 0
  125.               SetContent
  126.               tmpargument = 2
  127.               SetState
  128.             Else
  129.               // Check wisdom until it is found
  130.               tmpx = targetwis
  131.               tmpy = rand & 4095 + 3584  // Need between 14 and 30 wisdom
  132.               tmpy = rand & 4095  // Need between 0 and 16 wisdom
  133.               IfXIsMoreThanY
  134.                 // Character finds the false bottom
  135.                 tmpargument = 1
  136.                 SendMessageNear
  137.  
  138.  
  139.                 // Give some experience
  140.                 tmpargument = 15
  141.                 tmpdistance = EXPSECRET
  142.                 GiveExperienceToTarget
  143.  
  144.  
  145.                 // Figure out what to drop...  Opposite of first drop
  146.                 GetContent
  147.                 tmpargument = tmpargument & 1
  148.                 SetState
  149.                 IfStateIs0
  150.                   DropItems
  151.                 Else
  152.                   tmpargument = selfmoney
  153.                   DropMoney
  154.  
  155.  
  156.  
  157.                 // No more false bottom
  158.                 tmpargument = 0
  159.                 SetContent
  160.                 tmpargument = 2
  161.                 SetState
  162.           IfStateIs0
  163.             // No false bottom
  164.             tmpargument = 2
  165.             SetState
  166.  
  167.  
  168.  
  169.  
  170.         // Drop the contents
  171.         IfStateIs1
  172.           // Content...  0 is money, 1 is items
  173.           GetContent
  174.           tmpargument = tmpargument & 1
  175.           SetState
  176.           IfStateIs0
  177.             tmpx = selfmoney
  178.             tmpy = 0
  179.             IfXIsMoreThanY
  180.               // Drop the money
  181.               tmpargument = selfmoney
  182.               DropMoney
  183.               tmpargument = 2
  184.               SendMessageNear
  185.             Else
  186.               // No money in a money chest...
  187.               tmpargument = 0
  188.               SendMessageNear
  189.           Else
  190.             // Found some items
  191.             DropItems
  192.             tmpargument = 2
  193.             SendMessageNear
  194.           tmpargument = 2
  195.           SetState
  196.  
  197.  
  198.  
  199.  
  200. // All done
  201. End
  202.