Advertisement
BossForever

Admin Commands

Jan 20th, 2013
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.92 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. ### Eclipse Workspace Patch 1.0
  3. #P L2JHellasD
  4. Index: sql/game/admin_command_access_rights.sql
  5. ===================================================================
  6. --- sql/game/admin_command_access_rights.sql    (revision 176)
  7. +++ sql/game/admin_command_access_rights.sql    (working copy)
  8. @@ -103,6 +103,9 @@
  9.  -- DELETE
  10.  ('admin_delete','1'),
  11.  
  12. +-- DEPORT
  13. +('admin_deport','1'),
  14. +
  15.  -- DISCONNECT
  16.  ('admin_character_disconnect','1'),
  17.  
  18. @@ -331,6 +334,9 @@
  19.  ('admin_manor_save','1'),
  20.  ('admin_manor_disable','1'),
  21.  
  22. +-- MASSHERO
  23. +('admin_masshero','1'),
  24. +
  25.  -- MENU
  26.  ('admin_char_manage','1'),
  27.  ('admin_teleport_character_to_menu','1'),
  28. @@ -402,6 +408,8 @@
  29.  ('admin_quest_reload','1'),
  30.  ('admin_script_load','1'),
  31.  
  32. +-- RECALL ALL
  33. +('admin_recallall', '1'),
  34.  -- REPAIR CHAR
  35.  ('admin_restore','1'),
  36.  ('admin_repair','1'),
  37.  
  38. #P L2jHellasC
  39. Index: java/com/l2jhellas/gameserver/handler/AdminCommandHandler.java
  40. ===================================================================
  41. --- java/com/l2jhellas/gameserver/handler/AdminCommandHandler.java  (revision 176)
  42. +++ java/com/l2jhellas/gameserver/handler/AdminCommandHandler.java  (working copy)
  43. @@ -47,6 +47,7 @@
  44.          registerAdminCommandHandler(new AdminCreateItem());
  45.          registerAdminCommandHandler(new AdminCursedWeapons());
  46.          registerAdminCommandHandler(new AdminDelete());
  47. +        registerAdminCommandHandler(new AdminDeport());
  48.          registerAdminCommandHandler(new AdminDisconnect());
  49.          registerAdminCommandHandler(new AdminDoorControl());
  50.          registerAdminCommandHandler(new AdminEditChar());
  51. @@ -69,6 +70,7 @@
  52.          registerAdminCommandHandler(new AdminLogin());
  53.          registerAdminCommandHandler(new AdminMammon());
  54.          registerAdminCommandHandler(new AdminManor());
  55. +        registerAdminCommandHandler(new AdminMassHero());
  56.          registerAdminCommandHandler(new AdminMenu());
  57.          registerAdminCommandHandler(new AdminMobGroup());
  58.          registerAdminCommandHandler(new AdminMonsterRace());
  59. @@ -77,7 +79,7 @@
  60.          registerAdminCommandHandler(new AdminPForge());
  61.          registerAdminCommandHandler(new AdminPledge());
  62.          registerAdminCommandHandler(new AdminPolymorph());
  63.          registerAdminCommandHandler(new AdminQuest());
  64. +        registerAdminCommandHandler(new AdminRecallAll());
  65.          registerAdminCommandHandler(new AdminRepairChar());
  66.          registerAdminCommandHandler(new AdminRes());
  67.          registerAdminCommandHandler(new AdminRideWyvern());
  68. Index: java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminMassHero.java
  69. ===================================================================
  70. --- java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminMassHero.java   (revision 0)
  71. +++ java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminMassHero.java   (working copy)
  72. @@ -0,0 +1,48 @@
  73. +package com.l2jhellas.gameserver.handler.admincommandhandlers;
  74. +
  75. +import java.util.logging.Logger;
  76. +
  77. +import com.l2jhellas.gameserver.handler.IAdminCommandHandler;
  78. +import com.l2jhellas.gameserver.model.L2World;
  79. +import com.l2jhellas.gameserver.model.actor.instance.L2PcInstance;
  80. +import com.l2jhellas.gameserver.network.serverpackets.SocialAction;
  81. +
  82. +public class AdminMassHero implements IAdminCommandHandler
  83. +{
  84. +   protected static final Logger _log = Logger.getLogger(AdminMassHero.class.getName());
  85. +  
  86. +   @Override
  87. +   public String[] getAdminCommandList()
  88. +   {
  89. +       return ADMIN_COMMANDS;
  90. +   }
  91. +
  92. +   @Override
  93. +   public boolean useAdminCommand(String command, L2PcInstance activeChar)
  94. +   {
  95. +       if(activeChar == null)
  96. +           return false;
  97. +
  98. +       if(command.startsWith("admin_masshero"))
  99. +       {
  100. +           for(L2PcInstance player : L2World.getInstance().getAllPlayers())
  101. +           {
  102. +               if(player instanceof L2PcInstance)
  103. +               {
  104. +                   /* Check to see if the player already is Hero and if aren't in Olympiad Mode */
  105. +                   if(!player.isHero() || !player.isInOlympiadMode())
  106. +                   {
  107. +                       player.setHero(true);
  108. +                       player.sendMessage("Admin is rewarding all online players with Hero Status.");
  109. +                       player.broadcastPacket(new SocialAction(player.getObjectId(), 16));
  110. +                       player.broadcastUserInfo();
  111. +                   }
  112. +                   player = null;
  113. +               }
  114. +           }
  115. +       }
  116. +       return true;
  117. +   }
  118. +
  119. +   private static String[] ADMIN_COMMANDS = { "admin_masshero" };
  120. +}
  121. \ No newline at end of file
  122. Index: java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminRecallAll.java
  123. ===================================================================
  124. --- java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminRecallAll.java  (revision 0)
  125. +++ java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminRecallAll.java  (working copy)
  126. @@ -0,0 +1,36 @@
  127. +package com.l2jhellas.gameserver.handler.admincommandhandlers;
  128. +
  129. +import com.l2jhellas.gameserver.handler.IAdminCommandHandler;
  130. +import com.l2jhellas.gameserver.model.L2World;
  131. +import com.l2jhellas.gameserver.model.actor.instance.L2PcInstance;
  132. +
  133. +
  134. +
  135. +public class AdminRecallAll implements IAdminCommandHandler
  136. +{
  137. + private static final String[] ADMIN_COMMANDS = { "admin_recallall" };
  138. +
  139. + private void teleportTo(L2PcInstance activeChar, int x, int y, int z)
  140. + {
  141. +
  142. + activeChar.teleToLocation(x, y, z, false);
  143. +
  144. + }
  145. + @Override
  146. +public boolean useAdminCommand(String command, L2PcInstance activeChar)
  147. + {
  148. + if (command.startsWith("admin_recallall"))
  149. + {
  150. + for(L2PcInstance players :L2World.getInstance().getAllPlayers())
  151. + {
  152. + teleportTo(players, activeChar.getX(), activeChar.getY(), activeChar.getZ());
  153. + }
  154. + }
  155. + return false;
  156. + }
  157. + @Override
  158. +public String[] getAdminCommandList()
  159. + {
  160. + return ADMIN_COMMANDS;
  161. + }
  162. +}
  163. \ No newline at end of file
  164. Index: java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminDeport.java
  165. ===================================================================
  166. --- java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminDeport.java (revision 0)
  167. +++ java/com/l2jhellas/gameserver/handler/admincommandhandlers/AdminDeport.java (working copy)
  168. @@ -0,0 +1,33 @@
  169. +package com.l2jhellas.gameserver.handler.admincommandhandlers;
  170. +
  171. +import com.l2jhellas.gameserver.handler.IAdminCommandHandler;
  172. +import com.l2jhellas.gameserver.model.actor.instance.L2PcInstance;
  173. +
  174. +public class AdminDeport implements IAdminCommandHandler
  175. +{
  176. +   private static String[] _adminCommands =
  177. +   {
  178. +                "admin_deport"
  179. +   };
  180. +
  181. +   @Override
  182. +   public boolean useAdminCommand(String command, L2PcInstance activeChar)
  183. +   {
  184. +
  185. +         if(activeChar.getTarget() instanceof L2PcInstance)
  186. +         {
  187. +                if(command.startsWith("admin_deport"))
  188. +                {
  189. +                       ((L2PcInstance) activeChar.getTarget()).teleToLocation(82698, 148638, -3473); // Location Giran
  190. +                }
  191. +         }
  192. +         return false;
  193. +
  194. +   }
  195. +
  196. +   @Override
  197. +   public String[] getAdminCommandList()
  198. +   {
  199. +         return _adminCommands;
  200. +   }
  201. +}
  202. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement