1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-06-05 23:57:46 +00:00

[MSQ] SubFst045 + SubSea051 added with a little fix for ManSea001

This commit is contained in:
Dantestyle 2018-09-01 16:52:17 +02:00
parent 4946d18583
commit 63ef3bafbd
3 changed files with 179 additions and 1 deletions

View file

@ -70,7 +70,14 @@ private:
void Scene00005( Entity::Player& player )
{
player.playSceneChain( getId(), 5, HIDE_HOTBAR, bindScene( &ManSea001::Scene00006 ) );
player.playScene( getId(), 5, HIDE_HOTBAR,
[ & ]( Entity::Player& player, const Event::SceneResult& result)
{
if( result.param2 == 1 )
{
Scene00006( player );
}
} );
}
void Scene00006( Entity::Player& player )

View file

@ -0,0 +1,85 @@
#include <Script/NativeScriptApi.h>
#include <Actor/Player.h>
#include "Event/EventHelper.h"
#include <ScriptObject.h>
// Quest Script: SubFst045_00201
// Quest Name: Passing Muster
// Quest ID: 65737
// Start NPC: 1000421
// End NPC: 1000421
class SubFst045 :
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 = 200;
static constexpr auto RewardGil = 128;
// Entities found in the script data of the quest
static constexpr auto Actor0 = 1000421;
static constexpr auto Seq0Actor0 = 0;
static constexpr auto Seq1Actor0 = 1;
public:
SubFst045() :
EventScript( 65737 )
{
};
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
if( actor == Actor0 && !player.hasQuest( getId() ) )
{
Scene00000( player );
}
else
{
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() );
}
}
} );
}
};

View file

@ -0,0 +1,86 @@
#include <Actor/Player.h>
#include <Event/EventHelper.h>
#include <ScriptObject.h>
// Quest Script: SubSea051_00463
// Quest Name: Dressed to Call
// Quest ID: 65999
// Start NPC: 1002626
// End NPC: 1002626
class SubSea051 :
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 = 200;
static constexpr auto RewardGil = 161;
uint16_t RewardItemOptional[4] = { 1750, 2143, 9184, 5824 };
uint16_t RewardItemOptionalCount[4] = { 1, 1, 1, 1 };
// Entities found in the script data of the quest
static constexpr auto Actor0 = 1002626;
static constexpr auto Seq0Actor0 = 0;
static constexpr auto Seq1Actor0 = 1;
public:
SubSea051() :
EventScript( 65999 )
{
};
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
if( actor == Actor0 && !player.hasQuest( getId() ) )
{
Scene00000( player );
}
else
{
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() );
}
}
} );
}
};