mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-15 15:07:45 +00:00
180 lines
5.4 KiB
C++
180 lines
5.4 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: GaiUsb004_00811
|
||
|
// Quest Name: The Lominsan Way
|
||
|
// Quest ID: 66347
|
||
|
// Start NPC: 1006264
|
||
|
// End NPC: 1006266
|
||
|
|
||
|
using namespace Sapphire;
|
||
|
|
||
|
class GaiUsb004 : public Sapphire::ScriptAPI::QuestScript
|
||
|
{
|
||
|
private:
|
||
|
// Basic quest information
|
||
|
// Quest vars / flags used
|
||
|
// BitFlag8
|
||
|
// UI8AH
|
||
|
// UI8AL
|
||
|
|
||
|
/// Countable Num: 0 Seq: 1 Event: 1 Listener: 1006265
|
||
|
/// Countable Num: 0 Seq: 255 Event: 1 Listener: 2002284
|
||
|
// 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 = 1006264;//Trachtoum
|
||
|
static constexpr auto Actor1 = 1006265;//Grey Fleet Miller
|
||
|
static constexpr auto Actor2 = 1006266;//Wheiskaet
|
||
|
static constexpr auto Eobject0 = 2002284;
|
||
|
static constexpr auto EventActionSearch = 1;
|
||
|
static constexpr auto LocAction0 = 1005;
|
||
|
static constexpr auto LocActor0 = 1005259;
|
||
|
static constexpr auto LocActor1 = 1003782;
|
||
|
static constexpr auto LocActor9 = 1006676;
|
||
|
static constexpr auto LocBgm1 = 101;
|
||
|
static constexpr auto LocFace0 = 604;
|
||
|
static constexpr auto LocFace1 = 620;
|
||
|
static constexpr auto LocSe1 = 39;
|
||
|
static constexpr auto LocSe2 = 40;
|
||
|
static constexpr auto Questbattle0 = 59;
|
||
|
static constexpr auto Seq0Actor0Lq = 90;
|
||
|
static constexpr auto Territorytype0 = 307;
|
||
|
|
||
|
public:
|
||
|
GaiUsb004() : Sapphire::ScriptAPI::QuestScript( 66347 ){};
|
||
|
~GaiUsb004() = 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() == Seq1 )
|
||
|
{
|
||
|
playerMgr().sendUrgent( player, "QuestBattle unimplemented, skipping..." );
|
||
|
quest.setSeq( SeqFinish );
|
||
|
}
|
||
|
//Scene00002( quest, player );
|
||
|
break;
|
||
|
}
|
||
|
case Actor2:
|
||
|
{
|
||
|
if( quest.getSeq() == SeqFinish )
|
||
|
Scene00005( 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( &GaiUsb004::Scene00000Return ) );
|
||
|
}
|
||
|
|
||
|
void Scene00000Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||
|
{
|
||
|
if( result.getResult( 0 ) == 1 )// accept quest
|
||
|
{
|
||
|
Scene00090( quest, player );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
void Scene00002( World::Quest& quest, Entity::Player& player )
|
||
|
{
|
||
|
eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &GaiUsb004::Scene00002Return ) );
|
||
|
}
|
||
|
|
||
|
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||
|
{
|
||
|
if( result.getResult( 0 ) == 1 )
|
||
|
{
|
||
|
auto& pTeriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();
|
||
|
|
||
|
eventMgr().eventFinish( player, result.eventId, 0 );
|
||
|
pTeriMgr.createAndJoinQuestBattle( player, Questbattle0 );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
void Scene00003( World::Quest& quest, Entity::Player& player )
|
||
|
{
|
||
|
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &GaiUsb004::Scene00003Return ) );
|
||
|
}
|
||
|
|
||
|
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||
|
{
|
||
|
}
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
void Scene00004( World::Quest& quest, Entity::Player& player )
|
||
|
{
|
||
|
eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &GaiUsb004::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, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &GaiUsb004::Scene00005Return ) );
|
||
|
}
|
||
|
|
||
|
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||
|
{
|
||
|
|
||
|
if( result.getResult( 0 ) == 1 )
|
||
|
{
|
||
|
player.finishQuest( getId() );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
void Scene00090( World::Quest& quest, Entity::Player& player )
|
||
|
{
|
||
|
eventMgr().playQuestScene( player, getId(), 90, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &GaiUsb004::Scene00090Return ) );
|
||
|
}
|
||
|
|
||
|
void Scene00090Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||
|
{
|
||
|
quest.setSeq( Seq1 );
|
||
|
}
|
||
|
};
|
||
|
|
||
|
EXPOSE_SCRIPT( GaiUsb004 );
|