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

  1. // * Offensive mage -- intended for bards, possibly fighter mages
  2. // * Will only attack spells against 'stronger' creatures that do not have spell bouncing or protection
  3. // * Mostly low-level offsensive spells
  4.  
  5. // * Vocalize if silenced*
  6. IF
  7.     ActionListEmpty()
  8.     See(NearestEnemyOf(Myself))        
  9.     StateCheck(Myself,STATE_SILENCED)
  10.     HaveSpell(WIZARD_VOCALIZE)
  11. THEN
  12.     RESPONSE #100
  13.         Spell(Myself,WIZARD_VOCALIZE)
  14. END
  15.  
  16. // *Magic Attack*
  17. // * attemps to remove spell protections from an enemy mage
  18. // * Must check to see if it was able to bring down the shield
  19. // * if not, it should stop using this spell.
  20.  
  21. IF
  22.     ActionListEmpty()
  23.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  24.     HaveSpell(WIZARD_SPELL_THRUST)
  25.     Global("pscript_SpellThrust","LOCALS",0)
  26.     OR(2)
  27.     HasBounceEffects(LastSeenBy(Myself))
  28.     HasImmunityEffects(LastSeenBy(Myself))
  29. THEN
  30.     RESPONSE #100
  31.         Spell(LastSeenBy(Myself),WIZARD_SPELL_THRUST)
  32.         Wait(2)
  33.         SetGlobal("pscript_SpellThrust","LOCALS",1)        
  34. END
  35.  
  36. // *
  37. // * spellThrust=1 means to check to see if the shields went down
  38. // * if they didn't, it means this spell won't work against the level of shielding this mage has
  39. // * so set the local to 2 
  40. IF
  41.     Global("pscript_SpellThrust","LOCALS",1)
  42.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  43.     OR(2)
  44.     HasBounceEffects(LastSeenBy(Myself))
  45.     HasImmunityEffects(LastSeenBy(Myself))    
  46. THEN
  47.     RESPONSE #100
  48.         SetGlobal("pscript_SpellThrust","LOCALS",2)        
  49. END
  50. // * If the spell did work then reset the local to 0
  51. IF
  52.     Global("pscript_SpellThrust","LOCALS",1)
  53.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  54.     !HasBounceEffects(LastSeenBy(Myself))
  55.     !HasImmunityEffects(LastSeenBy(Myself))    
  56. THEN
  57.     RESPONSE #100
  58.         SetGlobal("pscript_SpellThrust","LOCALS",0)        
  59. END
  60.  
  61. // *
  62. // Khelben's warding whip.
  63. // *
  64. IF
  65.     ActionListEmpty()
  66.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  67.     HaveSpell(WIZARD_WARDING_WHIP)
  68.     Global("pscript_WHIP","LOCALS",0)
  69.     OR(2)
  70.     HasBounceEffects(LastSeenBy(Myself))
  71.     HasImmunityEffects(LastSeenBy(Myself))
  72. THEN
  73.     RESPONSE #100
  74.         Spell(LastSeenBy(Myself),WIZARD_WARDING_WHIP)
  75.         Wait(2)
  76.         SetGlobal("pscript_WHIP","LOCALS",1)        
  77. END
  78.  
  79. // *
  80. // * WHIP=1 means to check to see if the shields went down
  81. // * if they didn't, it means this spell won't work against the level of shielding this mage has
  82. // * so set the local to 2 
  83. IF
  84.     Global("pscript_WHIP","LOCALS",1)
  85.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  86.     OR(2)
  87.     HasBounceEffects(LastSeenBy(Myself))
  88.     HasImmunityEffects(LastSeenBy(Myself))    
  89. THEN
  90.     RESPONSE #100
  91.         SetGlobal("pscript_WHIP","LOCALS",2)        
  92. END
  93. // * If the spell did work then reset the local to 0
  94. IF
  95.     Global("pscript_WHIP","LOCALS",1)
  96.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  97.     !HasBounceEffects(LastSeenBy(Myself))
  98.     !HasImmunityEffects(LastSeenBy(Myself))    
  99. THEN
  100.     RESPONSE #100
  101.         SetGlobal("pscript_WHIP","LOCALS",0)        
  102. END
  103. // * Disabling*
  104.  
  105. IF
  106.     ActionListEmpty()
  107.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  108.     HaveSpell(WIZARD_POWER_WORD_SILENCE)
  109.     !HasBounceEffects(LastSeenBy(Myself))
  110.     !StateCheck(LastSeenBy(Myself),STATE_SILENCED)
  111. THEN
  112.     RESPONSE #100
  113.         Spell(LastSeenBy(Myself),WIZARD_POWER_WORD_SILENCE)
  114. END
  115.  
  116. // *High-Level Offensive*
  117. IF
  118.     ActionListEmpty()
  119.     See(NearestEnemyOf(Myself))
  120.     HPLT(LastSeenBy(Myself),50)
  121.     HPGT(LastSeenBy(Myself),20)
  122.     !HasBounceEffects(LastSeenBy(Myself))        
  123.     HaveSpell(WIZARD_FINGER_OF_DEATH)
  124. THEN
  125.     RESPONSE #100
  126.         Spell(NearestEnemyOf(Myself),WIZARD_FINGER_OF_DEATH)
  127. END
  128.  
  129. IF
  130.     See(NearestEnemyOf(Myself))        
  131.     HaveSpell(WIZARD_ABI_DALZIMS_HORRID_WILTING)
  132.     HPGT(LastSeenBy(Myself),20)
  133. THEN
  134.     RESPONSE #100
  135.         Spell(NearestEnemyOf(Myself),WIZARD_ABI_DALZIMS_HORRID_WILTING)
  136. END
  137.  
  138.  
  139. // * summon a Nishruu to combat an enemy mage
  140. IF
  141.     ActionListEmpty()
  142.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  143.     HaveSpell(WIZARD_SUMMON_NISHRUU)
  144. THEN
  145.     RESPONSE #100
  146.         Spell(Myself,WIZARD_SUMMON_NISHRUU)
  147. END
  148.  
  149. // * cast maze on a strong opponent
  150. IF
  151.     ActionListEmpty()
  152.     See(NearestEnemyOf(Myself))
  153.     HPGT(LastSeenBy(Myself),50)
  154.     !HasBounceEffects(LastSeenBy(Myself))        
  155.     HaveSpell(WIZARD_MAZE)
  156. THEN
  157.     RESPONSE #100
  158.         Spell(NearestEnemyOf(Myself),WIZARD_MAZE)
  159. END
  160.  
  161. // * Mid-Level Offensive*
  162.  
  163. // * cone of cold
  164. IF
  165.     ActionListEmpty()
  166.     See(NearestEnemyOf(Myself))
  167.     HPGT(LastSeenBy(Myself),20)
  168.     !HasBounceEffects(LastSeenBy(Myself))    
  169.     HaveSpell(WIZARD_CONE_OF_COLD)
  170. THEN
  171.     RESPONSE #100
  172.         Spell(LastSeenBy(Myself),WIZARD_CONE_OF_COLD)
  173. END
  174.  
  175. // * try to hold monsters
  176. IF
  177.     ActionListEmpty()
  178.     See(NearestEnemyOf(Myself))
  179.     HPGT(LastSeenBy(Myself),30)
  180.     !HasBounceEffects(LastSeenBy(Myself))
  181.     !General(LastSeenBy(Myself),HUMANOID)
  182.     !StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
  183.     HaveSpell(WIZARD_HOLD_MONSTER)
  184. THEN
  185.     RESPONSE #100
  186.         Spell(LastSeenBy(Myself),WIZARD_HOLD_MONSTER)
  187. END
  188.  
  189. // * death spell; very useful against hordes of summoned creatures
  190. // * will only use this spell if attacked by more than 4 enemy creatures
  191. IF
  192.     ActionListEmpty()
  193.     Delay(6)
  194.     HaveSpell(WIZARD_DEATH_SPELL)
  195.     See(NearestEnemyOf(Myself))
  196.     HPGT(LastSeenBy(Myself),10)
  197.     HPLT(LastSeenBy(Myself),50)
  198.     !HasBounceEffects(LastSeenBy(Myself))
  199.     NumCreatureVsPartyGT([ENEMY],4)
  200. THEN
  201.     RESPONSE #100
  202.         Spell(LastSeenBy(Myself),WIZARD_DEATH_SPELL)
  203. END
  204.  
  205. // * try and disintegrate a really powerful opponent
  206. IF
  207.     ActionListEmpty()
  208.     See(NearestEnemyOf(Myself))
  209.     HPGT(LastSeenBy(Myself),50)
  210.     !HasBounceEffects(LastSeenBy(Myself))
  211.     HaveSpell(WIZARD_DISINTEGRATE)
  212. THEN
  213.     RESPONSE #100
  214.         Spell(LastSeenBy(Myself),WIZARD_DISINTEGRATE)
  215. END
  216.  
  217. // *Low-Level Offensive*
  218.  
  219. IF
  220.     ActionListEmpty()
  221.     See(NearestEnemyOf(Myself))
  222.     HPGT(LastSeenBy(Myself),20)
  223.     !HasBounceEffects(LastSeenBy(Myself))
  224.     HaveSpell(WIZARD_BURNING_HANDS)
  225. THEN
  226.     RESPONSE #100
  227.         Spell(LastSeenBy(Myself),WIZARD_BURNING_HANDS)
  228. END
  229.  
  230. IF
  231.     ActionListEmpty()
  232.     See(NearestEnemyOf(Myself))
  233.     HPGT(LastSeenBy(Myself),20)
  234.     !HasBounceEffects(LastSeenBy(Myself))
  235.     HaveSpell(WIZARD_COLOR_SPRAY)
  236. THEN
  237.     RESPONSE #100
  238.         Spell(LastSeenBy(Myself),WIZARD_COLOR_SPRAY)
  239. END
  240.  
  241. IF
  242.     ActionListEmpty()
  243.     See(NearestEnemyOf(Myself))
  244.     HPGT(LastSeenBy(Myself),20)
  245.     !HasBounceEffects(LastSeenBy(Myself))
  246.     HaveSpell(WIZARD_MAGIC_MISSILE)
  247. THEN
  248.     RESPONSE #100
  249.         Spell(LastSeenBy(Myself),WIZARD_MAGIC_MISSILE)
  250. END
  251.  
  252. IF
  253.     See(NearestEnemyOf(Myself))
  254.     !HasBounceEffects(LastSeenBy(Myself))
  255.     HaveSpell(WIZARD_SLEEP)
  256.     ActionListEmpty()
  257. THEN
  258.     RESPONSE #100
  259.         Spell(LastSeenBy(Myself),WIZARD_SLEEP)
  260. END
  261.  
  262. IF
  263.     ActionListEmpty()
  264.     See(NearestEnemyOf(Myself))
  265.     HPGT(LastSeenBy(Myself),20)
  266.     !HasBounceEffects(LastSeenBy(Myself))
  267.     HaveSpell(WIZARD_CHROMATIC_ORB)
  268. THEN
  269.     RESPONSE #100
  270.         Spell(LastSeenBy(Myself),WIZARD_CHROMATIC_ORB)
  271. END
  272.  
  273. IF
  274.     ActionListEmpty()
  275.     See(NearestEnemyOf(Myself))
  276.     HPGT(LastSeenBy(Myself),20)
  277.     !HasBounceEffects(LastSeenBy(Myself))
  278.     HaveSpell(WIZARD_LARLOCH_MINOR_DRAIN)
  279. THEN
  280.     RESPONSE #100
  281.         Spell(LastSeenBy(Myself),WIZARD_LARLOCH_MINOR_DRAIN)
  282. END
  283.  
  284. IF
  285.     ActionListEmpty()
  286.     See(NearestEnemyOf(Myself))
  287.     HPGT(LastSeenBy(Myself),20)
  288.     !HasBounceEffects(LastSeenBy(Myself))
  289.     HaveSpell(WIZARD_BLINDNESS)
  290.     !StateCheck(LastSeenBy(Myself),STATE_BLIND)
  291. THEN
  292.     RESPONSE #100
  293.         Spell(LastSeenBy(Myself),WIZARD_BLINDNESS)
  294. END
  295.  
  296. IF
  297.     ActionListEmpty()
  298.     See(NearestEnemyOf(Myself))
  299.     HPGT(LastSeenBy(Myself),30)
  300.     !HasBounceEffects(LastSeenBy(Myself))
  301.     General(LastSeenBy(Myself),HUMANOID)
  302.     !StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
  303.     HaveSpell(WIZARD_CHARM_PERSON)
  304. THEN
  305.     RESPONSE #100
  306.         Spell(LastSeenBy(Myself),WIZARD_CHARM_PERSON)
  307. END
  308.  
  309. // *Combat*
  310.  
  311. // * attack with melee
  312. IF
  313.     ActionListEmpty()
  314.     See(NearestEnemyOf(Myself))
  315.     Range(NearestEnemyOf(Myself),4)
  316. THEN
  317.     RESPONSE #100
  318.         EquipMostDamagingMelee()
  319.         AttackReevaluate(NearestEnemyOf(Myself),30)
  320. END
  321.  
  322. // * attack with ranged weapons
  323. IF
  324.     ActionListEmpty()
  325.     See(NearestEnemyOf(Myself))
  326.     !Range(NearestEnemyOf(Myself),4)
  327. THEN
  328.     RESPONSE #100
  329.         EquipRanged()
  330.         AttackReevaluate(NearestEnemyOf(Myself),30)
  331. END
  332.  
  333. // * reset locals*
  334. // * if no enemies are around
  335. IF
  336.     !See(NearestEnemyOf(Myself))
  337.     CombatCounter(0)
  338.     OR(2)
  339.     GlobalGT("pscript_SpellThrust","LOCALS",0)
  340.     GlobalGT("pscript_WHIP","LOCALS",0)
  341. THEN
  342.     RESPONSE #100
  343.         SetGlobal("pscript_SpellThrust","LOCALS",0)
  344.         SetGlobal("pscript_WHIP","LOCALS",0)
  345. END