mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 00:47:45 +00:00
eobj_parser also parses questbattles now
This commit is contained in:
parent
e18ec582ed
commit
305a1e9c3a
4 changed files with 66 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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 = "";
|
||||
|
||||
|
|
32
src/tools/event_object_parser/questbattle.tmpl
Normal file
32
src/tools/event_object_parser/questbattle.tmpl
Normal 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 );
|
|
@ -73,7 +73,7 @@ namespace Sapphire::Network::Packets::Server
|
|||
m_data.currentMount = player.getCurrentMount();
|
||||
//m_data.activeMinion = player.getCurrentCompanion();
|
||||
m_data.activeMinion = 0;
|
||||
|
||||
|
||||
m_data.onlineStatus = static_cast< uint8_t >( player.getOnlineStatus() );
|
||||
|
||||
//m_data.u23 = 0x04;
|
||||
|
|
Loading…
Add table
Reference in a new issue