1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 19:17:45 +00:00

fix typo and move it to Chara so it can be set on mobs :)

This commit is contained in:
collett 2020-11-17 00:01:13 +09:00
parent c1b70480ff
commit 60191fb113
5 changed files with 36 additions and 28 deletions

View file

@ -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;
@ -990,6 +991,25 @@ float Sapphire::Entity::Chara::applyShieldProtection( float damage )
return remainingDamage;
}
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;

View file

@ -134,6 +134,8 @@ namespace Sapphire::Entity
/*! Detour Crowd actor scale */
float m_radius;
uint32_t m_effect;
public:
Chara( Common::ObjKind type );
@ -290,6 +292,10 @@ namespace Sapphire::Entity
float applyShieldProtection( float damage );
uint32_t getVisualEffect();
void setVisualEffect( uint32_t effect, bool sendPacket = true );
void sendVisualEffect();
};
}

View file

@ -83,8 +83,7 @@ Sapphire::Entity::Player::Player() :
m_directorInitialized( false ),
m_onEnterEventDone( false ),
m_falling( false ),
m_pQueuedAction( nullptr ),
m_effect( 0 )
m_pQueuedAction( nullptr )
{
m_id = 0;
m_currentStance = Stance::Passive;
@ -2546,25 +2545,6 @@ void Sapphire::Entity::Player::gaugeSetRaw( uint8_t* pData )
sendActorGauge();
}
uint32_t Sapphire::Entity::Player::getVisualEffect()
{
return m_effect;
}
void Sapphire::Entity::Player::setVisualEffect( uint32_t effect, bool sendPacket )
{
m_effect = effect;
if( sendPacket );
sendVisualEffect();
}
void Sapphire::Entity::Player::sendVisualEffect()
{
auto pPacket = makeZonePacket< FFXIVIpcCharaVisualEffect >( getId() );
pPacket->data().id = m_effect;
sendToInRangeSet( pPacket, true );
}
void Sapphire::Entity::Player::gaugeWarSetIb( uint8_t value )
{
assert( value >= 0 && value <= 100 );

View file

@ -990,10 +990,6 @@ namespace Sapphire::Entity
void sendActorGauge();
void gaugeSetRaw( uint8_t* pData );
uint32_t getVisualEffect();
void setVisualEffect( uint32_t effect, bool sendPacket = true );
void sendVisualEffect();
void gaugeWarSetIb( uint8_t value );
uint8_t gaugeWarGetIb();
@ -1221,8 +1217,6 @@ namespace Sapphire::Entity
std::array< Common::HuntingLogEntry, 12 > m_huntingLogEntries;
std::unordered_map< uint32_t, std::vector< ShopBuyBackEntry > > m_shopBuyBackMap;
uint32_t m_effect;
};
}

View file

@ -375,6 +375,14 @@ void Sapphire::World::Manager::DebugCommandMgr::set( char* data, Entity::Player&
{
int32_t id;
sscanf( params.c_str(), "%d", &id );
for( auto actor : player.getInRangeActors() )
{
if( actor->getId() == player.getTargetId() )
{
actor->getAsChara()->setVisualEffect( id );
return;
}
}
player.setVisualEffect( id );
}
else