Galactygon Posted August 16, 2014 Share Posted August 16, 2014 (edited) Opcode 146 (cast spell at target): When parameter2 (type) is set to 0 (cast normally), then it is affected by wild surge (stats 153 FORCESURGE and 154 SURGEMOD). This is possibly an engine bug in BGII:EE, so I've reported it. Also, stats 51 SPELLFAILUREMAGE, 52 SPELLFAILUREPRIEST, and 194 SPELLFAILUREINNATE do not affect this opcode. Haven't tested this in BGII (non EE). Nor have I tested stats 53 SPELLDURATIONMODMAGE and 54 SPELLDURATIONMODPRIEST Opcode 148 (cast spell at point): This opcode is NOT affected by wild surge (stats 153 FORCESURGE and 154 SURGEMOD), or spell failure (stats 51 SPELLFAILUREMAGE, 52 SPELLFAILUREPRIEST, and 194 SPELLFAILUREINNATE). Haven't tested this in BGII (non EE). Nor have I tested stats 53 SPELLDURATIONMODMAGE and 54 SPELLDURATIONMODPRIEST Edited August 16, 2014 by Galactygon Quote Link to comment
Galactygon Posted August 16, 2014 Author Share Posted August 16, 2014 This behavior hasn't been mentioned in the iesdp as well: If param2 of opcode 148 is set to 2, then the target(s) rather than the original caster will cast the spell from the resource file at a spell level specified in param1. This behaviour is unchanged from BGII to BGII:EE Quote Link to comment
lynx Posted August 18, 2014 Share Posted August 18, 2014 This behavior hasn't been mentioned in the iesdp as well: If param2 of opcode 148 is set to 2, then the target(s) rather than the original caster will cast the spell from the resource file at a spell level specified in param1. This behaviour is unchanged from BGII to BGII:EE Do you have any examples? SpellPoint is always used just with coordinates+spellref in vanilla bg2 (and others). (Really)ForceSpellPointRES is the only exception from the spellcasting family, due to different parameter ordering. As far as I know, also only the Really* family forces the level with param1 (if also a string parameter is passed) or param2. Quote Link to comment
Avenger Posted August 19, 2014 Share Posted August 19, 2014 As far as i know, param2 can be 0 or not 0. There is no different behavior between 1 or 2. Quote Link to comment
Galactygon Posted August 19, 2014 Author Share Posted August 19, 2014 This behavior hasn't been mentioned in the iesdp as well: If param2 of opcode 148 is set to 2, then the target(s) rather than the original caster will cast the spell from the resource file at a spell level specified in param1. This behaviour is unchanged from BGII to BGII:EE Do you have any examples? SpellPoint is always used just with coordinates+spellref in vanilla bg2 (and others). (Really)ForceSpellPointRES is the only exception from the spellcasting family, due to different parameter ordering. As far as I know, also only the Really* family forces the level with param1 (if also a string parameter is passed) or param2. There are no examples in the game, but I have been able to reproduce it in both BGII:ToB and BGII:EE and use it my mods. I do not have access to the files atm so I can at most instruct how to reproduce this. Open SPWI304 (Fireball), and add an effect with opcode 148 and param2=2 that casts SPWI308 (Lightning Bolt). Make sure the target type of that effect is set to 2 (pretarget) and not 1 (self) as one would expect to do in this opcode. When you cast Fireball into a group of creatures, they will then cast Lightning Bolt to the center point of the Fireball explosion. Quote Link to comment
Ardanis Posted August 20, 2014 Share Posted August 20, 2014 Also, stats 51 SPELLFAILUREMAGE, 52 SPELLFAILUREPRIEST, and 194 SPELLFAILUREINNATE do not affect this opcode. Haven't tested this in BGII (non EE). It's been like that in BG2 as well. Quote Link to comment
Avenger Posted August 21, 2014 Share Posted August 21, 2014 (edited) This behavior hasn't been mentioned in the iesdp as well: If param2 of opcode 148 is set to 2, then the target(s) rather than the original caster will cast the spell from the resource file at a spell level specified in param1. This behaviour is unchanged from BGII to BGII:EE Do you have any examples? SpellPoint is always used just with coordinates+spellref in vanilla bg2 (and others). (Really)ForceSpellPointRES is the only exception from the spellcasting family, due to different parameter ordering. As far as I know, also only the Really* family forces the level with param1 (if also a string parameter is passed) or param2. There are no examples in the game, but I have been able to reproduce it in both BGII:ToB and BGII:EE and use it my mods. I do not have access to the files atm so I can at most instruct how to reproduce this. Open SPWI304 (Fireball), and add an effect with opcode 148 and param2=2 that casts SPWI308 (Lightning Bolt). Make sure the target type of that effect is set to 2 (pretarget) and not 1 (self) as one would expect to do in this opcode. When you cast Fireball into a group of creatures, they will then cast Lightning Bolt to the center point of the Fireball explosion. Repeat the same with param2=1 and the result will be all the same. It is always the affected creature who casts the spell in #146/#148 Edited August 21, 2014 by Avenger Quote Link to comment
subtledoctor Posted May 23, 2018 Share Posted May 23, 2018 It is always the affected creature who casts the spell in #146/#148 Whoa whoa whoa. Sorry this is an old thread, but I might not have ever really understood this. Let's say I want to have someone cast Magic Missile in a non-traditional way: say, a thief casting it from an innate ability, or casting it from a wizard's staff, or making it a cleric spell. Heck, let's say I want to do ALL of those things, and I want them all to be treated equally by Shield, and SpellCastOnMe triggers, etc. I had figured, that's easy, just have them all use opcode 146 to cast SPWI112. But does that mean the target is the 'caster' of SPWI112? Does that me that target's level is used for purposes of caster level? Quote Link to comment
Avenger Posted May 23, 2018 Share Posted May 23, 2018 The 'target' of 146/148 is your thief or whoever wants to cast a mage spell. Their level might be used or ignored depending on the parameters for 146/148. The normal casting option, for example, just queues up a ForceSpell or ForceSpellPoint action. Quote Link to comment
subtledoctor Posted May 23, 2018 Share Posted May 23, 2018 Oh okay that's what I thought. So if, extremely hypothetically, I clone all the SPWI mage spells to innate abilities, and then change the original wizard spells into empty shells that only cast the innate abilities via 146/148 with param1 = 0, then anybody with access to an NRD/opcode 214 spell could cast wizard spells, and it would use their actual level as the caster level because anyone can have a proper caster level for innate abilities...? And then anyone could be a spontaneous arcane caster... and then we could have multiclass sorcerers. Or 3E-style spontaneous-casting bards with thief skills. Totally hypothetically, of course. Quote Link to comment
kjeron Posted June 1, 2018 Share Posted June 1, 2018 (edited) The 'target' of 146/148 is your thief or whoever wants to cast a mage spell. Their level might be used or ignored depending on the parameters for 146/148. The normal casting option, for example, just queues up a ForceSpell or ForceSpellPoint action. I've always gotten different results from that: Opcode 146: The source always does the casting. If p2=2 and target=(1 or 9), Source casts spell at "Preset Target" and this effect bypasses targets deflection/reflection effects (though its subspell's effects are still subject). Otherwise, Source casts spell at any/all specified target(s). Opcode 148: The source always does the casting when p2=0, and the spell is cast once for each effect target. The target(s) always does the casting when p2=1. With either p2 value, the spell is always cast at the ability target(point). To compare: Opcode 258 (activate sequencer) The target is always the caster, and is who must have the spells sequenced. Opcode 260 (activate sequencer at point) The target is always the caster, and is who must have the spells sequenced. Opcode 326 (apply effects list) The source always does the casting. Unless target = 2, this effect bypasses targets deflection/reflection effects (though its subspell's effects are still subject). When target=(1 or 9), Source casts spell at "Preset Target". Otherwise, Source casts spell at any/all specified target(s). Delaying the effects can further complicates the identify of "Source" and "target", as they revert to defaults if you save&reload before the delay expires. Using them further in Subspells also complicates the identity of "Source" and "target". Edited June 1, 2018 by kjeron Quote Link to comment
subtledoctor Posted June 2, 2018 Share Posted June 2, 2018 (edited) Well I'm glad we have clarity To complicate matters, I've been finding that the definition of "target" when setting contingencies with opcode 232 is incredibly vague... Edited September 7, 2018 by subtledoctor Quote Link to comment
Avenger Posted June 3, 2018 Share Posted June 3, 2018 The 'target' of 146/148 is your thief or whoever wants to cast a mage spell. Their level might be used or ignored depending on the parameters for 146/148. The normal casting option, for example, just queues up a ForceSpell or ForceSpellPoint action. I've always gotten different results from that: Opcode 146: The source always does the casting. If p2=2 and target=(1 or 9), Source casts spell at "Preset Target" and this effect bypasses targets deflection/reflection effects (though its subspell's effects are still subject). Otherwise, Source casts spell at any/all specified target(s). Opcode 148: The source always does the casting when p2=0, and the spell is cast once for each effect target. The target(s) always does the casting when p2=1. With either p2 value, the spell is always cast at the ability target(point). To compare: Opcode 258 (activate sequencer) The target is always the caster, and is who must have the spells sequenced. Opcode 260 (activate sequencer at point) The target is always the caster, and is who must have the spells sequenced. Opcode 326 (apply effects list) The source always does the casting. Unless target = 2, this effect bypasses targets deflection/reflection effects (though its subspell's effects are still subject). When target=(1 or 9), Source casts spell at "Preset Target". Otherwise, Source casts spell at any/all specified target(s). Delaying the effects can further complicates the identify of "Source" and "target", as they revert to defaults if you save&reload before the delay expires. Using them further in Subspells also complicates the identity of "Source" and "target". The target of those effects is supposed to be the 'would be' caster of the spell stored in their resource field. You can test this by targeting them at someone other than self, but with a spell that targets self. You must see the spells affect the second guy, not the first. Quote Link to comment
kjeron Posted June 3, 2018 Share Posted June 3, 2018 The target of those effects is supposed to be the 'would be' caster of the spell stored in their resource field. You can test this by targeting them at someone other than self, but with a spell that targets self. You must see the spells affect the second guy, not the first. If I'm understanding you correctly, no, some of them do not function that way. For all: Player A casts SpellA targeting player B SpellA: Ability Target: Living Actor -Effect: Opcode 146, target = (1 or 9), parameter2 = (0 or 1), resource = SpellB SpellB: -Effect: Opcode 12, target = 1(Self) = affects Player A -Effect: Opcode 12, target = 2(Preset) = affects Player A -Effect: Opcode 12, target = 9(Original) = affects Player A SpellA: Ability Target: Living Actor -Effect: Opcode 146, target = 2(Preset), parameter2 = (0 or 1), resource = SpellB SpellB: -Effect: Opcode 12, target = 1(Self) = affects Player A -Effect: Opcode 12, target = 2(Preset) = affects Player B -Effect: Opcode 12, target = 9(Original) = affects Player A While here it does: SpellA: Ability Target: Living Actor -Effect: Opcode 146, target = (1, 2, or 9), parameter2 = 2, resource = SpellB SpellB: -Effect: Opcode 12, target = 1(Self) = affects Player B -Effect: Opcode 12, target = 2(Preset) = affects Player B -Effect: Opcode 12, target = 9(Original) = affects Player A More importantly, for Opcode 146(P2=0/1), Opcode 148(P2=0), regardless of target, the spells are cast at the level of player A(or specified level), and their effects bypasses player A's magic resistance, not Player B's. Targeting playerB with Opcode 148(P2=1), Opcode 258, or Opcode 260, will have the spells cast at the level of player B(or specified level), and their effects bypass player B's magic resistance. Targeting playerB with Opcode 146(P2=2) or Opcode 326, the spells are cast at the level of PlayerA(or specified level), and their effects bypass both players magic resistance. The targeting quirks of AoE's(i.e Sunfire) still take precedence over the above to determine bypassing MR. Opcode 326 also casts spells using the caster level of the calling spell, not the called spell, as other opcodes do. If spellA is innate and spellB is wizard, opcode 326 would cast spellB using character level, not wizard caster level. If spellA is cleric and spellB is wizard, opcode 326 would cast spellB using cleric caster level, not wizard caster level. If spellA is innate and spellB is wizard, opcode 146 would cast spellB using wizard caster level, not character level. If spellA is cleric and spellB is wizard, opcode 146 would cast spellB using wizard caster level, not cleric caster level. Quote Link to comment
Avenger Posted June 4, 2018 Share Posted June 4, 2018 (edited) Well, tl;dr. But i looked at the first line where you used Effect: Opcode 146, target = (1 or 9), parameter2 = (0 or 1), resource = SpellB. By using target type 1, you effectively disabled targeting B. I wrote "The 'target' of 146/148 is your thief or whoever wants to cast a mage spell. " You made 'A' as the target of the effects. B is irrelevant for target type 1. Even with target type 9, where the projectile is targeted at B, opcode 146/148 will still get their target as A (original caster). Obviously, you don't do that if you want 'B' as target. I also wrote: It is always the affected creature who casts the spell in #146/#148 If you use target type 1, obviously the affected creature is A. Admittedly, i didn't chew myself through your whole chart. Maybe you want to show me this: SpellA: Ability Target: Living Actor-Effect: Opcode 146, target = 2(Preset), parameter2 = (0 or 1), resource = SpellBSpellB:-Effect: Opcode 12, target = 1(Self) = affects Player A I'm pretty sure this part is in error. If SpellA really affected player B, there is no way the opcode will ever touch player A. Maybe you could also add a displaystring (139) with the same targeting as opcode 146, to see if your 146 indeed targeted the intended creature. Edited June 4, 2018 by Avenger 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.