mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-10 09:22:49 +00:00
@@ -16,27 +16,19 @@
|
||||
*/
|
||||
package com.l2jserver;
|
||||
|
||||
import com.google.inject.Injector;
|
||||
import com.l2jserver.model.id.object.provider.NPCIDProvider;
|
||||
import com.l2jserver.model.id.template.NPCTemplateID;
|
||||
import com.l2jserver.model.id.template.provider.NPCTemplateIDProvider;
|
||||
import com.l2jserver.model.world.NPC;
|
||||
import com.l2jserver.service.ServiceManager;
|
||||
import com.l2jserver.service.cache.CacheService;
|
||||
import com.l2jserver.service.configuration.ConfigurationService;
|
||||
import com.l2jserver.service.database.DatabaseService;
|
||||
import com.l2jserver.service.game.character.CharacterService;
|
||||
import com.l2jserver.service.game.chat.ChatService;
|
||||
import com.l2jserver.service.game.npc.NPCService;
|
||||
import com.l2jserver.service.game.pathing.PathingService;
|
||||
import com.l2jserver.service.game.scripting.ScriptingService;
|
||||
import com.l2jserver.service.game.spawn.AlreadySpawnedServiceException;
|
||||
import com.l2jserver.service.game.spawn.SpawnPointNotFoundServiceException;
|
||||
import com.l2jserver.service.game.spawn.SpawnService;
|
||||
import com.l2jserver.service.game.template.TemplateService;
|
||||
import com.l2jserver.service.game.world.WorldIDService;
|
||||
import com.l2jserver.service.network.NetworkService;
|
||||
import com.l2jserver.service.network.keygen.BlowfishKeygenService;
|
||||
import com.l2jserver.util.dimensional.Point;
|
||||
|
||||
public class L2JGameServerMain {
|
||||
/**
|
||||
@@ -65,7 +57,10 @@ public class L2JGameServerMain {
|
||||
serviceManager.start(BlowfishKeygenService.class);
|
||||
serviceManager.start(NetworkService.class);
|
||||
|
||||
staticSpawn(server.getInjector());
|
||||
// spawn
|
||||
serviceManager.get(NPCService.class).spawnAll();
|
||||
|
||||
// staticSpawn(server.getInjector());
|
||||
} catch (Exception e) {
|
||||
System.out.println("GameServer could not be started!");
|
||||
e.printStackTrace();
|
||||
@@ -74,44 +69,44 @@ public class L2JGameServerMain {
|
||||
|
||||
// Thread.sleep(60 * 60 * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method does an static spawn for an object
|
||||
*
|
||||
* @throws AlreadySpawnedServiceException
|
||||
* @throws SpawnPointNotFoundServiceException
|
||||
*/
|
||||
private static void staticSpawn(Injector injector)
|
||||
throws SpawnPointNotFoundServiceException,
|
||||
AlreadySpawnedServiceException {
|
||||
final NPCTemplateIDProvider templateProvider = injector
|
||||
.getInstance(NPCTemplateIDProvider.class);
|
||||
final NPCIDProvider provider = injector
|
||||
.getInstance(NPCIDProvider.class);
|
||||
final SpawnService spawnService = injector
|
||||
.getInstance(SpawnService.class);
|
||||
|
||||
final NPCTemplateID id = templateProvider.createID(12077);
|
||||
final NPC npc = id.getTemplate().create();
|
||||
|
||||
npc.setID(provider.createID());
|
||||
// close to char spawn
|
||||
npc.setPoint(Point.fromXYZ(-71301, 258259, -3134));
|
||||
|
||||
spawnService.spawn(npc, null);
|
||||
|
||||
// close spawn gatekepper
|
||||
final NPCTemplateID gid = templateProvider.createID(30006);
|
||||
final NPC gatekeeper = gid.getTemplate().create();
|
||||
gatekeeper.setID(provider.createID());
|
||||
gatekeeper.setPoint(Point.fromXYZ(-71301, 258559, -3134));
|
||||
spawnService.spawn(gatekeeper, null);
|
||||
|
||||
// spawn tamil - orc village
|
||||
final NPCTemplateID tamilId = templateProvider.createID(30576);
|
||||
final NPC tamil = tamilId.getTemplate().create();
|
||||
tamil.setID(provider.createID());
|
||||
tamil.setPoint(Point.fromXYZ(-45264, -112512, -240));
|
||||
spawnService.spawn(tamil, null);
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * This method does an static spawn for an object
|
||||
// *
|
||||
// * @throws AlreadySpawnedServiceException
|
||||
// * @throws SpawnPointNotFoundServiceException
|
||||
// */
|
||||
// private static void staticSpawn(Injector injector)
|
||||
// throws SpawnPointNotFoundServiceException,
|
||||
// AlreadySpawnedServiceException {
|
||||
// final NPCTemplateIDProvider templateProvider = injector
|
||||
// .getInstance(NPCTemplateIDProvider.class);
|
||||
// final NPCIDProvider provider = injector
|
||||
// .getInstance(NPCIDProvider.class);
|
||||
// final SpawnService spawnService = injector
|
||||
// .getInstance(SpawnService.class);
|
||||
//
|
||||
// final NPCTemplateID id = templateProvider.createID(12077);
|
||||
// final NPC npc = id.getTemplate().create();
|
||||
//
|
||||
// npc.setID(provider.createID());
|
||||
// // close to char spawn
|
||||
// npc.setPoint(Point.fromXYZ(-71301, 258259, -3134));
|
||||
//
|
||||
// spawnService.spawn(npc, null);
|
||||
//
|
||||
// // close spawn gatekepper
|
||||
// final NPCTemplateID gid = templateProvider.createID(30006);
|
||||
// final NPC gatekeeper = gid.getTemplate().create();
|
||||
// gatekeeper.setID(provider.createID());
|
||||
// gatekeeper.setPoint(Point.fromXYZ(-71301, 258559, -3134));
|
||||
// spawnService.spawn(gatekeeper, null);
|
||||
//
|
||||
// // spawn tamil - orc village
|
||||
// final NPCTemplateID tamilId = templateProvider.createID(30576);
|
||||
// final NPC tamil = tamilId.getTemplate().create();
|
||||
// tamil.setID(provider.createID());
|
||||
// tamil.setPoint(Point.fromXYZ(-45264, -112512, -240));
|
||||
// spawnService.spawn(tamil, null);
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user