using ODMO.Commons.Models.Base;
namespace ODMO.Commons.Models.Map
{
public partial class Drop
{
private const int HandlerRange = 49153;
public bool BitsDrop => DropInfo.ItemId == 90600;
public bool Expired => DateTime.Now > Expiration;
public bool NoOwner => OwnerHandler == 0 || DateTime.Now > LoseOwnership;
///
/// Sets the current drop general handler.
///
/// Sequential value to attach into the final value
public void SetHandlerValue(short handler) => GeneralHandler = HandlerRange + handler;
///
/// Updates the drop lost status.
///
/// Lost status
public void SetLost(bool lost = true) => Lost = lost;
public void SetCollected(bool collected) => Collected = collected;
public Drop(long id, long ownerId, ushort ownerHandler, ItemModel itemInfo, Location location, bool throwAway = false)
{
Id = id;
OwnerId = ownerId;
OwnerHandler = ownerHandler;
DropInfo = itemInfo;
Location = location;
Expiration = DateTime.Now.AddSeconds(90); //TODO: externalizar
LoseOwnership = DateTime.Now.AddSeconds(60);
Thrown = throwAway;
}
}
}