ronancpl / HeavenMS

An improved server based on MapleSolaxia (v83 MapleStory private server)
GNU Affero General Public License v3.0
1.03k stars 742 forks source link

Dropped Loot Not Expiring #477

Closed davidlafriniere closed 5 years ago

davidlafriniere commented 5 years ago

It seems loot that's dropped by a player never expires, although, loot from mobs expire.

ronancpl commented 5 years ago

Hi @davidlafriniere. I see you have closed both issues you have authored in the timespan of 5 days from today. And I notice that in both of them, no interaction of mine would have come yet, in foremost sorry for the late reply.

This development is being maintained voluntarily, and sure it's also eager for feedback of those who want to see it progress. In such a case, an answer tends to happen at a longer rate, more likely in a closer time to when a new update is prompted (in my broad hint, doing this would be more straightforward than "Oh, I got a solution for your issue, but it will only become available at the next update, expect it to show up in 10 days or so.").

I would like to have you know that, also apologies for all this hassle. Btw, noted your issue, thanks for reporting!

davidlafriniere commented 5 years ago

@ronancpl do no fret about not being able to address these right away. You're aware of the issues and that's all that matters. I'm pretty damn rusty having taken a 10 year break from all of this and I'm actively relearning things and hope to learn how to fix this on my own. If you have a fix available before I figure it out, great! I'd love to read your notes on it, if you have any.

ronancpl commented 5 years ago

Well a solution for that is as simple as using map.spawnItemDrop(chr, chr, source, dropPos, true, true); to do the job.

Not tackled in the code yet, but the disappearing occurs when the disappearing task (makeDisappearExpiredItemDrops()) runs. And to an item to disappear, they must be registered first, with: MapleMap.registerItemDrop(MapleMapItem mdrop)

ronancpl commented 5 years ago

Hmm, couldn't reproduce this issue. Both from testing and code looking, the item disappears normally when the player let it there, and the code that handles this is already using map.spawnItemDrop(chr, chr, target, dropPos, true, true);. Could you elaborate on the case you found?

davidlafriniere commented 5 years ago

Upon further testing; it appears player dropped items do not expire in town maps and the Free Market. I haven't done much further testing to see what other types of maps do this.

ronancpl commented 5 years ago

Hmm, I may have figured the cause of this issue. There is a gimmick in MapleStory on where some maps are tagged with "everlast", that means items that are dropped in there do not expire. Following that, during a MapleMap object creation, there's this: map.setEverlast(infoData.getChildByPath("everlast") != null);

This wouldn't handle an issue with the XML's that are present in this repo, but it would consider eventual <int name="everlast" value="0"/> as a map with everlasting items, which shouldn't be the case. Please confirm if that's the case happening in your side.

davidlafriniere commented 5 years ago

That would make a LOT of sense!

A lot of my maps are edited via HaCreator, which saves the everlast node into the properties of the map itself. Saving it as everlast = 0.

ronancpl commented 5 years ago

Gotcha!

davidlafriniere commented 5 years ago

And after further testing; All maps that I've edited DO have everlast = 0 and the items are NOT expiring.