warc222

/unstuck effect to .pvp and .farm voiced commands

Dec 25th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. Index: head-src/com/l2jfrozen/gameserver/handler.voicedcommandhandlers/FarmPvpCmd.java
  2. ===================================================================
  3. --- head-src/com/l2jfrozen/gameserver/handler.voicedcommandhandlers/FarmPvpCmd.java (revision 774)
  4. +++ head-src/com/l2jfrozen/gameserver/handler.voicedcommandhandlers/FarmPvpCmd.java (working copy)
  5. @@ -23,1 +30,1 @@
  6. import com.l2jfrozen.Config;
  7. +import com.l2jfrozen.gameserver.GameTimeController;
  8. +import com.l2jfrozen.gameserver.ai.CtrlIntention;
  9. import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
  10. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  11. +import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser;
  12. import com.l2jfrozen.gameserver.network.serverpackets.SetupGauge;
  13. import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  14. +import com.l2jfrozen.gameserver.util.Broadcast;
  15. @@ -114,9 +121,21 @@
  16. - SetupGauge sg = new SetupGauge(SetupGauge.BLUE, 15000);
  17. - activeChar.sendPacket(sg);
  18. - sg = null;
  19. - activeChar.setIsImobilised(true);
  20. -
  21. - ThreadPoolManager.getInstance().scheduleGeneral(new teleportTask(activeChar, placex, placey, placez, message), 15000);
  22. -
  23. - return true;
  24. + int teleportTimer = activeChar.getAccessLevel().isGm() ? 1000 : Config.UNSTUCK_INTERVAL * 1000;
  25. +
  26. + activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
  27. +
  28. + //SoE Animation section
  29. + activeChar.setTarget(activeChar);
  30. + activeChar.disableAllSkills();
  31. +
  32. + MagicSkillUser msk = new MagicSkillUser(activeChar, 1050, 1, teleportTimer, 0);
  33. + Broadcast.toSelfAndKnownPlayersInRadius(activeChar, msk, 810000/*900*/);
  34. + SetupGauge sg = new SetupGauge(0, teleportTimer);
  35. + activeChar.sendPacket(sg);
  36. + msk = null;
  37. + sg = null;
  38. + //End SoE Animation section
  39. +
  40. + EscapeFinalizer ef = new EscapeFinalizer(activeChar, placex, placey, placez, message);
  41. + // continue execution later
  42. + activeChar.setSkillCast(ThreadPoolManager.getInstance().scheduleGeneral(ef, teleportTimer));
  43. + activeChar.setSkillCastEndTime(10 + GameTimeController.getGameTicks() + teleportTimer / GameTimeController.MILLIS_IN_TICK);
  44. + ef = null;
  45. +
  46. + return true;
  47. }
  48. @@ -145,5 +145,43 @@
  49. - class teleportTask implements Runnable
  50. + static class EscapeFinalizer implements Runnable
  51. @@ -153,9 +153,83 @@
  52. - teleportTask(L2PcInstance activeChar, int x, int y, int z, String message)
  53. + EscapeFinalizer(L2PcInstance activeChar, int x, int y, int z, String message)
  54. @@ -166,17 +168,13 @@
  55. if(_activeChar == null)
  56. - return;
  57. -
  58. + return;
  59. +
  60. + if(_activeChar.isDead())
  61. + return;
  62. +
  63. + _activeChar.enableAllSkills();
  64. + _activeChar.sendMessage(_message);
  65. - _activeChar.sendMessage(_message);
  66. - _activeChar.setIsImobilised(false);
  67. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment