1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 07:37:45 +00:00

Update SubFst002.cpp

removed unneeded space
This commit is contained in:
Mordred 2018-01-05 18:21:49 +01:00 committed by GitHub
parent 4a6fa2e9da
commit 7abc33c930

View file

@ -1,38 +1,38 @@
#include "../../../ScriptObject.h" #include "../../../ScriptObject.h"
// Quest Script: SubFst002_00025 // Quest Script: SubFst002_00025
// Quest Name: Quarrels with Squirrels // Quest Name: Quarrels with Squirrels
// Quest ID: 65561 // Quest ID: 65561
// Start NPC: 1000263 // Start NPC: 1000263
// End NPC: 1000263 // End NPC: 1000263
class SubFst002 : public EventScript class SubFst002 : public EventScript
{ {
private: private:
static constexpr auto SEQ_0 = 0; static constexpr auto SEQ_0 = 0;
static constexpr auto SEQ_1 = 1; static constexpr auto SEQ_1 = 1;
static constexpr auto SEQ_2 = 2; static constexpr auto SEQ_2 = 2;
static constexpr auto SEQ_FINISH = 255; static constexpr auto SEQ_FINISH = 255;
static constexpr auto ACTOR0 = 1000263; static constexpr auto ACTOR0 = 1000263;
static constexpr auto ENEMY0 = 37; static constexpr auto ENEMY0 = 37;
static constexpr auto SEQ_0_ACTOR0 = 0; static constexpr auto SEQ_0_ACTOR0 = 0;
static constexpr auto SEQ_2_ACTOR0 = 1; static constexpr auto SEQ_2_ACTOR0 = 1;
void Scene00000( Entity::Player& player ) void Scene00000( Entity::Player& player )
{ {
auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{ {
if( param2 == 1 ) // accept quest if( param2 == 1 ) // accept quest
{ {
player.updateQuest( getId(), SEQ_1 ); player.updateQuest( getId(), SEQ_1 );
} }
}; };
player.eventPlay( getId (), 0, NONE, callback ); player.eventPlay( getId (), 0, NONE, callback );
} }
void Scene00001(Entity::Player& player) void Scene00001(Entity::Player& player)
{ {
auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{ {
if( param2 == 1 ) // finish quest if( param2 == 1 ) // finish quest
@ -40,24 +40,24 @@ private:
if( player.giveQuestRewards( getId(), 0 ) ) if( player.giveQuestRewards( getId(), 0 ) )
player.finishQuest( getId() ); player.finishQuest( getId() );
} }
}; };
player.eventPlay( getId (), 1, NONE, callback ); player.eventPlay( getId(), 1, NONE, callback );
} }
public: public:
SubFst002() : EventScript( "SubFst002", 65561 ) {} SubFst002() : EventScript( "SubFst002", 65561 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {
auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) ); auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
if( actor == ACTOR0 && !player.hasQuest( getId() ) ) if( actor == ACTOR0 && !player.hasQuest( getId() ) )
Scene00000( player ); Scene00000( player );
else if( actor == ACTOR0 && player.getQuestSeq( getId() ) == SEQ_FINISH ) else if( actor == ACTOR0 && player.getQuestSeq( getId() ) == SEQ_FINISH )
Scene00001( player ); Scene00001( player );
} }
void onNpcKill( uint32_t npcId, Entity::Player& player ) override void onNpcKill( uint32_t npcId, Entity::Player& player ) override
{ {
if( npcId != ENEMY0 ) if( npcId != ENEMY0 )
@ -72,5 +72,5 @@ public:
player.setQuestUI8AL( getId(), currentKC ); player.setQuestUI8AL( getId(), currentKC );
player.sendQuestMessage( getId(), 0, 2, currentKC, 6 ); player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
} }
} }
}; };