SeraVerte Posted November 9, 2013 Share Posted November 9, 2013 Is there a way to modify a weapon so that it can only be used by certain npcs? Or does not allow other npcs to pick up said weapon?On a related note, is there a way to disallow a certain type of arrow to appear in an npc's inventory after it has struck them? Link to comment Share on other sites More sharing options...
Fistandilius Posted November 9, 2013 Share Posted November 9, 2013 Is there a way to modify a weapon so that it can only be used by certain npcs? Or does not allow other npcs to pick up said weapon?On a related note, is there a way to disallow a certain type of arrow to appear in an npc's inventory after it has struck them?You could mark it as unplayable and start the game with it in that npc's inventory. Then, when they die, the player can't pick it up. If you don't want it to start in the npc's inventory, you would have to write a script giving them the weapon. Link to comment Share on other sites More sharing options...
SeraVerte Posted November 10, 2013 Author Share Posted November 10, 2013 My problem actually stems from "angel-like" npcs using "holy arrows" that burn their targets. It kinda ruins the immersion when a bandit picks up the arrow and uses it too. So I'm trying to restrict other npcs rather than the player. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 10, 2013 Share Posted November 10, 2013 The following script placed on the specific objects that you do not want NPCs to use should prevent them from using them by having said objects automatically removed from their inventory once added. Scriptname PreventNPCsFromUsingItem Extends ObjectReference Actor Property PlayerRef Auto ObjectReference Property SelfObject Auto ;when the specified self object changes container and the player isn't the new container and the new container is an actor ;then get the # of the specified self object and remove that from the actor's inventory. Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) If (akNewContainer != PlayerRef) && (akNewContainer as Actor) Int Num = akNewContainer.GetItemCount(SelfObject) akNewContainer.RemoveItem(SelfObject,Num,true) EndIf EndEvent Modifying stock assets directly for local use could be acceptable but doing so for public release is not. There are too many issues that can arise due to removing a mod mid game that applied scripts directly to stock objects. It would therefore be beneficial to utilize a quest with aliases that point to the objects you wish to apply the script to. There would however need to be slight changes to the above script, but not much. Do note that I have not tested the above script for compilation or functionality. It was written based on theory and experience with the various events and functions. Link to comment Share on other sites More sharing options...
Recommended Posts