diff --git a/src/scripts/quest/subquest/gridania/SubFst002.cpp b/src/scripts/quest/subquest/gridania/SubFst002.cpp new file mode 100644 index 00000000..f881688f --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst002.cpp @@ -0,0 +1,117 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst002_00025 +// Quest Name: Quarrels with Squirrels +// Quest ID: 65561 +// Start NPC: 1000263 +// End NPC: 1000263 + +using namespace Sapphire; + +class SubFst002 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + + /// Countable Num: 10 Seq: 1 Event: 5 Listener: 37 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000263 + // 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 = 1000263; + static constexpr auto Enemy0 = 37; + static constexpr auto Seq0Actor0 = 0; + static constexpr auto Seq2Actor0 = 1; + +public: + SubFst002() : Sapphire::ScriptAPI::QuestScript( 65561 ){}; + ~SubFst002() = 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 ) + Scene00001( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + if( nameId != Enemy0 ) + return; + + auto currentKC = quest.getUI8AL() + 1; + + if( currentKC >= 6 ) + { + eventMgr().sendEventNotice( player, getId(), 0, 2, 6, 6 ); + quest.setSeq( SeqFinish ); + } + else + { + quest.setUI8AL( currentKC ); + eventMgr().sendEventNotice( player, getId(), 0, 2, currentKC, 6 ); + } + } + +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( &SubFst002::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( &SubFst002::Scene00001Return ) ); + } + + void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } +}; + +EXPOSE_SCRIPT( SubFst002 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/gridania/SubFst007.cpp b/src/scripts/quest/subquest/gridania/SubFst007.cpp new file mode 100644 index 00000000..21d2e178 --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst007.cpp @@ -0,0 +1,151 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst007_00031 +// Quest Name: Essential Oil +// Quest ID: 65567 +// Start NPC: 1000705 +// End NPC: 1000705 + +using namespace Sapphire; + +class SubFst007 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + // UI8BH + + /// Countable Num: 6 Seq: 1 Event: 9 Listener: 49 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000705 + // 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 = 1000705; + static constexpr auto Enemy0 = 49; + static constexpr auto Item0 = 2000098; + static constexpr auto Seq0Actor0 = 0; + static constexpr auto Seq2Actor0 = 1; + static constexpr auto Seq2Actor0Npctradeno = 99; + static constexpr auto Seq2Actor0Npctradeok = 100; + +public: + SubFst007() : Sapphire::ScriptAPI::QuestScript( 65567 ){}; + ~SubFst007() = default; + + ////////////////////////////////////////////////////////////////////// + // Event Handlers + void onTalk( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override + { + switch( actorId ) + { + case Actor0: + { + if( !player.hasQuest( getId() ) ) + Scene00000( quest, player ); + else if( quest.getSeq() == SeqFinish ) + Scene00001( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + if( nameId != Enemy0 ) + return; + + auto currentKC = quest.getUI8AL(); + + if( currentKC + 1 >= 6 ) + { + quest.setUI8AL( currentKC + 1 ); + quest.setUI8BH( currentKC + 1 ); + eventMgr().sendEventNotice( player, getId(), 0, 2, currentKC + 1, 6 ); + quest.setSeq( SeqFinish ); + } + else + { + eventMgr().sendEventNotice( player, getId(), 0, 2, currentKC + 1, 6 ); + quest.setUI8AL( currentKC + 1 ); + quest.setUI8BH( currentKC + 1 ); + } + } + +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( &SubFst007::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, HIDE_HOTBAR, bindSceneReturn( &SubFst007::Scene00001Return ) ); + } + + void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + if( result.getResult( 0 ) == 1 ) + Scene00100( quest, player ); + else + Scene00099( quest, player ); + } + + ////////////////////////////////////////////////////////////////////// + + void Scene00099( World::Quest& quest, Entity::Player& player ) + { + eventMgr().playQuestScene( player, getId(), 99, HIDE_HOTBAR, bindSceneReturn( &SubFst007::Scene00099Return ) ); + } + + void Scene00099Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + //Empty + } + + ////////////////////////////////////////////////////////////////////// + + void Scene00100( World::Quest& quest, Entity::Player& player ) + { + eventMgr().playQuestScene( player, getId(), 100, HIDE_HOTBAR, bindSceneReturn( &SubFst007::Scene00100Return ) ); + } + + void Scene00100Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } +}; + +EXPOSE_SCRIPT( SubFst007 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/gridania/SubFst011.cpp b/src/scripts/quest/subquest/gridania/SubFst011.cpp new file mode 100644 index 00000000..68699a46 --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst011.cpp @@ -0,0 +1,113 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst011_00037 +// Quest Name: Population Control +// Quest ID: 65573 +// Start NPC: 1000195 +// End NPC: 1000195 + +using namespace Sapphire; + +class SubFst011 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + + /// Countable Num: 10 Seq: 1 Event: 5 Listener: 47 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000195 + // 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 = 1000195; + static constexpr auto Enemy0 = 47; + static constexpr auto Seq0Actor0 = 0; + static constexpr auto Seq2Actor0 = 1; + +public: + SubFst011() : Sapphire::ScriptAPI::QuestScript( 65573 ){}; + ~SubFst011() = default; + + ////////////////////////////////////////////////////////////////////// + // Event Handlers + void onTalk( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override + { + switch( actorId ) + { + case Actor0: + { + if( !player.hasQuest( getId() ) ) + Scene00000( quest, player ); + else if( quest.getSeq() == SeqFinish ) + Scene00001( quest, player ); + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + switch( nameId ) + { + case Enemy0: + { + auto currentKC = quest.getUI8AL(); + quest.setUI8AL( currentKC + 1 ); + eventMgr().sendEventNotice( player, getId(), 0, 2, currentKC + 1, 6 ); + + if( currentKC + 1 >= 6 ) + quest.setSeq( SeqFinish ); + } + } + } + +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( &SubFst011::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, HIDE_HOTBAR, bindSceneReturn( &SubFst011::Scene00001Return ) ); + } + + void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } +}; + +EXPOSE_SCRIPT( SubFst011 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/gridania/SubFst021.cpp b/src/scripts/quest/subquest/gridania/SubFst021.cpp new file mode 100644 index 00000000..9e9a3a3b --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst021.cpp @@ -0,0 +1,127 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst021_00095 +// Quest Name: Hematophagic Harassment +// Quest ID: 65631 +// Start NPC: 1000640 +// End NPC: 1000640 + +using namespace Sapphire; + +class SubFst021 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + + /// Countable Num: 6 Seq: 1 Event: 5 Listener: 136 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000640 + // 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 = 1000640; + static constexpr auto Enemy0 = 118;//136; <- WRONG INFO + +public: + SubFst021() : Sapphire::ScriptAPI::QuestScript( 65631 ){}; + ~SubFst021() = default; + + ////////////////////////////////////////////////////////////////////// + // Event Handlers + void onTalk( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override + { + switch( actorId ) + { + case Actor0: + { + if( !player.hasQuest( getId() ) ) + Scene00000( quest, player ); + else if( quest.getSeq() == SeqFinish ) + Scene00002( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + if( nameId != Enemy0 ) + return; + + auto credit = quest.getUI8AL(); + if( credit + 1 >= 6 ) + { + quest.setUI8AL( credit + 1 ); + eventMgr().sendEventNotice( player, getId(), 0, 2, credit + 1, 6 ); + quest.setSeq( SeqFinish ); + } + else + { + quest.setUI8AL( credit + 1 ); + eventMgr().sendEventNotice( player, getId(), 0, 2, credit + 1, 6 ); + } + } + +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( &SubFst021::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( &SubFst021::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( &SubFst021::Scene00002Return ) ); + } + + void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } +}; + +EXPOSE_SCRIPT( SubFst021 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/gridania/SubFst025.cpp b/src/scripts/quest/subquest/gridania/SubFst025.cpp new file mode 100644 index 00000000..18615b7f --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst025.cpp @@ -0,0 +1,161 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst025_00103 +// Quest Name: Death to the Bean Thieves +// Quest ID: 65639 +// Start NPC: 1000627 +// End NPC: 1000656 + +using namespace Sapphire; + +class SubFst025 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + // UI8BH + + /// Countable Num: 6 Seq: 1 Event: 9 Listener: 5 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000656 + // 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 = 1000627; + static constexpr auto Actor1 = 1000656; + static constexpr auto Enemy0 = 5; + static constexpr auto Item0 = 2000075; + +public: + SubFst025() : Sapphire::ScriptAPI::QuestScript( 65639 ){}; + ~SubFst025() = 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 ) + Scene00002( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + if( nameId != Enemy0 ) + return; + + auto credit = quest.getUI8AL(); + + if( credit + 1 >= 6 ) + { + eventMgr().sendEventNotice( player, getId(), 0, 2, credit + 1, 6 ); + quest.setUI8BH( credit + 1 ); + quest.setSeq( SeqFinish ); + } + else + { + quest.setUI8AL( credit + 1 ); + quest.setUI8BH( credit + 1 ); + eventMgr().sendEventNotice( player, getId(), 0, 2, credit + 1, 6 ); + } + } + +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( &SubFst025::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( &SubFst025::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( &SubFst025::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( &SubFst025::Scene00003Return ) ); + } + + void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } + + ////////////////////////////////////////////////////////////////////// + + void Scene00004( World::Quest& quest, Entity::Player& player ) + { + eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &SubFst025::Scene00004Return ) ); + } + + void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + //Empty + } +}; + +EXPOSE_SCRIPT( SubFst025 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/gridania/SubFst026.cpp b/src/scripts/quest/subquest/gridania/SubFst026.cpp new file mode 100644 index 00000000..252050b5 --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst026.cpp @@ -0,0 +1,117 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst026_00170 +// Quest Name: Jumping at Shadows +// Quest ID: 65706 +// Start NPC: 1000629 +// End NPC: 1000629 + +using namespace Sapphire; + +class SubFst026 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + + /// Countable Num: 6 Seq: 1 Event: 5 Listener: 9 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000629 + // 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 = 1000629; + static constexpr auto Enemy0 = 9; + static constexpr auto Seq0Actor0 = 0; + static constexpr auto Seq2Actor0 = 1; + +public: + SubFst026() : Sapphire::ScriptAPI::QuestScript( 65706 ){}; + ~SubFst026() = 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 ) + Scene00001( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + if( nameId != Enemy0 ) + return; + + auto currentKC = quest.getUI8AL(); + + if( currentKC + 1 >= 6 ) + { + eventMgr().sendEventNotice( player, getId(), 0, 2, currentKC + 1, 6 ); + quest.setSeq( SeqFinish ); + } + else + { + quest.setUI8AL( currentKC + 1 ); + eventMgr().sendEventNotice( player, getId(), 0, 2, currentKC + 1, 6 ); + } + } + +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( &SubFst026::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( &SubFst026::Scene00001Return ) ); + } + + void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId() ); + } + } +}; + +EXPOSE_SCRIPT( SubFst026 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/gridania/SubFst037.cpp b/src/scripts/quest/subquest/gridania/SubFst037.cpp new file mode 100644 index 00000000..70a63769 --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst037.cpp @@ -0,0 +1,164 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst037_00174 +// Quest Name: No Quarter Given +// Quest ID: 65710 +// Start NPC: 1000612 +// End NPC: 1000612 + +using namespace Sapphire; + +class SubFst037 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + // UI8BH + // UI8BL + + /// Countable Num: 2 Seq: 1 Event: 5 Listener: 743 + /// Countable Num: 2 Seq: 1 Event: 5 Listener: 744 + /// Countable Num: 2 Seq: 1 Event: 5 Listener: 745 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000612 + // 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 = 1000612; + static constexpr auto Enemy0 = 192;//743; <- WRONG INFO + static constexpr auto Enemy1 = 193;//744; <- WRONG INFO + static constexpr auto Enemy2 = 194;//745; <- WRONG INFO + +public: + SubFst037() : Sapphire::ScriptAPI::QuestScript( 65710 ){}; + ~SubFst037() = default; + + ////////////////////////////////////////////////////////////////////// + // Event Handlers + void onTalk( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override + { + switch( actorId ) + { + case Actor0: + { + if( !player.hasQuest( getId() ) ) + Scene00000( quest, player ); + else if( quest.getSeq() == SeqFinish ) + Scene00002( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + auto credit = 0; + + switch( nameId ) + { + case Enemy0: + { + credit = quest.getUI8AL(); + + quest.setUI8AL( credit + 1 ); + if( credit + 1 <= 2 ) + eventMgr().sendEventNotice( player, getId(), 0, 2, credit + 1, 2 ); + + break; + } + case Enemy1: + { + credit = quest.getUI8BH(); + + quest.setUI8BH( credit + 1 ); + if( credit + 1 <= 2 ) + eventMgr().sendEventNotice( player, getId(), 1, 2, credit + 1, 2 ); + + break; + } + case Enemy2: + { + credit = quest.getUI8BL(); + + quest.setUI8BL( credit + 1 ); + if( credit + 1 <= 2 ) + eventMgr().sendEventNotice( player, getId(), 2, 2, credit + 1, 2 ); + + break; + } + } + + checkQuestCompletion( quest, player ); + } + +private: + void checkQuestCompletion( World::Quest& quest, Entity::Player& player ) + { + auto credit192 = quest.getUI8AL(); + auto credit193 = quest.getUI8BH(); + auto credit194 = quest.getUI8BL(); + + if( credit192 >= 2 && credit193 >= 2 && credit194 >= 2 ) + 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, NONE, bindSceneReturn( &SubFst037::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( &SubFst037::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( &SubFst037::Scene00002Return ) ); + } + + void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } +}; + +EXPOSE_SCRIPT( SubFst037 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/gridania/SubFst039.cpp b/src/scripts/quest/subquest/gridania/SubFst039.cpp new file mode 100644 index 00000000..1f341728 --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst039.cpp @@ -0,0 +1,114 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst039_00196 +// Quest Name: An Eft for Effort +// Quest ID: 65732 +// Start NPC: 1000421 +// End NPC: 1000421 + +using namespace Sapphire; + +class SubFst039 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + + /// Countable Num: 4 Seq: 1 Event: 5 Listener: 160 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000421 + // 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 = 1000421; + static constexpr auto Enemy0 = 196; //Incorrect: 160 + static constexpr auto Seq0Actor0 = 0; + static constexpr auto Seq2Actor0 = 1; + +public: + SubFst039() : Sapphire::ScriptAPI::QuestScript( 65732 ){}; + ~SubFst039() = 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 ) + Scene00001( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + if( nameId != Enemy0 ) + return; + + auto currentKC = quest.getUI8AL() + 1; + + if( currentKC >= 4 ) + quest.setSeq( SeqFinish ); + else + { + quest.setUI8AL( currentKC ); + } + eventMgr().sendEventNotice( player, getId(), 0, 2, currentKC, 4 ); + } + +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( &SubFst039::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, HIDE_HOTBAR, bindSceneReturn( &SubFst039::Scene00001Return ) ); + } + + void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } +}; + +EXPOSE_SCRIPT( SubFst039 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/gridania/SubFst041.cpp b/src/scripts/quest/subquest/gridania/SubFst041.cpp new file mode 100644 index 00000000..3c6a606e --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst041.cpp @@ -0,0 +1,155 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst041_00197 +// Quest Name: Splitting Shells +// Quest ID: 65733 +// Start NPC: 1000432 +// End NPC: 1000411 + +using namespace Sapphire; + +class SubFst041 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + // UI8BH + + /// Countable Num: 4 Seq: 1 Event: 9 Listener: 159 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000411 + // 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 = 1000432; + static constexpr auto Actor1 = 1000411; + static constexpr auto Enemy0 = 197;//Incorrect: 159 + static constexpr auto Item0 = 2000142; + static constexpr auto Seq0Actor0 = 0; + static constexpr auto Seq2Actor1 = 1; + static constexpr auto Seq2Actor1Npctradeno = 99; + static constexpr auto Seq2Actor1Npctradeok = 100; + +public: + SubFst041() : Sapphire::ScriptAPI::QuestScript( 65733 ){}; + ~SubFst041() = default; + + ////////////////////////////////////////////////////////////////////// + // Event Handlers + void onTalk( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override + { + switch( actorId ) + { + case Actor0: + { + Scene00000( quest, player ); + break; + } + case Actor1: + { + Scene00001( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + if( nameId != Enemy0 ) + return; + + auto currentKC = quest.getUI8BH(); + + if( currentKC + 1 >= 4 ) + { + quest.setUI8AL( currentKC + 1 ); + quest.setUI8BH( currentKC + 1 ); + eventMgr().sendEventNotice( player, getId(), 1, 0, 0, 0 ); + quest.setSeq( SeqFinish ); + } + else + { + quest.setUI8AL( currentKC + 1 ); + quest.setUI8BH( currentKC + 1 ); + eventMgr().sendEventNotice( player, getId(), 0, 2, currentKC + 1, 4 ); + } + } + +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( &SubFst041::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, HIDE_HOTBAR, bindSceneReturn( &SubFst041::Scene00001Return ) ); + } + + void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + if( result.getResult( 0 ) == 1 ) + Scene00100( quest, player ); + else + Scene00099( quest, player ); + } + + ////////////////////////////////////////////////////////////////////// + + void Scene00099( World::Quest& quest, Entity::Player& player ) + { + eventMgr().playQuestScene( player, getId(), 99, HIDE_HOTBAR, bindSceneReturn( &SubFst041::Scene00099Return ) ); + } + + void Scene00099Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + //TODO: What do I replace this with? + //player.playScene(getId(), 99, 0, 0, 0); + } + + ////////////////////////////////////////////////////////////////////// + + void Scene00100( World::Quest& quest, Entity::Player& player ) + { + eventMgr().playQuestScene( player, getId(), 100, HIDE_HOTBAR, bindSceneReturn( &SubFst041::Scene00100Return ) ); + } + + void Scene00100Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } +}; + +EXPOSE_SCRIPT( SubFst041 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/gridania/SubFst042.cpp b/src/scripts/quest/subquest/gridania/SubFst042.cpp new file mode 100644 index 00000000..57c99dfe --- /dev/null +++ b/src/scripts/quest/subquest/gridania/SubFst042.cpp @@ -0,0 +1,114 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubFst042_00198 +// Quest Name: Butcher of Greentear +// Quest ID: 65734 +// Start NPC: 1000685 +// End NPC: 1000685 + +using namespace Sapphire; + +class SubFst042 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + + /// Countable Num: 6 Seq: 1 Event: 5 Listener: 14 + /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000685 + // 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 = 1000685; + static constexpr auto Enemy0 = 195;//Incorrect: 14 + static constexpr auto Seq0Actor0 = 0; + static constexpr auto Seq2Actor0 = 1; + +public: + SubFst042() : Sapphire::ScriptAPI::QuestScript( 65734 ){}; + ~SubFst042() = 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 ) + Scene00001( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + if( nameId != Enemy0 ) + return; + + auto currentKC = quest.getUI8AL() + 1; + + if( currentKC >= 6 ) + quest.setSeq( SeqFinish ); + else + { + quest.setUI8AL( currentKC ); + eventMgr().sendEventNotice( player, getId(), 0, 2, currentKC, 6 ); + } + } + +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( &SubFst042::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( &SubFst042::Scene00001Return ) ); + } + + void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } +}; + +EXPOSE_SCRIPT( SubFst042 ); \ No newline at end of file diff --git a/src/scripts/quest/subquest/limsa/SubSea012.cpp b/src/scripts/quest/subquest/limsa/SubSea012.cpp new file mode 100644 index 00000000..59016828 --- /dev/null +++ b/src/scripts/quest/subquest/limsa/SubSea012.cpp @@ -0,0 +1,163 @@ +// 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 /scripts/ + +#include "Manager/EventMgr.h" +#include +#include +#include + +// Quest Script: SubSea012_00122 +// Quest Name: Glory Days +// Quest ID: 65658 +// Start NPC: 1003601 +// End NPC: 1000972 + +using namespace Sapphire; + +class SubSea012 : public Sapphire::ScriptAPI::QuestScript +{ +private: + // Basic quest information + // Quest vars / flags used + // UI8AL + // UI8BH + + /// Countable Num: 1 Seq: 1 Event: 1 Listener: 1001024 + /// Countable Num: 1 Seq: 2 Event: 9 Listener: 324 + /// Countable Num: 0 Seq: 255 Event: 1 Listener: 1000972 + // 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, + SeqFinish = 255, + }; + + // Entities found in the script data of the quest + static constexpr auto Actor0 = 1003601; + static constexpr auto Actor1 = 1001024; + static constexpr auto Actor2 = 1000972; + static constexpr auto Enemy0 = 324; + static constexpr auto Item0 = 2000454; + +public: + SubSea012() : Sapphire::ScriptAPI::QuestScript( 65658 ){}; + ~SubSea012() = default; + + ////////////////////////////////////////////////////////////////////// + // Event Handlers + void onTalk( World::Quest& quest, Entity::Player& player, uint64_t actorId ) override + { + switch( actorId ) + { + case Actor0: + { + Scene00000( quest, player ); + break; + } + case Actor1: + { + Scene00002( quest, player ); + break; + } + case Actor2: + { + Scene00003( quest, player ); + break; + } + } + } + + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ) override + { + if( nameId != Enemy0 ) + return; + + auto currentKC = quest.getUI8AL() + 1; + quest.setUI8BH( currentKC ); + quest.setUI8AL( currentKC ); + + if( currentKC >= 4 ) + quest.setSeq( SeqFinish ); + else + eventMgr().sendEventNotice( player, getId(), 1, 2, currentKC, 4 ); + } + +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( &SubSea012::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, HIDE_HOTBAR, bindSceneReturn( &SubSea012::Scene00001Return ) ); + } + + void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + //Empty + } + + ////////////////////////////////////////////////////////////////////// + + void Scene00002( World::Quest& quest, Entity::Player& player ) + { + eventMgr().playQuestScene( player, getId(), 2, HIDE_HOTBAR, bindSceneReturn( &SubSea012::Scene00002Return ) ); + } + + void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + quest.setSeq( Seq2 ); + } + + ////////////////////////////////////////////////////////////////////// + + void Scene00003( World::Quest& quest, Entity::Player& player ) + { + eventMgr().playQuestScene( player, getId(), 3, HIDE_HOTBAR, bindSceneReturn( &SubSea012::Scene00003Return ) ); + } + + void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + if( result.getResult( 0 ) == 1 ) + { + Scene00004( quest, player ); + } + } + + ////////////////////////////////////////////////////////////////////// + + void Scene00004( World::Quest& quest, Entity::Player& player ) + { + eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &SubSea012::Scene00004Return ) ); + } + + void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) + { + + if( result.getResult( 0 ) == 1 ) + { + player.finishQuest( getId(), result.getResult( 1 ) ); + } + } +}; + +EXPOSE_SCRIPT( SubSea012 ); \ No newline at end of file