Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. package ai.custom1;
  2.  
  3. import l2f.gameserver.ai.DefaultAI;
  4. import l2f.gameserver.model.Player;
  5. import l2f.gameserver.model.World;
  6. import l2f.gameserver.model.instances.NpcInstance;
  7. import l2f.gameserver.tables.SkillTable;
  8.  
  9. public class custom extends DefaultAI
  10. {
  11. private int SKILL_ID_1 = 555;
  12. private int i = 1;
  13.  
  14. public custom(NpcInstance actor)
  15. {
  16. super(actor);
  17. }
  18.  
  19.  
  20.  
  21. protected boolean thinkActive()
  22. {
  23. NpcInstance actor = getActor();
  24. if (actor == null)
  25. {
  26. return true;
  27. }
  28. int skillId = SKILL_ID_1;
  29. for (Player player : World.getAroundPlayers(actor, 200, 200))
  30. {
  31. if ((player != null) && (player.isInAnonymousZone()) && (player.getEffectList().getEffectsBySkillId(skillId) == null))
  32. {
  33. while (i < 10)
  34. {
  35. actor.doCast(SkillTable.getInstance().getInfo(skillId, 1), player, true);
  36.  
  37. try {
  38. Thread.sleep(60000); //60000 milliseconds is one minute.
  39. } catch(InterruptedException ex) {
  40. Thread.currentThread().interrupt();
  41. }
  42. i = i + 1;
  43. }
  44. }
  45. }
  46. return false;
  47. }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement