How to make NPC weaponry undropable?

Post » Fri Jan 07, 2011 3:28 pm

Is it possible to have an NPC not lose his weapon if disarmed? I don't want their weapons to be playable or even placed on the ground.
User avatar
maya papps
 
Posts: 3468
Joined: Mon Aug 07, 2006 3:44 pm

Post » Fri Jan 07, 2011 9:25 am

Could do it like The Return of the Ayleids mod (IIRC) does and place a script on the weapon that uses an onadd player block to remove the weapon from inventory and displays a message to the effect that the weapon crumbles in your hand or similar.
User avatar
Sammygirl
 
Posts: 3378
Joined: Fri Jun 16, 2006 6:15 pm

Post » Fri Jan 07, 2011 4:00 am

Could do it like The Return of the Ayleids mod (IIRC) does and place a script on the weapon that uses an onadd player block to remove the weapon from inventory and displays a message to the effect that the weapon crumbles in your hand or similar.


This. I'm using a script that does just that in a mod I'm working on. Here it is:

scn WeaponDisableScriptBegin OnActivate	If IsActionRef Player == 1		MessageBox "The weapon crumbles to dust in your hands."		Disable	Else		Activate	EndIfEnd


Note: This is an Object script, not an enchantment. It needs to be attached to the Object itself.
User avatar
Eduardo Rosas
 
Posts: 3381
Joined: Thu Oct 18, 2007 3:15 pm

Post » Fri Jan 07, 2011 12:46 am

But that counts as the weapon drops on the ground.
If the weapon is disarmed, does it trigger "OnUnequip"?
User avatar
Gavin boyce
 
Posts: 3436
Joined: Sat Jul 28, 2007 11:19 pm

Post » Fri Jan 07, 2011 9:36 am

But that counts as the weapon drops on the ground.
If the weapon is disarmed, does it trigger "OnUnequip"?

No, but that can be solved by using this script instead:

Begin OnUnEquipdisableend


Another problem is that the weapon can still be obtained if the NPC doesn't drop it on 'death'. That could be solved with a script attached to the NPC using it:

Begin OnDeathDrop WeaponID 1end

User avatar
Hayley Bristow
 
Posts: 3467
Joined: Tue Oct 31, 2006 12:24 am

Post » Fri Jan 07, 2011 3:23 pm

No, but that can be solved by using this script instead:

Begin OnUnEquipdisableend





As always, thanks Vyper. That's just what I think I'll use. The death part isn't a problem since the NPC is disabled after death anyways. My only problem was disarming them. Thanks also for the response JDFan.
User avatar
Shianne Donato
 
Posts: 3422
Joined: Sat Aug 11, 2007 5:55 am

Post » Fri Jan 07, 2011 11:24 am

Hmm, for some reason this didn't work. I was still able to disarm the NPC and force him to drop his weapon, which promptly then stayed on the ground even after the NPC continued to fight and die.
User avatar
Breanna Van Dijk
 
Posts: 3384
Joined: Mon Mar 12, 2007 2:18 pm

Post » Fri Jan 07, 2011 3:50 pm

Hmm, for some reason this didn't work. I was still able to disarm the NPC and force him to drop his weapon, which promptly then stayed on the ground even after the NPC continued to fight and die.


Unequip will only run when they sheath the weapon - maybe an OnDrop block instead ? :shrug:
User avatar
Celestine Stardust
 
Posts: 3390
Joined: Fri Dec 01, 2006 11:22 pm


Return to IV - Oblivion