2018-03-07 08:14:42 +01:00
|
|
|
#include <Actor/Player.h>
|
2018-12-23 03:53:08 +01:00
|
|
|
#include "Manager/EventMgr.h"
|
2018-05-13 04:29:29 +02:00
|
|
|
#include <ScriptObject.h>
|
2020-03-01 01:00:57 +11:00
|
|
|
#include <Service.h>
|
2018-05-13 04:29:29 +02:00
|
|
|
|
|
|
|
// Quest Script: ManSea001_00107
|
|
|
|
// Quest Name: Coming to Limsa Lominsa
|
|
|
|
// Quest ID: 65643
|
|
|
|
// Start NPC: 1001028
|
|
|
|
// End NPC: 1002697
|
2018-03-07 08:14:42 +01:00
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
using namespace Sapphire;
|
2018-10-28 21:53:21 +01:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
class ManSea001 : public Sapphire::ScriptAPI::QuestScript
|
2018-03-07 08:14:42 +01:00
|
|
|
{
|
|
|
|
private:
|
2018-05-13 04:29:29 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
static constexpr auto SEQ_0 = 0;
|
|
|
|
static constexpr auto SEQ_1 = 1;
|
|
|
|
static constexpr auto SEQ_FINISH = 255;
|
|
|
|
|
|
|
|
static constexpr auto ACTOR0 = 1001028;
|
|
|
|
static constexpr auto ACTOR1 = 1002732;
|
|
|
|
static constexpr auto ACTOR2 = 1002697;
|
|
|
|
static constexpr auto CUT_EVENT = 202;
|
|
|
|
static constexpr auto EOBJECT0 = 2001679;
|
|
|
|
static constexpr auto EOBJECT1 = 2001680;
|
|
|
|
static constexpr auto EVENT_ACTION_SEARCH = 1;
|
|
|
|
static constexpr auto LOC_ACTOR0 = 1002732;
|
|
|
|
static constexpr auto LOC_POS_ACTOR0 = 4107186;
|
|
|
|
static constexpr auto OPENING_EVENT_HANDLER = 1245185;
|
|
|
|
static constexpr auto POPRANGE0 = 4127803;
|
|
|
|
static constexpr auto TERRITORYTYPE0 = 181;
|
|
|
|
|
|
|
|
void Scene00000( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 0, 8192,
|
2018-08-29 21:40:59 +02:00
|
|
|
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
if( result.getResult( 0 ) == 1 )
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
|
|
|
player.setOpeningSequence( 2 );
|
|
|
|
Scene00001( player );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00001( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playSceneChain( player, getId(), 1, DISABLE_SKIP | HIDE_HOTBAR | SET_BASE, bindScene( &ManSea001::Scene00002 ) );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00002( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
auto pQuest = player.getQuest( getId() );
|
|
|
|
if( !pQuest )
|
|
|
|
return;
|
|
|
|
|
|
|
|
pQuest->setSeq( SEQ_1 );
|
|
|
|
eventMgr().playSceneChain( player, getId(), 2, NONE, bindScene( &ManSea001::Scene00003 ) );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00003( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 3, NONE,
|
|
|
|
[&](Entity::Player& player, const Event::SceneResult& result)
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().eventStart( player, result.actorId, OPENING_EVENT_HANDLER, Event::EventHandler::Nest, 0, 0 );
|
|
|
|
eventMgr().playScene( player, OPENING_EVENT_HANDLER, 0x1E, HIDE_HOTBAR | NO_DEFAULT_CAMERA, { 1 } );
|
2018-08-29 21:40:59 +02:00
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00004( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 4, NONE );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00005( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playSceneChain( player, getId(), 5, HIDE_HOTBAR, bindScene( &ManSea001::Scene00006 ) );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00006( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 6, INVIS_OTHER_PC,
|
2018-08-29 21:40:59 +02:00
|
|
|
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
if( result.getResult( 0 ) == 1 )
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
auto pQuest = player.getQuest( getId() );
|
|
|
|
if( !pQuest )
|
|
|
|
return;
|
|
|
|
pQuest->setSeq( SEQ_FINISH );
|
2022-01-11 00:18:00 +01:00
|
|
|
player.prepareZoning( player.getTerritoryTypeId(), true, 1, 0 );
|
2018-08-29 21:40:59 +02:00
|
|
|
player.changePosition( 9, 40, 14, 2 );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00007( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 7, NONE );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00008( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 8, NONE );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00009( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 9, NONE );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00010( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 10, NONE );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00011( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playSceneChain( player, getId(), 11, 0x2c02, bindScene( &ManSea001::Scene00012 ) );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00012( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 12, INVIS_OTHER_PC,
|
2018-08-29 21:40:59 +02:00
|
|
|
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
if( result.getResult( 0 ) == 1 ) // finish quest
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2021-12-21 01:05:08 +01:00
|
|
|
player.finishQuest( getId(), result.getResult( 1 ) );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00013( Entity::Player& player )
|
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playScene( player, getId(), 13, NONE );
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
2018-03-07 08:14:42 +01:00
|
|
|
|
|
|
|
public:
|
2021-11-27 00:53:57 +01:00
|
|
|
ManSea001() : Sapphire::ScriptAPI::QuestScript( 65643 )
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
void onTalk( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
if( actorId == ACTOR0 )
|
2018-08-29 21:40:59 +02:00
|
|
|
Scene00000( player );
|
2021-11-27 00:53:57 +01:00
|
|
|
else if( actorId == ACTOR1 )
|
2018-08-29 21:40:59 +02:00
|
|
|
Scene00005( player );
|
2021-11-27 00:53:57 +01:00
|
|
|
else if( actorId == ACTOR2 )
|
2018-08-29 21:40:59 +02:00
|
|
|
Scene00011( player );
|
|
|
|
}
|
2019-02-20 17:38:03 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
EXPOSE_SCRIPT( ManSea001 );
|