Workaround for NPC Item damage?

Post » Wed Sep 08, 2010 8:03 am

I'm trying to think of a good workaround for NPC item damage and health.

As far as armor goes, I've set it as clothing, and moved the armor class to a shield ability on the NPC. This seems to work around armor damage.

Now I'm wondering about weapon damage...

I'm thinking along the lines of giving the items a high health level, and maybe adding a "Begin OnUnequip, remove item, add item" type deal to ensure they always have healthy swords.

Anyone know if that will work? I'm trying to avoid having any dependencies besides stock oblivion, so I'd like to avoid OBSE, etc.

-Andy
User avatar
Kelly Osbourne Kelly
 
Posts: 3426
Joined: Sun Nov 05, 2006 6:56 pm

Post » Wed Sep 08, 2010 2:47 am

I'm thinking along the lines of giving the items a high health level, and maybe adding a "Begin OnUnequip, remove item, add item" type deal to ensure they always have healthy swords.


That sounds like a good way to do it. You could even use a Leveled List for the "item" you remove/add so that the weapons upgrade as the Player levels up (if you want them to).
User avatar
N3T4
 
Posts: 3428
Joined: Wed Aug 08, 2007 8:36 pm

Post » Wed Sep 08, 2010 5:42 am

That sounds like a good way to do it. You could even use a Leveled List for the "item" you remove/add so that the weapons upgrade as the Player levels up (if you want them to).


Now that I think about it, I'm not sure the NPC ever actually unequips his sword, I'm assuming he simply "unreadies" it.

So I'm trying something like this:

ScriptName NPC-SelfHealingSwordfloat BladeDamaged; We assume the blade will be damaged during combatBegin OnStartCombat	set BladeDamaged to 1EndBegin GameMode        ; If the blade isn't damaged, or we are currently in combat, halt script	if (BladeDamaged != 1) || (IsInCombat == 1)		return	endif        ; Otherwise we remove the sword and add a new one:	if (GetItemCount SelfHealingSword > 0)		UnEquipItem SelfHealingSword		RemoveItem SelfHealingSword 1		AddItem SelfHealingSword 1		set BladeDamaged to 0		EquipItem SelfHealingSword	endifEnd


Now I need to think of a good way to actually test it... hmmm
User avatar
Daramis McGee
 
Posts: 3378
Joined: Mon Sep 03, 2007 10:47 am

Post » Wed Sep 08, 2010 5:51 am

I don't think this works... :/
User avatar
courtnay
 
Posts: 3412
Joined: Sun Nov 05, 2006 8:49 pm

Post » Wed Sep 08, 2010 12:39 am

I really have no idea if this works or not... It's kind of hard to test.

It LOOKS like it should work, and I do notice that the NPCs running it, tend to "shuffle" their swords after leaving combat...
User avatar
Dona BlackHeart
 
Posts: 3405
Joined: Fri Dec 22, 2006 4:05 pm

Post » Tue Sep 07, 2010 7:50 pm

If you disable and then enable the NPC would the health and enchantments of the weapon/armor not reset?
User avatar
Pawel Platek
 
Posts: 3489
Joined: Sat May 26, 2007 2:08 pm


Return to IV - Oblivion