void MissionObjectiveImplementation::complete() { Locker _lock(_this.get()); ManagedReference<CreatureObject*> player = getPlayerOwner(); if (player == NULL) return; _lock.release(); Reference<CompleteMissionObjectiveTask*> task = new CompleteMissionObjectiveTask(_this.get()); task->execute(); if (player->isGrouped() && player->getGroup() != NULL) { GroupObject* group = player->getGroup(); Locker locker(group); group->scheduleUpdateNearestMissionForGroup(player->getPlanetCRC()); } /*awardReward(); awardFactionPoints(); removeMissionFromPlayer();*/ }
void MissionObjectImplementation::updateMissionLocation() { if (getMissionObjective() == NULL || getMissionObjective()->getPlayerOwner() == NULL) { return; } CreatureObject* playerCreature = getMissionObjective()->getPlayerOwner().castTo<CreatureObject*>(); ManagedReference<WaypointObject* > waypointToMission = this->waypointToMission; if (playerCreature != NULL && waypointToMission != NULL) { MissionObjectDeltaMessage3* dmiso3 = new MissionObjectDeltaMessage3(_this.get()); dmiso3->updateWaypoint(waypointToMission); dmiso3->close(); playerCreature->sendMessage(dmiso3); if (playerCreature->isGrouped() && playerCreature->getGroup() != NULL) { GroupObject* group = playerCreature->getGroup(); group->scheduleUpdateNearestMissionForGroup(playerCreature->getPlanetCRC()); } } }