UglyOgre Posted December 6, 2010 Share Posted December 6, 2010 I am not sure what is wrong with this, but it doesnt fire correctly. Actually it works just fine as long as I setav paralysis immediately. If I attempt to use a timer, it just doesnt go. I made a little needler gun and it does minimal damage, it successfully paralyzes the target, at which point the paralyze script calls this script as a spell on the target. I would appreciate any help someone could give me, even if its a knock in the head for overlooking something dumb. scn CureNeedlerParalysisScript Float timer Float unfreeze BEGIN ScriptEffectStart set timer to 0 set unfreeze to 0 END BEGIN ScriptEffectUpdate if (timer < 15) set timer to timer + GetSecondsPassed else set unfreeze to 1 endif END BEGIN ScriptEffectFinish if(unfreeze == 1) setAv Paralysis 0 endif END Link to comment Share on other sites More sharing options...
Ez0n3 Posted December 6, 2010 Share Posted December 6, 2010 You don't need a timer if it's an effect script. "ScriptEffectStart" runs right away, then "ScriptEffectUpdate" loops until it finished, at which time "ScriptEffectFinish" will run. The "timer" is how long you want the effect to last (IE the duration of the spell). If you have an effect that lasts 15sec, then the code in "ScriptEffectUpdate" will loop for 15 sec. All you would need is "ScriptEffectFinish" and set the spell for 15 sec. scn CureNeedlerParalysisScript BEGIN ScriptEffectFinish setAv Paralysis 0 END After 15 sec is up, it will run the finish block. Or another way: scn CureNeedlerParalysisScript BEGIN ScriptEffectStart setAv Paralysis 1 END BEGIN ScriptEffectFinish setAv Paralysis 0 END Would paralyze them right away and then un-paralyze them 15 sec later (duration of spell). Link to comment Share on other sites More sharing options...
UglyOgre Posted December 6, 2010 Author Share Posted December 6, 2010 All you would need is "ScriptEffectFinish" and set the spell for 15 sec. So I was being a bonehead. Thanks Ez0n3. That works perfectly and its much cleaner code. Link to comment Share on other sites More sharing options...
Recommended Posts