Advertisement
BossForever

Mass Hero H5

Apr 30th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.27 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P Datapack
  3. Index: dist/game/data/scripts/handlers/MasterHandler.java
  4. ===================================================================
  5. --- dist/game/data/scripts/handlers/MasterHandler.java  (revision 12)
  6. +++ dist/game/data/scripts/handlers/MasterHandler.java  (working copy)
  7. @@ -404,6 +408,7 @@
  8.             AdminLogin.class,
  9.             AdminMammon.class,
  10.             AdminManor.class,
  11. +           AdminMassHero.class,
  12.             AdminMenu.class,
  13.             AdminMessages.class,
  14.             AdminMobGroup.class,
  15.  
  16.         {
  17.             // Target Handlers
  18. Index: dist/game/data/scripts/handlers/admincommandhandlers/AdminMassHero.java
  19. ===================================================================
  20. --- dist/game/data/scripts/handlers/admincommandhandlers/AdminMassHero.java (revision 0)
  21. +++ dist/game/data/scripts/handlers/admincommandhandlers/AdminMassHero.java (working copy)
  22. @@ -0,0 +1,54 @@
  23. +package handlers.admincommandhandlers;
  24. +
  25. +import l2jcrimmerproject.gameserver.handler.IAdminCommandHandler;
  26. +import l2jcrimmerproject.gameserver.model.L2World;
  27. +import l2jcrimmerproject.gameserver.model.actor.instance.L2PcInstance;
  28. +import l2jcrimmerproject.gameserver.network.serverpackets.SocialAction;
  29. +
  30. +/**
  31. + * @author RedHoT
  32. + */
  33. +public class AdminMassHero implements IAdminCommandHandler
  34. +{
  35. +   private static String[] ADMIN_COMMANDS =
  36. +   {
  37. +       "admin_masshero"
  38. +   };
  39. +  
  40. +   @Override
  41. +   public boolean useAdminCommand(String command, L2PcInstance activeChar)
  42. +   {
  43. +       if (activeChar == null)
  44. +       {
  45. +           return false;
  46. +       }
  47. +      
  48. +       if (command.startsWith("admin_masshero"))
  49. +       {
  50. +           for (L2PcInstance player : L2World.getInstance().getAllPlayers().valueCollection())
  51. +           {
  52. +               if (player == null)
  53. +               {
  54. +                   return false;
  55. +               }
  56. +              
  57. +               /** Check to see if the player already is Hero and if aren't in Olympiad Mode */
  58. +               if (!player.isHero() || !player.isInOlympiadMode())
  59. +               {
  60. +                   player.setHero(true);
  61. +                   player.sendMessage("Admin is rewarding all online players with Hero Status.");
  62. +                   player.broadcastPacket(new SocialAction(player.getObjectId(), 16));
  63. +                   player.broadcastUserInfo();
  64. +               }
  65. +               player = null;
  66. +           }
  67. +       }
  68. +       return true;
  69. +   }
  70. +  
  71. +   @Override
  72. +   public String[] getAdminCommandList()
  73. +   {
  74. +       return ADMIN_COMMANDS;
  75. +   }
  76. +}
  77. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement