2018-07-22 22:11:03 +10:00
|
|
|
#include <ScriptObject.h>
|
|
|
|
#include <Actor/Player.h>
|
|
|
|
|
|
|
|
class GilShop : public EventScript
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GilShop() : EventScript( 0x00041 )
|
|
|
|
{}
|
|
|
|
|
2018-07-22 23:20:12 +10:00
|
|
|
constexpr static auto SCENE_FLAGS = HIDE_HOTBAR | NO_DEFAULT_CAMERA;
|
|
|
|
|
|
|
|
static void shopInteractionCallback( Entity::Player& player, const Event::SceneResult& result )
|
2018-07-22 22:11:03 +10:00
|
|
|
{
|
2018-07-22 23:20:12 +10:00
|
|
|
// item purchase
|
|
|
|
if( result.param1 == 768 )
|
2018-07-22 22:11:03 +10:00
|
|
|
{
|
2018-07-22 23:20:12 +10:00
|
|
|
//player.playGilShop( result.eventId, HIDE_HOTBAR | NO_DEFAULT_CAMERA, shopInteractionCallback );
|
|
|
|
|
2018-07-22 23:32:16 +10:00
|
|
|
player.sendDebug("got tradeQuantity: " + std::to_string( result.param4 ) );
|
2018-07-22 23:20:12 +10:00
|
|
|
player.playScene( result.eventId, 10, SCENE_FLAGS, 0, 0, shopInteractionCallback );
|
|
|
|
return;
|
|
|
|
}
|
2018-07-22 22:11:03 +10:00
|
|
|
|
2018-07-22 23:20:12 +10:00
|
|
|
// exit
|
|
|
|
player.playScene( result.eventId, 255, SCENE_FLAGS );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void shopCallback( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
//player.playGilShop( result.eventId, HIDE_HOTBAR | NO_DEFAULT_CAMERA, shopInteractionCallback );
|
|
|
|
|
|
|
|
player.playScene( result.eventId, 10, SCENE_FLAGS, 0, 0, shopInteractionCallback );
|
|
|
|
}
|
|
|
|
|
|
|
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
|
|
|
{
|
|
|
|
player.playScene( eventId, 0, SCENE_FLAGS, 0, 2, shopCallback );
|
2018-07-22 22:11:03 +10:00
|
|
|
}
|
|
|
|
};
|