Time Schedule Script not replacing inventory correctly

Post » Fri Jun 12, 2015 12:27 pm

Hi, I'm a novice and i didn't make this script, I've got this script that I attach to an NPC, the purpose of the script is to replace the NPC's Inventory at a specific time in the day. I have this because I have the NPCs fighting repeatedly and they need to have their armor replaced often otherwise they lose their combat effectiveness. Problem is, I've noticed with 1 particular NPC, that has the same AI packages and schedule as 3 other NPCs doesn't seem to have its greave armor replaced at the specified time. I know this because when I check the NPC Inventory after the restock time I can see the damaged greaves from the previous battle that still haven't been replaced. 3 other NPCs have the same script, should I try editing this script for this particular NPC and change the replacement time making it contrast with the other 3 NPCs, or does anyone with scripting skill here have a better script that will ensure that this odd NPC will have all its armor replaced properly?

Scriptname IzCAranMathiRoyalGuardDayScript
Int bReplaceStuff
Begin GameMode
If ( GameHour >= 10 ) != bReplaceStuff
Set bReplaceStuff to ( bReplaceStuff == 0 )
If bReplaceStuff
RemoveItem armorRDAyleidGreaves 1
AddItem armorRDAyleidGreaves 1
RemoveItem armorRDAyleidCuirass 1
AddItem armorRDAyleidCuirass 1
RemoveItem armorRDAyleidGauntlets 1
AddItem armorRDAyleidGauntlets 1
RemoveItem armorRDAyleidBoots 1
AddItem armorRDAyleidBoots 1
RemoveItem armorRDAyleidHelmet 1
AddItem armorRDAyleidHelmet 1
RemoveItem armorRDAyleidShield 1
AddItem armorRDAyleidShield 1
RemoveItem weaponsRDAyleidLongsword 1
AddItem weaponsRDAyleidLongsword 1
EndIf
EndIf
End
User avatar
BlackaneseB
 
Posts: 3431
Joined: Sat Sep 23, 2006 1:21 am

Return to IV - Oblivion