1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

Merge branch 'ThreePointOh' of https://github.com/dude22072/Sapphire into ThreePointOh

This commit is contained in:
dude22072 2022-03-05 22:11:00 -06:00
commit 0a89948ce5
10 changed files with 1896 additions and 0 deletions

View file

@ -0,0 +1,173 @@
// 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: FesPdy101_00499
// Quest Name: A Thorne-y Relationship
// Quest ID: 66035
// Start NPC: 1011778
// End NPC: 1011780
using namespace Sapphire;
class FesPdy101 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// BitFlag8
// UI8AL
/// Countable Num: 1 Seq: 1 Event: 1 Listener: 1011779
/// Countable Num: 1 Seq: 255 Event: 1 Listener: 1011786
// 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 = 1011778;//Sophisticated Servitor
static constexpr auto Actor1 = 1011779;//Nanapasi (Seq1)
static constexpr auto Actor2 = 1011786;//Ninimo
static constexpr auto Actor3 = 1011780;//Nanapai (SeqFinish)
static constexpr auto LcutActor01 = 1011785;
static constexpr auto LcutLevelHide01 = 4996401;
static constexpr auto LcutLevelHide02 = 4996400;
static constexpr auto LocBgm01 = 93;
static constexpr auto LocBgm02 = 88;
static constexpr auto LocFace1 = 614;
static constexpr auto LocFace2 = 613;
static constexpr auto LocPos01 = 5668095;
static constexpr auto LocQuestCheck01 = 65572;
public:
FesPdy101() : Sapphire::ScriptAPI::QuestScript( 66035 ){};
~FesPdy101() = 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() == Seq1 )
Scene00004( quest, player );
break;
}
case Actor1:
{
if( quest.getSeq() == Seq1 )
Scene00002( quest, player );
break;
}
case Actor2:
{
if( quest.getSeq() == Seq1 )
Scene00003( quest, player );
break;
}
case Actor3:
{
if( quest.getSeq() == SeqFinish )
Scene00005( quest, player );
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( &FesPdy101::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, HIDE_HOTBAR, bindSceneReturn( &FesPdy101::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, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &FesPdy101::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( SeqFinish );
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &FesPdy101::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, HIDE_HOTBAR, bindSceneReturn( &FesPdy101::Scene00004Return ) );
}
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00005( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, bindSceneReturn( &FesPdy101::Scene00005Return ) );
}
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.finishQuest( getId() );
}
}
};
EXPOSE_SCRIPT( FesPdy101 );

View file

@ -0,0 +1,124 @@
// 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: FesPdy102_00500
// Quest Name: Digging for Dolls
// Quest ID: 66036
// Start NPC: 1011781
// End NPC: 1011781
using namespace Sapphire;
class FesPdy102 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
/// Countable Num: 1 Seq: 255 Event: 1 Listener: 1011781
// 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 = 1011781;//Disciplined Domestic
static constexpr auto LocQuest01 = 66036;
static constexpr auto LocQuest02 = 66747;
static constexpr auto LocQuest03 = 66037;
static constexpr auto LocRitem01 = 9900;
static constexpr auto Ritem0 = 10089;
public:
FesPdy102() : Sapphire::ScriptAPI::QuestScript( 66036 ){};
~FesPdy102() = 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;
}
}
}
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( &FesPdy102::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, HIDE_HOTBAR, bindSceneReturn( &FesPdy102::Scene00001Return ) );
}
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( SeqFinish );
}
//////////////////////////////////////////////////////////////////////
void Scene00002( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &FesPdy102::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
Scene00003( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &FesPdy102::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.collectHandInItems( { Ritem0 } );
player.finishQuest( getId() );
}
}
};
EXPOSE_SCRIPT( FesPdy102 );

View file

@ -0,0 +1,172 @@
// 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: FesPdy103_00501
// Quest Name: A Father's Folly
// Quest ID: 66037
// Start NPC: 1011780
// End NPC: 1011780
using namespace Sapphire;
class FesPdy103 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// BitFlag8
// UI8AL
/// Countable Num: 1 Seq: 1 Event: 1 Listener: 2005193
/// Countable Num: 1 Seq: 255 Event: 1 Listener: 1011780
// 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 = 1011780;//Nanapasi
static constexpr auto Eobject0 = 2005193;//Destination
static constexpr auto EventActionWaiting2Middle = 12;
static constexpr auto LcutActor01 = 1011878;
static constexpr auto LcutActor02 = 1011785;
static constexpr auto LcutLevelHide01 = 4996401;
static constexpr auto LcutLevelHide02 = 4996400;
static constexpr auto LocBgm01 = 87;
static constexpr auto LocBgm02 = 98;
static constexpr auto LocEmote1 = 3754;
static constexpr auto LocFace1 = 605;
static constexpr auto LocLevelEnpcId01 = 5668092;
static constexpr auto LocPosActor1 = 5668682;
static constexpr auto LocPosActor2 = 5762414;
static constexpr auto LocQuestCheck01 = 65572;
static constexpr auto AchievementCompleteQuest = 1062;//Welcome to the Dollhouse
public:
FesPdy103() : Sapphire::ScriptAPI::QuestScript( 66037 ){};
~FesPdy103() = 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() == Seq1 )
Scene00004( quest, player );
else if( quest.getSeq() == SeqFinish )
Scene00005( quest, player );
break;
}
case Eobject0:
{
eventMgr().eventActionStart(
player, getId(), EventActionWaiting2Middle,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional ) {
Scene00003( 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( &FesPdy103::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, HIDE_HOTBAR, bindSceneReturn( &FesPdy103::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( &FesPdy103::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &FesPdy103::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
eventMgr().sendEventNotice( player, getId(), 0, 0 );
quest.setSeq( SeqFinish );
}
//////////////////////////////////////////////////////////////////////
void Scene00004( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &FesPdy103::Scene00004Return ) );
}
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00005( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, bindSceneReturn( &FesPdy103::Scene00005Return ) );
}
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
//TODO:Achievement
player.finishQuest( getId() );
}
}
};
EXPOSE_SCRIPT( FesPdy103 );

View file

@ -0,0 +1,228 @@
// 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>
#include "Actor/BNpc.h"
// Quest Script: SubFst911_01162
// Quest Name: My Feisty Little Chocobo
// Quest ID: 66698
// Start NPC: 1002754
// End NPC: 1000471
using namespace Sapphire;
class SubFst911 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// UI8AL
// UI8BH
/// Countable Num: 0 Seq: 1 Event: 1 Listener: 1000471
/// Countable Num: 0 Seq: 2 Event: 1 Listener: 2001467
/// Countable Num: 0 Seq: 3 Event: 1 Listener: 1000471
/// Countable Num: 0 Seq: 4 Event: 5 Listener: 178
/// Countable Num: 0 Seq: 255 Event: 1 Listener: 1000471
// 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,
Seq4 = 4,
SeqFinish = 255,
};
// Entities found in the script data of the quest
static constexpr auto Actor0 = 1002754;
static constexpr auto Actor1 = 1000471;
static constexpr auto Enemy0 = 178;
static constexpr auto Eobject0 = 2001467;
static constexpr auto EventActionProcessMiddle = 16;
static constexpr auto Item0 = 2000085;
static constexpr auto Reward0 = 18;
static constexpr auto Ritem0 = 4868;
static constexpr auto Screenimage0 = 92;
public:
SubFst911() : Sapphire::ScriptAPI::QuestScript( 66698 ){};
~SubFst911() = 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 );
break;
}
case Actor1:
{
if( quest.getSeq() == Seq1 )
Scene00002( quest, player );
else if( quest.getSeq() == Seq3 )
Scene00005( quest, player );
else if( quest.getSeq() == SeqFinish )
Scene00007( quest, player );
break;
}
case Eobject0:
{
if( quest.getSeq() == Seq2 )
eventMgr().eventActionStart(
player, getId(), EventActionProcessMiddle,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional ) {
Scene00003( quest, player );
},
nullptr, 0 );
}
}
}
void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{
switch( bnpc.getBNpcBaseId() )
{
case Enemy0:
{
//TODO: Check if companion is spawned
quest.setUI8AL( quest.getUI8AL() + 1 );
eventMgr().sendEventNotice( player, getId(), 3, 2, quest.getUI8AL(), 3 );
if( quest.getUI8AL() >= 3 )
{
quest.setUI8AL( 0 );
quest.setSeq( SeqFinish );
}
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, NONE, bindSceneReturn( &SubFst911::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, NONE, bindSceneReturn( &SubFst911::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, NONE, bindSceneReturn( &SubFst911::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq2 );
eventMgr().sendEventNotice( player, getId(), 0, 0 );
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, NONE, bindSceneReturn( &SubFst911::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq3 );
eventMgr().sendEventNotice( player, getId(), 1, 0 );
quest.setUI8BH( 1 );
}
//////////////////////////////////////////////////////////////////////
void Scene00004( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 4, NONE, bindSceneReturn( &SubFst911::Scene00004Return ) );
}
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00005( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 5, NONE, bindSceneReturn( &SubFst911::Scene00005Return ) );
}
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
Scene00006( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00006( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 6, NONE, bindSceneReturn( &SubFst911::Scene00006Return ) );
}
void Scene00006Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq4 );
eventMgr().sendEventNotice( player, getId(), 2, 0 );
quest.setUI8BH( 0 );
player.setRewardFlag( static_cast< Common::UnlockEntry >( Reward0 ) );
player.setRewardFlag( static_cast< Common::UnlockEntry >( 17 ) );
}
//////////////////////////////////////////////////////////////////////
void Scene00007( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 7, NONE, bindSceneReturn( &SubFst911::Scene00007Return ) );
}
void Scene00007Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.finishQuest( getId() );
}
}
};
EXPOSE_SCRIPT( SubFst911 );

