Thanks Ingenue,
I tried GetAttacked before, but it wasn't working. Now I used your command with the player as target and zero as value. It works perfect, not the way I wanted but good enough, because the spell is casting and the message shows that the target resist... I was thinking the the spell isn't cast while being attacked. At the end of the day the result counts.
I solved magicka consumption. It is my first script, it works but is this ok or is something wrong?
Float myMagickaFloat myStaminaEvent OnEffectFinish(Actor akCaster, Actor akTarget) myMagicka = Game.GetPlayer().GetActorValue("Magicka") as Float Game.GetPlayer().DamageAV("Magicka", myMagicka) myStamina = Game.GetPlayer().GetActorValue("Stamina") as Float Game.GetPlayer().DamageAV("Stamina", myStamina)EndEvent
In the Magic Effect window at Target Condition I put GetActorValue Magicka >= 50 on the player. Means if Magicka lower than 50 points the spell will fail.
Actually I want 20% because if a player has 600 Magicka the 50 points limit are too low compared to a player with 100 Magicka. How can I solve this?
I thought I could use my script with OnEffectStart and calculate MaxMagicka * 0.2 and compare this in an if command with the current Magicka. But in a script, how do I stop that spell?
Thanks for help