2018-03-07 08:14:42 +01:00
|
|
|
#include <Actor/Player.h>
|
2018-06-18 13:14:11 +00:00
|
|
|
#include <ScriptObject.h>
|
2018-12-23 03:53:08 +01:00
|
|
|
#include "Manager/EventMgr.h"
|
2018-09-20 23:31:38 +02:00
|
|
|
#include "Event/EventHandler.h"
|
2020-03-01 01:00:57 +11:00
|
|
|
#include <Service.h>
|
2018-03-07 08:14:42 +01:00
|
|
|
|
|
|
|
// Quest Script: ManFst001_00039
|
|
|
|
// Quest Name: Coming to Gridania
|
|
|
|
// Quest ID: 65575
|
|
|
|
// Start NPC: 1001148
|
|
|
|
// End NPC: 1001140
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
using namespace Sapphire;
|
2018-10-28 21:53:21 +01:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
class ManFst001 :
|
2018-11-13 21:34:44 +11:00
|
|
|
public Sapphire::ScriptAPI::EventScript
|
2018-03-07 08:14:42 +01:00
|
|
|
{
|
|
|
|
private:
|
2018-08-29 21:40:59 +02:00
|
|
|
static constexpr auto SEQ_0 = 0;
|
|
|
|
static constexpr auto SEQ_FINISH = 255;
|
|
|
|
|
|
|
|
static constexpr auto RewardExpFactor = 50;
|
|
|
|
static constexpr auto RewardGil = 103;
|
|
|
|
|
|
|
|
static constexpr auto ACTOR0 = 1001148;
|
|
|
|
static constexpr auto ACTOR1 = 1001140;
|
|
|
|
static constexpr auto CUT_EVENT = 29;
|
|
|
|
static constexpr auto EOBJECT0 = 2001659;
|
|
|
|
static constexpr auto EOBJECT1 = 2001660;
|
|
|
|
static constexpr auto EOBJECT7 = 2616477;
|
|
|
|
static constexpr auto EVENT_ACTION_SEARCH = 1;
|
|
|
|
static constexpr auto HOWTO_QUEST_ACCEPT = 12;
|
|
|
|
static constexpr auto HOWTO_QUEST_ANNOUNCE = 2;
|
|
|
|
static constexpr auto HOWTO_REWARD = 11;
|
|
|
|
static constexpr auto HOWTO_TODO = 3;
|
|
|
|
static constexpr auto OPENING_EVENT_HANDLER = 1245186;
|
|
|
|
static constexpr auto SEQ_2_ACTOR1 = 2;
|
|
|
|
|
|
|
|
void Scene00000( Entity::Player& player )
|
|
|
|
{
|
|
|
|
auto callback = [ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.param2 == 1 ) // accept quest
|
2018-03-07 08:14:42 +01:00
|
|
|
{
|
2018-08-29 21:40:59 +02:00
|
|
|
player.setOpeningSequence( 2 );
|
|
|
|
Scene00001( player );
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
player.playScene( getId(), 0, HIDE_HOTBAR, 0, 0, callback );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00001( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playSceneChain( getId(), 1, DISABLE_SKIP | HIDE_HOTBAR | SET_BASE, bindScene( &ManFst001::Scene00002 ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00002( Entity::Player& player )
|
|
|
|
{
|
|
|
|
auto callback = [ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
player.updateQuest( getId(), SEQ_FINISH );
|
|
|
|
|
2018-12-07 00:06:59 +01:00
|
|
|
player.eventStart( result.actorId, OPENING_EVENT_HANDLER, Event::EventHandler::Nest, 0, 0 );
|
2018-08-29 21:40:59 +02:00
|
|
|
player.playScene( OPENING_EVENT_HANDLER, 0x1E, HIDE_HOTBAR | NO_DEFAULT_CAMERA, 0, 0 );
|
|
|
|
};
|
|
|
|
|
|
|
|
player.playScene( getId(), 2, 0, 0, 0, callback );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00004( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playSceneChain( getId(), 4, FADE_OUT | HIDE_HOTBAR | CONDITION_CUTSCENE | HIDE_UI,
|
|
|
|
bindScene( &ManFst001::Scene00005 ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00005( Entity::Player& player )
|
|
|
|
{
|
|
|
|
auto callback = [ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.param2 == 1 )
|
2018-03-07 08:14:42 +01:00
|
|
|
{
|
2018-08-29 21:40:59 +02:00
|
|
|
if( player.giveQuestRewards( getId(), 0 ) )
|
|
|
|
player.finishQuest( getId() );
|
|
|
|
}
|
|
|
|
};
|
2018-03-07 08:14:42 +01:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
player.playScene( getId(), 5, INVIS_OTHER_PC, 0, 0, callback );
|
|
|
|
}
|
2018-03-07 08:14:42 +01:00
|
|
|
|
|
|
|
public:
|
2018-08-29 21:40:59 +02:00
|
|
|
ManFst001() :
|
2018-11-13 21:34:44 +11:00
|
|
|
Sapphire::ScriptAPI::EventScript( 65575 )
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
|
|
|
{
|
2020-03-01 11:57:41 +11:00
|
|
|
auto& pEventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
2020-03-01 01:00:57 +11:00
|
|
|
auto actor = pEventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
|
|
|
if( actor == ACTOR0 )
|
|
|
|
Scene00000( player );
|
|
|
|
else if( actor == ACTOR1 )
|
|
|
|
Scene00004( player );
|
|
|
|
}
|
2019-02-20 17:38:03 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
EXPOSE_SCRIPT( ManFst001 );
|