home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 42 / CDGAMER42.iso / Egoboo / egoboo.exe / egoboo / modules / healer.mod / objects / bossnecr.obj / script.txt < prev    next >
Text File  |  2000-10-29  |  9KB  |  402 lines

  1. //------------------------------------------------------------------------------
  2. // Each hand has a spell usage list, which is stored in content.  8 bits
  3. // for each hand, bits 0-7 for left, 8-15 for right.
  4. // Bit 7 - 1 is useable, 0 is unuseable
  5. // Bit 6 - 1 is one shot, 0 is unlimited uses
  6. // Bit 5 - 1 is need a [HUMA] corpse, 0 is use anytime
  7. // Bit 4 - \Charge time
  8. // Bit 3 - /
  9. // Bit 2 - \
  10. // Bit 1 -  Range
  11. // Bit 0 - /
  12.  
  13.  
  14. //------------------------------------------------------------------------------
  15. // ZZ> Handle death by sending a message and other stuff
  16. IfKilled
  17.   tmpargument = 2
  18.   tmpdistance = rand & 1023 + 10000
  19.   PlaySound
  20.  
  21.  
  22.   // Send messages
  23.   IfTargetIsOnHatedTeam
  24.     tmpargument = 0
  25.   Else
  26.     tmpargument = 1
  27.   SendMessageNear
  28.  
  29.  
  30.   // Drop goodies
  31.   tmpargument = 65535
  32.   DropMoney
  33.  
  34.  
  35.   // Make the character body
  36.   tmpargument = 45
  37.   SetBumpHeight
  38.  
  39.   // Award quest experience
  40.   tmpargument = 100
  41.   tmpdistance = EXPQUEST
  42.   GiveExperienceToTargetTeam
  43.  
  44.   // Finish it up
  45.   BeatModule
  46.   EnableExport
  47.   // Mark this module as beaten, hidden modules may open up
  48.   tmpargument = [BEAT]
  49.   AddIDSZ
  50.   // Fix the end text
  51.   ClearEndMessage
  52.   tmpargument = 3
  53.   AddEndMessage
  54.  
  55.   // Order team to die
  56.   tmpdistance = [EVIL]
  57.   tmpargument = [UNDO]
  58.   OrderSpecialID
  59.  
  60.  
  61.   // Put out the eyes
  62.   DisaffirmCharacter
  63.  
  64.  
  65.  
  66. //------------------------------------------------------------------------------
  67. // ZZ> Oops
  68. IfHealed
  69.   tmpargument = 2
  70.   SendMessageNear
  71.  
  72.  
  73. //------------------------------------------------------------------------------
  74. // ZZ> Keep 'em guessin'
  75. IfAttacked
  76.   tmpargument = rand & 1
  77.   tmpdistance = rand & 1023 + 10000
  78.   PlaySound
  79.  
  80.  
  81.   SetTargetToWhoeverAttacked
  82.     IfTargetIsOnHatedTeam
  83.       GetState
  84.     Else
  85.       SetTargetToOldTarget
  86.  
  87.  
  88.   IfStateIs1
  89.     GetState
  90.   Else
  91.     IfStateIs2
  92.       GetState
  93.     Else
  94.       // Teleport away...
  95.       tmpargument = 1
  96.       SetState
  97.       tmpargument = 20
  98.       SetTime
  99.  
  100.  
  101.  
  102. //------------------------------------------------------------------------------
  103. IfBumped
  104.   IfStateIs1
  105.     GetState
  106.   Else
  107.     IfStateIs2
  108.       GetState
  109.     Else
  110.       // Teleport away...
  111.       tmpargument = 1
  112.       SetState
  113.       tmpargument = 0
  114.       SetTime
  115.  
  116.  
  117.  
  118. //------------------------------------------------------------------------------
  119. // ZZ> For charging a spell...
  120. IfStateIs10
  121.   // Left hand
  122.   IfTimeOut
  123.     // Release the spell?
  124.     tmpx = targetdistance - 128
  125.     GetContent
  126.     tmpy = tmpargument & 7 < 7
  127.     IfXIsLessThanY
  128.       // Distance is good...
  129.       tmpx = selfmana
  130.       tmpy = 256
  131.       IfXIsMoreThanY
  132.         // Is it one use?
  133.         tmpy = 64
  134.         tmpx = tmpargument & tmpy
  135.         IfXIsEqualToY
  136.           tmpargument = tmpargument + 128
  137.           SetContent
  138.         tmpargument = 0
  139.         SetState
  140.       Else
  141.         // Get more mana first
  142.         tmpargument = LATCHLEFT
  143.         PressLatchButton
  144.     Else
  145.       // Get closer first
  146.       tmpargument = LATCHLEFT
  147.       PressLatchButton
  148.     tmpx = targetx - selfx > 1 + selfx
  149.     tmpy = targety - selfy > 1 + selfy
  150.     ClearWaypoints
  151.     AddWaypoint
  152.     tmpargument = 10
  153.     SetTime
  154.   Else
  155.     // Keep charging
  156.     tmpargument = LATCHLEFT
  157.     PressLatchButton
  158.     tmpx = targetx - selfx > 1 + selfx
  159.     tmpy = targety - selfy > 1 + selfy
  160.     ClearWaypoints
  161.     AddWaypoint
  162. IfStateIs11
  163.   // Right hand
  164.   IfTimeOut
  165.     // Release the spell?
  166.     tmpx = targetdistance - 128
  167.     GetContent
  168.     tmpy = tmpargument & 1792 > 1
  169.     IfXIsLessThanY
  170.       // Distance is good...
  171.       tmpx = selfmana
  172.       tmpy = 256
  173.       IfXIsMoreThanY
  174.         // Is it one use?
  175.         tmpy = 16384
  176.         tmpx = tmpargument & tmpy
  177.         IfXIsEqualToY
  178.           tmpargument = tmpargument + 32768
  179.           SetContent
  180.         tmpargument = 0
  181.         SetState
  182.       Else
  183.         // Get more mana first
  184.         tmpargument = LATCHRIGHT
  185.         PressLatchButton
  186.     Else
  187.       // Get closer first
  188.       tmpargument = LATCHRIGHT
  189.       PressLatchButton
  190.     tmpx = targetx - selfx > 1 + selfx
  191.     tmpy = targety - selfy > 1 + selfy
  192.     ClearWaypoints
  193.     AddWaypoint
  194.     tmpargument = 10
  195.     SetTime
  196.   Else
  197.     // Keep charging
  198.     tmpargument = LATCHRIGHT
  199.     PressLatchButton
  200.     tmpx = targetx - selfx > 1 + selfx
  201.     tmpy = targety - selfy > 1 + selfy
  202.     ClearWaypoints
  203.     AddWaypoint
  204.  
  205.  
  206.  
  207. //------------------------------------------------------------------------------
  208. // ZZ> Find something to do...
  209. IfTimeOut
  210.   CleanUp
  211.  
  212.  
  213.   IfStateIs15
  214.     // Fall through to normal state
  215.     tmpargument = 0
  216.     SetState
  217.  
  218.  
  219.  
  220.   IfStateIs13
  221.     // Un-charged spell in right hand...
  222.     IfTargetIsOnHatedTeam
  223.       tmpx = targetdistance - 128
  224.       GetContent
  225.       tmpy = tmpargument & 1792 > 1
  226.       IfXIsLessThanY
  227.         // Distance is good...
  228.         IfFacingTarget
  229.           tmpargument = LATCHRIGHT
  230.           PressLatchButton
  231.       tmpargument = 15
  232.       SetState
  233.       tmpargument = rand & 15 + 20
  234.       SetTime
  235.     Else
  236.       tmpargument = 0
  237.       SetState
  238.  
  239.  
  240.  
  241.   IfStateIs12
  242.     IfTargetIsOnHatedTeam
  243.       // Un-charged spell in left hand...
  244.       tmpx = targetdistance - 128
  245.       GetContent
  246.       tmpy = tmpargument & 7 < 7
  247.       IfXIsLessThanY
  248.         // Distance is good...
  249.         IfFacingTarget
  250.           tmpargument = LATCHLEFT
  251.           PressLatchButton
  252.       tmpargument = 15
  253.       SetState
  254.       tmpargument = rand & 15 + 20
  255.       SetTime
  256.     Else
  257.       tmpargument = 0
  258.       SetState
  259.  
  260.  
  261.  
  262.   IfStateIs3
  263.     // Pick a spell to use on the enemy...  Left or right
  264.     IfTargetIsOnHatedTeam
  265.       GetContent
  266.       tmpx = tmpargument & 32896
  267.       tmpy = 0
  268.       IfXIsEqualToY
  269.         // Neither hand is useable...  Fall through to state 1
  270.         tmpargument = 1
  271.         SetState
  272.       Else
  273.         tmpy = 32896
  274.         IfXIsEqualToY
  275.           // Both hands are useable, so pick one...  0 or 8
  276.           tmpx = rand & 8
  277.         Else
  278.           // Figure out if it's left or right...  0 or 8
  279.           tmpx = tmpx > 12
  280.         tmpy = 0
  281.         tmpturn = 11  // Right hand state
  282.         IfXIsEqualToY
  283.           tmpturn = 10  // Left hand state
  284.         tmpargument = tmpargument > tmpx & 127
  285.         tmpy = 32
  286.         tmpx = tmpargument & tmpy
  287.         IfXIsEqualToY
  288.           // We need a [HUMA] corpse around...
  289.           tmpx = tmpargument  // Save it...
  290.           tmpargument = [HUMA]
  291.           tmpdistance = 7 // Dead friends and enemies...
  292.           SetTargetToNearestBlahID
  293.             tmpargument = tmpx & 24 < 4
  294.             SetTime
  295.             tmpargument = tmpturn
  296.             SetState
  297.           Else
  298.             // Drop back to normal state
  299.             tmpargument = 0
  300.             SetState
  301.         Else
  302.           // Just set the state and time...
  303.           tmpargument = tmpargument & 24 < 4
  304.           SetTime
  305.           tmpx = tmpargument
  306.           tmpy = 0
  307.           IfXIsEqualToY
  308.             // Use states 12 and 13 for uncharged spells...
  309.             tmpturn = tmpturn + 2
  310.           tmpargument = tmpturn
  311.           SetState
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.   IfStateIs2
  319.     // Halfway through a teleport
  320.     tmpargument = rand & 15 + 35
  321.     SetTime
  322.     tmpx = rand & 511 - 256 + selfx
  323.     tmpy = rand & 511 - 256 + selfy
  324.     Teleport
  325.     tmpx = rand & 511 - 256 + selfx
  326.     tmpy = rand & 511 - 256 + selfy
  327.     Teleport
  328.     tmpargument = 15
  329.     SetState
  330.     // Face the target
  331.     tmpx = targetx
  332.     tmpy = targety
  333.     ClearWaypoints
  334.     AddWaypoint
  335.  
  336.  
  337.  
  338.   IfStateIs1
  339.     // Want to start a teleport
  340.     tmpargument = ACTIONMJ
  341.     DoAction
  342.       tmpargument = 2
  343.       SetState
  344.       tmpargument = 40  // Don't let 'em get hit out of it...
  345.       SetDamageTime
  346.       tmpargument = 16
  347.       SetTime
  348.     Else
  349.       // Try again in a bit...
  350.       tmpargument = 5
  351.       SetTime
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.   IfStateIs0
  360.     tmpargument = 20
  361.     SetTime
  362.     tmpx = rand & 255
  363.     tmpy = 200
  364.     IfXIsMoreThanY
  365.       // Teleport...
  366.       tmpargument = 1
  367.       SetState
  368.       SetTime
  369.     Else
  370.       // Go after enemies
  371.       SetTargetToNearestEnemy
  372.         tmpargument = rand & 7 + 4
  373.         SetTime
  374.         tmpargument = 3
  375.         SetState
  376.         tmpx = targetx
  377.         tmpy = targety
  378.       Else
  379.         // Wander around
  380.         tmpargument = rand & 15 + 25
  381.         SetTime
  382.         tmpx = rand & 511 - 256 + selfspawnx
  383.         tmpy = rand & 511 - 256 + selfspawny
  384.       ClearWaypoints
  385.       AddWaypoint
  386.  
  387.  
  388. //------------------------------------------------------------------------------
  389. // ZZ> Put on some eyes
  390. IfSpawned
  391.   tmpargument = 6
  392.   tmpdistance = 9
  393.   SpawnAttachedParticle
  394.   tmpdistance = 10
  395.   SpawnAttachedParticle
  396.  
  397.  
  398.  
  399. //------------------------------------------------------------------------------
  400. End
  401. //------------------------------------------------------------------------------
  402.