Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void expireInvitation() {
- if (invitingPlayer == null)
- return;
- player.getPackets().sendGameMessage(
- "Your dungeon party invitation to " + invitingPlayer.getDisplayName() + " has expired.");
- invitingPlayer.getPackets()
- .sendGameMessage("A dungeon party invitation from " + player.getDisplayName() + " has expired.");
- invitingPlayer = null;
- }
- public void enterDungeon(boolean selectSize) {
- player.stopAll();
- expireInvitation();
- if (party == null) {
- player.getDialogueManager().startDialogue("DungeonPartyStart");
- return;
- }
- if (party.getDungeon() != null) // cant happen
- return;
- if (!party.isLeader(player)) {
- player.getPackets().sendGameMessage("Only your party's leader can start a dungeon!");
- return;
- }
- if (party.getFloor() == 0) {
- changeFloor();
- return;
- }
- if (party.getComplexity() == 0) {
- changeComplexity();
- return;
- }
- if (party.getDificulty() == 0) {
- if (party.getTeam().size() == 1)
- party.setDificulty(1);
- else {
- player.getDialogueManager().startDialogue("DungeonDificulty", party.getTeam().size());
- return;
- }
- }
- boolean solo = party.getTeam().size() == 1;
- if (solo)
- party.setKeyShare(true);
- else if (party.getKeyType() == 0) {
- player.getDialogueManager().startDialogue("PreShareD");
- return;
- }
- if (selectSize) {
- if (party.getComplexity() == 6) {
- player.getDialogueManager().startDialogue("DungeonSize");
- return;
- } else
- party.setSize(DungeonConstants.SMALL_DUNGEON);
- }
- for (Player p2 : party.getTeam()) {
- for (Item item : p2.getInventory().getItems().getItems()) {
- if (item != null && item.getId() != 15707) {
- player.getPackets().sendGameMessage(
- p2.getDisplayName() + " is carrying items that cannot be taken into Daemonheim.");
- return;
- }
- }
- /*
- * for (Item item : p2.getEquipment().getItems().getItems()) { if
- * (item != null && item.getId() != 15707) { player.getPackets()
- * .sendGameMessage( p2.getDisplayName() +
- * " is carrying items that cannot be taken into Daemonheim.");
- * return; } }
- */
- if (p2.getFamiliar() != null || p2.getPet() != null) {
- player.getPackets().sendGameMessage(
- p2.getDisplayName() + " is carrying a familiar that cannot be taken into Daemonheim.");
- return;
- }
- if (p2.getPlane() != 0 || p2.getInterfaceManager().containsScreenInter() || p2.isLocked()
- || !(p2.getControlerManager().getControler() instanceof Kalaboss)) {
- player.getPackets().sendGameMessage(p2.getDisplayName() + " is busy.");
- return;
- }
- }
- party.start();
- }
- public void setSize(int size) {
- if (party == null || !party.isLeader(player) || party.getComplexity() != 6)
- return;
- party.setSize(size);
- }
- public void setDificulty(int dificulty) {
- if (party == null || !party.isLeader(player))
- return;
- party.setDificulty(dificulty);
- }
- public void setKeyShare(boolean isKeyShare) {
- if (party == null || !party.isLeader(player))
- return;
- party.setKeyShare(isKeyShare);
- }
- public void resetInvitation() {
- if (invitingPlayer == null)
- return;
- invitingPlayer = null;
- }
- public void refreshNames() {
- if (party == null)
- return;
- int index = 0;
- for (Player p2 : party.getTeam())
- player.getPackets().sendGlobalString(292 + (index++), p2.getDisplayName());
- }
- public void refreshFloor() {
- player.getPackets().sendCSVarInteger(1180, party == null ? 0 : party.getFloor());
- }
- public void refreshComplexity() {
- player.getPackets().sendCSVarInteger(1183, party == null ? 0 : party.getComplexity());
- }
- public void refreshCurrentProgress() {
- player.getPackets().sendCSVarInteger(1181, getCurrentProgres());
- }
- public void refreshPreviousProgress() {
- player.getPackets().sendCSVarInteger(1182, previousProgress);
- }
Advertisement
Add Comment
Please, Sign In to add comment