Jump to content

Soul Cage Amulet


Recommended Posts

Alright. I'm a new modder that is trying to make an amulet that, while worn on the PC, detects when an NPC (not a creature) dies in it's radius and adds a custom soul gem to the PC's inventory. I have the script for the gem figured out, but the amulet is giving me trouble. I tried on the Bethesda Forums and got nothing. I also don't know whether to use an Item Script on an Enchantment Script on the amulet, but I have tried both. Here is my script so far. (enchantment script).

 

scn "AASoulCageABILITYSCRIPT"

 

ref NPC

short hesdead

 

begin scripteffectupdate

set NPC to getFirstRef 35

while NPC

if hesdead == 0

if getdead NPC == 1

player.additem AASoulCageCapturedSoulITEM 1

message "You captured a soul with the Soul Cage."

set hesdead to 1

endif

endif

set NPC to getnextref

loop

end

 

 

 

 

 

Thanks for the help in advance!

Link to comment
Share on other sites

Use an object script on the Amulet...you can then add enchantment to boost player stats, reistances etc

 

scn "AASoulCageABILITYSCRIPT"

 

ref NPC

short hesdead

 

begin gamemode

 

set NPC to 0

set NPC to player.getfirstref 69 1

 

while NPC != 0

if isformvalid NPC == 1

if NPC.getdead == 1 && hesdead == 0

player.additem AASoulCageCapturedSoulITEM 1

message "You captured a soul with the Soul Cage."

set hesdead to 1

endif

endif

 

set NPC to 0

set NPC to getnextref

 

loop

 

end

 

This will only happen once unless you add an extra command to return hesdead to 0

 

Lets say you are fighting 3 Bandits, you kill one you get the soul, then thats it..you will not recieve it again with the hesdead variable set to 1. I know a nifty little way to get the soul with each death without it being added repeatedly.

Edited by slygothmog
Link to comment
Share on other sites

scn "AASoulCageABILITYSCRIPT"

 

ref NPC

 

begin gamemode

 

set NPC to 0

set NPC to player.getfirstref 69 1

 

while NPC != 0

if isformvalid NPC == 1

if NPC.getdead == 1 && NPC.getav strength >= 2

player.additem AASoulCageCapturedSoulITEM 1

message "You captured a soul with the Soul Cage."

NPC.modav strength -100

endif

endif

 

set NPC to 0

set NPC to getnextref

 

loop

 

end

 

 

Their strength will always be above 2, so you will recieve a soul from the dead one just once, reducing their strength to 0 is immeterial...they are dead, and will not give you a further soul as this will reduce their strength to 0 and that NPC will then be discounted.

Link to comment
Share on other sites

Just rememberd....if anyone dies in your location you will auto recieve the soul...extra condition will need to be placed to ensure only evil NPC souls are colleced.

 

Oh and change... message "You captured a soul with the Soul Cage." to this.

 

messageex "You captured a soul with the Soul Cage."

Edited by slygothmog
Link to comment
Share on other sites

scn "AASoulCageABILITYSCRIPT"

 

ref NPC

 

begin gamemode

 

set NPC to 0

set NPC to player.getfirstref 69 1

 

while NPC != 0

if isformvalid NPC == 1

if NPC.getdead == 1 && NPC.getdistance player < 900 && NPC.getav strength >= 2

player.additem AASoulCageCapturedSoulITEM 1

messageex "You captured a soul with the Soul Cage."

NPC.modav strength -100

endif

endif

 

set NPC to 0

set NPC to getnextref

 

loop

 

end

 

I hope I get a Kudo for all of this. 900 is a guess, you will need to play around with this value to get the result you desire.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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