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-06-18 13:14:11 +00:00
|
|
|
#include <ScriptObject.h>
|
2018-12-23 03:53:08 +01:00
|
|
|
#include "Framework.h"
|
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
|
|
|
|
2018-03-07 08:14:42 +01:00
|
|
|
// Quest Script: SubFst001_00024
|
|
|
|
// Quest Name: Coarse Correspondence
|
|
|
|
// Quest ID: 65560
|
|
|
|
// Start NPC: 1000206
|
|
|
|
// End NPC: 1000233
|
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
class SubFst001 :
|
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 ACTOR0 = 1000206;
|
|
|
|
static constexpr auto ACTOR1 = 1000233;
|
|
|
|
static constexpr auto ITEM0 = 2000079;
|
|
|
|
static constexpr auto SEQ_0_ACTOR0 = 0;
|
|
|
|
static constexpr auto SEQ_1_ACTOR1 = 1;
|
|
|
|
static constexpr auto SEQ_1_ACTOR1_NPCTRADENO = 99;
|
|
|
|
static constexpr auto SEQ_1_ACTOR1_NPCTRADEOK = 100;
|
2018-03-07 08:14:42 +01:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
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.setQuestUI8AL( getId(), 1 );
|
|
|
|
player.setQuestUI8BH( getId(), 1 );
|
|
|
|
player.updateQuest( getId(), SEQ_FINISH );
|
|
|
|
}
|
|
|
|
};
|
2018-03-07 08:14:42 +01:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
player.playScene( getId(), 0, NONE, callback );
|
|
|
|
}
|
2018-03-07 08:14:42 +01:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void Scene00001( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playScene( getId(), 1, NONE );
|
|
|
|
}
|
2018-03-07 08:14:42 +01:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void Scene00099( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playScene( getId(), 99, NONE );
|
|
|
|
}
|
2018-03-07 08:14:42 +01:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void Scene00100( 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
|
|
|
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(), 100, NONE, callback );
|
|
|
|
}
|
2018-03-07 08:14:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
public:
|
2018-08-29 21:40:59 +02:00
|
|
|
SubFst001() :
|
2018-11-13 21:34:44 +11:00
|
|
|
Sapphire::ScriptAPI::EventScript( 65560 )
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
|
|
|
}
|
2018-03-07 08:14:42 +01:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
|
|
|
{
|
2018-12-23 03:53:08 +01:00
|
|
|
auto pEventMgr = m_framework->get< World::Manager::EventMgr >();
|
|
|
|
auto actor = pEventMgr->mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
2018-03-07 08:14:42 +01:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
if( actor == ACTOR0 )
|
|
|
|
{
|
|
|
|
if( !player.hasQuest( getId() ) )
|
|
|
|
Scene00000( player );
|
|
|
|
else
|
|
|
|
Scene00001( player );
|
|
|
|
}
|
|
|
|
else if( actor == ACTOR1 )
|
|
|
|
{
|
|
|
|
if( !player.hasQuest( getId() ) )
|
|
|
|
Scene00099( player );
|
|
|
|
else
|
|
|
|
Scene00100( player );
|
|
|
|
}
|
|
|
|
}
|
2018-03-07 08:14:42 +01:00
|
|
|
};
|