Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String onEnterZone(final L2Character character, final L2ZoneType zone)
- {
- if (character instanceof L2PcInstance && !(character instanceof L2Npc))
- {
- L2PcInstance player = (L2PcInstance) character;
- if (debug)
- {
- _log.info("EnterZone");
- InstanceWorld temp = InstanceManager.getInstance().getPlayerWorld(player);
- if ( temp != null && temp.templateId == 6)
- {
- _log.info("yes template is 6");
- if (temp.status == 20 )
- {
- BelethWorld world = new BelethWorld();
- InstanceManager.getInstance().addWorld(world);
- world.allowed.clear();
- world.instanceId = player.getInstanceId();
- world.allowed.add(player.getObjectId());
- world.belethPlayers.add(player);
- startSpawnTask(world.belethPlayers, world.instanceId);
- _log.info("Beleth is under Attack : CCL is: " + player.getName());
- }
- }
- --------------------------------------------------
- public void startSpawnTask(ArrayList<L2PcInstance> players, int instanceId)
- {
- if(debug)
- _log.info("starting Spawn Task after 10 secs");
- ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(1, players, instanceId), debug ? 10000 : 300000);
- }
- ---------------------------------------------------
- private class Spawn implements Runnable
- {
- private int _taskId = 0;
- private ArrayList<L2PcInstance> players = new ArrayList<L2PcInstance>();
- private int instanceId = 0;
- private void play(ArrayList<L2PcInstance> players, L2GameServerPacket packet)
- {
- if (players.isEmpty())
- return;
- {
- for (L2PcInstance plr : players)
- {
- if (plr.isOnline() > 0 && plr.getInstanceId() == instanceId)
- {
- plr.sendPacket(packet);
- }
- else
- {
- continue;
- }
- }
- }
- }
- public Spawn(int taskId, ArrayList<L2PcInstance> players, int instanceId)
- {
- this.players = players;
- this.instanceId = instanceId;
- _taskId = taskId;
- }
- public void run()
- {
- BelethWorld world = (BelethWorld) InstanceManager.getInstance().getWorld(this.instanceId);
- try
- {
- switch (_taskId)
- {
- case 1:
- if(debug)
- _log.info("starting Spawn Case 1");
- world.movie = true;
- for (L2Character npc : _zone.getCharactersInside().values())
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement