home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2000 December / PCP_12_2000B.iso / bg2demo / data1.cab / hd0_scripts / Text / control.baf < prev    next >
Encoding:
Text File  |  2000-09-22  |  2.3 KB  |  131 lines

  1. // * Date Created:Mar 22, 2000.
  2. // * Created by: Brent Knowles
  3. // * Purpose: A Control Panel type script to allow the hot-skeys to control the functionality of the NPC
  4. // * Strings:
  5. // * Never shout for help 830
  6. // * help at three quarter hit points  831 
  7. // * help at half hit points 832
  8. // * help when almost dead  833
  9. // *
  10. // * Follow mode on  835
  11. // * Follow mode off 836
  12. // * 
  13.  
  14. // *Control panel*
  15.  
  16.  
  17. // * Switch Weapons
  18. IF
  19.     HotKey(D)
  20. THEN
  21.     RESPONSE #100
  22.         EquipMostDamagingMelee()
  23. END
  24.  
  25. IF
  26.     HotKey(F)
  27. THEN
  28.     RESPONSE #100
  29.         EquipRanged()
  30. END
  31.  
  32. // * Turn Auto-Follow On
  33. IF 
  34.     HotKey(S)
  35.     Global("pscript_AutoFollow","LOCALS",0)
  36. THEN
  37.     RESPONSE #100
  38.         DisplayStringHead(Myself,835)
  39.         SetGlobal("pscript_AutoFollow","LOCALS",1)    
  40. END
  41.  
  42. // * Turn Auto-Follow Off
  43. IF 
  44.     HotKey(S)
  45.     Global("pscript_AutoFollow","LOCALS",1)
  46. THEN
  47.     RESPONSE #100
  48.         DisplayStringHead(Myself,836)
  49.         SetGlobal("pscript_AutoFollow","LOCALS",0)    
  50. END
  51.  
  52. //*Pain Tolerance*
  53. // * local=0 means that the user will never ask for help
  54. IF
  55.     HotKey(G)
  56.     Global("pscript_Pain","LOCALS",0)
  57. THEN
  58.     RESPONSE #100
  59.         DisplayStringHead(Myself,831)
  60.         SetGlobal("pscript_Pain","LOCALS",1)
  61. END
  62.  
  63. // * 2 = half hit point
  64. IF
  65.     HotKey(G)
  66.     Global("pscript_Pain","LOCALS",1)
  67. THEN
  68.     RESPONSE #100
  69.         DisplayStringHead(Myself,832)
  70.         SetGlobal("pscript_Pain","LOCALS",2)
  71. END
  72. IF
  73.     HotKey(G)
  74.     Global("pscript_Pain","LOCALS",2)
  75. THEN
  76.     RESPONSE #100
  77.         DisplayStringHead(Myself,833)
  78.         SetGlobal("pscript_Pain","LOCALS",3)
  79. END
  80.  
  81. IF
  82.     HotKey(G)
  83.     Global("pscript_Pain","LOCALS",3)
  84. THEN
  85.     RESPONSE #100
  86.         DisplayStringHead(Myself,830)
  87.         SetGlobal("pscript_Pain","LOCALS",0)
  88. END
  89. //*SHOUTS*
  90. IF
  91.     HPPercentLT(Myself,75)
  92.     See(NearestEnemyOf(Myself))
  93.     Global("pscript_Pain","LOCALS",1)
  94. THEN
  95.     RESPONSE #100
  96.         Help()
  97.         Continue()
  98. END
  99.  
  100. IF
  101.     HPPercentLT(Myself,50)
  102.     See(NearestEnemyOf(Myself))
  103.     Global("pscript_Pain","LOCALS",2)
  104. THEN
  105.     RESPONSE #100
  106.         Help()
  107.         Continue()
  108. END
  109. IF
  110.     HPPercentLT(Myself,25)
  111.     See(NearestEnemyOf(Myself))
  112.     Global("pscript_Pain","LOCALS",3)
  113. THEN
  114.     RESPONSE #100
  115.         Help()
  116.         Continue()
  117. END
  118.  
  119. //*ORDERS*
  120.  
  121. // * follow if Auto-Follow is turned on
  122. IF
  123. //    See(Player1)
  124.     !Range(Player1,15)
  125.     Global("pscript_AutoFollow","LOCALS",1)
  126. THEN
  127.     RESPONSE #100
  128.         SetInterrupt(FALSE)
  129.         MoveToObject(Player1)
  130.         SetInterrupt(TRUE)
  131. END