mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
Merge pull request #234 from goaaats/exd_rework
zone, api: Removed old EXD reader
This commit is contained in:
commit
7a23d24336
28 changed files with 288 additions and 211 deletions
|
@ -735,7 +735,9 @@
|
||||||
name = exdData->getField< std::string >( row, 0 );
|
name = exdData->getField< std::string >( row, 0 );
|
||||||
abbreviation = exdData->getField< std::string >( row, 1 );
|
abbreviation = exdData->getField< std::string >( row, 1 );
|
||||||
classJobCategory = exdData->getField< uint8_t >( row, 3 );
|
classJobCategory = exdData->getField< uint8_t >( row, 3 );
|
||||||
|
expArrayIndex = exdData->getField< int8_t >( row, 4 );
|
||||||
modifierHitPoints = exdData->getField< uint16_t >( row, 9 );
|
modifierHitPoints = exdData->getField< uint16_t >( row, 9 );
|
||||||
|
modifierManaPoints = exdData->getField< uint16_t >( row, 10 );
|
||||||
modifierStrength = exdData->getField< uint16_t >( row, 11 );
|
modifierStrength = exdData->getField< uint16_t >( row, 11 );
|
||||||
modifierVitality = exdData->getField< uint16_t >( row, 12 );
|
modifierVitality = exdData->getField< uint16_t >( row, 12 );
|
||||||
modifierDexterity = exdData->getField< uint16_t >( row, 13 );
|
modifierDexterity = exdData->getField< uint16_t >( row, 13 );
|
||||||
|
@ -2380,7 +2382,9 @@
|
||||||
placeNameRegion = exdData->getField< uint16_t >( row, 9 );
|
placeNameRegion = exdData->getField< uint16_t >( row, 9 );
|
||||||
placeName = exdData->getField< uint16_t >( row, 10 );
|
placeName = exdData->getField< uint16_t >( row, 10 );
|
||||||
placeNameSub = exdData->getField< uint16_t >( row, 11 );
|
placeNameSub = exdData->getField< uint16_t >( row, 11 );
|
||||||
|
discoveryIndex = exdData->getField< int16_t >( row, 12 );
|
||||||
territoryType = exdData->getField< uint16_t >( row, 14 );
|
territoryType = exdData->getField< uint16_t >( row, 14 );
|
||||||
|
discoveryArrayByte = exdData->getField< bool >( row, 15 );
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Data::MapMarker::MapMarker( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
Core::Data::MapMarker::MapMarker( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||||
|
@ -2571,6 +2575,12 @@
|
||||||
icon = exdData->getField< uint32_t >( row, 4 );
|
icon = exdData->getField< uint32_t >( row, 4 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::Data::Opening::Opening( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||||
|
{
|
||||||
|
auto row = exdData->m_OpeningDat.get_row( row_id );
|
||||||
|
name = exdData->getField< std::string >( row, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
Core::Data::Orchestrion::Orchestrion( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
Core::Data::Orchestrion::Orchestrion( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||||
{
|
{
|
||||||
auto row = exdData->m_OrchestrionDat.get_row( row_id );
|
auto row = exdData->m_OrchestrionDat.get_row( row_id );
|
||||||
|
@ -3702,6 +3712,10 @@
|
||||||
defaultTalkNPCWin = exdData->getField< uint32_t >( row, 22 );
|
defaultTalkNPCWin = exdData->getField< uint32_t >( row, 22 );
|
||||||
defaultTalkDraw = exdData->getField< uint32_t >( row, 23 );
|
defaultTalkDraw = exdData->getField< uint32_t >( row, 23 );
|
||||||
defaultTalkPCWin = exdData->getField< uint32_t >( row, 24 );
|
defaultTalkPCWin = exdData->getField< uint32_t >( row, 24 );
|
||||||
|
itemPossibleReward.push_back( exdData->getField< uint32_t >( row, 26 ) );
|
||||||
|
itemPossibleReward.push_back( exdData->getField< uint32_t >( row, 27 ) );
|
||||||
|
itemPossibleReward.push_back( exdData->getField< uint32_t >( row, 28 ) );
|
||||||
|
itemPossibleReward.push_back( exdData->getField< uint32_t >( row, 29 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Data::TripleTriadCard::TripleTriadCard( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
Core::Data::TripleTriadCard::TripleTriadCard( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||||
|
@ -4096,6 +4110,7 @@ bool Core::Data::ExdDataGenerated::init( const std::string& path )
|
||||||
m_NpcEquipDat = setupDatAccess( "NpcEquip", xiv::exd::Language::none );
|
m_NpcEquipDat = setupDatAccess( "NpcEquip", xiv::exd::Language::none );
|
||||||
m_OmenDat = setupDatAccess( "Omen", xiv::exd::Language::none );
|
m_OmenDat = setupDatAccess( "Omen", xiv::exd::Language::none );
|
||||||
m_OnlineStatusDat = setupDatAccess( "OnlineStatus", xiv::exd::Language::en );
|
m_OnlineStatusDat = setupDatAccess( "OnlineStatus", xiv::exd::Language::en );
|
||||||
|
m_OpeningDat = setupDatAccess( "Opening", xiv::exd::Language::none );
|
||||||
m_OrchestrionDat = setupDatAccess( "Orchestrion", xiv::exd::Language::en );
|
m_OrchestrionDat = setupDatAccess( "Orchestrion", xiv::exd::Language::en );
|
||||||
m_OrchestrionPathDat = setupDatAccess( "OrchestrionPath", xiv::exd::Language::none );
|
m_OrchestrionPathDat = setupDatAccess( "OrchestrionPath", xiv::exd::Language::none );
|
||||||
m_ParamGrowDat = setupDatAccess( "ParamGrow", xiv::exd::Language::none );
|
m_ParamGrowDat = setupDatAccess( "ParamGrow", xiv::exd::Language::none );
|
||||||
|
@ -7555,6 +7570,21 @@ boost::shared_ptr< Core::Data::OnlineStatus >
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
boost::shared_ptr< Core::Data::Opening >
|
||||||
|
Core::Data::ExdDataGenerated::getOpening( uint32_t OpeningId )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
auto row = m_OpeningDat.get_row( OpeningId );
|
||||||
|
auto info = boost::make_shared< Opening >( OpeningId, this );
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
catch( ... )
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
boost::shared_ptr< Core::Data::Orchestrion >
|
boost::shared_ptr< Core::Data::Orchestrion >
|
||||||
Core::Data::ExdDataGenerated::getOrchestrion( uint32_t OrchestrionId )
|
Core::Data::ExdDataGenerated::getOrchestrion( uint32_t OrchestrionId )
|
||||||
{
|
{
|
||||||
|
|
|
@ -242,6 +242,7 @@ struct MountAction;
|
||||||
struct NpcEquip;
|
struct NpcEquip;
|
||||||
struct Omen;
|
struct Omen;
|
||||||
struct OnlineStatus;
|
struct OnlineStatus;
|
||||||
|
struct Opening;
|
||||||
struct Orchestrion;
|
struct Orchestrion;
|
||||||
struct OrchestrionPath;
|
struct OrchestrionPath;
|
||||||
struct ParamGrow;
|
struct ParamGrow;
|
||||||
|
@ -936,7 +937,9 @@ struct ClassJob
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string abbreviation;
|
std::string abbreviation;
|
||||||
uint8_t classJobCategory;
|
uint8_t classJobCategory;
|
||||||
|
int8_t expArrayIndex;
|
||||||
uint16_t modifierHitPoints;
|
uint16_t modifierHitPoints;
|
||||||
|
uint16_t modifierManaPoints;
|
||||||
uint16_t modifierStrength;
|
uint16_t modifierStrength;
|
||||||
uint16_t modifierVitality;
|
uint16_t modifierVitality;
|
||||||
uint16_t modifierDexterity;
|
uint16_t modifierDexterity;
|
||||||
|
@ -2425,7 +2428,9 @@ struct Map
|
||||||
uint16_t placeNameRegion;
|
uint16_t placeNameRegion;
|
||||||
uint16_t placeName;
|
uint16_t placeName;
|
||||||
uint16_t placeNameSub;
|
uint16_t placeNameSub;
|
||||||
|
int16_t discoveryIndex;
|
||||||
uint16_t territoryType;
|
uint16_t territoryType;
|
||||||
|
bool discoveryArrayByte;
|
||||||
|
|
||||||
Map( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
Map( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
||||||
};
|
};
|
||||||
|
@ -2604,6 +2609,13 @@ struct OnlineStatus
|
||||||
OnlineStatus( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
OnlineStatus( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Opening
|
||||||
|
{
|
||||||
|
std::string name;
|
||||||
|
|
||||||
|
Opening( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
||||||
|
};
|
||||||
|
|
||||||
struct Orchestrion
|
struct Orchestrion
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
|
@ -3204,6 +3216,7 @@ struct TripleTriad
|
||||||
uint32_t defaultTalkNPCWin;
|
uint32_t defaultTalkNPCWin;
|
||||||
uint32_t defaultTalkDraw;
|
uint32_t defaultTalkDraw;
|
||||||
uint32_t defaultTalkPCWin;
|
uint32_t defaultTalkPCWin;
|
||||||
|
std::vector< uint32_t > itemPossibleReward;
|
||||||
|
|
||||||
TripleTriad( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
TripleTriad( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
||||||
};
|
};
|
||||||
|
@ -3607,6 +3620,7 @@ struct WorldDCGroupType
|
||||||
xiv::exd::Exd m_NpcEquipDat;
|
xiv::exd::Exd m_NpcEquipDat;
|
||||||
xiv::exd::Exd m_OmenDat;
|
xiv::exd::Exd m_OmenDat;
|
||||||
xiv::exd::Exd m_OnlineStatusDat;
|
xiv::exd::Exd m_OnlineStatusDat;
|
||||||
|
xiv::exd::Exd m_OpeningDat;
|
||||||
xiv::exd::Exd m_OrchestrionDat;
|
xiv::exd::Exd m_OrchestrionDat;
|
||||||
xiv::exd::Exd m_OrchestrionPathDat;
|
xiv::exd::Exd m_OrchestrionPathDat;
|
||||||
xiv::exd::Exd m_ParamGrowDat;
|
xiv::exd::Exd m_ParamGrowDat;
|
||||||
|
@ -3906,6 +3920,7 @@ struct WorldDCGroupType
|
||||||
boost::shared_ptr< NpcEquip > getNpcEquip( uint32_t NpcEquipId );
|
boost::shared_ptr< NpcEquip > getNpcEquip( uint32_t NpcEquipId );
|
||||||
boost::shared_ptr< Omen > getOmen( uint32_t OmenId );
|
boost::shared_ptr< Omen > getOmen( uint32_t OmenId );
|
||||||
boost::shared_ptr< OnlineStatus > getOnlineStatus( uint32_t OnlineStatusId );
|
boost::shared_ptr< OnlineStatus > getOnlineStatus( uint32_t OnlineStatusId );
|
||||||
|
boost::shared_ptr< Opening > getOpening( uint32_t OpeningId );
|
||||||
boost::shared_ptr< Orchestrion > getOrchestrion( uint32_t OrchestrionId );
|
boost::shared_ptr< Orchestrion > getOrchestrion( uint32_t OrchestrionId );
|
||||||
boost::shared_ptr< OrchestrionPath > getOrchestrionPath( uint32_t OrchestrionPathId );
|
boost::shared_ptr< OrchestrionPath > getOrchestrionPath( uint32_t OrchestrionPathId );
|
||||||
boost::shared_ptr< ParamGrow > getParamGrow( uint32_t ParamGrowId );
|
boost::shared_ptr< ParamGrow > getParamGrow( uint32_t ParamGrowId );
|
||||||
|
@ -4205,6 +4220,7 @@ struct WorldDCGroupType
|
||||||
std::set< uint32_t > m_NpcEquipIdList;
|
std::set< uint32_t > m_NpcEquipIdList;
|
||||||
std::set< uint32_t > m_OmenIdList;
|
std::set< uint32_t > m_OmenIdList;
|
||||||
std::set< uint32_t > m_OnlineStatusIdList;
|
std::set< uint32_t > m_OnlineStatusIdList;
|
||||||
|
std::set< uint32_t > m_OpeningIdList;
|
||||||
std::set< uint32_t > m_OrchestrionIdList;
|
std::set< uint32_t > m_OrchestrionIdList;
|
||||||
std::set< uint32_t > m_OrchestrionPathIdList;
|
std::set< uint32_t > m_OrchestrionPathIdList;
|
||||||
std::set< uint32_t > m_ParamGrowIdList;
|
std::set< uint32_t > m_ParamGrowIdList;
|
||||||
|
@ -5629,6 +5645,12 @@ const std::set< uint32_t >& getOnlineStatusIdList()
|
||||||
loadIdList( m_OnlineStatusDat, m_OnlineStatusIdList );
|
loadIdList( m_OnlineStatusDat, m_OnlineStatusIdList );
|
||||||
return m_OnlineStatusIdList;
|
return m_OnlineStatusIdList;
|
||||||
}
|
}
|
||||||
|
const std::set< uint32_t >& getOpeningIdList()
|
||||||
|
{
|
||||||
|
if( m_OpeningIdList.size() == 0 )
|
||||||
|
loadIdList( m_OpeningDat, m_OpeningIdList );
|
||||||
|
return m_OpeningIdList;
|
||||||
|
}
|
||||||
const std::set< uint32_t >& getOrchestrionIdList()
|
const std::set< uint32_t >& getOrchestrionIdList()
|
||||||
{
|
{
|
||||||
if( m_OrchestrionIdList.size() == 0 )
|
if( m_OrchestrionIdList.size() == 0 )
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
#include <common/Util/Util.h>
|
#include <common/Util/Util.h>
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
|
|
||||||
#include <common/Database/DatabaseDef.h>
|
#include <common/Database/DatabaseDef.h>
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ namespace Core {
|
||||||
// CharacterId, ClassIdx, Exp, Lvl
|
// CharacterId, ClassIdx, Exp, Lvl
|
||||||
auto stmtClass = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_CLASS_INS );
|
auto stmtClass = g_charaDb.getPreparedStatement( Db::CharaDbStatements::CHARA_CLASS_INS );
|
||||||
stmtClass->setInt( 1, m_id );
|
stmtClass->setInt( 1, m_id );
|
||||||
stmtClass->setInt( 2, g_exdData.m_classJobInfoMap[m_class].exp_idx );
|
stmtClass->setInt( 2, g_exdDataGen.getClassJob( m_class )->expArrayIndex );
|
||||||
stmtClass->setInt( 3, 0 );
|
stmtClass->setInt( 3, 0 );
|
||||||
stmtClass->setInt( 4, 1 );
|
stmtClass->setInt( 4, 1 );
|
||||||
g_charaDb.directExecute( stmtClass );
|
g_charaDb.directExecute( stmtClass );
|
||||||
|
@ -292,14 +292,14 @@ namespace Core {
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
/// SETUP EQUIPMENT / STARTING GEAR
|
/// SETUP EQUIPMENT / STARTING GEAR
|
||||||
auto classJobInfo = g_exdData.m_classJobInfoMap[m_class];
|
auto classJobInfo = g_exdDataGen.getClassJob( m_class );
|
||||||
uint32_t weaponId = classJobInfo.start_weapon_id;
|
uint32_t weaponId = classJobInfo->itemStartingWeapon;
|
||||||
uint64_t uniqueId = getNextUId64();
|
uint64_t uniqueId = getNextUId64();
|
||||||
|
|
||||||
uint8_t race = customize[CharaLook::Race];
|
uint8_t race = customize[CharaLook::Race];
|
||||||
uint8_t gender = customize[CharaLook::Gender];
|
uint8_t gender = customize[CharaLook::Gender];
|
||||||
|
|
||||||
auto raceInfo = g_exdData.getRaceInfo( race );
|
auto raceInfo = g_exdDataGen.getRace( race );
|
||||||
|
|
||||||
uint32_t body;
|
uint32_t body;
|
||||||
uint32_t hands;
|
uint32_t hands;
|
||||||
|
@ -312,17 +312,17 @@ namespace Core {
|
||||||
|
|
||||||
if( gender == 0 )
|
if( gender == 0 )
|
||||||
{
|
{
|
||||||
body = raceInfo->male_body;
|
body = raceInfo->rSEMBody;
|
||||||
hands = raceInfo->male_hands;
|
hands = raceInfo->rSEMHands;
|
||||||
legs = raceInfo->male_legs;
|
legs = raceInfo->rSEMLegs;
|
||||||
feet = raceInfo->male_feet;
|
feet = raceInfo->rSEMFeet;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
body = raceInfo->female_body;
|
body = raceInfo->rSEFBody;
|
||||||
hands = raceInfo->female_hands;
|
hands = raceInfo->rSEFHands;
|
||||||
legs = raceInfo->female_legs;
|
legs = raceInfo->rSEFLegs;
|
||||||
feet = raceInfo->female_feet;
|
feet = raceInfo->rSEFFeet;
|
||||||
}
|
}
|
||||||
|
|
||||||
insertDbGlobalItem( weaponId, uniqueId );
|
insertDbGlobalItem( weaponId, uniqueId );
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include <common/Network/Hive.h>
|
#include <common/Network/Hive.h>
|
||||||
#include <common/Network/Acceptor.h>
|
#include <common/Network/Acceptor.h>
|
||||||
|
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Crypt/base64.h>
|
#include <common/Crypt/base64.h>
|
||||||
|
|
||||||
#include <common/Database/DbLoader.h>
|
#include <common/Database/DbLoader.h>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
Core::Logger g_log;
|
Core::Logger g_log;
|
||||||
Core::Db::DbWorkerPool< Core::Db::CharaDbConnection > g_charaDb;
|
Core::Db::DbWorkerPool< Core::Db::CharaDbConnection > g_charaDb;
|
||||||
Core::Data::ExdData g_exdData;
|
Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
Core::Network::SapphireAPI g_sapphireAPI;
|
Core::Network::SapphireAPI g_sapphireAPI;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -139,10 +139,10 @@ bool loadSettings( int32_t argc, char* argv[] )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_log.info( "Setting up EXD data" );
|
g_log.info( "Setting up generated EXD data" );
|
||||||
if( !g_exdData.init( m_pConfig->getValue< std::string >( "Settings.General.DataPath", "" ) ) )
|
if( !g_exdDataGen.init( m_pConfig->getValue< std::string >( "Settings.General.DataPath", "" ) ) )
|
||||||
{
|
{
|
||||||
g_log.fatal( "Error setting up EXD data " );
|
g_log.fatal( "Error setting up generated EXD data " );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,10 +241,10 @@ std::string buildHttpResponse( uint16_t rCode, const std::string& content = "",
|
||||||
void getZoneName( shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> request )
|
void getZoneName( shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> request )
|
||||||
{
|
{
|
||||||
string number = request->path_match[1];
|
string number = request->path_match[1];
|
||||||
auto it = g_exdData.m_zoneInfoMap.find( atoi( number.c_str() ) );
|
auto info = g_exdDataGen.getTerritoryType( atoi( number.c_str() ) );
|
||||||
std::string responseStr = "Not found!";
|
std::string responseStr = "Not found!";
|
||||||
if( it != g_exdData.m_zoneInfoMap.end() )
|
if( info )
|
||||||
responseStr = it->second.zone_name + ", " + it->second.zone_str;
|
responseStr = info->name + ", " + info->bg;
|
||||||
*response << buildHttpResponse( 200, responseStr );
|
*response << buildHttpResponse( 200, responseStr );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -751,9 +751,6 @@ int main( int argc, char* argv[] )
|
||||||
if( !loadSettings( argc, argv ) )
|
if( !loadSettings( argc, argv ) )
|
||||||
throw std::exception();
|
throw std::exception();
|
||||||
|
|
||||||
g_exdData.loadZoneInfo();
|
|
||||||
g_exdData.loadClassJobInfo();
|
|
||||||
|
|
||||||
server.config.port = stoi( m_pConfig->getValue< std::string >( "Settings.General.HttpPort", "80" ) );
|
server.config.port = stoi( m_pConfig->getValue< std::string >( "Settings.General.HttpPort", "80" ) );
|
||||||
g_log.info( "Starting API server at port " + m_pConfig->getValue< std::string >( "Settings.General.HttpPort", "80" ) + "..." );
|
g_log.info( "Starting API server at port " + m_pConfig->getValue< std::string >( "Settings.General.HttpPort", "80" ) + "..." );
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include <common/Util/Util.h>
|
#include <common/Util/Util.h>
|
||||||
#include <common/Util/UtilMath.h>
|
#include <common/Util/UtilMath.h>
|
||||||
#include <common/Exd/ExdData.h>
|
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
|
|
||||||
#include "Network/PacketWrappers/ActorControlPacket142.h"
|
#include "Network/PacketWrappers/ActorControlPacket142.h"
|
||||||
#include "Network/PacketWrappers/ActorControlPacket143.h"
|
#include "Network/PacketWrappers/ActorControlPacket143.h"
|
||||||
|
@ -17,7 +17,7 @@ using namespace Core::Network;
|
||||||
using namespace Core::Network::Packets;
|
using namespace Core::Network::Packets;
|
||||||
using namespace Core::Network::Packets::Server;
|
using namespace Core::Network::Packets::Server;
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::Scripting::ScriptManager g_scriptMgr;
|
extern Core::Scripting::ScriptManager g_scriptMgr;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ Core::Action::ActionCast::ActionCast( Entity::ActorPtr pActor, Entity::ActorPtr
|
||||||
m_startTime = 0;
|
m_startTime = 0;
|
||||||
m_id = actionId;
|
m_id = actionId;
|
||||||
m_handleActionType = HandleActionType::Spell;
|
m_handleActionType = HandleActionType::Spell;
|
||||||
m_castTime = g_exdData.getActionInfo( actionId )->cast_time; // TODO: Add security checks.
|
m_castTime = g_exdDataGen.getAction( actionId )->cast100ms * 100; // TODO: Add security checks.
|
||||||
m_pSource = pActor;
|
m_pSource = pActor;
|
||||||
m_pTarget = pTarget;
|
m_pTarget = pTarget;
|
||||||
m_bInterrupt = false;
|
m_bInterrupt = false;
|
||||||
|
|
|
@ -53,12 +53,12 @@ bool ActionCollision::isActorApplicable( ActorPtr actorPtr, TargetFilter targetF
|
||||||
|
|
||||||
std::set< Core::Entity::ActorPtr > ActionCollision::getActorsHitFromAction( FFXIVARR_POSITION3 aoePosition,
|
std::set< Core::Entity::ActorPtr > ActionCollision::getActorsHitFromAction( FFXIVARR_POSITION3 aoePosition,
|
||||||
std::set< ActorPtr > actorsInRange,
|
std::set< ActorPtr > actorsInRange,
|
||||||
boost::shared_ptr< Core::Data::ActionInfo > actionInfo,
|
boost::shared_ptr< Core::Data::Action > actionInfo,
|
||||||
TargetFilter targetFilter )
|
TargetFilter targetFilter )
|
||||||
{
|
{
|
||||||
std::set< ActorPtr > actorsCollided;
|
std::set< ActorPtr > actorsCollided;
|
||||||
|
|
||||||
switch( static_cast< ActionCollisionType >( actionInfo->aoe_type ) )
|
switch( static_cast< ActionCollisionType >( actionInfo->castType ) )
|
||||||
{
|
{
|
||||||
case ActionCollisionType::None:
|
case ActionCollisionType::None:
|
||||||
case ActionCollisionType::SingleTarget:
|
case ActionCollisionType::SingleTarget:
|
||||||
|
@ -75,7 +75,7 @@ std::set< Core::Entity::ActorPtr > ActionCollision::getActorsHitFromAction( FFXI
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Test our collision from actor with the area generated by the action from the AoE data
|
// Test our collision from actor with the area generated by the action from the AoE data
|
||||||
if ( radiusCollision( pActor->getPos(), aoePosition, actionInfo->aoe_width ) )
|
if ( radiusCollision( pActor->getPos(), aoePosition, actionInfo->effectRange ) )
|
||||||
{
|
{
|
||||||
// Add it to the actors collided with the area
|
// Add it to the actors collided with the area
|
||||||
actorsCollided.insert( pActor );
|
actorsCollided.insert( pActor );
|
||||||
|
@ -92,7 +92,7 @@ std::set< Core::Entity::ActorPtr > ActionCollision::getActorsHitFromAction( FFXI
|
||||||
if ( !isActorApplicable( pActor, targetFilter ) )
|
if ( !isActorApplicable( pActor, targetFilter ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( radiusCollision( pActor->getPos(), aoePosition, actionInfo->aoe_range ) )
|
if ( radiusCollision( pActor->getPos(), aoePosition, actionInfo->effectRange ) )
|
||||||
actorsCollided.insert( pActor );
|
actorsCollided.insert( pActor );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -106,7 +106,7 @@ std::set< Core::Entity::ActorPtr > ActionCollision::getActorsHitFromAction( FFXI
|
||||||
if ( !isActorApplicable( pActor, targetFilter ) )
|
if ( !isActorApplicable( pActor, targetFilter ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( boxCollision( pActor->getPos(), aoePosition, actionInfo->aoe_width, actionInfo->aoe_range ) )
|
if ( boxCollision( pActor->getPos(), aoePosition, actionInfo->xAxisModifier, actionInfo->effectRange ) )
|
||||||
{
|
{
|
||||||
// todo: does this actually work?
|
// todo: does this actually work?
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define _ACTIONCOLLISION_H
|
#define _ACTIONCOLLISION_H
|
||||||
|
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
|
|
||||||
#include "Actor/Actor.h"
|
#include "Actor/Actor.h"
|
||||||
#include "Action.h"
|
#include "Action.h"
|
||||||
|
@ -25,7 +26,7 @@ namespace Entity {
|
||||||
static bool isActorApplicable( ActorPtr actorPtr, TargetFilter targetFilter );
|
static bool isActorApplicable( ActorPtr actorPtr, TargetFilter targetFilter );
|
||||||
static std::set< ActorPtr > getActorsHitFromAction( Common::FFXIVARR_POSITION3 aoePosition,
|
static std::set< ActorPtr > getActorsHitFromAction( Common::FFXIVARR_POSITION3 aoePosition,
|
||||||
std::set< ActorPtr > actorsInRange,
|
std::set< ActorPtr > actorsInRange,
|
||||||
boost::shared_ptr< Data::ActionInfo > actionInfo,
|
boost::shared_ptr< Data::Action > actionInfo,
|
||||||
TargetFilter targetFilter );
|
TargetFilter targetFilter );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "ActionTeleport.h"
|
#include "ActionTeleport.h"
|
||||||
|
|
||||||
#include <common/Util/Util.h>
|
#include <common/Util/Util.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
|
|
||||||
#include "Network/PacketWrappers/ActorControlPacket142.h"
|
#include "Network/PacketWrappers/ActorControlPacket142.h"
|
||||||
|
@ -13,7 +13,7 @@ using namespace Core::Network;
|
||||||
using namespace Core::Network::Packets;
|
using namespace Core::Network::Packets;
|
||||||
using namespace Core::Network::Packets::Server;
|
using namespace Core::Network::Packets::Server;
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
|
|
||||||
Core::Action::ActionTeleport::ActionTeleport()
|
Core::Action::ActionTeleport::ActionTeleport()
|
||||||
|
@ -26,7 +26,7 @@ Core::Action::ActionTeleport::ActionTeleport( Entity::ActorPtr pActor, uint16_t
|
||||||
m_startTime = 0;
|
m_startTime = 0;
|
||||||
m_id = 5;
|
m_id = 5;
|
||||||
m_handleActionType = HandleActionType::Teleport;
|
m_handleActionType = HandleActionType::Teleport;
|
||||||
m_castTime = g_exdData.getActionInfo(5)->cast_time; // TODO: Add security checks.
|
m_castTime = g_exdDataGen.getAction( 5 )->cast100ms * 100; // TODO: Add security checks.
|
||||||
m_pSource = pActor;
|
m_pSource = pActor;
|
||||||
m_bInterrupt = false;
|
m_bInterrupt = false;
|
||||||
m_targetAetheryte = targetZone;
|
m_targetAetheryte = targetZone;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <common/Util/Util.h>
|
#include <common/Util/Util.h>
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
|
|
||||||
#include "EventAction.h"
|
#include "EventAction.h"
|
||||||
#include "Network/PacketWrappers/ActorControlPacket142.h"
|
#include "Network/PacketWrappers/ActorControlPacket142.h"
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
#include "Event/EventHandler.h"
|
#include "Event/EventHandler.h"
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
using namespace Core::Network;
|
using namespace Core::Network;
|
||||||
|
@ -28,7 +28,7 @@ Core::Action::EventAction::EventAction( Entity::ActorPtr pActor, uint32_t eventI
|
||||||
m_handleActionType = HandleActionType::Event;
|
m_handleActionType = HandleActionType::Event;
|
||||||
m_eventId = eventId;
|
m_eventId = eventId;
|
||||||
m_id = action;
|
m_id = action;
|
||||||
m_castTime = g_exdData.m_EventActionInfoMap[action].castTime; // TODO: Add security checks.
|
m_castTime = g_exdDataGen.getEventAction( action )->castTime; // TODO: Add security checks.
|
||||||
m_onActionFinishClb = finishRef;
|
m_onActionFinishClb = finishRef;
|
||||||
m_onActionInterruptClb = interruptRef;
|
m_onActionInterruptClb = interruptRef;
|
||||||
m_pSource = pActor;
|
m_pSource = pActor;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include <common/Util/UtilMath.h>
|
#include <common/Util/UtilMath.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdData.h>
|
||||||
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Network/GamePacket.h>
|
#include <common/Network/GamePacket.h>
|
||||||
|
|
||||||
#include "Forwards.h"
|
#include "Forwards.h"
|
||||||
|
@ -24,7 +25,7 @@
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
|
||||||
extern Core::ServerZone g_serverZone;
|
extern Core::ServerZone g_serverZone;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
using namespace Core::Network::Packets;
|
using namespace Core::Network::Packets;
|
||||||
|
@ -682,7 +683,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
getAsPlayer()->sendDebug( "Handle script skill type: " + std::to_string( type ) );
|
getAsPlayer()->sendDebug( "Handle script skill type: " + std::to_string( type ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
auto actionInfoPtr = g_exdData.getActionInfo( actionId );
|
auto actionInfoPtr = g_exdDataGen.getAction( actionId );
|
||||||
|
|
||||||
// Todo: Effect packet generator. 90% of this is basically setting params and it's basically unreadable.
|
// Todo: Effect packet generator. 90% of this is basically setting params and it's basically unreadable.
|
||||||
// Prepare packet. This is seemingly common for all packets in the action handler.
|
// Prepare packet. This is seemingly common for all packets in the action handler.
|
||||||
|
@ -708,7 +709,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalDamage;
|
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalDamage;
|
||||||
effectPacket.data().effects[0].unknown_3 = 7;
|
effectPacket.data().effects[0].unknown_3 = 7;
|
||||||
|
|
||||||
if( !actionInfoPtr->is_aoe )
|
if( actionInfoPtr->castType == 1 && actionInfoPtr->effectRange != 0 || actionInfoPtr->castType != 1 )
|
||||||
{
|
{
|
||||||
// If action on this specific target is valid...
|
// If action on this specific target is valid...
|
||||||
if ( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Enemies ) )
|
if ( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Enemies ) )
|
||||||
|
@ -764,7 +765,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
effectPacket.data().effects[0].effectType = ActionEffectType::Heal;
|
effectPacket.data().effects[0].effectType = ActionEffectType::Heal;
|
||||||
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalHeal;
|
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalHeal;
|
||||||
|
|
||||||
if( !actionInfoPtr->is_aoe )
|
if( actionInfoPtr->castType == 1 && actionInfoPtr->effectRange != 0 || actionInfoPtr->castType != 1 )
|
||||||
{
|
{
|
||||||
if( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Allies ) )
|
if( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Allies ) )
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Util/Util.h>
|
#include <common/Util/Util.h>
|
||||||
#include <common/Util/UtilMath.h>
|
#include <common/Util/UtilMath.h>
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ using namespace Core::Network::Packets;
|
||||||
using namespace Core::Network::Packets::Server;
|
using namespace Core::Network::Packets::Server;
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
uint32_t Core::Entity::BattleNpc::m_nextID = 1149241694;
|
uint32_t Core::Entity::BattleNpc::m_nextID = 1149241694;
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ void Core::Entity::BattleNpc::onDeath()
|
||||||
auto levelDiff = static_cast< int32_t >( this->m_level ) - level;
|
auto levelDiff = static_cast< int32_t >( this->m_level ) - level;
|
||||||
auto cappedLevelDiff = Math::Util::clamp( levelDiff, 1, 6 );
|
auto cappedLevelDiff = Math::Util::clamp( levelDiff, 1, 6 );
|
||||||
|
|
||||||
auto expNeeded = g_exdData.m_paramGrowthInfoMap[m_level + cappedLevelDiff - 1].needed_exp;
|
auto expNeeded = g_exdDataGen.getParamGrow( m_level + cappedLevelDiff - 1 )->expToNext;
|
||||||
int32_t exp = 0;
|
int32_t exp = 0;
|
||||||
|
|
||||||
// todo: arbitrary numbers pulled out of my ass
|
// todo: arbitrary numbers pulled out of my ass
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <common/Config/XMLConfig.h>
|
#include <common/Config/XMLConfig.h>
|
||||||
#include <common/Network/GamePacket.h>
|
#include <common/Network/GamePacket.h>
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
|
|
||||||
#include "Session.h"
|
#include "Session.h"
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::ServerZone g_serverZone;
|
extern Core::ServerZone g_serverZone;
|
||||||
extern Core::TerritoryMgr g_territoryMgr;
|
extern Core::TerritoryMgr g_territoryMgr;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
extern Core::Scripting::ScriptManager g_scriptMgr;
|
extern Core::Scripting::ScriptManager g_scriptMgr;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
|
@ -211,36 +211,27 @@ void Core::Entity::Player::calculateStats()
|
||||||
uint8_t level = getLevel();
|
uint8_t level = getLevel();
|
||||||
uint8_t job = static_cast< uint8_t >( getClass() );
|
uint8_t job = static_cast< uint8_t >( getClass() );
|
||||||
|
|
||||||
auto classInfoIt = g_exdData.m_classJobInfoMap.find( job );
|
auto classInfo = g_exdDataGen.getClassJob( job );
|
||||||
auto tribeInfoIt = g_exdData.m_tribeInfoMap.find( tribe );
|
auto tribeInfo = g_exdDataGen.getTribe( tribe );
|
||||||
auto paramGrowthInfoIt = g_exdData.m_paramGrowthInfoMap.find( level );
|
auto paramGrowthInfo = g_exdDataGen.getParamGrow( level );
|
||||||
|
|
||||||
if( tribeInfoIt == g_exdData.m_tribeInfoMap.end() ||
|
|
||||||
classInfoIt == g_exdData.m_classJobInfoMap.end() ||
|
|
||||||
paramGrowthInfoIt == g_exdData.m_paramGrowthInfoMap.end() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto tribeInfo = tribeInfoIt->second;
|
|
||||||
auto classInfo = classInfoIt->second;
|
|
||||||
auto paramGrowthInfo = paramGrowthInfoIt->second;
|
|
||||||
|
|
||||||
// TODO: put formula somewhere else...
|
// TODO: put formula somewhere else...
|
||||||
float base = Math::CalcStats::calculateBaseStat( getAsPlayer() );
|
float base = Math::CalcStats::calculateBaseStat( getAsPlayer() );
|
||||||
|
|
||||||
m_baseStats.str = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_str ) / 100 ) + tribeInfo.mod_str );
|
m_baseStats.str = static_cast< uint32_t >( base * ( static_cast< float >( classInfo->modifierStrength ) / 100 ) + tribeInfo->sTR );
|
||||||
m_baseStats.dex = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_dex ) / 100 ) + tribeInfo.mod_dex );
|
m_baseStats.dex = static_cast< uint32_t >( base * ( static_cast< float >( classInfo->modifierDexterity ) / 100 ) + tribeInfo->dEX );
|
||||||
m_baseStats.vit = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_vit ) / 100 ) + tribeInfo.mod_vit );
|
m_baseStats.vit = static_cast< uint32_t >( base * ( static_cast< float >( classInfo->modifierVitality ) / 100 ) + tribeInfo->vIT );
|
||||||
m_baseStats.inte = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_int ) / 100 ) + tribeInfo.mod_int );
|
m_baseStats.inte = static_cast< uint32_t >( base * ( static_cast< float >( classInfo->modifierIntelligence ) / 100 ) + tribeInfo->iNT );
|
||||||
m_baseStats.mnd = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_mnd ) / 100 ) + tribeInfo.mod_mnd );
|
m_baseStats.mnd = static_cast< uint32_t >( base * ( static_cast< float >( classInfo->modifierMind ) / 100 ) + tribeInfo->mND );
|
||||||
m_baseStats.pie = static_cast< uint32_t >( base * ( static_cast< float >( classInfo.mod_pie ) / 100 ) + tribeInfo.mod_pie );
|
m_baseStats.pie = static_cast< uint32_t >( base * ( static_cast< float >( classInfo->modifierPiety ) / 100 ) + tribeInfo->pIE );
|
||||||
|
|
||||||
m_baseStats.skillSpeed = paramGrowthInfo.base_secondary;
|
m_baseStats.skillSpeed = paramGrowthInfo->baseSpeed;
|
||||||
m_baseStats.spellSpeed = paramGrowthInfo.base_secondary;
|
m_baseStats.spellSpeed = paramGrowthInfo->baseSpeed;
|
||||||
m_baseStats.accuracy = paramGrowthInfo.base_secondary;
|
m_baseStats.accuracy = paramGrowthInfo->baseSpeed;
|
||||||
m_baseStats.critHitRate = paramGrowthInfo.base_secondary;
|
m_baseStats.critHitRate = paramGrowthInfo->baseSpeed;
|
||||||
m_baseStats.attackPotMagic = paramGrowthInfo.base_secondary;
|
m_baseStats.attackPotMagic = paramGrowthInfo->baseSpeed;
|
||||||
m_baseStats.healingPotMagic = paramGrowthInfo.base_secondary;
|
m_baseStats.healingPotMagic = paramGrowthInfo->baseSpeed;
|
||||||
m_baseStats.tenacity = paramGrowthInfo.base_secondary;
|
m_baseStats.tenacity = paramGrowthInfo->baseSpeed;
|
||||||
|
|
||||||
m_baseStats.max_mp = Math::CalcStats::calculateMaxMp( getAsPlayer() );
|
m_baseStats.max_mp = Math::CalcStats::calculateMaxMp( getAsPlayer() );
|
||||||
|
|
||||||
|
@ -300,7 +291,7 @@ void Core::Entity::Player::sendStats()
|
||||||
|
|
||||||
void Core::Entity::Player::teleport( uint16_t aetheryteId, uint8_t type )
|
void Core::Entity::Player::teleport( uint16_t aetheryteId, uint8_t type )
|
||||||
{
|
{
|
||||||
auto data = g_exdData.getAetheryteInfo( aetheryteId );
|
auto data = g_exdDataGen.getAetheryte( aetheryteId );
|
||||||
|
|
||||||
if( data == nullptr )
|
if( data == nullptr )
|
||||||
{
|
{
|
||||||
|
@ -309,7 +300,7 @@ void Core::Entity::Player::teleport( uint16_t aetheryteId, uint8_t type )
|
||||||
|
|
||||||
setStateFlag( PlayerStateFlag::BetweenAreas );
|
setStateFlag( PlayerStateFlag::BetweenAreas );
|
||||||
|
|
||||||
auto z_pos = g_territoryMgr.getTerritoryPosition( data->levelId );
|
auto z_pos = g_territoryMgr.getTerritoryPosition( data->territory );
|
||||||
|
|
||||||
Common::FFXIVARR_POSITION3 pos;
|
Common::FFXIVARR_POSITION3 pos;
|
||||||
pos.x = 0;
|
pos.x = 0;
|
||||||
|
@ -323,30 +314,30 @@ void Core::Entity::Player::teleport( uint16_t aetheryteId, uint8_t type )
|
||||||
rot = z_pos->getTargetRotation();
|
rot = z_pos->getTargetRotation();
|
||||||
}
|
}
|
||||||
|
|
||||||
sendDebug( "Teleport: " + data->placename + " " + data->placename_aethernet +
|
sendDebug( "Teleport: " + g_exdDataGen.getPlaceName( data->placeName )->name + " " + g_exdDataGen.getPlaceName( data->aethernetName )->name +
|
||||||
"(" + std::to_string( data->levelId ) + ")" );
|
"(" + std::to_string( data->territory ) + ")" );
|
||||||
|
|
||||||
// TODO: this should be simplified and a type created in server_common/common.h.
|
// TODO: this should be simplified and a type created in server_common/common.h.
|
||||||
if( type == 1 ) // teleport
|
if( type == 1 ) // teleport
|
||||||
{
|
{
|
||||||
prepareZoning( data->target_zone, true, 1, 112 );
|
prepareZoning( data->territory, true, 1, 112 ); // TODO: Really?
|
||||||
sendToInRangeSet( ActorControlPacket142( getId(), ActorDespawnEffect, 0x04 ) );
|
sendToInRangeSet( ActorControlPacket142( getId(), ActorDespawnEffect, 0x04 ) );
|
||||||
setZoningType( Common::ZoneingType::Teleport );
|
setZoningType( Common::ZoneingType::Teleport );
|
||||||
}
|
}
|
||||||
else if( type == 2 ) // aethernet
|
else if( type == 2 ) // aethernet
|
||||||
{
|
{
|
||||||
prepareZoning( data->target_zone, true, 1, 112 );
|
prepareZoning( data->territory, true, 1, 112 );
|
||||||
sendToInRangeSet( ActorControlPacket142( getId(), ActorDespawnEffect, 0x04 ) );
|
sendToInRangeSet( ActorControlPacket142( getId(), ActorDespawnEffect, 0x04 ) );
|
||||||
setZoningType( Common::ZoneingType::Teleport );
|
setZoningType( Common::ZoneingType::Teleport );
|
||||||
}
|
}
|
||||||
else if( type == 3 ) // return
|
else if( type == 3 ) // return
|
||||||
{
|
{
|
||||||
prepareZoning( data->target_zone, true, 1, 111 );
|
prepareZoning( data->territory, true, 1, 111 );
|
||||||
sendToInRangeSet( ActorControlPacket142( getId(), ActorDespawnEffect, 0x03 ) );
|
sendToInRangeSet( ActorControlPacket142( getId(), ActorDespawnEffect, 0x03 ) );
|
||||||
setZoningType( Common::ZoneingType::Return );
|
setZoningType( Common::ZoneingType::Return );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_queuedZoneing = boost::make_shared< QueuedZoning >( data->target_zone, pos, Util::getTimeMs(), rot );
|
m_queuedZoneing = boost::make_shared< QueuedZoning >( data->territory, pos, Util::getTimeMs(), rot );
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -502,11 +493,11 @@ void Core::Entity::Player::discover( int16_t map_id, int16_t sub_id )
|
||||||
|
|
||||||
int32_t offset = 4;
|
int32_t offset = 4;
|
||||||
|
|
||||||
auto info = g_exdData.m_zoneInfoMap[getCurrentZone()->getTerritoryId()];
|
auto info = g_exdDataGen.getMap( g_exdDataGen.getTerritoryType( getCurrentZone()->getTerritoryId() )->map );
|
||||||
if( info.is_two_byte )
|
if( info->discoveryArrayByte )
|
||||||
offset = 4 + 2 * info.discovery_index;
|
offset = 4 + 2 * info->discoveryIndex;
|
||||||
else
|
else
|
||||||
offset = 324 + 4 * info.discovery_index;
|
offset = 324 + 4 * info->discoveryIndex;
|
||||||
|
|
||||||
int32_t index = offset + sub_id / 8;
|
int32_t index = offset + sub_id / 8;
|
||||||
uint8_t bitIndex = sub_id % 8;
|
uint8_t bitIndex = sub_id % 8;
|
||||||
|
@ -517,7 +508,7 @@ void Core::Entity::Player::discover( int16_t map_id, int16_t sub_id )
|
||||||
|
|
||||||
uint16_t level = getLevel();
|
uint16_t level = getLevel();
|
||||||
|
|
||||||
uint32_t exp = ( g_exdData.m_paramGrowthInfoMap[level].needed_exp * 5 / 100 );
|
uint32_t exp = ( g_exdDataGen.getParamGrow( level )->expToNext * 5 / 100 );
|
||||||
|
|
||||||
gainExp( exp );
|
gainExp( exp );
|
||||||
|
|
||||||
|
@ -594,9 +585,9 @@ void Core::Entity::Player::gainExp( uint32_t amount )
|
||||||
|
|
||||||
uint16_t level = getLevel();
|
uint16_t level = getLevel();
|
||||||
|
|
||||||
uint32_t neededExpToLevel = g_exdData.m_paramGrowthInfoMap[level].needed_exp;
|
uint32_t neededExpToLevel = g_exdDataGen.getParamGrow( level )->expToNext;
|
||||||
|
|
||||||
uint32_t neededExpToLevelplus1 = g_exdData.m_paramGrowthInfoMap[level + 1].needed_exp;
|
uint32_t neededExpToLevelplus1 = g_exdDataGen.getParamGrow( level + 1 )->expToNext;
|
||||||
|
|
||||||
queuePacket( ActorControlPacket143( getId(), GainExpMsg, static_cast< uint8_t >( getClass() ), amount ) );
|
queuePacket( ActorControlPacket143( getId(), GainExpMsg, static_cast< uint8_t >( getClass() ), amount ) );
|
||||||
|
|
||||||
|
@ -696,25 +687,25 @@ void Core::Entity::Player::sendStatusUpdate( bool toSelf )
|
||||||
|
|
||||||
uint8_t Core::Entity::Player::getLevel() const
|
uint8_t Core::Entity::Player::getLevel() const
|
||||||
{
|
{
|
||||||
uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( getClass() )].exp_idx;
|
uint8_t classJobIndex = g_exdDataGen.getClassJob( static_cast< uint8_t >( getClass() ) )->expArrayIndex;
|
||||||
return static_cast< uint8_t >( m_classArray[classJobIndex] );
|
return static_cast< uint8_t >( m_classArray[classJobIndex] );
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Core::Entity::Player::getLevelForClass( Common::ClassJob pClass ) const
|
uint8_t Core::Entity::Player::getLevelForClass( Common::ClassJob pClass ) const
|
||||||
{
|
{
|
||||||
uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( pClass )].exp_idx;
|
uint8_t classJobIndex = g_exdDataGen.getClassJob( static_cast< uint8_t >( pClass ) )->expArrayIndex;
|
||||||
return static_cast< uint8_t >( m_classArray[classJobIndex] );
|
return static_cast< uint8_t >( m_classArray[classJobIndex] );
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Core::Entity::Player::getExp() const
|
uint32_t Core::Entity::Player::getExp() const
|
||||||
{
|
{
|
||||||
uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( getClass() )].exp_idx;
|
uint8_t classJobIndex = g_exdDataGen.getClassJob( static_cast< uint8_t >( getClass() ) )->expArrayIndex;
|
||||||
return m_expArray[classJobIndex];
|
return m_expArray[classJobIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::Entity::Player::setExp( uint32_t amount )
|
void Core::Entity::Player::setExp( uint32_t amount )
|
||||||
{
|
{
|
||||||
uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( getClass() )].exp_idx;
|
uint8_t classJobIndex = g_exdDataGen.getClassJob( static_cast< uint8_t >( getClass() ) )->expArrayIndex;
|
||||||
m_expArray[classJobIndex] = amount;
|
m_expArray[classJobIndex] = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -754,13 +745,13 @@ void Core::Entity::Player::setClassJob( Common::ClassJob classJob )
|
||||||
|
|
||||||
void Core::Entity::Player::setLevel( uint8_t level )
|
void Core::Entity::Player::setLevel( uint8_t level )
|
||||||
{
|
{
|
||||||
uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( static_cast< uint8_t >( getClass() ) )].exp_idx;
|
uint8_t classJobIndex = g_exdDataGen.getClassJob( static_cast< uint8_t >( getClass() ) )->expArrayIndex;
|
||||||
m_classArray[classJobIndex] = level;
|
m_classArray[classJobIndex] = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::Entity::Player::setLevelForClass( uint8_t level, Common::ClassJob classjob )
|
void Core::Entity::Player::setLevelForClass( uint8_t level, Common::ClassJob classjob )
|
||||||
{
|
{
|
||||||
uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( classjob )].exp_idx;
|
uint8_t classJobIndex = g_exdDataGen.getClassJob( static_cast< uint8_t >( classjob ) )->expArrayIndex;
|
||||||
|
|
||||||
if( m_classArray[classJobIndex] == 0 )
|
if( m_classArray[classJobIndex] == 0 )
|
||||||
insertDbClass( classJobIndex );
|
insertDbClass( classJobIndex );
|
||||||
|
@ -910,11 +901,11 @@ const uint8_t* Core::Entity::Player::getStateFlags() const
|
||||||
|
|
||||||
bool Core::Entity::Player::actionHasCastTime( uint32_t actionId ) //TODO: Add logic for special cases
|
bool Core::Entity::Player::actionHasCastTime( uint32_t actionId ) //TODO: Add logic for special cases
|
||||||
{
|
{
|
||||||
auto actionInfoPtr = g_exdData.getActionInfo( actionId );
|
auto actionInfoPtr = g_exdDataGen.getAction( actionId );
|
||||||
if( actionInfoPtr->is_instant )
|
if( actionInfoPtr->preservesCombo )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return actionInfoPtr->cast_time != 0;
|
return actionInfoPtr->cast100ms != 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
||||||
#include <common/Network/GamePacket.h>
|
#include <common/Network/GamePacket.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
|
|
||||||
#include "Network/GameConnection.h"
|
#include "Network/GameConnection.h"
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
#include "Inventory/Inventory.h"
|
#include "Inventory/Inventory.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
using namespace Core::Network::Packets;
|
using namespace Core::Network::Packets;
|
||||||
|
@ -1015,24 +1015,24 @@ void Core::Entity::Player::removeQuestsCompleted( uint32_t questId )
|
||||||
bool Core::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t optionalChoice )
|
bool Core::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t optionalChoice )
|
||||||
{
|
{
|
||||||
uint32_t playerLevel = getLevel();
|
uint32_t playerLevel = getLevel();
|
||||||
auto questInfo = g_exdData.getQuestInfo( questId );
|
auto questInfo = g_exdDataGen.getQuest( questId );
|
||||||
|
|
||||||
|
|
||||||
if( !questInfo )
|
if( !questInfo )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
auto paramGrowth = g_exdData.m_paramGrowthInfoMap[questInfo->quest_level];
|
auto paramGrowth = g_exdDataGen.getParamGrow( questInfo->classJobLevel0 );
|
||||||
|
|
||||||
// TODO: use the correct formula, this one is wrong
|
// TODO: use the correct formula, this one is wrong
|
||||||
uint32_t exp = ( questInfo->reward_exp_factor * paramGrowth.quest_exp_mod * ( 45 + 5 * questInfo->quest_level) ) / 100;
|
uint32_t exp = ( questInfo->expFactor * paramGrowth->questExpModifier * ( 45 + 5 * questInfo->classJobLevel0 ) ) / 100;
|
||||||
exp = exp + ( questInfo->reward_exp_factor / 100 ) * 10000;
|
exp = exp + ( questInfo->expFactor / 100 ) * 10000;
|
||||||
|
|
||||||
exp = questInfo->reward_exp_factor;
|
exp = questInfo->expFactor;
|
||||||
|
|
||||||
auto rewardItemCount = questInfo->reward_item.size();
|
auto rewardItemCount = questInfo->itemReward0.size();
|
||||||
uint16_t optionalItemCount = questInfo->reward_item_optional.size() > 0 ? 1 : 0;
|
uint16_t optionalItemCount = questInfo->itemReward1.size();
|
||||||
|
|
||||||
uint32_t gilReward = questInfo->reward_gil;
|
uint32_t gilReward = questInfo->gilReward;
|
||||||
|
|
||||||
// TODO: check if there is room in inventory, else return false;
|
// TODO: check if there is room in inventory, else return false;
|
||||||
if( exp > 0 )
|
if( exp > 0 )
|
||||||
|
@ -1040,18 +1040,18 @@ bool Core::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t optional
|
||||||
|
|
||||||
if( rewardItemCount > 0 )
|
if( rewardItemCount > 0 )
|
||||||
{
|
{
|
||||||
for( uint32_t i = 0; i < questInfo->reward_item.size(); i++ )
|
for( uint32_t i = 0; i < questInfo->itemReward0.size(); i++ )
|
||||||
{
|
{
|
||||||
// TODO: add the correct amount of items instead of 1
|
// TODO: add the correct amount of items instead of 1
|
||||||
addItem( -1, questInfo->reward_item.at( i ), questInfo->reward_item_count.at( i ) );
|
addItem( -1, questInfo->itemReward0.at( i ), questInfo->itemReward1.at( i ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( optionalItemCount > 0 )
|
if( optionalItemCount > 0 )
|
||||||
{
|
{
|
||||||
auto itemId = questInfo->reward_item_optional.at( optionalChoice );
|
auto itemId = questInfo->itemReward1.at( optionalChoice );
|
||||||
// TODO: add the correct amount of items instead of 1
|
// TODO: add the correct amount of items instead of 1
|
||||||
addItem( -1, itemId, questInfo->reward_item_optional_count.at( optionalChoice ) );
|
addItem( -1, itemId, questInfo->itemCountReward1.at( optionalChoice ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( gilReward > 0 )
|
if( gilReward > 0 )
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <common/Util/UtilMath.h>
|
#include <common/Util/UtilMath.h>
|
||||||
#include <common/Config/XMLConfig.h>
|
#include <common/Config/XMLConfig.h>
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include <common/Database/DatabaseDef.h>
|
#include <common/Database/DatabaseDef.h>
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::ServerZone g_serverZone;
|
extern Core::ServerZone g_serverZone;
|
||||||
extern Core::TerritoryMgr g_territoryMgr;
|
extern Core::TerritoryMgr g_territoryMgr;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
|
@ -433,7 +433,7 @@ void Core::Entity::Player::updateSql()
|
||||||
|
|
||||||
void Core::Entity::Player::updateDbClass() const
|
void Core::Entity::Player::updateDbClass() const
|
||||||
{
|
{
|
||||||
uint8_t classJobIndex = g_exdData.m_classJobInfoMap[static_cast< uint8_t >( getClass() )].exp_idx;
|
uint8_t classJobIndex = g_exdDataGen.getClassJob( static_cast<uint8_t>( getClass() ) )->expArrayIndex;
|
||||||
|
|
||||||
//Exp = ?, Lvl = ? WHERE CharacterId = ? AND ClassIdx = ?
|
//Exp = ?, Lvl = ? WHERE CharacterId = ? AND ClassIdx = ?
|
||||||
auto stmtS = g_charaDb.getPreparedStatement( Db::CHARA_CLASS_UP );
|
auto stmtS = g_charaDb.getPreparedStatement( Db::CHARA_CLASS_UP );
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <common/Util/UtilMath.h>
|
#include <common/Util/UtilMath.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Database/DatabaseDef.h>
|
#include <common/Database/DatabaseDef.h>
|
||||||
|
|
||||||
#include "DebugCommand.h"
|
#include "DebugCommand.h"
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
#include "Zone/TerritoryMgr.h"
|
#include "Zone/TerritoryMgr.h"
|
||||||
|
|
||||||
extern Core::Scripting::ScriptManager g_scriptMgr;
|
extern Core::Scripting::ScriptManager g_scriptMgr;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::ServerZone g_serverZone;
|
extern Core::ServerZone g_serverZone;
|
||||||
extern Core::TerritoryMgr g_territoryMgr;
|
extern Core::TerritoryMgr g_territoryMgr;
|
||||||
|
@ -480,7 +480,7 @@ void Core::DebugCommandHandler::get( char * data, Entity::Player& player, boost:
|
||||||
if( ( subCommand == "pos" ) )
|
if( ( subCommand == "pos" ) )
|
||||||
{
|
{
|
||||||
|
|
||||||
int16_t map_id = g_exdData.m_zoneInfoMap[player.getCurrentZone()->getTerritoryId()].map_id;
|
int16_t map_id = g_exdDataGen.getTerritoryType( player.getCurrentZone()->getTerritoryId() )->map;
|
||||||
|
|
||||||
player.sendNotice( "Pos:\n" +
|
player.sendNotice( "Pos:\n" +
|
||||||
std::to_string( player.getPos().x ) + "\n" +
|
std::to_string( player.getPos().x ) + "\n" +
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
#include "EventHelper.h"
|
#include "EventHelper.h"
|
||||||
#include "EventHandler.h"
|
#include "EventHandler.h"
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include <common/Exd/ExdData.h>
|
|
||||||
#include <common/Exd/ExdDataGenerated.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
|
||||||
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
|
@ -41,7 +39,7 @@ std::string Core::Event::getEventName( uint32_t eventId )
|
||||||
}
|
}
|
||||||
case Event::EventHandler::EventHandlerType::Opening:
|
case Event::EventHandler::EventHandlerType::Opening:
|
||||||
{
|
{
|
||||||
auto openingInfo = g_exdData.getOpeningInfo( eventId );
|
auto openingInfo = g_exdDataGen.getOpening( eventId );
|
||||||
if( openingInfo )
|
if( openingInfo )
|
||||||
return openingInfo->name;
|
return openingInfo->name;
|
||||||
return unknown + "Opening";
|
return unknown + "Opening";
|
||||||
|
@ -67,9 +65,9 @@ std::string Core::Event::getEventName( uint32_t eventId )
|
||||||
|
|
||||||
uint32_t Core::Event::mapEventActorToRealActor( uint32_t eventActorId )
|
uint32_t Core::Event::mapEventActorToRealActor( uint32_t eventActorId )
|
||||||
{
|
{
|
||||||
auto levelInfo = g_exdData.getLevelInfo( eventActorId );
|
auto levelInfo = g_exdDataGen.getLevel( eventActorId );
|
||||||
if( levelInfo )
|
if( levelInfo )
|
||||||
return levelInfo->actor_id;
|
return levelInfo->objectKey;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
#include <common/Database/DatabaseDef.h>
|
#include <common/Database/DatabaseDef.h>
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
using namespace Core::Network;
|
using namespace Core::Network;
|
||||||
|
@ -135,11 +135,11 @@ Core::ItemPtr Core::Inventory::getItemAt( uint16_t containerId, uint8_t slotId )
|
||||||
|
|
||||||
Core::ItemPtr Core::Inventory::createItem( uint32_t catalogId, uint8_t quantity )
|
Core::ItemPtr Core::Inventory::createItem( uint32_t catalogId, uint8_t quantity )
|
||||||
{
|
{
|
||||||
auto itemInfo = g_exdData.getItemInfo( catalogId );
|
auto itemInfo = g_exdDataGen.getItem( catalogId );
|
||||||
|
|
||||||
uint8_t itemAmount = quantity;
|
uint8_t itemAmount = quantity;
|
||||||
|
|
||||||
if( itemInfo->stack_size == 1 )
|
if( itemInfo->stackSize == 1 )
|
||||||
itemAmount = 1;
|
itemAmount = 1;
|
||||||
|
|
||||||
if( !itemInfo )
|
if( !itemInfo )
|
||||||
|
@ -153,8 +153,8 @@ Core::ItemPtr Core::Inventory::createItem( uint32_t catalogId, uint8_t quantity
|
||||||
|
|
||||||
pItem->setStackSize( itemAmount );
|
pItem->setStackSize( itemAmount );
|
||||||
pItem->setUId( getNextUId() );
|
pItem->setUId( getNextUId() );
|
||||||
pItem->setModelIds( itemInfo->model_primary, itemInfo->model_secondary );
|
pItem->setModelIds( itemInfo->modelMain, itemInfo->modelSub );
|
||||||
pItem->setCategory( static_cast< ItemUICategory >( itemInfo->ui_category ) );
|
pItem->setCategory( static_cast< ItemUICategory >( itemInfo->itemUICategory ) );
|
||||||
|
|
||||||
g_charaDb.execute( "INSERT INTO charaglobalitem ( CharacterId, itemId, catalogId, stack, flags ) VALUES ( " +
|
g_charaDb.execute( "INSERT INTO charaglobalitem ( CharacterId, itemId, catalogId, stack, flags ) VALUES ( " +
|
||||||
std::to_string( m_pOwner->getId() ) + ", " +
|
std::to_string( m_pOwner->getId() ) + ", " +
|
||||||
|
@ -473,10 +473,10 @@ bool Core::Inventory::isObtainable( uint32_t catalogId, uint8_t quantity )
|
||||||
int16_t Core::Inventory::addItem( uint16_t inventoryId, int8_t slotId, uint32_t catalogId, uint8_t quantity )
|
int16_t Core::Inventory::addItem( uint16_t inventoryId, int8_t slotId, uint32_t catalogId, uint8_t quantity )
|
||||||
{
|
{
|
||||||
|
|
||||||
auto itemInfo = g_exdData.getItemInfo( catalogId );
|
auto itemInfo = g_exdDataGen.getItem( catalogId );
|
||||||
|
|
||||||
// if item data doesn't exist or it's a blank field
|
// if item data doesn't exist or it's a blank field
|
||||||
if( !itemInfo || itemInfo->item_level == 0 )
|
if( !itemInfo || itemInfo->levelItem == 0 )
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -656,13 +656,13 @@ Core::ItemPtr Core::Inventory::loadItem( uint64_t uId )
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto itemInfo = g_exdData.getItemInfo( itemRes->getUInt( 1 ) );
|
auto itemInfo = g_exdDataGen.getItem( itemRes->getUInt( 1 ) );
|
||||||
bool isHq = itemRes->getUInt( 3 ) == 1 ? true : false;
|
bool isHq = itemRes->getUInt( 3 ) == 1 ? true : false;
|
||||||
ItemPtr pItem( new Item( uId,
|
ItemPtr pItem( new Item( uId,
|
||||||
itemInfo->id,
|
itemRes->getUInt( 1 ),
|
||||||
itemInfo->model_primary,
|
itemInfo->modelMain,
|
||||||
itemInfo->model_secondary,
|
itemInfo->modelSub,
|
||||||
static_cast< ItemUICategory >( itemInfo->ui_category ),
|
static_cast< ItemUICategory >( itemInfo->itemUICategory ),
|
||||||
isHq ) );
|
isHq ) );
|
||||||
pItem->setStackSize( itemRes->getUInt( 2 ) );
|
pItem->setStackSize( itemRes->getUInt( 2 ) );
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
Core::Item::Item()
|
Core::Item::Item()
|
||||||
{
|
{
|
||||||
|
@ -24,13 +24,13 @@ Core::Item::Item( uint64_t uId, uint32_t catalogId, uint64_t model1, uint64_t mo
|
||||||
m_model2( model2 ),
|
m_model2( model2 ),
|
||||||
m_isHq( isHq )
|
m_isHq( isHq )
|
||||||
{
|
{
|
||||||
auto itemInfo = g_exdData.getItemInfo( catalogId );
|
auto itemInfo = g_exdDataGen.getItem( catalogId );
|
||||||
m_delayMs = itemInfo->delayMs;
|
m_delayMs = itemInfo->delayms;
|
||||||
m_physicalDmg = itemInfo->physical_damage;
|
m_physicalDmg = itemInfo->damagePhys;
|
||||||
m_magicalDmg = itemInfo->magical_damage;
|
m_magicalDmg = itemInfo->damageMag;
|
||||||
m_weaponDmg = ( m_physicalDmg != 0 ) ? m_physicalDmg : m_magicalDmg;
|
m_weaponDmg = ( m_physicalDmg != 0 ) ? m_physicalDmg : m_magicalDmg;
|
||||||
m_autoAttackDmg = static_cast< float >( m_weaponDmg * m_delayMs ) / 3000;
|
m_autoAttackDmg = static_cast< float >( m_weaponDmg * m_delayMs ) / 3000;
|
||||||
m_itemLevel = itemInfo->item_level;
|
m_itemLevel = itemInfo->levelItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Item::~Item()
|
Core::Item::~Item()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include "Actor/Actor.h"
|
#include "Actor/Actor.h"
|
||||||
#include "Actor/Player.h"
|
#include "Actor/Player.h"
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
using namespace Core::Math;
|
using namespace Core::Math;
|
||||||
using namespace Core::Entity;
|
using namespace Core::Entity;
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class used for battle-related formulas and calculations.
|
Class used for battle-related formulas and calculations.
|
||||||
|
@ -30,14 +30,13 @@ extern Core::Data::ExdData g_exdData;
|
||||||
|
|
||||||
uint32_t CalcBattle::calculateHealValue( PlayerPtr pPlayer, uint32_t potency )
|
uint32_t CalcBattle::calculateHealValue( PlayerPtr pPlayer, uint32_t potency )
|
||||||
{
|
{
|
||||||
auto classInfoIt = g_exdData.m_classJobInfoMap.find( static_cast< uint8_t >( pPlayer->getClass() ) );
|
auto classInfo = g_exdDataGen.getClassJob( static_cast< uint8_t >( pPlayer->getClass() ) );
|
||||||
auto paramGrowthInfoIt = g_exdData.m_paramGrowthInfoMap.find( pPlayer->getLevel() );
|
auto paramGrowthInfo = g_exdDataGen.getParamGrow( pPlayer->getLevel() );
|
||||||
|
|
||||||
if ( classInfoIt == g_exdData.m_classJobInfoMap.end() ||
|
if ( !classInfo || !paramGrowthInfo )
|
||||||
paramGrowthInfoIt == g_exdData.m_paramGrowthInfoMap.end())
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
auto jobModVal = classInfoIt->second;
|
//auto jobModVal = classInfoIt->second;
|
||||||
|
|
||||||
// consider 3% variation
|
// consider 3% variation
|
||||||
return potency / 10;
|
return potency / 10;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include "Actor/Actor.h"
|
#include "Actor/Actor.h"
|
||||||
#include "Actor/Player.h"
|
#include "Actor/Player.h"
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
using namespace Core::Math;
|
using namespace Core::Math;
|
||||||
using namespace Core::Entity;
|
using namespace Core::Entity;
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class used for battle-related formulas and calculations.
|
Class used for battle-related formulas and calculations.
|
||||||
|
@ -61,19 +61,18 @@ uint32_t CalcStats::calculateMaxHp( PlayerPtr pPlayer )
|
||||||
// Is there any way to pull reliable BaseHP without having to manually use a pet for every level, and using the values from a table?
|
// Is there any way to pull reliable BaseHP without having to manually use a pet for every level, and using the values from a table?
|
||||||
// More info here: https://docs.google.com/spreadsheets/d/1de06KGT0cNRUvyiXNmjNgcNvzBCCQku7jte5QxEQRbs/edit?usp=sharing
|
// More info here: https://docs.google.com/spreadsheets/d/1de06KGT0cNRUvyiXNmjNgcNvzBCCQku7jte5QxEQRbs/edit?usp=sharing
|
||||||
|
|
||||||
auto classInfoIt = g_exdData.m_classJobInfoMap.find( static_cast< uint8_t >( pPlayer->getClass() ) );
|
auto classInfo = g_exdDataGen.getClassJob( static_cast< uint8_t >( pPlayer->getClass() ) );
|
||||||
auto paramGrowthInfoIt = g_exdData.m_paramGrowthInfoMap.find( pPlayer->getLevel() );
|
auto paramGrowthInfo = g_exdDataGen.getParamGrow( pPlayer->getLevel() );
|
||||||
|
|
||||||
if ( classInfoIt == g_exdData.m_classJobInfoMap.end() ||
|
if ( !classInfo || !paramGrowthInfo )
|
||||||
paramGrowthInfoIt == g_exdData.m_paramGrowthInfoMap.end() )
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
uint8_t level = pPlayer->getLevel();
|
uint8_t level = pPlayer->getLevel();
|
||||||
|
|
||||||
float baseStat = calculateBaseStat( pPlayer );
|
float baseStat = calculateBaseStat( pPlayer );
|
||||||
uint16_t vitStat = pPlayer->getStats().vit;
|
uint16_t vitStat = pPlayer->getStats().vit;
|
||||||
uint16_t hpMod = paramGrowthInfoIt->second.hp_mod;
|
uint16_t hpMod = paramGrowthInfo->hpModifier;
|
||||||
uint16_t jobModHp = classInfoIt->second.mod_hp;
|
uint16_t jobModHp = classInfo->modifierHitPoints;
|
||||||
float approxBaseHp = 0.0f; // Read above
|
float approxBaseHp = 0.0f; // Read above
|
||||||
|
|
||||||
// These values are not precise.
|
// These values are not precise.
|
||||||
|
@ -83,7 +82,7 @@ uint32_t CalcStats::calculateMaxHp( PlayerPtr pPlayer )
|
||||||
else if ( level >= 50 )
|
else if ( level >= 50 )
|
||||||
approxBaseHp = 1700 + ( ( level - 50 ) * ( 1700 * 1.04325f ) );
|
approxBaseHp = 1700 + ( ( level - 50 ) * ( 1700 * 1.04325f ) );
|
||||||
else
|
else
|
||||||
approxBaseHp = paramGrowthInfoIt->second.mp_const * 0.7667f;
|
approxBaseHp = paramGrowthInfo->mpModifier * 0.7667f;
|
||||||
|
|
||||||
uint16_t result = static_cast< uint16_t >( floor( jobModHp * ( approxBaseHp / 100.0f ) ) + floor( hpMod / 100.0f * ( vitStat - baseStat ) ) );
|
uint16_t result = static_cast< uint16_t >( floor( jobModHp * ( approxBaseHp / 100.0f ) ) + floor( hpMod / 100.0f * ( vitStat - baseStat ) ) );
|
||||||
|
|
||||||
|
@ -95,18 +94,17 @@ uint32_t CalcStats::calculateMaxHp( PlayerPtr pPlayer )
|
||||||
|
|
||||||
uint32_t CalcStats::calculateMaxMp( PlayerPtr pPlayer )
|
uint32_t CalcStats::calculateMaxMp( PlayerPtr pPlayer )
|
||||||
{
|
{
|
||||||
auto classInfoIt = g_exdData.m_classJobInfoMap.find( static_cast< uint8_t >( pPlayer->getClass() ) );
|
auto classInfo = g_exdDataGen.getClassJob( static_cast< uint8_t >( pPlayer->getClass() ) );
|
||||||
auto paramGrowthInfoIt = g_exdData.m_paramGrowthInfoMap.find( pPlayer->getLevel() );
|
auto paramGrowthInfo = g_exdDataGen.getParamGrow( pPlayer->getLevel() );
|
||||||
|
|
||||||
if ( classInfoIt == g_exdData.m_classJobInfoMap.end() ||
|
if ( !classInfo || !paramGrowthInfo )
|
||||||
paramGrowthInfoIt == g_exdData.m_paramGrowthInfoMap.end() )
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
float baseStat = calculateBaseStat( pPlayer );
|
float baseStat = calculateBaseStat( pPlayer );
|
||||||
uint16_t piety = pPlayer->getStats().pie;
|
uint16_t piety = pPlayer->getStats().pie;
|
||||||
uint16_t pietyScalar = paramGrowthInfoIt->second.mp_mod;
|
uint16_t pietyScalar = paramGrowthInfo->mpModifier;
|
||||||
uint16_t jobModMp = classInfoIt->second.mod_mpcpgp;
|
uint16_t jobModMp = classInfo->modifierManaPoints;
|
||||||
uint16_t baseMp = paramGrowthInfoIt->second.mp_const;
|
uint16_t baseMp = paramGrowthInfo->mpModifier;
|
||||||
|
|
||||||
uint16_t result = static_cast< uint16_t >( floor( floor( piety - baseStat ) * ( pietyScalar / 100 ) + baseMp ) * jobModMp / 100 );
|
uint16_t result = static_cast< uint16_t >( floor( floor( piety - baseStat ) * ( pietyScalar / 100 ) + baseMp ) * jobModMp / 100 );
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <common/Network/CommonNetwork.h>
|
#include <common/Network/CommonNetwork.h>
|
||||||
#include <common/Network/GamePacketNew.h>
|
#include <common/Network/GamePacketNew.h>
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
|
|
||||||
#include <boost/format.hpp>
|
#include <boost/format.hpp>
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::ServerZone g_serverZone;
|
extern Core::ServerZone g_serverZone;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
extern Core::DebugCommandHandler g_gameCommandMgr;
|
extern Core::DebugCommandHandler g_gameCommandMgr;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
|
@ -200,15 +200,15 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in
|
||||||
case 0xCA: // Teleport
|
case 0xCA: // Teleport
|
||||||
{
|
{
|
||||||
// TODO: only register this action if enough gil is in possession
|
// TODO: only register this action if enough gil is in possession
|
||||||
auto targetAetheryte = g_exdData.getAetheryteInfo( param11 );
|
auto targetAetheryte = g_exdDataGen.getAetheryte( param11 );
|
||||||
|
|
||||||
if( targetAetheryte )
|
if( targetAetheryte )
|
||||||
{
|
{
|
||||||
auto fromAetheryte = g_exdData.getAetheryteInfo( g_exdData.m_zoneInfoMap[player.getZoneId()].aetheryte_index );
|
auto fromAetheryte = g_exdDataGen.getAetheryte( g_exdDataGen.getTerritoryType( player.getZoneId() )->aetheryte );
|
||||||
|
|
||||||
// calculate cost - does not apply for favorite points or homepoints neither checks for aether tickets
|
// calculate cost - does not apply for favorite points or homepoints neither checks for aether tickets
|
||||||
auto cost = static_cast< uint16_t > ( ( sqrt( pow( fromAetheryte->map_coord_x - targetAetheryte->map_coord_x, 2 ) +
|
auto cost = static_cast< uint16_t > ( ( sqrt( pow( fromAetheryte->aetherstreamX - targetAetheryte->aetherstreamX, 2 ) +
|
||||||
pow( fromAetheryte->map_coord_y - targetAetheryte->map_coord_y, 2 ) ) / 2 ) + 100 );
|
pow( fromAetheryte->aetherstreamY - targetAetheryte->aetherstreamY, 2 ) ) / 2 ) + 100 );
|
||||||
|
|
||||||
// cap at 999 gil
|
// cap at 999 gil
|
||||||
cost = cost > uint16_t{999} ? uint16_t{999} : cost;
|
cost = cost > uint16_t{999} ? uint16_t{999} : cost;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Network/CommonNetwork.h>
|
#include <common/Network/CommonNetwork.h>
|
||||||
#include <common/Network/GamePacketNew.h>
|
#include <common/Network/GamePacketNew.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
#include "Forwards.h"
|
#include "Forwards.h"
|
||||||
#include "Event/EventHelper.h"
|
#include "Event/EventHelper.h"
|
||||||
|
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
extern Core::Scripting::ScriptManager g_scriptMgr;
|
extern Core::Scripting::ScriptManager g_scriptMgr;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
|
@ -52,9 +52,9 @@ void Core::Network::GameConnection::eventHandlerTalk( const Packets::GamePacket&
|
||||||
if( !g_scriptMgr.onTalk( player, actorId, eventId ) &&
|
if( !g_scriptMgr.onTalk( player, actorId, eventId ) &&
|
||||||
eventType == Event::EventHandler::EventHandlerType::Quest )
|
eventType == Event::EventHandler::EventHandlerType::Quest )
|
||||||
{
|
{
|
||||||
auto questInfo = g_exdData.getQuestInfo( eventId );
|
auto questInfo = g_exdDataGen.getQuest( eventId );
|
||||||
if ( questInfo )
|
if ( questInfo )
|
||||||
player.sendUrgent( "Quest not implemented: " + questInfo->name + " (" + questInfo->name_intern + ")" );
|
player.sendUrgent( "Quest not implemented: " + questInfo->name + " (" + questInfo->id + ")" );
|
||||||
}
|
}
|
||||||
|
|
||||||
player.checkEvent( eventId );
|
player.checkEvent( eventId );
|
||||||
|
@ -87,7 +87,7 @@ void Core::Network::GameConnection::eventHandlerEmote( const Packets::GamePacket
|
||||||
if( !g_scriptMgr.onEmote( player, actorId, eventId, static_cast< uint8_t >( emoteId ) ) &&
|
if( !g_scriptMgr.onEmote( player, actorId, eventId, static_cast< uint8_t >( emoteId ) ) &&
|
||||||
eventType == Event::EventHandler::EventHandlerType::Quest )
|
eventType == Event::EventHandler::EventHandlerType::Quest )
|
||||||
{
|
{
|
||||||
auto questInfo = g_exdData.getQuestInfo( eventId );
|
auto questInfo = g_exdDataGen.getQuest( eventId );
|
||||||
if( questInfo )
|
if( questInfo )
|
||||||
player.sendUrgent( "Quest not implemented: " + questInfo->name );
|
player.sendUrgent( "Quest not implemented: " + questInfo->name );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <common/Common.h>
|
#include <common/Common.h>
|
||||||
#include <common/Network/CommonNetwork.h>
|
#include <common/Network/CommonNetwork.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Network/GamePacketNew.h>
|
#include <common/Network/GamePacketNew.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
|
|
||||||
extern Core::Scripting::ScriptManager g_scriptMgr;
|
extern Core::Scripting::ScriptManager g_scriptMgr;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
|
@ -60,7 +60,7 @@ void Core::Network::GameConnection::skillHandler( const Packets::GamePacket& inP
|
||||||
std::string actionIdStr = boost::str( boost::format( "%|04X|" ) % action );
|
std::string actionIdStr = boost::str( boost::format( "%|04X|" ) % action );
|
||||||
player.sendDebug( "---------------------------------------" );
|
player.sendDebug( "---------------------------------------" );
|
||||||
player.sendDebug( "ActionHandler ( " + actionIdStr + " | " +
|
player.sendDebug( "ActionHandler ( " + actionIdStr + " | " +
|
||||||
g_exdData.getActionInfo( action )->name +
|
g_exdDataGen.getAction( action )->name +
|
||||||
" | " + std::to_string( targetId ) + " )" );
|
" | " + std::to_string( targetId ) + " )" );
|
||||||
|
|
||||||
player.queuePacket( ActorControlPacket142( player.getId(), ActorControlType::ActionStart, 0x01, action ) );
|
player.queuePacket( ActorControlPacket142( player.getId(), ActorControlType::ActionStart, 0x01, action ) );
|
||||||
|
@ -100,11 +100,11 @@ void Core::Network::GameConnection::skillHandler( const Packets::GamePacket& inP
|
||||||
}
|
}
|
||||||
else if( action < 3000000 ) // item action
|
else if( action < 3000000 ) // item action
|
||||||
{
|
{
|
||||||
auto info = g_exdData.getEventItemInfo( action );
|
auto info = g_exdDataGen.getEventItem( action );
|
||||||
if( info )
|
if( info )
|
||||||
{
|
{
|
||||||
g_log.debug( info->name );
|
g_log.debug( info->name );
|
||||||
g_scriptMgr.onEventItem( player, action, info->eventId, info->castTime, targetId );
|
g_scriptMgr.onEventItem( player, action, info->quest, info->castTime, targetId );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( action > 3000000 ) // unknown
|
else if( action > 3000000 ) // unknown
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Config/XMLConfig.h>
|
#include <common/Config/XMLConfig.h>
|
||||||
|
|
||||||
#include "NativeScriptManager.h"
|
#include "NativeScriptManager.h"
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
#include <libraries/external/watchdog/Watchdog.h>
|
#include <libraries/external/watchdog/Watchdog.h>
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
extern Core::ServerZone g_serverZone;
|
extern Core::ServerZone g_serverZone;
|
||||||
|
|
||||||
Core::Scripting::ScriptManager::ScriptManager() :
|
Core::Scripting::ScriptManager::ScriptManager() :
|
||||||
|
@ -154,7 +154,7 @@ bool Core::Scripting::ScriptManager::onTalk( Entity::Player& player, uint64_t ac
|
||||||
// aethernet/aetherytes need to be handled separately
|
// aethernet/aetherytes need to be handled separately
|
||||||
if( eventType == Event::EventHandler::EventHandlerType::Aetheryte )
|
if( eventType == Event::EventHandler::EventHandlerType::Aetheryte )
|
||||||
{
|
{
|
||||||
auto aetherInfo = g_exdData.getAetheryteInfo( eventId & 0xFFFF );
|
auto aetherInfo = g_exdDataGen.getAetheryte( eventId & 0xFFFF );
|
||||||
scriptId = EVENTSCRIPT_AETHERYTE_ID;
|
scriptId = EVENTSCRIPT_AETHERYTE_ID;
|
||||||
if( !aetherInfo->isAetheryte )
|
if( !aetherInfo->isAetheryte )
|
||||||
scriptId = EVENTSCRIPT_AETHERNET_ID;
|
scriptId = EVENTSCRIPT_AETHERNET_ID;
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include <common/Network/Connection.h>
|
#include <common/Network/Connection.h>
|
||||||
#include <common/Network/Hive.h>
|
#include <common/Network/Hive.h>
|
||||||
|
|
||||||
#include <common/Exd/ExdData.h>
|
|
||||||
#include <common/Exd/ExdDataGenerated.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
#include <common/Database/DbLoader.h>
|
#include <common/Database/DbLoader.h>
|
||||||
|
@ -39,7 +38,6 @@
|
||||||
Core::Logger g_log;
|
Core::Logger g_log;
|
||||||
Core::DebugCommandHandler g_gameCommandMgr;
|
Core::DebugCommandHandler g_gameCommandMgr;
|
||||||
Core::Scripting::ScriptManager g_scriptMgr;
|
Core::Scripting::ScriptManager g_scriptMgr;
|
||||||
Core::Data::ExdData g_exdData;
|
|
||||||
Core::Data::ExdDataGenerated g_exdDataGen;
|
Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
Core::TerritoryMgr g_territoryMgr;
|
Core::TerritoryMgr g_territoryMgr;
|
||||||
Core::LinkshellMgr g_linkshellMgr;
|
Core::LinkshellMgr g_linkshellMgr;
|
||||||
|
@ -164,13 +162,6 @@ bool Core::ServerZone::loadSettings( int32_t argc, char* argv[] )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_log.info( "Setting up EXD data" );
|
|
||||||
if( !g_exdData.init( m_pConfig->getValue< std::string >( "Settings.General.DataPath", "" ) ) )
|
|
||||||
{
|
|
||||||
g_log.fatal( "Error setting up EXD data " );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_log.info( "Setting up generated EXD data" );
|
g_log.info( "Setting up generated EXD data" );
|
||||||
if( !g_exdDataGen.init( m_pConfig->getValue< std::string >( "Settings.General.DataPath", "" ) ) )
|
if( !g_exdDataGen.init( m_pConfig->getValue< std::string >( "Settings.General.DataPath", "" ) ) )
|
||||||
{
|
{
|
||||||
|
@ -213,15 +204,6 @@ void Core::ServerZone::run( int32_t argc, char* argv[] )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_exdData.loadZoneInfo();
|
|
||||||
g_exdData.loadClassJobInfo();
|
|
||||||
g_exdData.loadParamGrowInfo();
|
|
||||||
g_exdData.loadEventActionInfo();
|
|
||||||
g_exdData.loadActionInfo();
|
|
||||||
g_exdData.loadStatusEffectInfo();
|
|
||||||
g_exdData.loadAetheryteInfo();
|
|
||||||
g_exdData.loadTribeInfo();
|
|
||||||
|
|
||||||
g_log.info( "LinkshellMgr: Caching linkshells" );
|
g_log.info( "LinkshellMgr: Caching linkshells" );
|
||||||
if( !g_linkshellMgr.loadLinkshells() )
|
if( !g_linkshellMgr.loadLinkshells() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Util/Util.h>
|
#include <common/Util/Util.h>
|
||||||
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
||||||
#include <common/Logging/Logger.h>
|
#include <common/Logging/Logger.h>
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
#include "Script/ScriptManager.h"
|
#include "Script/ScriptManager.h"
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
using namespace Core::Network::Packets;
|
using namespace Core::Network::Packets;
|
||||||
|
@ -31,8 +31,8 @@ Core::StatusEffect::StatusEffect::StatusEffect( uint32_t id, Entity::ActorPtr so
|
||||||
, m_tickRate( tickRate )
|
, m_tickRate( tickRate )
|
||||||
, m_lastTick( 0 )
|
, m_lastTick( 0 )
|
||||||
{
|
{
|
||||||
auto& entry = g_exdData.m_statusEffectInfoMap[id];
|
auto entry = g_exdDataGen.getStatus( id );
|
||||||
m_name = entry.name;
|
m_name = entry->name;
|
||||||
|
|
||||||
std::replace( m_name.begin(), m_name.end(), ' ', '_' );
|
std::replace( m_name.begin(), m_name.end(), ' ', '_' );
|
||||||
std::replace( m_name.begin(), m_name.end(), ':', '_' );
|
std::replace( m_name.begin(), m_name.end(), ':', '_' );
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <common/Util/UtilMath.h>
|
#include <common/Util/UtilMath.h>
|
||||||
#include <common/Network/GamePacket.h>
|
#include <common/Network/GamePacket.h>
|
||||||
#include <common/Network/GamePacketNew.h>
|
#include <common/Network/GamePacketNew.h>
|
||||||
#include <common/Exd/ExdData.h>
|
#include <common/Exd/ExdDataGenerated.h>
|
||||||
#include <common/Network/CommonNetwork.h>
|
#include <common/Network/CommonNetwork.h>
|
||||||
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
extern Core::ServerZone g_serverZone;
|
extern Core::ServerZone g_serverZone;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdDataGenerated g_exdDataGen;
|
||||||
extern Core::Scripting::ScriptManager g_scriptMgr;
|
extern Core::Scripting::ScriptManager g_scriptMgr;
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
@ -207,7 +207,7 @@ void Zone::loadCellCache()
|
||||||
|
|
||||||
uint8_t Zone::getNextWeather()
|
uint8_t Zone::getNextWeather()
|
||||||
{
|
{
|
||||||
auto zoneInfo = g_exdData.m_zoneInfoMap[getTerritoryId()];
|
auto zoneInfo = g_exdDataGen.getTerritoryType( getTerritoryId() );
|
||||||
|
|
||||||
uint32_t unixTime = static_cast< uint32_t >( Util::getTimeSeconds() );
|
uint32_t unixTime = static_cast< uint32_t >( Util::getTimeSeconds() );
|
||||||
// Get Eorzea hour for weather start
|
// Get Eorzea hour for weather start
|
||||||
|
@ -225,7 +225,28 @@ uint8_t Zone::getNextWeather()
|
||||||
|
|
||||||
auto rate = static_cast< uint8_t >( step2 % 0x64 );
|
auto rate = static_cast< uint8_t >( step2 % 0x64 );
|
||||||
|
|
||||||
for( auto entry : zoneInfo.weather_rate_map )
|
uint8_t weatherRateNum = zoneInfo->weatherRate > g_exdDataGen.getWeatherRateIdList().size() ? 0 : zoneInfo->weatherRate;
|
||||||
|
|
||||||
|
auto weatherRate = g_exdDataGen.getWeatherRate( weatherRateNum );
|
||||||
|
auto weatherRateFields = g_exdDataGen.m_WeatherRateDat.get_row( weatherRateNum );
|
||||||
|
|
||||||
|
std::map< uint8_t, int32_t> weatherRateMap;
|
||||||
|
|
||||||
|
uint8_t sumPc = 0;
|
||||||
|
for( size_t i = 0; i < 16; )
|
||||||
|
{
|
||||||
|
int32_t weatherId = boost::get< int32_t >( weatherRateFields[i] );
|
||||||
|
|
||||||
|
if( weatherId == 0 )
|
||||||
|
break;
|
||||||
|
|
||||||
|
sumPc += boost::get< uint8_t >( weatherRateFields[i + 1] );
|
||||||
|
weatherRateMap[sumPc] = weatherId;
|
||||||
|
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
for( auto entry : weatherRateMap )
|
||||||
{
|
{
|
||||||
uint8_t sRate = entry.first;
|
uint8_t sRate = entry.first;
|
||||||
auto weatherId = static_cast< uint8_t >( entry.second );
|
auto weatherId = static_cast< uint8_t >( entry.second );
|
||||||
|
|
|
@ -1666,10 +1666,18 @@
|
||||||
"target": "ClassJobCategory"
|
"target": "ClassJobCategory"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"index": 4,
|
||||||
|
"name": "ExpArrayIndex"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"index": 9,
|
"index": 9,
|
||||||
"name": "Modifier{HitPoints}"
|
"name": "Modifier{HitPoints}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"index": 10,
|
||||||
|
"name": "Modifier{ManaPoints}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"index": 11,
|
"index": 11,
|
||||||
"name": "Modifier{Strength}"
|
"name": "Modifier{Strength}"
|
||||||
|
@ -6244,6 +6252,10 @@
|
||||||
"target": "PlaceName"
|
"target": "PlaceName"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"index": 12,
|
||||||
|
"name": "DiscoveryIndex"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"index": 14,
|
"index": 14,
|
||||||
"name": "TerritoryType",
|
"name": "TerritoryType",
|
||||||
|
@ -6251,6 +6263,10 @@
|
||||||
"type": "link",
|
"type": "link",
|
||||||
"target": "TerritoryType"
|
"target": "TerritoryType"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"index": 15,
|
||||||
|
"name": "DiscoveryArrayByte"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -6845,6 +6861,15 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"sheet": "Opening",
|
||||||
|
"defaultColumn": "Name",
|
||||||
|
"definitions": [
|
||||||
|
{
|
||||||
|
"name": "Name"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"sheet": "Orchestrion",
|
"sheet": "Orchestrion",
|
||||||
"definitions": [
|
"definitions": [
|
||||||
|
@ -9089,6 +9114,18 @@
|
||||||
"type": "link",
|
"type": "link",
|
||||||
"target": "DefaultTalk"
|
"target": "DefaultTalk"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"index": 26,
|
||||||
|
"type": "repeat",
|
||||||
|
"count": 4,
|
||||||
|
"definition": {
|
||||||
|
"name": "Item{PossibleReward}",
|
||||||
|
"converter": {
|
||||||
|
"type": "link",
|
||||||
|
"target": "Item"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue