diff --git a/.gitignore b/.gitignore index be5cd80f..4e989b2b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,8 +23,9 @@ src/tools/[Bb]in/exd_struct_gen # decompiled scripts src/tools/bin/generated/* -# Build Directory +# Build Directories build/ +build-*/ cmake-build-*/ # Prerequisites diff --git a/src/common/Common.h b/src/common/Common.h index 2cab0b10..f3f9a1ff 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -525,8 +525,7 @@ namespace Sapphire::Common }; - enum struct ActionAspect : - uint8_t + enum struct ActionAspect : uint8_t { None = 0, // Doesn't imply unaspected Fire = 1, @@ -538,6 +537,21 @@ namespace Sapphire::Common Unaspected = 7 // Doesn't imply magical unaspected damage - could be unaspected physical }; + enum class ActionPrimaryCostType : uint8_t + { + None = 0, // ? + MagicPoints = 3, + TacticsPoints = 5, +// WARGauge = 22, +// DRKGauge = 25, +// AetherflowStack = 30, +// Status = 32, +// PLDGauge = 41, +// RDMGaugeBoth = 74, +//// RDMGaugeBlack = 75, // not right? +// DRGGauge3Eyes = 76, + }; + enum class ActionType : int8_t { WeaponOverride = -1, // Needs more investigation (takes the damage type of the equipped weapon)? @@ -584,6 +598,11 @@ namespace Sapphire::Common CritDirectHitDamage = 3 }; + enum ItemActionType : uint16_t + { + ItemActionVFX = 944, + }; + enum ActionEffectDisplayType : uint8_t { HideActionName = 0, @@ -591,6 +610,22 @@ namespace Sapphire::Common ShowItemName = 2, }; + struct EffectEntry + { + Common::ActionEffectType effectType; + Common::ActionHitSeverityType hitSeverity; + uint8_t param; + /*! + * @brief Shows an additional percentage in the battle log + * + * Has no effect on what is shown and stored in value + */ + int8_t bonusPercent; + uint8_t valueMultiplier; // This multiplies whatever value is in the 'value' param by 10. Possibly a workaround for big numbers + uint8_t flags; + int16_t value; + }; + enum class ActionCollisionType : uint8_t { None, @@ -604,6 +639,13 @@ namespace Sapphire::Common Unknown3 }; + enum class ActionInterruptType : uint8_t + { + None, + RegularInterrupt, + DamageInterrupt, + }; + enum HandleActionType : uint8_t { Event, @@ -889,6 +931,12 @@ namespace Sapphire::Common IsFreeCompanyEstate = 16, }; + struct PlayerTeleportQuery + { + uint16_t targetAetheryte; + uint16_t cost; + }; + using PlayerStateFlagList = std::vector< PlayerStateFlag >; } diff --git a/src/common/Network/CommonActorControl.h b/src/common/Network/CommonActorControl.h index 77daeef4..e204e931 100644 --- a/src/common/Network/CommonActorControl.h +++ b/src/common/Network/CommonActorControl.h @@ -17,10 +17,10 @@ enum ActorControlType : uint16_t { /*! Toggles weapon status -> Sheathed/UnSheathed \param param1 status 0|1 */ - ToggleWeapon = 0x00, + ToggleWeapon = 0x00, /*! Toggles Autoattack status on/off \param param1 status 0|1 */ - AutoAttack = 0x01, + AutoAttack = 0x01, SetStatus = 0x02, CastStart = 0x03, ToggleAggro = 0x04, @@ -35,6 +35,13 @@ enum ActorControlType : uint16_t DeathAnimation = 0x0E, CastInterrupt = 0x0F, + /*! + * @brief Sent when a player uses an action + * + * param1 Seems to be always 1 from what I've seen, needs more research + * param2 The actionid + * param3 The action cooldown in ms / 10 + */ ActionStart = 0x11, StatusEffectGain = 0x14, diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index afded198..1af7218b 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -304,6 +304,7 @@ namespace Sapphire::Network::Packets SkillHandler = 0x013B, // updated 4.5 GMCommand1 = 0x013C, // updated 4.5 GMCommand2 = 0x013D, // updated 4.5 + AoESkillHandler = 0x13E, // updated 4.5 UpdatePositionHandler = 0x013F, // updated 4.5 UpdatePositionInstance = 0x0183, // updated 4.3 diff --git a/src/common/Network/PacketDef/Zone/ClientZoneDef.h b/src/common/Network/PacketDef/Zone/ClientZoneDef.h index 663feb3c..3d439dc7 100644 --- a/src/common/Network/PacketDef/Zone/ClientZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ClientZoneDef.h @@ -63,13 +63,29 @@ struct FFXIVIpcUpdatePosition : struct FFXIVIpcSkillHandler : FFXIVIpcBasePacket< SkillHandler > { - /* 0000 */ char pad_0000[1]; + /* 0000 */ uint8_t pad_0000; /* 0001 */ uint8_t type; - /* 0002 */ char pad_0002[2]; + /* 0002 */ uint8_t pad_0002[2]; /* 0004 */ uint32_t actionId; - /* 0008 */ uint32_t useCount; - /* 000C */ char pad_000C[4]; + /* 0008 */ uint16_t sequence; + /* 000A */ uint8_t pad_000C[6]; /* 0010 */ uint64_t targetId; + /* 0018 */ uint16_t itemSourceSlot; + /* 001A */ uint16_t itemSourceContainer; + /* 001C */ uint32_t unknown; +}; + +struct FFXIVIpcAoESkillHandler : + FFXIVIpcBasePacket< AoESkillHandler > +{ + /* 0000 */ uint8_t pad_0000; + /* 0001 */ uint8_t type; + /* 0002 */ uint8_t pad_0002[2]; + /* 0004 */ uint32_t actionId; + /* 0008 */ uint16_t sequence; + /* 000A */ uint8_t pad_000C[6]; + /* 0010 */ Common::FFXIVARR_POSITION3 pos; + /* 001C */ uint32_t unknown; // could almost be rotation + 16 bits more padding? }; struct FFXIVIpcZoneLineHandler : @@ -91,9 +107,9 @@ struct FFXIVIpcEventHandlerReturn : /* 0004 */ uint16_t scene; /* 0006 */ uint16_t param1; /* 0008 */ uint16_t param2; - /* 000A */ char pad_000A[2]; + /* 000A */ uint8_t pad_000A[2]; /* 000C */ uint16_t param3; - /* 000E */ char pad_000E[2]; + /* 000E */ uint8_t pad_000E[2]; /* 0010 */ uint16_t param4; }; @@ -155,7 +171,7 @@ struct FFXIVIpcSetSearchInfo : }; }; - /* 0008 */ char pad_0008[9]; + /* 0008 */ uint8_t pad_0008[9]; /* 0011 */ Common::ClientLanguage language; /* 0012 */ char searchComment[193]; }; @@ -175,9 +191,9 @@ struct FFXIVIpcTellHandler : FFXIVIpcBasePacket< TellReq > struct FFXIVIpcChatHandler : FFXIVIpcBasePacket< ChatHandler > { - /* 0000 */ char pad_0000[4]; + /* 0000 */ uint8_t pad_0000[4]; /* 0004 */ uint32_t sourceId; - /* 0008 */ char pad_0008[16]; + /* 0008 */ uint8_t pad_0008[16]; /* 0018 */ Common::ChatType chatType; /* 001A */ char message[1012]; }; @@ -194,7 +210,7 @@ struct FFXIVIpcLinkshellEventHandler : { /* 0000 */ uint32_t eventId; /* 0004 */ uint16_t scene; - /* 0006 */ char pad_0006[1]; + /* 0006 */ uint8_t pad_0006[1]; /* 0007 */ char lsName[21]; }; @@ -203,13 +219,13 @@ struct FFXIVIpcInventoryModifyHandler : { /* 0000 */ uint32_t seq; /* 0004 */ Common::InventoryOperation action; - /* 0005 */ char pad_0005[7]; + /* 0005 */ uint8_t pad_0005[7]; /* 000C */ uint16_t fromContainer; - /* 000E */ char pad_000E[2]; + /* 000E */ uint8_t pad_000E[2]; /* 0010 */ uint8_t fromSlot; - /* 0011 */ char pad_0011[15]; + /* 0011 */ uint8_t pad_0011[15]; /* 0020 */ uint16_t toContainer; - /* 0022 */ char pad_0022[2]; + /* 0022 */ uint8_t pad_0022[2]; /* 0024 */ uint8_t toSlot; /* 0025 */ uint8_t pad_0025[3]; /* 0028 */ uint32_t splitCount; @@ -245,11 +261,11 @@ struct FFXIVIpcSetSharedEstateSettings : /* 0008 */ uint64_t char2ContentId; /* 0010 */ uint64_t char3ContentId; /* 0018 */ uint8_t char1Permissions; - /* 0019 */ char padding1[0x7]; + /* 0019 */ uint8_t padding1[0x7]; /* 0020 */ uint8_t char2Permissions; - /* 0021 */ char padding2[0x7]; + /* 0021 */ uint8_t padding2[0x7]; /* 0028 */ uint8_t char3Permissions; - /* 0029 */ char padding3[0x7]; + /* 0029 */ uint8_t padding3[0x7]; }; struct FFXIVIpcMarketBoardRequestItemListings : diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index 86988bd9..d24d8452 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -388,17 +388,6 @@ struct FFXIVIpcUpdateHpMpTp : * Structural representation of the packet sent by the server * for battle actions */ -struct EffectEntry -{ - Common::ActionEffectType effectType; - Common::ActionHitSeverityType hitSeverity; - uint8_t param; - int8_t bonusPercent; // shows an additional percentage in the battle log, will not change the damage number sent & shown - uint8_t valueMultiplier; // This multiplies whatever value is in the 'value' param by 10. Possibly a workaround for big numbers - uint8_t flags; - int16_t value; -}; - struct EffectHeader { uint64_t animationTargetId; // who the animation targets @@ -426,7 +415,7 @@ struct FFXIVIpcEffect : FFXIVIpcBasePacket< Effect > uint64_t animationTargetId; // who the animation targets uint32_t actionId; // what the casting player casts, shown in battle log/ui - uint32_t globalEffectCounter; // seems to only increment on retail? + uint32_t sequence; // seems to only increment on retail? float animationLockTime; // maybe? doesn't seem to do anything uint32_t someTargetId; // always 00 00 00 E0, 0x0E000000 is the internal def for INVALID TARGET ID @@ -458,7 +447,7 @@ struct FFXIVIpcAoeEffect { EffectHeader header; - EffectEntry effects[size]; + Common::EffectEntry effects[size]; uint16_t padding_6A[3]; @@ -1154,15 +1143,15 @@ struct FFXIVIpcCurrencyCrystalInfo : struct FFXIVIpcInventoryTransactionFinish : FFXIVIpcBasePacket< InventoryTransactionFinish > { - uint32_t transactionId; - uint32_t transactionId1; + uint32_t sequenceId; + uint32_t sequenceId1; uint64_t padding; }; struct FFXIVIpcInventoryTransaction : FFXIVIpcBasePacket< InventoryTransaction > { - uint32_t transactionId; + uint32_t sequence; uint8_t type; uint8_t padding; uint16_t padding1; diff --git a/src/scripts/action/ActionSprint3.cpp b/src/scripts/action/ActionSprint3.cpp deleted file mode 100644 index 8d123bf7..00000000 --- a/src/scripts/action/ActionSprint3.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -class ActionSprint3 : - public Sapphire::ScriptAPI::ActionScript -{ -public: - ActionSprint3() : - Sapphire::ScriptAPI::ActionScript( 3 ) - { - } - - void onCastFinish( Sapphire::Entity::Player& player, Sapphire::Entity::Chara& targetActor ) override - { - player.addStatusEffectByIdIfNotExist( 50, 20000, player, 30 ); - } -}; - -EXPOSE_SCRIPT( ActionSprint3 ); \ No newline at end of file diff --git a/src/scripts/action/ScriptLoader.cpp b/src/scripts/action/ScriptLoader.cpp deleted file mode 100644 index 492a2b69..00000000 --- a/src/scripts/action/ScriptLoader.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include