2018-07-22 16:54:01 +10:00
|
|
|
#include <ScriptObject.h>
|
|
|
|
#include <Actor/Player.h>
|
2018-11-10 19:00:13 +01:00
|
|
|
#include <Zone/Zone.h>
|
|
|
|
#include <Zone/HousingZone.h>
|
2018-07-22 16:54:01 +10:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
using namespace Core;
|
|
|
|
|
2018-11-10 19:00:13 +01:00
|
|
|
class CmnDefHousingSignboard : public EventScript
|
2018-07-22 16:54:01 +10:00
|
|
|
{
|
|
|
|
public:
|
2018-11-10 19:00:13 +01:00
|
|
|
CmnDefHousingSignboard() : EventScript( 721031 )
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
|
|
|
}
|
2018-07-22 16:54:01 +10:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void Scene00000( Entity::Player& player )
|
|
|
|
{
|
2018-11-10 19:00:13 +01:00
|
|
|
auto callback = [ this ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
// Purchase Land
|
|
|
|
if( result.param2 == 2 )
|
|
|
|
{
|
|
|
|
auto activeLand = player.getActiveLand();
|
|
|
|
auto territoryId = player.getTerritoryId();
|
|
|
|
|
|
|
|
auto pTerritory = player.getCurrentZone();
|
|
|
|
auto pHousing = std::dynamic_pointer_cast< HousingZone >( pTerritory );
|
|
|
|
|
|
|
|
pHousing->playerPurchseLand( player, activeLand.plot, result.param2 );
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
player.playScene( getId(), 0, HIDE_HOTBAR, 0, 0, callback );
|
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
2018-07-22 16:54:01 +10:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
|
|
|
{
|
|
|
|
Scene00000( player );
|
|
|
|
}
|
2018-07-22 16:54:01 +10:00
|
|
|
};
|