Jump to content

Photo

Spell effect "power" value


2 replies to this topic

#1 subtledoctor

subtledoctor
  • Modders
  • 2761 posts
  • Gender:Male

Posted 10 October 2018 - 02:54 PM

This number is supposed to represent the spell level of an effect... a 3rd level spell can have an effect that counts as a 5th level spell. I believe Spell Thrust and Secret Word are examples.

But I believe the field can hold any integer value from 1 to 255. So my question is: is it functional for values over 9?

More specifically, if a Spell Deflection blocks 12 spell levels before being exhausted, could I code a 5th level spell whose effect has a power of 15? Would that exhaust the Deflection in a single shot?

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#2 kjeron

kjeron
  • Members
  • 131 posts

Posted 10 October 2018 - 08:05 PM

Opcodes 102/200/201/259 (those that specify a power level) only acknowledge power levels 1 through 9.
The other opcodes (those that only specify a total number of spell levels) do work, and will actually accept power levels up to 2^31 - 1, as can be specified in external EFF files.

#3 subtledoctor

subtledoctor
  • Modders
  • 2761 posts
  • Gender:Male

Posted 11 October 2018 - 07:22 AM

Hmmm... I think I had misread an old quote by Galactygon:

takes advantage of an obscure engine behavior when calculating what spells willl be deflected/turned/spelltrapped. When a spell hits a turned/trapped/deflected creature, only the power level of the first effect in the effects list is taken into consideration. For example, if a spell's very first effect has a power level of 5 followed by a series of effects with a power level of 9, then spell turning/deflection/trap returns the entire spell as if a 5th level spell. Meanwhile, the effects that have a power level of 9 will still burn through opcode 102 (protection from spell levels) because opcode 102 is hardcoded to check for every effect.


I hoped I could take advantage of this to allow spells to "burn off" arbitrary numbers of levels from a Deflection/Turning/Trap, by changing the power level of their effects (maybe only the first effect).  But it doesn't work, and it seems to be limited to recognizing power=9 in any event.  (I'm specifically working with opcode 201 here.)

 

But I've hit upon a way to manufacture it:

- SpellA (say, a modified Spell Thrust) has sectype "MAGICATTACK." I has a 146 effect casting SubSpell1.

- SubSpell1 is level 6 and has a single dummy effect: a 0-point 0-second Lore bonus, at power=6

 

- SpellB (modified Secret Word) is MAGICATTACK and has two 146 effects... the 2nd one has to be timing=4, duration=1.  Both 146 effects cast SubSpell1

 

- SpellC (modified Pierce Magic) is MAGICATTACK and has three 146 effects... the 2nd one is timing=4, duration=1, the 3rd one is timing=4, duration=2.  All three 146 effects cast SubSpell1

 

- Set Minor Spell Deflection to deflect 6 levels of spells, level 1-9.

- Set Spell Deflection to deflect 12 levels of spells, level 1-9.

- Change Spell Turning to Greater Deflection and set it to deflect 18 levels of spells, level 1-9.

 

Now:

- Spell Thrust cast once cancels Minor Spell Deflection

- Spell Thrust cast twice cancels Spell Deflection

- Spell Thrust cast three times cancels Greater Spell Deflection

- Secret Word cast once cancels Minor Spell Deflection and Spell Deflection

- Secret Word cast twice cancels Greater Spell Deflection

- Pierce Magic cast once cancels Minor Spell Deflection, Spell Deflection, and Greater Spell Deflection

 

And perhaps best of all: Deflections won't stack anymore.  (The vanilla system, per kreso: "Deflection-type spells don't stack when it comes to spell apsorption, but do stack when it comes to removing them with spell removals. Try buffing with Minor Deflection + Deflection. You need two Secret Word spells to remove them both.")


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users