mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 14:07:46 +00:00
SubFst009 fixed
This commit is contained in:
parent
05bd40a646
commit
90978fce7b
1 changed files with 114 additions and 0 deletions
114
src/servers/Scripts/quest/subquest/gridania/SubFst009.cpp
Normal file
114
src/servers/Scripts/quest/subquest/gridania/SubFst009.cpp
Normal file
|
@ -0,0 +1,114 @@
|
|||
#include <Script/NativeScriptApi.h>
|
||||
#include <Actor/Player.h>
|
||||
#include "Event/EventHelper.h"
|
||||
#include <ScriptObject.h>
|
||||
|
||||
// Quest Script: SubFst009_00034
|
||||
// Quest Name: Derision of Labor
|
||||
// Quest ID: 65570
|
||||
// Start NPC: 1000370
|
||||
// End NPC: 1000408
|
||||
|
||||
class SubFst009 : public EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestUI8AL
|
||||
// GetQuestUI8BH
|
||||
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Quest rewards
|
||||
static constexpr auto RewardExpFactor = 100;
|
||||
static constexpr auto RewardGil = 127;
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000370;
|
||||
static constexpr auto Actor1 = 1000408;
|
||||
static constexpr auto Item0 = 2000080;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq1Actor1 = 1;
|
||||
static constexpr auto Seq1Actor1Npctradeno = 99;
|
||||
static constexpr auto Seq1Actor1Npctradeok = 100;
|
||||
|
||||
public:
|
||||
SubFst009() : EventScript( 65570 )
|
||||
{};
|
||||
~SubFst009()
|
||||
{};
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto actor = Event::mapEventActorToRealActor( 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(), 255 );
|
||||
player.setQuestUI8BH( getId(), 1 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00099( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 99, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.playScene( getId(), 99, 0 );
|
||||
} );
|
||||
}
|
||||
|
||||
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() );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
Loading…
Add table
Reference in a new issue