コード例 #1
0
 /** Method setUpPlayers. */
 private void setUpPlayers() {
   HandysBlockCheckerManager.getInstance().setArenaBeingUsed(_arena);
   _redPoints = _spawns.size() / 2;
   _bluePoints = _spawns.size() / 2;
   final ExCubeGameChangePoints initialPoints =
       new ExCubeGameChangePoints(300, _bluePoints, _redPoints);
   ExCubeGameExtendedChangePoints clientSetUp;
   for (Player player : _holder.getAllPlayers()) {
     if (player == null) {
       continue;
     }
     player.addListener(_listener);
     boolean isRed = _holder.getRedPlayers().contains(player);
     clientSetUp =
         new ExCubeGameExtendedChangePoints(300, _bluePoints, _redPoints, isRed, player, 0);
     player.sendPacket(clientSetUp);
     player.sendActionFailed();
     int tc = _holder.getPlayerTeam(player) * 2;
     int x = _arenaCoordinates[_arena][tc];
     int y = _arenaCoordinates[_arena][tc + 1];
     player.teleToLocation(x, y, _zCoord);
     if (isRed) {
       _redTeamPoints.put(player, 0);
       player.setTeam(TeamType.RED);
     } else {
       _blueTeamPoints.put(player, 0);
       player.setTeam(TeamType.BLUE);
     }
     player.getEffectList().stopAllEffects();
     for (Summon summon : player.getSummonList()) {
       summon.unSummon();
     }
     _freeze.getEffects(player, player, false, false);
     if (_holder.getPlayerTeam(player) == 0) {
       _transformationRed.getEffects(player, player, false, false);
     } else {
       _transformationBlue.getEffects(player, player, false, false);
     }
     player.setBlockCheckerArena((byte) _arena);
     player.sendPacket(initialPoints);
     player.sendPacket(_closeUserInterface);
     player.sendPacket(new ExBasicActionList(player));
     broadcastRelationChanged(player);
     player.broadcastCharInfo();
   }
 }
コード例 #2
0
 /**
  * Method onPlayerExit.
  *
  * @param player Player
  * @see lineage2.gameserver.listener.actor.player.OnPlayerExitListener#onPlayerExit(Player)
  */
 @Override
 public void onPlayerExit(final Player player) {
   if (player.getBlockCheckerArena() < 0) {
     return;
   }
   _isExit = true;
   player.teleToLocation(-57478, -60367, -2370);
   player.setTransformation(0);
   player.getEffectList().stopAllEffects();
   int arena = player.getBlockCheckerArena();
   int team = HandysBlockCheckerManager.getInstance().getHolder(arena).getPlayerTeam(player);
   HandysBlockCheckerManager.getInstance().removePlayer(player, arena, team);
   player.setTeam(TeamType.NONE);
   player.broadcastCharInfo();
   PcInventory inv = player.getInventory();
   inv.destroyItemByItemId(13787, inv.getCountOf(13787));
   inv.destroyItemByItemId(13788, inv.getCountOf(13788));
 }
コード例 #3
0
 /** Method setPlayersBack. */
 private void setPlayersBack() {
   final ExCubeGameEnd end = new ExCubeGameEnd(_isRedWinner);
   for (Player player : _holder.getAllPlayers()) {
     if (player == null) {
       continue;
     }
     player.getEffectList().stopAllEffects();
     player.setTeam(TeamType.NONE);
     player.setBlockCheckerArena(DEFAULT_ARENA);
     PcInventory inv = player.getInventory();
     inv.destroyItemByItemId(13787, inv.getCountOf(13787));
     inv.destroyItemByItemId(13788, inv.getCountOf(13788));
     broadcastRelationChanged(player);
     player.teleToLocation(-57478, -60367, -2370);
     player.sendPacket(end);
     player.broadcastCharInfo();
   }
 }