Skip to content

Nahal's Reckless Dweomer & Fireshield Red/Blue Bug

Hello there,

I am playing the last version of BGEE that available in Steam (not Beta). Yesterday I found a bug that makes me upset and very sad at the same moment.

I am using Neera as a wild mage for my current run. When I tried to cast Fireshield (tested with both of them, Red and Blue) via Nahal's Reckless Dweomer, I am always getting "Spell cast normally" as Wild Surge result. Before post this, I make 30 attempts in a row so it can't be just "bad" luck or something.

Some additional details:
  • both spells were learned in a legal way, by scrolls that I obtained during my run (I mean not by EE Keeper or console)
  • Fireshield (Blue) - I got after killing Resar
  • Fireshield (Red) - I got after killing Kysus

I made some searches from different BG forums and almost found nothing related to this issue.
kjeron wrote: »
(Quote)
A Wild Surge triggers upon casting completion, after the spells global effects, but before the spells projectile is fired. Any thing that modifies the surge or roll must be active at that moment.

The Chaos Shield spells provide a passive bonus to the Wild Surge rolls through opcode 281, they are always active, and they have no direct interaction with NRD.

NRD just forces the next (valid) spell to roll a wild surge, through opcode 280, param2=1.

The Chaos Shield effect (opcode 199) makes the next 'Amount' (valid) spells invalid for surges, and displays a feedback message each time it does. Such spells do not count as the "next (valid) spell" for [opcode 280, Param2=1](NRD).

* Valid spells being those not flagged with bits 14(Ignore Dead/Wild Magic) or 15(Ignore Wild Surge).
* It also ignores spells cast instantly, through ability target mode 7 (Caster, Keep spell / no Animation), the various ReallyForceSpell() actions, or through opcodes (258/260/232/326/333, 146/148 when param2 >0).

What is it you're trying to accomplish?

So I checked both spells by NearInfinity and EE Keeper
  • Neera using SPWI403 and SPWI418 versions
  • Game contains also SPWI403D and SPWI418D versions (they has the same description but different icon and some other minor changes, but I do not have a lot experience to understand the details of them)
  • Flags like "Ignore Dead/Wild Magic" or "Ignore Wild Surge" not set for all of them

And.. I am completely don't know what to do! But to finish my last run, it's strongly needed to get it works (I stuck with all of this by staying at Temple of Bhaal)! So plz, help me if it's possible!

A few of my thoughts - the actual issue can be that both of these spells were missing from some table (or list) that's used by Wild Surge code? Or probably someone make mistake and SPWI403D/SPWI418D versions were put there instead of right?

@kjeron @OlvynChuru @argent77 @Bubb FYI (sorry for ping, but you guys my last hope)

Comments

  • kjeronkjeron Member Posts: 2,367
    Bubb wrote: »
    Did you know that there are some spells that completely bypass the effects of Wild Magic?

    This is due to the engine harcoding some opcodes to, when present, automatically cause Wild Surge rolls to be bypassed. These opcodes are as follows:#32 (0x20) Cure: Death (Raise Dead)
    #192 (0xC0) Spell Effect: Find Familiar
    #214 (0xD6) Spell Effect: Select Spell
    #232 (0xE8) Spell Effect: Cast Spell on Condition
    #234 (0xEA) Spell Effect: Contingency Creation
    #256 (0x100) Spell: Spell Sequencer Active
    #257 (0x101) Spell: Spell Sequencer Creation

    Some of the more popular spells that use these opcodes include Fire Shield (Red), Fire Shield (Blue), and Spell Immunity. So, have fun casting these 4th and 5th level spells via Nahal's with no risk whatsoever! :)
  • razaraza Member Posts: 24
    @kjeron thanks for your response! At less now I know, that I am not cursed.

    I am already using EEex for the spell menu mod. Is there any option to fix this behavior somehow?
  • kjeronkjeron Member Posts: 2,367
    EEex isn't necessary to bypass this (I don't think it has an option to either).
    While those opcodes are hardcoded to force a normal cast, it only occurs if they are directly in the spell (.SPL) file. Putting those opcodes in (.EFF) files, called through opcode 177 in the (.SPL) file, will allow them to surge normally.

    The attached is a simple weidu mod that should make the necessary adjustments, regardless of campaign.
    Note: This will also allow to recast them to refresh their duration, instead of them failing because "you cannot cast multiple instances of the same contingency spell on yourself".
  • jmerryjmerry Member Posts: 3,829
    raza wrote: »
    [*] Game contains also SPWI403D and SPWI418D versions (they has the same description but different icon and some other minor changes, but I do not have a lot experience to understand the details of them)
    Those are the sub-spells used to make the fireshields work. SPWI403 is a self-buff which applies a contengency effect: cast SPWI403D on anything that hits you. Then SPWI403D is the effect that actually deals damage.
    Or, that's what it should be in theory. In practice, it's SPPR951D and SPPR952D that are cast contingently, with SPWI403D and SPWI418D unused.
  • BubbBubb Member Posts: 1,000
    While you can bypass the hardcode, should you? I would imagine the developers forbid those opcodes from being manipulated by a surge for a reason, (though I have no idea what that reason might be).
  • razaraza Member Posts: 24
    @kjeron thank you so much! You are saving me!
  • kjeronkjeron Member Posts: 2,367
    edited September 2020
    Bubb wrote: »
    While you can bypass the hardcode, should you? I would imagine the developers forbid those opcodes from being manipulated by a surge for a reason, (though I have no idea what that reason might be).
    I suspect those specific opcodes are all blocked to avoid the "Area Effect", "Projectile Changed", and "Random target" surges, to avoid affecting other creatures.
    • The familiar opcode for the very reason given in the spells description.
    • Op234 and Op257 (Contingency/Sequencer Creation) because they invoke the Magescreen UI, which IIRC either crashed or otherwise didn't function correctly in the original game when used by non-party members.
    • Op232 and Op256 (Contingency/Sequencer Storage) are the effect applied to the creature when using op234/257, so presumably their inclusion was either necessary or just a precaution.

    Op214 (select spell) - this one was likely to avoid the "Spell cast twice" surge, as even now, it results in a infinite repeating menu for casting the subspells offered (until you select another character).

    The fireshield spells use op232 directly, which is harmless to apply other creatures (they even use the spell themselves). Op256 is similarly harmless when applied without op257.
Sign In or Register to comment.