1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-04 17:57:47 +00:00
sapphire/src/servers/sapphire_zone/Zone/Land.h

115 lines
2.6 KiB
C
Raw Normal View History

2018-11-01 23:56:43 +01:00
#ifndef LAND_H_
#define LAND_H_
2018-11-01 00:18:19 +01:00
#include <Common.h>
#include "Exd/ExdDataGenerated.h"
2018-11-01 00:18:19 +01:00
#include "ForwardsZone.h"
namespace Core
{
2018-11-04 23:47:10 +01:00
namespace Data
{
using HousingLandSetPtr = std::shared_ptr< HousingLandSet >;
}
2018-11-01 23:56:43 +01:00
class Land
2018-11-01 00:18:19 +01:00
{
public:
2018-11-04 23:47:10 +01:00
Land( uint16_t zoneId, uint8_t wardNum, uint8_t landId, uint32_t landSetId, Core::Data::HousingLandSetPtr info );
2018-11-01 23:56:43 +01:00
virtual ~Land();
2018-11-01 00:18:19 +01:00
void load();
//Primary state
void setHouseSize( uint8_t size );
void setState( uint8_t state );
void setOwnership( uint8_t state );
void setSharing( uint8_t state );
2018-11-11 14:34:56 +01:00
void setLandName( const std::string& name );
void setLandType( Common::LandType type );
2018-11-01 00:18:19 +01:00
//Gerneral
uint8_t getPlotSize() const;
uint8_t getState() const;
uint8_t getOwnership() const;
uint8_t getSharing() const;
uint32_t getLandSetId() const;
uint8_t getWardNum() const;
uint8_t getLandId() const;
uint16_t getZoneId() const;
std::string getLandName() const;
Common::LandType getLandType() const;
2018-11-01 00:18:19 +01:00
//Free Comapny
void setFreeCompany( uint32_t id, uint32_t icon, uint32_t color );
uint32_t getFcId();
uint32_t getFcIcon();
uint32_t getFcColor();
//House data
2018-11-02 19:21:12 +01:00
void setHousePart( Common::HousePartSlot slot, uint16_t itemId );
uint16_t getHousePart( Common::HousePartSlot slot );
2018-11-01 00:18:19 +01:00
//Color
void setColor( uint8_t slot, uint8_t color );
uint8_t getColor( uint8_t slot );
//Player
void setPlayerOwner( uint32_t id );
uint32_t getPlayerOwner();
//Housing Functions
void setPreset( uint32_t itemId );
2018-11-10 19:00:13 +01:00
void UpdateLandDb();
2018-11-01 00:18:19 +01:00
void Update( uint32_t currTime );
uint32_t getMaxItems();
2018-11-04 23:47:10 +01:00
uint32_t getCurrentPrice() const;
2018-11-07 11:08:07 +01:00
uint32_t getDevaluationTime();
2018-11-04 23:47:10 +01:00
2018-11-10 19:00:13 +01:00
//House tags
void setLandTag( uint8_t slot, uint8_t tag );
uint8_t getLandTag( uint8_t slot );
2018-11-01 00:18:19 +01:00
private:
2018-11-02 19:21:12 +01:00
uint16_t convertItemIdToHousingItemId( uint16_t itemId );
2018-11-03 00:47:45 +01:00
void init();
2018-11-01 00:18:19 +01:00
uint8_t m_wardNum;
2018-11-01 23:56:43 +01:00
uint8_t m_landId;
2018-11-04 23:47:10 +01:00
uint32_t m_landSetId;
2018-11-01 00:18:19 +01:00
uint16_t m_zoneId;
uint8_t m_size;
uint8_t m_state;
uint8_t m_iconColor;
uint8_t m_iconAddIcon;
uint32_t m_fcId;
uint32_t m_fcIcon;
uint32_t m_fcIconColor;
Common::LandType m_type;
2018-11-01 00:18:19 +01:00
uint32_t m_ownerPlayerId;
2018-11-04 23:47:10 +01:00
Core::Data::HousingLandSetPtr m_landInfo;
2018-11-01 00:18:19 +01:00
//item storage
Core::ItemContainerPtr ItemsOutdoorContainer;
uint32_t m_maxItems;
//price
uint32_t m_initPrice;
uint32_t m_nextDrop;
uint32_t m_currentPrice;
2018-11-09 09:49:43 +01:00
uint32_t m_minPrice;
2018-11-10 19:00:13 +01:00
2018-11-11 14:27:39 +01:00
//information
char m_landName[23];
char m_landMsg[193];
char m_ownerName[31];
char fcTag[7];
2018-11-10 19:00:13 +01:00
uint8_t m_tag[3];
2018-11-01 00:18:19 +01:00
};
}
#endif