Jump to content

[LE] I need help with scripting


Recommended Posts

[RESOLVED]

 

Okay, hey guys.

TL;DR version:
I want to know an elegant version to damage the player(health, magicka, and health regen) via scripts. The level of damage must also be adjustable in the script. Preferably by adding a poison/magic effect.

 

Long Version:
<HERE IS THE IMAGE struggling to get the right file type, smh HERE IS THE IMAGE>
This is a table. It fills up soul gems.

Technical(the stuff I need help with):


I want to do this:

  • You activate the table, and a messagebox menu pops up. You select the option you want (petty/common/grand, etc).
  • The script checks for the item(unfilled gem) in question, removes it, and adds a corresponding filled gem.
  • In the process, the player loses health, magicka and suffers health regen debuff for t seconds.
    • of course, if you lack the magicka or gems, nothing happens
    • if you lack the correct amount of health, you die.

I know how to do this:

  • register the OnActivate event
  • check the conditions, remove/add necessary items
  • Code:

 

Message Property MMenu00 auto
MiscObject Property gem01 auto
MiscObject Property gem01f auto
MiscObject Property gem02 auto
MiscObject Property gem02f auto
int Property aiButton auto

Event OnActivate(ObjectReference akActionRef)

aiButton = 0 ;clean initialize

aiButton = MMenu00.show()

if (aiButton == 0)
;go back

Elseif (aiButton == 1);lesser
if (akActionRef.GetItemCount(gem01) >= 1 && akActionRef.GetAV("magicka")>= 40)
akActionRef.removeitem(gem01)
akActionRef.additem(gem01f)
;<damage health, magicka, health regen>
endif

Elseif (aibutton == 2);common
if (akActionRef.GetItemCount(gem02) >= 1 && akActionRef.GetAV("magicka")>= 60)
akActionRef.removeitem(gem02)
akActionRef.additem(gem02f)
;<damage health, magicka, health regen>
endif

<two more cases go here, but I wanted to make this short so you don't need to read extra stuff.>

Endif

EndEvent



I want to know this:

  • How do I damage the player in the ways I mentioned earlier? I would like it to be lore friendly, so there's a little sound, a little light, etc. I think this can be done w/ magic effects, but I am clueless about implementation.

Lore(suggestions welcome):

The main concept here is that a portion of your soul is "eaten up" by corrosive magic, and said portion fills up the gems. You can't fill black gems, because a black gem is filled by a full, human soul. Animal/creature souls are worth far less, and as such, a portion of the Dragonborn's soul is sufficient.

It's part of a bigger mod, just saying. Also, maybe I'll add a spell that brings up this menu from anywhere, so you don't need the table.

Edited by dlobo1999
Link to comment
Share on other sites

Make a spell (or spells) that damages the player for x seconds.

use the script to cast the spell on the player.

 

mySpell.Cast(self, akActionRef)

 

There are plenty of examples on how to make spells and magic effects out there.

 

http://www.creationkit.com/index.php?title=Spell

http://www.creationkit.com/index.php?title=Effect_Item

http://www.creationkit.com/index.php?title=Magic_Effect

https://www.youtube.com/watch?v=E7ikxJJcVG4

Link to comment
Share on other sites

Make a spell (or spells) that damages the player for x seconds.

use the script to cast the spell on the player.

 

mySpell.Cast(self, akActionRef)

 

There are plenty of examples on how to make spells and magic effects out there.

 

http://www.creationkit.com/index.php?title=Spell

http://www.creationkit.com/index.php?title=Effect_Item

http://www.creationkit.com/index.php?title=Magic_Effect

https://www.youtube.com/watch?v=E7ikxJJcVG4

 

Tried it. For some reason, I can't get the spell right... Do you know how I can apply a poison instead? That looks easier.

Link to comment
Share on other sites

[RESOLVED]

The issue was fixed by adding a custom potion with negative (poisonous) effects.

NOTE: it is not tagged as a poison in the CK, and can be drunk by the player.

Game.GetPlayer().EquipItem(poisonref)

This line of code did the job.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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