I'm trying to add some effects to NPCs which are loaded up near the player.
So far I got this, it works on NPCs for the cell where the player is - but sadly thats just a small area.
Best would be to check all loaded cells, or have a list of cells in the location where the player is - dunno how to do that.
What I want is to add a spell to every NPCs as soon as they are attached to cells, without adding a script manually in creation kit on actor bases. I want it compatible with every monster mod.
Also I could make an invisible aura around the player to react with NPCs but dunno how much FPS it costs if I increase the radius to 10.000 or something. On my monster machine I can't measure the performance hit but dunno how weaker PCs behave.
Suggestions?
Actor player=Game.GetPlayer() Cell kCell = player.GetParentCell()Int iIndex = kCell.GetNumRefs(62)while (iIndex) iIndex -= 1sp1.Cast(kCell.GetNthRef(iIndex, 62))