mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 06:27:45 +00:00
178 lines
No EOL
5.5 KiB
C++
178 lines
No EOL
5.5 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: SubFst069_00385
|
|
// Quest Name: Favor for the Fisherwoman
|
|
// Quest ID: 65921
|
|
// Start NPC: 1000502
|
|
// End NPC: 1000502
|
|
|
|
using namespace Sapphire;
|
|
|
|
class SubFst069 : public Sapphire::ScriptAPI::QuestScript
|
|
{
|
|
private:
|
|
// Basic quest information
|
|
// Quest vars / flags used
|
|
// UI8AL
|
|
// UI8BH
|
|
|
|
/// Countable Num: 1 Seq: 1 Event: 1 Listener: 2000685
|
|
/// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000502
|
|
// 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 = 1000502;//Berthe
|
|
static constexpr auto Eobject0 = 2000685;//Well-worn Fishing Rod
|
|
static constexpr auto EventActionSearch = 1;
|
|
static constexpr auto Item0 = 2000185;
|
|
static constexpr auto Seq0Actor0 = 0;
|
|
static constexpr auto Seq1Eobject0 = 1;
|
|
static constexpr auto Seq1Eobject0Eventactionno = 99;
|
|
static constexpr auto Seq1Eobject0Eventactionok = 100;
|
|
static constexpr auto Seq2Actor0 = 2;
|
|
static constexpr auto Seq2Actor0Npctradeno = 97;
|
|
static constexpr auto Seq2Actor0Npctradeok = 98;
|
|
|
|
public:
|
|
SubFst069() : Sapphire::ScriptAPI::QuestScript( 65921 ){};
|
|
~SubFst069() = 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() == SeqFinish )
|
|
Scene00002( quest, player );
|
|
break;
|
|
}
|
|
case Eobject0:
|
|
{
|
|
if( quest.getSeq() == Seq1 )
|
|
eventMgr().eventActionStart(
|
|
player, getId(), EventActionSearch,
|
|
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional ) {
|
|
Scene00100( 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( &SubFst069::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, NONE, bindSceneReturn( &SubFst069::Scene00001Return ) );
|
|
}
|
|
|
|
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
{
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
void Scene00002( World::Quest& quest, Entity::Player& player )
|
|
{
|
|
eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &SubFst069::Scene00002Return ) );
|
|
}
|
|
|
|
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
{
|
|
if( result.getResult( 0 ) == 1 )
|
|
Scene00098( quest, player );
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
void Scene00097( World::Quest& quest, Entity::Player& player )
|
|
{
|
|
eventMgr().playQuestScene( player, getId(), 97, NONE, bindSceneReturn( &SubFst069::Scene00097Return ) );
|
|
}
|
|
|
|
void Scene00097Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
{
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
void Scene00098( World::Quest& quest, Entity::Player& player )
|
|
{
|
|
eventMgr().playQuestScene( player, getId(), 98, HIDE_HOTBAR, bindSceneReturn( &SubFst069::Scene00098Return ) );
|
|
}
|
|
|
|
void Scene00098Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
{
|
|
|
|
if( result.getResult( 0 ) == 1 )
|
|
{
|
|
player.finishQuest( getId(), result.getResult( 1 ) );
|
|
}
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
void Scene00099( World::Quest& quest, Entity::Player& player )
|
|
{
|
|
eventMgr().playQuestScene( player, getId(), 99, NONE, bindSceneReturn( &SubFst069::Scene00099Return ) );
|
|
}
|
|
|
|
void Scene00099Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
{
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
void Scene00100( World::Quest& quest, Entity::Player& player )
|
|
{
|
|
eventMgr().playQuestScene( player, getId(), 100, NONE, bindSceneReturn( &SubFst069::Scene00100Return ) );
|
|
}
|
|
|
|
void Scene00100Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
|
{
|
|
eventMgr().sendEventNotice( player, getId(), 0, 0 );//TODO: Probably Item Icon
|
|
quest.setUI8BH( 1 );
|
|
quest.setSeq( SeqFinish );
|
|
}
|
|
};
|
|
|
|
EXPOSE_SCRIPT( SubFst069 ); |