From 34568b64319462cb2e516a61917aa98e3b9a618b Mon Sep 17 00:00:00 2001 From: Maru Date: Wed, 30 Aug 2017 01:52:20 -0300 Subject: [PATCH] Sorting out action effects (castbar, anim); Block heal and damage on dead actors; --- src/servers/Server_Zone/Action/ActionCast.cpp | 2 +- src/servers/Server_Zone/Actor/Player.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/servers/Server_Zone/Action/ActionCast.cpp b/src/servers/Server_Zone/Action/ActionCast.cpp index a3297484..968580a9 100644 --- a/src/servers/Server_Zone/Action/ActionCast.cpp +++ b/src/servers/Server_Zone/Action/ActionCast.cpp @@ -53,7 +53,7 @@ void Core::Action::ActionCast::onStart() castPacket.data().action_id = m_id; castPacket.data().unknown = 1; - castPacket.data().cast_time = m_castTime; + castPacket.data().cast_time = m_castTime / 1000; // This is used for the cast bar above the target bar of the caster. castPacket.data().target_id = m_pTarget->getId(); m_pSource->sendToInRangeSet( castPacket, false ); diff --git a/src/servers/Server_Zone/Actor/Player.cpp b/src/servers/Server_Zone/Actor/Player.cpp index f4899997..0dd80c73 100644 --- a/src/servers/Server_Zone/Actor/Player.cpp +++ b/src/servers/Server_Zone/Actor/Player.cpp @@ -1516,10 +1516,11 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId, case Core::Common::HandleSkillType::StdDamage: { sendDebug( "STD_DAMAGE" ); + GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() ); effectPacket.data().targetId = pTarget.getId(); effectPacket.data().actionAnimationId = actionId; - effectPacket.data().unknown_2 = 0; + effectPacket.data().unknown_2 = 1; // This seems to have an effect on the "double-cast finish" animation // effectPacket.data().unknown_3 = 1; effectPacket.data().actionTextId = actionId; effectPacket.data().numEffects = 1; @@ -1532,6 +1533,9 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId, sendToInRangeSet( effectPacket, true ); + if (!pTarget.isAlive()) + break; + pTarget.takeDamage( param1 ); pTarget.onActionHostile( shared_from_this() ); break; @@ -1546,7 +1550,7 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId, GamePacketNew< FFXIVIpcEffect, ServerZoneIpcType > effectPacket( getId() ); effectPacket.data().targetId = pTarget.getId(); effectPacket.data().actionAnimationId = actionId; - effectPacket.data().unknown_2 = 0; + effectPacket.data().unknown_2 = 1; // This seems to have an effect on the "double-cast finish" animation // effectPacket.data().unknown_3 = 1; effectPacket.data().actionTextId = actionId; effectPacket.data().numEffects = 1; @@ -1559,6 +1563,9 @@ void Core::Entity::Player::handleScriptSkill( uint32_t type, uint32_t actionId, sendToInRangeSet( effectPacket, true ); + if ( !pTarget.isAlive() ) + break; + pTarget.heal( calculatedHeal ); break; }