Jump to content

opcode 146 "cast spell"


subtledoctor

Recommended Posts

How does the timing work? If Blindness has a normal casting time of 3, and I want to make another spell use opcode 146 to cast Blindness, should my custom spell have a casting time of 0 so that the total casting time is still 3?

 

Or does 146 cast the spell immediately, do my custom spell needs casting time to be 3?

 

Corollary query: depending on the answer above, what does this mean for spell interruption? If my custom spell is uninterruptible with a casting time of 0, and causes Blindness to be cast, can that secondary casting be interrupted?

Link to comment

@Jarno because then my cleric version of Breach that uses opcode 146 to cast the wizard version of Breach would not be detected by scripts that look for

IF 
   SpellCastOnMe('WIZARD_BREACH')
Yes, this has to do with the issues raised by Roxanne in our other conversation.

 

@Avenger thanks, good to know!

Link to comment

How does parameter 1 "cast at level" work? If I set it to zero, will it cast the other spell at the caster's level?

A 'Casting Level' of 0 casts at the level of the casting creature. 

That would be a yes...

Ps, only the single class clerics, druids and mages have equal caster level = character level, paladins, rangers and bards are close to character level -y amount, y depending which class it is, and non dualed chars caster level is 1.

Link to comment

Next up: might as well use this thread to ask the big question. Using opcode 146 as an integral part of my sphere system.

 

One of the things the sphere system does, is change the level of certain spells. This is necessary because I want to make sure every sphere has 1-2 spells at each level. I want to avoid the situation where, if your kit happens to choose the wrong 6 spheres, you end up with no spells at level 4, or something like that. Every kit in my mod that has major access to 6 spheres, should have at least 6 spells of levels 4-7. That is non-negotiable.

 

SO: there are three ways I've found to do this.

 

1) Make clones of every spell in the sphere system, give the clones to the player, let the AI use the old SPPR spells. This is what I have working right now. But it can cause problems with scripts, where the game checks whether you have cast a spell. For example, with this method you can't complete the Trademeet Skinchanger quest, because the cloned version of Restoration won't be recognized by the game when you cast it on Raissa.

 

2) ADD_SPELL the spell at its new level, then run RES_NUM_OF_SPELL_NAME to find its new SPPR filename, then edit any .CRE files in the game to replace any known/memorized instances of the old spell with the new spell, so that AI scripts continue to work. Changing .CREs is very intimidating, and I don't think ALTER_EFFECT can get this done easily. :(

 

3) Copy the original spell, change the level of the copy to the new level, use DELETE_EFFECT to remove all effects from the copy, and use ADD_SPELL_EFFECT to add a 146 effect casting the original spell.

 

I've got a version of 3) that installs and adds sphere spells correctly, and I'm starting to run basic tests - just CLUAing some XP in Candlekeep and firing off spells to see if they work.

 

But, do any experts here foresee any problems with 3) that I'm not anticipating?

Link to comment

Archived

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

×
×
  • Create New...