[(BG2) bug] Chant fixes (0924)
As it stands, Chant is a glorified Bless since it was not affecting enemies. Since we essentially needs two sets of effects with different targets (one for allies, one for enemies) we have to resort to a pair of shell spells.
COPY_EXISTING ~sppr203.spl~ ~override/sppr203d.spl~
~sppr203.spl~ ~override/sppr203e.spl~
PATCH_IF ("%DEST_RES%" STRING_COMPARE_CASE "sppr203d" = 0) BEGIN
SET "proj" = 162 END ELSE BEGIN SET "proj" = 171
END
SAY NAME1 #-1
SAY NAME2 #-1
WRITE_ASCII 0x10 ~~ #8 // casting sound
WRITE_SHORT 0x22 0 // casting anim
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
FOR (index = 0 ; index < abil_num ; ++index) BEGIN
WRITE_SHORT (abil_off + 0x26 + (index * 0x28)) "%proj%" // projectile set above
END
LPF DELETE_SPELL_EFFECT INT_VAR opcode_to_delete = "-1" END // delete ALL the effects!
COPY_EXISTING ~sppr203.spl~ ~override~
LPF DELETE_SPELL_EFFECT INT_VAR opcode_to_delete = "-1" END // delete ALL the effects!
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
FOR (index = 0 ; index < abil_num ; ++index) BEGIN
WRITE_BYTE (abil_off + 0x0c + (index * 0x28)) 5 // target: caster
WRITE_SHORT (abil_off + 0x0e + (index * 0x28)) 0 // range
WRITE_SHORT (abil_off + 0x26 + (index * 0x28)) 1 // projectile: none
END
PATCH_FOR_EACH spell IN sppr203d sppr203e BEGIN
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 146 // cast spell
target = 1 // target self
parameter2 = 1 // cast instantly
timing = 1 // instant/perm
STR_VAR resource = EVAL "%spell%"
END
END
COPY_EXISTING ~sppr203d.spl~ ~override~
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 139 // display string
target = 2 // preset target
power = 2 // power
timing = 1 // instant/perm
resist_dispel = 3 // dispel, bypass MR
parameter1 = 14124 // string 'chant'
END
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 142 // portrait icon
target = 2 // preset target
power = 2 // power
resist_dispel = 3 // dispel, bypass MR
duration = 60 // duration
parameter2 = 18 // icon chant
END
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 174 // portrait icon
target = 2 // preset target
power = 2 // power
timing = 4 // delay/perm
resist_dispel = 3 // dispel, bypass MR
duration = 60 // duration
STR_VAR resource = eff_e01 // sound file
END
FOR (index = 0 ; index < 7 ; ++index) BEGIN
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 9 // color pulse
target = 2 // preset target
power = 2 // power
resist_dispel = 3 // dispel, bypass MR
duration = 60 // duration
parameter1 = 0x2e496000 // rgb
parameter2 = (0x00140000 + index) // cycle, location
END
END
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 215 // play visual effect
target = 2 // preset target
power = 2 // power
resist_dispel = 3 // dispel, bypass MR
duration = 6 // duration
STR_VAR resource = icblesai // graphic
END
// instant/limited effects
PATCH_FOR_EACH op IN 131 33 34 35 36 37 BEGIN
LPF ADD_SPELL_EFFECT INT_VAR
opcode = %op% // opcode
target = 2 // preset target
power = 2 // power
resist_dispel = 3 // dispel, bypass MR
duration = 60 // duration
parameter1 = 1 // bonus
END
END
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 206 // prevent spell
target = 2 // preset target
power = 2 // power
resist_dispel = 3 // dispel, bypass MR
duration = 60 // duration
parameter1 = "-1" // no string
STR_VAR resource = sppr203d // graphic
END
COPY_EXISTING ~sppr203e.spl~ ~override~
WRITE_BYTE 0x27 11 // disabling as secondary
PATCH_FOR_EACH op IN 33 34 35 36 37 BEGIN
LPF ADD_SPELL_EFFECT INT_VAR
opcode = %op% // opcode
target = 2 // preset target
power = 2 // power
resist_dispel = 1 // dispel, not bypass MR
duration = 60 // duration
parameter1 = "-1" // bonus
END
END
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 137 // opcode
target = 2 // preset target
power = 2 // power
resist_dispel = 1 // dispel, not bypass MR
duration = 60 // duration
parameter1 = 1 // bonus
END
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 50 // characte color pulse
target = 2 // preset target
power = 2 // power
resist_dispel = 1 // dispel, not bypass MR
duration = 60 // duration
parameter1 = 0x60600000 // rgb
parameter2 = 0x00140000 // cycle
END
LPF ADD_SPELL_EFFECT INT_VAR
opcode = 206 // prevent spell
target = 2 // preset target
power = 2 // power
resist_dispel = 1 // dispel, not bypass MR
duration = 60 // duration
parameter1 = "-1" // no string
STR_VAR resource = sppr203e // graphic
END
Post edited by Tanthalas on
0
Comments
In NI:
-SPPR203 does now cast SPPR203E and SPPR203D, all three of which are are set to Target = Caster.
-SPPR203E seems to add a -1 penalty to a preset target's Saves, plus a glow pulse and "Bad Chant".
-SPPR203D seems to add a +1 bonus to the caster's Saves, plus a lot of glow pulses, display string, and portrait icon- and "Chant"...
They also involve a Protection from Spell but NI at present is showing the spell by code rather than name, so I can't confirm anything there.
Neither spell seems to make an adjustment to THAC0 or dam directly as per the spell description: Maybe the "Chant" and "Bad chant" effects are what is supposed to affect ally and enemy THAC0 and dam?
In-game I recruited five and noted their Saves: And then noted their pre-spell and post-spell stats during battle: (I ultimately didn't bother typing in the Post-spell section because it was identical to the Pre-spell section...) When casting the spell it did send what appeared to be a superfast mote to all nearby allies, but all those Saves above remained the same for all NPCs, no display string occurred (other than CHARNAME: Casts Chant), no portrait icons were placed, no color pulse occurred. (I didn't bother checking for THAC0 or dam bonuses or penalties, though I bet that "Chant" and "Bad chant" do affect that?) I then CTRL-Q'd the otherwise affected xvart which had no portrait string (the new GUI no longer gives the default Coriander portrait to non-regular NPCs, so I couldn't check for that) and no save difference for a xvart after creating one with exactly 16 for all saves, CLUAing one in, CTRL-Q'ing him, then CLUAing in another hostile one and letting them fight. Chant did nothing to the attack or damage rolls (they had a weapon doing 1d1+1 dam and remained at +0 adjustment). The Saves remained at 16 for both the recruited and "Bad chanted" one...
Something went wrong when this was applied. Chant basically does nothing now aside from giving the casting animation.
I can confirm what Tanthalas experienced.
Meh, i'm silly, i have a modded ToB which externalized the projectile in question.
Ok, after several times i tricked myself with editing the wrong file and such, i found that simply moving the resist spell opcode to the end of sppr203d and sppr203e will make it work.
I don't know if it worked before or we were sloppy testers.
Yeah, those files seems to fix Chant. I didn't check attack and damage rolls, but the bonus to allies and penalty to enemies saves is there.