2018-12-30 19:06:21 +01:00
|
|
|
#include <Actor/Player.h>
|
|
|
|
#include <Manager/EventMgr.h>
|
|
|
|
#include <ScriptObject.h>
|
2020-03-01 01:00:57 +11:00
|
|
|
#include <Service.h>
|
2018-12-30 19:06:21 +01:00
|
|
|
|
|
|
|
using namespace Sapphire;
|
|
|
|
|
|
|
|
// Quest Script: SubFst005_00028
|
|
|
|
// Quest Name: To the Bannock
|
|
|
|
// Quest ID: 65564
|
|
|
|
// Start NPC: 1000100
|
|
|
|
// End NPC: 1000421
|
|
|
|
|
|
|
|
class SubFst005 :
|
|
|
|
public Sapphire::ScriptAPI::EventScript
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
// Basic quest information
|
|
|
|
// Quest vars / flags used
|
|
|
|
// GetQuestUI8AL
|
|
|
|
|
|
|
|
enum Sequence :
|
|
|
|
uint8_t
|
|
|
|
{
|
|
|
|
Seq0 = 0,
|
|
|
|
SeqFinish = 255,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Quest rewards
|
|
|
|
static constexpr auto RewardExpFactor = 200;
|
|
|
|
static constexpr auto RewardGil = 127;
|
|
|
|
|
|
|
|
// Entities found in the script data of the quest
|
|
|
|
static constexpr auto Actor0 = 1000100;
|
|
|
|
static constexpr auto Actor1 = 1000421;
|
|
|
|
static constexpr auto Seq0Actor0 = 0;
|
|
|
|
static constexpr auto Seq1Actor1 = 1;
|
|
|
|
|
|
|
|
public:
|
|
|
|
SubFst005() :
|
|
|
|
Sapphire::ScriptAPI::EventScript( 65564 )
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
~SubFst005()
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
|
|
|
{
|
2020-03-01 01:00:57 +11:00
|
|
|
auto pEventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
|
|
|
auto actor = pEventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
2018-12-30 19:06:21 +01:00
|
|
|
|
|
|
|
if ( actor == Actor0 )
|
|
|
|
{
|
|
|
|
Scene00000( player );
|
|
|
|
}
|
|
|
|
else if ( actor == Actor1 )
|
|
|
|
{
|
|
|
|
Scene00001( player );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void Scene00000( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playScene( getId(), 0, 0,
|
|
|
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if ( result.param2 == 1 )
|
|
|
|
player.updateQuest( getId(), SeqFinish );
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
2018-12-30 19:11:30 +01:00
|
|
|
void Scene00001( Entity::Player& player )
|
2018-12-30 19:06:21 +01:00
|
|
|
{
|
|
|
|
player.playScene( getId(), 1, 0,
|
|
|
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if ( result.param2 == 1 )
|
|
|
|
{
|
|
|
|
if ( player.giveQuestRewards( getId(), 0 ) )
|
|
|
|
player.finishQuest( getId() );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
};
|
2019-02-20 17:38:03 +11:00
|
|
|
|
|
|
|
EXPOSE_SCRIPT( SubFst005 );
|