1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 06:47:45 +00:00
sapphire/src/scripts/quest/classquest/ARC/ClsArc998.cpp

103 lines
2.9 KiB
C++
Raw Normal View History

2022-01-13 23:18:53 -06: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/
#include "Manager/EventMgr.h"
2022-01-14 01:26:54 -06:00
#include <Actor/Player.h>
2022-01-13 23:18:53 -06:00
#include <ScriptObject.h>
#include <Service.h>
// Quest Script: ClsArc998_00131
// Quest Name: Way of the Archer
// Quest ID: 65667
// Start NPC: 1000197
// End NPC: 1000200
using namespace Sapphire;
class ClsArc998 : public Sapphire::ScriptAPI::QuestScript
{
2022-01-14 01:26:54 -06:00
private:
// Basic quest information
// Quest vars / flags used
// UI8AL
/// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000200
// 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 = 1000197;
static constexpr auto Actor1 = 1000200;
static constexpr auto Classjob = 5;
static constexpr auto GearsetUnlock = 1905;
static constexpr auto LocFace0 = 604;
static constexpr auto LocFace1 = 605;
static constexpr auto LogmessageMonsterNotePageUnlock = 1008;
static constexpr auto UnlockImageClassArc = 24;
public:
ClsArc998() : Sapphire::ScriptAPI::QuestScript( 65667 ){};
~ClsArc998() = default;
2022-01-13 23:18:53 -06:00
//////////////////////////////////////////////////////////////////////
// Event Handlers
2022-01-14 01:26:54 -06:00
void onTalk( World::Quest &quest, Entity::Player &player, uint64_t actorId ) override
2022-01-13 23:18:53 -06:00
{
switch( actorId )
{
2022-01-14 01:26:54 -06:00
case Actor0: {
if( quest.getSeq() == Seq0 )
Scene00000( quest, player );
2022-01-13 23:18:53 -06:00
break;
}
2022-01-14 01:26:54 -06:00
case Actor1: {
if( quest.getSeq() == SeqFinish )
Scene00001( quest, player );
2022-01-13 23:18:53 -06:00
break;
}
}
}
2022-01-14 01:26:54 -06:00
private:
2022-01-13 23:18:53 -06:00
//////////////////////////////////////////////////////////////////////
// Available Scenes in this quest, not necessarly all are used
//////////////////////////////////////////////////////////////////////
2022-01-14 01:26:54 -06:00
void Scene00000( World::Quest &quest, Entity::Player &player )
2022-01-13 23:18:53 -06:00
{
eventMgr().playQuestScene( player, getId(), 0, NONE, bindSceneReturn( &ClsArc998::Scene00000Return ) );
}
2022-01-14 01:26:54 -06:00
void Scene00000Return( World::Quest &quest, Entity::Player &player, const Event::SceneResult &result )
2022-01-13 23:18:53 -06:00
{
2022-01-14 01:26:54 -06:00
if( result.getResult( 0 ) == 1 )// accept quest
2022-01-13 23:18:53 -06:00
{
2022-01-14 01:26:54 -06:00
quest.setSeq( SeqFinish );
2022-01-13 23:18:53 -06:00
}
}
//////////////////////////////////////////////////////////////////////
2022-01-14 01:26:54 -06:00
void Scene00001( World::Quest &quest, Entity::Player &player )
2022-01-13 23:18:53 -06:00
{
eventMgr().playQuestScene( player, getId(), 1, FADE_OUT | HIDE_UI, bindSceneReturn( &ClsArc998::Scene00001Return ) );
}
2022-01-14 01:26:54 -06:00
void Scene00001Return( World::Quest &quest, Entity::Player &player, const Event::SceneResult &result )
2022-01-13 23:18:53 -06:00
{
if( result.getResult( 0 ) == 1 )
{
2022-01-14 01:26:54 -06:00
player.finishQuest( getId() );
2022-01-13 23:18:53 -06:00
}
}
};
EXPOSE_SCRIPT( ClsArc998 );