home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 42 / CDGAMER42.iso / Egoboo / egoboo.exe / egoboo / modules / rogue.mod / objects / prisgnom.obj / script.txt < prev    next >
Text File  |  2000-05-18  |  6KB  |  252 lines

  1. //------------------------------------------------------------------------------
  2. // ZZ> Jump over corpses
  3. IfBumped
  4.   SetTargetToWhoeverBumped
  5.   IfTargetIsAlive
  6.     tmpargument = [CHES]
  7.     IfTargetHasID
  8.       tmpargument = LATCHJUMP
  9.       PressLatchButton
  10.   Else
  11.     tmpargument = LATCHJUMP
  12.     PressLatchButton
  13.   SetTargetToOldTarget
  14.  
  15.  
  16. //------------------------------------------------------------------------------
  17. tmpargument = 0
  18. IfStateIsNot
  19.   GetContent
  20.   tmpx = tmpargument
  21.   tmpy = 0
  22.   IfXIsMoreThanY
  23.     tmpargument = tmpx - 1
  24.     SetContent
  25.  
  26.  
  27.   // Check messages
  28.   IfBumped
  29.     tmpargument = 0
  30.     IfContentIs
  31.       IfStateIs2
  32.         // "Good!"
  33.         AddStat
  34.         tmpargument = 8
  35.         tmpdistance = 12000
  36.         PlaySound
  37.         tmpargument = 3
  38.         SetState
  39.         DropKeys
  40.         tmpargument = 5
  41.         SendMessageNear
  42.         tmpargument = 30
  43.         SetContent
  44.       IfStateIs1
  45.         // "So is it a deal?"
  46.         tmpargument = 7
  47.         tmpdistance = 12000
  48.         PlaySound
  49.         tmpargument = 2
  50.         SetState
  51.         tmpargument = 60
  52.         SetContent
  53.         tmpargument = 4
  54.         SendMessageNear
  55.  
  56.  
  57. //------------------------------------------------------------------------------
  58. // ZZ> Move around...
  59. IfTimeOut
  60.   IfStateIs3
  61.     tmpargument = 0
  62.     IfContentIs
  63.       SetTargetToSelf
  64.       SetTargetToTargetLeftHand
  65.         SetTargetToSelf
  66.         SetTargetToTargetRightHand
  67.           GetState // NOP
  68.         Else
  69.           tmpargument = LATCHPACKRIGHT
  70.           PressLatchButton
  71.       Else
  72.         tmpargument = LATCHPACKLEFT
  73.         PressLatchButton
  74.       tmpargument = 100
  75.       SetContent
  76.  
  77.  
  78.     // Get in a fight
  79.     tmpdistance = 250000
  80.     SetTargetToDistantEnemy
  81.       // Charge!
  82.       tmpx = targetx
  83.       tmpy = targety
  84.       tmpdistance = 300
  85.       tmpturn = targetturnto
  86.       Compass
  87.       ClearWaypoints
  88.       AddWaypoint
  89.  
  90.  
  91.       // Take a stab?
  92.       tmpx = targetdistance
  93.       tmpy = 120
  94.       IfXIsLessThanY
  95.         IfFacingTarget
  96.           tmpargument = rand & 1 + 1
  97.           PressLatchButton
  98.  
  99.  
  100.       tmpargument = 10
  101.       SetTime
  102.     Else
  103.       // Follow the Player around
  104.       SetTargetToLeader
  105.       tmpx = targetdistance
  106.       tmpy = 200
  107.       IfXIsLessThanY
  108.         tmpx = targetx
  109.         tmpy = targety
  110.         tmpturn = targetturnto + 32768
  111.         tmpdistance = 100
  112.         Compass
  113.         ClearWaypoints
  114.         AddWaypoint
  115.         tmpargument = 20
  116.         SetTime
  117.       Else
  118.         tmpy = 600
  119.         IfXIsLessThanY
  120.           // Run after the player
  121.           tmpx = targetx
  122.           tmpy = targety
  123.           tmpturn = targetturnto
  124.           tmpdistance = 400
  125.           Compass
  126.           ClearWaypoints
  127.           AddWaypoint
  128.           tmpargument = 20
  129.           SetTime
  130.         Else
  131.           // Walk around...
  132.           tmpx = selfx
  133.           tmpy = selfy
  134.           tmpturn = selfturn + 8192
  135.           tmpdistance = 200
  136.           Compass
  137.           ClearWaypoints
  138.           AddWaypoint
  139.           tmpargument = 20
  140.           SetTime
  141.   Else
  142.     // How close is the player?
  143.     tmpargument = [ROGU]
  144.     tmpdistance = 6 // Friends and Enemies
  145.     SetTargetToNearestBlahID
  146.       tmpx = targetx - selfspawnx
  147.       tmpy = targety - selfspawny
  148.       tmpx = xydistance
  149.       tmpy = 400
  150.       IfXIsLessThanY
  151.         tmpy = 200
  152.         IfXIsLessThanY
  153.           IfStateIs0
  154.             // Talk to the player
  155.             tmpargument = 90 // Delay
  156.             SetContent
  157.  
  158.             tmpargument = 6
  159.             tmpdistance = 12000
  160.             PlaySound
  161.  
  162.             tmpargument = 3
  163.             SendMessageNear
  164.  
  165.             tmpargument = 1
  166.             SetState
  167.           Else
  168.             tmpx = selfspawnx
  169.             tmpy = selfspawny
  170.             tmpturn = targetturnto
  171.             tmpdistance = 150
  172.             Compass
  173.             ClearWaypoints
  174.             AddWaypoint
  175.             tmpargument = 20
  176.             SetTime
  177.         Else
  178.           // Approach the player
  179.           tmpx = selfspawnx
  180.           tmpy = selfspawny
  181.           tmpturn = targetturnto
  182.           tmpdistance = 150
  183.           Compass
  184.           ClearWaypoints
  185.           AddWaypoint
  186.           tmpargument = 20
  187.           SetTime
  188.       Else
  189.         // Walk around in a circle
  190.         tmpx = selfx
  191.         tmpy = selfy
  192.         tmpturn = selfturn + 8192
  193.         tmpdistance = 200
  194.         Compass
  195.         ClearWaypoints
  196.         AddWaypoint
  197.         tmpargument = 20
  198.         SetTime
  199.     Else
  200.       // Walk around in a circle
  201.       tmpx = selfx
  202.       tmpy = selfy
  203.       tmpturn = selfturn + 8192
  204.       tmpdistance = 200
  205.       Compass
  206.       ClearWaypoints
  207.       AddWaypoint
  208.       tmpargument = 20
  209.       SetTime
  210.  
  211.  
  212. //------------------------------------------------------------------------------
  213. // ZZ> Handle death by sending a message and other stuff
  214. IfKilled
  215.   tmpargument = 2
  216.   tmpdistance = rand & 1027 + 11000
  217.   PlaySound
  218.   tmpargument = 0
  219.   IfTargetIsOnSameTeam
  220.     tmpargument = 1
  221.   SendMessage
  222.  
  223.   // Drop goodies
  224.   tmpargument = 65535
  225.   DropMoney
  226.  
  227.   // Make the character body
  228.   tmpargument = 45
  229.   SetBumpHeight
  230.  
  231.  
  232. //------------------------------------------------------------------------------
  233. // ZZ> Handle being attacked by blocking or countering or running away
  234. IfAttacked
  235.   SetTargetToWhoeverAttacked
  236.   IfTargetIsOnSameTeam
  237.     tmpargument = 5
  238.     tmpdistance = rand & 1027 + 11000
  239.     PlaySound
  240.     tmpargument = 2
  241.     SendMessageNear
  242.   Else
  243.     tmpargument = rand & 1 + 3
  244.     tmpdistance = rand & 1027 + 11000
  245.     PlaySound
  246.   SetTargetToOldTarget
  247.  
  248.  
  249. //------------------------------------------------------------------------------
  250. End
  251. //------------------------------------------------------------------------------
  252.