Jump to content

i have a scripting question


Darkranger91

Recommended Posts

These scripts are for if you can't or don't want to use OBSE:

 

 

scriptname SomeSpell1Script

float timer

Begin ScriptEffectStart

SomeActivator.MoveTo Player
SomeActivator.Cast SomeSpell2 SomeActivator

End

Begin ScriptEffectUpdate

set timer to timer + ScriptEffectElapsedSeconds
if (timer >= 1)
	set timer to 0
	SomeActivator.MoveTo Player
	SomeActivator.Cast SomeSpell2 SomeActivator
endif

End

scriptname SomeSpell2Script

Begin ScriptEffectStart

set self to GetSelf
if (self == Player)
	self.AddSpell RestoreMagickaAbility
else
	self.AddSpell DamageFatigueAbility
endif

End

Begin ScriptEffectFinish

self.RemoveSpell RestoreMagickaAbility
self.RemoveSpell DamageFatigueAbility

End

 

 

The first script would be attached to a self targeting spell, and it's the spell that the player would be casting. "SomeActivator" would be an activator that is persistent and initially disabled.

 

The second script would be attached to "SomeSpell2", which should be an area effect spell with 0 duration. "RestoreMagickaAbility" would be an ability that restores magicka, and "DamageFatigueAbility" would be an ability that damages fatigue.

 

If you use OBSE, you can use this script:

 

 

scriptname SomeSpell1Script

float timer
ref tempref

Begin ScriptEffectStart

let tempref := GetFirstRef 69
while (tempref)
	if (tempref.GetDistance Player <= 'AreaEffectOfSpell')
		tempref.ModAV2 Fatigue 'DrainAmount'
		tempref.pms effectDamage
		Player.ModAV2 Magicka 'RestoreAmount'
	endif
	let tempref := GetNextRef
loop

End

Begin ScriptEffectUpdate

let timer += ScriptEffectElapsedSeconds
if (timer >= 1)
	let tempref := GetFirstRef 69
	while (tempref)
		if (tempref.GetDistance Player <= 'AreaEffectOfSpell')
			tempref.ModAV2 Fatigue 'DrainAmount'
			tempref.pms effectDamage
			Player.ModAV2 Magicka 'RestoreAmount'
		endif
		let tempref := GetNextRef
	loop
endif

End

 

 

'AreaEffectOfSpell' would be the radius you want to cover with the spell (eg 750). 'DrainAmount' would be the amount of fatigue that should be drained (eg -5). 'RestoreAmount' should be the amount of magicka restored for each person/creature drained (eg 5).

Edited by fg109
Link to comment
Share on other sites

  • Recently Browsing   0 members

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