armark1ng

Untitled

Sep 4th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. package com.rs.game.npc.vorago;
  2.  
  3. import com.rs.cache.loaders.AnimationDefinitions;
  4. import com.rs.game.Animation;
  5. import com.rs.game.WorldTile;
  6. import com.rs.game.map.bossInstance.impl.VoragoInstance;
  7. import com.rs.game.npc.NPC;
  8. import com.rs.game.player.Player;
  9. import com.rs.game.tasks.WorldTask;
  10. import com.rs.game.tasks.WorldTasksManager;
  11.  
  12. @SuppressWarnings("serial")
  13. public class VoragoFace extends NPC {
  14.  
  15. private transient VoragoInstance instance;
  16. private boolean battleInGoing;
  17. private boolean transforming;
  18.  
  19. public VoragoFace(int id, WorldTile tile, int mapAreaNameHash, boolean canBeAttackFromOutOfArea,
  20. VoragoInstance instance) {
  21. super(id, tile, mapAreaNameHash, canBeAttackFromOutOfArea);
  22. this.instance = instance;
  23. this.setNextFaceEntity(null);
  24. battleInGoing = false;
  25. transforming = false;
  26. }
  27.  
  28. public boolean isBattleInGoing() {
  29. return battleInGoing;
  30. }
  31.  
  32. public void setBattleInGoing(boolean battleInGoing) {
  33. this.battleInGoing = battleInGoing;
  34. if (battleInGoing)
  35. setNextNPCTransformation(17162);
  36. else
  37. startTransformation(null);
  38. }
  39.  
  40. public VoragoInstance getInstance() {
  41. return instance;
  42. }
  43.  
  44. public boolean isTransforming() {
  45. return transforming;
  46. }
  47.  
  48. public void startTransformation(Player player) {
  49. if (player != null)
  50. player.lock();
  51. setNextAnimation(new Animation(20335));
  52. transforming = true;
  53. WorldTasksManager.schedule(new WorldTask() {
  54. @Override
  55. public void run() {
  56. setNextNPCTransformation(17161);
  57. transforming = false;
  58. if (player != null) {
  59. player.unlock();
  60. player.getDialogueManager().startDialogue("VoragoFaceD", getId(), 0, instance);
  61. }
  62. }
  63. }, (AnimationDefinitions.getAnimationDefinitions(20335).getEmoteClientCycles() / 30));
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment