1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 06:47:45 +00:00
sapphire/src/scripts/quest/ManFst306.cpp
2022-02-15 02:12:40 -06:00

177 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: ManFst306_00514
// Quest Name: Into the Beast's Maw
// Quest ID: 66050
// Start NPC: 1000590
// End NPC: 1000590
using namespace Sapphire;
class ManFst306 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// UI8AL
/// Countable Num: 0 Seq: 1 Event: 1 Listener: 1000393
/// Countable Num: 0 Seq: 2 Event: 1 Listener: 5010000
/// Countable Num: 0 Seq: 3 Event: 1 Listener: 1000393
/// Countable Num: 0 Seq: 255 Event: 15 Listener: 5020000
// 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,
Seq3 = 3, //Fake sequence for cutscene
SeqFinish = 255,
};
// Entities found in the script data of the quest
static constexpr auto ActionJoy = 953;
static constexpr auto Actor0 = 1000590;//Buscarron
static constexpr auto Actor1 = 1000393;//Bloisirant
static constexpr auto ContentStart = 1;
static constexpr auto CutSceneQibAfter01 = 240;
static constexpr auto CutSceneQibAfter02 = 241;
static constexpr auto CutSceneQibAfter03 = 373;
static constexpr auto Instancedungeon0 = 1;
static constexpr auto LocActor0 = 1002275;
static constexpr auto LocActor1 = 1002276;
static constexpr auto LocActor2 = 1003838;
static constexpr auto Poprange0 = 4332862;
static constexpr auto Territorytype0 = 153;
static constexpr auto UnlockAddNewContentToCf = 3702;
static constexpr auto UnlockImageDungeonTotorak = 78;
public:
ManFst306() : Sapphire::ScriptAPI::QuestScript( 66050 ){};
~ManFst306() = 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 )
Scene00005( quest, player );
break;
}
case Actor1:
{
if( quest.getSeq() == Seq1 )
Scene00002( quest, player );
else if( quest.getSeq() == Seq2 )
Scene00003( quest, player );
break;
}
}
}
void onEnterTerritory( World::Quest& quest, Entity::Player& player, uint16_t param1, uint16_t param2 ) override
{
if( quest.getSeq() == Seq3 )
Scene00004( quest, player );
}
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( &ManFst306::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, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &ManFst306::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, HIDE_HOTBAR, bindSceneReturn( &ManFst306::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq2 );
eventMgr().sendEventNotice( player, getId(), 0, 0 );
//TODO:Unlock Thousand Maws
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &ManFst306::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00004( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 4, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &ManFst306::Scene00004Return ) );
}
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( SeqFinish );
}
//////////////////////////////////////////////////////////////////////
void Scene00005( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, bindSceneReturn( &ManFst306::Scene00005Return ) );
}
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.finishQuest( getId() );
}
}
};
EXPOSE_SCRIPT( ManFst306 );