hestia-rsps / hestia

An open-source Kotlin game server.
BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

Floor Item System #75

Closed GregHib closed 4 years ago

GregHib commented 4 years ago

Item entity with Position

Add/removed from client viewports just like other entities.

GregHib commented 4 years ago

Item is an entity with Type FloorItem is an Item entity with Position

Two timeout systems, one Owner which stores player name identifier and the other Local. The local system only runs when Local is present but Owner isn't. Once the timeout reaches 0 (or -1 for indefinitely) then the timeout is removed and updates sent.

FloorItemSystem when picking up an item via event, simply removes Position. Container handling will be implemented later in #76 but what if a player has a full inventory?

DropSystem will allow items to be added to the floor. Should handle some items turning to gold when dropped, also should item spawning (potential untradables) be a separate system or not?

FloorItemProducer system, probably a better name. If an item is taken then timeout until a new one is added.