Author Topic: Removing Temporary Item Properties  (Read 498 times)

Legacy_Sadira of Tyr

  • Sr. Member
  • ****
  • Posts: 299
  • Karma: +0/-0
Removing Temporary Item Properties
« on: March 22, 2014, 04:33:59 pm »


               

I know it sounds silly, that I would want to remove something that is temporary, and should remove itself after a certain amount of time expires. However I have noticed that temporary item properties can become buggy when a player logs and comes back. The properties would stay for much longer than they should. Also the properties are not being removed when a player rests.


 


That is the problem plaguing our rebirth system. When a player rebirths, they receive a token, which when activated, will add some temporary item properties to their weapons or armour. They are set for 20 minutes, 3 times a day. However when a player logs and comes back the next day, the properties are still there, and will last for a few days, rather than just the 20 minutes.


 


What I would like to do, is use scripts to remove all temporary item properties from both weapon hands and armour, when a player logs on the server, and when a player rests. I do not know if it can be done, so that is why I am asking. Can the temporary item properties be removed, or should I change them all to effects, and have them dispelable on rest?


 


Thank you for any help you may have.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Removing Temporary Item Properties
« Reply #1 on: March 22, 2014, 05:40:12 pm »


               

http://www.nwnlexico...lItemProperties may be the simplest solution for you.


 


Otherwise you'd just need to cycle through each item property, check the duration with GetItemPropertyDurationType, and them if temporary remove it with RemoveItemProperty.


 


Either method should work.  Can write a script later for the second method if the first method doesn't work for you.



               
               

               
            

Legacy_Sadira of Tyr

  • Sr. Member
  • ****
  • Posts: 299
  • Karma: +0/-0
Removing Temporary Item Properties
« Reply #2 on: March 22, 2014, 08:06:58 pm »


               

I will try the first one, and see if it works.


 


Thank you very much. ':wub:'



               
               

               
            

Legacy_Sadira of Tyr

  • Sr. Member
  • ****
  • Posts: 299
  • Karma: +0/-0
Removing Temporary Item Properties
« Reply #3 on: March 22, 2014, 08:53:09 pm »


               

Well, I have tried option one on the client enter and rest scripts, and they both worked great.


 


Thank you.  ':wub:'