2018-08-01 01:44:53 +02:00
|
|
|
#include <Actor/Player.h>
|
|
|
|
#include <Event/EventHelper.h>
|
|
|
|
#include <ScriptObject.h>
|
|
|
|
|
|
|
|
// Quest Script: SubWil022_00395
|
|
|
|
// Quest Name: The Wealth of Nations
|
|
|
|
// Quest ID: 65931
|
|
|
|
// Start NPC: 1001657
|
|
|
|
// End NPC: 1001679
|
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
class SubWil022 :
|
|
|
|
public EventScript
|
2018-08-01 01:44:53 +02:00
|
|
|
{
|
2018-08-29 21:40:59 +02:00
|
|
|
private:
|
|
|
|
// Basic quest information
|
|
|
|
// Quest vars / flags used
|
|
|
|
// GetQuestUI8AL
|
|
|
|
// GetQuestUI8BH
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
enum Sequence :
|
|
|
|
uint8_t
|
|
|
|
{
|
|
|
|
Seq0 = 0,
|
|
|
|
SeqFinish = 255,
|
|
|
|
};
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
// Quest rewards
|
|
|
|
static constexpr auto RewardExpFactor = 50;
|
|
|
|
static constexpr auto RewardGil = 111;
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
// Entities found in the script data of the quest
|
|
|
|
static constexpr auto Actor0 = 1001657;
|
|
|
|
static constexpr auto Actor1 = 1001679;
|
|
|
|
static constexpr auto Item0 = 2000197;
|
|
|
|
static constexpr auto Seq0Actor0 = 0;
|
|
|
|
static constexpr auto Seq1Actor1 = 1;
|
|
|
|
static constexpr auto Seq1Actor1Npctradeno = 99;
|
|
|
|
static constexpr auto Seq1Actor1Npctradeok = 100;
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
public:
|
|
|
|
SubWil022() :
|
|
|
|
EventScript( 65931 )
|
|
|
|
{
|
|
|
|
};
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
~SubWil022()
|
|
|
|
{
|
|
|
|
};
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
|
|
|
{
|
|
|
|
auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
if( actor == Actor0 )
|
|
|
|
{
|
|
|
|
Scene00000( player );
|
|
|
|
}
|
|
|
|
else if( actor == Actor1 )
|
|
|
|
{
|
|
|
|
Scene00001( player );
|
|
|
|
}
|
|
|
|
}
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
private:
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
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 );
|
|
|
|
player.setQuestUI8BH( getId(), 1 );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void Scene00001( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playScene( getId(), 1, HIDE_HOTBAR,
|
|
|
|
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.param2 == 1 )
|
|
|
|
{
|
|
|
|
Scene00100( player );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Scene00099( player );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
2018-08-01 01:44:53 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void Scene00099( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playScene( getId(), 99, HIDE_HOTBAR,
|
|
|
|
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00100( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playScene( getId(), 100, HIDE_HOTBAR,
|
|
|
|
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.param2 == 1 )
|
|
|
|
{
|
|
|
|
if( player.giveQuestRewards( getId(), 0 ) )
|
|
|
|
player.finishQuest( getId() );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
2018-08-01 01:44:53 +02:00
|
|
|
};
|
|
|
|
|