#include #include #include // Quest Script: SubWil001_00150 // Quest Name: Motivational Speaking // Quest ID: 65686 // Start NPC: 1001287 // End NPC: 1001288 class SubWil001 : public EventScript { private: // Basic quest information // Quest vars / flags used // GetQuestUI8AL enum Sequence : uint8_t { Seq0 = 0, SeqFinish = 255, }; // Quest rewards static constexpr auto RewardExpFactor = 50; static constexpr auto RewardItem = 4551; static constexpr auto RewardItemCount = 2; // Entities found in the script data of the quest static constexpr auto Actor0 = 1001287; static constexpr auto Actor1 = 1001288; static constexpr auto Seq0Actor0 = 0; static constexpr auto Seq1Actor1 = 1; public: SubWil001() : EventScript( 65686 ) { }; ~SubWil001() { }; void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override { auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) ); if( actor == Actor0 ) { Scene00000( player ); } else if( actor == Actor1 ) { Scene00001( player ); } } private: void Scene00000( Entity::Player& player ) { player.playScene( getId(), 0, HIDE_HOTBAR, [ & ]( Entity::Player& player, const Event::SceneResult& result ) { if( result.param2 == 1 ) { player.updateQuest( getId(), SeqFinish ); } } ); } void Scene00001( Entity::Player& player ) { player.playScene( getId(), 1, HIDE_HOTBAR, [ & ]( Entity::Player& player, const Event::SceneResult& result ) { if( result.param2 == 1 ) { if( player.giveQuestRewards( getId(), 0 ) ) { player.finishQuest( getId() ); } } } ); } };