Advertisement
Guest User

Untitled

a guest
Aug 19th, 2013
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 11.27 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/itemhandlers/ItemSkills.java
  24. ===================================================================
  25. --- dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java    (revision 9467)
  26. +++ dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java    (working copy)
  27. @@ -14,8 +14,10 @@
  28.   */
  29.  package handlers.itemhandlers;
  30.  
  31. +import com.l2jserver.gameserver.model.actor.L2Character;
  32.  import com.l2jserver.gameserver.model.actor.L2Playable;
  33.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  34. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  35.  import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
  36.  import com.l2jserver.gameserver.network.SystemMessageId;
  37.  
  38. @@ -33,6 +35,16 @@
  39.             activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
  40.             return false;
  41.         }
  42. +       else if((activeChar != null) && PkHunterEvent.isPk(activeChar))
  43. +       {
  44. +           activeChar.sendMessage("You cannot use this item while in this zone.");
  45. +           return false;
  46. +       }
  47. +       else if(activeChar != null && activeChar.isInsideZone(L2Character.MASS_ZONE) && item.getItemId() != 728 && item.getItemId() != 5592 && item.getItemId() != 20353)
  48. +       {
  49. +           activeChar.sendMessage("You cannot use this item while in this zone.");
  50. +           return false;
  51. +       }
  52.         return super.useItem(playable, item, forceUse);
  53.     }
  54.  }
  55.  
  56. Index: dist/game/data/scripts/handlers/skillhandlers/SummonFriend.java
  57. ===================================================================
  58. --- dist/game/data/scripts/handlers/skillhandlers/SummonFriend.java (revision 9467)
  59. +++ dist/game/data/scripts/handlers/skillhandlers/SummonFriend.java (working copy)
  60. @@ -21,6 +21,7 @@
  61.  import com.l2jserver.gameserver.model.L2Party;
  62.  import com.l2jserver.gameserver.model.actor.L2Character;
  63.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  64. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  65.  import com.l2jserver.gameserver.model.skills.L2Skill;
  66.  import com.l2jserver.gameserver.model.skills.L2SkillType;
  67.  import com.l2jserver.gameserver.network.SystemMessageId;
  68. @@ -98,6 +99,11 @@
  69.                        
  70.                         if (skill.getId() == 1403) //Summon Friend
  71.                         {
  72. +                           if (PkHunterEvent.isPk(activePlayer) || PkHunterEvent.isPk(targetPlayer))
  73. +                           {
  74. +                               activeChar.sendMessage("Players can't be summoned while in event.");
  75. +                               return;
  76. +                           }
  77.                             // Send message
  78.                             final ConfirmDlg confirm = new ConfirmDlg(SystemMessageId.C1_WISHES_TO_SUMMON_YOU_FROM_S2_DO_YOU_ACCEPT.getId());
  79.                             confirm.addCharName(activeChar);
  80. Index: dist/game/data/scripts/handlers/usercommandhandlers/Escape.java
  81. ===================================================================
  82. --- dist/game/data/scripts/handlers/usercommandhandlers/Escape.java (revision 9467)
  83. +++ dist/game/data/scripts/handlers/usercommandhandlers/Escape.java (working copy)
  84. @@ -25,6 +25,7 @@
  85.  import com.l2jserver.gameserver.instancemanager.GrandBossManager;
  86.  import com.l2jserver.gameserver.instancemanager.MapRegionManager;
  87.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  88. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  89.  import com.l2jserver.gameserver.model.entity.TvTEvent;
  90.  import com.l2jserver.gameserver.model.skills.L2Skill;
  91.  import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
  92. @@ -75,6 +76,12 @@
  93.             return false;
  94.         }
  95.        
  96. +       if (PkHunterEvent.isPk(activeChar))
  97. +       {
  98. +           activeChar.sendMessage("You can't escape while in event.");
  99. +           return false;
  100. +       }
  101. +      
  102.         if (activeChar.isCastingNow() || activeChar.isMovementDisabled() || activeChar.isMuted()
  103.                 || activeChar.isAlikeDead() || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || activeChar.isCombatFlagEquipped())
  104.             return false;
  105. Index: dist/game/data/scripts/handlers/itemhandlers/SummonItems.java
  106. ===================================================================
  107. --- dist/game/data/scripts/handlers/itemhandlers/SummonItems.java   (revision 9467)
  108. +++ dist/game/data/scripts/handlers/itemhandlers/SummonItems.java   (working copy)
  109. @@ -37,6 +37,7 @@
  110.  import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
  111.  import com.l2jserver.gameserver.model.actor.instance.L2XmassTreeInstance;
  112.  import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
  113. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  114.  import com.l2jserver.gameserver.model.entity.TvTEvent;
  115.  import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
  116.  import com.l2jserver.gameserver.network.SystemMessageId;
  117. @@ -85,6 +86,11 @@
  118.             activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
  119.             return false;
  120.         }
  121. +       if (PkHunterEvent.isPk(activeChar))
  122. +       {
  123. +           activeChar.sendMessage("You can't use this item while in event.");
  124. +           return false;
  125. +       }
  126.         if (activeChar.isAllSkillsDisabled() || activeChar.isCastingNow())
  127.             return false;  
  128. Index: dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java
  129. ===================================================================
  130. --- dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java   (revision 0)
  131. +++ dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java   (revision 0)
  132. @@ -0,0 +1,80 @@
  133. +/*
  134. + * This program is free software: you can redistribute it and/or modify it under
  135. + * the terms of the GNU General Public License as published by the Free Software
  136. + * Foundation, either version 3 of the License, or (at your option) any later
  137. + * version.
  138. + *
  139. + * This program is distributed in the hope that it will be useful, but WITHOUT
  140. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  141. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  142. + * details.
  143. + *
  144. + * You should have received a copy of the GNU General Public License along with
  145. + * this program. If not, see <http://www.gnu.org/licenses/>.
  146. + */
  147. +package handlers.voicedcommandhandlers;
  148. +
  149. +
  150. +import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
  151. +import com.l2jserver.gameserver.model.StatsSet;
  152. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  153. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  154. +import com.l2jserver.gameserver.model.skills.l2skills.L2SkillTeleport;
  155. +
  156. +/**
  157. + *
  158. + * @author  Wyatt
  159. + */
  160. +
  161. +public class PkHunterVoiced implements IVoicedCommandHandler
  162. +{
  163. +    private static final String[] VOICED_COMMANDS = { "gopk", "pkinfo"};
  164. +    
  165. +   @Override
  166. +   public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  167. +   {
  168. +       if (command.toLowerCase().equals("gopk"))
  169. +       {
  170. +           if (activeChar.isFestivalParticipant() || activeChar.isInJail() || activeChar.isInDuel()
  171. +               || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || PkHunterEvent.isPk(activeChar)
  172. +               )
  173. +            {
  174. +               activeChar.sendMessage("You can't use this command while participating in the Festival!");
  175. +               return false;
  176. +            }     
  177. +          
  178. +           if (PkHunterEvent.isActive())
  179. +           {
  180. +               StatsSet set = new StatsSet();
  181. +               set.set("skill_id", "2525");
  182. +               set.set("level", "1");
  183. +               set.set("target", "TARGET_SELF");
  184. +               set.set("name", "Scroll to move to PkHunter Event area");
  185. +               set.set("isMagic", "2");
  186. +               set.set("itemConsumeCount", "0");
  187. +               set.set("hitTime", "10000");
  188. +               set.set("operateType", "A1");
  189. +               set.set("skillType", "TELEPORT");
  190. +               set.set("teleCoords", PkHunterEvent.getPkLocation()[0]+","+PkHunterEvent.getPkLocation()[1]+","+PkHunterEvent.getPkLocation()[2]);
  191. +               activeChar.useMagic(new L2SkillTeleport(set), false, true);
  192. +               activeChar.sendMessage("Moving to PkHunter Event area...");
  193. +           }
  194. +           else
  195. +           {
  196. +               activeChar.sendMessage("PkHunter Event is not currently active.");
  197. +               return false;
  198. +           }
  199. +       }
  200. +       else if (command.toLowerCase().equals("pkinfo"))
  201. +       {
  202. +           PkHunterEvent.sendLocationMessage(activeChar);
  203. +       }
  204. +       return true;
  205. +   }
  206. +  
  207. +   @Override
  208. +   public String[] getVoicedCommandList()
  209. +   {
  210. +       return VOICED_COMMANDS;
  211. +   }  
  212. +}
  213. \ No newline at end of file
  214. Index: dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java
  215. ===================================================================
  216. --- dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java    (revision 9467)
  217. +++ dist/game/data/scripts/handlers/itemhandlers/ItemSkills.java    (working copy)
  218. @@ -14,6 +14,7 @@
  219.   */
  220.  package handlers.itemhandlers;
  221.  
  222. +import com.l2jserver.gameserver.model.actor.L2Character;
  223.  import com.l2jserver.gameserver.model.actor.L2Playable;
  224.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  225.  import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
  226. @@ -33,6 +34,11 @@
  227.             activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
  228.             return false;
  229.         }
  230. +       else if(activeChar != null && activeChar.isInsideZone(L2Character.MASS_ZONE) && item.getItemId() != 728 && item.getItemId() != 5592 && item.getItemId() != 20353)
  231. +       {
  232. +           activeChar.sendMessage("You cannot use this item while in this zone.");
  233. +           return false;
  234. +       }
  235.         return super.useItem(playable, item, forceUse);
  236.     }
  237.  }
  238. Index: dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java
  239. ===================================================================
  240. --- dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java (revision 9467)
  241. +++ dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java (working copy)
  242. @@ -20,6 +20,7 @@
  243.  import com.l2jserver.gameserver.model.actor.L2Character;
  244.  import com.l2jserver.gameserver.model.actor.instance.L2OlympiadManagerInstance;
  245.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  246. +import com.l2jserver.gameserver.model.entity.PkHunterEvent;
  247.  import com.l2jserver.gameserver.model.entity.TvTEvent;
  248.  import com.l2jserver.gameserver.model.olympiad.Olympiad;
  249.  import com.l2jserver.gameserver.model.olympiad.OlympiadGameManager;
  250. @@ -216,6 +217,11 @@
  251.                     activeChar.sendMessage("You can not observe games while registered for TvT");
  252.                     return false;
  253.                 }
  254. +               if (PkHunterEvent.isPk(activeChar))
  255. +               {
  256. +                   activeChar.sendMessage("You can't observe games while in event.");
  257. +                   return false;
  258. +               }
  259.             }
  260.            
  261.             final int arenaId = Integer.parseInt(command.substring(12).trim());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement