Jump to content

Script behaves different depending on Spell


serya

Recommended Posts

Posted

Hi,

 

I´m still a noob at scripting, so maybe this is a stupid question.

 

I wrote a script and attached it on the magiceffect of a Healspell (cast on the player). The script changes the strength of the spell depending on the lightlevel it is casted. This is working fine when casted on the player, but if i attach the script on a spell that is casted away (like a fireball or lightspell) nothing happens. The script is executed (the messageboxes are appearing), but the strength doesn´t change. Can somebody please help me to find the error?

 

Here is the script:

 

Spoiler

Scriptname sunheal Extends ActiveMagicEffect

import Debug
import Math


Spell Property healspell Auto


Event OnEffectStart(Actor akTarget, Actor akCaster)
    MessageBox("Start")
    float lLevel = akCaster.GetLightLevel()
    MessageBox(lLevel)
    float magnitude = (lLevel / 5) * sqrt(lLevel)
    MessageBox(magnitude)
    healspell.SetNthEffectMagnitude(0, magnitude)
EndEvent

 

 

Thanks in advance

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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