Advertisement
horato

Raidbosses

Jun 16th, 2011
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package ai.group_template;
  16.  
  17. import java.util.concurrent.ScheduledFuture;
  18.  
  19. import com.l2jserver.gameserver.ThreadPoolManager;
  20. import com.l2jserver.gameserver.model.actor.L2Npc;
  21. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  22. import com.l2jserver.util.Rnd;
  23.  
  24. public class customRaidboss extends L2AttackableAIScript
  25. {
  26. private static final int[] _RBs = {
  27. //TODO: some fucking IDs here
  28. };
  29. private static final int[][] _spawns = {
  30. //TODO: Some spawns here
  31. { 83421, 148551, -3408 },
  32. { 83300, 148551, -3408 }
  33. };
  34. private static L2Npc _currentSpawn;
  35. private static ScheduledFuture<?> _RBcontrol = null;
  36.  
  37. public customRaidboss(int questId, String name, String descr)
  38. {
  39. super(questId, name, descr);
  40. for (int id : _RBs)
  41. {
  42. addAttackId(id);
  43. addSpawnId(id);
  44. addKillId(id);
  45. }
  46. _currentSpawn = addSpawn(_RBs[Rnd.get(_RBs.length)], _spawns[Rnd.get(0, 3)][0], _spawns[Rnd.get(0, 3)][1], _spawns[Rnd.get(0, 3)][2], 0, false, 0);
  47.  
  48. while (true)
  49. {
  50. _RBcontrol = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  51. {
  52. public void run()
  53. {
  54. _currentSpawn.deleteMe();
  55. _currentSpawn = addSpawn(_RBs[Rnd.get(_RBs.length)], _spawns[Rnd.get(0, 3)][0], _spawns[Rnd.get(0, 3)][1], _spawns[Rnd.get(0, 3)][2], 0, false, 0);
  56. }
  57. }, 10 * 60 * 1000);
  58. }
  59. }
  60.  
  61. @Override
  62. public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isPet)
  63. {
  64. return super.onAttack(npc, player, damage, isPet);
  65. }
  66.  
  67. @Override
  68. public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
  69. {
  70. // TODO Auto-generated method stub
  71. return super.onKill(npc, killer, isPet);
  72. }
  73.  
  74. @Override
  75. public String onSpawn(L2Npc npc)
  76. {
  77. // TODO Auto-generated method stub
  78. return super.onSpawn(npc);
  79. }
  80.  
  81. public static void main(String[] args)
  82. {
  83. new customRaidboss(-1, "customRaidboss", "ai");
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement