Ok.
I found how to do that simply.
I made 5 spells with the same effect, but with 10, 20, 30, 40 and 50. And I put this script on the 5 items of the armor I'm trying to work with :
Scriptname ArmorResistFrost extends ObjectReferenceSpell Property TestFrostResist01 autoSpell Property TestFrostResist02 autoSpell Property TestFrostResist03 autoSpell Property TestFrostResist04 autoSpell Property TestFrostResist05 autoEvent OnEquipped(Actor AkActor) If akActor == Game.GetPlayer() If (Game.Getplayer().HasSpell(TestFrostResist01)) Game.Getplayer().removespell(TestFrostResist01) Game.GetPlayer().Addspell(TestFrostResist02, false) ElseIf (Game.Getplayer().HasSpell(TestFrostResist02)) Game.Getplayer().removespell(TestFrostResist02) Game.GetPlayer().Addspell(TestFrostResist03, false) ElseIf (Game.Getplayer().HasSpell(TestFrostResist03)) Game.Getplayer().removespell(TestFrostResist03) Game.GetPlayer().Addspell(TestFrostResist04, false) ElseIf (Game.Getplayer().HasSpell(TestFrostResist04)) Game.Getplayer().removespell(TestFrostResist04) Game.GetPlayer().Addspell(TestFrostResist05, false) Else Game.GetPlayer().Addspell(TestFrostResist01, false) EndIf EndIfEndEventEvent OnUnequipped(Actor AkActor) If akActor == Game.GetPlayer() If (Game.Getplayer().HasSpell(TestFrostResist05)) Game.Getplayer().removespell(TestFrostResist05) Game.GetPlayer().Addspell(TestFrostResist04, false) ElseIf (Game.Getplayer().HasSpell(TestFrostResist04)) Game.Getplayer().removespell(TestFrostResist04) Game.GetPlayer().Addspell(TestFrostResist03, false) ElseIf (Game.Getplayer().HasSpell(TestFrostResist03)) Game.Getplayer().removespell(TestFrostResist03) Game.GetPlayer().Addspell(TestFrostResist02, false) ElseIf (Game.Getplayer().HasSpell(TestFrostResist02)) Game.Getplayer().removespell(TestFrostResist02) Game.GetPlayer().Addspell(TestFrostResist01, false) Else Game.GetPlayer().removespell(TestFrostResist01) EndIf EndIfEndevent
I filled the good values in the Script properties in each item.
But I encounter a problem in game.
The multiple spells and resists work fine, but... The first piece I put gives me the +10, and the second gives me nothing. The 3rd, 4th and 5th works fine, until +40 instead of +50 because of this second piece which is not working.
In the reverse order, when I put off the amor, same problem, same place. I put off the item until I have 2 of them, and then I have +10. I put off one more, I still have +10. And the last item remove the spell.
I read and read again my script, I searched the logic, but I can't understand why the second piece doesn't give anything.
Can someone tell me where is the problem ?