Jump to content

Spell damage based on equipped weapon


Kish

Recommended Posts

Is there a way to design a spell that does damage based on the equipped weapon--not that changes the weapon, not that needs an attack to be made, but that derives its damage from the weapon? For example, a spell that, if you have a long sword +2 equipped and have a +2 Strength bonus (such that your current weapon damage is 1d8+4), does 1d8+4 damage to everyone in the same radius as a fireball?

Link to comment

Easily. Nope.

The one alike possibility one could make is somekind of planar ally that takes the casters current equipped weapon and uses it to swing at people.. that's kinda easy to make, but that's about it.

Link to comment

In the EE, there is a 'cast spell if item x equipped' effect. This effect is sadly buggy in the original engine (but tobex might have fixed it!).

Opcode 182 for item resref

opcode 183 for item type

Yeah, but considering there's ~1874 items... in the not modified BG1EE game, and then you add the mod items... even if you remove the non weapons, you'll have hundreds of references to sort through... really not worth it.
Link to comment

 

In the EE, there is a 'cast spell if item x equipped' effect. This effect is sadly buggy in the original engine (but tobex might have fixed it!).

Opcode 182 for item resref

opcode 183 for item type

Wait...that works now!?!

 

 

I don't know if it is usable, but definitely works better than originally.

Link to comment

I cannot attest to whether this works on non-EE games, but as far as I know these opcodes work in the original games:

 

Alter the weapon to store a permanent, custom Spell Sequencer while it is equipped.

Alter the spell to activate that spell sequencer on each target it effects.

 

Give the weapon a "While Equipped" Opcode 177: Use External Eff, Target = Self(1), Resource = (CUSTOM1)

 

Create (CUSTOM1).eff: Opcode 256: Spell Sequencer, Resource = (CUSTOM2), Parent Resource = (CUSTOM3)

Create (CUSTOM2).spl: Target = Creature, Range = 255, Then load it with whatever effects you want the weapon to add to the spell being cast.

 

Create (CUSTOM4).spl: Target = Creature, Opcode 258: Activate Spell Sequencer, Target = Self(1), Resource = (CUSTOM3)

 

(Any spell you want to receive the extra effects).spl: To each header/ability, add effect: Opcode 146: Cast Spell, Target = Preset(2), Resource = (CUSTOM4)

 

The spell (CUSTOM2).spl will be cast on any targets of the modified spells while the weapon is equipped.

 

You can name (CUSTOM1), (CUSTOM2), (CUSTOM3), and (CUSTOM4) anything you want, just make sure each instance of (CUSTOM1) is the same, each instance of (CUSTOM2) is the same, etc.. One exception: (CUSTOM3) must be in ALL-CAPS.

Link to comment

 

...

 

(Any spell you want to receive the extra effects).spl: To each header/ability, add effect: Opcode 146: Cast Spell, Target = Preset(2), Resource = (CUSTOM4)

 

...

 

I just want to double check: this is CUSTOM3, correct?

No, this is whatever spell your casting, Fireball, Magic Missile, Acid Arrow, whatever.

No file named CUSTOM3 will actually exist.

The Parent Resource field in (CUSTOM1).eff. enables you to define the Spell Sequencer it belongs to when called to activate it, in this case (CUSTOM3).

Link to comment

 

In the EE, there is a 'cast spell if item x equipped' effect. This effect is sadly buggy in the original engine (but tobex might have fixed it!).

Opcode 182 for item resref

opcode 183 for item type

Yeah, but considering there's ~1874 items... in the not modified BG1EE game, and then you add the mod items... even if you remove the non weapons, you'll have hundreds of references to sort through... really not worth it.

 

 

1. there is an item type option. 2. you can use weidu to sort through the items.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...