Jump to content

[LE] Scripted spell, invisiblity and haste


Recommended Posts

I'm working on a playable Seeker mod and I'm almost done with it, but there's one spell I can't seem to figure out how to translate over to the player.

 

Enemy seekers have a script attached to them where they're invisible until they get within a certain distance of the player, or get attacked. While invisible, they also have a ludicrously quick move speed, (the multiplier is 3000) which goes back to normal in tandem with the invisibility.

 

The original script is not designed as a magic effect script but as an actor one, and I'm a bit out of my depth with it.

 

I created a basic invisibility spell that, when fired, increases the caster's speed:

 

Event OnEffectStart(Actor akTarget, Actor akCaster)

akCaster.setav("speedmult", 800)

EndEvent

 

I've been wracking my brain trying to figure out how to get the speed to drop as soon as the invisibility does. I also tried using a spell that combines an invisibility effect with a haste one without any scripting, but since the effects are separate, the speed sticks around whether you're invisible or not until its timer runs out. OnEffectFinish happens instantly since the spell is fire and forget, so I'm out of luck with that too. OnUpdate seems promising, but after looking around on the creation kit wiki I'm not sure exactly what I'd be checking for. The HasMagicEffect function checks if you have an effect but not if you don't have one, so that seems like a no go is well, though I'll admit my scripting knowledge is pretty shallow - I made a couple about a year ago and I've lost a lot of my old knowledge.

 

Is there a way via scripting to check if the caster has an invisibility effect currently active, and if not, to drop the speed multiplier back down to 100?

Link to comment
Share on other sites

Couldn't you use a RegisterForSingleUpdate and check for the lack of invisibility? It'd be a pretty simple check;

 

If PlayerRef.HasMagicEffect(Invisibility)

; do nothing

Else.;i.e. if they don't have the keyword

(Reduce speed)

Edited by candlepin
Link to comment
Share on other sites

  • Recently Browsing   0 members

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