protected void dispose(boolean warpout) { int chnl = p1.getLeader().getChannel(); ChannelServer cs = ChannelServer.getInstance(chnl); MapleMap out = cs.getMapFactory().getMap(980000000); for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) { MapleCharacter mc; mc = cs.getPlayerStorage().getCharacterByName(mpc.getName()); if (mc != null) { mc.setCpqRanking(getRankByCP(this.redTotalCP)); mc.resetCP(); if (warpout) { mc.changeMap(out, out.getPortal(0)); } } } for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) { MapleCharacter mc; mc = cs.getPlayerStorage().getCharacterByName(mpc.getName()); if (mc != null) { mc.setCpqRanking(getRankByCP(this.blueTotalCP)); mc.resetCP(); if (warpout) { mc.changeMap(out, out.getPortal(0)); } } } timer.cancel(false); effectTimer.cancel(false); redTotalCP = 0; blueTotalCP = 0; leader1.getParty().setEnemy(null); leader2.getParty().setEnemy(null); }
public void finish(int winningTeam) { int chnl = leader1.getClient().getChannel(); int chnl1 = leader2.getClient().getChannel(); if (chnl != chnl1) throw new RuntimeException("CPQ leaders are on different channels.."); ChannelServer cs = ChannelServer.getInstance(chnl); if (winningTeam == 0) { for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) { MapleCharacter mc; mc = cs.getPlayerStorage().getCharacterByName(mpc.getName()); if (mc != null) { mc.setCpqRanking(getRankByCP(this.redTotalCP)); mc.changeMap( cs.getMapFactory().getMap(map.getId() + 2), cs.getMapFactory().getMap(map.getId() + 2).getPortal(0)); mc.setTeam(-1); } } for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) { MapleCharacter mc; mc = cs.getPlayerStorage().getCharacterByName(mpc.getName()); if (mc != null) { mc.setCpqRanking(getRankByCP(this.blueTotalCP)); mc.changeMap( cs.getMapFactory().getMap(map.getId() + 3), cs.getMapFactory().getMap(map.getId() + 3).getPortal(0)); mc.setTeam(-1); } } } else if (winningTeam == 1) { for (MaplePartyCharacter mpc : leader2.getParty().getMembers()) { MapleCharacter mc; mc = cs.getPlayerStorage().getCharacterByName(mpc.getName()); if (mc != null) { mc.changeMap( cs.getMapFactory().getMap(map.getId() + 2), cs.getMapFactory().getMap(map.getId() + 2).getPortal(0)); mc.setTeam(-1); } } for (MaplePartyCharacter mpc : leader1.getParty().getMembers()) { MapleCharacter mc; mc = cs.getPlayerStorage().getCharacterByName(mpc.getName()); if (mc != null) { mc.changeMap( cs.getMapFactory().getMap(map.getId() + 3), cs.getMapFactory().getMap(map.getId() + 3).getPortal(0)); mc.setTeam(-1); } } } dispose(); }