Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. public String onEnterZone(final L2Character character, final L2ZoneType zone)
  2. {
  3. if (character instanceof L2PcInstance && !(character instanceof L2Npc))
  4. {
  5. L2PcInstance player = (L2PcInstance) character;
  6.  
  7. if (debug)
  8. {
  9. _log.info("EnterZone");
  10. InstanceWorld temp = InstanceManager.getInstance().getPlayerWorld(player);
  11.  
  12. if ( temp != null && temp.templateId == 6)
  13. {
  14. _log.info("yes template is 6");
  15. if (temp.status == 20 )
  16. {
  17. BelethWorld world = new BelethWorld();
  18. InstanceManager.getInstance().addWorld(world);
  19. world.allowed.clear();
  20. world.instanceId = player.getInstanceId();
  21. world.allowed.add(player.getObjectId());
  22. world.belethPlayers.add(player);
  23. startSpawnTask(world.belethPlayers, world.instanceId);
  24. _log.info("Beleth is under Attack : CCL is: " + player.getName());
  25. }
  26. }
  27. --------------------------------------------------
  28. public void startSpawnTask(ArrayList<L2PcInstance> players, int instanceId)
  29. {
  30. if(debug)
  31. _log.info("starting Spawn Task after 10 secs");
  32. ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(1, players, instanceId), debug ? 10000 : 300000);
  33. }
  34. ---------------------------------------------------
  35. private class Spawn implements Runnable
  36. {
  37. private int _taskId = 0;
  38. private ArrayList<L2PcInstance> players = new ArrayList<L2PcInstance>();
  39. private int instanceId = 0;
  40.  
  41. private void play(ArrayList<L2PcInstance> players, L2GameServerPacket packet)
  42. {
  43. if (players.isEmpty())
  44. return;
  45. {
  46. for (L2PcInstance plr : players)
  47. {
  48. if (plr.isOnline() > 0 && plr.getInstanceId() == instanceId)
  49. {
  50. plr.sendPacket(packet);
  51. }
  52. else
  53. {
  54. continue;
  55. }
  56. }
  57. }
  58. }
  59.  
  60. public Spawn(int taskId, ArrayList<L2PcInstance> players, int instanceId)
  61. {
  62. this.players = players;
  63. this.instanceId = instanceId;
  64. _taskId = taskId;
  65.  
  66. }
  67.  
  68. public void run()
  69. {
  70. BelethWorld world = (BelethWorld) InstanceManager.getInstance().getWorld(this.instanceId);
  71.  
  72. try
  73. {
  74. switch (_taskId)
  75. {
  76. case 1:
  77. if(debug)
  78. _log.info("starting Spawn Case 1");
  79. world.movie = true;
  80. for (L2Character npc : _zone.getCharactersInside().values())
  81. {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement