Jump to content

[LE] Help Detect and Increase Summon Duration


Arbidon

Recommended Posts

I'm attempting to make a mod that does the following.

 

Player casts a spell and it hits the summoned the creature from ANY MOD

A soul gem is consumed from the players inventory

The Duration of that partiuclar summon is increased by X.

 

 

It seems rather simple in practice, but I'm stumped....

 

am I on the right track? Can anyone point me in the right direction with this? Will give credit upon mod release.

ScriptName ArbExtendSummonDurationSpell Extends ActiveMagicEffect

ObjectReference Property CurrentTarget Auto

If (Game.GetPlayer().GetItemCount(EnterSoulGemhereRef) == 0
Debug.Trace("You do not have a grand soul gem)

Else

Game.GetPlayer()RemoveItem(SoulGemRef, 1)
Debug.Trace("Your spell blazes to life, consuming the soul gem")

Now here's where I get stumped...
How do I get the actor the spell just hit?
How do I get the magic effect associated with the summon?
How do I extend the duration?

Endif

I would also like to in the future, base the gem off the targets level...so a level 5 skeleton would only need a petty soul gem, where as a level 20 summoned atronach would reqiure a greater soul gem and so on and so forth...but I'd like to keep it as simple as possible due to my inexperience....I also plan to add sending summons on missions or quests later, once I figure this out.

 

Any help would be greatly appreciated, thank you for you time

 

 

 

 

 

Link to comment
Share on other sites

I don't believe you can extend a conjured/summoned actor's duration. The timer is specified during the act of casting via the spell used. The perks that affect conjuration duration take place before the spell is cast so that the duration timer is set at casting to be longer.

 

As for detecting what the spell hit or who cast it, that would need to have a magic effect that applies to the target. A script on that effect can capture the event OnEffectStart(Actor akTarget, Actor akCaster).

 

I don't believe there is any way to use an actor ref and determine what spell was used to conjure them. From the actor ref it will look like any other actor. The difference is that the system has an internal timer to despawn the actor when the duration expires.

 

Edit: After posting I thought about it and checked the actor.psc file. There are some functions HasMagicEffect, HasMagicEffectWithKeyword which might apply the the actor that was summoned. I don't have time to test but you could make a test spell and have it check if the target has a magic effect of one of the conjure spells or a keyword that is on the conjure spells. They might be applied. I don't know. In the back of my mind I'm thinking they aren't but it would require testing. If it does then it would also require that you made a list and check each type against the target. Which means it won't be generic for any conjured/summoned actor only ones your script "knows" about.

Edited by BigAndFlabby
Link to comment
Share on other sites

I see, thank you!

 

Since I wont be able to extend a specific summon, perhaps it would be more prudent to temporarly add a perk that would increase the the duration of all summons....so for instance, give the player a temporary perk for 10 seconds that increases the duration of all conjuring effects by 5000 seconds for 10 seconds? would that be a less complicated way of going about it?

 

anyway to temporarly add and remove perks then?

 

 

Edit

 

 

So, I've been messing around with the editor and discovered that when I make a new perk value that's not inside the conjuration tree it is

viewed as a null value....I'm assuming my only option then is to edit the conjuration perk tree and add a hidden perk that will do much the same as the duration increasing perk....Will this conflict with other mods that add perks to or edits these values? What if I put it off to the side so its not linkd to any other perk and its hidden? will it still conflict with reqiuem?

Edited by Arbidon
Link to comment
Share on other sites

  • Recently Browsing   0 members

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