2022-02-10 19:42:26 -06:00
|
|
|
// This is an automatically generated C++ script template
|
|
|
|
// Content needs to be added by hand to make it function
|
|
|
|
// In order for this script to be loaded, move it to the correct folder in <root>/scripts/
|
|
|
|
|
|
|
|
#include "Manager/EventMgr.h"
|
|
|
|
#include <Actor/Player.h>
|
2022-02-23 08:36:23 +01:00
|
|
|
#include <Actor/BNpc.h>
|
2022-02-10 19:42:26 -06:00
|
|
|
#include <ScriptObject.h>
|
|
|
|
#include <Service.h>
|
|
|
|
|
|
|
|
// Quest Script: ManFst208_00272
|
|
|
|
// Quest Name: Life, Materia and Everything
|
|
|
|
// Quest ID: 65808
|
|
|
|
// Start NPC: 1005116
|
|
|
|
// End NPC: 1005116
|
|
|
|
|
|
|
|
using namespace Sapphire;
|
|
|
|
|
|
|
|
class ManFst208 : public Sapphire::ScriptAPI::QuestScript
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
// Basic quest information
|
|
|
|
// Quest vars / flags used
|
|
|
|
// UI8AL
|
|
|
|
// UI8BH
|
|
|
|
// UI8BL
|
|
|
|
|
|
|
|
/// Countable Num: 0 Seq: 1 Event: 1 Listener: 1001425
|
|
|
|
/// Countable Num: 0 Seq: 255 Event: 1 Listener: 1005116
|
|
|
|
// Steps in this quest ( 0 is before accepting,
|
|
|
|
// 1 is first, 255 means ready for turning it in
|
|
|
|
enum Sequence : uint8_t
|
|
|
|
{
|
|
|
|
Seq0 = 0,
|
|
|
|
Seq1 = 1,
|
|
|
|
SeqFinish = 255,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Entities found in the script data of the quest
|
|
|
|
static constexpr auto Actor0 = 1005116;//Minfilia
|
|
|
|
static constexpr auto Actor1 = 1001425;//Mutamix
|
|
|
|
static constexpr auto CutManfst20810 = 83;
|
|
|
|
static constexpr auto Item0 = 2000461;
|
|
|
|
static constexpr auto Item1 = 2000462;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ManFst208() : Sapphire::ScriptAPI::QuestScript( 65808 ){};
|
|
|
|
~ManFst208() = default;
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// Event Handlers
|
|
|
|
void onTalk( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override
|
|
|
|
{
|
|
|
|
switch( actorId )
|
|
|
|
{
|
|
|
|
case Actor0:
|
|
|
|
{
|
|
|
|
if( quest.getSeq() == Seq0 )
|
|
|
|
Scene00000( quest, player );
|
|
|
|
else if( quest.getSeq() == SeqFinish )
|
|
|
|
Scene00003( quest, player );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Actor1:
|
|
|
|
{
|
|
|
|
if( quest.getSeq() == Seq1 )
|
|
|
|
Scene00001( quest, player );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// Available Scenes in this quest, not necessarly all are used
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00000( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 0, HIDE_HOTBAR, bindSceneReturn( &ManFst208::Scene00000Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00000Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.getResult( 0 ) == 1 )// accept quest
|
|
|
|
{
|
|
|
|
quest.setSeq( Seq1 );
|
|
|
|
quest.setUI8BH( 1 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00001( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 1, HIDE_HOTBAR, bindSceneReturn( &ManFst208::Scene00001Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.getResult( 0 ) == 1 )
|
|
|
|
Scene00002( quest, player );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00002( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 2, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &ManFst208::Scene00002Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
quest.setUI8BH( 0 );
|
|
|
|
quest.setUI8BL( 1 );
|
|
|
|
eventMgr().sendEventNotice( player, getId(), 0, 0 );
|
|
|
|
quest.setSeq( SeqFinish );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00003( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &ManFst208::Scene00003Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.getResult( 0 ) == 1 )
|
|
|
|
Scene00004( quest, player );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00004( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &ManFst208::Scene00004Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
|
|
|
|
if( result.getResult( 0 ) == 1 )
|
|
|
|
{
|
|
|
|
player.finishQuest( getId() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
EXPOSE_SCRIPT( ManFst208 );
|