Jump to content

Mucking with the Undead, random raise dead


ZippyDSMlee

Recommended Posts

I am trying to get raise dead and the like to be more random , magnitude 3 all the time, magnitude 50 30% of the time, magnitude 500 10% of the time. It seems it just apply the same effect 2+ times disabling the raise dead spell or turning the course to ash, so I need to adjust the script right? uhg scripting is my bane....

 

I am starting to think I need to run a script to toggle on or toggle off an enchantment so the magnitude can be done separate. but I am thinking backwards, I want to be able to run the reanimation code at 50 mag and 50% chance if it fails it tries the 500 mag at 10%chance if it fails it then dose the mag 3 100% chance one.

 

Edit

 

nope wrong script. I found what I need, I need a script to pass/fail a random chance on running 3 different enchantment if it fails it moves on to the next enchantment,ect.

 

edit

 

New script. Won't compile but I think I am getting close....
 

Scriptname zippyrandyrollsREANIMATEscript extends ActiveMagicEffect  





spell Property zippyRaiseZombierandyrolspell1 auto
spell Property zippyRaiseZombierandyrolspell2 auto
spell Property zippyRaiseZombierandyrolspell3 auto
spell Property zippyRaiseZombierandyrolspell4 auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
Target = akTarget
endEvent

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
int myRan1 = Utility.RandomInt (1.0, 10.0)
                           If myRan1 <= 1.0 =
zippyRaiseZombierandyrolspell4.Cast(akAggressor, self)
              endif

                                ElseIf myRan1 <= 3.0 =
zippyRaiseZombierandyrolspell3.Cast(akAggressor, self)
              endif

                            ElseIf myRan1 <= 6.0 =
zippyRaiseZombierandyrolspell2.Cast(akAggressor, self)
              endif

                                ElseIf myRan1 <= 10.0 =
zippyRaiseZombierandyrolspell1.Cast(akAggressor, self)
               endif


EndEvent

End
Link to comment
Share on other sites

Cleaned it up a little bit also changed a few things...

 

 

Begin ScriptEffectStart

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Target = akTarget ;Don't forget that you'll need to set a property for "Target"
endEvent

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
	myRan1 = Utility.RandomFloat(1.0, 100.0)
		If myRan1 <= 100.0
			; =  akTarget.zippyRaiseZombierandyrolspell1
		ElseIf myRan1 <= 50.0
			; =  akTarget.zippyRaiseZombierandyrolspell2
		ElseIf myRan1 <= 30.0
			; =  akTarget. zippyRaiseZombierandyrolspell3 ; you have a space after akTarget. zippy ....
		ElseIf myRan1 <= 10.0
			; =  akTarget.zippyRaiseZombierandyrolspell4
		EndIf
EndEvent
First, when you are doing checks with incremental numbers like 1.0 to 100.00 start the check with the highest number and work down. Say if you need something to only happen at <=10, it could fire 4 times with the way you had it set up.
 
Second, what is the Begin ScriptEffectStart do you not have that finished yet? 
 
Third, see the comment on the OnEffectStart lines and other comment(s)
 
If necessary, I would setup a DoOnce inside each "; = akTarget.SpellProperty" like so:   ... I like to do this so that, in hope, that it only runs once, however this is dependant upon how YOU need it setup.
Begin ScriptEffectStart

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Target = akTarget ;Don't forget that you'll need to set a property for "Target"
endEvent

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
	if DoOnce == 0
		myRan1 = Utility.RandomFloat(1.0, 100.0)
			If myRan1 <= 100.0
				; =  akTarget.zippyRaiseZombierandyrolspell1
				DoOnce = 1
			ElseIf myRan1 <= 50.0
				; =  akTarget.zippyRaiseZombierandyrolspell2
				DoOnce = 1
			ElseIf myRan1 <= 30.0
				; =  akTarget. zippyRaiseZombierandyrolspell3
				DoOnce = 1
			ElseIf myRan1 <= 10.0
				; =  akTarget.zippyRaiseZombierandyrolspell4
				DoOnce = 1
			EndIf
	EndIf
EndEvent

int DoOnce

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...