|
|
@ -675,8 +675,7 @@ static float randomAngle()
|
|
|
|
return val;
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, double dispersionRadius, bool spawnBots, double orientation, const std::string &botsName, const std::string &look)
|
|
|
|
CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const& sheetId, CAIVector const& pos, double dispersionRadius, bool spawnBots, double orientation, const std::string &botsName, const std::string &look, sint32 cell) {
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!_EventNpcManager)
|
|
|
|
if (!_EventNpcManager)
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
|
@ -772,6 +771,8 @@ CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const&
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spawnGroup->setCell(cell);
|
|
|
|
|
|
|
|
|
|
|
|
NLMISC::CSmartPtr<CNpcZonePlaceNoPrim> destZone = NLMISC::CSmartPtr<CNpcZonePlaceNoPrim>(new CNpcZonePlaceNoPrim());
|
|
|
|
NLMISC::CSmartPtr<CNpcZonePlaceNoPrim> destZone = NLMISC::CSmartPtr<CNpcZonePlaceNoPrim>(new CNpcZonePlaceNoPrim());
|
|
|
|
destZone->setPosAndRadius(AITYPES::vp_auto, CAIPos(pos, 0, 0), (uint32)(dispersionRadius*1000.));
|
|
|
|
destZone->setPosAndRadius(AITYPES::vp_auto, CAIPos(pos, 0, 0), (uint32)(dispersionRadius*1000.));
|
|
|
|
spawnGroup->movingProfile().setAIProfile(new CGrpProfileWanderNoPrim(spawnGroup, destZone));
|
|
|
|
spawnGroup->movingProfile().setAIProfile(new CGrpProfileWanderNoPrim(spawnGroup, destZone));
|
|
|
@ -941,7 +942,7 @@ void cbEventCreateNpcGroup( NLNET::CMessage& msgin, const std::string &serviceNa
|
|
|
|
CAIInstance* instance = CAIS::instance().getAIInstance(instanceNumber);
|
|
|
|
CAIInstance* instance = CAIS::instance().getAIInstance(instanceNumber);
|
|
|
|
if (instance)
|
|
|
|
if (instance)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CGroupNpc* npcGroup = instance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(((double)x)/1000.0, ((double)y)/1000.0), dispersionRadius, spawnBots, ((double)orientation)/1000.0, botsName, look);
|
|
|
|
CGroupNpc* npcGroup = instance->eventCreateNpcGroup(nbBots, sheetId, CAIVector(((double)x)/1000.0, ((double)y)/1000.0), dispersionRadius, spawnBots, ((double)orientation)/1000.0, botsName, look, cell);
|
|
|
|
if (npcGroup != NULL)
|
|
|
|
if (npcGroup != NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_PlayersLastCreatedNpcGroup[playerId] = npcGroup->getName();
|
|
|
|
_PlayersLastCreatedNpcGroup[playerId] = npcGroup->getName();
|
|
|
|