Jump to content

quick script needed for summon mod


haMRJha

Recommended Posts

Been trying for forever to make a mod (needed for my new playthrough) but just cant get it and its driving me nuts. Can anyone please help make a mod to put the lingering magicka damage on the summon flaming familiar/wolf spell? or maybe just compile the script that qwertpoI012 was nice enough to write for me(thanks again mate) cause i can not get any scripting programs to work for me. the whole idea for the mod was to have a summon eat away at your magicka pool as long as its summoned and then is possible unsummon when your pool is empty but id settle for it to just drain the pool.

 

Here is the script:

 

Scriptname MySummonScript extends ActiveMagicEffect


Spell Property MyMagicDamageSpell Auto


Event OnEffectStart(Actor akTarget, Actor akCaster)
MyMagicDamageSpell.cast(akCaster, akCaster) ;caster of the summon spell also casts magic damage on themself
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
akCaster.dispelSpell(MyMagicDamageSpell) ;to make sure the spell is dispelled when your summon spell has ended
EndEvent

Link to comment
Share on other sites

  • 1 month later...

I needed some practice before deep diving into my project, so...

 

Scriptname MySummonScript extends ActiveMagicEffect
{ The whole idea for the mod was to have a summon eat away at your magicka pool as long as its summoned and then is possible unsummon when your pool is empty but id settle for it to just drain the pool. }

Spell Property MyMagicDamageSpell Auto ; alchDamageMagicka
Spell Property MySummonSpell Auto
Actor MySummon ;Auto
Actor caster ;Auto
float fCost1
float fCost2
float fCost3

Event OnEffectStart(Actor akTarget, Actor akCaster)
MySummon = akTarget
caster = akCaster
;MySummonSpell = Self.GetBaseObject() as Spell - cannot cast a magiceffect to a spell, types are incompatible
fCost1 = caster.GetActorValue("Magicka")
debug.notification("original magicka: " + fCost1 as String)
MyMagicDamageSpell.cast(caster, caster) ;caster of the summon spell also casts magic damage on themself
fCost3 = caster.GetActorValue("Magicka")
fCost2 = fCost1 - fCost3
debug.notification("new magicka: " + fCost3 as String + " magicka cost: " + fCost2 as String)
RegisterForSingleUpdate(1.5)
EndEvent

Event OnUpdate()
if ( MySummon == None )
caster.dispelSpell(MySummonSpell) ;to make sure the spell is dispelled when your summon spell has ended
debug.notification("spell dispeled - 0")
return
endif
if ( caster.GetActorValue("Magicka") < fCost2 )
MySummon.disable() ; unsummon would be better
caster.dispelSpell(MySummonSpell) ;to make sure the spell is dispelled when your summon spell has ended
debug.notification("spell dispeled - 1")
return
endif
if ( MySummon.IsDisabled() || MySummon.IsDead() )
caster.dispelSpell(MySummonSpell) ;to make sure the spell is dispelled when your summon spell has ended
debug.notification("spell dispeled - 2")
return
endif
if ( caster.GetActorValue("Magicka") >= fCost2 )
if ( MySummon.GetActorValue("Health") > 0 )
MyMagicDamageSpell.cast(caster, caster) ;caster of the summon spell also casts magic damage on themself
RegisterForSingleUpdate(1.5)
endif
endif
EndEvent

;Event OnEffectFinish(Actor akTarget, Actor akCaster)
;akCaster.dispelSpell(MyMagicDamageSpell) ;to make sure the spell is dispelled when your summon spell has ended
;EndEvent

 

It's not finished but I'm in a hurry so I post this. (You don't need the debug.notification lines)

It basically works but it has some issues.

 

Plugin

 

Usage:

help "summon familiar" 0
player.addspell <ID> - it will be sg like xx000d62
Best regards,
VikMorroHun
Edited by Luke2135
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...