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

  1. // * Date Created: Mar 21, 2000.
  2. // * Brent Knowles
  3. // *Ranger Script: combines hiding and ranged attack abilities
  4. // * A ranged weapon script.  Attempts to stay out of melee ranged with opponents,
  5. // * Although will switch to melee weapons if needed.
  6.  
  7.  
  8. // *move away and hide
  9. IF
  10.     HPPercentLT(Myself,50)
  11.     See(NearestEnemyOf(Myself))
  12.     !StateCheck(Myself,STATE_INVISIBLE)
  13. THEN
  14.     RESPONSE #100
  15.         RunAwayFrom(NearestEnemyOf(Myself),75)
  16.         Hide()
  17. END
  18.  
  19. IF
  20.     Delay(30)
  21.     !StateCheck(Myself,STATE_INVISIBLE)
  22. THEN
  23.     RESPONSE #100
  24.         Hide()
  25. END
  26.  
  27. //*Defense*
  28. IF
  29.     ActionListEmpty()
  30.     See(NearestEnemyOf(Myself))        
  31.     HaveSpell(CLERIC_ARMOR_OF_FAITH)
  32.     CheckStatGT(Myself,3,ARMORCLASS)
  33.     HPGT(LastSeenBy(Myself),20)
  34. THEN
  35.     RESPONSE #100
  36.         Spell(Myself,CLERIC_ARMOR_OF_FAITH)
  37. END
  38.  
  39. IF
  40.     ActionListEmpty()
  41.     See(NearestEnemyOf(Myself))        
  42.     HaveSpell(CLERIC_BLESS)
  43.     HPGT(LastSeenBy(Myself),20)
  44.     !StateCheck(LastSeenBy(Myself),STATE_BLESS)
  45. THEN
  46.     RESPONSE #100
  47.         Spell(Myself,CLERIC_BLESS)
  48. END
  49. //*Charm Animals*
  50. IF
  51.     ActionListEmpty()
  52.     See(NearestEnemyOfType([0.ANIMAL]))
  53.     HaveSpell(RANGER_CHARM_ANIMAL)
  54. THEN
  55.     RESPONSE #100
  56.         Spell(LastSeenBy(Myself),RANGER_CHARM_ANIMAL)
  57. END
  58.  
  59. //*Heal*
  60. IF
  61.     ActionListEmpty()
  62.     HPPercentLT(MostDamagedOf(),50)
  63.     !StateCheck(MostDamagedOf(),STATE_INVISIBLE)
  64.     HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS)
  65. THEN
  66.     RESPONSE #100
  67.         Spell(MostDamagedOf(),CLERIC_CURE_MEDIUM_WOUNDS)
  68. END
  69.  
  70. IF
  71.     ActionListEmpty()
  72.     HPPercentLT(MostDamagedOf(),80)
  73.     !StateCheck(MostDamagedOf(),STATE_INVISIBLE)
  74.     HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)
  75. THEN
  76.     RESPONSE #100
  77.         Spell(MostDamagedOf(),CLERIC_CURE_LIGHT_WOUNDS)
  78. END
  79.  
  80. //*Heal Self*
  81.  
  82. IF
  83.     ActionListEmpty()
  84.     HPPercentLT(Myself,50)
  85.     HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS)
  86. THEN
  87.     RESPONSE #100
  88.         Spell(Myself,CLERIC_CURE_MEDIUM_WOUNDS)
  89. END
  90.  
  91. IF
  92.     ActionListEmpty()
  93.     HPPercentLT(Myself,80)
  94.     HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)
  95. THEN
  96.     RESPONSE #100
  97.         Spell(Myself,CLERIC_CURE_LIGHT_WOUNDS)
  98. END
  99.  
  100. //*Use Healing Potions*
  101. IF
  102.     HasItem("POTN08",Myself)
  103.     HPPercentLT(Myself,80)
  104. THEN
  105.     RESPONSE #100
  106.         UseItem("POTN08,Myself)
  107. END
  108.  
  109. IF
  110.     HasItem("POTN52",Myself)
  111.     HPPercentLT(Myself,50)
  112. THEN
  113.     RESPONSE #100
  114.         UseItem("POTN52,Myself)
  115. END
  116.  
  117. //*combat*
  118. IF
  119.     ActionListEmpty()
  120.     AttackedBy([ANYONE],DEFAULT)
  121.     Range(LastAttackerOf(Myself),4)
  122. THEN
  123.     RESPONSE #100
  124.         EquipMostDamagingMelee()
  125.         AttackReevaluate(LastAttackerOf(Myself),30)
  126. END
  127.  
  128. IF
  129.     ActionListEmpty()
  130.     See(NearestEnemyOf(Myself))
  131.     !Range(NearestEnemyOf(Myself),4)
  132.     Range(NearestEnemyOf(Myself),10)
  133. THEN
  134.     RESPONSE #100
  135.         RunAwayFrom(NearestEnemyOf(Myself),45)
  136. END
  137.  
  138. IF
  139.     ActionListEmpty()
  140.     See(NearestEnemyOf(Myself))
  141.     !Range(NearestEnemyOf(Myself),10)
  142. THEN
  143.     RESPONSE #100
  144.         EquipRanged()
  145.         AttackReevaluate(NearestEnemyOf(Myself),30)
  146. END
  147.  
  148. IF
  149.     ActionListEmpty()
  150.     See(NearestEnemyOf(Myself))
  151.     Range(NearestEnemyOf(Myself),4)
  152. THEN
  153.     RESPONSE #100
  154.         EquipMostDamagingMelee()
  155.         AttackReevaluate(NearestEnemyOf(Myself),30)
  156. END
  157.  
  158. IF
  159.     ActionListEmpty()
  160.     See(NearestEnemyOf(Myself))
  161.     !Range(NearestEnemyOf(Myself),4)
  162. THEN
  163.     RESPONSE #100
  164.         EquipRanged()
  165.         EquipMostDamagingMelee()
  166.         AttackReevaluate(NearestEnemyOf(Myself),30)
  167. END