Jump to content

Looking for help with ActiveMagicEffect script & applying damage (novice)


wardy164

Recommended Posts

Hi guys,

 

I'm a complete novice when it comes to modding, but I enjoy playing around with the kit. Recently, I've tried making a staff enchantment which randomly casts a defined spell. Currently this works, but for the destruction spells i have assigned (i.e., fire storm, blizzard, thunderbolt) the spells correctly activate, but do not damage the target.

 

Does anyone know how to rectify this please?

 

This is my current script:

 

Scriptname StaffScript extends ActiveMagicEffect
spell property firestorm auto
spell property blizzard auto
spell property lightning auto
spell property illus auto
spell property illus2 auto
spell property alter auto
spell property alter2 auto
spell property restore auto
spell property conjure auto
spell property conjure2 auto
spell property conjure3 auto
function OnEffectStart(Actor akTarget, Actor akCaster)
Int random = utility.RandomInt(0, 10)
if random >= 0 && random < 1
firestorm.Cast(akTarget as objectreference)
elseIf random >=1 && random < 2
blizzard.Cast(akTarget as objectreference)
elseIf random >= 2 && random < 3
lightning.Cast(akTarget as objectreference)
elseIf random >= 3 && random < 4
illus.Cast(akTarget as objectreference)
elseIf random >= 4 && random < 5
illus2.Cast(akCaster as objectreference)
elseIf random >= 5 && random < 6
alter.Cast(akCaster as objectreference)
elseIf random >= 6 && random < 7
alter2.Cast(akTarget as objectreference)
elseIf random >= 7 && random < 8
restore.Cast(akCaster as objectreference)
elseIf random >= 8 && random < 9
conjure.Cast(akTarget as objectreference)
elseIf random >= 9 && random < 10
conjure2.Cast(akTarget as objectreference)
elseIf random >= 10
conjure3.Cast(akTarget as objectreference)
endIf
endFunction
Thank you!
Link to comment
Share on other sites

  • Recently Browsing   0 members

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