diff --git a/sql/schema/schema.sql b/sql/schema/schema.sql index 100308c6..4698f812 100644 --- a/sql/schema/schema.sql +++ b/sql/schema/schema.sql @@ -584,3 +584,21 @@ CREATE TABLE `landplaceditems` ( ) COLLATE='latin1_swedish_ci' ENGINE=InnoDB; + +CREATE TABLE `charamonsternote` ( + `CharacterId` int(20) NOT NULL, + `Category_0` binary(41) DEFAULT NULL, + `Category_1` binary(41) DEFAULT NULL, + `Category_2` binary(41) DEFAULT NULL, + `Category_3` binary(41) DEFAULT NULL, + `Category_4` binary(41) DEFAULT NULL, + `Category_5` binary(41) DEFAULT NULL, + `Category_6` binary(41) DEFAULT NULL, + `Category_7` binary(41) DEFAULT NULL, + `Category_8` binary(41) DEFAULT NULL, + `Category_9` binary(41) DEFAULT NULL, + `Category_10` binary(41) DEFAULT NULL, + `Category_11` binary(41) DEFAULT NULL, + `UPDATE_DATE` datetime DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY(`CharacterId`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git a/src/api/PlayerMinimal.cpp b/src/api/PlayerMinimal.cpp index d74fc7b2..d7fb3645 100644 --- a/src/api/PlayerMinimal.cpp +++ b/src/api/PlayerMinimal.cpp @@ -187,6 +187,7 @@ void PlayerMinimal::saveAsNew() std::vector< uint8_t > orchestrion( 40 ); std::vector< uint8_t > modelEquip( 40 ); std::vector< uint8_t > questTracking8( 10 ); + std::vector< uint8_t > monsterNote( 41 ); std::vector< int16_t > questTracking = { -1, -1, -1, -1, -1 }; memset( questComplete.data(), 0, questComplete.size() ); @@ -328,6 +329,12 @@ void PlayerMinimal::saveAsNew() createInvDbContainer( InventoryType::Currency ); createInvDbContainer( InventoryType::Crystal ); + auto stmtMonsterNote = g_charaDb.getPreparedStatement( Db::ZoneDbStatements::CHARA_MONSTERNOTE_INS ); + stmtMonsterNote->setInt( 1, m_id ); + for( uint8_t i = 1; i <= 12; ++i ) + stmtMonsterNote->setBinary( i + 1, monsterNote ); + g_charaDb.directExecute( stmtMonsterNote ); + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// SETUP EQUIPMENT / STARTING GEAR auto classJobInfo = g_exdDataGen.get< Sapphire::Data::ClassJob >( m_class ); diff --git a/src/common/Common.h b/src/common/Common.h index cb4c1283..078c6420 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -263,6 +263,14 @@ namespace Sapphire::Common }; + enum class UnlockEntry : uint16_t + { + Return = 1, + Teleport = 4, + GearSets = 6, + HuntingLog = 21, + }; + enum ContainerType : uint16_t { Unknown = 0, @@ -579,6 +587,13 @@ namespace Sapphire::Common TpLoss = 12, TpGain = 13, GpGain = 14, + /*! + * @brief Tells the client that it should show combo indicators on actions. + * + * @param flags Required to be 128, doesn't show combo rings on hotbars otherwise + * @param value The actionid that starts/continues the combo. eg, 3617 will start a spinning slash and/or syphon strike combo + */ + StartActionCombo = 28, Knockback = 33, Mount = 38, VFX = 59, // links to VFX sheet @@ -596,7 +611,8 @@ namespace Sapphire::Common enum ItemActionType : uint16_t { - ItemActionVFX = 944, + ItemActionVFX = 852, + ItemActionVFX2 = 944, }; enum ActionEffectDisplayType : uint8_t @@ -931,6 +947,18 @@ namespace Sapphire::Common uint16_t cost; }; + enum LevelTableEntry : uint8_t + { + PIE, + MP, + MAIN, + SUB, + DIV, + HP, + ELMT, + THREAT + }; + using PlayerStateFlagList = std::vector< PlayerStateFlag >; } diff --git a/src/common/Database/ZoneDbConnection.cpp b/src/common/Database/ZoneDbConnection.cpp index 13f6a885..a5503d0e 100644 --- a/src/common/Database/ZoneDbConnection.cpp +++ b/src/common/Database/ZoneDbConnection.cpp @@ -175,6 +175,31 @@ void Sapphire::Db::ZoneDbConnection::doPrepareStatements() "INSERT INTO charaglobalitem ( CharacterId, ItemId, catalogId, stack, UPDATE_DATE ) VALUES ( ?, ?, ?, ?, NOW() );", CONNECTION_SYNC ); + /// CHARA MONSTERNOTE + prepareStatement( CHARA_MONSTERNOTE_INS, + "INSERT INTO charamonsternote ( CharacterId, Category_0, Category_1, Category_2," + " Category_3, Category_4, Category_5, Category_6," + " Category_7, Category_8, Category_9, Category_10," + " Category_11, UPDATE_DATE ) " + " VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW() );", + CONNECTION_SYNC ); + + prepareStatement( CHARA_MONSTERNOTE_UP, "UPDATE charamonsternote " + " SET Category_0 = ?," + " Category_1 = ?," + " Category_2 = ?," + " Category_3 = ?," + " Category_4 = ?," + " Category_5 = ?," + " Category_6 = ?," + " Category_7 = ?," + " Category_8 = ?," + " Category_9 = ?," + " Category_10 = ?," + " Category_11 = ?" + " WHERE CharacterId = ?;", + CONNECTION_ASYNC ); + /// ZONE QUERIES prepareStatement( ZONE_SEL_BNPCTEMPLATES, "SELECT Id, Name, bNPCBaseId, bNPCNameId, mainWeaponModel, " diff --git a/src/common/Database/ZoneDbConnection.h b/src/common/Database/ZoneDbConnection.h index 1c0fde7a..4b094772 100644 --- a/src/common/Database/ZoneDbConnection.h +++ b/src/common/Database/ZoneDbConnection.h @@ -76,6 +76,9 @@ namespace Sapphire::Db CHARA_ITEMGLOBAL_UP, CHARA_ITEMGLOBAL_DELETE, + CHARA_MONSTERNOTE_INS, + CHARA_MONSTERNOTE_UP, + ZONE_SEL_BNPCTEMPLATES, ZONE_SEL_SPAWNGROUPS, ZONE_SEL_SPAWNPOINTS, diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index ef8db6ec..87b1e8e9 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -155,6 +155,8 @@ namespace Sapphire::Network::Packets InventoryActionAck = 0x019D, // updated 4.5 UpdateInventorySlot = 0x019E, // updated 4.5 + HuntingLogEntry = 0x01A9, // added 4.5 + EventPlay = 0x01AB, // updated 4.5 DirectorPlayScene = 0x01AF, // updated 4.5 EventOpenGilShop = 0x01B2, // updated 4.5 diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index d24d8452..d27d0df2 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -1228,6 +1228,20 @@ struct FFXIVIpcEventStart : /* 0014 */ uint32_t padding1; }; +/** +* Structural representation of the packet sent by the server +* to fill a huntin log entry +*/ +struct FFXIVIpcHuntingLogEntry : FFXIVIpcBasePacket< HuntingLogEntry > +{ + int32_t u0; // -1 for all normal classes + uint8_t rank; // starting from 0 + uint8_t index; // classes and gcs + uint8_t entries[10][4]; + uint16_t pad; + uint64_t completeFlags; // 4 bit for each potential entry and the 5th bit for completion of the section + uint64_t pad1; +}; /** * Structural representation of the packet sent by the server diff --git a/src/scripts/action/darkknight/ActionHardSlash3617.cpp b/src/scripts/action/darkknight/ActionHardSlash3617.cpp new file mode 100644 index 00000000..6b582c04 --- /dev/null +++ b/src/scripts/action/darkknight/ActionHardSlash3617.cpp @@ -0,0 +1,22 @@ +#include