mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-02 03:15:52 -04:00
Added Lair template overloads and Boss spawns for lairs
- Content devs can now add lairCRC vectors and bosses - The boss spawns will only work after the invasion commit because then lairs will get health bars and the lair will spawn more waves
This commit is contained in:
@@ -436,7 +436,15 @@ public class SpawnService {
|
||||
LairTemplate lairTemplate = lairTemplates.get(lairSpawnTemplate);
|
||||
if(lairTemplate == null)
|
||||
return null;
|
||||
TangibleObject lairObject = (TangibleObject) core.objectService.createObject(lairTemplate.getLairCRC(), 0, planet, position, new Quaternion(1, 0, 0, 0));
|
||||
|
||||
TangibleObject lairObject = null;
|
||||
if (lairTemplate.getLairCRC()==null){
|
||||
String lairCRC = lairTemplate.getLairCRCs().get(new Random().nextInt(lairTemplate.getLairCRCs().size()));
|
||||
System.out.println("Lair CRC " + lairCRC);
|
||||
lairObject = (TangibleObject) core.objectService.createObject(lairCRC, 0, planet, position, new Quaternion(1, 0, 0, 0));
|
||||
} else {
|
||||
lairObject = (TangibleObject) core.objectService.createObject(lairTemplate.getLairCRC().trim(), 0, planet, position, new Quaternion(1, 0, 0, 0));
|
||||
}
|
||||
|
||||
if(lairObject == null)
|
||||
return null;
|
||||
@@ -452,6 +460,9 @@ public class SpawnService {
|
||||
|
||||
lairObject.setAttachment("AI", lairActor);
|
||||
|
||||
if (lairTemplate.getBossTemplate()!=null)
|
||||
lairActor.setBossTemplate(lairTemplate.getBossTemplate());
|
||||
|
||||
core.simulationService.add(lairObject, position.x, position.z, true);
|
||||
lairActor.spawnNewCreatures();
|
||||
|
||||
@@ -506,6 +517,18 @@ public class SpawnService {
|
||||
lairTemplates.put(name, new LairTemplate(name, mobiles, mobileLimit, lairCRC));
|
||||
}
|
||||
|
||||
public void addLairTemplate(String name, Vector<String> mobiles, int mobileLimit, Vector<String> lairCRCs) {
|
||||
lairTemplates.put(name, new LairTemplate(name, mobiles, mobileLimit, lairCRCs));
|
||||
}
|
||||
|
||||
public void addLairTemplate(String name, Vector<String> mobiles, int mobileLimit, Vector<String> lairCRCs, String bossTemplate) {
|
||||
lairTemplates.put(name, new LairTemplate(name, mobiles, mobileLimit, lairCRCs));
|
||||
}
|
||||
|
||||
public void addLairTemplate(String name, String mobile, int mobileLimit, Vector<String> lairCRCs, String bossTemplate) {
|
||||
lairTemplates.put(name, new LairTemplate(name, mobile, mobileLimit, lairCRCs));
|
||||
}
|
||||
|
||||
public void loadLairGroups() {
|
||||
Path p = Paths.get("scripts/mobiles/lairgroups");
|
||||
FileVisitor<Path> fv = new SimpleFileVisitor<Path>() {
|
||||
|
||||
Reference in New Issue
Block a user