mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 08:07:46 +00:00
Re-push Gridania's quests
This commit is contained in:
parent
0a6164fc03
commit
05bd40a646
10 changed files with 1585 additions and 0 deletions
112
src/servers/Scripts/quest/subquest/gridania/SubFst003.cpp
Normal file
112
src/servers/Scripts/quest/subquest/gridania/SubFst003.cpp
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst003_00026
|
||||||
|
// Quest Name: Once Bitten, Twice Shy
|
||||||
|
// Quest ID: 65562
|
||||||
|
// Start NPC: 1000297
|
||||||
|
// End NPC: 1000315
|
||||||
|
|
||||||
|
class SubFst003 : 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 = 50;
|
||||||
|
static constexpr auto RewardGil = 118;
|
||||||
|
|
||||||
|
// Entities found in the script data of the quest
|
||||||
|
static constexpr auto Actor0 = 1000297;
|
||||||
|
static constexpr auto Actor1 = 1000315;
|
||||||
|
static constexpr auto Item0 = 2000028;
|
||||||
|
static constexpr auto Seq0Actor0 = 0;
|
||||||
|
static constexpr auto Seq1Actor1 = 1;
|
||||||
|
static constexpr auto Seq1Actor1Npctradeno = 99;
|
||||||
|
static constexpr auto Seq1Actor1Npctradeok = 100;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst003() : EventScript( 65562 )
|
||||||
|
{};
|
||||||
|
~SubFst003()
|
||||||
|
{};
|
||||||
|
|
||||||
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
{
|
||||||
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
|
if( actor == SubFst003::Actor0 )
|
||||||
|
{
|
||||||
|
Scene00000( player );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst003::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 ) // accept quest
|
||||||
|
{
|
||||||
|
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, 0, 0 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00100( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 100, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
if( player.giveQuestRewards( getId(), 0 ) )
|
||||||
|
{
|
||||||
|
player.setQuestUI8BH( getId(), 0 );
|
||||||
|
player.finishQuest( getId() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
129
src/servers/Scripts/quest/subquest/gridania/SubFst004.cpp
Normal file
129
src/servers/Scripts/quest/subquest/gridania/SubFst004.cpp
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst004_00027
|
||||||
|
// Quest Name: Preserving the Past
|
||||||
|
// Quest ID: 65563
|
||||||
|
// Start NPC: 1000194
|
||||||
|
// End NPC: 1000789
|
||||||
|
|
||||||
|
class SubFst004 : 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 = 50;
|
||||||
|
static constexpr auto RewardItem = 5594;
|
||||||
|
static constexpr auto RewardItemCount = 10 ;
|
||||||
|
|
||||||
|
// Entities found in the script data of the quest
|
||||||
|
static constexpr auto Actor0 = 1000194;
|
||||||
|
static constexpr auto Actor1 = 1000686;
|
||||||
|
static constexpr auto Actor2 = 1000789;
|
||||||
|
static constexpr auto Item0 = 2000024;
|
||||||
|
static constexpr auto Seq0Actor0 = 0;
|
||||||
|
static constexpr auto Seq1Actor1 = 1;
|
||||||
|
static constexpr auto Seq2Actor2 = 2;
|
||||||
|
static constexpr auto Seq2Actor2Npctradeno = 99;
|
||||||
|
static constexpr auto Seq2Actor2Npctradeok = 100;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst004() : EventScript( 65563 )
|
||||||
|
{};
|
||||||
|
~SubFst004()
|
||||||
|
{};
|
||||||
|
|
||||||
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
{
|
||||||
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
|
if( actor == SubFst004::Actor0 )
|
||||||
|
{
|
||||||
|
Scene00000( player );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst004::Actor1 )
|
||||||
|
{
|
||||||
|
Scene00001( player );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst004::Actor2 )
|
||||||
|
{
|
||||||
|
Scene00002( player );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void Scene00000( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 0, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
if( result.param2 == 1 ) // accept quest
|
||||||
|
player.updateQuest( getId(), 1 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00001( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 1, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
player.sendQuestMessage( getId(), 0, 1, 21002, 0 );
|
||||||
|
player.setQuestUI8BH( getId(), 1 );
|
||||||
|
player.updateQuest( getId(), 255 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00002( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 2, 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, 0, 0 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00100( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 100, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
player.setQuestUI8AL( getId(), 0 );
|
||||||
|
|
||||||
|
if( player.giveQuestRewards( getId(), 0 ) )
|
||||||
|
{
|
||||||
|
player.finishQuest( getId() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
129
src/servers/Scripts/quest/subquest/gridania/SubFst008.cpp
Normal file
129
src/servers/Scripts/quest/subquest/gridania/SubFst008.cpp
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst008_00032
|
||||||
|
// Quest Name: A Hard Nut to Crack
|
||||||
|
// Quest ID: 65568
|
||||||
|
// Start NPC: 1000372
|
||||||
|
// End NPC: 1000629
|
||||||
|
|
||||||
|
class SubFst008 : 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 = 100;
|
||||||
|
uint32_t RewardItemOptional[3] = { 2999, 3010, 5824 };
|
||||||
|
uint32_t RewardItemOptionalCount[3] = { 1, 1, 1 };
|
||||||
|
|
||||||
|
// Entities found in the script data of the quest
|
||||||
|
static constexpr auto Actor0 = 1000372;
|
||||||
|
static constexpr auto Actor1 = 1000311;
|
||||||
|
static constexpr auto Actor2 = 1000629;
|
||||||
|
static constexpr auto Item0 = 2000029;
|
||||||
|
static constexpr auto Seq0Actor0 = 0;
|
||||||
|
static constexpr auto Seq1Actor1 = 1;
|
||||||
|
static constexpr auto Seq2Actor2 = 2;
|
||||||
|
static constexpr auto Seq2Actor2Npctradeno = 99;
|
||||||
|
static constexpr auto Seq2Actor2Npctradeok = 100;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst008() : EventScript( 65568 )
|
||||||
|
{};
|
||||||
|
~SubFst008()
|
||||||
|
{};
|
||||||
|
|
||||||
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
{
|
||||||
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
|
if( actor == SubFst008::Actor0 )
|
||||||
|
{
|
||||||
|
Scene00000( player );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst008::Actor1 )
|
||||||
|
{
|
||||||
|
Scene00001( player );
|
||||||
|
}
|
||||||
|
else if( Actor2 == SubFst008::Actor2 )
|
||||||
|
{
|
||||||
|
Scene00002( 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(), 1 );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00001( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 1, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
player.setQuestUI8BH( getId(), 1 );
|
||||||
|
player.updateQuest( getId(), 255 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00002( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 2, 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, 0, 0 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00100( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene(getId(), 100, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
if ( player.giveQuestRewards( getId(), 0 ) )
|
||||||
|
{
|
||||||
|
player.setQuestUI8BH( getId(), 0 );
|
||||||
|
player.finishQuest( getId() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
96
src/servers/Scripts/quest/subquest/gridania/SubFst011.cpp
Normal file
96
src/servers/Scripts/quest/subquest/gridania/SubFst011.cpp
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst011_00037
|
||||||
|
// Quest Name: Population Control
|
||||||
|
// Quest ID: 65573
|
||||||
|
// Start NPC: 1000195
|
||||||
|
// End NPC: 1000195
|
||||||
|
|
||||||
|
//NEED TEST KILLCREDIT
|
||||||
|
|
||||||
|
class SubFst011 : public EventScript
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
// GetQuestUI8AL
|
||||||
|
|
||||||
|
enum Sequence : uint8_t
|
||||||
|
{
|
||||||
|
Seq0 = 0,
|
||||||
|
Seq1 = 1,
|
||||||
|
SeqFinish = 255,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Quest rewards
|
||||||
|
static constexpr auto RewardExpFactor = 100;
|
||||||
|
uint32_t RewardItemOptional[3] = { 2653, 2655, 5823 };
|
||||||
|
uint32_t RewardItemCount[3] = { 1, 1, 3 };
|
||||||
|
|
||||||
|
static constexpr auto Actor0 = 1000195;
|
||||||
|
static constexpr auto Enemy0 = 47;
|
||||||
|
static constexpr auto Seq0Actor0 = 0;
|
||||||
|
static constexpr auto Seq2Actor0 = 1;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst011() : EventScript( 65573 )
|
||||||
|
{};
|
||||||
|
~SubFst011()
|
||||||
|
{};
|
||||||
|
|
||||||
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
{
|
||||||
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
|
if( actor == SubFst011::Actor0 && !player.hasQuest( getId() ) )
|
||||||
|
{
|
||||||
|
Scene00000( player );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst011::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 ) // accept quest
|
||||||
|
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 ) // finish quest
|
||||||
|
{
|
||||||
|
if( player.giveQuestRewards( getId(), 0 ) )
|
||||||
|
player.finishQuest( getId() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
};
|
||||||
|
};
|
361
src/servers/Scripts/quest/subquest/gridania/SubFst014.cpp
Normal file
361
src/servers/Scripts/quest/subquest/gridania/SubFst014.cpp
Normal file
|
@ -0,0 +1,361 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst014_00041
|
||||||
|
// Quest Name: Covered in Roses
|
||||||
|
// Quest ID: 65577
|
||||||
|
// Start NPC: 1000300
|
||||||
|
// End NPC: 1000300
|
||||||
|
|
||||||
|
class SubFst014 : public EventScript
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
// Basic quest information
|
||||||
|
// Quest vars / flags used
|
||||||
|
// setQuestBitFlag8
|
||||||
|
// GetQuestUI8AL
|
||||||
|
// GetQuestUI8BH
|
||||||
|
|
||||||
|
enum Sequence : uint8_t
|
||||||
|
{
|
||||||
|
Seq0 = 0,
|
||||||
|
Seq1 = 1,
|
||||||
|
SeqFinish = 255,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Quest rewards
|
||||||
|
static constexpr auto RewardExpFactor = 50;
|
||||||
|
static constexpr auto RewardGil = 111;
|
||||||
|
|
||||||
|
// Entities found in the script data of the quest
|
||||||
|
static constexpr auto Actor0 = 1000300;
|
||||||
|
static constexpr auto Eobject0 = 2000026;
|
||||||
|
static constexpr auto Eobject1 = 2000027;
|
||||||
|
static constexpr auto Eobject2 = 2000028;
|
||||||
|
static constexpr auto Eobject3 = 2000029;
|
||||||
|
static constexpr auto Eobject4 = 2000030;
|
||||||
|
static constexpr auto Eobject5 = 2000031;
|
||||||
|
static constexpr auto EventActionSearch = 1;
|
||||||
|
static constexpr auto Item0 = 2000084;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst014() : EventScript( 65577 )
|
||||||
|
{};
|
||||||
|
~SubFst014()
|
||||||
|
{};
|
||||||
|
|
||||||
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
{
|
||||||
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
|
if( actor == SubFst014::Actor0 && !player.hasQuest( getId() ) )
|
||||||
|
{
|
||||||
|
Scene00000( player );
|
||||||
|
}
|
||||||
|
else if ( actor == SubFst014::Actor0 )
|
||||||
|
{
|
||||||
|
Scene00007( player );
|
||||||
|
}
|
||||||
|
//EOBJECTS CHECK
|
||||||
|
else if( actor == SubFst014::Eobject0 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00001( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst014::Eobject1 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00002( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst014::Eobject2 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00003( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst014::Eobject3 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00004( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst014::Eobject4 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00005( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst014::Eobject5 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00006( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void checkQuestcompletion( Entity::Player& player )
|
||||||
|
{
|
||||||
|
auto currentCC = player.getQuestUI8AL( getId() );
|
||||||
|
|
||||||
|
player.sendQuestMessage( getId(), 0, 2, currentCC + 1, 6 );
|
||||||
|
|
||||||
|
if( currentCC + 1 >= 6 )
|
||||||
|
{
|
||||||
|
player.updateQuest( getId(), SeqFinish );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.setQuestUI8AL( getId(), currentCC + 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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 )
|
||||||
|
{
|
||||||
|
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 )
|
||||||
|
{
|
||||||
|
Scene00096( player );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00004( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 4, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
Scene00094( player );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00005( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 5, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
Scene00092( player );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00006( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 6, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
Scene00090( player );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00007( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 7, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
if( result.param2 == 1 )
|
||||||
|
{
|
||||||
|
Scene00088( player );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Scene00087( player );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00087( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 87, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 87, 0, 0, 0 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00088( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 88, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
if( result.param2 == 1 )
|
||||||
|
{
|
||||||
|
if( player.giveQuestRewards( getId(), 0) )
|
||||||
|
{
|
||||||
|
player.setQuestUI8AL( getId(), 0 );
|
||||||
|
player.finishQuest( getId() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00089( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 89, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00090( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 90, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
checkQuestcompletion( player );
|
||||||
|
player.setQuestBitFlag8( getId(), 2, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00091( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 91, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00092( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 92, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
checkQuestcompletion( player );
|
||||||
|
player.setQuestBitFlag8( getId(), 3, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00093( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 93, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00094( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 94, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
checkQuestcompletion( player );
|
||||||
|
player.setQuestBitFlag8( getId(), 4, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00095( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 95, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00096( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 96, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
checkQuestcompletion( player );
|
||||||
|
player.setQuestBitFlag8( getId(), 5, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
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(), 6, 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(), 7, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
333
src/servers/Scripts/quest/subquest/gridania/SubFst015.cpp
Normal file
333
src/servers/Scripts/quest/subquest/gridania/SubFst015.cpp
Normal file
|
@ -0,0 +1,333 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst015_00042
|
||||||
|
// Quest Name: Sylphic Gratitude
|
||||||
|
// Quest ID: 65578
|
||||||
|
// Start NPC: 1000286
|
||||||
|
// End NPC: 1000286
|
||||||
|
|
||||||
|
class SubFst015 : public EventScript
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
// Basic quest information
|
||||||
|
// Quest vars / flags used
|
||||||
|
// GetQuestBitFlag8
|
||||||
|
// GetQuestUI8AL
|
||||||
|
|
||||||
|
enum Sequence : uint8_t
|
||||||
|
{
|
||||||
|
Seq0 = 0,
|
||||||
|
Seq1 = 1,
|
||||||
|
SeqFinish = 255,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Quest rewards
|
||||||
|
static constexpr auto RewardExpFactor = 50;
|
||||||
|
static constexpr auto RewardGil = 110;
|
||||||
|
|
||||||
|
// Entities found in the script data of the quest
|
||||||
|
static constexpr auto Actor0 = 1000286;
|
||||||
|
static constexpr auto Eobject0 = 2000020;
|
||||||
|
static constexpr auto Eobject1 = 2000021;
|
||||||
|
static constexpr auto Eobject2 = 2000022;
|
||||||
|
static constexpr auto Eobject3 = 2000023;
|
||||||
|
static constexpr auto Eobject4 = 2000024;
|
||||||
|
static constexpr auto Eobject5 = 2000025;
|
||||||
|
static constexpr auto EventActionSearch = 1;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst015() : EventScript( 65578 )
|
||||||
|
{};
|
||||||
|
~SubFst015()
|
||||||
|
{};
|
||||||
|
|
||||||
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
{
|
||||||
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
|
if( actor == SubFst015::Actor0 && !player.hasQuest( getId() ) )
|
||||||
|
{
|
||||||
|
Scene00000( player );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst015::Actor0 )
|
||||||
|
{
|
||||||
|
Scene00007( player );
|
||||||
|
}
|
||||||
|
//EOBJECTS CHECK
|
||||||
|
else if( actor == SubFst015::Eobject0 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00001( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst015::Eobject1 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00002( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst015::Eobject2 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00003( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst015::Eobject3 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00004( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst015::Eobject4 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00005( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst015::Eobject5 )
|
||||||
|
{
|
||||||
|
player.eventActionStart( getId(), 0x01,
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{
|
||||||
|
Scene00006( player );
|
||||||
|
},
|
||||||
|
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||||
|
{},
|
||||||
|
eventId );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void checkQuestcompletion( Entity::Player& player )
|
||||||
|
{
|
||||||
|
auto currentCC = player.getQuestUI8AL( getId() );
|
||||||
|
|
||||||
|
player.sendQuestMessage( getId(), 0, 2, currentCC + 1, 6 );
|
||||||
|
|
||||||
|
if( currentCC + 1 >= 6 )
|
||||||
|
{
|
||||||
|
player.updateQuest( getId(), SeqFinish );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.setQuestUI8AL( getId(), currentCC + 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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 )
|
||||||
|
{
|
||||||
|
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 )
|
||||||
|
{
|
||||||
|
Scene00096( player );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00004( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 4, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
Scene00094( player );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00005( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 5, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
Scene00092( player );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00006( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 6, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
Scene00090( player );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00007( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 7, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
if( result.param2 == 1 )
|
||||||
|
{
|
||||||
|
if( player.giveQuestRewards( getId(), 0 ) )
|
||||||
|
player.finishQuest( getId() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00089( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 89, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00090( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 90, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
checkQuestcompletion( player );
|
||||||
|
player.setQuestBitFlag8( getId(), 2, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00091( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 91, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00092( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 92, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
checkQuestcompletion( player );
|
||||||
|
player.setQuestBitFlag8( getId(), 3, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00093( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 93, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00094( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 94, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
checkQuestcompletion( player );
|
||||||
|
player.setQuestBitFlag8( getId(), 4, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00095( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 95, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00096( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 96, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
checkQuestcompletion( player );
|
||||||
|
player.setQuestBitFlag8( getId(), 5, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
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(), 6, 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(), 7, true );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
84
src/servers/Scripts/quest/subquest/gridania/SubFst019.cpp
Normal file
84
src/servers/Scripts/quest/subquest/gridania/SubFst019.cpp
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst019_00049
|
||||||
|
// Quest Name: I Am Millicent, Hear Me Roar
|
||||||
|
// Quest ID: 65585
|
||||||
|
// Start NPC: 1000788
|
||||||
|
// End NPC: 1000429
|
||||||
|
|
||||||
|
class SubFst019 : 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 = 50;
|
||||||
|
static constexpr auto RewardItem = 4551;
|
||||||
|
static constexpr auto RewardItemCount = 5;
|
||||||
|
|
||||||
|
// Entities found in the script data of the quest
|
||||||
|
static constexpr auto Actor0 = 1000788;
|
||||||
|
static constexpr auto Actor1 = 1000429;
|
||||||
|
static constexpr auto Seq0Actor0 = 0;
|
||||||
|
static constexpr auto Seq1Actor1 = 1;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst019() : EventScript( 65585 )
|
||||||
|
{};
|
||||||
|
~SubFst019()
|
||||||
|
{};
|
||||||
|
|
||||||
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
{
|
||||||
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
|
if( actor == SubFst019::Actor0 )
|
||||||
|
{
|
||||||
|
Scene00000( player );
|
||||||
|
}
|
||||||
|
else if( actor == SubFst019::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() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
99
src/servers/Scripts/quest/subquest/gridania/SubFst026.cpp
Normal file
99
src/servers/Scripts/quest/subquest/gridania/SubFst026.cpp
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst026_00170
|
||||||
|
// Quest Name: Jumping at Shadows
|
||||||
|
// Quest ID: 65706
|
||||||
|
// Start NPC: 1000629
|
||||||
|
// End NPC: 1000629
|
||||||
|
|
||||||
|
//NEED TEST KILLCREDIT
|
||||||
|
|
||||||
|
class SubFst026 : 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 = 100;
|
||||||
|
static constexpr auto RewardGil = 135;
|
||||||
|
|
||||||
|
// Entities found in the script data of the quest
|
||||||
|
static constexpr auto Actor0 = 1000629;
|
||||||
|
static constexpr auto Enemy0 = 9;
|
||||||
|
static constexpr auto Seq0Actor0 = 0;
|
||||||
|
static constexpr auto Seq2Actor0 = 1;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst026() : EventScript( 65706 )
|
||||||
|
{};
|
||||||
|
~SubFst026()
|
||||||
|
{};
|
||||||
|
|
||||||
|
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 && player.getQuestSeq( getId() ) == 255 )
|
||||||
|
{
|
||||||
|
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() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
110
src/servers/Scripts/quest/subquest/gridania/SubFst029.cpp
Normal file
110
src/servers/Scripts/quest/subquest/gridania/SubFst029.cpp
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst029_00172
|
||||||
|
// Quest Name: More than a Flesh Wound
|
||||||
|
// Quest ID: 65708
|
||||||
|
// Start NPC: 1000430
|
||||||
|
// End NPC: 1000430
|
||||||
|
|
||||||
|
class SubFst029 : public EventScript
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
// Basic quest information
|
||||||
|
// Quest vars / flags used
|
||||||
|
// GetQuestUI8AH
|
||||||
|
|
||||||
|
enum Sequence : uint8_t
|
||||||
|
{
|
||||||
|
Seq0 = 0,
|
||||||
|
SeqFinish = 255,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Quest rewards
|
||||||
|
static constexpr auto RewardExpFactor = 100;
|
||||||
|
static constexpr auto RewardGil = 146;
|
||||||
|
|
||||||
|
// Entities found in the script data of the quest
|
||||||
|
static constexpr auto Actor0 = 1000430;
|
||||||
|
static constexpr auto Ritem0 = 4552;
|
||||||
|
static constexpr auto Seq0Actor0 = 0;
|
||||||
|
static constexpr auto Seq1Actor0 = 1;
|
||||||
|
static constexpr auto Seq1Actor0Npctradeno = 99;
|
||||||
|
static constexpr auto Seq1Actor0Npctradeok = 100;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst029() : EventScript( 65708 )
|
||||||
|
{};
|
||||||
|
~SubFst029()
|
||||||
|
{};
|
||||||
|
|
||||||
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
{
|
||||||
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
|
//NOT SAFE - CRASH
|
||||||
|
|
||||||
|
/*if( actor == SubFst029::Actor0 && !player.hasQuest( getId() ) )
|
||||||
|
{
|
||||||
|
Scene00000( player );
|
||||||
|
}
|
||||||
|
if( actor == SubFst029::Actor0 && player.getQuestSeq ( getId() ) == 255 )
|
||||||
|
{
|
||||||
|
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 )
|
||||||
|
{
|
||||||
|
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, 0, 0 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00100( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 100, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
if( player.giveQuestRewards( getId(), 0 ) )
|
||||||
|
{
|
||||||
|
player.finishQuest( getId() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
132
src/servers/Scripts/quest/subquest/gridania/SubFst041.cpp
Normal file
132
src/servers/Scripts/quest/subquest/gridania/SubFst041.cpp
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
#include <Script/NativeScriptApi.h>
|
||||||
|
#include <Actor/Player.h>
|
||||||
|
#include "Event/EventHelper.h"
|
||||||
|
#include <ScriptObject.h>
|
||||||
|
|
||||||
|
// Quest Script: SubFst041_00197
|
||||||
|
// Quest Name: Splitting Shells
|
||||||
|
// Quest ID: 65733
|
||||||
|
// Start NPC: 1000432
|
||||||
|
// End NPC: 1000411
|
||||||
|
|
||||||
|
//NEED TEST KILLCREDIT
|
||||||
|
|
||||||
|
class SubFst041 : 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 = 100;
|
||||||
|
uint32_t RewardItemOptional[3] = { 4657, 4658, 5823 };
|
||||||
|
uint32_t RewardItemOptionalCount[3] = { 3, 3, 3 };
|
||||||
|
|
||||||
|
// 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 Item0 = 2000142;
|
||||||
|
static constexpr auto Seq0Actor0 = 0;
|
||||||
|
static constexpr auto Seq2Actor1 = 1;
|
||||||
|
static constexpr auto Seq2Actor1Npctradeno = 99;
|
||||||
|
static constexpr auto Seq2Actor1Npctradeok = 100;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SubFst041() : EventScript( 65733 )
|
||||||
|
{};
|
||||||
|
~SubFst041()
|
||||||
|
{};
|
||||||
|
|
||||||
|
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
|
||||||
|
{
|
||||||
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
|
if( actor == SubFst041::Actor0 )
|
||||||
|
{
|
||||||
|
Scene00000( player );
|
||||||
|
}
|
||||||
|
if( actor == SubFst041::Actor1 )
|
||||||
|
{
|
||||||
|
Scene00001(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void onMobKill( Entity::Player& player, uint64_t npcId )
|
||||||
|
{
|
||||||
|
if( npcId != Enemy0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto currentKC = player.getQuestUI8BH( getId() ) + 1;
|
||||||
|
|
||||||
|
if( currentKC >= 6 )
|
||||||
|
player.updateQuest( getId(), 255 );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.setQuestUI8BH( 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 )
|
||||||
|
{
|
||||||
|
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, 0, 0 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene00100( Entity::Player& player )
|
||||||
|
{
|
||||||
|
player.playScene( getId(), 100, HIDE_HOTBAR,
|
||||||
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
|
{
|
||||||
|
if( player.giveQuestRewards( getId(), 0 ) )
|
||||||
|
{
|
||||||
|
player.setQuestUI8BH( getId(), 0 );
|
||||||
|
player.finishQuest( getId() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue