mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
It is now possible to deaggro striking dummies properly...
This commit is contained in:
parent
514c507dcf
commit
4b74b8bfc8
2 changed files with 17 additions and 12 deletions
|
@ -161,6 +161,10 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
|
||||||
|
|
||||||
calculateStats();
|
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,
|
auto distance = Util::distance( getPos().x, getPos().y, getPos().z,
|
||||||
pHatedActor->getPos().x, pHatedActor->getPos().y, pHatedActor->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();
|
hateListClear();
|
||||||
changeTarget( INVALID_GAME_OBJECT_ID64 );
|
changeTarget( INVALID_GAME_OBJECT_ID64 );
|
||||||
|
|
|
@ -40,7 +40,8 @@ namespace Sapphire::Entity
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::array< uint32_t, 50 > BnpcBaseHp =
|
const std::array< uint32_t, 50 > BnpcBaseHp =
|
||||||
{ 44,51, 59, 68, 91,
|
{
|
||||||
|
44,51, 59, 68, 91,
|
||||||
108, 126, 143, 160, 192,
|
108, 126, 143, 160, 192,
|
||||||
217, 243, 268, 293, 319,
|
217, 243, 268, 293, 319,
|
||||||
344, 369, 394, 420, 413,
|
344, 369, 394, 420, 413,
|
||||||
|
|
Loading…
Add table
Reference in a new issue