/** Method runImpl. */ @Override protected void runImpl() { Player activeChar = getClient().getActiveChar(); if (activeChar == null) { return; } if (!activeChar.isInStoreMode() || (activeChar.getPrivateStoreType() != Player.STORE_PRIVATE_BUY)) { activeChar.sendActionFailed(); return; } activeChar.setPrivateStoreType(Player.STORE_PRIVATE_NONE); activeChar.standUp(); activeChar.broadcastCharInfo(); }
@Override public void dropItem(Player player, ItemInstance item, long count, Location loc) { if (item.isEquipped()) { player.getInventory().unEquipItem(item); player.sendUserInfo(); } item = player.getInventory().removeItemByObjectId(item.getObjectId(), count); if (item == null) { player.sendActionFailed(); return; } Log.LogItem(player, Log.Drop, item); item.dropToTheGround(player, loc); player.disableDrop(1000); player.sendChanges(); }
/** Method runImpl. */ @Override protected void runImpl() { Player activeChar = getClient().getActiveChar(); if (activeChar == null) { return; } if ((_page < 0) || (_page > ShortCut.PAGE_MAX)) { activeChar.sendActionFailed(); return; } ShortCut shortCut = new ShortCut(_slot, _page, _type, _id, _lvl, _characterType); activeChar.sendPacket(new ShortCutRegister(activeChar, shortCut)); activeChar.registerShortCut(shortCut); }
/** 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(); } }
/** * Method getRaceSkill. * * @param player Player * @return null */ public Skill getRaceSkill(Player player) { int race = player.getRace().ordinal(); Skill skill = null; if (player.getClassId().isOfLevel(ClassLevel.Fourth)) { switch (race) { case 0: skill = SkillTable.getInstance().getInfo(248, 6); player.addSkill(skill); break; case 1: skill = SkillTable.getInstance().getInfo(248, 6); player.addSkill(skill); break; case 2: skill = SkillTable.getInstance().getInfo(248, 6); player.addSkill(skill); break; case 3: skill = SkillTable.getInstance().getInfo(248, 6); player.addSkill(skill); break; case 4: skill = SkillTable.getInstance().getInfo(248, 6); player.addSkill(skill); break; case 5: skill = SkillTable.getInstance().getInfo(248, 6); player.addSkill(skill); } } else { player.sendActionFailed(); } player.updateStats(); return null; }