Advertisement
Guest User

NonLethalAbleNpc

a guest
Mar 10th, 2015
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.46 KB | None | 0 0
  1. package ai.group_template;
  2.  
  3. import ai.npc.AbstractNpcAI;
  4.  
  5. import com.l2jserver.gameserver.datatables.SpawnTable;
  6. import com.l2jserver.gameserver.model.L2Spawn;
  7. import com.l2jserver.gameserver.model.actor.L2Npc;
  8.  
  9.  
  10. public final class NonLethalableNpcs extends AbstractNpcAI
  11. {
  12.         // @formatter:off
  13.     private static final int[] HEADQUARTERS =
  14.     {
  15.         35062,
  16.         20431, 20453, 20487, //Abyss20
  17.         20945, 20594, 20646, //Abyss40
  18.         18008, 21578, 22506, //Abyss60
  19.         31847, 22748, 25598, //Abyss80
  20.         27217, 20821, 20762, //stage3
  21.         21580, 21083, 22550, //stage4
  22.         22518, 22362, 18490, //stage5
  23.         80030, 80031, 80032, 80033, 80034, 80035, 80036, 80037, 80038, 80039, 80040, 80042, 80043, 80044, //Rts
  24.         80045, 80046, 80047, 80048, 80049, 80050, 80051, 80052, 80053, 80054, 80055, 80056, 80057, 80058, //Rts
  25.     };
  26.     // @formatter:on
  27.    
  28.     public NonLethalableNpcs()
  29.     {
  30.         super(NonLethalableNpcs.class.getSimpleName(), "ai/group_template");
  31.         addSpawnId(HEADQUARTERS);
  32.    
  33.             for (int npcId : HEADQUARTERS)
  34.             {
  35.                 for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(npcId))
  36.                 {
  37.                     onSpawn(spawn.getLastSpawn());
  38.                 }
  39.             }
  40.    
  41.             /** for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(HEADQUARTERS))
  42.             *       {
  43.             *           onSpawn(spawn.getLastSpawn());
  44.             *       }
  45.             */
  46.     }
  47.    
  48.     @Override
  49.     public String onSpawn(L2Npc npc)
  50.     {
  51.         npc.setLethalable(false);
  52.         return super.onSpawn(npc);
  53.     }
  54.    
  55.     public static void main(String[] args)
  56.     {
  57.         new NonLethalableNpcs();
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement