mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-28 23:15:53 -04:00
Added xp gain on killing NPCs, fixed some bugs, added 2 new config options
This commit is contained in:
@@ -78,6 +78,8 @@ import engine.clientdata.visitors.WorldSnapshotVisitor.SnapshotChunk;
|
||||
import engine.clients.Client;
|
||||
import engine.resources.common.CRC;
|
||||
import engine.resources.container.Traverser;
|
||||
import engine.resources.container.WorldCellPermissions;
|
||||
import engine.resources.container.WorldPermissions;
|
||||
import engine.resources.database.DatabaseConnection;
|
||||
import engine.resources.objects.SWGObject;
|
||||
import engine.resources.scene.Planet;
|
||||
@@ -415,9 +417,15 @@ public class ObjectService implements INetworkDispatch {
|
||||
}
|
||||
});
|
||||
objectList.remove(object.getObjectID());
|
||||
if(object.getContainer() != null) {
|
||||
SWGObject parent = object.getContainer();
|
||||
|
||||
if(parent != null) {
|
||||
if(parent instanceof CreatureObject) {
|
||||
((CreatureObject) parent).removeObjectFromEquipList(object);
|
||||
((CreatureObject) parent).removeObjectFromAppearanceEquipList(object);
|
||||
}
|
||||
long parentId = object.getParentId();
|
||||
object.getContainer()._remove(object);
|
||||
parent.remove(object);
|
||||
object.setParentId(parentId);
|
||||
} else {
|
||||
core.simulationService.remove(object, object.getWorldPosition().x, object.getWorldPosition().z, true);
|
||||
@@ -696,10 +704,12 @@ public class ObjectService implements INetworkDispatch {
|
||||
int objectId = chunk.id;
|
||||
SWGObject obj = createObject(visitor.getName(chunk.nameId), objectId, planet, new Point3D(chunk.xPosition, chunk.yPosition, chunk.zPosition), new Quaternion(chunk.orientationW, chunk.orientationX, chunk.orientationY, chunk.orientationZ));
|
||||
if(obj != null) {
|
||||
obj.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
|
||||
obj.setisInSnapshot(true);
|
||||
obj.setParentId(chunk.parentId);
|
||||
if(obj instanceof CellObject) {
|
||||
((CellObject) obj).setCellNumber(chunk.cellNumber);
|
||||
obj.setContainerPermissions(WorldCellPermissions.WORLD_CELL_PERMISSIONS);
|
||||
}
|
||||
}
|
||||
//System.out.print("\rLoading Object [" + counter + "/" + visitor.getChunks().size() + "] : " + visitor.getName(chunk.nameId));
|
||||
@@ -744,7 +754,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
}
|
||||
|
||||
SWGObject child = createObject(template, 0, parent.getPlanet(), position, orientation);
|
||||
|
||||
child.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
|
||||
if(parent.getAttachment("childObjects") == null)
|
||||
parent.setAttachment("childObjects", new Vector<SWGObject>());
|
||||
|
||||
@@ -890,17 +900,21 @@ public class ObjectService implements INetworkDispatch {
|
||||
}
|
||||
if(object == null)
|
||||
continue;
|
||||
object.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
|
||||
if(radius > 256)
|
||||
object.setAttachment("bigSpawnRange", new Boolean(true));
|
||||
quadtreeObjects.add(object);
|
||||
} else if(containerId != 0) {
|
||||
object = createObject(template, 0, planet, new Point3D(px, py, pz), new Quaternion(qw, qx, qy, qz));
|
||||
object = createObject(template, 0, planet, new Point3D(px, py, pz), new Quaternion(qw, qx, qy, qz));
|
||||
if(containers.contains(containerId)) {
|
||||
object.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
|
||||
object.setisInSnapshot(false);
|
||||
containers.add(objectId);
|
||||
}
|
||||
if(object instanceof CellObject && cellIndex != 0)
|
||||
if(object instanceof CellObject && cellIndex != 0) {
|
||||
object.setContainerPermissions(WorldCellPermissions.WORLD_CELL_PERMISSIONS);
|
||||
((CellObject) object).setCellNumber(cellIndex);
|
||||
}
|
||||
SWGObject parent = getObject(containerId);
|
||||
|
||||
if(parent != null && object != null) {
|
||||
@@ -910,6 +924,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
}
|
||||
} else {
|
||||
object = createObject(template, 0, planet, new Point3D(px + x1, py, pz + z1), new Quaternion(qw, qx, qy, qz));
|
||||
object.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
|
||||
quadtreeObjects.add(object);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user