mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 11:07:45 +00:00
fix typo and move it to Chara so it can be set on mobs :)
This commit is contained in:
parent
c1b70480ff
commit
60191fb113
5 changed files with 36 additions and 28 deletions
|
@ -38,7 +38,8 @@ Sapphire::Entity::Chara::Chara( ObjKind type ) :
|
||||||
m_pose( 0 ),
|
m_pose( 0 ),
|
||||||
m_targetId( INVALID_GAME_OBJECT_ID64 ),
|
m_targetId( INVALID_GAME_OBJECT_ID64 ),
|
||||||
m_directorId( 0 ),
|
m_directorId( 0 ),
|
||||||
m_radius( 1.f )
|
m_radius( 1.f ),
|
||||||
|
m_effect( 0 )
|
||||||
{
|
{
|
||||||
|
|
||||||
m_lastTickTime = 0;
|
m_lastTickTime = 0;
|
||||||
|
@ -990,6 +991,25 @@ float Sapphire::Entity::Chara::applyShieldProtection( float damage )
|
||||||
return remainingDamage;
|
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()
|
void Sapphire::Entity::Chara::onTick()
|
||||||
{
|
{
|
||||||
uint32_t thisTickDmg = 0;
|
uint32_t thisTickDmg = 0;
|
||||||
|
|
|
@ -134,6 +134,8 @@ namespace Sapphire::Entity
|
||||||
/*! Detour Crowd actor scale */
|
/*! Detour Crowd actor scale */
|
||||||
float m_radius;
|
float m_radius;
|
||||||
|
|
||||||
|
uint32_t m_effect;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Chara( Common::ObjKind type );
|
Chara( Common::ObjKind type );
|
||||||
|
|
||||||
|
@ -290,6 +292,10 @@ namespace Sapphire::Entity
|
||||||
|
|
||||||
float applyShieldProtection( float damage );
|
float applyShieldProtection( float damage );
|
||||||
|
|
||||||
|
uint32_t getVisualEffect();
|
||||||
|
void setVisualEffect( uint32_t effect, bool sendPacket = true );
|
||||||
|
void sendVisualEffect();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,8 +83,7 @@ Sapphire::Entity::Player::Player() :
|
||||||
m_directorInitialized( false ),
|
m_directorInitialized( false ),
|
||||||
m_onEnterEventDone( false ),
|
m_onEnterEventDone( false ),
|
||||||
m_falling( false ),
|
m_falling( false ),
|
||||||
m_pQueuedAction( nullptr ),
|
m_pQueuedAction( nullptr )
|
||||||
m_effect( 0 )
|
|
||||||
{
|
{
|
||||||
m_id = 0;
|
m_id = 0;
|
||||||
m_currentStance = Stance::Passive;
|
m_currentStance = Stance::Passive;
|
||||||
|
@ -2546,25 +2545,6 @@ void Sapphire::Entity::Player::gaugeSetRaw( uint8_t* pData )
|
||||||
sendActorGauge();
|
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 )
|
void Sapphire::Entity::Player::gaugeWarSetIb( uint8_t value )
|
||||||
{
|
{
|
||||||
assert( value >= 0 && value <= 100 );
|
assert( value >= 0 && value <= 100 );
|
||||||
|
|
|
@ -990,10 +990,6 @@ namespace Sapphire::Entity
|
||||||
void sendActorGauge();
|
void sendActorGauge();
|
||||||
void gaugeSetRaw( uint8_t* pData );
|
void gaugeSetRaw( uint8_t* pData );
|
||||||
|
|
||||||
uint32_t getVisualEffect();
|
|
||||||
void setVisualEffect( uint32_t effect, bool sendPacket = true );
|
|
||||||
void sendVisualEffect();
|
|
||||||
|
|
||||||
void gaugeWarSetIb( uint8_t value );
|
void gaugeWarSetIb( uint8_t value );
|
||||||
uint8_t gaugeWarGetIb();
|
uint8_t gaugeWarGetIb();
|
||||||
|
|
||||||
|
@ -1221,8 +1217,6 @@ namespace Sapphire::Entity
|
||||||
|
|
||||||
std::array< Common::HuntingLogEntry, 12 > m_huntingLogEntries;
|
std::array< Common::HuntingLogEntry, 12 > m_huntingLogEntries;
|
||||||
std::unordered_map< uint32_t, std::vector< ShopBuyBackEntry > > m_shopBuyBackMap;
|
std::unordered_map< uint32_t, std::vector< ShopBuyBackEntry > > m_shopBuyBackMap;
|
||||||
|
|
||||||
uint32_t m_effect;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,6 +375,14 @@ void Sapphire::World::Manager::DebugCommandMgr::set( char* data, Entity::Player&
|
||||||
{
|
{
|
||||||
int32_t id;
|
int32_t id;
|
||||||
sscanf( params.c_str(), "%d", &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 );
|
player.setVisualEffect( id );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue