StaticService can now use mobileTemplates

Just put a mobileTemplate in place of the objectTemplate.
This commit is contained in:
Treeku
2014-05-04 23:22:15 +01:00
parent 966f207d10
commit a5ee3ff2b4
4 changed files with 13 additions and 26 deletions
+6 -2
View File
@@ -70,7 +70,7 @@ public class SpawnService {
}
}
public CreatureObject spawnCreature(String template, String planetName, long cellId, float x, float y, float z, float qW, float qX, float qY, float qZ, short level) {
public CreatureObject spawnCreature(String template, long objectId, String planetName, long cellId, float x, float y, float z, float qW, float qX, float qY, float qZ, short level) {
Planet planet = core.terrainService.getPlanetByName(planetName);
MobileTemplate mobileTemplate = mobileTemplates.get(template);
@@ -85,7 +85,7 @@ public class SpawnService {
return null;
}
CreatureObject creature = (CreatureObject) core.objectService.createObject(mobileTemplate.getTemplates().get(new Random().nextInt(mobileTemplate.getTemplates().size())), 0, planet, new Point3D(x, y, z), new Quaternion(qW, qX, qY, qZ));
CreatureObject creature = (CreatureObject) core.objectService.createObject(mobileTemplate.getTemplates().get(new Random().nextInt(mobileTemplate.getTemplates().size())), objectId, planet, new Point3D(x, y, z), new Quaternion(qW, qX, qY, qZ));
if(creature == null)
return null;
@@ -211,6 +211,10 @@ public class SpawnService {
return creature;
}
public CreatureObject spawnCreature(String template, String planetName, long cellId, float x, float y, float z, float qW, float qX, float qY, float qZ, short level) {
return spawnCreature(template, 0L, planetName, cellId, x, y, z, qW, qX, qY, qZ, level);
}
public CreatureObject spawnCreature(String mobileTemplate, String planetName, long cellId, float x, float y, float z, float qW, float qX, float qY, float qZ, int level) {
return spawnCreature(mobileTemplate, planetName, cellId, x, y, z, 1, 0, 0, 0, (short) level);
}