• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 1.X] Timed items with time left indicator when look the item

Athenuz

Owlz!
Joined
Oct 1, 2015
Messages
234
Reaction score
27
Location
México
Hello!

Is possible to make an item "timed" for sample, "24 hours" and when "look" on it, show the time left?

Can someone help me with this? :D
 
Based from the Stealth Ring, there definitely is a way.

Code:
  <item id="2202" article="a" name="stealth ring (invisibility)">
     <attribute key="weight" value="100" />
     <attribute key="slotType" value="ring" />
     <attribute key="decayTo" value="0" />
     <attribute key="transformDeEquipTo" value="2165" /> -- this would not be needed
     <attribute key="duration" value="600" /> -- ten minutes in seconds
     <attribute key="showduration" value="1" />
     <attribute key="invisible" value="1" /> -- this would not be needed
     <attribute key="showattributes" value="1" /> -- this would not be needed
   </item>

So modified, I would make an item like this.

Code:
  <item id="2202" article="a" name="timed item">
     <attribute key="weight" value="100" />
     <attribute key="slotType" value="ring" /> -- would only be used if its equipment
     <attribute key="decayTo" value="0" />
     <attribute key="duration" value="86400" /> -- 24 hours
     <attribute key="showduration" value="1" />
   </item>

Now, this isn't tested. But as soon as this item is spawned it should start the duration, once the duration is done - item will be removed.
Im not 100% sure if you will need to modify anything in movements. I assume only if you add attributes to the item.

Regards,
Extrodus
 
Based from the Stealth Ring, there definitely is a way.

Code:
  <item id="2202" article="a" name="stealth ring (invisibility)">
     <attribute key="weight" value="100" />
     <attribute key="slotType" value="ring" />
     <attribute key="decayTo" value="0" />
     <attribute key="transformDeEquipTo" value="2165" /> -- this would not be needed
     <attribute key="duration" value="600" /> -- ten minutes in seconds
     <attribute key="showduration" value="1" />
     <attribute key="invisible" value="1" /> -- this would not be needed
     <attribute key="showattributes" value="1" /> -- this would not be needed
   </item>

So modified, I would make an item like this.

Code:
  <item id="2202" article="a" name="timed item">
     <attribute key="weight" value="100" />
     <attribute key="slotType" value="ring" /> -- would only be used if its equipment
     <attribute key="decayTo" value="0" />
     <attribute key="duration" value="86400" /> -- 24 hours
     <attribute key="showduration" value="1" />
   </item>

Now, this isn't tested. But as soon as this item is spawned it should start the duration, once the duration is done - item will be removed.
Im not 100% sure if you will need to modify anything in movements. I assume only if you add attributes to the item.

Regards,
Extrodus


I feel so noobish.

Thanks a lot!
 
you have to start the doDecay function or the proper reference of it in your item* definition nowadays. Along with the aforementioned configurations too.
 
onEquip movement or addItem movement. By initializing the decay it will transform to the item with the provided duration. Depending your revision, something like this might work in /data/movements/movements.xml


<movevent event="Equip" itemid="ITEMID" slot="ring" function="onEquipItem" />
<movevent event="DeEquip" itemid="ITEMID" slot="ring" function="onDeEquipItem" />
 
Back
Top