mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-14 04:13:14 -04:00
Refactored delivery missions to use pre-spawned commoners
Scripters should change any commoners being spawned to use core.staticService.spawnCommoner instead of spawnObject (see mos_eisley.py in static_spawns\tatooine for an example). The spawnCommoner method will add required attachments and set the proper options bitmask in order for the missions to function properly. Note that delivery missions won't work unless you have spawned buildouts on the planet you are requesting the missions on due to this change.
This commit is contained in:
@@ -36,6 +36,7 @@ import java.util.Map;
|
||||
import resources.common.FileUtilities;
|
||||
import resources.objects.building.BuildingObject;
|
||||
import resources.objects.cell.CellObject;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
import services.ai.AIActor;
|
||||
import services.spawn.MobileTemplate;
|
||||
import main.NGECore;
|
||||
@@ -214,6 +215,27 @@ public class StaticService implements INetworkDispatch {
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for spawning a commoner that can be used for a variety of mission types, like delivery and crafting missions.
|
||||
*/
|
||||
public CreatureObject spawnCommoner(String template, String planetName, long cellId, float x, float y, float z, float qW, float qX, float qY, float qZ) {
|
||||
CreatureObject commoner = (CreatureObject) spawnObject(template, planetName, cellId, x, y, z, qW, qX, qY, qZ);
|
||||
|
||||
if (commoner == null)
|
||||
return null;
|
||||
|
||||
commoner.setAttachment("conversationFile", "missions/deliver");
|
||||
commoner.setAttachment("radial_filename", "object/conversation");
|
||||
commoner.setOptionsBitmask(264);
|
||||
|
||||
core.missionService.addCommoner(commoner);
|
||||
return commoner;
|
||||
}
|
||||
|
||||
public CreatureObject spawnCommoner(String template, String planetName, long cellId, float x, float y, float z, float qY, float qW) {
|
||||
return spawnCommoner(template, planetName, cellId, x, y, z, qW, 0, qY, 0);
|
||||
}
|
||||
|
||||
public List<SWGObject> getCloningFacilitiesByPlanet(Planet planet) {
|
||||
List<SWGObject> objects = core.simulationService.get(planet, 0, 0, 8300);
|
||||
List<SWGObject> cloners = new ArrayList<SWGObject>();
|
||||
|
||||
Reference in New Issue
Block a user