mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-31 13:37:45 +00:00
Merge 741c9f6fe4
into a3d5dc8c26
This commit is contained in:
commit
e5f0e6be46
6 changed files with 722 additions and 0 deletions
213
src/servers/Scripts/quest/ManFst005.cpp
Normal file
213
src/servers/Scripts/quest/ManFst005.cpp
Normal file
|
@ -0,0 +1,213 @@
|
|||
#include <Script/NativeScriptApi.h>
|
||||
#include <Actor/Player.h>
|
||||
#include "Event/EventHelper.h"
|
||||
#include <ScriptObject.h>
|
||||
|
||||
// Quest Script: ManFst005_00445
|
||||
// Quest Name: Chasing Shadows
|
||||
// Quest ID: 65981
|
||||
// Start NPC: 1000421
|
||||
// End NPC: 1000421
|
||||
|
||||
class ManFst005 : public EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestUI8AL
|
||||
// GetQuestUI8BH
|
||||
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
Seq2 = 2,
|
||||
Seq3 = 3,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Quest rewards
|
||||
static constexpr auto RewardExpFactor = 200;
|
||||
static constexpr auto RewardGil = 132;
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000421;
|
||||
static constexpr auto CutScene02 = 55;
|
||||
static constexpr auto CutScene03 = 56;
|
||||
static constexpr auto CutScene04 = 57;
|
||||
static constexpr auto Eobject0 = 2000953;
|
||||
static constexpr auto Eobject1 = 2001194;
|
||||
static constexpr auto EventActionProcessShor = 15;
|
||||
static constexpr auto Item0 = 2000229;
|
||||
static constexpr auto Questbattle0 = 11;
|
||||
static constexpr auto Seq0Actor0Lq = 90;
|
||||
static constexpr auto Territorytype0 = 233;
|
||||
static constexpr auto Territorytype1 = 148;
|
||||
|
||||
static constexpr auto ManFst005QB = 2147876875;
|
||||
|
||||
public:
|
||||
ManFst005() : EventScript( 65981 )
|
||||
{};
|
||||
~ManFst005()
|
||||
{};
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||
|
||||
if( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
else if( actor == Actor0 )
|
||||
{
|
||||
Scene00009( player );
|
||||
}
|
||||
// EOBJECTS
|
||||
else if( actor == Eobject0 )
|
||||
{
|
||||
player.eventActionStart( getId(), 0x0F,
|
||||
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{
|
||||
Scene00002( player );
|
||||
},
|
||||
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{},
|
||||
eventId );
|
||||
}
|
||||
else if( actor == Eobject1 )
|
||||
{
|
||||
player.eventActionStart( getId(), 0x0F,
|
||||
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{
|
||||
Scene00006( player );
|
||||
},
|
||||
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{},
|
||||
eventId );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.param2 == 1 )
|
||||
{
|
||||
Scene00001( player );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 1, SET_EOBJ_BASE | HIDE_HOTBAR | INVIS_EOBJ,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.updateQuest( getId(), 1 );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00002( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 2, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
Scene00003( player );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00003( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 3, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.param2 == 1)
|
||||
{
|
||||
player.updateQuest( getId(), 3 );
|
||||
player.sendNotice("QuestBattle actually disabled, goat said it...it's not my fault!" );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00004( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 4, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00005( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 5, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.updateQuest( getId(), 3 );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00006( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 6, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
Scene00007( player );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00007( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 7, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.sendQuestMessage( getId(), 2, 1, 30426, 3750473944 );
|
||||
player.setQuestUI8BH( getId(), 1 );
|
||||
player.updateQuest( getId(), 255 );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00008( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 8, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00009( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 9, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.param2 == 1 )
|
||||
{
|
||||
Scene00010( player );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00010( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 10, SET_EOBJ_BASE | HIDE_HOTBAR | INVIS_EOBJ,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( player.giveQuestRewards( getId(), 0 ) )
|
||||
{
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00011( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 11, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
} );
|
||||
}
|
||||
};
|
82
src/servers/Scripts/quest/subquest/gridania/SubFst005.cpp
Normal file
82
src/servers/Scripts/quest/subquest/gridania/SubFst005.cpp
Normal file
|
@ -0,0 +1,82 @@
|
|||
#include <Script/NativeScriptApi.h>
|
||||
#include <Actor/Player.h>
|
||||
#include "Event/EventHelper.h"
|
||||
#include <ScriptObject.h>
|
||||
|
||||
// Quest Script: SubFst005_00028
|
||||
// Quest Name: To the Bannock
|
||||
// Quest ID: 65564
|
||||
// Start NPC: 1000100
|
||||
// End NPC: 1000421
|
||||
|
||||
class SubFst005 : 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 = 127;
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000100;
|
||||
static constexpr auto Actor1 = 1000421;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq1Actor1 = 1;
|
||||
|
||||
public:
|
||||
SubFst005() : EventScript( 65564 )
|
||||
{};
|
||||
~SubFst005()
|
||||
{};
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||
|
||||
if( actor == SubFst005::Actor0 )
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
else if( actor == SubFst005::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 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
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() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
141
src/servers/Scripts/quest/subquest/gridania/SubFst034.cpp
Normal file
141
src/servers/Scripts/quest/subquest/gridania/SubFst034.cpp
Normal file
|
@ -0,0 +1,141 @@
|
|||
#include <Script/NativeScriptApi.h>
|
||||
#include <Actor/Player.h>
|
||||
#include "Event/EventHelper.h"
|
||||
#include <ScriptObject.h>
|
||||
|
||||
// Quest Script: SubFst034_00128
|
||||
// Quest Name: Eggs over Queasy
|
||||
// Quest ID: 65664
|
||||
// Start NPC: 1000421
|
||||
// End NPC: 1000449
|
||||
|
||||
// NEED TO TEST KILLCREDITS
|
||||
|
||||
class SubFst034 : public EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestUI8AL
|
||||
// GetQuestUI8BH
|
||||
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Quest rewards
|
||||
static constexpr auto RewardExpFactor = 200;
|
||||
static constexpr auto RewardGil = 151;
|
||||
static constexpr auto RewardItem = 4552;
|
||||
static constexpr auto RewardItemCount = 1;
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000421;
|
||||
static constexpr auto Actor1 = 1000449;
|
||||
static constexpr auto Enemy0 = 43;
|
||||
static constexpr auto Item0 = 2000062;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq2Actor1 = 1;
|
||||
static constexpr auto Seq2Actor1Npctradeno = 99;
|
||||
static constexpr auto Seq2Actor1Npctradeok = 100;
|
||||
|
||||
public:
|
||||
SubFst034() : EventScript( 65664 )
|
||||
{ };
|
||||
~SubFst034()
|
||||
{ };
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||
|
||||
if ( actor == SubFst034::Actor0 )
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
else if ( actor == SubFst034::Actor1 )
|
||||
{
|
||||
Scene00001( player );
|
||||
}
|
||||
}
|
||||
|
||||
void onMobKill( Entity::Player& player, uint64_t npcId )
|
||||
{
|
||||
if ( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto currentKC = player.getQuestUI8BH( m_id ) + 1;
|
||||
|
||||
if ( currentKC >= 6 )
|
||||
player.updateQuest( m_id, 255 );
|
||||
else
|
||||
{
|
||||
player.setQuestUI8BH( m_id, currentKC );
|
||||
player.sendQuestMessage( m_id, 0, 2, currentKC, 6 );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
{
|
||||
player.playScene( m_id, 0, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if ( result.param2 == 1 )
|
||||
{
|
||||
player.updateQuest( m_id, 1 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player )
|
||||
{
|
||||
player.playScene( m_id, 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( m_id, 99, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.playScene( m_id, 99, 0, 0, 0 );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00100( Entity::Player& player )
|
||||
{
|
||||
player.playScene( m_id, 100, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if ( result.param2 == 1 )
|
||||
{
|
||||
player.setQuestUI8BH( m_id, 0 );
|
||||
player.setQuestUI8AL( m_id, 1 );
|
||||
|
||||
if ( player.getQuestUI8AL( m_id ) == 1 )
|
||||
{
|
||||
if ( player.giveQuestRewards( m_id,0 ) )
|
||||
{
|
||||
player.finishQuest( m_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
105
src/servers/Scripts/quest/subquest/gridania/SubFst039.cpp
Normal file
105
src/servers/Scripts/quest/subquest/gridania/SubFst039.cpp
Normal file
|
@ -0,0 +1,105 @@
|
|||
#include <Script/NativeScriptApi.h>
|
||||
#include <Actor/Player.h>
|
||||
#include "Event/EventHelper.h"
|
||||
#include <ScriptObject.h>
|
||||
|
||||
// Quest Script: SubFst039_00196
|
||||
// Quest Name: An Eft for Effort
|
||||
// Quest ID: 65732
|
||||
// Start NPC: 1000421
|
||||
// End NPC: 1000421
|
||||
|
||||
// NEED TEST KILLCREDIT COUNT
|
||||
|
||||
class SubFst039 : public EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestUI8AL
|
||||
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Quest rewards
|
||||
static constexpr auto RewardExpFactor = 200;
|
||||
static constexpr auto RewardGil = 155;
|
||||
uint32_t RewardItemOptional[4] = { 1821, 1892, 1959, 5824 };
|
||||
uint32_t RewardItemOptionalCount[4] = { 1, 1, 1, 2 };
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000421;
|
||||
static constexpr auto Enemy0 = 160;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq2Actor0 = 1;
|
||||
|
||||
public:
|
||||
SubFst039() : EventScript( 65732 )
|
||||
{};
|
||||
~SubFst039()
|
||||
{};
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||
|
||||
if( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
if( actor == Actor0 )
|
||||
{
|
||||
Scene00001( player );
|
||||
}
|
||||
}
|
||||
|
||||
void onMobKill( Entity::Player& player, uint64_t npcId )
|
||||
{
|
||||
if( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto currentKC = player.getQuestUI8AL( getId() ) + 1;
|
||||
|
||||
if ( currentKC >= 6 )
|
||||
player.updateQuest( getId(), 255 );
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), currentKC );
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
|
||||
}
|
||||
}
|
||||
|
||||
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(), 1 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
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() );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
100
src/servers/Scripts/quest/subquest/gridania/SubFst042.cpp
Normal file
100
src/servers/Scripts/quest/subquest/gridania/SubFst042.cpp
Normal file
|
@ -0,0 +1,100 @@
|
|||
#include <Script/NativeScriptApi.h>
|
||||
#include <Actor/Player.h>
|
||||
#include "Event/EventHelper.h"
|
||||
#include <ScriptObject.h>
|
||||
|
||||
// Quest Script: SubFst042_00198
|
||||
// Quest Name: Butcher of Greentear
|
||||
// Quest ID: 65734
|
||||
// Start NPC: 1000685
|
||||
// End NPC: 1000685
|
||||
|
||||
//NEED TEST KILLCREDIT
|
||||
|
||||
class SubFst042 : public EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestUI8AL
|
||||
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Quest rewards
|
||||
static constexpr auto RewardExpFactor = 200;
|
||||
uint32_t RewardItemOptional[3] = { 4092, 4091, 5824 };
|
||||
uint32_t RewardItemOptionalCount[3] = { 1, 1, 1 };
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000685;
|
||||
static constexpr auto Enemy0 = 14;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq2Actor0 = 1;
|
||||
|
||||
public:
|
||||
SubFst042() : EventScript( 65734 )
|
||||
{};
|
||||
~SubFst042()
|
||||
{};
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||
|
||||
if ( actor == SubFst042::Actor0 && !player.hasQuest( getId() ) )
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
else if ( actor == SubFst042::Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
{
|
||||
Scene00001( player );
|
||||
}
|
||||
}
|
||||
|
||||
void onMobKill( Entity::Player& player, uint64_t npcId )
|
||||
{
|
||||
if( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto currentKC = player.getQuestUI8AL( getId() ) + 1;
|
||||
|
||||
if( currentKC >= 6 )
|
||||
player.updateQuest( getId(), 255 );
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), currentKC );
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
|
||||
}
|
||||
}
|
||||
|
||||
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(), 1 );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 0, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if ( result.param2 == 1 )
|
||||
{
|
||||
if ( player.giveQuestRewards( getId(), 0 ) )
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
81
src/servers/Scripts/quest/subquest/gridania/SubFst045.cpp
Normal file
81
src/servers/Scripts/quest/subquest/gridania/SubFst045.cpp
Normal file
|
@ -0,0 +1,81 @@
|
|||
#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 ){};
|
||||
~SubFst045(){};
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto actor = Event::mapEventActorToRealActor( 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(), 255 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
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() );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
Loading…
Add table
Reference in a new issue