Monitoring magicka is fairly simple. Just add this to the main script:
short CurrentMagickashort LastMagickashort SpellCostset CurrentMagicka to ( Player->GetMagicka )if ( CurrentMagicka < LastMagicka ) set SpellCost to ( LastMagicka - CurrentMagicka )endifset LastMagicka to CurrentMagicka
That should be at or near the top of the script so it runs continuously and SpellCost always contains the price of the most recent spell.
A timer for the bad effects would probably work best as a separate script for each timer. Here's a sample of how I'd write one:
begin Blind_100_Timer_30 float Timer if ( MenuMode ) return endif if ( Timer == 0 );just started Player->AddSpell "Blind_100" endif set Timer to ( Timer + GetSecondsPassed ) if ( Timer >= 30 ) Player->RemoveSpell "Blind_100" set Timer to 0;Important, so it starts at 0 next time. StopScript "Blind_100_Timer_30" endifendif
So that example would control an "Ability" type spell, named Blind_100. I had it apply the effect too, so you can just use
StartScript "Blind_100_Timer_30" and that will take care of everything.
And alternate way to do it would be to place a small object by the PC and have it actually use
Cast "Blind_100_30", Player in which case the spell would be a normal Touch spell with a duration of 30. The object could then delete itself.
If you need more help, let me know. Though perhaps we should take this to the CS forum.
(Note I haven't tested the above, there could be typos, etc.)