1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-02 08:57:44 +00:00

eobj_parser also parses questbattles now

This commit is contained in:
Mordred 2019-03-31 13:06:37 +02:00
parent e18ec582ed
commit 305a1e9c3a
4 changed files with 66 additions and 6 deletions

View file

@ -3,12 +3,10 @@
using namespace Sapphire;
class INSTANCE_NAME :
public Sapphire::ScriptAPI::InstanceContentScript
class INSTANCE_NAME : public Sapphire::ScriptAPI::InstanceContentScript
{
public:
INSTANCE_NAME() :
Sapphire::ScriptAPI::InstanceContentScript( INSTANCE_ID )
INSTANCE_NAME() : Sapphire::ScriptAPI::InstanceContentScript( INSTANCE_ID )
{ }
void onInit( InstanceContent& instance ) override

View file

@ -482,6 +482,11 @@ int main( int argc, char* argv[] )
zoneDumpList.emplace( zoneName );
}
auto& catQuestBattle = eData->get_category( "QuestBattle" );
auto questBattleData = static_cast< xiv::exd::Exd >( catQuestBattle.get_data_ln( xiv::exd::Language::none ) );
for( auto entry : contentList )
{
std::string eobjects = "";
@ -728,7 +733,14 @@ int main( int argc, char* argv[] )
}
std::cout << "\n\n\n";
std::ifstream t( "instance.tmpl" );
std::ifstream t;
if( entry.type == 7 )
{
t = std::ifstream ( "questbattle.tmpl" );
}
else
t = std::ifstream ( "instance.tmpl" );
std::string instanceTpl( ( std::istreambuf_iterator< char >( t ) ),
std::istreambuf_iterator< char >() );
@ -736,6 +748,24 @@ int main( int argc, char* argv[] )
result = std::regex_replace( result, std::regex( "\\INSTANCE_ID" ), std::to_string( entry.id ) );
result = std::regex_replace( result, std::regex( "\\EOBJ_INIT" ), eobjects );
if( entry.type == 7 )
{
if( entry.id > 200 )
continue;
std::string instruction;
auto row = questBattleData.get_row( entry.id );
for( int i = 0; i < 149; ++i )
{
if( std::get< std::string >( row.at( 4 + i ) ).empty() )
continue;
instruction += " static constexpr auto " + std::get< std::string >( row.at( 4 + i ) ) + " = " +
std::to_string( std::get< uint32_t >( row.at( 154 + i ) ) )+ ";\n";
}
result = std::regex_replace( result, std::regex( "\\SCRIPT_INSTRUCTIONS" ), instruction );
}
std::string subdir = "";

View file

@ -0,0 +1,32 @@
#include <ScriptObject.h>
#include <Territory/QuestBattle.h>
using namespace Sapphire;
class INSTANCE_NAME : public Sapphire::ScriptAPI::QuestBattleScript
{
private:
SCRIPT_INSTRUCTIONS
public:
INSTANCE_NAME() : Sapphire::ScriptAPI::QuestBattleScript( INSTANCE_ID )
{ }
void onInit( QuestBattle& instance ) override
{
EOBJ_INIT
}
void onUpdate( QuestBattle& instance, uint32_t currTime ) override
{
}
void onEnterTerritory( QuestBattle& instance, Entity::Player& player, uint32_t eventId, uint16_t param1,
uint16_t param2 ) override
{
}
};
EXPOSE_SCRIPT( INSTANCE_NAME );