mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
Merge pull request #686 from DantestyleXD/SubFst#1
Subquests Gridania #1
This commit is contained in:
commit
c8c696b89a
15 changed files with 1140 additions and 61 deletions
|
@ -43,7 +43,7 @@ private:
|
|||
{
|
||||
if( result.param2 == 1 ) // finish quest
|
||||
{
|
||||
if( player.giveQuestRewards( getId(), 0 ) )
|
||||
if( player.giveQuestRewards( getId(), result.param3 ) )
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
};
|
||||
|
|
134
src/scripts/quest/subquest/gridania/SubFst007.cpp
Normal file
134
src/scripts/quest/subquest/gridania/SubFst007.cpp
Normal file
|
@ -0,0 +1,134 @@
|
|||
#include <Actor/Player.h>
|
||||
#include "Manager/EventMgr.h"
|
||||
#include <ScriptObject.h>
|
||||
#include <Service.h>
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
// Quest Script: SubFst007_00031
|
||||
// Quest Name: Essential Oil
|
||||
// Quest ID: 65567
|
||||
// Start NPC: 1000705
|
||||
// End NPC: 1000705
|
||||
|
||||
class SubFst007 : public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestUI8AL
|
||||
// GetQuestUI8BH
|
||||
|
||||
// Steps in this quest ( 0 is before accepting,
|
||||
// 1 is first, 255 means ready for turning it in
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Quest rewards
|
||||
static constexpr auto RewardExpFactor = 100;
|
||||
uint32_t RewardItemOptional[3] = { 3530, 3531, 5823 };
|
||||
uint32_t RewardItemOptionalCount[3] = { 1, 1, 3 };
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000705;
|
||||
static constexpr auto Enemy0 = 49;
|
||||
static constexpr auto Item0 = 2000098;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq2Actor0 = 1;
|
||||
static constexpr auto Seq2Actor0Npctradeno = 99;
|
||||
static constexpr auto Seq2Actor0Npctradeok = 100;
|
||||
|
||||
public:
|
||||
SubFst007() : Sapphire::ScriptAPI::EventScript( 65567 ){};
|
||||
~SubFst007(){};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Event Handlers
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto pEventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
||||
auto actor = pEventMgr.mapEventActorToRealActor( static_cast<uint32_t>( actorId ) );
|
||||
|
||||
if ( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
if ( actor == Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
{
|
||||
Scene00001( player );
|
||||
}
|
||||
}
|
||||
|
||||
void onBNpcKill( uint32_t npcId, Entity::Player& player )
|
||||
{
|
||||
if ( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto currentKC = player.getQuestUI8AL( getId() );
|
||||
|
||||
if ( currentKC + 1 >= 6 )
|
||||
{
|
||||
player.setQuestUI8AL( getId(), currentKC + 1 );
|
||||
player.setQuestUI8BH( getId(), currentKC + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC + 1, 6 );
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC + 1, 6 );
|
||||
player.setQuestUI8AL( getId(), currentKC + 1 );
|
||||
player.setQuestUI8BH( getId(), currentKC + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Available Scenes in this quest, not necessarly all are used
|
||||
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(), Seq1 );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 1, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
result.param2 == 1 ? Scene00100( player ) : Scene00099( player );
|
||||
} );
|
||||
}
|
||||
|
||||
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(), result.param3 ) )
|
||||
{
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT(SubFst007);
|
|
@ -93,6 +93,7 @@ private:
|
|||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.setQuestUI8BH( getId(), 1 );
|
||||
player.sendQuestMessage( getId(), 0, 0, 0, 0 );
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
} );
|
||||
}
|
||||
|
@ -102,14 +103,7 @@ private:
|
|||
player.playScene( getId(), 2, HIDE_HOTBAR,
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.param2 == 1 )
|
||||
{
|
||||
Scene00100( player );
|
||||
}
|
||||
else
|
||||
{
|
||||
Scene00099( player );
|
||||
}
|
||||
result.param2 == 1 ? Scene00100( player ) : Scene00099( player );
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -131,7 +125,7 @@ private:
|
|||
{
|
||||
if( player.giveQuestRewards( getId(), 0 ) )
|
||||
{
|
||||
player.setQuestUI8BH( getId(), 0 );
|
||||
player.setQuestUI8BH( getId(), result.param3 );
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@ using namespace Sapphire;
|
|||
// Start NPC: 1000195
|
||||
// End NPC: 1000195
|
||||
|
||||
//NEED TEST KILLCREDIT
|
||||
|
||||
class SubFst011 :
|
||||
public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
|
@ -67,15 +65,12 @@ public:
|
|||
if( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto currentKC = player.getQuestUI8AL( getId() ) + 1;
|
||||
auto currentKC = player.getQuestUI8AL( getId() );
|
||||
player.setQuestUI8AL( getId(), currentKC + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC + 1, 6 );
|
||||
|
||||
if( currentKC >= 6 )
|
||||
if( currentKC + 1 >= 6 )
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), currentKC );
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -99,7 +94,7 @@ private:
|
|||
{
|
||||
if( result.param2 == 1 )
|
||||
{
|
||||
if( player.giveQuestRewards( getId(), 0 ) )
|
||||
if( player.giveQuestRewards( getId(), result.param3 ) )
|
||||
{
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
else if( actor == Actor0 )
|
||||
else if( actor == Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
{
|
||||
Scene00007( player );
|
||||
}
|
||||
|
@ -131,15 +131,13 @@ private:
|
|||
auto currentCC = player.getQuestUI8AL( getId() );
|
||||
|
||||
player.sendQuestMessage( getId(), 0, 2, currentCC + 1, 6 );
|
||||
player.setQuestUI8AL( getId(), currentCC + 1 );
|
||||
player.setQuestUI8BH( getId(), currentCC + 1 );
|
||||
|
||||
if( currentCC + 1 >= 6 )
|
||||
if ( currentCC + 1 >= 6 )
|
||||
{
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), currentCC + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
void Scene00000( Entity::Player& player )
|
||||
|
@ -211,14 +209,10 @@ private:
|
|||
player.playScene( getId(), 7, HIDE_HOTBAR,
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.param2 == 1 )
|
||||
if ( result.param2 == 1 )
|
||||
{
|
||||
Scene00088( player );
|
||||
}
|
||||
else
|
||||
{
|
||||
Scene00087( player );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -227,7 +221,6 @@ private:
|
|||
player.playScene( getId(), 87, HIDE_HOTBAR,
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.playScene( getId(), 87, 0, 0, 0 );
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -236,13 +229,9 @@ private:
|
|||
player.playScene( getId(), 88, HIDE_HOTBAR,
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.param2 == 1 )
|
||||
if ( player.giveQuestRewards( getId(), 0 ) )
|
||||
{
|
||||
if( player.giveQuestRewards( getId(), 0 ) )
|
||||
{
|
||||
player.setQuestUI8AL( getId(), 0 );
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
112
src/scripts/quest/subquest/gridania/SubFst021.cpp
Normal file
112
src/scripts/quest/subquest/gridania/SubFst021.cpp
Normal file
|
@ -0,0 +1,112 @@
|
|||
// This is an automatically generated C++ script template
|
||||
// Content needs to be added by hand to make it function
|
||||
// In order for this script to be loaded, move it to the correct folder in <root>/scripts/
|
||||
|
||||
#include <Actor/Player.h>
|
||||
#include "Manager/EventMgr.h"
|
||||
#include <ScriptObject.h>
|
||||
#include <Service.h>
|
||||
|
||||
// Quest Script: SubFst021_00095
|
||||
// Quest Name: Hematophagic Harassment
|
||||
// Quest ID: 65631
|
||||
// Start NPC: 1000640
|
||||
// End NPC: 1000640
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
class SubFst021 : public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestUI8AL
|
||||
|
||||
// Steps in this quest ( 0 is before accepting,
|
||||
// 1 is first, 255 means ready for turning it in
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000640;
|
||||
static constexpr auto Enemy0 = 118; //136; <- WRONG INFO
|
||||
|
||||
public:
|
||||
SubFst021() : Sapphire::ScriptAPI::EventScript( 65631 ){};
|
||||
~SubFst021(){};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Event Handlers
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
||||
auto actor = eventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
||||
|
||||
if ( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
Scene00000( player );
|
||||
if ( actor == Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
Scene00002( player );
|
||||
}
|
||||
|
||||
void onBNpcKill( uint32_t npcId, Entity::Player& player ) override
|
||||
{
|
||||
if ( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto credit = player.getQuestUI8AL( getId() );
|
||||
if ( credit + 1 >= 6 )
|
||||
{
|
||||
player.setQuestUI8AL( getId(), credit + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, credit + 1, 6 );
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), credit + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, credit + 1, 6 );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Available Scenes in this quest, not necessarly all are used
|
||||
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, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.updateQuest( getId(), Seq1 );
|
||||
} );
|
||||
}
|
||||
|
||||
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(), result.param3 ) )
|
||||
{
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( SubFst021 );
|
134
src/scripts/quest/subquest/gridania/SubFst025.cpp
Normal file
134
src/scripts/quest/subquest/gridania/SubFst025.cpp
Normal file
|
@ -0,0 +1,134 @@
|
|||
// This is an automatically generated C++ script template
|
||||
// Content needs to be added by hand to make it function
|
||||
// In order for this script to be loaded, move it to the correct folder in <root>/scripts/
|
||||
|
||||
#include <Actor/Player.h>
|
||||
#include "Manager/EventMgr.h"
|
||||
#include <ScriptObject.h>
|
||||
#include <Service.h>
|
||||
|
||||
// Quest Script: SubFst025_00103
|
||||
// Quest Name: Death to the Bean Thieves
|
||||
// Quest ID: 65639
|
||||
// Start NPC: 1000627
|
||||
// End NPC: 1000656
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
class SubFst025 : public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestUI8AL
|
||||
// GetQuestUI8BH
|
||||
|
||||
// Steps in this quest ( 0 is before accepting,
|
||||
// 1 is first, 255 means ready for turning it in
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000627;
|
||||
static constexpr auto Actor1 = 1000656;
|
||||
static constexpr auto Enemy0 = 5;
|
||||
static constexpr auto Item0 = 2000075;
|
||||
|
||||
public:
|
||||
SubFst025() : Sapphire::ScriptAPI::EventScript( 65639 ){};
|
||||
~SubFst025() {};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Event Handlers
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
||||
auto actor = eventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
||||
|
||||
if ( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
Scene00000( player );
|
||||
if ( actor == Actor1 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
Scene00002( player );
|
||||
}
|
||||
|
||||
void onBNpcKill( uint32_t npcId, Entity::Player& player ) override
|
||||
{
|
||||
if ( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto credit = player.getQuestUI8AL( getId() );
|
||||
|
||||
if ( credit + 1 >= 6 )
|
||||
{
|
||||
player.sendQuestMessage( getId(), 0, 2, credit + 1, 6 );
|
||||
player.setQuestUI8BH( getId(), credit + 1 );
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), credit + 1 );
|
||||
player.setQuestUI8BH( getId(), credit + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, credit + 1, 6 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Available Scenes in this quest, not necessarly all are used
|
||||
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, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.updateQuest( getId(), Seq1 );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00002( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 2, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if ( result.param2 == 1 )
|
||||
Scene00003( player );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00003( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 3, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if ( result.param2 == 1 )
|
||||
if ( player.giveQuestRewards( getId(), result.param3 ) )
|
||||
{
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00004( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 4, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( SubFst025 );
|
|
@ -11,8 +11,6 @@ using namespace Sapphire;
|
|||
// Start NPC: 1000629
|
||||
// End NPC: 1000629
|
||||
|
||||
//NEED TEST KILLCREDIT
|
||||
|
||||
class SubFst026 :
|
||||
public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
|
@ -55,28 +53,27 @@ public:
|
|||
auto actor = pEventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
||||
|
||||
if( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
else if( actor == Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
{
|
||||
Scene00001( player );
|
||||
}
|
||||
}
|
||||
|
||||
void onMobKill( Entity::Player& player, uint64_t npcId )
|
||||
void onBNpcKill( uint32_t npcId, Entity::Player& player ) override
|
||||
{
|
||||
if( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto currentKC = player.getQuestUI8AL( getId() ) + 1;
|
||||
auto currentKC = player.getQuestUI8AL( getId() );
|
||||
|
||||
if( currentKC >= 6 )
|
||||
if ( currentKC + 1 >= 6 )
|
||||
{
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC + 1, 6 );
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), currentKC );
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
|
||||
player.setQuestUI8AL( getId(), currentKC + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC + 1, 6 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
146
src/scripts/quest/subquest/gridania/SubFst037.cpp
Normal file
146
src/scripts/quest/subquest/gridania/SubFst037.cpp
Normal file
|
@ -0,0 +1,146 @@
|
|||
// This is an automatically generated C++ script template
|
||||
// Content needs to be added by hand to make it function
|
||||
// In order for this script to be loaded, move it to the correct folder in <root>/scripts/
|
||||
|
||||
#include <Actor/Player.h>
|
||||
#include "Manager/EventMgr.h"
|
||||
#include <ScriptObject.h>
|
||||
#include <Service.h>
|
||||
|
||||
// Quest Script: SubFst037_00174
|
||||
// Quest Name: No Quarter Given
|
||||
// Quest ID: 65710
|
||||
// Start NPC: 1000612
|
||||
// End NPC: 1000612
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
class SubFst037 : public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestUI8AL
|
||||
// GetQuestUI8BH
|
||||
// GetQuestUI8BL
|
||||
|
||||
// Steps in this quest ( 0 is before accepting,
|
||||
// 1 is first, 255 means ready for turning it in
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000612;
|
||||
static constexpr auto Enemy0 = 192; //743; <- WRONG INFO
|
||||
static constexpr auto Enemy1 = 193; //744; <- WRONG INFO
|
||||
static constexpr auto Enemy2 = 194; //745; <- WRONG INFO
|
||||
|
||||
public:
|
||||
SubFst037() : Sapphire::ScriptAPI::EventScript( 65710 ){};
|
||||
~SubFst037() {};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Event Handlers
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
||||
auto actor = eventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
||||
|
||||
if ( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
Scene00000( player );
|
||||
if ( actor == Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
Scene00002( player );
|
||||
}
|
||||
|
||||
void onBNpcKill( uint32_t npcId, Entity::Player& player ) override
|
||||
{
|
||||
auto credit = 0;
|
||||
|
||||
switch( npcId )
|
||||
{
|
||||
case Enemy0:
|
||||
{
|
||||
credit = player.getQuestUI8AL( getId() );
|
||||
|
||||
player.setQuestUI8AL( getId() , credit + 1 );
|
||||
if( credit + 1 <= 2 )
|
||||
player.sendQuestMessage( getId() , 0, 2, credit + 1, 2 );
|
||||
|
||||
break;
|
||||
}
|
||||
case Enemy1:
|
||||
{
|
||||
credit = player.getQuestUI8BH( getId() );
|
||||
|
||||
player.setQuestUI8BH( getId() , credit + 1 );
|
||||
if ( credit + 1 <= 2 )
|
||||
player.sendQuestMessage( getId() , 1, 2, credit + 1, 2 );
|
||||
|
||||
break;
|
||||
}
|
||||
case Enemy2:
|
||||
{
|
||||
credit = player.getQuestUI8BL( getId() );
|
||||
|
||||
player.setQuestUI8BL( getId() , credit + 1 );
|
||||
if ( credit + 1 <= 2 )
|
||||
player.sendQuestMessage( getId() , 2, 2, credit + 1, 2 );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
checkQuestCompletion( player );
|
||||
}
|
||||
|
||||
void checkQuestCompletion( Entity::Player& player )
|
||||
{
|
||||
auto credit192 = player.getQuestUI8AL( getId() );
|
||||
auto credit193 = player.getQuestUI8BH( getId() );
|
||||
auto credit194 = player.getQuestUI8BL( getId() );
|
||||
|
||||
if ( credit192 >= 2 && credit193 >= 2 && credit194 >= 2 )
|
||||
player.updateQuest( getId() , SeqFinish );
|
||||
}
|
||||
|
||||
private:
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Available Scenes in this quest, not necessarly all are used
|
||||
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, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
player.updateQuest( getId() , Seq1 );
|
||||
} );
|
||||
}
|
||||
|
||||
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() , result.param3 ) )
|
||||
{
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( SubFst037 );
|
|
@ -11,8 +11,6 @@ using namespace Sapphire;
|
|||
// Start NPC: 1000432
|
||||
// End NPC: 1000411
|
||||
|
||||
//NEED TEST KILLCREDIT
|
||||
|
||||
class SubFst041 :
|
||||
public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
|
@ -38,7 +36,7 @@ private:
|
|||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000432;
|
||||
static constexpr auto Actor1 = 1000411;
|
||||
static constexpr auto Enemy0 = 159;
|
||||
static constexpr auto Enemy0 = 197; //159; WRONG INFO
|
||||
static constexpr auto Item0 = 2000142;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq2Actor1 = 1;
|
||||
|
@ -61,28 +59,30 @@ public:
|
|||
auto actor = pEventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
||||
|
||||
if( actor == Actor0 )
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
if( actor == Actor1 )
|
||||
{
|
||||
Scene00001( player );
|
||||
}
|
||||
}
|
||||
|
||||
void onMobKill( Entity::Player& player, uint64_t npcId )
|
||||
void onBNpcKill( uint32_t npcId, Entity::Player& player ) override
|
||||
{
|
||||
if( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto currentKC = player.getQuestUI8BH( getId() ) + 1;
|
||||
auto currentKC = player.getQuestUI8BH( getId() );
|
||||
|
||||
if( currentKC >= 6 )
|
||||
if ( currentKC + 1 >= 4 )
|
||||
{
|
||||
player.setQuestUI8AL( getId(), currentKC + 1 );
|
||||
player.setQuestUI8BH( getId(), currentKC + 1 );
|
||||
player.sendQuestMessage( getId(), 1, 0, 0, 0 );
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setQuestUI8BH( getId(), currentKC );
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
|
||||
player.setQuestUI8AL( getId(), currentKC + 1 );
|
||||
player.setQuestUI8BH( getId(), currentKC + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, currentKC + 1, 4 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
100
src/scripts/quest/subquest/gridania/SubFst042.cpp
Normal file
100
src/scripts/quest/subquest/gridania/SubFst042.cpp
Normal file
|
@ -0,0 +1,100 @@
|
|||
#include <Actor/Player.h>
|
||||
#include <Manager/EventMgr.h>
|
||||
#include <ScriptObject.h>
|
||||
#include <Service.h>
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
// Quest Script: SubFst042_00198
|
||||
// Quest Name: Butcher of Greentear
|
||||
// Quest ID: 65734
|
||||
// Start NPC: 1000685
|
||||
// End NPC: 1000685
|
||||
|
||||
class SubFst042 : public Sapphire::ScriptAPI::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() : Sapphire::ScriptAPI::EventScript( 65734 ){};
|
||||
~SubFst042(){};
|
||||
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto& pEventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
||||
auto actor = pEventMgr.mapEventActorToRealActor( static_cast<uint32_t>( actorId ) );
|
||||
|
||||
if ( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
{
|
||||
Scene00000( player );
|
||||
}
|
||||
else if ( actor == Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
{
|
||||
Scene00001( player );
|
||||
}
|
||||
}
|
||||
|
||||
void onBNpcKill( uint32_t npcId, Entity::Player& player ) override
|
||||
{
|
||||
if ( npcId != Enemy0 )
|
||||
return;
|
||||
|
||||
auto currentKC = player.getQuestUI8AL( getId() ) + 1;
|
||||
|
||||
if ( currentKC >= 6 )
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
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() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( SubFst042 );
|
184
src/scripts/quest/subquest/gridania/SubFst043.cpp
Normal file
184
src/scripts/quest/subquest/gridania/SubFst043.cpp
Normal file
|
@ -0,0 +1,184 @@
|
|||
// This is an automatically generated C++ script template
|
||||
// Content needs to be added by hand to make it function
|
||||
// In order for this script to be loaded, move it to the correct folder in <root>/scripts/
|
||||
|
||||
#include <Actor/Player.h>
|
||||
#include "Manager/EventMgr.h"
|
||||
#include <ScriptObject.h>
|
||||
#include <Service.h>
|
||||
|
||||
// Quest Script: SubFst043_00199
|
||||
// Quest Name: A Clear Sign
|
||||
// Quest ID: 65735
|
||||
// Start NPC: 1000172
|
||||
// End NPC: 1000627
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
class SubFst043 : public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestBitFlag8
|
||||
// GetQuestUI8AL
|
||||
|
||||
// Steps in this quest ( 0 is before accepting,
|
||||
// 1 is first, 255 means ready for turning it in
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000172;
|
||||
static constexpr auto Actor1 = 1000627;
|
||||
static constexpr auto Eobject0 = 2000143;
|
||||
static constexpr auto Eobject1 = 2000144;
|
||||
static constexpr auto EventActionProcessMiddle = 16;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq1Eobject0 = 1;
|
||||
static constexpr auto Seq1Eobject0Eventactionno = 99;
|
||||
static constexpr auto Seq1Eobject0Eventactionok = 100;
|
||||
static constexpr auto Seq1Eobject1 = 2;
|
||||
static constexpr auto Seq1Eobject1Eventactionno = 97;
|
||||
static constexpr auto Seq1Eobject1Eventactionok = 98;
|
||||
static constexpr auto Seq2Actor1 = 3;
|
||||
|
||||
public:
|
||||
SubFst043() : Sapphire::ScriptAPI::EventScript( 65735 ){};
|
||||
~SubFst043() {};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Event Handlers
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
||||
auto actor = eventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
||||
|
||||
if ( actor == Actor0 )
|
||||
Scene00000( player );
|
||||
else if (actor == Actor1 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
Scene00003( player );
|
||||
else if ( actor == Eobject0 )
|
||||
player.eventActionStart( getId(), EventActionProcessMiddle,
|
||||
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{
|
||||
Scene00001( player );
|
||||
},
|
||||
nullptr, eventId );
|
||||
else if ( actor == Eobject1 )
|
||||
player.eventActionStart( getId(), EventActionProcessMiddle,
|
||||
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{
|
||||
Scene00002( player );
|
||||
},
|
||||
nullptr, eventId );
|
||||
}
|
||||
|
||||
void checkQuestCompletion( Entity::Player& player )
|
||||
{
|
||||
auto credit = player.getQuestUI8AL( getId() );
|
||||
|
||||
if ( credit + 1 >= 2 )
|
||||
{
|
||||
player.setQuestUI8AL( getId(), credit + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, credit + 1, 2 );
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), credit + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, credit + 1, 2 );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Available Scenes in this quest, not necessarly all are used
|
||||
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(), Seq1 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 1, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
Scene00100( player );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00002( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 2, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
Scene00098( player );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00003( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 3, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if ( result.param2 == 1 )
|
||||
{
|
||||
if ( player.giveQuestRewards( getId(), 0 ) )
|
||||
{
|
||||
player.setQuestUI8BH( getId(), 0 );
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void Scene00097( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 97, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00098( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 98, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
checkQuestCompletion( player );
|
||||
player.setQuestBitFlag8( getId(), 2, true );
|
||||
} );
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
checkQuestCompletion( player );
|
||||
player.setQuestBitFlag8( getId(), 1, true );
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( SubFst043 );
|
150
src/scripts/quest/subquest/gridania/SubFst046.cpp
Normal file
150
src/scripts/quest/subquest/gridania/SubFst046.cpp
Normal file
|
@ -0,0 +1,150 @@
|
|||
// This is an automatically generated C++ script template
|
||||
// Content needs to be added by hand to make it function
|
||||
// In order for this script to be loaded, move it to the correct folder in <root>/scripts/
|
||||
|
||||
#include <Actor/Player.h>
|
||||
#include "Manager/EventMgr.h"
|
||||
#include <ScriptObject.h>
|
||||
#include <Service.h>
|
||||
|
||||
// Quest Script: SubFst046_00210
|
||||
// Quest Name: Idle Initiatives
|
||||
// Quest ID: 65746
|
||||
// Start NPC: 1000408
|
||||
// End NPC: 1000408
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
class SubFst046 :
|
||||
public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestBitFlag8
|
||||
// GetQuestUI8AL
|
||||
|
||||
// Steps in this quest ( 0 is before accepting,
|
||||
// 1 is first, 255 means ready for turning it in
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto ActionTimelineEventBaseIdle = 783;
|
||||
static constexpr auto Actor0 = 1000408;
|
||||
static constexpr auto Actor1 = 1000792;
|
||||
static constexpr auto Actor2 = 1000793;
|
||||
static constexpr auto Actor3 = 1000794;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq1Actor1 = 1;
|
||||
static constexpr auto Seq1Actor2 = 2;
|
||||
static constexpr auto Seq1Actor3 = 3;
|
||||
static constexpr auto Seq2Actor0 = 4;
|
||||
|
||||
public:
|
||||
SubFst046() : Sapphire::ScriptAPI::EventScript( 65746 ){};
|
||||
~SubFst046() {};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Event Handlers
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
||||
auto actor = eventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
||||
|
||||
if ( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
Scene00000( player );
|
||||
if ( actor == Actor1 )
|
||||
Scene00001( player );
|
||||
if ( actor == Actor2 )
|
||||
Scene00002( player );
|
||||
if ( actor == Actor3 )
|
||||
Scene00003( player );
|
||||
if ( actor == Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
Scene00004( player );
|
||||
}
|
||||
|
||||
void checkQuestCompletion( Entity::Player& player )
|
||||
{
|
||||
auto credit = player.getQuestUI8AL( getId() );
|
||||
|
||||
if ( credit + 1 >= 3 )
|
||||
{
|
||||
player.setQuestUI8AL( getId(), credit + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 0, credit + 1, 3 );
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), credit + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 0, credit + 1, 3 );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Available Scenes in this quest, not necessarly all are used
|
||||
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(), Seq1 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 1, HIDE_HOTBAR,
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
checkQuestCompletion( player );
|
||||
player.setQuestBitFlag8( getId(), 1, true );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00002( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 2, HIDE_HOTBAR,
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
checkQuestCompletion( player );
|
||||
player.setQuestBitFlag8( getId(), 2, true );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00003( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 3, HIDE_HOTBAR,
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
checkQuestCompletion( player );
|
||||
player.setQuestBitFlag8( getId(), 3, true );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00004( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 4, HIDE_HOTBAR,
|
||||
[ & ]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if ( result.param2 == 1 )
|
||||
{
|
||||
if ( player.giveQuestRewards( getId(), 0 ) )
|
||||
{
|
||||
player.setQuestUI8BH( getId(), 0 );
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( SubFst046 );
|
144
src/scripts/quest/subquest/gridania/SubFst048.cpp
Normal file
144
src/scripts/quest/subquest/gridania/SubFst048.cpp
Normal file
|
@ -0,0 +1,144 @@
|
|||
// This is an automatically generated C++ script template
|
||||
// Content needs to be added by hand to make it function
|
||||
// In order for this script to be loaded, move it to the correct folder in <root>/scripts/
|
||||
|
||||
#include <Actor/Player.h>
|
||||
#include "Manager/EventMgr.h"
|
||||
#include <ScriptObject.h>
|
||||
#include <Service.h>
|
||||
|
||||
// Quest Script: SubFst048_00375
|
||||
// Quest Name: Not a Material Girl
|
||||
// Quest ID: 65911
|
||||
// Start NPC: 1000742
|
||||
// End NPC: 1000742
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
class SubFst048 : public Sapphire::ScriptAPI::EventScript
|
||||
{
|
||||
private:
|
||||
// Basic quest information
|
||||
// Quest vars / flags used
|
||||
// GetQuestBitFlag8
|
||||
// GetQuestUI8AL
|
||||
|
||||
// Steps in this quest ( 0 is before accepting,
|
||||
// 1 is first, 255 means ready for turning it in
|
||||
enum Sequence : uint8_t
|
||||
{
|
||||
Seq0 = 0,
|
||||
Seq1 = 1,
|
||||
SeqFinish = 255,
|
||||
};
|
||||
|
||||
// Entities found in the script data of the quest
|
||||
static constexpr auto Actor0 = 1000742;
|
||||
static constexpr auto Actor1 = 1000474;
|
||||
static constexpr auto Actor2 = 1000476;
|
||||
static constexpr auto Actor3 = 1000483;
|
||||
static constexpr auto Seq0Actor0 = 0;
|
||||
static constexpr auto Seq1Actor1 = 1;
|
||||
static constexpr auto Seq1Actor2 = 2;
|
||||
static constexpr auto Seq1Actor3 = 3;
|
||||
static constexpr auto Seq2Actor0 = 4;
|
||||
|
||||
public:
|
||||
SubFst048() : Sapphire::ScriptAPI::EventScript( 65911 ){};
|
||||
~SubFst048() {};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Event Handlers
|
||||
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||
{
|
||||
auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
||||
auto actor = eventMgr.mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
|
||||
|
||||
if ( actor == Actor0 && !player.hasQuest( getId() ) )
|
||||
Scene00000( player );
|
||||
if ( actor == Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||
Scene00004( player );
|
||||
if ( actor == Actor1 )
|
||||
Scene00001( player );
|
||||
if ( actor == Actor2 )
|
||||
Scene00002( player );
|
||||
if ( actor == Actor3 )
|
||||
Scene00003( player );
|
||||
}
|
||||
|
||||
void checkQuestCompletion( Entity::Player& player )
|
||||
{
|
||||
auto credit = player.getQuestUI8AL( getId() );
|
||||
|
||||
if ( credit + 1 >= 3 )
|
||||
{
|
||||
player.setQuestUI8AL( getId(), credit + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, credit + 1, 3 );
|
||||
player.updateQuest( getId(), SeqFinish );
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setQuestUI8AL( getId(), credit + 1 );
|
||||
player.sendQuestMessage( getId(), 0, 2, credit + 1, 3 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Available Scenes in this quest, not necessarly all are used
|
||||
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(), Seq1 );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00001( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 1, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
checkQuestCompletion( player );
|
||||
player.setQuestBitFlag8( getId(), 1, true );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00002( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 2, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
checkQuestCompletion( player );
|
||||
player.setQuestBitFlag8( getId(), 2, true );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00003( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 3, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
checkQuestCompletion( player );
|
||||
player.setQuestBitFlag8( getId(), 3, true );
|
||||
} );
|
||||
}
|
||||
|
||||
void Scene00004( Entity::Player& player )
|
||||
{
|
||||
player.playScene( getId(), 4, HIDE_HOTBAR,
|
||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||
{
|
||||
if( result.param2 == 1 )
|
||||
if ( player.giveQuestRewards( getId(), result.param3 ) )
|
||||
{
|
||||
player.finishQuest( getId() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( SubFst048 );
|
Loading…
Add table
Reference in a new issue