2018-08-04 03:56:46 +02:00
|
|
|
#include <Actor/Player.h>
|
2018-12-23 03:53:08 +01:00
|
|
|
#include <Manager/EventMgr.h>
|
2018-08-04 03:56:46 +02:00
|
|
|
#include <ScriptObject.h>
|
2018-12-23 03:53:08 +01:00
|
|
|
#include "Framework.h"
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
using namespace Sapphire;
|
2018-10-28 21:53:21 +01:00
|
|
|
|
2018-08-04 03:56:46 +02:00
|
|
|
// Quest Script: SubWil028_00389
|
|
|
|
// Quest Name: Fantastic Voyage
|
|
|
|
// Quest ID: 65925
|
|
|
|
// Start NPC: 1001678
|
|
|
|
// End NPC: 1001497
|
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
class SubWil028 :
|
2018-11-13 21:34:44 +11:00
|
|
|
public Sapphire::ScriptAPI::EventScript
|
2018-08-04 03:56:46 +02:00
|
|
|
{
|
2018-08-29 21:40:59 +02:00
|
|
|
private:
|
|
|
|
// Basic quest information
|
|
|
|
// Quest vars / flags used
|
|
|
|
// GetQuestUI8AL
|
|
|
|
// GetQuestUI8BH
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
enum Sequence :
|
|
|
|
uint8_t
|
|
|
|
{
|
|
|
|
Seq0 = 0,
|
|
|
|
SeqFinish = 255,
|
|
|
|
};
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
// Quest rewards
|
|
|
|
static constexpr auto RewardExpFactor = 100;
|
|
|
|
static constexpr auto RewardGil = 122;
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
// Entities found in the script data of the quest
|
|
|
|
static constexpr auto Actor0 = 1001678;
|
|
|
|
static constexpr auto Actor1 = 1001497;
|
|
|
|
static constexpr auto Item0 = 2000241;
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
public:
|
|
|
|
SubWil028() :
|
2018-11-13 21:34:44 +11:00
|
|
|
Sapphire::ScriptAPI::EventScript( 65925 )
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
|
|
|
};
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
~SubWil028()
|
|
|
|
{
|
|
|
|
};
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
|
|
|
{
|
2018-12-23 03:53:08 +01:00
|
|
|
auto pEventMgr = m_framework->get< World::Manager::EventMgr >();
|
|
|
|
auto actor = pEventMgr->mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
if( actor == Actor0 )
|
|
|
|
{
|
|
|
|
Scene00000( player );
|
|
|
|
}
|
|
|
|
else if( actor == Actor1 )
|
|
|
|
{
|
|
|
|
Scene00001( player );
|
|
|
|
}
|
|
|
|
}
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
private:
|
2018-08-04 03:56:46 +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-04 03:56:46 +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 )
|
|
|
|
{
|
|
|
|
Scene00002( player );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Scene00003( player );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
2018-08-04 03:56:46 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void Scene00002( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playScene( getId(), 2, HIDE_HOTBAR,
|
|
|
|
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
if( result.param2 == 1 )
|
|
|
|
{
|
|
|
|
if( player.giveQuestRewards( getId(), 0 ) )
|
|
|
|
{
|
|
|
|
player.finishQuest( getId() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene00003( Entity::Player& player )
|
|
|
|
{
|
|
|
|
player.playScene( getId(), 3, HIDE_HOTBAR,
|
|
|
|
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
|
|
|
{
|
|
|
|
} );
|
|
|
|
}
|
2018-08-04 03:56:46 +02:00
|
|
|
};
|
|
|
|
|
2019-02-20 17:38:03 +11:00
|
|
|
EXPOSE_SCRIPT( SubWil028 );
|