Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Damage Actor Values - Health Stamina or magicka


DsoS
 Share

Recommended Posts

I could not find a way to select Health, Stamina, Magicka, etc. for properties in the CK for scripting. I also had found nothing on the CK wiki or in the CK itself to do this, so I created my own:

This script was created for a Trigger Zone. This script was modified from the vanilla script "bwcLightDamageSCRIPT"

The script as it is, works with Health, Magicka or Stamina for now. I will think about adding in more, such as Armor, Block, etc. however the coding for those will be slightly (or greatly) different and I need time to study the attributes!

Please note, that I wrote this to use ONLY 1 attribute at a time, and have NOT tested with multiple attributes selected. So I am not sure what the affect could be if multiple is used.

I'm giving this script out for free, however if you use it, please make sure to change the scriptname or bad things could happen if a player uses your mod and my mod at the same time (maybe)!!!

I also ask that you give me credit if you use this script. Its not required, but if you want to just shoot me a PM and let me know, I'd be happy to know if people use this script :pints:

The script is heavily noted when used while setting up the properties. If you are unsure about some, just ask here or shoot PM me and I'll be happy to help!
 

Scriptname aaDSoSDamageActorValueScript extends ObjectReference

{Damages Player Actor Value with Adjustable Damage Values.}

 

Import Utility

Import Game

;Allows me to use GetPlayer() without the need to type in Game. constantly!

 

Bool Property maxDmg AUTO

{False = minimum damage

True = maximum damage

True = Box is Checked}

 

Bool Property MyHealth Auto

{Choose only ONE (1) Attribute to damage!

False = Do NOT Damage

True = Damage This

True = Box is Checked}

 

Bool Property MyMagicka Auto

{Choose only ONE (1) Attribute to damage!

False = Do NOT Damage

True = Damage This

True = Box is Checked}

 

Bool Property MyStamina Auto

{Choose only ONE (1) Attribute to damage!

False = Do NOT Damage

True = Damage This

True = Box is Checked}

 

String MyAttribute

String health

String magicka

String stamina

 

Float Property MaxDamage Auto

{Max Damage is adjustable, it is not recommened to go over much more than 0.50 the health is drained fast. Using 1.00 the death is instant for low level players!

Default used is 0.20}

Float Property MinDamage Auto

{Min Damnage is adjustable, 0.00 is no/little damage, 0.01 would take a long time to kill the player.}

 

EffectShader Property Effect AUTO

{Using an effect is NOT required to use this script, however it lets the player know something is not right! Default used is "TurnUNFXShader"}

 

Int InTrigger = 0

 

Event OnTriggerEnter(ObjectReference AkActor)

 

                If MyHealth == True

                                MyAttribute = "health"

                EndIf

 

                If MyMagicka == True

                                MyAttribute = "magicka"

                EndIf

 

                If MyStamina == True

                                MyAttribute = "stamina"

                EndIf

 

                If AkActor == GetPlayer()

                                InTrigger += 1

                                Effect.play(GetPlayer())

 

                                while(InTrigger > 0)

                                                If(maxDMG)

                                                                GetPlayer().DamageAV(MyAttribute, (GetPlayer().GetBaseAV(MyAttribute) * MaxDamage))

                                                ElseIf(maxDMG == FALSE)

                                                                GetPlayer().DamageAV(MyAttribute, (GetPlayer().GetBaseAV(MyAttribute) * MinDamage))

                                                EndIf

                                wait(0.5)

                                EndWhile

 

                                Effect.stop(GetPlayer())

                EndIf

EndEvent

 

Event OnTriggerLeave(ObjectReference AkActor)

                If AkActor == GetPlayer()

                                InTrigger -= 1

                EndIf

EndEvent

 


 

If you notice anything that is not correct or does not appear correct, please let me know! :pints:

Enjoy the script and have fun draining the health/magicka/stamina of the players! :evil:

This link no longer works!
I am attaching the file below, which is the script above. Since the code can sometimes be screwed on the indentions, I decided to you the .psc file. PLEASE RIGHT CLICK AND SAVE-AS!!!
aaDSoSDamageActorValue Script

 

Edit:

After striking out the link, the script formatting somehow broke, so I fixed it, hopefully.

Edited by DsoS
Link to comment
Share on other sites

I'm working on a new version of this.

The new version will include a fail-safe to make sure that modders don't use more than 1 attribute (health, magicka, stamina).

After this new version, I will be working on another new version, for more choices :lmao:

Link to comment
Share on other sites

Failsafe.

If MyHealth == True

MyAttribute = "health"

elseIf MyMagicka == True

MyAttribute = "magicka"

elseIf MyStamina == True

MyAttribute = "stamina"

EndIf

As you have it with the seperate IF statements, if all three are true, 'stamina' will be the only one that is true.

Since you can only have ONE that is active in your version of this code, your going to have to decide which one will be selected. I prefer the 'first in is true' selection. :)

Link to comment
Share on other sites

I was pretty close to that in my attempt of the fail-safe.

mine was:


If MyHealth == True

    MyAttribute = "health"

    MyMagicka = False

    MyStamina = False

EndIf


If MyMagicka == True

    MyAttribute = "magicka"

    MyHealth = False

    MyStamina = False

EndIf


If MyStamina == True

    MyAttribute = "stamina"

    MyHealth = False

    MyMagicka = False

EndIf


:rofl: no matter what you choose, health would ALWAYS be true :rofl: (this is IF a person selected all three selections!)

I'll implentment your part.

Thank you for the tip Willie :pints:

Link to comment
Share on other sites

And then you could apply all three effects:

 
Event OnTriggerEnter(ObjectReference AkActor)

health = "health"
magicka = "magicka"
stamina = "stamina"

If AkActor == GetPlayer()
InTrigger += 1
Effect.play(GetPlayer())

while InTrigger > 0
If maxDMG
If MyHealth
GetPlayer().DamageAV(MyAttribute, (GetPlayer().GetBaseAV(health) * MaxDamage))
Endif
If MyMagicka
GetPlayer().DamageAV(MyAttribute, (GetPlayer().GetBaseAV(magicka) * MaxDamage))
Endif
If MyStamina
GetPlayer().DamageAV(MyAttribute, (GetPlayer().GetBaseAV(stamina) * MaxDamage))
Endif

Else
If MyHealth
GetPlayer().DamageAV(MyAttribute, (GetPlayer().GetBaseAV(health) * MinDamage))
endif
If MyMagicka
GetPlayer().DamageAV(MyAttribute, (GetPlayer().GetBaseAV(magicka) * MinDamage))
endif
If MyStamina
GetPlayer().DamageAV(MyAttribute, (GetPlayer().GetBaseAV(stamina) * MinDamage))
endif
EndIf
wait(0.5)
EndWhile

Effect.stop(GetPlayer())
EndIf
EndEvent
[/CODE]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...