kungfuhobbit Posted May 26, 2019 Share Posted May 26, 2019 I read in the readme that SR's Spell Deflection protects against indirectly targeted AOE spells. How is this achieved please? I would like to know to mod other spells. Ive opened spwi618 in DLTCEP but cant see what was changed. Thanks Quote Link to comment
subtledoctor Posted May 28, 2019 Share Posted May 28, 2019 (edited) The code is here. At the beginning, it makes an array with a list of spells that are AoE enemy-effecting spells, and require this treatment. Then, in lines 498-563, it applies the NWN-style Deflection code to the spells in that array. Basically, instead of each AoE spell having a projectile and transmitting its effects through that projectile, it creates a subspell with the original spell's effects; and the projectile only carries a single opcode 146 effect, which causes each target to cast a personal spell on themselves with the original spell's effects. So instead of a Fireball doing fire damage to everyone in its radius, the Fireball will now cause everyone in its radius to be hit by their own personal, tiny Fireball. This tiny personal spell is blocked by Spell Deflection, and burns off some of the Deflection's layers of protection. I applied this to several other mods, including IWDification - you can see how I did that over here. See e.g. line 357, adding Snowball Swarm to an array; and then lines 2601 through 2679, which applies the NWN-style Deflection code if the relevant component of SR has already bee installed. (As far as I'm concerned, feel free to copy and paste that and use it in your own mods, if it makes it easier for you.) Edited May 28, 2019 by subtledoctor Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.