1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

It is now possible to deaggro striking dummies properly...

This commit is contained in:
Mordred 2021-12-31 16:20:11 +01:00
parent 514c507dcf
commit 4b74b8bfc8
2 changed files with 17 additions and 12 deletions

View file

@ -161,6 +161,10 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
calculateStats();
if( m_bnpcType == BNpcType::Friendly )
m_maxHp *= 5;
max_hp = m_maxHp;
}
@ -667,7 +671,7 @@ void Sapphire::Entity::BNpc::update( uint64_t tickCount )
auto distance = Util::distance( getPos().x, getPos().y, getPos().z,
pHatedActor->getPos().x, pHatedActor->getPos().y, pHatedActor->getPos().z );
if( !hasFlag( NoDeaggro ) && ( distanceOrig > maxDistanceToOrigin ) )
if( !hasFlag( NoDeaggro ) && ( ( distanceOrig > maxDistanceToOrigin ) || distance > 30.0f ) )
{
hateListClear();
changeTarget( INVALID_GAME_OBJECT_ID64 );

View file

@ -40,17 +40,18 @@ namespace Sapphire::Entity
};
const std::array< uint32_t, 50 > BnpcBaseHp =
{ 44,51, 59, 68, 91,
108, 126, 143, 160, 192,
217, 243, 268, 293, 319,
344, 369, 394, 420, 413,
458, 493, 532, 568, 594,
641, 677,714, 750, 780,
887, 965, 1055, 1142, 1220,
1306, 1409, 1515, 1587, 1601,
1703, 1789, 1872, 2008, 2112,
2180, 2314, 2383, 2501, 2589
};
{
44,51, 59, 68, 91,
108, 126, 143, 160, 192,
217, 243, 268, 293, 319,
344, 369, 394, 420, 413,
458, 493, 532, 568, 594,
641, 677,714, 750, 780,
887, 965, 1055, 1142, 1220,
1306, 1409, 1515, 1587, 1601,
1703, 1789, 1872, 2008, 2112,
2180, 2314, 2383, 2501, 2589
};
/*!
\class BNpc