home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 42 / CDGAMER42.iso / Egoboo / egoboo.exe / egoboo / modules / advent.mod / objects / mimic.obj / script.txt < prev    next >
Text File  |  2000-05-26  |  3KB  |  100 lines

  1. //------------------------------------------------------------------------------
  2. // ZZ> Mimics have an enchantment sustaining them
  3. IfSpawned
  4.   EnchantTarget  // Enchant self...
  5.  
  6.  
  7. //------------------------------------------------------------------------------
  8. // ZZ> Someone cast an unlock spell
  9. IfOrdered
  10.   tmpx = selforder
  11.   tmpy = 491  // The unique code for an unlock order
  12.   IfXIsEqualToY
  13.     // Die
  14.     SetTargetToSelf
  15.     KillTarget
  16.     tmpargument = 3
  17.     SendMessageNear
  18.  
  19.  
  20. //------------------------------------------------------------------------------
  21. // ZZ> This function makes the character wait for the enemy to open it
  22. IfKilled                // This reduces the height of the char
  23.   tmpargument = 0
  24.   tmpdistance = rand & 1023 + 10500
  25.   PlaySound
  26.  
  27.  
  28.   tmpargument = 0                //
  29.   SendMessageNear                // Kill message
  30.   GetBumpHeight                  //
  31.   tmpargument = tmpargument * 50 / 100      //
  32.   SetBumpHeight                  //
  33.   tmpargument = 65535              // Drop money
  34.   DropMoney                  //
  35.   DropItems
  36. IfTargetKilled                // Check for more food
  37.   tmpargument = 0              //
  38.   SetTargetToNearbyEnemy          // Get the other enemy
  39.     tmpargument = 1                //
  40.   SetState                  //
  41. IfAttacked                // Retaliation
  42.   tmpargument = 0
  43.   tmpdistance = rand & 1023 + 10500
  44.   PlaySound
  45.   SetTargetToWhoeverAttacked          // Get the enemy
  46.     tmpargument = 0                //
  47.     IfStateIs                    // Enter combat mode
  48.       tmpargument = 1                  //
  49.       SetState                      //
  50.       IfTargetIsAPlayer                  //
  51.         tmpargument = 2                    //
  52.         SendMessageNear                    // Advice
  53. IfBumped                // Attack whoever it bumped
  54.   SetTargetToWhoeverBumped          //
  55.   IfTargetIsOnHatedTeam              // Make sure it's an enemy
  56.     tmpargument = 0                //
  57.     IfStateIs                    // Enter combat mode
  58.       IfTargetIsAPlayer                  // Advice
  59.         tmpargument = 1                    //
  60.         SendMessageNear                    //
  61.       SetState                      // Combat
  62.     tmpargument = 1                // Attack Left = 1
  63.     PressLatchButton                //
  64. IfTimeOut                // This is done every so often
  65.   tmpargument = 0              //
  66.   IfStateIs                  // State 0 ( Lurk )
  67.     tmpx = selfx                //
  68.     tmpy = selfy                //
  69.   Else                      // State 1 ( Combat )
  70.     tmpx = 2000                    // Too far?
  71.     tmpy = targetdistance            //
  72.     IfXIsLessThanY                //
  73.       SetState                      // Revert to lurk mode
  74.     tmpx = tmpy                    // In attack range?
  75.     tmpy = 250                    //
  76.     IfXIsLessThanY                // Stick and move
  77.       tmpargument = 2
  78.       tmpdistance = rand & 1023 + 10500
  79.       PlaySound
  80.  
  81.       tmpargument = 1                  // Attack Left = 1
  82.       PressLatchButton                  //
  83.       tmpx = rand & 511 - 256 + targetx          //
  84.       tmpy = rand & 511 - 256 + targety          //
  85.     Else                    // Get closer
  86.       tmpargument = 1
  87.       tmpdistance = rand & 1023 + 10500
  88.       PlaySound
  89.  
  90.       tmpx = targetx                  //
  91.       tmpy = targety                  //
  92.       tmpturn = targetturnto              //
  93.       tmpdistance = 200                  //
  94.       Compass                      //
  95.   ClearWaypoints              //
  96.   AddWaypoint                  //
  97.   tmpargument = rand & 31 + 20          // Wait a while and try again
  98.   SetTime                  //
  99. End                    // Finished with this character
  100.