otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.6k stars 1.06k forks source link

Force Item Decay #1199

Open EPuncker opened 9 years ago

EPuncker commented 9 years ago

Would be nice to have a new item attribute to make item duration be counted even if it is in depot, user offline, house etc, like in real tibia we got some items that disappear despite the user being logged in or not, using it or not:

http://tibia.wikia.com/wiki/Shimmer_Bow http://tibia.wikia.com/wiki/Shimmer_Sword http://tibia.wikia.com/wiki/Shimmer_Rod http://tibia.wikia.com/wiki/Shimmer_Wand

maybe something like forcedecay = 1

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Zbizu commented 9 years ago

on global: if you put item in dp and walk away, it's decay is paused, try with magic light wand. Same with logging out

Luckey1729 commented 9 years ago

I'm pretty sure Zbizu is correct (if he is incorrect - at least that's how decay worked last time I played.) But who's to say TFS can't be better in this sort of way? I'm for it.

EPuncker commented 9 years ago

@Zbizu even with shimmer items? xD I know that it worked like that for some items (helmet of ancient pieces, flower pots etc)

bennydz commented 7 years ago

there is no solution yet?

andersonfaaria commented 4 years ago

both this and #2641 could be closed by using the solution provided by @gesior

Zbizu commented 4 years ago

care to link the solution?

also the decay could be stored this way: customAttribute with os.mtime() of expiration date for actively decaying items and resynchronised on opening depot

andersonfaaria commented 4 years ago

@Zbizu https://github.com/gesior/forgottenserver/commit/b9019632f5d284c87355135fa129e21260d991ee

Zbizu commented 4 years ago

does it solve the issue though?

there are items that should have decay paused when locking in depot and special cases that shouldn't for example claw of the noxious spawn, rat corpses and other items like that don't refresh when in depot (at least they didn't around 9.x times), but demon children and lightbearer torch disappear after specified time.

andersonfaaria commented 4 years ago

check the two branches he have on his fork, one of them is exactly the timestamp decay https://github.com/gesior/forgottenserver/commit/b7fea42fbd97c1723051ac1b40da1951dbec3eb8

andersonfaaria commented 4 years ago

here's the comparison: https://github.com/otland/forgottenserver/compare/master...gesior:2641_new_decay_algorithm

DSpeichert commented 4 years ago

@andersonfaaria is there a PR open?