warc222

voicedolyjoin

Jan 14th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. Index: L2jFrozen_GameServer\head-src\com\l2jfrozen\Config.java
  2. ===================================================================
  3. --- head-src\com\l2jfrozen\Config.java (revision 931)
  4. +++ head-src\com\l2jfrozen\Config.java (working copy)
  5.  
  6. @@ -2385,1 +2385,5 @@
  7. public static String PVP2_CUSTOM_MESSAGE;
  8. + public static boolean OLYMPIAD_JOIN_COMMAND;
  9. +
  10. //============================================================
  11. public static void loadL2JFrozenConfig()
  12.  
  13. @@ -2512,1 +2512,13 @@
  14. PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
  15. + OLYMPIAD_JOIN_COMMAND = Boolean.parseBoolean(L2JFrozenSettings.getProperty("EnableJoinOlympiadCommand", "True"));
  16. (/No newline at the end of the line)
  17.  
  18. Index: L2jFrozen_GameServer\head-src\com\l2jfrozen\gameserver\handler\voicedcommandhandlers\JoinOly.java
  19. ===================================================================
  20. +++ head-src\com\l2jfrozen\gameserver\handler\voicedcommandhandlers\JoinOly.java (working copy)
  21. +package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
  22. +
  23. +import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
  24. +import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
  25. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  26. +
  27. +public class JoinOly implements IVoicedCommandHandler
  28. +{
  29. +
  30. + private static final String[] VOICED_COMMANDS = { "joinoly" , "leaveoly" };
  31. +
  32. +
  33. +public boolean useVoicedCommand(String command, L2PcInstance activeChar,String target)
  34. +{
  35. + if (command.equalsIgnoreCase("joinoly"))
  36. + {
  37. + if (!activeChar.isInOlympiadMode() )
  38. + {
  39. + Olympiad.getInstance().registerNoble(activeChar, true);
  40. + return true;
  41. + }
  42. + else if (!activeChar.isNoble() || activeChar.isDead() || activeChar.isFestivalParticipant() || activeChar.atEvent
  43. + || activeChar.isSubClassActive() || activeChar.isInDuel() || activeChar.isAlikeDead()
  44. + || activeChar.getPvpFlag() > 0 || activeChar.getKarma() > 0 || activeChar.isInCombat() || activeChar.inObserverMode())
  45. + {
  46. + activeChar.sendMessage("Your Status Doesnt Allow You To Join Olympiad!");
  47. + return false;
  48. + }
  49. + }
  50. +
  51. + if (command.equalsIgnoreCase("leaveoly"))
  52. + {
  53. + if (activeChar.isInOlympiadMode())
  54. + {
  55. + Olympiad.getInstance().unRegisterNoble(activeChar);
  56. + return true;
  57. + }
  58. + else if (activeChar.isAlikeDead() || activeChar.isInCombat()
  59. + || activeChar.inObserverMode() || !activeChar.isInOlympiadMode())
  60. + {
  61. + activeChar.sendMessage("You Can't Leave Olympiad while Participating somewhere.");
  62. + return false;
  63. + }
  64. + }
  65. +
  66. +
  67. + return true;
  68. +}
  69. +
  70. + public String[] getVoicedCommandList()
  71. + {
  72. + return VOICED_COMMANDS;
  73. + }
  74. +}
  75. +
  76. (/No newline at the end of the line)
  77.  
  78. Index: L2jFrozen_GameServer\head-src\com\l2jfrozen\gameserver\handler\VoicedCommandHandler.java
  79. ===================================================================
  80. --- head-src\com\l2jfrozen\gameserver\handler\VoicedCommandHandler.java (revision 570)
  81. +++ head-src\com\l2jfrozen\gameserver\handler\VoicedCommandHandler.java (working copy)
  82.  
  83. @@ -75,1 +75,9 @@
  84. if(Config.BANKING_SYSTEM_ENABLED)
  85. {
  86. registerVoicedCommandHandler(new BankingCmd());
  87. }
  88. +
  89. + if(Config.OLYMPIAD_JOIN_COMMAND)
  90. + {
  91. + registerVoicedCommandHandler(new JoinOly());
  92. + }
  93. if(Config.CTF_COMMAND)
  94. (/No newline at the end of the line)
  95.  
  96. Index: L2jFrozen_GameServer\config\functions\l2jfrozen.ppt
  97. ===================================================================
  98. --- config\functions\l2jfrozen.ppt (revision 912)
  99. +++ config\functions\l2jfrozen.ppt (working copy)
  100.  
  101. @@ -282,1 +282,1 @@
  102. ProtectorSkillId = 1170
  103. # Skill Level used for npc
  104. ProtectorSkillLevel = 13
  105. ProtectorSkillTime = 600
  106. # Npc Protector Message
  107. ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  108. +
  109. +#-------------------------------------
  110. +# Join and Leave Olympiad by Command -
  111. +#-------------------------------------
  112. +# Default: True
  113. +EnableJoinOlympiadCommand = True
Advertisement
Add Comment
Please, Sign In to add comment