Jump to content

Miscompiled scripts


Recommended Posts

Started a project to try and restore the scripts that were compiled with missing symbolic references. I'm breaking them into four categories as I go: solid, probable, no idea, and scroll.ids. The latter gets its own category because a) there's a lot and b) they may or may not work without a symbolic reference (need to investigate). Progress so far:

 

edit: removed, skip down a few posts for a more complete and detailed post

Link to comment

OK, ignore the first post. This has got the good stuff now. For the multiple line matches, we used the bigg's \n and \t regexp hack (hence %tab% and %lnl% etc.).

 

Dragons cast a spell on themselves in response to a enemies casting death fog, incendiary cloud, or cloudkill. Spell is paired with a wing buffet, so presmably it's a zone of sweet air effect.

 

// dragons have responses to cloud-based attacks
COPY_EXISTING ~abazdrag.bcs~ ~override~ // abazigal
		  ~dragbrow.bcs~ ~override~ // draconis
		  ~draggre2.bcs~ ~override~
		  ~draggree.bcs~ ~override~
		  ~gorsal.bcs~   ~override~ // saladrex
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~ApplySpell(Myself,0)~ ~ApplySpell(Myself,CLERIC_ZONE_OF_SWEET_AIR)~ // in response to death fog/incend cloud, cloudkill
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

Many spellcasting scripts have two missing stat checks in an OR block prior to casting dispel magic. Based on the other checks in the block, they appear to be checking for stoneskins or improved haste. (Common example is OR(5) StateCheck(LastSeenBy(Myself),STATE_HASTED) StateCheck(LastSeenBy(Myself),STATE_BLESS) StateCheck(LastSeenBy(Myself),STATE_DRAWUPONHOLYMIGHT)

 

// many dispel magic actions have two missing CheckStatGT triggers in an OR() block
COPY_EXISTING ~abazdrag.bcs~ ~override~
		  ~amlich02.bcs~ ~override~
		  ~dragbrow.bcs~ ~override~
		  ~finsol04.bcs~ ~override~
		  ~gorgua02.bcs~ ~override~
		  ~meliss01.bcs~ ~override~
		  ~meliss02.bcs~ ~override~
		  ~meliss03.bcs~ ~override~
		  ~planet.bcs~   ~override~
		  ~senbattl.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~CheckStatGT(LastSeenBy(Myself),0,0)[%tab% %lnl%%mnl%%wnl%]+CheckStatGT(LastSeenBy(Myself),0,0)~
				 ~CheckStatGT(LastSeenBy(Myself),0,IMPROVEDHASTE) CheckStatGT(LastSeenBy(Myself),0,STONESKINS)~
				 // triggers for a dispel magic
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// saladrex's dispel block is missing a stat check and valid stat.ids refs
COPY_EXISTING ~gorsal.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~OR(8)\([%tab% %lnl%%mnl%%wnl%]+StateCheck(LastSeenBy(Myself),STATE_INVISIBLE)[%tab% %lnl%%mnl%%wnl%]+StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)[%tab% %lnl%%mnl%%wnl%]+StateCheck(LastSeenBy(Myself),STATE_HASTED)[%tab% %lnl%%mnl%%wnl%]+StateCheck(LastSeenBy(Myself),STATE_BLESS)[%tab% %lnl%%mnl%%wnl%]+StateCheck(LastSeenBy(Myself),STATE_DRAWUPONHOLYMIGHT)[%tab% %lnl%%mnl%%wnl%]+StateCheck(LastSeenBy(Myself),STATE_BLUR)[%tab% %lnl%%mnl%%wnl%]+StateCheck(LastSeenBy(Myself),STATE_MIRRORIMAGE)[%tab% %lnl%%mnl%%wnl%]+\)CheckStatGT(LastSeenBy(Myself),0,0)\([%tab% %lnl%%mnl%%wnl%]+THEN\)~
				 ~OR(9) \1 CheckStatGT(LastSeenBy(Myself),0,IMPROVEDHASTE) CheckStatGT(LastSeenBy(Myself),0,STONESKINS) \2~
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

Several blocks are very simple 'if I have spell X, cast spell X' blocks. Healers were especially screwed, as it seemed the various cure and heal spells suffered repeatedly from this issue.

 

// many priest scripts have a failed CLERIC_HEAL call
COPY_EXISTING ~aeriex.bcs~   ~override~
		  ~anomx.bcs~	~override~
		  ~anvskel.bcs~  ~override~
		  ~pries18a.bcs~ ~override~
		  ~pries18b.bcs~ ~override~
		  ~pries18c.bcs~ ~override~
		  ~pries18d.bcs~ ~override~
		  ~saerkx.bcs~   ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~Spell(Myself,0)~ ~Spell(Myself,CLERIC_HEAL)~ // trigger checks for this spell
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// aerie's very straightforward--both missing Spell calls check for a spell in memory in the trigger
COPY_EXISTING ~aeriex.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~Spell(LastSeenBy(Myself),0)~ ~Spell(LastSeenBy(Myself),CLERIC_ANIMAL_SUMMONING_3)~ // trigger checks for this spell
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~amlich02.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~ForceSpell(Myself,0)~ ~ForceSpell(Myself,WIZARD_STONE_SKIN)~ // trigger, locals checks for stoneskins
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// anomen's very straightforward--missing Spell calls check for a spell in memory in the trigger
COPY_EXISTING ~anomx.bcs~   ~override~
		  ~anvskel.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~Spell(LastSeenBy(Myself),0)[%tab% %lnl%%mnl%%wnl%]+AttackOneRound(LastSeenBy(Myself))~
				 ~Spell(LastSeenBy(Myself),CLERIC_SLAY_LIVING) AttackOneRound(LastSeenBy(Myself))~ // trigger checks for this spell
  REPLACE_TEXTUALLY ~Spell(LastSeenBy(Myself),0)[%tab% %lnl%%mnl%%wnl%]+Continue()~ 
				 ~Spell(LastSeenBy(Myself),CLERIC_ANIMAL_SUMMONING_3) Continue()~ // trigger checks for this spell
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// gphealer should run away and heal themselves, but missing actual casting; two more unknown issues
COPY_EXISTING ~gphealer.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY 
 ~HaveSpell(\([A-Z_]+\))\([%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+RunAwayFrom(NearestEnemyOf(Myself),30)[%tab% %lnl%%mnl%%wnl%]+\)Spell(Myself,0)~ 
 ~HaveSpell(\1) \2 Spell(Myself,\1)~ //
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// action dictates trigger
COPY_EXISTING ~jatermin.bcs~ ~override~
		  ~mage20a.bcs~  ~override~
		  ~mage20c.bcs~  ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~HaveSpell(0)~ ~HaveSpell(WIZARD_MAZE)~ // associated action casts this spell
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// have x cast x block
COPY_EXISTING ~mage16m.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~HaveSpell(0)~ ~HaveSpell(WIZARD_STONE_SKIN)~ // associated action casts this spell
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// have x cast x
COPY_EXISTING ~mage8d.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~HaveSpell(0)~ ~HaveSpell(WIZARD_CHROMATIC_ORB)~ // associated action casts this spell
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// trigger defines spell
COPY_EXISTING ~senbattl.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~Spell(Myself,0)~ ~Spell(Myself,WIZARD_STONE_SKIN)~ // associated trigger checks this spell
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// viccy's combat script for keldorn fight
COPY_EXISTING ~vicvskel.bcs~  ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~Spell(Myself,0)~ ~Spell(Myself,CLERIC_HEAL)~
  REPLACE_TEXTUALLY ~\(HPGT("Keldorn",20)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(LastSeenBy(Myself),0)~
 ~\1 Spell(LastSeenBy(Myself),CLERIC_SLAY_LIVING)~
  REPLACE_TEXTUALLY ~\(HaveSpell(CLERIC_ANIMAL_SUMMONING_3)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(LastSeenBy(Myself),0)~
 ~\1 Spell(LastSeenBy(Myself),CLERIC_ANIMAL_SUMMONING_3)~
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// viccy's generic combat script
COPY_EXISTING ~vicx.bcs~  ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~Spell(Myself,0)~ ~Spell(Myself,CLERIC_HEAL)~
  REPLACE_TEXTUALLY ~\(HPGT(NearestEnemyOf(Myself),20)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(LastSeenBy(Myself),0)~
 ~\1 Spell(LastSeenBy(Myself),CLERIC_SLAY_LIVING)~
  REPLACE_TEXTUALLY ~\(HaveSpell(CLERIC_ANIMAL_SUMMONING_3)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(LastSeenBy(Myself),0)~
 ~\1 Spell(LastSeenBy(Myself),CLERIC_ANIMAL_SUMMONING_3)~
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

Five banter triggers were trying to check if they were outside (verified from dialogue trigger).

 

// alter missing areatype check to match banter trigger
COPY_EXISTING ~aerie.bcs~   ~override~
		  ~anomen.bcs~  ~override~
		  ~minsc.bcs~   ~override~
		  ~nalia.bcs~   ~override~
		  ~yoshimo.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~AreaType(0)~ ~AreaType(OUTDOOR)~ // for Minsc Umar Hills reminder, Nalia-Edwina banter
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

Far and away the most comon issue was creatures trying to turn into enemies with a missing allegiance in the trigger. Triggers were all OR(3) Allegiance(Myself,GOODBUTBLUE) Allegiance(Myself,NEUTRAL) Allegiance(Myself,0). Last one is, I believe, EVILBUTBLUE.

 

// recurring issue--going to enemy, but checks that allegiance is either neutral, goodbutblue, or ?
COPY_EXISTING ~amduel1.bcs~  ~override~
		  ~amduel2.bcs~  ~override~
		  ~balmonk.bcs~  ~override~
		  ~chalpc01.bcs~ ~override~
		  ~gorbat.bcs~   ~override~
		  ~gorbat1.bcs~  ~override~
		  ~gortan.bcs~   ~override~
		  ~gortan1.bcs~  ~override~
		  ~gparcher.bcs~ ~override~
		  ~gphealer.bcs~ ~override~
		  ~gpkensai.bcs~ ~override~
		  ~gpmage1.bcs~  ~override~
		  ~gpmage2.bcs~  ~override~
		  ~gpshout.bcs~  ~override~
		  ~grpsht01.bcs~ ~override~
		  ~sarbul01.bcs~ ~override~
		  ~sarbul02.bcs~ ~override~
		  ~sarbul03.bcs~ ~override~
		  ~sardw01.bcs~  ~override~
		  ~sardw02.bcs~  ~override~
		  ~sardw03.bcs~  ~override~
		  ~sarrein.bcs~  ~override~
		  ~teltief3.bcs~ ~override~
		  ~trgrd02.bcs~  ~override~
		  ~trgrd03.bcs~  ~override~
		  ~trgrdr01.bcs~ ~override~
		  ~trgrdr02.bcs~ ~override~
		  ~trgrdr03.bcs~ ~override~
		  ~trgrdr04.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~Allegiance(Myself,0)~ ~Allegiance(Myself,EVILBUTBLUE)~ // third allegiance check?
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

In one of the cutscenes, all actors but one were receiving CUTSCENE_HASTE. This is, I believe, one of the Githyanki killed by Carston in WK in the opening cutscene on his level.

 

// all other cres are hasted with identical blocks to this one
COPY_EXISTING ~cut207c.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~ApplySpell(Myself,0)~ ~ApplySpell(Myself,CUTSCENE_HASTE)~ // all other creatures hasted in similar blocks
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

A few spells in forced spell triggers were missing, but Bioware was nice enough to precede them with stringheads indicating which spells were (supposed to be) cast.

 

// displays 'protection from energy' string without, uh, casting it
COPY_EXISTING ~dlich01.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~ApplySpell(Myself,0)~ ~ApplySpell(Myself,WIZARD_PROTECTION_FROM_ENERGY)~ // action immediately above is displaystring 'protection from energy'
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// missing spell is preceded by stringhead
COPY_EXISTING ~jatermin.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~ApplySpell(Myself,0)~ ~ApplySpell(Myself,WIZARD_PROTECTION_FROM_NORMAL_MISSILES)~ // preceded by string
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

Two mage triggers were checking for three fear-inducing spells (WIZARD_HORROR, WIZARD_SYMBOL_FEAR, CLERIC_SYMBOL_FEAR) and a mystery fourth. Cloak of Fear comes to mind:

 

// missing a priest spell in their resist fear trigger
COPY_EXISTING ~gpmage1.bcs~  ~override~
		  ~magehigh.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~SpellCastPriest(\[GOODCUTOFF\],0)~ ~SpellCastPriest([GOODCUTOFF],CLERIC_CLOAK_OF_FEAR)~ // only missing divine 'fear' spell
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

In the opening dungeon, the shadow thieves fight Irenicus' mephits until the mephits die, and then turn on the party. They had missing allegiance checks, though I do no believe these cause any actual ingame issues.

 

// should attack Jon's minions until minions dead, then turn on party
COPY_EXISTING ~ishthf01.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~Allegiance(Myself,0)~ ~Allegiance(Myself,GOODBUTBLUE)~ // triggers for a dispel magic
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// should attack Jon's minions until minions dead, then turn on party
COPY_EXISTING ~jonthief.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~Allegiance(Myself,0)~ ~Allegiance(Myself,GOODBUTBLUE)~ // triggers for a dispel magic
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

One of the 10th level mage scripts checks for party buffs, but is missing a spell. Based on the ordering of the list it appears to be a low-level cleric spell. Remove Fear firs the bill.

 

// mage10d checks for buffing spells; remove fear appears to fit the gap between bless and sanctuary
COPY_EXISTING ~mage10d.bcs~ ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~SpellCastPriest(\[PC\],0)~ ~SpellCastPriest([PC],CLERIC_REMOVE_FEAR)~ // triggers are for party buffs
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

Four rakshasas in Suldenesselar had many missing spell calls. Fortunately, the scripts were (outside of surakw1's spell trigger) identical. Comparing the scripts filled in the missing gaps.

 

// surakw1-4 identical except for surakw1's spell trigger
COPY_EXISTING ~surakw2.bcs~  ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~\(IncrementGlobal("Fight","LOCALS",1)[%tab% %lnl%%mnl%%wnl%]+\)ForceSpell(Myself,0)~
   ~\1 ForceSpell(Myself,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)~ // from surakw4
  REPLACE_TEXTUALLY ~\(StateCheck(Myself,STATE_SILENCED)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)ForceSpell(Myself,0)~
   ~\1 ForceSpell(Myself,WIZARD_VOCALIZE)~ // if silenced - vocalize?
  REPLACE_TEXTUALLY ~\(!See(LastSeenBy(Myself))[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)ForceSpell(Myself,0)~
   ~\1 ForceSpell(Myself,WIZARD_TRUE_SIGHT)~ // if can detect but not see - true sight?
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// surakw1-4 identical except for surakw1's spell trigger
COPY_EXISTING ~surakw3.bcs~  ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~ApplySpell(Myself,0)\([%tab% %lnl%%mnl%%wnl%]+DisplayString(Myself,39968)[%tab% %lnl%%mnl%%wnl%]+\)ApplySpell(Myself,0)\([%tab% %lnl%%mnl%%wnl%]+\)ApplySpell(Myself,0)~
   ~ApplySpell(Myself,WIZARD_STONE_SKIN) \1 ApplySpell(Myself,WIZARD_GLOBE_OF_INVULNERABILITY) \2 ApplySpell(Myself,WIZARD_MISLEAD)~ // from surakw4
  REPLACE_TEXTUALLY ~\(IncrementGlobal("Fight","LOCALS",1)[%tab% %lnl%%mnl%%wnl%]+\)ForceSpell(Myself,0)~
   ~\1 ForceSpell(Myself,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)~ // from surakw4
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

// surakw1-4 identical except for surakw1's spell trigger
COPY_EXISTING ~surakw4.bcs~  ~override~
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~ApplySpell(Myself,0)\([%tab% %lnl%%mnl%%wnl%]+DisplayString(Myself,39968)[%tab% %lnl%%mnl%%wnl%]+\)ApplySpell(Myself,0)\([%tab% %lnl%%mnl%%wnl%]+\)ApplySpell(Myself,0)~
   ~ApplySpell(Myself,WIZARD_STONE_SKIN) \1 ApplySpell(Myself,WIZARD_GLOBE_OF_INVULNERABILITY) \2 ApplySpell(Myself,WIZARD_MISLEAD)~ // three spell spell trigger
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

 

There are still a number of missing IDS symbols, particularly in spellcasting scripts. However, these seem to be the only ones I can confidently say that these are definitely the missing symbol. For the others, I believe a new OBC component, "Speculative AI Script Fixes", is in order. For example, the Unseeing Eye has a 'have x, cast x' block where both the trigger and action entries are missing. The only spell it has memorized that is not already scripted is Horrid Wilting. A good guess, but not one of the standard to which we're holding core fixes. :( I'll post more on the speculative fixes as I have them.

Link to comment
Dragons cast a spell on themselves in response to a enemies casting death fog, incendiary cloud, or cloudkill. Spell is paired with a wing buffet, so presmably it's a zone of sweet air effect.

 

// dragons have responses to cloud-based attacks
COPY_EXISTING ~abazdrag.bcs~ ~override~ // abazigal
		  ~dragbrow.bcs~ ~override~ // draconis
		  ~draggre2.bcs~ ~override~
		  ~draggree.bcs~ ~override~
		  ~gorsal.bcs~   ~override~ // saladrex
DECOMPILE_BCS_TO_BAF
  REPLACE_TEXTUALLY ~ApplySpell(Myself,0)~ ~ApplySpell(Myself,CLERIC_ZONE_OF_SWEET_AIR)~ // in response to death fog/incend cloud, cloudkill
COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

I had a long response, but I must have never posted it. Vacation and stuff.

 

IIRC, the wing buffet spell already does sweet air. Hence the removal of the sweet air ApplySpell() (or at least, that's the conclusion I came to).

Link to comment

Yeah, confirmed, wing buffet includes a zone of sweet air effect. Those ApplySpell(0) calls are just removed now.

 

OK, one more of these should be moved into core fixes. When the party escapes the opening dungeon, the CW-Irenicus-Imoen cutscene ensues in the Promenade. At the end of the cutscene, everyone leaves/is taken to Spellhold. However, only two of the six characters that depart use dimension door; four just disappear.

 

// end of CI Escape cutscene, everyone leaving
COPY_EXISTING ~cut01g.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY 
  ~ForceSpell(Myself,0)~   
  ~ForceSpell(Myself,DRYAD_TELEPORT)~   // cast by CSCowl6 and 8
REPLACE_TEXTUALLY 
  ~ForceSpell("CSImoen",DRYAD_TELEPORT)~ 
  ~ForceSpell("CSImoen",DRYAD_TELEPORT) ForceSpell(Myself,DRYAD_TELEPORT)~   // cast by CSCowl4 on Imoen, added to causes effects for self as well
REPLACE_TEXTUALLY 
  ~ForceSpell("CSIren",0)~ 
  ~ForceSpell("CSIren",DRYAD_TELEPORT) ForceSpell(Myself,DRYAD_TELEPORT)~ // cast by CSCowl7 on Irenicus, also makes CSCowl7 go away
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

Now for the stuff thats going in the new OBC component.

 

Vongoethe in Amketheran has a block where he has four possible options if he can't see the player. One is to move towards Player1, two others are summoning spells (animate dead and summon nishruu), and the fourth is missing. Sumoning an efreeti is often paired with summon nishruu, so:

 

// unknown fourth possible option; efreet seems to be a common alternative to nishruu summoning (plus it's known to cre)
COPY_EXISTING ~amlich02.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~SpellNoDec(Myself,0)~ ~SpellNoDec(Myself,WIZARD_SUMMON_EFREET)~ // other three actions--two summoning spells and move to PC
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

Blue dragons have an extra spell being forced after their breath attacks. It appears to be a leftover from a copy-and-paste from the green or red dragon scripts. For green and red dragons, the breath attack spell itself does nothing (except visuals) and the forced spell does the actual damage. In the case of blue dragons, the breath attack itself does the damage and the 'extra' forced spell is unnecessary.

 

// remove old green/red dragon ReallyForceSpell
COPY_EXISTING ~abazdrag.bcs~ ~override~
		  ~dragblue.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~ReallyForceSpell(LastSeenBy(Myself),0)~ ~~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

The Unseeing Eye has a single 'if I have spell X memorized, cast it' block that's missing references. The only spell in its memorized list that is not already scripted is Horrid Wilting.

 

// blank block for HaveSpell, CastSpell--only one memorized but not scripted is ADHW
COPY_EXISTING ~bheye.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~HaveSpell(0)~ ~HaveSpell(WIZARD_ABI_DALZIMS_HORRID_WILTING)~
REPLACE_TEXTUALLY ~Spell(NearestEnemyOf(Myself),0)~ ~Spell(NearestEnemyOf(Myself),WIZARD_ABI_DALZIMS_HORRID_WILTING)~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

In the Pocket Plane challenge with Cyric, he summons Favored. They have an early buff in their script that's missing. Based on their kit (assassin) , their existing HLA usage, and propensity for turning invisible, the buff is set as the Assassination HLA.

 

// script designed to turn invisible repeatedly; given level and kit, assassination seems a good fit here
COPY_EXISTING ~chalcy02.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~SpellNoDec(Myself,0)~ ~SpellNoDec(Myself,ROGUE_ASSASINATION)~ // Some prep spell
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

The escaped Ellisime clone in the opening dungeon has a 'if I have spell X memorized, cast it' block that's missing references. The only two memorized spells not already scripted are Fireball and Magic Missile. As there's no range check, magic missile is used.

 

// blank block for HaveSpell, CastSpell in offensive situation--two spells memorized but not scripted: fireball and magic missile
// select MM as there's no range check for fireball safety
COPY_EXISTING ~clone1.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY
  ~HaveSpell(0)\([%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(NearestEnemyOf(Myself),0)~
  ~HaveSpell(WIZARD_MAGIC_MISSILE) \1 Spell(NearestEnemyOf(Myself),WIZARD_MAGIC_MISSILE)~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

In the final cutscene of SoA before being sent to ToB, the cutscene resurrects and heals all party members. One action is missing in between them; best guess is a form of restoration. A restoration spell without fatigue effects was selected so that the PC does not start ToB fatigued.

 

// final game cutscene
COPY_EXISTING ~cut59a.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY 
  ~ApplySpell(\([A-Za-z0-9]+\),0)~ 
  ~ApplySpell(\1,RESTORATION_IGNORE_RESIST)~   // some form of restoration--follows resurrections and full heal
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

Part of the Irenicus dream cutscene that begins with "Life... is strength. This is not to be contested; it seems logical enough. You live; you affect your world.". If you refuse Jon, he summons Imoen, informs you that others will suffer for your refusal, then tortures Imoen as the dream ends. There is a missing action between when he summons Imoen and speaks--presumably a first round of hurting her.

 

// cutscene
COPY_EXISTING ~cut67d.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~ForceSpell("Dpimo01",0)~ ~ForceSpell("Dpimo01",CUTSCENE_DAMAGE_1)~   // irenicus doing something to Imoen
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

Degardan, who comes hunting Edwin after the Nether Scroll affair, has several combat actions which are missing spell references. The replacements were chosen based upon comparable mage combat scripts.

 

// degardan has one messed up script
COPY_EXISTING ~degard2.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY // against non-humanoids; use HM even though not memorized since used in similar blocks in other AI scripts
  ~\(!General(LastSeenBy(Myself),HUMANOID)[%tab% %lnl%%mnl%%wnl%]+\)HaveSpell(0)\([%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(LastSeenBy(Myself),0)~
  ~\1 HaveSpell(WIZARD_HOLD_MONSTER) \2 Spell(LastSeenBy(Myself),WIZARD_HOLD_MONSTER)~
REPLACE_TEXTUALLY // death spell? something effective against multiple enemies-- cone of cold?
  ~\(NumCreatureGT(\[ALLY\],4)[%tab% %lnl%%mnl%%wnl%]+Allegiance(Myself,ENEMY)[%tab% %lnl%%mnl%%wnl%]+See(NearestEnemyOf(Myself))[%tab% %lnl%%mnl%%wnl%]+\)HaveSpell(0)\([%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(LastSeenBy(Myself),0)~
  ~\1 HaveSpell(WIZARD_DEATH_SPELL) \2 Spell(LastSeenBy(Myself),WIZARD_DEATH_SPELL)~
REPLACE_TEXTUALLY // one of several generic attack responses--melf's acid arrow?
  ~SpellNoDec(LastSeenBy(Myself),0)~
  ~SpellNoDec(LastSeenBy(Myself),WIZARD_MELF_ACID_ARROW)~
REPLACE_TEXTUALLY // anti-mage spell--hold person? do this one last, had problems with matching
  ~HaveSpell(0)\([%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(LastSeenBy(Myself),0)~
  ~HaveSpell(WIZARD_HOLD_PERSON) \1 Spell(LastSeenBy(Myself),WIZARD_HOLD_PERSON)~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

The green dragon combat script is missing a spell call between dragon fear and a wing buffet. Red and blue dragons have similar sequences, and use the spell in between to lower resistance to their particular breath attack (blues lower electrical resistance, reds lower fire resistance). There is no way to reduce poison resistance, so the call is simply removed.

 

// in between dragon fear and a wing buffet--per other dragon AI, should be lowering specific resistances to breath attack, but nothing to reduce poison resistance
COPY_EXISTING ~draggre2.bcs~ ~override~
		  ~draggree.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~ReallyForceSpell(NearestEnemyOf(Myself),0)~ ~~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

Gauths should be using more spells/abilities (several missing calls), but their script is entirely unique. Possible replacements would either cause them to simply cast two or three spells a round, or expand their abilities. Neither seems a logical fit, so nothing is altered.

 

/*
// gauths should be firing off more spells
COPY_EXISTING ~gauth01.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY
  ~ReallyForceSpell(\[PC\],0)\([%tab% %lnl%%mnl%%wnl%]+SetGlobal("GauthBehavior","LOCALS",1)\)~
  ~ReallyForceSpell([PC],0) \1~ // no idea
REPLACE_TEXTUALLY
  ~\(!See(LeastDamagedOf(Myself))[%tab% %lnl%%mnl%%wnl%]+HPGT(Myself,35)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+ReallyForceSpell(\[PC\],BEHOLDER_HOLD_PERSON)[%tab% %lnl%%mnl%%wnl%]+\)ReallyForceSpell([PC],0)~
  ~\1 ReallyForceSpell([PC],0)~ // no idea
REPLACE_TEXTUALLY
  ~\([^!]See(LeastDamagedOf(Myself))[%tab% %lnl%%mnl%%wnl%]+HPGT(Myself,35)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+ReallyForceSpell(\[PC\],BEHOLDER_HOLD_PERSON)[%tab% %lnl%%mnl%%wnl%]+\)ReallyForceSpell([PC],0)~
  ~\1 ReallyForceSpell([PC],0)~ // no idea
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES
*/

 

Aurumach Rilmani's script: it's missing a spell between a full heal and a lesser restoration. First thought was that it might be something to dispel any spell effects, but it uses Mirror Image and True Sight and might end up simply clearing its own beneficial effects. Left alone for now.

/*
// missing spell in heal-?-restoration sequence
COPY_EXISTING ~gorgua01.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~ApplySpell(Myself,0)~ ~ApplySpell(Myself,FORCE_DISPEL_MAGIC)~ // between full heal and restore--dispel effects?
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES
*/

 

The gphealer scripts (for clerics) were missing spell calls for two 'if I have spell X memorized, cast it' blocks. Near-identical blocks were found in generic mage scripts to use the mage symbol spells. Filled in gphealer with the cleric versions of the symbol spells.

 

// gphealer has two HaveSpell, Spell blocks with unknown IDS entries--something offensive with a 5' radius
// found near-identical sequence for mage symbol spells in gpmage1
COPY_EXISTING ~gphealer.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY
  ~\(IF[%tab% %lnl%%mnl%%wnl%]+\)HaveSpell(0)\([%tab% %lnl%%mnl%%wnl%]+!HasBounceEffects(LastSeenBy(Myself))[%tab% %lnl%%mnl%%wnl%]+!Range(LastSeenBy(Myself),5)[%tab% %lnl%%mnl%%wnl%]+RandomNum(2,1)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(LastSeenBy(Myself),0)\([%tab% %lnl%%mnl%%wnl%]+END[%tab% %lnl%%mnl%%wnl%]+IF[%tab% %lnl%%mnl%%wnl%]+\)HaveSpell(0)\([%tab% %lnl%%mnl%%wnl%]+!HasBounceEffects(LastSeenBy(Myself))[%tab% %lnl%%mnl%%wnl%]+!Range(LastSeenBy(Myself),5)[%tab% %lnl%%mnl%%wnl%]+RandomNum(2,1)[%tab% %lnl%%mnl%%wnl%]+THEN[%tab% %lnl%%mnl%%wnl%]+RESPONSE #100[%tab% %lnl%%mnl%%wnl%]+\)Spell(LastSeenBy(Myself),0)\([%tab% %lnl%%mnl%%wnl%]+END\)~
  ~\1 HaveSpell(CLERIC_SYMBOL_DEATH) \2 Spell(LastSeenBy(Myself),CLERIC_SYMBOL_DEATH) \3 HaveSpell(CLERIC_SYMBOL_STUN) \4 Spell(LastSeenBy(Myself),CLERIC_SYMBOL_STUN) \5~ //
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

And speaking of generic mage scripts... several of them had incomplete 'if I have spell X memorized, cast it' blocks. Due to the number of scripts of this type, they can be reconstructed with a fair degree of confidence.

 

// gpmage1 is missing IDS refs in a HaveSpell, Spell block
// gpmage2 has identical block
COPY_EXISTING ~gpmage1.bcs~  ~override~
		  ~magehigh.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~HaveSpell(0)~ ~HaveSpell(WIZARD_DISPEL_MAGIC)~ // trigger...
REPLACE_TEXTUALLY ~Spell(LastSeenBy(Myself),0)~ ~Spell(LastSeenBy(Myself),WIZARD_DISPEL_MAGIC)~ // ... and action
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

// missing IDS refs in a HaveSpell, Spell block--offensive/disabling spell
// every mage12 ends with a magic missile block before melee
COPY_EXISTING ~lyros.bcs~   ~override~
		  ~mage12b.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~HaveSpell(0)~ ~HaveSpell(WIZARD_MAGIC_MISSILE)~ // trigger...
REPLACE_TEXTUALLY ~Spell(NearestEnemyOf(Myself),0)~ ~Spell(NearestEnemyOf(Myself),WIZARD_MAGIC_MISSILE)~ // ... and action
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

// missing IDS refs in a HaveSpell, Spell block--offensive/disabling spell
// based on sequencing, chaos is a good guess here
COPY_EXISTING ~mage12e.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~HaveSpell(0)~ ~HaveSpell(WIZARD_CHAOS)~ // trigger...
REPLACE_TEXTUALLY ~Spell(NearestEnemyOf(Myself),0)~ ~Spell(NearestEnemyOf(Myself),WIZARD_CHAOS)~ // ... and action
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

// missing IDS refs in a HaveSpell, Spell block for > 6 opponents
// kproen02 has exact same sequencing
COPY_EXISTING ~mage14d.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~HaveSpell(0)~ ~HaveSpell(WIZARD_DEATH_SPELL)~ // trigger...
REPLACE_TEXTUALLY ~Spell(LastSeenBy(Myself),0)~ ~Spell(LastSeenBy(Myself),WIZARD_DEATH_SPELL)~ // ... and action
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

// one possible attack with mag missile and fireball--no bounce, indiv target, range > 5
// except for two extra response options, similar to many symbol sequences
COPY_EXISTING ~meliss01.bcs~ ~override~
		  ~meliss02.bcs~ ~override~
		  ~meliss03.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~SpellNoDec(LastSeenBy(Myself),0)~ ~SpellNoDec(LastSeenBy(Myself),WIZARD_SYMBOL_DEATH)~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

One of Melissan's scripts for the ToB finale, it was missing a call to a big, high-level spell (tracked by the MelissanBigSpell3 variable). Her other 'MelissanBigSpell3' options included Comet and Bigby's Crushing Hand, so Dragon's Breath was selected for the missing spell.

 

// big, high-level spell: only against 75% HP+. similar blocks are very high-level spells--comet, bigby, bone blades
COPY_EXISTING ~meliss03.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~ForceSpell(LastSeenBy(Myself),0)~ ~ForceSpell(LastSeenBy(Myself),WIZARD_DRAGONS_BREATH)~ // dragon's breath?
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

Fire mephits were missing a spell call in their initial scripted attack; subbed in one of their inherent abilities.

 

// some fire mephit attack
COPY_EXISTING ~mepfir.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~ForceSpell(NearestEnemyOf(Myself),0)~ ~ForceSpell(NearestEnemyOf(Myself),MEPHIT_FLAME_FAN)~ // attack spell
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

Fire salamanders have two identical blocks for their opening three rounds of combat, with four possible responses. One is melee, two are fire-based spells, and the fourth is an unknown spell. Given that the two known were Fireball and Burning Hands, selected Agannazar's Scorcher as the replacement.

 

// two missing actions in four-action blocks; blocks seem identical
// for fire slamanders; should be offensive fire spell
COPY_EXISTING ~salgrfir.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~SpellNoDec(NearestEnemyOf(Myself),0)~ ~SpellNoDec(NearestEnemyOf(Myself),WIZARD_AGANNAZAR_SCORCHER)~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

Tahazzar in WK has an offensive scripting block with a missing spell in one of the branches. Based on the level of the spells in the other branches, selected Flame Strike.

 

// one of four attack options--others all cleric damage/disabling spells
COPY_EXISTING ~tahazz.bcs~  ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~ForceSpell(NearestEnemyOf(Myself),0)~ ~ForceSpell(NearestEnemyOf(Myself),CLERIC_FLAME_STRIKE)~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

 

Demon Knights had several missing references for spell calls. Reconstructed from variable hints (i.e. DeathKnightFireball) and similar mage combat script triggers.

 

// demon knights
COPY_EXISTING ~uddeath.bcs~  ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY 
  ~ReallyForceSpell(LastSeenBy(Myself),0)~
  ~ReallyForceSpell(LastSeenBy(Myself),WIZARD_SYMBOL_STUN)~ // one of five attack options--symbol stun?
REPLACE_TEXTUALLY 
  ~ForceSpell(LastSeenBy(Myself),0)\([%tab% %lnl%%mnl%%wnl%]+SetGlobal("DeathKnightFireball","LOCALS",1)\)~
  ~ForceSpell(LastSeenBy(Myself),WIZARD_FIREBALL) \1~ // one of two attack options--fireball?
REPLACE_TEXTUALLY 
  ~ForceSpell(LastSeenBy(Myself),0)\([%tab% %lnl%%mnl%%wnl%]+SetGlobal("DeathAttack","LOCALS",1)\)~
  ~ForceSpell(LastSeenBy(Myself),WIZARD_SYMBOL_DEATH) \1~ // one of three attack options--symbol death?
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Actaully, Gauths and Beholders should cast multiple spells a round.

But gauth's don't really have all that many specials in PnP, compareatively; i think they have 4 eyes.

 

Let me go reference the page... http://www.coryj.net/CoreRule/corerule.php...=MM/DD03808.htm

 

Cause Serious (existing), Paralyzation (existing), Cone of Cold, Repulsion, Lightning bolt (existing, IIRC), Repulsion, Dweomer Drain.

 

It would REALLY be cool for Dweomer Drain gave attack to be thier favorite. It's their raison d'etre.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...