Tiranno71 Posted October 7, 2014 Share Posted October 7, 2014 Hi, I've created some scripted spells and I need to don't let the caster recast the same spell until the effect is expired (like recall a horse to ride for 10 minutes). I know that need to do something with variables but i don't know how do it. Any advice? Thanks! :) Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 7, 2014 Share Posted October 7, 2014 Add a "scripted effect" to your spell. Give the effect a script that changes the value of a global variable. Something like Scriptname SomeScript Extends ActiveMagicEffect GlobalVariable Property SomeVar Auto Event OnEffectStart(Actor akTarget, Actor akCaster) SomeVar.SetValueInt(1) ;effect is active EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) SomeVar.SetValueInt(0) ;effect is inactive EndEvent Conditions on the spell itself would require that the global variable be of the correct value before casting is allowed. Link to comment Share on other sites More sharing options...
Tiranno71 Posted October 8, 2014 Author Share Posted October 8, 2014 Add a "scripted effect" to your spell. Give the effect a script that changes the value of a global variable. Something like Scriptname SomeScript Extends ActiveMagicEffect GlobalVariable Property SomeVar Auto Event OnEffectStart(Actor akTarget, Actor akCaster) SomeVar.SetValueInt(1) ;effect is active EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) SomeVar.SetValueInt(0) ;effect is inactive EndEvent Conditions on the spell itself would require that the global variable be of the correct value before casting is allowed. Thanks your advice and working around for a while i've made it! :) I've applied to other scripted spells too ^_^ . Now there are other steps for this spell ... How can force target to mount the horse without dismount until the effect expires? (For example a follower of mine) ... and how can make possible that horse follow directly the target without recruit as follower? Can you give any other advice? :) Thanks anyway for ypur patience! ^_^ Link to comment Share on other sites More sharing options...
Recommended Posts