@Override public void onEventEnd() { if (NexusLoader.detailedDebug) { this.print("Event: onEventEnd()"); } for (Deathmatch.DMEventInstance match : this._matches.values()) { if (!this.getEventData(match.getInstance().getId()).isActive()) continue; this.endRoundDueToEventTimeLimit(match.getInstance().getId(), true); } super.onEventEnd(); }
@Override public String getEstimatedTimeLeft() { if (this._matches == null) { return "Starting"; } for (Deathmatch.DMEventInstance match : this._matches.values()) { if (!this.getEventData(match.getInstance().getId())._isActive) continue; return "+-" + (this._maxRounds - this.getEventData(match.getInstance().getId())._round + 1) + " rounds"; } return null; }
@Override public synchronized void clearEvent(int instanceId) { if (NexusLoader.detailedDebug) { this.print("Event: called CLEAREVENT for instance " + instanceId); } try { if (this._matches != null) { for (Deathmatch.DMEventInstance match : this._matches.values()) { if (instanceId != 0 && instanceId != match.getInstance().getId()) continue; match.abort(); } } } catch (Exception e) { e.printStackTrace(); } for (PlayerEventInfo player : this.getPlayers(instanceId)) { if (!player.isOnline()) continue; if (player.hasAntifeedProtection()) { player.stopAntifeedProtection(false); } if (player.isParalyzed()) { player.setIsParalyzed(false); player.paralizeEffect(false); } player.setIsInvul(false); player.removeRadarAllMarkers(); if (player.isImmobilized()) { player.unroot(); } if (!player.isGM()) { player.setIsInvul(false); } player.setInstanceId(0); if (this._removeBuffsOnEnd) { player.removeBuffs(); } player.restoreData(); player.teleport(player.getOrigLoc(), 0, true, 0); player.sendMessage(LanguageEngine.getMsg("event_teleportBack")); if (player.getParty() != null) { PartyData party = player.getParty(); party.removePartyMember(player); } player.broadcastUserInfo(); } this.clearPlayers(true, instanceId); }
@Override public synchronized void clearEvent() { if (NexusLoader.detailedDebug) { this.print("Event: called global clearEvent()"); } try { if (this._matches != null) { for (Deathmatch.DMEventInstance match : this._matches.values()) { if (!this.getEventData(match.getInstance().getId()).isActive()) continue; this.endRoundDueToEventTimeLimit(match.getInstance().getId(), true); } } } catch (Exception e) { // empty catch block } this.clearEvent(0); }