Currently I have been playing around with the idea of making all armor and weapons have random durability. So finding a new cool dagger in a chest it would have 34 durability and require you to repair it before using it at full potential. I dislike finding almost completely new armor and weapons off of skeletons. I have been playing around with the idea but I am finding this fairly simple concept a bit harder to do than I am expecting.
Does anyone here know the simplest way to go about doing this?
So far I have not been able to get this to work.
ref itemRefshort doOnceshort equipOnceshort randValCondMinshort randValCondMaxshort randValCondshort randValEnchbegin OnLoad if doOnce == 0 set doOnce to 1 set itemRef to GetSelf set randValCondMin to 1 set randValCondMax to 60 set randValCond to randValCondMin + GetRandomPercent * (randValCondMin - randValCondMax+1) / 100 ModObjectHealth randValCond itemRef endifendbegin OnAdd if doOnce == 0 set doOnce to 1 set itemRef to GetSelf set randValCondMin to 1 set randValCondMax to 60 set randValCond to randValCondMin + GetRandomPercent * (randValCondMin - randValCondMax+1) / 100 ModObjectHealth randValCond itemRef endifendbegin OnEquip if equipOnce == 0 set equipOnce to 1 set randValEnch to GetRandomPercent if randValEnch <= 2 Message "This item has a deadly curse..." endif endifend