mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
fix actionresult, hudparam, resting packet; comment action filter for sprint false selftarget; warp vfx on exit range; fix status duration;
This commit is contained in:
parent
1ba6ea02d5
commit
d5022516f5
5 changed files with 41 additions and 14 deletions
|
@ -470,15 +470,15 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IntegrityStatus {
|
struct IntegrityStatus {
|
||||||
|
|
||||||
uint8_t Slot;
|
uint8_t Slot;
|
||||||
uint8_t __padding1;
|
uint8_t paddingmaybe;
|
||||||
uint16_t Id;
|
uint16_t Id;
|
||||||
int16_t SystemParam;
|
int16_t SystemParam;
|
||||||
uint8_t __padding2;
|
uint8_t __padding2;
|
||||||
uint8_t __padding3;
|
uint8_t __padding3;
|
||||||
float Time;
|
float Time;
|
||||||
uint32_t Source;
|
uint32_t Source;
|
||||||
uint8_t unknown_3_2;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -499,8 +499,9 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
uint32_t HpMax;
|
uint32_t HpMax;
|
||||||
uint16_t MpMax;
|
uint16_t MpMax;
|
||||||
uint8_t StatusCount;
|
uint8_t StatusCount;
|
||||||
uint8_t __padding3;
|
uint8_t unknown_E0;
|
||||||
IntegrityStatus Status[4];
|
IntegrityStatus Status[4];
|
||||||
|
uint32_t unk_1;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -550,14 +551,15 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Structural representation of the packet sent by the 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 >
|
struct FFXIVIpcResting : FFXIVIpcBasePacket< Resting >
|
||||||
{
|
{
|
||||||
/* 0000 */ uint32_t Hp;
|
uint32_t Hp;
|
||||||
/* 0004 */ uint16_t Mp;
|
uint16_t Mp;
|
||||||
/* 0006 */ uint16_t Tp;
|
uint16_t Tp;
|
||||||
/* 0008 */ uint16_t Gp;
|
uint16_t Gp;
|
||||||
|
uint32_t Unknown_3_2;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FFXIVIpcRecastGroup : FFXIVIpcBasePacket< RecastGroup >
|
struct FFXIVIpcRecastGroup : FFXIVIpcBasePacket< RecastGroup >
|
||||||
|
@ -617,6 +619,7 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
uint64_t Target;
|
uint64_t Target;
|
||||||
uint32_t BallistaEntityId;
|
uint32_t BallistaEntityId;
|
||||||
Common::CalcResult CalcResult;
|
Common::CalcResult CalcResult;
|
||||||
|
uint32_t __padding2;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MountStruct
|
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?
|
// todo: are there any server side eobjs that players can hit?
|
||||||
if( kind != ObjKind::BattleNpc && kind != ObjKind::Player )
|
if( kind != ObjKind::BattleNpc && kind != ObjKind::Player )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( !m_canTargetSelf && chara->getId() == m_pSource->getId() )
|
// todo: evaluate other actions that can hit condition (eg. sprint)
|
||||||
return false;
|
/* 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
|
if( ( m_lutEntry.potency > 0 || m_lutEntry.curePotency > 0 ) && !chara->isAlive() ) // !m_canTargetDead not working for aoe
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -530,13 +530,21 @@ void Sapphire::Entity::Chara::addStatusEffect( StatusEffect::StatusEffectPtr pEf
|
||||||
statusEffectAdd->data().MpMax = static_cast< uint16_t >( getMaxMp() );
|
statusEffectAdd->data().MpMax = static_cast< uint16_t >( getMaxMp() );
|
||||||
statusEffectAdd->data().ClassJob = static_cast< uint8_t >( getClass() );
|
statusEffectAdd->data().ClassJob = static_cast< uint8_t >( getClass() );
|
||||||
statusEffectAdd->data().StatusCount = 1;
|
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 ];
|
auto& status = statusEffectAdd->data().Status[ 0 ];
|
||||||
|
|
||||||
status.Source = pEffect->getSrcActorId();
|
status.Source = pEffect->getSrcActorId();
|
||||||
status.Time = static_cast< float >( pEffect->getDuration() ) / 1000;
|
status.Time = static_cast< float >( pEffect->getDuration() ) / 1000;
|
||||||
status.Id = static_cast< uint16_t >( pEffect->getId() );
|
status.Id = static_cast< uint16_t >( pEffect->getId() );
|
||||||
status.Slot = static_cast< uint8_t >( nextSlot );
|
status.Slot = static_cast< uint8_t >( nextSlot + 1 );
|
||||||
status.SystemParam = static_cast< int16_t >( pEffect->getParam() );
|
status.SystemParam = static_cast< int16_t >( pEffect->getParam() );
|
||||||
|
|
||||||
sendToInRangeSet( statusEffectAdd, isPlayer() );
|
sendToInRangeSet( statusEffectAdd, isPlayer() );
|
||||||
|
|
|
@ -335,7 +335,7 @@ void Sapphire::Network::GameConnection::zoneJumpHandler( const Packets::FFXIVARR
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto& warpMgr = Common::Service< WarpMgr >::ref();
|
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
|
#pragma once
|
||||||
|
|
||||||
#include <Network/GamePacket.h>
|
#include <Network/GamePacket.h>
|
||||||
|
#include <StatusEffect/StatusEffect.h>
|
||||||
|
#include <Util/Util.h>
|
||||||
#include "Forwards.h"
|
#include "Forwards.h"
|
||||||
|
|
||||||
namespace Sapphire::Network::Packets::WorldPackets::Server
|
namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
|
@ -28,7 +30,20 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
m_data.Mp = player.getMp();
|
m_data.Mp = player.getMp();
|
||||||
m_data.Tp = player.getTp();
|
m_data.Tp = player.getTp();
|
||||||
m_data.HpMax = player.getMaxHp();
|
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 >
|
template< typename... Args >
|
||||||
|
|
Loading…
Add table
Reference in a new issue