View file

@ -0,0 +1,177 @@
// 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: SubCts806_01421
// Quest Name: A Self-improving Man
// Quest ID: 66957
// Start NPC: 1006969
// End NPC: 1006969
using namespace Sapphire;
class SubCts806 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// BitFlag8
// UI8AL
// UI8BH
/// Countable Num: 1 Seq: 1 Event: 1 Listener: 1001304
/// Countable Num: 1 Seq: 255 Event: 1 Listener: 1006969
// 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 = 1006969;
static constexpr auto Actor1 = 1001304;
static constexpr auto EventActionSearch = 1;
static constexpr auto Item0 = 2001238;
static constexpr auto LocGeneralAction = 22;
static constexpr auto UnlockPatternMaking = 172;
public:
SubCts806() : Sapphire::ScriptAPI::QuestScript( 66957 ){};
~SubCts806() = 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() == Seq1 )
Scene00004( quest, player );
else if( quest.getSeq() == SeqFinish )
Scene00005( quest, player );
break;
}
case Actor1:
{
if( quest.getSeq() == Seq1 )
Scene00002( quest, player );
else if( quest.getSeq() == SeqFinish )
Scene00006( quest, player );
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( &SubCts806::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, HIDE_HOTBAR, bindSceneReturn( &SubCts806::Scene00001Return ) );
}
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq1 );
quest.setUI8BH( 1 );
}
//////////////////////////////////////////////////////////////////////
void Scene00002( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &SubCts806::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
Scene00003( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &SubCts806::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
eventMgr().sendEventNotice( player, getId(), 0, 0 );
quest.setSeq( SeqFinish );
quest.setUI8BH( 0 );
}
//////////////////////////////////////////////////////////////////////
void Scene00004( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &SubCts806::Scene00004Return ) );
}
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00005( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, bindSceneReturn( &SubCts806::Scene00005Return ) );
}
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.finishQuest( getId(), result.getResult(1) );
player.setRewardFlag( Common::UnlockEntry::Glamour );
player.setRewardFlag( static_cast< Common::UnlockEntry >( UnlockPatternMaking ) );
}
}
//////////////////////////////////////////////////////////////////////
void Scene00006( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 6, HIDE_HOTBAR, bindSceneReturn( &SubCts806::Scene00006Return ) );
}
void Scene00006Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
};
EXPOSE_SCRIPT( SubCts806 );

View file

@ -0,0 +1,263 @@
// 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>
#include "Actor/BNpc.h"
#include "Manager/TerritoryMgr.h"
#include "Territory/Territory.h"
// Quest Script: GaiUsc903_01038
// Quest Name: High Standards
// Quest ID: 66574
// Start NPC: 1006637
// End NPC: 1006637
using namespace Sapphire;
class GaiUsc903 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// BitFlag8
// UI8AH
// UI8AL
// UI8BH
// UI8BL
/// Countable Num: 0 Seq: 1 Event: 1 Listener: 2002255
/// Countable Num: 0 Seq: 255 Event: 1 Listener: 2002253
// 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 = 1006637;//Rafold
static constexpr auto Enemy0 = 4301884;
static constexpr auto Eobject0 = 2002255;//Immortal Flames Standard (East)
static constexpr auto Eobject1 = 2002253;//Immortal Flames Standard (South)
static constexpr auto Eobject2 = 2002254;//Immortal Flames Standard (West)
static constexpr auto EventAction = 28;
static constexpr auto EventActionSearch = 1;
public:
GaiUsc903() : Sapphire::ScriptAPI::QuestScript( 66574 ){};
~GaiUsc903() = 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 )
Scene00008( quest, player );
break;
}
case Eobject0:
{
eventMgr().eventActionStart(
player, getId(), EventAction,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional ) {
Scene00003( quest, player );
},
nullptr, 0 );
break;
}
case Eobject1:
{
eventMgr().eventActionStart(
player, getId(), EventAction,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional ) {
Scene00005( quest, player );
},
nullptr, 0 );
break;
}
case Eobject2:
{
eventMgr().eventActionStart(
player, getId(), EventAction,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional ) {
Scene00007( quest, player );
},
nullptr, 0 );
break;
}
}
}
void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{
switch( bnpc.getLayoutId() )
{
case Enemy0:
{
quest.setUI8BL( 1 );
quest.setBitFlag8( 3, true );
quest.setUI8AH( quest.getUI8AH() + 1 );
checkQuestCompletion( quest, player );
break;
}
}
}
private:
void checkQuestCompletion( World::Quest& quest, Entity::Player& player )
{
eventMgr().sendEventNotice( player, getId(), 0, 2, quest.getUI8AH(), 3 );
if( quest.getUI8AH() >= 3 )
{
quest.setUI8AH( 0 );
quest.setUI8AL( 0 );
quest.setUI8BH( 0 );
quest.setUI8BL( 0 );
quest.setBitFlag8( 1, false );
quest.setBitFlag8( 2, false );
quest.setBitFlag8( 3, false );
quest.setSeq( SeqFinish );
}
}
//////////////////////////////////////////////////////////////////////
// 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( &GaiUsc903::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, HIDE_HOTBAR, bindSceneReturn( &GaiUsc903::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( &GaiUsc903::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &GaiUsc903::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setUI8AL( 1 );
quest.setBitFlag8( 1, true );
quest.setUI8AH( quest.getUI8AH() + 1 );
checkQuestCompletion( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00004( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &GaiUsc903::Scene00004Return ) );
}
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00005( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, bindSceneReturn( &GaiUsc903::Scene00005Return ) );
}
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setUI8BH( 1 );
quest.setBitFlag8( 2, true );
quest.setUI8AH( quest.getUI8AH() + 1 );
checkQuestCompletion( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00006( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 6, HIDE_HOTBAR, bindSceneReturn( &GaiUsc903::Scene00006Return ) );
}
void Scene00006Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00007( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 7, HIDE_HOTBAR, bindSceneReturn( &GaiUsc903::Scene00007Return ) );
}
void Scene00007Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
auto instance = teriMgr().getTerritoryByGuId( player.getTerritoryId() );
auto enemySpawned = instance->getActiveBNpcByLayoutIdAndTriggerOwner( Enemy0, player.getId() );
if( !enemySpawned )
{
auto enemy = instance->createBNpcFromLayoutId( Enemy0, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() );
enemy->hateListAddDelayed( player.getAsPlayer(), 1 );
}
}
//////////////////////////////////////////////////////////////////////
void Scene00008( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 8, HIDE_HOTBAR, bindSceneReturn( &GaiUsc903::Scene00008Return ) );
}
void Scene00008Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.finishQuest( getId(), result.getResult( 1 ) );
}
}
};
EXPOSE_SCRIPT( GaiUsc903 );

View file

@ -0,0 +1,190 @@
// 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>
#include "Actor/BNpc.h"
#include "Manager/TerritoryMgr.h"
#include "Territory/Territory.h"
// Quest Script: GaiUsc906_01041
// Quest Name: Jumping on a Grenade
// Quest ID: 66577
// Start NPC: 1006637
// End NPC: 1006643
using namespace Sapphire;
class GaiUsc906 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// BitFlag8
// UI8AL
// UI8BH
/// Countable Num: 0 Seq: 1 Event: 1 Listener: 2002257
/// Countable Num: 0 Seq: 255 Event: 9 Listener: 2092
// 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 = 1006637;
static constexpr auto Actor1 = 1006643;
static constexpr auto Enemy0 = 4302012;
static constexpr auto Eobject0 = 2002257;
static constexpr auto EventActionSearch = 1;
static constexpr auto EventActionWaiting = 10;
static constexpr auto Item0 = 2000788;
public:
GaiUsc906() : Sapphire::ScriptAPI::QuestScript( 66577 ){};
~GaiUsc906() = 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 );
break;
}
case Actor1:
{
if( quest.getSeq() == SeqFinish )
Scene00004( quest, player );
break;
}
case Eobject0:
{
eventMgr().eventActionStart(
player, getId(), EventActionWaiting,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional ) {
Scene00003( quest, player );
},
nullptr, 0 );
break;
}
}
}
void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{
switch( bnpc.getLayoutId() )
{
case Enemy0:
{
quest.setUI8BH( 1 );
eventMgr().sendEventNotice( player, getId(), 0, 0 );
quest.setSeq( SeqFinish );
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( &GaiUsc906::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, HIDE_HOTBAR, bindSceneReturn( &GaiUsc906::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( &GaiUsc906::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &GaiUsc906::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
auto instance = teriMgr().getTerritoryByGuId( player.getTerritoryId() );
auto enemySpawned = instance->getActiveBNpcByLayoutIdAndTriggerOwner( Enemy0, player.getId() );
if( !enemySpawned )
{
auto enemy = instance->createBNpcFromLayoutId( Enemy0, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() );
enemy->hateListAddDelayed( player.getAsPlayer(), 1 );
}
}
//////////////////////////////////////////////////////////////////////
void Scene00004( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &GaiUsc906::Scene00004Return ) );
}
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
Scene00005( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00005( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, bindSceneReturn( &GaiUsc906::Scene00005Return ) );
}
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.finishQuest( getId(), result.getResult(1) );
}
}
};
EXPOSE_SCRIPT( GaiUsc906 );

View file

@ -0,0 +1,294 @@
// 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: GaiUsc909_01044
// Quest Name: The Life of the Party
// Quest ID: 66580
// Start NPC: 1006643
// End NPC: 1006643
using namespace Sapphire;
class GaiUsc909 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// BitFlag8
// UI8AH
// UI8AL
// UI8BH
// UI8BL
// UI8CH
// UI8CL
/// Countable Num: 0 Seq: 1 Event: 1 Listener: 1006653
/// Countable Num: 0 Seq: 255 Event: 8 Listener: 1006653
// 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 = 1006643;//Memezofu
static constexpr auto Actor1 = 1006653;
static constexpr auto Actor2 = 1006654;
static constexpr auto Actor3 = 1006655;
static constexpr auto Actor4 = 1006656;
static constexpr auto Item0 = 2000789;
static constexpr auto VfxReaction = 177;
public:
GaiUsc909() : Sapphire::ScriptAPI::QuestScript( 66580 ){};
~GaiUsc909() = 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 )
Scene00010( quest, player );
break;
}
case Actor1:
{
if( quest.getSeq() == Seq1 )
Scene00002( quest, player );
break;
}
case Actor2:
{
if( quest.getSeq() == Seq1 )
Scene00004( quest, player );
break;
}
case Actor3:
{
if( quest.getSeq() == Seq1 )
Scene00006( quest, player );
break;
}
case Actor4:
{
if( quest.getSeq() == Seq1 )
Scene00008( quest, player );
break;
}
}
}
void onEventItem( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override
{
switch( actorId )
{
case Actor1:
{
if( quest.getSeq() == Seq1 )
Scene00003( quest, player );
break;
}
case Actor2:
{
if( quest.getSeq() == Seq1 )
Scene00005( quest, player );
break;
}
case Actor3:
{
if( quest.getSeq() == Seq1 )
Scene00007( quest, player );
break;
}
case Actor4:
{
if( quest.getSeq() == Seq1 )
Scene00009( quest, player );
break;
}
}
}
private:
void checkQuestCompletion( World::Quest& quest, Entity::Player& player )
{
eventMgr().sendEventNotice( player, getId(), 0, 2, quest.getUI8AH(), 4 );
if( quest.getUI8AH() >= 4 )
{
quest.setUI8AH( 0 );
quest.setUI8AL( 0 );
quest.setUI8BH( 0 );
quest.setUI8BL( 0 );
quest.setUI8CH( 0 );
quest.setUI8CL( 0 );
quest.setSeq( SeqFinish );
}
}
//////////////////////////////////////////////////////////////////////
// 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( &GaiUsc909::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, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00001Return ) );
}
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq1 );
quest.setUI8CL( 4 );
}
//////////////////////////////////////////////////////////////////////
void Scene00002( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setUI8AL( 1 );
quest.setUI8AH( quest.getUI8AH() + 1 );
quest.setUI8CL( quest.getUI8CL() - 1 );
checkQuestCompletion( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00004( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00004Return ) );
}
void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00005( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00005Return ) );
}
void Scene00005Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setUI8BH( 1 );
quest.setUI8AH( quest.getUI8AH() + 1 );
quest.setUI8CL( quest.getUI8CL() - 1 );
checkQuestCompletion( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00006( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 6, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00006Return ) );
}
void Scene00006Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00007( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 7, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00007Return ) );
}
void Scene00007Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setUI8BL( 1 );
quest.setUI8AH( quest.getUI8AH() + 1 );
quest.setUI8CL( quest.getUI8CL() - 1 );
checkQuestCompletion( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00008( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 8, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00008Return ) );
}
void Scene00008Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
//////////////////////////////////////////////////////////////////////
void Scene00009( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 9, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00009Return ) );
}
void Scene00009Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setUI8CH( 1 );
quest.setUI8AH( quest.getUI8AH() + 1 );
quest.setUI8CL( quest.getUI8CL() - 1 );
checkQuestCompletion( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00010( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 10, HIDE_HOTBAR, bindSceneReturn( &GaiUsc909::Scene00010Return ) );
}
void Scene00010Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.finishQuest( getId(), result.getResult(1) );
}
}
};
EXPOSE_SCRIPT( GaiUsc909 );

View file

@ -0,0 +1,146 @@
// 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>
#include "Actor/BNpc.h"
// Quest Script: GaiUsc910_01045
// Quest Name: An Eye for Elixirs
// Quest ID: 66581
// Start NPC: 1006643
// End NPC: 1006643
using namespace Sapphire;
class GaiUsc910 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// UI8AL
// UI8BH
/// Countable Num: 0 Seq: 1 Event: 9 Listener: 182
/// Countable Num: 0 Seq: 255 Event: 9 Listener: 183
// 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 = 1006643;
static constexpr auto Enemy0 = 182;
static constexpr auto Enemy1 = 183;
static constexpr auto Enemy2 = 184;
static constexpr auto Item0 = 2000790;
public:
GaiUsc910() : Sapphire::ScriptAPI::QuestScript( 66581 ){};
~GaiUsc910() = 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;
}
}
}
void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{
switch( bnpc.getBNpcBaseId() )
{
case Enemy0:
case Enemy1:
case Enemy2:
{
quest.setUI8BH( quest.getUI8BH() + 1 );
eventMgr().sendEventNotice( player, getId(), 0, 2, quest.getUI8BH(), 2 );
if( quest.getUI8BH() >= 2 )
{
quest.setSeq( SeqFinish );
}
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( &GaiUsc910::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, HIDE_HOTBAR, bindSceneReturn( &GaiUsc910::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( &GaiUsc910::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
Scene00003( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &GaiUsc910::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.finishQuest( getId(), result.getResult(1) );
}
}
};
EXPOSE_SCRIPT( GaiUsc910 );

View file

@ -0,0 +1,129 @@
// 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: SubSea921_00699
// Quest Name: Color Your World
// Quest ID: 66235
// Start NPC: 1004990
// End NPC: 1004990
using namespace Sapphire;
class SubSea921 : public Sapphire::ScriptAPI::QuestScript
{
private:
// Basic quest information
// Quest vars / flags used
// UI8AH
/// Countable Num: 0 Seq: 255 Event: 1 Listener: 1004990
// 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 = 1004990;
static constexpr auto LocGeneralAction = 15;
static constexpr auto Ritem0 = 4745;
static constexpr auto UnlockImageDyeing = 249;
public:
SubSea921() : Sapphire::ScriptAPI::QuestScript( 66235 ){};
~SubSea921() = 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 )
{
Inventory::InventoryContainerPair pair;
if( player.findFirstItemWithId( Ritem0, pair ) )
Scene00001( quest, player );
else
Scene00003( quest, player );
}
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( &SubSea921::Scene00000Return ) );
}
void Scene00000Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )// accept quest
{
quest.setSeq( SeqFinish );
}
}
//////////////////////////////////////////////////////////////////////
void Scene00001( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 1, HIDE_HOTBAR, bindSceneReturn( &SubSea921::Scene00001Return ) );
}
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
Scene00002( quest, player );
}
//////////////////////////////////////////////////////////////////////
void Scene00002( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &SubSea921::Scene00002Return ) );
}
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if( result.getResult( 0 ) == 1 )
{
player.finishQuest( getId() );
player.collectHandInItems( { Ritem0 } );
player.setRewardFlag( Common::UnlockEntry::Dye );
}
}
//////////////////////////////////////////////////////////////////////
void Scene00003( World::Quest& quest, Entity::Player& player )
{
eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &SubSea921::Scene00003Return ) );
}
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
}
};
EXPOSE_SCRIPT( SubSea921 );