Advertisement
Nik

HighFive ArenaManager

Nik
Apr 20th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.02 KB | None | 0 0
  1. Index: data/html/default/31226.htm
  2. ===================================================================
  3. --- data/html/default/31226.htm (revision 545)
  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 545)
  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 545)
  33. +++ data/scripts/handlers/MasterHandler.java    (working copy)
  34. @@ -103,7 +103,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. @@ -382,7 +382,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/CPRecovery.java
  53. ===================================================================
  54. --- data/scripts/handlers/bypasshandlers/CPRecovery.java    (revision 545)
  55. +++ data/scripts/handlers/bypasshandlers/CPRecovery.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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement