2022-02-21 00:24:37 -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-21 00:24:37 -06:00
|
|
|
#include <ScriptObject.h>
|
|
|
|
#include <Service.h>
|
|
|
|
|
|
|
|
// Quest Script: GaiUsb808_00917
|
|
|
|
// Quest Name: The Final Flight of the Enterprise
|
|
|
|
// Quest ID: 66453
|
|
|
|
// Start NPC: 1006384
|
|
|
|
// End NPC: 1006435
|
|
|
|
|
|
|
|
using namespace Sapphire;
|
|
|
|
|
|
|
|
class GaiUsb808 : public Sapphire::ScriptAPI::QuestScript
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
// Basic quest information
|
|
|
|
// Quest vars / flags used
|
|
|
|
// BitFlag8
|
|
|
|
// UI8AL
|
|
|
|
// UI8BH
|
|
|
|
// UI8BL
|
|
|
|
|
|
|
|
/// Countable Num: 0 Seq: 1 Event: 1 Listener: 1006434
|
|
|
|
/// Countable Num: 0 Seq: 2 Event: 1 Listener: 2002320
|
|
|
|
/// Countable Num: 0 Seq: 3 Event: 1 Listener: 1006434
|
|
|
|
/// Countable Num: 0 Seq: 4 Event: 1 Listener: 1006434
|
|
|
|
/// Countable Num: 0 Seq: 5 Event: 1 Listener: 1006384
|
|
|
|
/// Countable Num: 0 Seq: 255 Event: 1 Listener: 1006383
|
|
|
|
// 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,
|
|
|
|
Seq2 = 2,
|
|
|
|
Seq3 = 3,
|
|
|
|
Seq4 = 4,
|
|
|
|
Seq5 = 5,
|
|
|
|
SeqFinish = 255,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Entities found in the script data of the quest
|
|
|
|
static constexpr auto Actor0 = 1006384;//Haurchefant
|
|
|
|
static constexpr auto Actor1 = 1006434;//Discomposed Cataloger
|
|
|
|
static constexpr auto Actor2 = 1006383;//Francel
|
|
|
|
static constexpr auto Actor3 = 1006435;//Brunadier
|
|
|
|
static constexpr auto Eobject0 = 2002320;//Past Logs
|
|
|
|
static constexpr auto EventActionProcessUpperMiddle = 32;
|
|
|
|
static constexpr auto Item0 = 2000720;
|
|
|
|
static constexpr auto Item1 = 2000721;
|
|
|
|
static constexpr auto Item2 = 2000722;
|
2023-05-09 17:06:50 -07:00
|
|
|
static constexpr auto Item0Icon = 26002;
|
2022-02-21 00:24:37 -06:00
|
|
|
|
|
|
|
public:
|
|
|
|
GaiUsb808() : Sapphire::ScriptAPI::QuestScript( 66453 ){};
|
|
|
|
~GaiUsb808() = 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() == Seq4 )
|
|
|
|
Scene00008( quest, player );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Actor1:
|
|
|
|
{
|
|
|
|
if( quest.getSeq() == Seq1 )
|
|
|
|
Scene00002( quest, player );
|
|
|
|
else if( quest.getSeq() == Seq2 )
|
|
|
|
Scene00005( quest, player );
|
|
|
|
else if( quest.getSeq() == Seq3 )
|
|
|
|
Scene00006( quest, player );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Actor2:
|
|
|
|
{
|
|
|
|
if( quest.getSeq() == Seq5 )
|
|
|
|
Scene00009( quest, player );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Actor3:
|
|
|
|
{
|
|
|
|
if( quest.getSeq() == SeqFinish )
|
|
|
|
Scene00010( quest, player );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Eobject0:
|
|
|
|
{
|
|
|
|
eventMgr().eventActionStart(
|
|
|
|
player, getId(), EventActionProcessUpperMiddle,
|
|
|
|
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional ) {
|
|
|
|
Scene00003( quest, player );
|
|
|
|
},
|
|
|
|
nullptr, 0 );
|
|
|
|
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( &GaiUsb808::Scene00000Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00000Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.getResult( 0 ) == 1 )// accept quest
|
|
|
|
{
|
|
|
|
Scene00001( quest, player );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00001( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 1, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00001Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
quest.setSeq( Seq1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00002( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00002Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
eventMgr().sendEventNotice( player, getId(), 0, 0 );
|
|
|
|
quest.setSeq( Seq2 );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00003( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00003Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
2023-05-09 17:06:50 -07:00
|
|
|
eventMgr().sendNotice( player, getId(), 1, { Item0Icon } );
|
2022-02-21 00:24:37 -06:00
|
|
|
quest.setUI8BH( 1 );
|
|
|
|
quest.setSeq( Seq3 );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00004( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00004Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00005( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00005Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00006( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 6, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00006Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00006Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.getResult( 0 ) == 1 )
|
|
|
|
Scene00007( quest, player );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00007( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 7, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00007Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00007Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
eventMgr().sendEventNotice( player, getId(), 2, 0 );
|
|
|
|
quest.setUI8BH( 0 );
|
|
|
|
quest.setSeq( Seq4 );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00008( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 8, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00008Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00008Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
eventMgr().sendEventNotice( player, getId(), 3, 0 );
|
|
|
|
quest.setUI8BH( 1 );
|
|
|
|
quest.setSeq( Seq5 );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00009( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 9, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00009Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00009Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
eventMgr().sendEventNotice( player, getId(), 4, 0 );
|
|
|
|
quest.setUI8BL( 1 );
|
|
|
|
quest.setSeq( SeqFinish );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00010( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 10, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00010Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00010Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.getResult( 0 ) == 1 )
|
|
|
|
Scene00011( quest, player );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void Scene00011( World::Quest& quest, Entity::Player& player )
|
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 11, HIDE_HOTBAR, bindSceneReturn( &GaiUsb808::Scene00011Return ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00011Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
|
|
|
|
if( result.getResult( 0 ) == 1 )
|
|
|
|
{
|
|
|
|
player.finishQuest( getId() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
EXPOSE_SCRIPT( GaiUsb808 );
|