mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
Implemented SubSea002
This commit is contained in:
parent
6a9f5b683f
commit
b508b996c6
1 changed files with 133 additions and 0 deletions
133
src/scripts/quest/subquest/limsa/SubSea002.cpp
Normal file
133
src/scripts/quest/subquest/limsa/SubSea002.cpp
Normal file
|
@ -0,0 +1,133 @@
|
|||
// 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 <Actor/Player.h>
|
||||
#include "Manager/EventMgr.h"
|
||||
#include <ScriptObject.h>
|
||||
#include <Service.h>
|
||||
|
||||
// Quest Script: SubSea002_00112
|
||||
// Quest Name: Suspiciously SoberF
|
||||
// Quest ID: 65648
|
||||
// Start NPC: 1003604 (Ahldskyf)
|
||||
// End NPC: 1003275 (Frydwyb)
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
class SubSea002 : public Sapphire::ScriptAPI::QuestScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// UI8AL
|
||||
|
||||
/// Countable Num: 1 Seq: 1 Event: 1 Listener: 1003274
|
||||
/// Countable Num: 0 Seq: 255 Event: 1 Listener: 1003275
|
||||
// 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 = 1003604; // Ahldskyf ( Pos: -60.441002 17.990400 -4.318360 Teri: 129 )
|
||||
static constexpr auto Actor1 = 1003274; // Glazrael ( Pos: -110.459999 17.990400 15.701500 Teri: 129 )
|
||||
static constexpr auto Actor2 = 1003275; // Frydwyb ( Pos: -147.087997 18.200001 14.382000 Teri: 129 )
|
||||
|
||||
public:
|
||||
SubSea002() : Sapphire::ScriptAPI::QuestScript( 65648 ){};
|
||||
~SubSea002() = default;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Event Handlers
|
||||
void onTalk( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
switch( actorId )
|
||||
{
|
||||
case Actor0:
|
||||
{
|
||||
Scene00000( quest, player );
|
||||
break;
|
||||
}
|
||||
case Actor1:
|
||||
{
|
||||
Scene00002( quest, player );
|
||||
break;
|
||||
}
|
||||
case Actor2:
|
||||
{
|
||||
Scene00003( 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, NONE, bindSceneReturn( &SubSea002::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, NONE, bindSceneReturn( &SubSea002::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, NONE, bindSceneReturn( &SubSea002::Scene00002Return ) );
|
||||
}
|
||||
|
||||
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
quest.setSeq( SeqFinish );
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Scene00003( World::Quest& quest, Entity::Player& player )
|
||||
{
|
||||
eventMgr().playQuestScene( player, getId(), 3, NONE, bindSceneReturn( &SubSea002::Scene00003Return ) );
|
||||
}
|
||||
|
||||
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
|
||||
if( result.getResult( 0 ) == 1 )
|
||||
{
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( SubSea002 );
|
Loading…
Add table
Reference in a new issue