1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 07:37:45 +00:00

minor cleanup;

This commit is contained in:
Alice Ogeda 2022-02-16 15:11:10 -03:00
parent dad8813239
commit 3b49cade1d
3 changed files with 64 additions and 63 deletions

View file

@ -1499,9 +1499,8 @@ namespace Sapphire::Common
using PlayerStateFlagList = std::vector< PlayerStateFlag >; using PlayerStateFlagList = std::vector< PlayerStateFlag >;
struct BNPCInstanceObject
struct BNPCInstanceObject {
{
uint16_t territoryType; uint16_t territoryType;
std::string bnpcName; std::string bnpcName;
uint32_t instanceId; uint32_t instanceId;
@ -1548,15 +1547,15 @@ struct BNPCInstanceObject
uint32_t ServerPathId; uint32_t ServerPathId;
uint32_t EquipmentID; uint32_t EquipmentID;
uint32_t CustomizeID; uint32_t CustomizeID;
}; };
/* /*
* CellId is used to identify a cell in the cell container of a zone * CellId is used to identify a cell in the cell container of a zone
*/ */
struct CellId struct CellId
{ {
uint32_t x{ 0 }; uint32_t x{ 0 };
uint32_t y{ 0 }; uint32_t y{ 0 };
}; };
} }

View file

@ -731,6 +731,7 @@ void Sapphire::Entity::BNpc::update( uint64_t tickCount )
} }
checkAggro(); checkAggro();
break;
} }
case BNpcState::Combat: case BNpcState::Combat:
@ -796,6 +797,7 @@ void Sapphire::Entity::BNpc::update( uint64_t tickCount )
pNaviProvider->updateAgentParameters( *this ); pNaviProvider->updateAgentParameters( *this );
} }
} }
break;
} }
@ -832,20 +834,21 @@ void Sapphire::Entity::BNpc::onDeath()
{ {
auto& server = Common::Service< World::WorldServer >::ref(); auto& server = Common::Service< World::WorldServer >::ref();
auto& playerMgr = Common::Service< World::Manager::PlayerMgr >::ref(); auto& playerMgr = Common::Service< World::Manager::PlayerMgr >::ref();
auto& taskMgr = Common::Service< World::Manager::TaskMgr >::ref();
setTargetId( INVALID_GAME_OBJECT_ID64 ); setTargetId( INVALID_GAME_OBJECT_ID64 );
m_currentStance = Stance::Passive; m_currentStance = Stance::Passive;
m_state = BNpcState::Dead; m_state = BNpcState::Dead;
m_timeOfDeath = Util::getTimeSeconds(); m_timeOfDeath = Util::getTimeSeconds();
setOwner( nullptr ); setOwner( nullptr );
auto& taskMgr = Common::Service< World::Manager::TaskMgr >::ref();
taskMgr.queueTask( World::makeFadeBNpcTask( 10000, getAsBNpc() ) ); taskMgr.queueTask( World::makeFadeBNpcTask( 10000, getAsBNpc() ) );
taskMgr.queueTask( World::makeRemoveBNpcTask( 12000, getAsBNpc() ) ); taskMgr.queueTask( World::makeRemoveBNpcTask( 12000, getAsBNpc() ) );
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto paramGrowthInfo = exdData.getRow< Excel::ParamGrow >( m_level ); auto paramGrowthInfo = exdData.getRow< Excel::ParamGrow >( m_level );
for( auto& pHateEntry : m_hateList ) for( const auto& pHateEntry : m_hateList )
{ {
// TODO: handle drops // TODO: handle drops
auto pPlayer = pHateEntry->m_pChara->getAsPlayer(); auto pPlayer = pHateEntry->m_pChara->getAsPlayer();
@ -855,6 +858,7 @@ void Sapphire::Entity::BNpc::onDeath()
pPlayer->gainExp( paramGrowthInfo->data().BaseExp ); pPlayer->gainExp( paramGrowthInfo->data().BaseExp );
} }
} }
hateListClear(); hateListClear();
} }

View file

@ -54,6 +54,7 @@ using namespace Sapphire::World::Manager;
Territory::Territory() : Territory::Territory() :
m_territoryTypeId( 0 ), m_territoryTypeId( 0 ),
m_ident(),
m_guId( 0 ), m_guId( 0 ),
m_currentWeather( Common::Weather::FairSkies ), m_currentWeather( Common::Weather::FairSkies ),
m_weatherOverride( Common::Weather::None ), m_weatherOverride( Common::Weather::None ),
@ -908,7 +909,6 @@ bool Territory::loadBNpcs()
while( res->next() ) while( res->next() )
{ {
auto bnpc = std::make_shared< Common::BNPCInstanceObject >(); auto bnpc = std::make_shared< Common::BNPCInstanceObject >();
bnpc->territoryType = res->getInt( 1 ); bnpc->territoryType = res->getInt( 1 );
@ -970,8 +970,6 @@ bool Territory::loadBNpcs()
m_spawnInfo.emplace_back( info ); m_spawnInfo.emplace_back( info );
} }
} }
return true; return true;
} }