Jump to content

script problem: the count is worse than the cure


UglyOgre

Recommended Posts

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

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

  • Recently Browsing   0 members

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