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

  1. // ZZ> This function makes the character wanders around its enemy
  2. IfCleanedUp                // Respawn
  3.   RespawnCharacter              // 
  4. IfKilled                // This reduces the height of the char
  5.   tmpargument = 0                //
  6.   SendMessageNear                //
  7.   tmpargument = 40              //
  8.   SetBumpSize                  //
  9.   tmpargument = 45              //
  10.   SetBumpHeight                  //
  11.   tmpargument = 65535              // Drop money
  12.   DropMoney                  //
  13.   tmpargument = 2              //
  14.   tmpdistance = rand & 4095 + 8000      //
  15.   PlaySound                  //
  16. IfAttacked                // Counter attack
  17.   SetTargetToWhoeverAttacked          //
  18.     IfTargetIsOnHatedTeam            //
  19.       BecomeLeader                  //
  20.       tmpargument = 1                  // Enter combat mode
  21.       SetState                      //
  22.     Else                    //
  23.       SetTargetToOldTarget              //
  24.   tmpargument = rand & 1          //
  25.   tmpdistance = rand & 4095 + 8000      //
  26.   PlaySound                  //
  27. IfTargetKilled                // Return to follow mode
  28.   tmpargument = 0              //
  29.   SetState                  //
  30. IfBumped                // Attack whoever it bumped
  31.   SetTargetToWhoeverBumped          //
  32.   IfTargetIsOnHatedTeam              // Make sure it's an enemy
  33.     IfHoldingMeleeWeapon                    // Got Weapon?
  34.       PressLatchButton                  //
  35.   Else                      // Scooch around friendly
  36.     tmpx = rand & 255 + targetx - 128        //
  37.     tmpy = rand & 255 + targety - 128        //
  38.     ClearWaypoints                //
  39.     AddWaypoint                    //
  40.     SetTargetToOldTarget            //
  41. IfTimeOut                // This is done every so often
  42.   SetTargetToNearbyEnemy          // Look for enemies
  43.     tmpargument = 1                // Enter combat mode
  44.     SetState                    //
  45.     BecomeLeader                //
  46.   tmpx = rand & 255              //
  47.   tmpy = 25                  //
  48.   IfXIsLessThanY              // Play a random grunt?
  49.     tmpargument = 3                //
  50.     tmpdistance = rand & 4095 + 9000        //
  51.     PlaySound                    //
  52.   IfStateIs0                  // State 0 ( Follow )
  53.     tmpx = rand & 1023 - 512 + leaderx        //
  54.     tmpy = rand & 1023 - 512 + leadery        //
  55.   Else                      // State 1 ( Combat )
  56.     tmpx = targetdistance            // Too far?
  57.     tmpy = 2000                    //
  58.     IfXIsMoreThanY                //
  59.       tmpargument = 0
  60.       SetState                      // Revert to follow mode
  61.       tmpx = selfx
  62.       tmpy = selfy
  63.     Else
  64.       tmpy = 150
  65.       IfXIsLessThanY
  66.         // Run away
  67.         tmpx = targetx
  68.         tmpy = targety
  69.         tmpturn = targetturnto + 32768
  70.         tmpdistance = 800
  71.         Compass         
  72.       Else
  73.         tmpy = 0  // Unarmed...
  74.         IfHoldingMeleeWeapon              // Got Weapon?
  75.           tmpy = 350
  76.         Else
  77.           IfHoldingRangedWeapon
  78.             tmpy = 800
  79.         IfXIsLessThanY
  80.           tmpx = 800
  81.           IfXIsEqualToY
  82.             // Ranged weapon, so lead the target
  83.             tmpx = targetspeedx * tmpx > 4 + targetx
  84.             tmpy = targetspeedy * tmpx > 4 + targety
  85.             IfFacingTarget
  86.               PressLatchButton
  87.           Else
  88.             // Melee weapon, so run around the target...
  89.             tmpx = rand & 511 - 256 + targetx
  90.             tmpy = rand & 511 - 256 + targety
  91.             IfFacingTarget
  92.               PressLatchButton
  93.               tmpx = targetx
  94.               tmpy = targety
  95.         Else
  96.           // Not close enough, so run at the target
  97.           tmpx = targetx
  98.           tmpy = targety
  99.           tmpturn = targetturnto
  100.           tmpdistance = 400
  101.           Compass
  102.   ClearWaypoints              //
  103.   AddWaypoint                  //
  104.   tmpargument = rand & 15 + 10          // Wait a while and try again
  105.   SetTime                  //
  106. End                    // Finished with this character
  107.