mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-07 19:27:45 +00:00
Merge pull request #894 from hkAlice/unfourtunate-warps
[3.x] fix actionresult, hudparam, resting packet; status duration; self sprint temp fix;
This commit is contained in:
commit
a1e402de07
5 changed files with 39 additions and 12 deletions
|
@ -470,6 +470,7 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
|||
};
|
||||
|
||||
struct IntegrityStatus {
|
||||
|
||||
uint8_t Slot;
|
||||
uint8_t __padding1;
|
||||
uint16_t Id;
|
||||
|
@ -478,7 +479,6 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
|||
uint8_t __padding3;
|
||||
float Time;
|
||||
uint32_t Source;
|
||||
uint8_t unknown_3_2;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -499,8 +499,9 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
|||
uint32_t HpMax;
|
||||
uint16_t MpMax;
|
||||
uint8_t StatusCount;
|
||||
uint8_t __padding3;
|
||||
uint8_t unknown_E0;
|
||||
IntegrityStatus Status[4];
|
||||
uint32_t __padding3;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -550,14 +551,15 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
|||
|
||||
/**
|
||||
* Structural representation of the packet sent by the server
|
||||
* to update HP / MP / TP
|
||||
* to update HP / MP / TP / GP
|
||||
*/
|
||||
struct FFXIVIpcResting : FFXIVIpcBasePacket< Resting >
|
||||
{
|
||||
/* 0000 */ uint32_t Hp;
|
||||
/* 0004 */ uint16_t Mp;
|
||||
/* 0006 */ uint16_t Tp;
|
||||
/* 0008 */ uint16_t Gp;
|
||||
uint32_t Hp;
|
||||
uint16_t Mp;
|
||||
uint16_t Tp;
|
||||
uint16_t Gp;
|
||||
uint32_t Unknown_3_2;
|
||||
};
|
||||
|
||||
struct FFXIVIpcRecastGroup : FFXIVIpcBasePacket< RecastGroup >
|
||||
|
@ -617,6 +619,7 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
|||
uint64_t Target;
|
||||
uint32_t BallistaEntityId;
|
||||
Common::CalcResult CalcResult;
|
||||
uint32_t __padding2;
|
||||
};
|
||||
|
||||
struct MountStruct
|
||||
|
|
|
@ -839,9 +839,10 @@ bool Action::Action::preFilterActor( Sapphire::Entity::GameObject& actor ) const
|
|||
// todo: are there any server side eobjs that players can hit?
|
||||
if( kind != ObjKind::BattleNpc && kind != ObjKind::Player )
|
||||
return false;
|
||||
|
||||
if( !m_canTargetSelf && chara->getId() == m_pSource->getId() )
|
||||
return false;
|
||||
|
||||
// todo: evaluate other actions that can hit condition (eg. sprint)
|
||||
/* if( !m_canTargetSelf && chara->getId() == m_pSource->getId() )
|
||||
return false;*/
|
||||
|
||||
if( ( m_lutEntry.potency > 0 || m_lutEntry.curePotency > 0 ) && !chara->isAlive() ) // !m_canTargetDead not working for aoe
|
||||
return false;
|
||||
|
|
|
@ -530,6 +530,14 @@ void Sapphire::Entity::Chara::addStatusEffect( StatusEffect::StatusEffectPtr pEf
|
|||
statusEffectAdd->data().MpMax = static_cast< uint16_t >( getMaxMp() );
|
||||
statusEffectAdd->data().ClassJob = static_cast< uint8_t >( getClass() );
|
||||
statusEffectAdd->data().StatusCount = 1;
|
||||
statusEffectAdd->data().unknown_E0 = 0xE0;
|
||||
|
||||
// set all status sources to u32 invalid game obj
|
||||
// todo: chara status effect map should be filled instead, since hudparam also uses invalid gameobj
|
||||
for( int i = 0; i < 4; ++i )
|
||||
{
|
||||
statusEffectAdd->data().Status[ i ].Source = INVALID_GAME_OBJECT_ID;
|
||||
}
|
||||
|
||||
auto& status = statusEffectAdd->data().Status[ 0 ];
|
||||
|
||||
|
|
|
@ -335,7 +335,7 @@ void Sapphire::Network::GameConnection::zoneJumpHandler( const Packets::FFXIVARR
|
|||
return;
|
||||
|
||||
auto& warpMgr = Common::Service< WarpMgr >::ref();
|
||||
warpMgr.requestMoveTerritory( player, Common::WARP_TYPE_EXIT_RANGE, pTargetTeri->getGuId(), targetPos, rotation );
|
||||
warpMgr.requestMoveTerritory( player, Common::WARP_TYPE_NORMAL_POS, pTargetTeri->getGuId(), targetPos, rotation );
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <Network/GamePacket.h>
|
||||
#include <StatusEffect/StatusEffect.h>
|
||||
#include <Util/Util.h>
|
||||
#include "Forwards.h"
|
||||
|
||||
namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||
|
@ -28,7 +30,20 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
|||
m_data.Mp = player.getMp();
|
||||
m_data.Tp = player.getTp();
|
||||
m_data.HpMax = player.getMaxHp();
|
||||
m_data.MpMax = player.getMaxMp();;
|
||||
m_data.MpMax = player.getMaxMp();
|
||||
|
||||
auto statusMap = player.getStatusEffectMap();
|
||||
|
||||
int i = 0;
|
||||
for( const auto& [ key, val ] : statusMap )
|
||||
{
|
||||
m_data.effect[ i ].Id = val->getId();
|
||||
m_data.effect[ i ].Source = val->getSrcActorId();
|
||||
m_data.effect[ i ].SystemParam = val->getParam();
|
||||
m_data.effect[ i ].Time = ( val->getDuration() - ( Common::Util::getTimeMs() - val->getStartTimeMs() ) ) / 1000.f;
|
||||
|
||||
i++;
|
||||
}
|
||||
};
|
||||
};
|
||||
template< typename... Args >
|
||||
|
|
Loading…
Add table
Reference in a new issue