trigger abilities

Post » Thu May 03, 2012 9:07 am

im trying to make a script that will automaticly use the "Blood of the North" lesser power when my hitpoints drops below 20%. i dont want it to be a power i can activate on demand, only when my hps drops,
User avatar
Avril Churchill
 
Posts: 3455
Joined: Wed Aug 09, 2006 10:00 am

Post » Thu May 03, 2012 3:37 pm

im trying to make a script that will automaticly use the "Blood of the North" lesser power when my hitpoints drops below 20%. i dont want it to be a power i can activate on demand, only when my hps drops,

You could have a quest running constantly that checks the Player's health, and then activates Blood of the North if needed. The quest script could be ....

ScriptName MyBloodOfTheNorthQuestScriptFloat fQuestDelayTimeFloat PlayerBaseHealthFloat PlayerCurrentHealthBegin GameMode  Set fQuestDelayTime to 2 ;This will make it run every two seconds  Set PlayerBaseHealth to Player.GetBaseActorValue Health  Set PlayerCurrentHealth to Player.GetActorValue Health  If ( PlayerCurrentHealth / PlayerBaseHealth ) < 0.2    If ( Player.IsSpellTarget BloodOfTheNorth == 0 )      Player.Cast BloodOfTheNorth    Endif  EndifEnd

Although, I've never forced the Player to cast anything and I don't know if it would work if the Player is currently playing another animation, like swinging a weapon, or for that matter is knocked down on the ground.

An alternative would be to have an activator cast Blood of the North on the Player instead of the Player being script-forced to do it themselves, and then also deducting 50 magicka from the Player so they still have to pay the magicka cost.

And if you want to get fancy and don't want a quest script running all the time when unnecessary, then you could break out some OBSE power and use the User-Defined Function OnHealthDamage that could run a script only when the Player takes damage.
User avatar
stephanie eastwood
 
Posts: 3526
Joined: Thu Jun 08, 2006 1:25 pm

Post » Thu May 03, 2012 9:09 pm

thank you, ill give it a try.
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Thu May 03, 2012 2:14 pm

well after thinking about it a minute or two, im trying to get an effect like the vampire mod" blood is everything. when your health gets low it automaticly heals you but takes from your blood pool. i would like to do some thing similar but for it to use your mana pool.
User avatar
LittleMiss
 
Posts: 3412
Joined: Wed Nov 29, 2006 6:22 am

Post » Thu May 03, 2012 2:58 pm

An alternative would be to have an activator cast Blood of the North on the Player instead of the Player being script-forced to do it themselves, and then also deducting 50 magicka from the Player so they still have to pay the magicka cost.

Aputamkon, hope you don't mind my reusing your thread, but I have a similar question and would like to use pimpskinny's answer as a basis for my question:

The question is: how do I get, in a script, this cost of 50 magicka for Blood of the North?
I see 50 in game, but everything I tried so far gives me 148.636 as the magicka cost.
I tried "playerref.GetSpellMagickaCost refSpell" and the [cost] value returned by GetNthEffectItem.

(I am trying to walk thru the player's spells, detecting any that heals and I am svck trying to match the cost vs. the current magicka available)

I must mention that I am a noob in the field of magicka: after 3-4 years scripting this is the very first time I even give a second glance at anything related to magicka, spells, effects and such. I really don't understand the basics of it.


Nevermind: "playerref.GetSpellMagickaCost refSpell" returns 50 (i could swear I double checked it, but . . . welll)
User avatar
cosmo valerga
 
Posts: 3477
Joined: Sat Oct 13, 2007 10:21 am


Return to IV - Oblivion