mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-07 11:17:46 +00:00
Create SubSea012.cpp
This commit is contained in:
parent
166c6e161f
commit
dc16463a17
1 changed files with 163 additions and 0 deletions
163
src/scripts/quest/subquest/limsa/SubSea012.cpp
Normal file
163
src/scripts/quest/subquest/limsa/SubSea012.cpp
Normal file
|
@ -0,0 +1,163 @@
|
|||
// 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: SubSea012_00122
|
||||
// Quest Name: Glory Days
|
||||
// Quest ID: 65658
|
||||
// Start NPC: 1003601
|
||||
// End NPC: 1000972
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
class SubSea012 : public Sapphire::ScriptAPI::QuestScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// UI8AL
|
||||
// UI8BH
|
||||
|
||||
/// Countable Num: 1 Seq: 1 Event: 1 Listener: 1001024
|
||||
/// Countable Num: 1 Seq: 2 Event: 9 Listener: 324
|
||||
/// Countable Num: 0 Seq: 255 Event: 1 Listener: 1000972
|
||||
// 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,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1003601;
|
||||
static constexpr auto Actor1 = 1001024;
|
||||
static constexpr auto Actor2 = 1000972;
|
||||
static constexpr auto Enemy0 = 324;
|
||||
static constexpr auto Item0 = 2000454;
|
||||
|
||||
public:
|
||||
SubSea012() : Sapphire::ScriptAPI::QuestScript( 65658 ){};
|
||||
~SubSea012() = 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override
|
||||
{
|
||||
if( nameId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto currentKC = quest.getUI8AL() + 1;
|
||||
quest.setUI8BH( currentKC );
|
||||
quest.setUI8AL( currentKC );
|
||||
|
||||
if( currentKC >= 4 )
|
||||
quest.setSeq( SeqFinish );
|
||||
else
|
||||
eventMgr().sendEventNotice( player, getId(), 1, 2, currentKC, 4 );
|
||||
}
|
||||
|
||||
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( &SubSea012::Scene00000Return ) );
|
||||
}
|
||||
|
||||
void Scene00000Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.getResult( 0 ) == 1 )// accept quest
|
||||
{
|
||||
quest.setSeq( Seq1 );
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Scene00001( World::Quest& quest, Entity::Player& player )
|
||||
{
|
||||
eventMgr().playQuestScene( player, getId(), 1, HIDE_HOTBAR, bindSceneReturn( &SubSea012::Scene00001Return ) );
|
||||
}
|
||||
|
||||
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
//Empty
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Scene00002( World::Quest& quest, Entity::Player& player )
|
||||
{
|
||||
eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &SubSea012::Scene00002Return ) );
|
||||
}
|
||||
|
||||
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
quest.setSeq( Seq2 );
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Scene00003( World::Quest& quest, Entity::Player& player )
|
||||
{
|
||||
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &SubSea012::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( &SubSea012::Scene00004Return ) );
|
||||
}
|
||||
|
||||
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
|
||||
if( result.getResult( 0 ) == 1 )
|
||||
{
|
||||
player.finishQuest( getId(), result.getResult( 1 ) );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( SubSea012 );
|
Loading…
Add table
Reference in a new issue