mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 14:37:44 +00:00
115 lines
3.2 KiB
C++
115 lines
3.2 KiB
C++
![]() |
// 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>
|
||
|
#include <ScriptObject.h>
|
||
|
#include <Service.h>
|
||
|
|
||
|
// Quest Script: ManFst304_00513
|
||
|
// Quest Name: Sylph-management
|
||
|
// Quest ID: 66049
|
||
|
// Start NPC: 1005128
|
||
|
// End NPC: 1000168
|
||
|
|
||
|
using namespace Sapphire;
|
||
|
|
||
|
class ManFst304 : public Sapphire::ScriptAPI::QuestScript
|
||
|
{
|
||
|
private:
|
||
|
// Basic quest information
|
||
|
// Quest vars / flags used
|
||
|
// UI8AL
|
||
|
|
||
|
/// Countable Num: 0 Seq: 255 Event: 1 Listener: 1000168
|
||
|
// Steps in this quest ( 0 is before accepting,
|
||
|
// 1 is first, 255 means ready for turning it in
|
||
|
enum Sequence : uint8_t
|
||
|
{
|
||
|
Seq0 = 0,
|
||
|
SeqFinish = 255,
|
||
|
};
|
||
|
|
||
|
// Entities found in the script data of the quest
|
||
|
static constexpr auto Actor0 = 1005128;//Minfilia
|
||
|
static constexpr auto Actor1 = 1000168;//Vorsaile Heuloix
|
||
|
static constexpr auto CutManfst30410 = 0;
|
||
|
static constexpr auto CutManfst30420 = 150;
|
||
|
static constexpr auto Seq0Actor0Nq = 50;
|
||
|
|
||
|
public:
|
||
|
ManFst304() : Sapphire::ScriptAPI::QuestScript( 66049 ){};
|
||
|
~ManFst304() = 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 );
|
||
|
break;
|
||
|
}
|
||
|
case Actor1:
|
||
|
{
|
||
|
if( quest.getSeq() == SeqFinish )
|
||
|
Scene00002( 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( &ManFst304::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, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &ManFst304::Scene00001Return ) );
|
||
|
}
|
||
|
|
||
|
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||
|
{
|
||
|
//TODO: Not returning from fade to black????
|
||
|
quest.setSeq( SeqFinish );
|
||
|
}
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
void Scene00002( World::Quest& quest, Entity::Player& player )
|
||
|
{
|
||
|
eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &ManFst304::Scene00002Return ) );
|
||
|
}
|
||
|
|
||
|
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||
|
{
|
||
|
|
||
|
if( result.getResult( 0 ) == 1 )
|
||
|
{
|
||
|
player.finishQuest( getId() );
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
EXPOSE_SCRIPT( ManFst304 );
|