diff --git a/src/world/Actor/Chara.cpp b/src/world/Actor/Chara.cpp index 1c9d6be5..bd3d8271 100644 --- a/src/world/Actor/Chara.cpp +++ b/src/world/Actor/Chara.cpp @@ -38,7 +38,8 @@ Sapphire::Entity::Chara::Chara( ObjKind type ) : m_pose( 0 ), m_targetId( INVALID_GAME_OBJECT_ID64 ), m_directorId( 0 ), - m_radius( 1.f ) + m_radius( 1.f ), + m_effect( 0 ) { m_lastTickTime = 0; @@ -911,6 +912,25 @@ uint32_t Sapphire::Entity::Chara::getStatValue( Sapphire::Common::BaseParam base return value + getBonusStat( baseParam ); } +uint32_t Sapphire::Entity::Chara::getVisualEffect() +{ + return m_effect; +} + +void Sapphire::Entity::Chara::setVisualEffect( uint32_t effect, bool sendPacket ) +{ + m_effect = effect; + if( sendPacket ) + sendVisualEffect(); +} + +void Sapphire::Entity::Chara::sendVisualEffect() +{ + auto pPacket = makeZonePacket< FFXIVIpcCharaVisualEffect >( getId() ); + pPacket->data().id = m_effect; + sendToInRangeSet( pPacket, true ); +} + void Sapphire::Entity::Chara::onTick() { uint32_t thisTickDmg = 0; diff --git a/src/world/Actor/Chara.h b/src/world/Actor/Chara.h index b200be4c..e5b30b7e 100644 --- a/src/world/Actor/Chara.h +++ b/src/world/Actor/Chara.h @@ -135,6 +135,8 @@ namespace Sapphire::Entity /*! Detour Crowd actor scale */ float m_radius; + uint32_t m_effect; + public: Chara( Common::ObjKind type ); @@ -289,6 +291,10 @@ namespace Sapphire::Entity Common::BaseParam getPrimaryStat() const; + uint32_t getVisualEffect(); + void setVisualEffect( uint32_t effect, bool sendPacket = true ); + void sendVisualEffect(); + }; } diff --git a/src/world/Manager/DebugCommandMgr.cpp b/src/world/Manager/DebugCommandMgr.cpp index 135d0f6f..044bc7f2 100644 --- a/src/world/Manager/DebugCommandMgr.cpp +++ b/src/world/Manager/DebugCommandMgr.cpp @@ -456,9 +456,15 @@ void Sapphire::World::Manager::DebugCommandMgr::set( char* data, Entity::Player& { int32_t id; sscanf( params.c_str(), "%d", &id ); - auto pPacket = makeZonePacket< FFXIVIpcCharaVisualEffect >( player.getId() ); - pPacket->data().id = id; - player.queuePacket( pPacket ); + for( auto actor : player.getInRangeActors() ) + { + if( actor->getId() == player.getTargetId() ) + { + actor->getAsChara()->setVisualEffect( id ); + return; + } + } + player.setVisualEffect( id ); } else {