Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

[(BG2) bug] Chant fixes (0924)

CamDawgCamDawg Member, Developer Posts: 3,394
edited November 2012 in Fixed
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

Comments

  • lansounetlansounet Member Posts: 1,182
    Not sure if that's included in your code, but it should be self-targetted. As it is currently (0815) you can cast it like Bless

  • SethDavisSethDavis Member Posts: 1,812
    Potentially fixed - @CamDawg's fix has been applied, it looks to affect enemies and allies and it is self targeted

    lansounet
  • CamDawgCamDawg Member, Developer Posts: 3,394
    Yes, amongst other things it changes the ability target to caster.

  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    I see the change implemented. And it appears working too.

  • BhryaenBhryaen Member Posts: 2,874
    edited September 2012
    Can't confirm this fixed...

    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:
    Chant (Conjuration/Summoning)
    Level: 2
    Sphere: Combat
    Range: 0
    Duration: 1 turn
    Casting Time: 1 round
    Area of Effect: 30-foot radius
    Saving Throw: None

    By means of the chant spell, the priest brings special favor upon himself and his party, and causes harm to his enemies. When the chant spell is completed, all attack and damage rolls and saving throws made by those in the area of effect who are friendly to the priest gain + 1 bonuses, while those of the priest's enemies suffer -1 penalties. Multiple chants are not cumulative.
    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:
    CHARNAME:   7, 11, 12. 15, 12 (halfling cleric, 4th lvl, STR16, WIS18)
    CORAN5: 11, 12, 11, 13, 13
    KIVAN4: 13, 15, 14, 16, 16
    JAHEIR4: 9, 13, 12, 15, 14
    KHALID4: 13, 15, 14, 16, 16
    DYNAHE6: 13, 9, 11, 13, 10
    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...)
                                           Pre-spell             Post-spell
    To Hit Pre-spell To Hit Post-spell
    THAC0 Dam Weapon wielded Adjust Dam Adjust Dam
    CHARNAME: 18 1-1 Club +0 2
    CORAN5: 16 1-1 Long sword * +2 3
    KIVAN4: 15 1-1 Halberd +2 6
    JAHEIR4: 14 1-1 Quarterstaff +0 1
    KHALID4: 17 1-1 Axe +0 1
    DYNAHE6: 19 1-1 Quarterstaff +0 1
    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...

    Post edited by Bhryaen on
  • TanthalasTanthalas Member Posts: 6,738
    @SethDavis

    Something went wrong when this was applied. Chant basically does nothing now aside from giving the casting animation.

  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited September 2012
    This changed since sept13?
    I can confirm what Tanthalas experienced.

  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited September 2012
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited September 2012
    I don't know why would someone remove projectiles randomly?
    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.

    Post edited by Avenger_teambg on
  • TanthalasTanthalas Member Posts: 6,738
    @Avenger_teambg

    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.

  • SethDavisSethDavis Member Posts: 1,812
    Potentially fixed - @Avenger_teambg's files have been added.

  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
Sign In or Register to comment.