So this vigor spell works, but it also continues to say "Vigor OnBeginRound" every round (in the console - using Temple+), even after the healing ends. Any suggestions on how to completely end the spell (the lines for "if (heal_count > 14): spell.spell_end( spell.id )" were meant to accomplish this task, but they don't)? from toee import * def OnBeginSpellCast( spell ): print "Vigor OnBeginSpellCast" print "spell.target_list=", spell.target_list print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level game.particles( "sp-conjuration-conjure", spell.caster ) def OnSpellEffect( spell ): print "Vigor OnSpellEffect" spell.duration = 10 + min( 5, spell.caster.stat_level_get( spell.caster_class ) ) target = spell.target_list[0] # Use any spell effect with a duration that you will not be using while under # the effects of lesser vigor #target.obj.condition_add_with_args( 'sp-Barkskin', spell.id, spell.duration, 0 ) #target.partsys_id = game.particles( 'sp-Cure Minor Wounds', target.obj ) dice = dice_new( "1d1" ) #dice.bonus = 1 target.obj.heal( OBJ_HANDLE_NULL, dice ) target.obj.healsubdual( OBJ_HANDLE_NULL, dice ) heal_count = 1 while (heal_count < spell.duration): game.timeevent_add( heal_later, ( target, spell, dice ), (heal_count * 6000) ) heal_count = heal_count + 1 # end while if (heal_count > 14): spell.spell_end( spell.id ) def OnBeginRound( spell ): print "Vigor OnBeginRound" def OnEndSpellCast( spell ): print "Vigor OnEndSpellCast" def heal_later( target, spell, dice ): target.obj.heal( OBJ_HANDLE_NULL, dice ) target.obj.healsubdual( OBJ_HANDLE_NULL, dice )
I see a problem already, maybe. It sets the spell.duration to 10+ minimum of 5 or spell caster level. And heal count being greater than 14 only ends the spell. The while loop only increments heal count while it is less than spell duration. So if spell duration is less than 14, which it seems to be possible to be, you will never hit this end condition to end the spell.
I believe fixes for all 3 vigor spells have already been posted, search for the "I'm Participating" thread. Shiningted's domain spell expansion mod and sitra achara's vigor spell fixes are on about page 5.
You need to remove target before ending the spell. Code: spell.target_list.remove_target(target.obj) spell.spell_end(spell.id) I've fixed this for the next Temple+ version, so you don't have to worry about it too much. On that note, is the addon still buried in the "I'm participating" thread? That's a damn shame...
Yeah that's my fault, I meant to do a proper thread in the downloads section but have been distracted. What is the difference between, spell.spell_end( spell.id ) and spell.spell_end( spell.id, 1 )
Nope, that's from vanilla ToEE. As a reminder I recommended you to apply this to KotB in the Looking for Livonya spell, which can otherwise can massive slowdowns over time.