SirCumference64 Posted December 8, 2016 Share Posted December 8, 2016 So I'm making a simple script for a playable Wispmother character to spawn the orbs and shades in a fashion similar to how the NPC does it (drop orbs at higher health and shades at lower health). I made it a lesser power that checks the caster's health and summons the relevant monster. What I want to do is make it so I can't just cast the spell over and over. Is there a way I can make the script disable the spell for a certain amount of time after I've cast it? Attaching the script for reference. Scriptname OrbSpawnScript extends ActiveMagicEffect;;;;;;;;;;;;;;PropertiesActorbase Property Orb01 AutoActorbase Property Orb02 AutoActorbase Property Orb03 AutoActorbase Property Shade01 AutoActorbase Property Shade02 AutoFloat Property Shadehealth Auto;;;;;;;;;;;;;;;;VariablesobjectReference orb01objectReference orb02objectReference orb03objectReference shade01objectReference shade02;;;;;;;;;;;;;EventsEvent onEffectStart(Actor Target, Actor Caster)If caster.getactorvaluepercentage ("health") > shadehealthcaster.placeatme(orb01)caster.placeatme(orb02)caster.placeatme(orb03)elsecaster.placeatme(shade01)caster.placeatme(shade02)endIfendEvent Link to comment Share on other sites More sharing options...
NexusComa Posted December 8, 2016 Share Posted December 8, 2016 (edited) Scriptname OrbSpawnScript extends ActiveMagicEffect;;;;;;;;;;;;;;PropertiesActorbase Property Orb01 AutoActorbase Property Orb02 AutoActorbase Property Orb03 AutoActorbase Property Shade01 AutoActorbase Property Shade02 AutoFloat Property Shadehealth AutoInt Qf = 0 ;;;;;;;;;;;;;;;;VariablesobjectReference orb01objectReference orb02objectReference orb03objectReference shade01objectReference shade02;;;;;;;;;;;;;EventsEvent onEffectStart(Actor Target, Actor Caster) If(Qf=(0)) Qf=(1) If caster.getactorvaluepercentage ("health") > shadehealth caster.placeatme(orb01) caster.placeatme(orb02) caster.placeatme(orb03) else caster.placeatme(shade01) caster.placeatme(shade02) endIf utility.wait(60.0) ; <- Wait Time in seconds Qf=(0) endifendEvent Edited December 8, 2016 by NexusComa Link to comment Share on other sites More sharing options...
SirCumference64 Posted December 8, 2016 Author Share Posted December 8, 2016 Awesome, thank you! I was originally going for a way to get the game to check if the wisps/shades were dead before I could use the spell again so I wouldn't be able to summon an army, but since I'm using an actorbase, GetDead isn't doing the job, but this will do the trick. Link to comment Share on other sites More sharing options...
lofgren Posted December 8, 2016 Share Posted December 8, 2016 The variables in an active magic effect are storer per instance, so that won't work. You will have to store your control variable in a global, then set it back to its original value in an oneffectfinsh block. Link to comment Share on other sites More sharing options...
Recommended Posts