Guest User

Untitled

a guest
Aug 18th, 2013
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.25 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2J_DataPack
  3. Index: dist/game/data/scripts/handlers/MasterHandler.java
  4. ===================================================================
  5. --- dist/game/data/scripts/handlers/MasterHandler.java (revision 9467)
  6. +++ dist/game/data/scripts/handlers/MasterHandler.java (working copy);
  7. @@ -290,6 +291,7 @@
  8. import handlers.voicedcommandhandlers.Debug;
  9. import handlers.voicedcommandhandlers.Hellbound;
  10. import handlers.voicedcommandhandlers.Lang;
  11. +import handlers.voicedcommandhandlers.PkHunterVoiced;
  12. import handlers.voicedcommandhandlers.StatsVCmd;
  13. import handlers.voicedcommandhandlers.TvTVoicedInfo;
  14. import handlers.voicedcommandhandlers.Wedding;
  15. @@ -603,6 +606,7 @@
  16. (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null),
  17. (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null),
  18. (Config.L2JMOD_HELLBOUND_STATUS ? Hellbound.class : null),
  19. + (Config.ENABLE_PKHUNTEREVENT ? PkHunterVoiced.class : null),
  20. },
  21. {
  22. // Target Handlers
  23. Index: dist/game/data/scripts/handlers/skillhandlers/SummonFriend.java
  24. ===================================================================
  25. --- dist/game/data/scripts/handlers/skillhandlers/SummonFriend.java (revision 9467)
  26. +++ dist/game/data/scripts/handlers/skillhandlers/SummonFriend.java (working copy)
  27. @@ -21,6 +21,7 @@
  28. import com.l2jserver.gameserver.model.L2Party;
  29. import com.l2jserver.gameserver.model.actor.L2Character;
  30. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  31. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  32. import com.l2jserver.gameserver.model.skills.L2Skill;
  33. import com.l2jserver.gameserver.model.skills.L2SkillType;
  34. import com.l2jserver.gameserver.network.SystemMessageId;
  35. @@ -98,6 +99,11 @@
  36.  
  37. if (skill.getId() == 1403) //Summon Friend
  38. {
  39. + if (PkHunterEvent.isPk(activePlayer) || PkHunterEvent.isPk(targetPlayer))
  40. + {
  41. + activeChar.sendMessage("Players can't be summoned while in event.");
  42. + return;
  43. + }
  44. // Send message
  45. final ConfirmDlg confirm = new ConfirmDlg(SystemMessageId.C1_WISHES_TO_SUMMON_YOU_FROM_S2_DO_YOU_ACCEPT.getId());
  46. confirm.addCharName(activeChar);
  47. Index: dist/game/data/scripts/handlers/usercommandhandlers/Escape.java
  48. ===================================================================
  49. --- dist/game/data/scripts/handlers/usercommandhandlers/Escape.java (revision 9467)
  50. +++ dist/game/data/scripts/handlers/usercommandhandlers/Escape.java (working copy)
  51. @@ -25,6 +25,7 @@
  52. import com.l2jserver.gameserver.instancemanager.GrandBossManager;
  53. import com.l2jserver.gameserver.instancemanager.MapRegionManager;
  54. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  55. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  56. import com.l2jserver.gameserver.model.entity.TvTEvent;
  57. import com.l2jserver.gameserver.model.skills.L2Skill;
  58. import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
  59. @@ -75,6 +76,12 @@
  60. return false;
  61. }
  62.  
  63. + if (PkHunterEvent.isPk(activeChar))
  64. + {
  65. + activeChar.sendMessage("You can't escape while in event.");
  66. + return false;
  67. + }
  68. +
  69. if (activeChar.isCastingNow() || activeChar.isMovementDisabled() || activeChar.isMuted()
  70. || activeChar.isAlikeDead() || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || activeChar.isCombatFlagEquipped())
  71. return false;
  72. Index: dist/game/data/scripts/handlers/itemhandlers/SummonItems.java
  73. ===================================================================
  74. --- dist/game/data/scripts/handlers/itemhandlers/SummonItems.java (revision 9467)
  75. +++ dist/game/data/scripts/handlers/itemhandlers/SummonItems.java (working copy)
  76. @@ -37,6 +37,7 @@
  77. import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
  78. import com.l2jserver.gameserver.model.actor.instance.L2XmassTreeInstance;
  79. import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
  80. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  81. import com.l2jserver.gameserver.model.entity.TvTEvent;
  82. import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
  83. import com.l2jserver.gameserver.network.SystemMessageId;
  84. @@ -85,6 +86,11 @@
  85. activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
  86. return false;
  87. }
  88. + if (PkHunterEvent.isPk(activeChar))
  89. + {
  90. + activeChar.sendMessage("You can't use this item while in event.");
  91. + return false;
  92. + }
  93. if (activeChar.isAllSkillsDisabled() || activeChar.isCastingNow())
  94. return false;
  95.  
  96. Index: dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java
  97. ===================================================================
  98. --- dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java (revision 0)
  99. +++ dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java (revision 0)
  100. @@ -0,0 +1,62 @@
  101. +/*
  102. + * This program is free software: you can redistribute it and/or modify it under
  103. + * the terms of the GNU General Public License as published by the Free Software
  104. + * Foundation, either version 3 of the License, or (at your option) any later
  105. + * version.
  106. + *
  107. + * This program is distributed in the hope that it will be useful, but WITHOUT
  108. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  109. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  110. + * details.
  111. + *
  112. + * You should have received a copy of the GNU General Public License along with
  113. + * this program. If not, see <http://www.gnu.org/licenses/>.
  114. + */
  115. +package handlers.voicedcommandhandlers;
  116. +
  117. +import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
  118. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  119. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  120. +
  121. +/**
  122. + *
  123. + * @author Wyatt
  124. + */
  125. +
  126. +public class PkHunterVoiced implements IVoicedCommandHandler
  127. +{
  128. + private static final String[] VOICED_COMMANDS = { "gopk"};
  129. +
  130. + @Override
  131. + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  132. + {
  133. + if (command.toLowerCase().equals("gopk"))
  134. + {
  135. + if (activeChar.isFestivalParticipant() || activeChar.isInJail() || activeChar.isInDuel()
  136. + || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || activeChar.getName().equals(PkHunterEvent.getPkName())
  137. + )
  138. + {
  139. + activeChar.sendMessage("You don't fit the requirements to use this command.");
  140. + return false;
  141. + }
  142. +
  143. + if (PkHunterEvent.isActive())
  144. + {
  145. + activeChar.sendMessage("You have successfully teleported to PkHunter Event area.");
  146. + activeChar.teleToLocation(PkHunterEvent.getPkLocation()[0], PkHunterEvent.getPkLocation()[1], PkHunterEvent.getPkLocation()[2]);
  147. + }
  148. + else
  149. + {
  150. + activeChar.sendMessage("PkHunter Event is not currently active.");
  151. + return false;
  152. + }
  153. + }
  154. + return true;
  155. + }
  156. +
  157. + @Override
  158. + public String[] getVoicedCommandList()
  159. + {
  160. + return VOICED_COMMANDS;
  161. + }
  162. +}
  163. \ No newline at end of file
  164. Index: dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java
  165. ===================================================================
  166. --- dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java (revision 9467)
  167. +++ dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java (working copy)
  168. @@ -14,6 +14,7 @@
  169. */
  170. package handlers.itemhandlers;
  171.  
  172. +import com.l2jserver.gameserver.model.actor.L2Character;
  173. import com.l2jserver.gameserver.model.actor.L2Playable;
  174. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  175. import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
  176. @@ -33,6 +34,11 @@
  177. activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
  178. return false;
  179. }
  180. + else if(activeChar != null && activeChar.isInsideZone(L2Character.MASS_ZONE) && item.getItemId() != 728 && item.getItemId() != 5592 && item.getItemId() != 20353)
  181. + {
  182. + activeChar.sendMessage("You cannot use this item while in this zone.");
  183. + return false;
  184. + }
  185. return super.useItem(playable, item, forceUse);
  186. }
  187. }
  188. Index: dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java
  189. ===================================================================
  190. --- dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java (revision 9467)
  191. +++ dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java (working copy)
  192. @@ -20,6 +20,7 @@
  193. import com.l2jserver.gameserver.model.actor.L2Character;
  194. import com.l2jserver.gameserver.model.actor.instance.L2OlympiadManagerInstance;
  195. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  196. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  197. import com.l2jserver.gameserver.model.entity.TvTEvent;
  198. import com.l2jserver.gameserver.model.olympiad.Olympiad;
  199. import com.l2jserver.gameserver.model.olympiad.OlympiadGameManager;
  200. @@ -216,6 +217,11 @@
  201. activeChar.sendMessage("You can not observe games while registered for TvT");
  202. return false;
  203. }
  204. + if (PkHunterEvent.isPk(activeChar))
  205. + {
  206. + activeChar.sendMessage("You can't observe games while in event.");
  207. + return false;
  208. + }
  209. }
  210.  
  211. final int arenaId = Integer.parseInt(command.substring(12).trim());
Advertisement
Add Comment
Please, Sign In to add comment