// 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 #include // Quest Script: GaiUsa404_00746 // Quest Name: Back from the Wood // Quest ID: 66282 // Start NPC: 1000168 // End NPC: 1006688 using namespace Sapphire; class GaiUsa404 : public Sapphire::ScriptAPI::QuestScript { private: // Basic quest information // Quest vars / flags used // UI8AL /// Countable Num: 0 Seq: 1 Event: 1 Listener: 1003785 /// Countable Num: 0 Seq: 2 Event: 15 Listener: 5020000 /// Countable Num: 0 Seq: 255 Event: 1 Listener: 1006688 // 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 = 1000168;//Vorsaie Heuloix static constexpr auto Actor1 = 1003785;//Tataru static constexpr auto Actor2 = 1006688;//Minfilia static constexpr auto CutGaiusa40410 = 96; static constexpr auto LocAction1 = 1002; static constexpr auto LocActor0 = 1003783; static constexpr auto LocSe1 = 42; static constexpr auto LocTalkshape1 = 6; static constexpr auto Territorytype0 = 212; static constexpr auto AchievementCompleteQuest = 783; //Back form the Wood public: GaiUsa404() : Sapphire::ScriptAPI::QuestScript( 66282 ){}; ~GaiUsa404() = 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 ); break; } case Actor2: { if( quest.getSeq() == SeqFinish ) Scene00004( quest, player ); break; } } } void onEnterTerritory( World::Quest& quest, Entity::Player& player, uint16_t param1, uint16_t param2 ) override { //onEnterTerritory only gets called when entering the waking sands and both params are 0 soooo just trusting that to always be true if( quest.getSeq() == Seq2 ) { Scene00003( quest, player ); } } private: ////////////////////////////////////////////////////////////////////// // Available Scenes in this quest, not necessarly all are used ////////////////////////////////////////////////////////////////////// void Scene00000( World::Quest& quest, Entity::Player& player ) { eventMgr().playQuestScene( player, getId(), 0, HIDE_HOTBAR, bindSceneReturn( &GaiUsa404::Scene00000Return ) ); } void Scene00000Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { if( result.getResult( 0 ) == 1 )// accept quest { Scene00001( quest, player ); } } ////////////////////////////////////////////////////////////////////// void Scene00001( World::Quest& quest, Entity::Player& player ) { eventMgr().playQuestScene( player, getId(), 1, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &GaiUsa404::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( &GaiUsa404::Scene00002Return ) ); } void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { eventMgr().sendEventNotice( player, getId(), 0, 0 ); quest.setSeq( Seq2 ); } ////////////////////////////////////////////////////////////////////// void Scene00003( World::Quest& quest, Entity::Player& player ) { eventMgr().playQuestScene( player, getId(), 3, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &GaiUsa404::Scene00003Return ) ); } void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { eventMgr().sendEventNotice( player, getId(), 1, 0 ); quest.setSeq( SeqFinish ); } ////////////////////////////////////////////////////////////////////// void Scene00004( World::Quest& quest, Entity::Player& player ) { eventMgr().playQuestScene( player, getId(), 4, HIDE_HOTBAR, bindSceneReturn( &GaiUsa404::Scene00004Return ) ); } void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { if( result.getResult( 0 ) == 1 ) { player.finishQuest( getId() ); } } }; EXPOSE_SCRIPT( GaiUsa404 );