本文整理汇总了C++中ZoneServer::getMissionManager方法的典型用法代码示例。如果您正苦于以下问题:C++ ZoneServer::getMissionManager方法的具体用法?C++ ZoneServer::getMissionManager怎么用?C++ ZoneServer::getMissionManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZoneServer
的用法示例。
在下文中一共展示了ZoneServer::getMissionManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: despawnNpcs
void DeliverMissionObjectiveImplementation::despawnNpcs() {
ZoneServer* zoneServer = ServerCore::getZoneServer();
MissionManager* missionManager = zoneServer->getMissionManager();
if (targetSpawnPoint != NULL)
missionManager->freeMissionNpc(targetSpawnPoint);
if (destinationSpawnPoint != NULL)
missionManager->freeMissionNpc(destinationSpawnPoint);
}
示例2: removeMissionFromPlayer
void MissionObjectiveImplementation::removeMissionFromPlayer() {
ManagedReference<CreatureObject*> player = getPlayerOwner();
ManagedReference<MissionObject* > mission = this->mission.get();
if (player != NULL) {
ZoneServer* zoneServer = player->getZoneServer();
MissionManager* missionManager = zoneServer->getMissionManager();
missionManager->removeMission(mission, player);
}
}
示例3: activateWithResult
bool DeliverMissionObjectiveImplementation::activateWithResult() {
ManagedReference<CreatureObject*> owner = getPlayerOwner();
ManagedReference<MissionObject* > mission = this->mission.get();
if (owner == NULL || mission == NULL) {
return false;
}
Zone* zone = owner->getZone();
if (zone == NULL) {
return false;
}
CreatureManager* creatureManager = zone->getCreatureManager();
PlanetManager* planetManager = zone->getPlanetManager();
if (planetManager == NULL) {
return false;
}
TerrainManager* terrainManager = planetManager->getTerrainManager();
if (terrainManager == NULL) {
return false;
}
ZoneServer* zoneServer = owner->getZoneServer();
if (zoneServer == NULL) {
return false;
}
MissionManager* missionManager = zoneServer->getMissionManager();
if (missionManager == NULL) {
return false;
}
//Select spawn type.
int spawnType = NpcSpawnPoint::NEUTRALSPAWN;
switch (mission->getFaction()) {
case FactionManager::FACTIONIMPERIAL:
spawnType = NpcSpawnPoint::IMPERIALSPAWN;
break;
case FactionManager::FACTIONREBEL:
spawnType = NpcSpawnPoint::REBELSPAWN;
break;
default:
spawnType = NpcSpawnPoint::NEUTRALSPAWN;
break;
}
//Spawn target and destination NPC's.
//Target NPC
//Find a free spawn point.
targetSpawnPoint = missionManager->getFreeNpcSpawnPoint(mission->getStartPlanetCRC(), mission->getStartPositionX(), mission->getStartPositionY(), spawnType);
if (targetSpawnPoint == NULL) {
return false;
}
Vector3* targetPosition = targetSpawnPoint->getPosition();
if (targetPosition == NULL) {
return false;
}
//Destination NPC.
//Find a free spawn point.
int retries = 10;
destinationSpawnPoint = NULL;
while (retries > 0 && (destinationSpawnPoint == NULL || destinationSpawnPoint == targetSpawnPoint)) {
destinationSpawnPoint = missionManager->getFreeNpcSpawnPoint(mission->getEndPlanet().hashCode(), mission->getEndPositionX(), mission->getEndPositionY(), spawnType);
retries--;
}
if (destinationSpawnPoint == NULL || destinationSpawnPoint == targetSpawnPoint) {
return false;
}
missionManager->allocateMissionNpcs(targetSpawnPoint, destinationSpawnPoint, terrainManager, creatureManager);
//Create waypoint and activate it.
if (objectiveStatus == 0) {
WaypointObject* waypoint = mission->getWaypointToMission();
Locker locker(waypoint);
waypoint->setPlanetCRC(mission->getStartPlanetCRC());
waypoint->setPosition(targetPosition->getX(), 0, targetPosition->getY());
waypoint->setActive(true);
mission->updateMissionLocation();
} else {
updateMissionTarget(getPlayerOwner().get());
}
return true;
}