Advertisement
Nik

HighFive ArenaManager

Nik
Apr 20th, 2011
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 8.46 KB | None | 0 0
  1. Index: data/html/default/31226.htm
  2. ===================================================================
  3. --- data/html/default/31226.htm (revision 7916)
  4. +++ data/html/default/31226.htm (working copy)
  5. @@ -1,5 +1,7 @@
  6.  <html><body>Arena Director:<br>
  7.  Play the game according to the rules! The loser should be silent! What? Unfair? Then, why don't you hold your tonque and give it another try!<br>
  8. -<a action="bypass -h npc_%objectId%_CPRecovery">CP Recovery: consumption of 100 adena</a><br>
  9. +<a action="bypass -h npc_%objectId%_CPRecovery">CP Recovery : 1,000 Adena</a><br>
  10. +<a action="bypass -h npc_%objectId%_HPRecovery">HP Recovery : 1,000 Adena</a><br><br>
  11. +<a action="bypass -h npc_%objectId%_ArenaBuffs">Buff for Battle Ground : 1,000 Adena</a><br><br>
  12.  <a action="bypass -h npc_%objectId%_Quest">Quest</a>
  13.  </body></html>
  14. \ No newline at end of file
  15. Index: data/html/warehouse/31225.htm
  16. ===================================================================
  17. --- data/html/warehouse/31225.htm   (revision 7916)
  18. +++ data/html/warehouse/31225.htm   (working copy)
  19. @@ -1,6 +1,9 @@
  20.  <html><body>Arena Manager:<br>
  21.  Way to go! Hooray! Hooray!!!<br>
  22. -<a action="bypass -h npc_%objectId%_CPRecovery">CP Recovery: consumption of 100 adena</a><br>
  23. +(Be careful! CP/HP will not get recovered inside the fence.)<br>
  24. +<a action="bypass -h npc_%objectId%_CPRecovery">CP Recovery : 1,000 Adena</a><br>
  25. +<a action="bypass -h npc_%objectId%_HPRecovery">HP Recovery : 1,000 Adena</a><br><br>
  26. +<a action="bypass -h npc_%objectId%_ArenaBuffs">Buff for Battle Ground : 1,000 Adena</a><br><br>
  27.  <a action="bypass -h npc_%objectId%_DepositP">Private Warehouse: Deposit an Item</a><br1>
  28.  <a action="bypass -h npc_%objectId%_WithdrawP">Private Warehouse: Withdraw an Item</a><br>
  29.  <a action="bypass -h npc_%objectId%_Quest">Quest</a>
  30. Index: data/scripts/handlers/MasterHandler.java
  31. ===================================================================
  32. --- data/scripts/handlers/MasterHandler.java    (revision 7916)
  33. +++ data/scripts/handlers/MasterHandler.java    (working copy)
  34. @@ -102,7 +102,7 @@
  35.  import handlers.bypasshandlers.Augment;
  36.  import handlers.bypasshandlers.Buy;
  37.  import handlers.bypasshandlers.BuyShadowItem;
  38. -import handlers.bypasshandlers.CPRecovery;
  39. +import handlers.bypasshandlers.ArenaManager;
  40.  import handlers.bypasshandlers.ChatLink;
  41.  import handlers.bypasshandlers.ClanWarehouse;
  42.  import handlers.bypasshandlers.DrawHenna;
  43. @@ -378,7 +378,7 @@
  44.         BypassHandler.getInstance().registerBypassHandler(new BuyShadowItem());
  45.         BypassHandler.getInstance().registerBypassHandler(new ChatLink());
  46.         BypassHandler.getInstance().registerBypassHandler(new ClanWarehouse());
  47. -       BypassHandler.getInstance().registerBypassHandler(new CPRecovery());
  48. +       BypassHandler.getInstance().registerBypassHandler(new ArenaManager());
  49.         BypassHandler.getInstance().registerBypassHandler(new DrawHenna());
  50.         BypassHandler.getInstance().registerBypassHandler(new Festival());
  51.         BypassHandler.getInstance().registerBypassHandler(new FishSkillList());
  52. Index: data/scripts/handlers/bypasshandlers/ArenaManager.java
  53. ===================================================================
  54. --- data/scripts/handlers/bypasshandlers/ArenaManager.java  (revision 7916)
  55. +++ data/scripts/handlers/bypasshandlers/ArenaManager.java  (working copy)
  56. @@ -22,13 +22,18 @@
  57.  import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  58.  import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
  59.  
  60. -public class CPRecovery implements IBypassHandler
  61. +public class ArenaManager implements IBypassHandler
  62.  {
  63.     private static final String[] COMMANDS =
  64.     {
  65. -       "CPRecovery"
  66. +       "CPRecovery",
  67. +       "HPRecovery",
  68. +       "ArenaBuffs",
  69.     };
  70.    
  71. +   private final int[] _fighterBuffs = {6803, 6809, 6811, 6808, 6804, 6812};
  72. +   private final int[] _mageBuffs = {6806, 6807, 6805, 6804, 6812};
  73. +  
  74.     public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
  75.     {
  76.         if (!(target instanceof L2Npc))
  77. @@ -46,14 +51,68 @@
  78.             return true;
  79.         }
  80.        
  81. -       if (!activeChar.reduceAdena("RestoreCP", 100, activeChar.getLastFolkNPC(), true))
  82. -           return false;
  83. -      
  84. -       L2Skill skill = SkillTable.getInstance().getInfo(4380, 1);
  85. -       if (skill != null)
  86. +       if ("CPRecovery".equalsIgnoreCase(command))
  87.         {
  88. -           npc.setTarget(activeChar);
  89. -           npc.doCast(skill);
  90. +           if (!activeChar.reduceAdena("RestoreCP", 1000, activeChar.getLastFolkNPC(), true))
  91. +               return false;
  92. +          
  93. +           // It is verified, the bastard doesnt heal you if you are inside the arena, only takes your money
  94. +           if (activeChar.isInsideZone(L2Character.ZONE_PVP))
  95. +               return false;
  96. +          
  97. +           L2Skill skill = SkillTable.getInstance().getInfo(4380, 1);
  98. +           if (skill != null)
  99. +           {
  100. +               npc.setTarget(activeChar);
  101. +               npc.doCast(skill);
  102. +           }
  103. +       }
  104. +       else if ("HPRecovery".equalsIgnoreCase(command))
  105. +       {
  106. +           if (!activeChar.reduceAdena("RestoreHP", 1000, activeChar.getLastFolkNPC(), true))
  107. +               return false;
  108. +          
  109. +           // It is verified, the bastard doesnt heal you if you are inside the arena, only takes your money
  110. +           if (activeChar.isInsideZone(L2Character.ZONE_PVP))
  111. +               return false;
  112. +          
  113. +           L2Skill skill = SkillTable.getInstance().getInfo(6817, 1);
  114. +           if (skill != null)
  115. +           {
  116. +               npc.setTarget(activeChar);
  117. +               npc.doCast(skill);
  118. +           }
  119. +       }
  120. +       else if ("ArenaBuffs".equalsIgnoreCase(command))
  121. +       {
  122. +           if (!activeChar.reduceAdena("ArenaBuff", 2000, activeChar.getLastFolkNPC(), true))
  123. +               return false;
  124. +          
  125. +           if (activeChar.getClassId().isMage())
  126. +           {
  127. +               for (int skillId : _mageBuffs)
  128. +               {
  129. +                   L2Skill skill = SkillTable.getInstance().getInfo(skillId, 1);
  130. +                   if (skill != null)
  131. +                   {
  132. +                       npc.setTarget(activeChar);
  133. +                       npc.doCast(skill);
  134. +                   }
  135. +                  
  136. +               }
  137. +           }
  138. +           else
  139. +           {
  140. +               for (int skillId : _fighterBuffs)
  141. +               {
  142. +                   L2Skill skill = SkillTable.getInstance().getInfo(skillId, 1);
  143. +                   if (skill != null)
  144. +                   {
  145. +                       npc.setTarget(activeChar);
  146. +                       npc.doCast(skill);
  147. +                   }
  148. +               }
  149. +           }
  150.         }
  151.         activeChar.sendPacket(ActionFailed.STATIC_PACKET);
  152.         return true;
  153. Index: data/scripts/handlers/bypasshandlers/CPRecovery.java
  154. ===================================================================
  155. --- data/scripts/handlers/bypasshandlers/CPRecovery.java    (revision 7916)
  156. +++ data/scripts/handlers/bypasshandlers/CPRecovery.java    (working copy)
  157. @@ -1,66 +0,0 @@
  158. -/*
  159. - * This program is free software: you can redistribute it and/or modify it under
  160. - * the terms of the GNU General Public License as published by the Free Software
  161. - * Foundation, either version 3 of the License, or (at your option) any later
  162. - * version.
  163. - *
  164. - * This program is distributed in the hope that it will be useful, but WITHOUT
  165. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  166. - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  167. - * details.
  168. - *
  169. - * You should have received a copy of the GNU General Public License along with
  170. - * this program. If not, see <http://www.gnu.org/licenses/>.
  171. - */
  172. -package handlers.bypasshandlers;
  173. -
  174. -import com.l2jserver.gameserver.datatables.SkillTable;
  175. -import com.l2jserver.gameserver.handler.IBypassHandler;
  176. -import com.l2jserver.gameserver.model.L2Skill;
  177. -import com.l2jserver.gameserver.model.actor.L2Character;
  178. -import com.l2jserver.gameserver.model.actor.L2Npc;
  179. -import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  180. -import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
  181. -
  182. -public class CPRecovery implements IBypassHandler
  183. -{
  184. -   private static final String[] COMMANDS =
  185. -   {
  186. -       "CPRecovery"
  187. -   };
  188. -  
  189. -   public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
  190. -   {
  191. -       if (!(target instanceof L2Npc))
  192. -           return false;
  193. -      
  194. -       final L2Npc npc = (L2Npc) target;
  195. -      
  196. -       if (npc.getNpcId() != 31225 && npc.getNpcId() != 31226)
  197. -           return false;
  198. -      
  199. -       if (activeChar.isCursedWeaponEquipped())
  200. -       {
  201. -           activeChar.sendMessage("Go away, you're not welcome here.");
  202. -           activeChar.sendPacket(ActionFailed.STATIC_PACKET);
  203. -           return true;
  204. -       }
  205. -      
  206. -       if (!activeChar.reduceAdena("RestoreCP", 100, activeChar.getLastFolkNPC(), true))
  207. -           return false;
  208. -      
  209. -       L2Skill skill = SkillTable.getInstance().getInfo(4380, 1);
  210. -       if (skill != null)
  211. -       {
  212. -           npc.setTarget(activeChar);
  213. -           npc.doCast(skill);
  214. -       }
  215. -       activeChar.sendPacket(ActionFailed.STATIC_PACKET);
  216. -       return true;
  217. -   }
  218. -  
  219. -   public String[] getBypassList()
  220. -   {
  221. -       return COMMANDS;
  222. -   }
  223. -}
  224. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement