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

  1. // * Defensive first and then offensive mage
  2. // * Will run away if doesn't have the spells, or can't use them
  3.  
  4. // * Vocalize if silenced*
  5. IF
  6.     ActionListEmpty()
  7.     See(NearestEnemyOf(Myself))        
  8.     StateCheck(Myself,STATE_SILENCED)
  9.     HaveSpell(WIZARD_VOCALIZE)
  10. THEN
  11.     RESPONSE #100
  12.         Spell(Myself,WIZARD_VOCALIZE)
  13. END
  14.  
  15. // *Spell Defensive*
  16. IF
  17.     ActionListEmpty()
  18.     HaveSpell(WIZARD_MINOR_SPELL_DEFLECTION)
  19.     OR(4)
  20.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))    
  21.     See(NearestEnemyOfType([0.0.0.CLERIC_ALL]))
  22.     See(NearestEnemyOfType([0.0.0.BARD_ALL]))
  23.     See(NearestEnemyOfType([0.0.0.DRUID_ALL]))
  24.     !HasBounceEffects(Myself)
  25.     !HasImmunityEffects(Myself)
  26. THEN
  27.     RESPONSE #100
  28.         Spell(Myself,WIZARD_MINOR_SPELL_DEFLECTION)
  29. END
  30.  
  31. IF
  32.     ActionListEmpty()
  33.     OR(4)
  34.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))    
  35.     See(NearestEnemyOfType([0.0.0.CLERIC_ALL]))
  36.     See(NearestEnemyOfType([0.0.0.BARD_ALL]))
  37.     See(NearestEnemyOfType([0.0.0.DRUID_ALL]))    
  38.     HaveSpell(WIZARD_MINOR_SPELL_TURNING)
  39.     !HasBounceEffects(Myself)
  40.     !HasImmunityEffects(Myself)
  41. THEN
  42.     RESPONSE #100
  43.         Spell(Myself,WIZARD_MINOR_SPELL_TURNING)
  44. END
  45.  
  46. IF
  47.     ActionListEmpty()
  48.     OR(4)
  49.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))    
  50.     See(NearestEnemyOfType([0.0.0.CLERIC_ALL]))
  51.     See(NearestEnemyOfType([0.0.0.BARD_ALL]))
  52.     See(NearestEnemyOfType([0.0.0.DRUID_ALL]))
  53.     HaveSpell(WIZARD_SPELL_SHIELD)
  54.     !HasBounceEffects(Myself)
  55.     !HasImmunityEffects(Myself)
  56. THEN
  57.     RESPONSE #100
  58.         Spell(Myself,WIZARD_SPELL_SHIELD)
  59. END
  60.  
  61.  
  62. IF
  63.     ActionListEmpty()
  64.     OR(4)
  65.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))    
  66.     See(NearestEnemyOfType([0.0.0.CLERIC_ALL]))
  67.     See(NearestEnemyOfType([0.0.0.BARD_ALL]))
  68.     See(NearestEnemyOfType([0.0.0.DRUID_ALL]))
  69.     HaveSpell(WIZARD_SPELL_TURNING)
  70.     !HasBounceEffects(Myself)
  71.     !HasImmunityEffects(Myself)
  72. THEN
  73.     RESPONSE #100
  74.         Spell(Myself,WIZARD_SPELL_TURNING)
  75. END
  76.  
  77.  
  78. //*Mid/High Level - Defensive*
  79. // * Only use these spells if needed, i.e., too high AC, or no mirror images
  80. IF
  81.     ActionListEmpty()
  82.     See(NearestEnemyOf(Myself))        
  83.     HaveSpell(WIZARD_STONE_SKIN)
  84.     CheckStatLT(Myself,1,STONESKINS)
  85. THEN
  86.     RESPONSE #100
  87.         Spell(Myself,WIZARD_STONE_SKIN)
  88. END
  89.  
  90. IF
  91.     ActionListEmpty()
  92.     See(NearestEnemyOf(Myself))        
  93.     HaveSpell(WIZARD_SPIRIT_ARMOR)
  94.     CheckStatGT(Myself,1,ARMORCLASS)
  95. THEN
  96.     RESPONSE #100
  97.         Spell(Myself,WIZARD_SPIRIT_ARMOR)
  98. END
  99.  
  100.  
  101. //*Low-Level Defensive*
  102. IF
  103.     ActionListEmpty()
  104.     See(NearestEnemyOf(Myself))
  105.     HaveSpell(WIZARD_GHOST_ARMOR)
  106.     CheckStatGT(Myself,2,ARMORCLASS)
  107. THEN
  108.     RESPONSE #100
  109.         Spell(Myself,WIZARD_GHOST_ARMOR)
  110. END
  111.  
  112. IF
  113.     ActionListEmpty()
  114.     See(NearestEnemyOf(Myself))
  115.     HaveSpell(WIZARD_MIRROR_IMAGE)
  116.     !StateCheck(Myself,STATE_MIRRORIMAGE)
  117. THEN
  118.     RESPONSE #100
  119.         Spell(Myself,WIZARD_MIRROR_IMAGE)
  120. END
  121.  
  122. IF
  123.     ActionListEmpty()
  124.     See(NearestEnemyOf(Myself))
  125.     HaveSpell(WIZARD_INVISIBILITY)
  126.     !StateCheck(Myself,STATE_INVISIBLE)
  127. THEN
  128.     RESPONSE #100
  129.         Spell(Myself,WIZARD_INVISIBILITY)
  130. END
  131.  
  132. IF
  133.     ActionListEmpty()
  134.     See(NearestEnemyOf(Myself))
  135.     HaveSpell(WIZARD_SHIELD)
  136.     CheckStatGT(Myself,4,ARMORCLASS)
  137. THEN
  138.     RESPONSE #100
  139.         Spell(Myself,WIZARD_SHIELD)
  140. END
  141.  
  142. IF
  143.     ActionListEmpty()
  144.     See(NearestEnemyOf(Myself))
  145.     HaveSpell(WIZARD_ARMOR)
  146.     CheckStatGT(Myself,6,ARMORCLASS)
  147. THEN
  148.     RESPONSE #100
  149.         Spell(Myself,WIZARD_ARMOR)
  150. END
  151. // *Magic Attack*
  152. // * attemps to remove spell protections from an enemy mage
  153. // * Must check to see if it was able to bring down the shield
  154. // * if not, it should stop using this spell.
  155.  
  156. IF
  157.     ActionListEmpty()
  158.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  159.     HaveSpell(WIZARD_SPELL_THRUST)
  160.     Global("pscript_SpellThrust","LOCALS",0)
  161.     OR(2)
  162.     HasBounceEffects(LastSeenBy(Myself))
  163.     HasImmunityEffects(LastSeenBy(Myself))
  164. THEN
  165.     RESPONSE #100
  166.         Spell(LastSeenBy(Myself),WIZARD_SPELL_THRUST)
  167.         Wait(2)
  168.         SetGlobal("pscript_SpellThrust","LOCALS",1)        
  169. END
  170.  
  171. // *
  172. // * spellThrust=1 means to check to see if the shields went down
  173. // * if they didn't, it means this spell won't work against the level of shielding this mage has
  174. // * so set the local to 2 
  175. IF
  176.     Global("pscript_SpellThrust","LOCALS",1)
  177.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  178.     OR(2)
  179.     HasBounceEffects(LastSeenBy(Myself))
  180.     HasImmunityEffects(LastSeenBy(Myself))    
  181. THEN
  182.     RESPONSE #100
  183.         SetGlobal("pscript_SpellThrust","LOCALS",2)        
  184. END
  185. // * If the spell did work then reset the local to 0
  186. IF
  187.     Global("pscript_SpellThrust","LOCALS",1)
  188.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  189.     !HasBounceEffects(LastSeenBy(Myself))
  190.     !HasImmunityEffects(LastSeenBy(Myself))    
  191. THEN
  192.     RESPONSE #100
  193.         SetGlobal("pscript_SpellThrust","LOCALS",0)        
  194. END
  195.  
  196. // *
  197. // Khelben's warding whip.
  198. // *
  199. IF
  200.     ActionListEmpty()
  201.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  202.     HaveSpell(WIZARD_WARDING_WHIP)
  203.     Global("pscript_WHIP","LOCALS",0)
  204.     OR(2)
  205.     HasBounceEffects(LastSeenBy(Myself))
  206.     HasImmunityEffects(LastSeenBy(Myself))
  207. THEN
  208.     RESPONSE #100
  209.         Spell(LastSeenBy(Myself),WIZARD_WARDING_WHIP)
  210.         Wait(2)
  211.         SetGlobal("pscript_WHIP","LOCALS",1)        
  212. END
  213.  
  214. // *
  215. // * WHIP=1 means to check to see if the shields went down
  216. // * if they didn't, it means this spell won't work against the level of shielding this mage has
  217. // * so set the local to 2 
  218. IF
  219.     Global("pscript_WHIP","LOCALS",1)
  220.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  221.     OR(2)
  222.     HasBounceEffects(LastSeenBy(Myself))
  223.     HasImmunityEffects(LastSeenBy(Myself))    
  224. THEN
  225.     RESPONSE #100
  226.         SetGlobal("pscript_WHIP","LOCALS",2)        
  227. END
  228. // * If the spell did work then reset the local to 0
  229. IF
  230.     Global("pscript_WHIP","LOCALS",1)
  231.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  232.     !HasBounceEffects(LastSeenBy(Myself))
  233.     !HasImmunityEffects(LastSeenBy(Myself))    
  234. THEN
  235.     RESPONSE #100
  236.         SetGlobal("pscript_WHIP","LOCALS",0)        
  237. END
  238.  
  239. // *High-Level Offensive*
  240. IF
  241.     ActionListEmpty()
  242.     See(NearestEnemyOf(Myself))
  243.     HPLT(LastSeenBy(Myself),50)
  244.     HPGT(LastSeenBy(Myself),20)
  245.     !HasBounceEffects(LastSeenBy(Myself))        
  246.     HaveSpell(WIZARD_FINGER_OF_DEATH)
  247. THEN
  248.     RESPONSE #100
  249.         Spell(NearestEnemyOf(Myself),WIZARD_FINGER_OF_DEATH)
  250. END
  251.  
  252. IF
  253.     See(NearestEnemyOf(Myself))        
  254.     HaveSpell(WIZARD_ABI_DALZIMS_HORRID_WILTING)
  255.     HPGT(LastSeenBy(Myself),20)
  256. THEN
  257.     RESPONSE #100
  258.         Spell(NearestEnemyOf(Myself),WIZARD_ABI_DALZIMS_HORRID_WILTING)
  259. END
  260.  
  261. // * summon a Nishruu to combat an enemy mage
  262. IF
  263.     ActionListEmpty()
  264.     See(NearestEnemyOfType([0.0.0.MAGE_ALL]))
  265.     HaveSpell(WIZARD_SUMMON_NISHRUU)
  266. THEN
  267.     RESPONSE #100
  268.         Spell(Myself,WIZARD_SUMMON_NISHRUU)
  269. END
  270.  
  271. // * cast maze on a strong opponent
  272. IF
  273.     ActionListEmpty()
  274.     See(NearestEnemyOf(Myself))
  275.     HPGT(LastSeenBy(Myself),50)
  276.     !HasBounceEffects(LastSeenBy(Myself))        
  277.     HaveSpell(WIZARD_MAZE)
  278. THEN
  279.     RESPONSE #100
  280.         Spell(NearestEnemyOf(Myself),WIZARD_MAZE)
  281. END
  282.  
  283. // * Mid-Level Offensive*
  284.  
  285. // * cone of cold
  286. IF
  287.     ActionListEmpty()
  288.     See(NearestEnemyOf(Myself))
  289.     HPGT(LastSeenBy(Myself),20)
  290.     !HasBounceEffects(LastSeenBy(Myself))    
  291.     HaveSpell(WIZARD_CONE_OF_COLD)
  292. THEN
  293.     RESPONSE #100
  294.         Spell(LastSeenBy(Myself),WIZARD_CONE_OF_COLD)
  295. END
  296.  
  297. // * try to hold monsters
  298. IF
  299.     ActionListEmpty()
  300.     See(NearestEnemyOf(Myself))
  301.     HPGT(LastSeenBy(Myself),30)
  302.     !HasBounceEffects(LastSeenBy(Myself))
  303.     !General(LastSeenBy(Myself),HUMANOID)
  304.     !StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
  305.     HaveSpell(WIZARD_HOLD_MONSTER)
  306. THEN
  307.     RESPONSE #100
  308.         Spell(LastSeenBy(Myself),WIZARD_HOLD_MONSTER)
  309. END
  310.  
  311. // * death spell; very useful against hordes of summoned creatures
  312. // * will only use this spell if attacked by more than 4 enemy creatures
  313. IF
  314.     ActionListEmpty()
  315.     Delay(6)
  316.     HaveSpell(WIZARD_DEATH_SPELL)
  317.     See(NearestEnemyOf(Myself))
  318.     HPGT(LastSeenBy(Myself),10)
  319.     HPLT(LastSeenBy(Myself),50)
  320.     !HasBounceEffects(LastSeenBy(Myself))
  321.     NumCreatureVsPartyGT([ENEMY],4)
  322. THEN
  323.     RESPONSE #100
  324.         Spell(LastSeenBy(Myself),WIZARD_DEATH_SPELL)
  325. END
  326.  
  327. // * try and disintegrate a really powerful opponent
  328. IF
  329.     ActionListEmpty()
  330.     See(NearestEnemyOf(Myself))
  331.     HPGT(LastSeenBy(Myself),50)
  332.     !HasBounceEffects(LastSeenBy(Myself))
  333.     HaveSpell(WIZARD_DISINTEGRATE)
  334. THEN
  335.     RESPONSE #100
  336.         Spell(LastSeenBy(Myself),WIZARD_DISINTEGRATE)
  337. END
  338. // *Low-Level Offensive*
  339.  
  340. IF
  341.     ActionListEmpty()
  342.     See(NearestEnemyOf(Myself))
  343.     HPGT(LastSeenBy(Myself),20)
  344.     !HasBounceEffects(LastSeenBy(Myself))
  345.     HaveSpell(WIZARD_BURNING_HANDS)
  346. THEN
  347.     RESPONSE #100
  348.         Spell(LastSeenBy(Myself),WIZARD_BURNING_HANDS)
  349. END
  350.  
  351. IF
  352.     ActionListEmpty()
  353.     See(NearestEnemyOf(Myself))
  354.     HPGT(LastSeenBy(Myself),20)
  355.     !HasBounceEffects(LastSeenBy(Myself))
  356.     HaveSpell(WIZARD_COLOR_SPRAY)
  357. THEN
  358.     RESPONSE #100
  359.         Spell(LastSeenBy(Myself),WIZARD_COLOR_SPRAY)
  360. END
  361.  
  362. IF
  363.     ActionListEmpty()
  364.     See(NearestEnemyOf(Myself))
  365.     HPGT(LastSeenBy(Myself),20)
  366.     !HasBounceEffects(LastSeenBy(Myself))
  367.     HaveSpell(WIZARD_MAGIC_MISSILE)
  368. THEN
  369.     RESPONSE #100
  370.         Spell(LastSeenBy(Myself),WIZARD_MAGIC_MISSILE)
  371. END
  372.  
  373. IF
  374.     ActionListEmpty()
  375.     See(NearestEnemyOf(Myself))
  376.     !HasBounceEffects(LastSeenBy(Myself))
  377.     HaveSpell(WIZARD_SLEEP)
  378.     ActionListEmpty()
  379. THEN
  380.     RESPONSE #100
  381.         Spell(LastSeenBy(Myself),WIZARD_SLEEP)
  382. END
  383.  
  384. IF
  385.     ActionListEmpty()
  386.     See(NearestEnemyOf(Myself))
  387.     HPGT(LastSeenBy(Myself),20)
  388.     !HasBounceEffects(LastSeenBy(Myself))
  389.     HaveSpell(WIZARD_CHROMATIC_ORB)
  390. THEN
  391.     RESPONSE #100
  392.         Spell(LastSeenBy(Myself),WIZARD_CHROMATIC_ORB)
  393. END
  394.  
  395. IF
  396.     ActionListEmpty()
  397.     See(NearestEnemyOf(Myself))
  398.     HPGT(LastSeenBy(Myself),20)
  399.     !HasBounceEffects(LastSeenBy(Myself))
  400.     HaveSpell(WIZARD_LARLOCH_MINOR_DRAIN)
  401. THEN
  402.     RESPONSE #100
  403.         Spell(LastSeenBy(Myself),WIZARD_LARLOCH_MINOR_DRAIN)
  404. END
  405.  
  406. IF
  407.     ActionListEmpty()
  408.     See(NearestEnemyOf(Myself))
  409.     HPGT(LastSeenBy(Myself),20)
  410.     !HasBounceEffects(LastSeenBy(Myself))
  411.     HaveSpell(WIZARD_BLINDNESS)
  412.     !StateCheck(LastSeenBy(Myself),STATE_BLIND)
  413. THEN
  414.     RESPONSE #100
  415.         Spell(LastSeenBy(Myself),WIZARD_BLINDNESS)
  416. END
  417.  
  418. IF
  419.     ActionListEmpty()
  420.     See(NearestEnemyOf(Myself))
  421.     HPGT(LastSeenBy(Myself),30)
  422.     !HasBounceEffects(LastSeenBy(Myself))
  423.     General(LastSeenBy(Myself),HUMANOID)
  424.     !StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
  425.     HaveSpell(WIZARD_CHARM_PERSON)
  426. THEN
  427.     RESPONSE #100
  428.         Spell(LastSeenBy(Myself),WIZARD_CHARM_PERSON)
  429. END
  430.  
  431.  
  432. //*Combat*
  433. IF
  434.     ActionListEmpty()
  435.     See(NearestEnemyOf(Myself))
  436.     Range(NearestEnemyOf(Myself),6)
  437. THEN
  438.     RESPONSE #100
  439.         RunAwayFrom(NearestEnemyOf(Myself),90)
  440. END
  441.  
  442. // * reset locals*
  443. // * if no enemies are around
  444. IF
  445.     !See(NearestEnemyOf(Myself))
  446.     CombatCounter(0)
  447.     OR(2)
  448.     GlobalGT("pscript_SpellThrust","LOCALS",0)
  449.     GlobalGT("pscript_WHIP","LOCALS",0)
  450. THEN
  451.     RESPONSE #100
  452.         SetGlobal("pscript_SpellThrust","LOCALS",0)
  453.         SetGlobal("pscript_WHIP","LOCALS",0)
  454. END