Guest User

Untitled

a guest
Aug 31st, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.30 KB | None | 0 0
  1. /*
  2.  * Copyright (C) 2004-2015 L2J DataPack
  3.  *
  4.  * This file is part of L2J DataPack.
  5.  *
  6.  * L2J DataPack is free software: you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation, either version 3 of the License, or
  9.  * (at your option) any later version.
  10.  *
  11.  * L2J DataPack is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14.  * General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18.  */
  19. package hellbound;
  20.  
  21. import handlers.admincommandhandlers.AdminHellbound;
  22. import handlers.usercommandhandlers.Hellbound;
  23. import hellbound.AI.Amaskari;
  24. import hellbound.AI.Chimeras;
  25. import hellbound.AI.DemonPrince;
  26. import hellbound.AI.HellboundCore;
  27. import hellbound.AI.Keltas;
  28. import hellbound.AI.NaiaLock;
  29. import hellbound.AI.OutpostCaptain;
  30. import hellbound.AI.Ranku;
  31. import hellbound.AI.Slaves;
  32. import hellbound.AI.Typhoon;
  33. import hellbound.AI.NPC.Bernarde.Bernarde;
  34. import hellbound.AI.NPC.Budenka.Budenka;
  35. import hellbound.AI.NPC.Buron.Buron;
  36. import hellbound.AI.NPC.Deltuva.Deltuva;
  37. import hellbound.AI.NPC.Falk.Falk;
  38. import hellbound.AI.NPC.Hude.Hude;
  39. import hellbound.AI.NPC.Jude.Jude;
  40. import hellbound.AI.NPC.Kanaf.Kanaf;
  41. import hellbound.AI.NPC.Kief.Kief;
  42. import hellbound.AI.NPC.Natives.Natives;
  43. import hellbound.AI.NPC.Quarry.Quarry;
  44. import hellbound.AI.NPC.Shadai.Shadai;
  45. import hellbound.AI.NPC.Solomon.Solomon;
  46. import hellbound.AI.NPC.Warpgate.Warpgate;
  47. import hellbound.AI.Zones.AnomicFoundry.AnomicFoundry;
  48. import hellbound.AI.Zones.BaseTower.BaseTower;
  49. import hellbound.AI.Zones.TowerOfInfinitum.TowerOfInfinitum;
  50. import hellbound.AI.Zones.TowerOfNaia.TowerOfNaia;
  51. import hellbound.AI.Zones.TullyWorkshop.TullyWorkshop;
  52. import hellbound.Instances.DemonPrinceFloor.DemonPrinceFloor;
  53. import hellbound.Instances.RankuFloor.RankuFloor;
  54. import hellbound.Instances.UrbanArea.UrbanArea;
  55.  
  56. import java.util.logging.Logger;
  57.  
  58. import com.l2jserver.gameserver.handler.AdminCommandHandler;
  59. import com.l2jserver.gameserver.handler.IAdminCommandHandler;
  60. import com.l2jserver.gameserver.handler.IUserCommandHandler;
  61. import com.l2jserver.gameserver.handler.UserCommandHandler;
  62.  
  63. /**
  64.  * Hellbound class-loader.
  65.  * @author -
  66.  */
  67. public final class HellboundLoader
  68. {
  69.     private static final Logger _log = Logger.getLogger(HellboundLoader.class.getName());
  70.     private static boolean L2JMOD_HELLBOUND_STATUS = true;
  71.    
  72.     private static final Class<?>[] SCRIPTS =
  73.     {
  74.         // Commands
  75.         AdminHellbound.class,
  76.         Hellbound.class,
  77.         // AIs
  78.         Amaskari.class,
  79.         Chimeras.class,
  80.         DemonPrince.class,
  81.         HellboundCore.class,
  82.         Keltas.class,
  83.         NaiaLock.class,
  84.         OutpostCaptain.class,
  85.         Ranku.class,
  86.         Slaves.class,
  87.         Typhoon.class,
  88.         // NPCs
  89.         Bernarde.class,
  90.         Budenka.class,
  91.         Buron.class,
  92.         Deltuva.class,
  93.         Falk.class,
  94.         Hude.class,
  95.         Jude.class,
  96.         Kanaf.class,
  97.         Kief.class,
  98.         Natives.class,
  99.         Quarry.class,
  100.         Shadai.class,
  101.         Solomon.class,
  102.         Warpgate.class,
  103.         // Zones
  104.         AnomicFoundry.class,
  105.         BaseTower.class,
  106.         TowerOfInfinitum.class,
  107.         TowerOfNaia.class,
  108.         TullyWorkshop.class,
  109.         // Instances
  110.         DemonPrinceFloor.class,
  111.         UrbanArea.class,
  112.         RankuFloor.class,
  113.     };
  114.    
  115.     public static void main(String[] args)
  116.     {
  117.         _log.info(HellboundLoader.class.getSimpleName() + ": Loading Hellbound related scripts:");
  118.        
  119.         HellboundPointData.getInstance();
  120.         HellboundSpawns.getInstance();
  121.         HellboundEngine.getInstance();
  122.        
  123.         for (Class<?> script : SCRIPTS)
  124.         {
  125.             try
  126.             {
  127.                 final Object instance = script.newInstance();
  128.                 if (instance instanceof IAdminCommandHandler)
  129.                 {
  130.                     AdminCommandHandler.getInstance().registerAdminCommandHandler((IAdminCommandHandler) instance);
  131.                 }
  132.                 else if (L2JMOD_HELLBOUND_STATUS && (instance instanceof IUserCommandHandler))
  133.                 {
  134.                     UserCommandHandler.getInstance().registerUserCommandHandler((IUserCommandHandler) instance);
  135.                 }
  136.             }
  137.             catch (Exception e)
  138.             {
  139.                 _log.severe(HellboundLoader.class.getSimpleName() + ": Failed loading " + script.getSimpleName() + ":" + e.getMessage());
  140.             }
  141.         }
  142.     }
  143. }
Advertisement
Add Comment
Please, Sign In to add comment