From 0573138e1bd2bd08e802044f2f5e6bf58872c196 Mon Sep 17 00:00:00 2001 From: collett Date: Mon, 13 Jan 2020 03:05:54 +0900 Subject: [PATCH] Implement shield buff, and script for adloquium as a demo. --- src/common/Common.h | 3 + .../Network/PacketDef/Zone/ServerZoneDef.h | 26 ++-- .../action/common/ActionAdloquium185.cpp | 83 +++++++++++++ src/world/Action/Action.cpp | 29 ++++- src/world/Action/Action.h | 8 ++ src/world/Action/EffectBuilder.cpp | 14 +++ src/world/Action/EffectBuilder.h | 4 +- src/world/Action/EffectResult.cpp | 36 +++++- src/world/Action/EffectResult.h | 6 + src/world/Actor/Chara.cpp | 114 +++++++++++++----- src/world/Actor/Chara.h | 10 +- src/world/Math/CalcStats.cpp | 49 +++++++- src/world/Math/CalcStats.h | 2 + .../Network/Handlers/ClientTriggerHandler.cpp | 2 +- src/world/StatusEffect/StatusEffect.cpp | 16 ++- src/world/StatusEffect/StatusEffect.h | 4 +- 16 files changed, 337 insertions(+), 69 deletions(-) create mode 100644 src/scripts/action/common/ActionAdloquium185.cpp diff --git a/src/common/Common.h b/src/common/Common.h index 9deaaf3f..c5d1ee16 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -624,6 +624,7 @@ namespace Sapphire::Common TpGain = 13, GpGain = 14, ApplyStatusEffect = 15, + StatusNoEffect = 21, /*! * @brief Tells the client that it should show combo indicators on actions. * @@ -650,6 +651,7 @@ namespace Sapphire::Common enum class ActionEffectResultFlag : uint8_t { None = 0, + Absorbed = 4, EffectOnSource = 0x80, Reflected = 0xA0, }; @@ -1034,6 +1036,7 @@ namespace Sapphire::Common CritDHRateBonus = 7, DamageReceiveTrigger = 8, DamageDealtTrigger = 9, + Shield = 10, }; enum class ActionTypeFilter : int32_t diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index 74bd02b2..2b2cab9b 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -422,7 +422,8 @@ namespace Sapphire::Network::Packets::Server uint16_t current_mp; uint16_t max_mp; uint16_t currentTp; - uint16_t unknown1; + uint8_t shieldPercentage; + uint8_t unknown1; Common::StatusEffect effect[30]; uint32_t padding; }; @@ -441,25 +442,16 @@ namespace Sapphire::Network::Packets::Server { uint32_t unknown; uint32_t actor_id; - //uint8_t unknown1; - //uint8_t unknown2; - //uint16_t padding1; - //uint32_t current_hp; - //uint16_t current_mp; - //uint16_t current_tp; - //uint32_t max_hp; - //uint16_t max_mp; - //uint16_t max_something; uint32_t current_hp; uint32_t max_hp; uint16_t current_mp; - uint16_t unknown1; + uint16_t current_tp; uint16_t max_mp; - uint8_t unknown2; + uint8_t unknown1; uint8_t classId; - uint8_t unknown4; - uint8_t unkFlag; - uint16_t unknown6; + uint8_t shieldPercentage; + uint8_t entryCount; + uint16_t unknown2; struct StatusEntry { @@ -467,12 +459,12 @@ namespace Sapphire::Network::Packets::Server uint8_t unknown3; uint16_t id; uint16_t param; - uint16_t unknown5; // Sort this out (old right half of power/param property) + uint16_t unknown4; // Sort this out (old right half of power/param property) float duration; uint32_t sourceActorId; } statusEntries[4]; - uint32_t unknown7; + uint32_t unknown5; }; /** diff --git a/src/scripts/action/common/ActionAdloquium185.cpp b/src/scripts/action/common/ActionAdloquium185.cpp new file mode 100644 index 00000000..847f890b --- /dev/null +++ b/src/scripts/action/common/ActionAdloquium185.cpp @@ -0,0 +1,83 @@ +#include