2021-11-27 00:53:57 +01:00
|
|
|
// 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/
|
|
|
|
|
2018-12-30 19:06:21 +01:00
|
|
|
#include <Actor/Player.h>
|
2021-11-27 00:53:57 +01:00
|
|
|
#include "Manager/EventMgr.h"
|
2018-12-30 19:06:21 +01:00
|
|
|
#include <ScriptObject.h>
|
2020-03-01 01:00:57 +11:00
|
|
|
#include <Service.h>
|
2018-12-30 19:06:21 +01:00
|
|
|
|
|
|
|
// Quest Script: SubFst005_00028
|
|
|
|
// Quest Name: To the Bannock
|
|
|
|
// Quest ID: 65564
|
|
|
|
// Start NPC: 1000100
|
|
|
|
// End NPC: 1000421
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
using namespace Sapphire;
|
|
|
|
|
|
|
|
class SubFst005 : public Sapphire::ScriptAPI::QuestScript
|
2018-12-30 19:06:21 +01:00
|
|
|
{
|
2021-12-20 00:06:52 +01:00
|
|
|
private:
|
|
|
|
// Basic quest information
|
|
|
|
// Quest vars / flags used
|
|
|
|
// GetQuestUI8AL
|
|
|
|
|
|
|
|
// 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 = 1000100;
|
|
|
|
static constexpr auto Actor1 = 1000421;
|
|
|
|
static constexpr auto Seq0Actor0 = 0;
|
|
|
|
static constexpr auto Seq1Actor1 = 1;
|
2018-12-30 19:06:21 +01:00
|
|
|
|
2021-12-20 00:06:52 +01:00
|
|
|
public:
|
|
|
|
SubFst005() : Sapphire::ScriptAPI::QuestScript( 65564 )
|
|
|
|
{};
|
2018-12-30 19:06:21 +01:00
|
|
|
|
2021-12-20 00:06:52 +01:00
|
|
|
~SubFst005() = default;
|
2018-12-30 19:06:21 +01:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// Event Handlers
|
2021-12-20 00:06:52 +01:00
|
|
|
void onTalk( World::Quest &quest, Entity::Player &player, uint64_t actorId ) override
|
2021-11-27 00:53:57 +01:00
|
|
|
{
|
2021-12-20 00:06:52 +01:00
|
|
|
if( actorId == Actor0 )
|
2018-12-30 19:06:21 +01:00
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
Scene00000( quest, player );
|
2018-12-30 19:06:21 +01:00
|
|
|
}
|
2021-12-20 00:06:52 +01:00
|
|
|
else if( actorId == Actor1 )
|
2018-12-30 19:06:21 +01:00
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
Scene00001( quest, player );
|
2018-12-30 19:06:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-12-20 00:06:52 +01:00
|
|
|
private:
|
2021-11-27 00:53:57 +01:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// Available Scenes in this quest, not necessarly all are used
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
2021-12-20 00:06:52 +01:00
|
|
|
void Scene00000( World::Quest &quest, Entity::Player &player )
|
2021-11-27 00:53:57 +01:00
|
|
|
{
|
|
|
|
eventMgr().playQuestScene( player, getId(), 0, NONE, bindSceneReturn( &SubFst005::Scene00000Return ) );
|
|
|
|
}
|
|
|
|
|
2021-12-20 00:06:52 +01:00
|
|
|
void Scene00000Return( World::Quest &quest, Entity::Player &player, const Event::SceneResult &result )
|
2018-12-30 19:06:21 +01:00
|
|
|
{
|
2021-12-20 00:06:52 +01:00
|
|
|
if( result.getResult( 0 ) == 1 )
|
2021-11-27 00:53:57 +01:00
|
|
|
quest.setSeq( SeqFinish );
|
2018-12-30 19:06:21 +01:00
|
|
|
}
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
2021-12-20 00:06:52 +01:00
|
|
|
void Scene00001( World::Quest &quest, Entity::Player &player )
|
2018-12-30 19:06:21 +01:00
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
eventMgr().playQuestScene( player, getId(), 1, NONE, bindSceneReturn( &SubFst005::Scene00001Return ) );
|
2018-12-30 19:06:21 +01:00
|
|
|
}
|
2021-11-27 00:53:57 +01:00
|
|
|
|
2021-12-20 00:06:52 +01:00
|
|
|
void Scene00001Return( World::Quest &quest, Entity::Player &player, const Event::SceneResult &result )
|
2021-11-27 00:53:57 +01:00
|
|
|
{
|
2021-12-20 00:06:52 +01:00
|
|
|
if( result.getResult( 0 ) == 1 )
|
2021-11-27 00:53:57 +01:00
|
|
|
{
|
2021-12-20 00:06:52 +01:00
|
|
|
if( player.giveQuestRewards( getId(), 0 ) )
|
2021-11-27 00:53:57 +01:00
|
|
|
player.finishQuest( getId() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-30 19:06:21 +01:00
|
|
|
};
|
2019-02-20 17:38:03 +11:00
|
|
|
|
|
|
|
EXPOSE_SCRIPT( SubFst005 );
|