Jump to content

Adding an Item to all evil actors?


scarycave

Recommended Posts

Anybody know a way to make an Npc add an item to him/herself in their responsibility < 10? I was thinking of making a mod where you have to collect a certain item from dead evil characters and trade them in for prizes. I'm okay with having to go through every npc and adding it but if theirs a faster way I'd be glad to hear it.
Link to comment
Share on other sites

You could add a token to the PC. Add a script on it that runs an array looks for actors in the current cell, using GetFirstRef 35 1 and GetNextRef 35 1. Or set an array_var to GetHighActors. The check the responsibility of each actor with If ((TempRef.GetAV Responsibility) <= 10) and add the item.

You would either need to check if the actor already has the item or keep track of all the actors who have the item added (I think you can do that with an array). Set the script to run once a minute or two.

They may be a function to check through ever actor in the game at once, but I've not seen it yet.

 

I'm not 100% sure but I'm fairly sure that if you edit (in the CS) every NPC with a low responsibility then it would override changes made by other mods (if yours is loaded last). If you do it with a script then it's more compatible, though will add to save game bloat (probably) even if only a little

Link to comment
Share on other sites

The easiest method would probably be a quest script running once every x seconds checking for npcs in the area (much like cfh85 suggested) and check if they have low responsibility and don't have the item (GetItemCount == 0). If they don't have it simply add and equip it. You might also be able to edit the leveled lists (AddToLeveledList), depending on your criteria. You shouldn't directly edit npcs or leveled lists though, to avoid incompatibilities.

 

An alternative method to check if an npc is evil is by checking if he/she is in an evil faction, rather than look at his/her responsibility.

Edited by Maskar
Link to comment
Share on other sites

  • Recently Browsing   0 members

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