home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 42 / CDGAMER42.iso / Egoboo / egoboo.exe / egoboo / modules / palshad.mod / objects / bossdark.obj / script.txt < prev    next >
Text File  |  2000-07-04  |  4KB  |  183 lines

  1. //------------------------------------------------------------------------------
  2. // ZZ> Most undead have an enchantment sustaining them
  3. IfSpawned
  4.   EnchantTarget  // Enchant self...
  5.  
  6.  
  7. //------------------------------------------------------------------------------
  8. IfTargetKilled
  9.   SetTargetToNearestEnemy
  10.     tmpargument = 1
  11.     SetState
  12.   Else
  13.     tmpargument = 0
  14.     SetState
  15.  
  16.  
  17. //------------------------------------------------------------------------------
  18. // ZZ> Handle death by sending a message and other stuff
  19. IfKilled
  20.   tmpargument = 2
  21.   tmpdistance = rand & 2047 + 10000
  22.   PlaySound
  23.  
  24.  
  25.   // Drop goodies
  26.   tmpargument = 65535
  27.   DropMoney
  28.   DropKeys
  29.  
  30.  
  31.   // Boss stuff...
  32.   tmpx = selfmorale
  33.   tmpy = 0
  34.   IfXIsEqualToY
  35.     tmpargument = 1
  36.     OpenPassage
  37.     ClearEndMessage
  38.     tmpargument = 2
  39.     AddEndMessage
  40.     tmpargument = 3
  41.     AddEndMessage
  42.     tmpargument = 1
  43.   Else
  44.     tmpargument = 0
  45.   SendMessageNear
  46.  
  47.  
  48.   // Make the character body
  49.   tmpargument = 0
  50.   SetBumpHeight
  51.   tmpargument = 0
  52.   SetFlyHeight
  53.  
  54.  
  55. //------------------------------------------------------------------------------
  56. IfBumped
  57.   SetTargetToWhoeverBumped
  58.   IfTargetIsOnSameTeam
  59.     tmpx = selfx
  60.     tmpy = selfy
  61.     tmpturn = targetturnto + 32768
  62.     tmpdistance = 256
  63.     Compass
  64.     ClearWaypoints
  65.     AddWaypoint
  66.     SetTargetToOldTarget
  67.  
  68.  
  69. //------------------------------------------------------------------------------
  70. IfTimeOut
  71.   // Return to normal
  72.   IfStateIs4
  73.     tmpargument = 1
  74.     SetState
  75.   // Wait for the good guys to barge in...
  76.   IfStateIs0
  77.     tmpargument = 20
  78.     SetTime
  79.     tmpargument = passage
  80.     SetTargetToSelf
  81.     SetTargetToWhoeverIsInPassage
  82.       GetState
  83.     Else
  84.       SetTargetToWideEnemy
  85.     IfTargetIsOnHatedTeam
  86.       tmpargument = rand & 15 + 50
  87.       SetTime
  88.       Run
  89.       SetTurnModeToVelocity
  90.       tmpx = targetx
  91.       tmpy = targety
  92.       tmpargument = 4
  93.       SetState
  94.     Else
  95.       Stop
  96.       SetTurnModeToWatch
  97.       tmpx = selfx
  98.       tmpy = selfy + 200
  99.       ClearWaypoints
  100.       AddWaypoint
  101.   // Follow through
  102.   IfStateIs3
  103.     tmpargument = rand & 31 + 90
  104.     SetTime
  105.     tmpargument = 4
  106.     SetState
  107.     tmpx = selfx
  108.     tmpy = selfy
  109.     tmpturn = selfturn
  110.     tmpdistance = 200
  111.     Compass
  112.     ClearWaypoints
  113.     AddWaypoint
  114.   // Chop the enemy
  115.   IfStateIs2
  116.     tmpargument = rand & 31 + 30
  117.     SetTime
  118.     tmpx = targetdistance
  119.     tmpy = 180
  120.     IfXIsLessThanY
  121.       // Close enough to swing...
  122.       IfHoldingMeleeWeapon
  123.         PressLatchButton
  124.         tmpargument = 3
  125.         SetState
  126.     Else
  127.       // Fall through to next...
  128.       tmpargument = 1
  129.       SetState
  130.   // Rush the enemy
  131.   IfStateIs1
  132.     SetTurnModeToVelocity
  133.     tmpx = targetdistance
  134.     tmpy = 1400
  135.     IfXIsMoreThanY
  136.       // Find a new enemy
  137.       SetTargetToNearestEnemy
  138.         tmpargument = 5
  139.       Else
  140.         tmpargument = 0
  141.         SetState
  142.         tmpargument = 5
  143.       SetTime
  144.     Else
  145.       // Charge the enemy
  146.       tmpx = targetx
  147.       tmpy = targety
  148.       tmpturn = targetturnto
  149.       tmpdistance = 200
  150.       Compass
  151.       SetOldTarget
  152.       SetTargetToNearestFriend
  153.         tmpdistance = 500 - targetdistance > 1
  154.         tmpturn = targetturnto + 32768
  155.         Compass
  156.         SetTargetToOldTarget
  157.       ClearWaypoints
  158.       AddWaypoint
  159.       tmpargument = 2
  160.       SetState
  161.       tmpargument = rand & 3 + 6
  162.       SetTime
  163.  
  164.  
  165.  
  166. //------------------------------------------------------------------------------
  167. // ZZ> Handle being attacked by blocking or countering or running away
  168. IfAttacked
  169.   Run
  170.   tmpargument = 1
  171.   SetState
  172.   SetTurnModeToVelocity
  173.   SetTargetToWhoeverAttacked
  174.   tmpargument = rand & 1
  175.   tmpdistance = rand & 2047 + 10000
  176.   PlaySound
  177.  
  178.  
  179.  
  180. //------------------------------------------------------------------------------
  181. End
  182. //------------------------------------------------------------------------------
  183.