// 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: ClsHrv100_00208 // Quest Name: My First Hatchet // Quest ID: 65744 // Start NPC: 1000815 // End NPC: 1000815 using namespace Sapphire; class ClsHrv100 : public Sapphire::ScriptAPI::QuestScript { private: // Basic quest information // Quest vars / flags used // UI8AH /// Countable Num: 1 Seq: 255 Event: 1 Listener: 1000815 // 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 = 1000815;//Fufucha static constexpr auto LocAction1 = 990; static constexpr auto LocActor0 = 1004089; static constexpr auto LocEobj1 = 2000701; static constexpr auto LocPosActor1 = 3693827; static constexpr auto LocPosActor2 = 3693847; static constexpr auto LocPosCam1 = 3693831; static constexpr auto LocPosEobj1 = 3693820; static constexpr auto LocPosStand = 3852694; static constexpr auto LocStand = 2001079; static constexpr auto Ritem0 = 5509; public: ClsHrv100() : Sapphire::ScriptAPI::QuestScript( 65744 ){}; ~ClsHrv100() = 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; } } } 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( &ClsHrv100::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, NONE, bindSceneReturn( &ClsHrv100::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, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, bindSceneReturn( &ClsHrv100::Scene00002Return ) ); } void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { if( result.getResult( 0 ) == 1 ) { player.finishQuest( getId() ); player.collectHandInItems( { Ritem0 } ); } } ////////////////////////////////////////////////////////////////////// void Scene00003( World::Quest& quest, Entity::Player& player ) { eventMgr().playQuestScene( player, getId(), 3, NONE, bindSceneReturn( &ClsHrv100::Scene00003Return ) ); } void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { } }; EXPOSE_SCRIPT( ClsHrv100 );