armark1ng

Untitled

Sep 22nd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. public void expireInvitation() {
  2. if (invitingPlayer == null)
  3. return;
  4. player.getPackets().sendGameMessage(
  5. "Your dungeon party invitation to " + invitingPlayer.getDisplayName() + " has expired.");
  6. invitingPlayer.getPackets()
  7. .sendGameMessage("A dungeon party invitation from " + player.getDisplayName() + " has expired.");
  8. invitingPlayer = null;
  9. }
  10.  
  11. public void enterDungeon(boolean selectSize) {
  12. player.stopAll();
  13. expireInvitation();
  14. if (party == null) {
  15. player.getDialogueManager().startDialogue("DungeonPartyStart");
  16. return;
  17. }
  18. if (party.getDungeon() != null) // cant happen
  19. return;
  20. if (!party.isLeader(player)) {
  21. player.getPackets().sendGameMessage("Only your party's leader can start a dungeon!");
  22. return;
  23. }
  24. if (party.getFloor() == 0) {
  25. changeFloor();
  26. return;
  27. }
  28. if (party.getComplexity() == 0) {
  29. changeComplexity();
  30. return;
  31. }
  32. if (party.getDificulty() == 0) {
  33. if (party.getTeam().size() == 1)
  34. party.setDificulty(1);
  35. else {
  36. player.getDialogueManager().startDialogue("DungeonDificulty", party.getTeam().size());
  37. return;
  38. }
  39. }
  40. boolean solo = party.getTeam().size() == 1;
  41. if (solo)
  42. party.setKeyShare(true);
  43. else if (party.getKeyType() == 0) {
  44. player.getDialogueManager().startDialogue("PreShareD");
  45. return;
  46. }
  47. if (selectSize) {
  48. if (party.getComplexity() == 6) {
  49. player.getDialogueManager().startDialogue("DungeonSize");
  50. return;
  51. } else
  52. party.setSize(DungeonConstants.SMALL_DUNGEON);
  53. }
  54. for (Player p2 : party.getTeam()) {
  55. for (Item item : p2.getInventory().getItems().getItems()) {
  56. if (item != null && item.getId() != 15707) {
  57. player.getPackets().sendGameMessage(
  58. p2.getDisplayName() + " is carrying items that cannot be taken into Daemonheim.");
  59. return;
  60. }
  61. }
  62. /*
  63. * for (Item item : p2.getEquipment().getItems().getItems()) { if
  64. * (item != null && item.getId() != 15707) { player.getPackets()
  65. * .sendGameMessage( p2.getDisplayName() +
  66. * " is carrying items that cannot be taken into Daemonheim.");
  67. * return; } }
  68. */
  69. if (p2.getFamiliar() != null || p2.getPet() != null) {
  70. player.getPackets().sendGameMessage(
  71. p2.getDisplayName() + " is carrying a familiar that cannot be taken into Daemonheim.");
  72. return;
  73. }
  74. if (p2.getPlane() != 0 || p2.getInterfaceManager().containsScreenInter() || p2.isLocked()
  75. || !(p2.getControlerManager().getControler() instanceof Kalaboss)) {
  76. player.getPackets().sendGameMessage(p2.getDisplayName() + " is busy.");
  77. return;
  78. }
  79. }
  80. party.start();
  81. }
  82.  
  83. public void setSize(int size) {
  84. if (party == null || !party.isLeader(player) || party.getComplexity() != 6)
  85. return;
  86. party.setSize(size);
  87. }
  88.  
  89. public void setDificulty(int dificulty) {
  90. if (party == null || !party.isLeader(player))
  91. return;
  92. party.setDificulty(dificulty);
  93. }
  94.  
  95. public void setKeyShare(boolean isKeyShare) {
  96. if (party == null || !party.isLeader(player))
  97. return;
  98. party.setKeyShare(isKeyShare);
  99. }
  100.  
  101. public void resetInvitation() {
  102. if (invitingPlayer == null)
  103. return;
  104. invitingPlayer = null;
  105. }
  106.  
  107. public void refreshNames() {
  108. if (party == null)
  109. return;
  110. int index = 0;
  111. for (Player p2 : party.getTeam())
  112. player.getPackets().sendGlobalString(292 + (index++), p2.getDisplayName());
  113. }
  114.  
  115. public void refreshFloor() {
  116. player.getPackets().sendCSVarInteger(1180, party == null ? 0 : party.getFloor());
  117. }
  118.  
  119. public void refreshComplexity() {
  120. player.getPackets().sendCSVarInteger(1183, party == null ? 0 : party.getComplexity());
  121. }
  122.  
  123. public void refreshCurrentProgress() {
  124. player.getPackets().sendCSVarInteger(1181, getCurrentProgres());
  125. }
  126.  
  127. public void refreshPreviousProgress() {
  128. player.getPackets().sendCSVarInteger(1182, previousProgress);
  129. }
Advertisement
Add Comment
Please, Sign In to add comment