Jump to content

Use a Script to Temporarilty Disable a Spell


SirCumference64

Recommended Posts

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

;;;;;;;;;;;;;;Properties

Actorbase Property Orb01 Auto
Actorbase Property Orb02 Auto
Actorbase Property Orb03 Auto
Actorbase Property Shade01 Auto
Actorbase Property Shade02 Auto
Float Property Shadehealth Auto

;;;;;;;;;;;;;;;;Variables

objectReference orb01
objectReference orb02
objectReference orb03
objectReference shade01
objectReference shade02

;;;;;;;;;;;;;Events

Event onEffectStart(Actor Target, Actor Caster)
If caster.getactorvaluepercentage ("health") > shadehealth
caster.placeatme(orb01)
caster.placeatme(orb02)
caster.placeatme(orb03)
else
caster.placeatme(shade01)
caster.placeatme(shade02)
endIf
endEvent

 

 

Link to comment
Share on other sites

 

 

 

Scriptname OrbSpawnScript extends ActiveMagicEffect

;;;;;;;;;;;;;;Properties

Actorbase Property Orb01 Auto
Actorbase Property Orb02 Auto
Actorbase Property Orb03 Auto
Actorbase Property Shade01 Auto
Actorbase Property Shade02 Auto
Float Property Shadehealth Auto

Int Qf = 0

;;;;;;;;;;;;;;;;Variables

objectReference orb01
objectReference orb02
objectReference orb03
objectReference shade01
objectReference shade02

;;;;;;;;;;;;;Events

Event 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)

endif

endEvent

 

Edited by NexusComa
Link to comment
Share on other sites

  • Recently Browsing   0 members

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