So how would I make a command that a character can toggle on an off and when it is toggled on, items from bosses etc. wont drop for you. But mesos will still drop.
Was thinking of somehow adding an exception to the bossdrops table maybe?
This is for v55 btw, and heres my dropfrommonster from maplemap:
So would I make a dropitems is on check and then if it is just return; or?Code:private void dropFromMonster(MapleCharacter dropOwner, MapleMonster monster) { if (dropsDisabled || (ChannelServer.getInstance(channel).getBossDropRate() <= 0)) { int card = dropOwner.getDropMod(); return; } int maxDrops; MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); final boolean isBoss = monster.isBoss(); if (isBoss) { maxDrops = 8 * ChannelServer.getInstance(channel).getBossDropRate(); } else { maxDrops = 8 * ChannelServer.getInstance(channel).getBossDropRate(); } List<Integer> toDrop = new ArrayList<Integer>(); if (monster.getId() == 9500167) { Random randomInt = new Random(); int chance = randomInt.nextInt(10000); if (chance <= 10) { // 0.1% toDrop.add(4001013); // ItemID } } for (int i = 0; i < maxDrops; i++) { toDrop.add(monster.getDrop()); } Set<Integer> alreadyDropped = new HashSet<Integer>(); for (int i = 0; i < toDrop.size(); i++) { if (toDrop.get(i) == -1) { if (alreadyDropped.contains(-1) && !isBoss) { toDrop.remove(i); i--; } else { alreadyDropped.add(-1); } } else { MapleInventoryType type = ii.getInventoryType(toDrop.get(i)); if (alreadyDropped.contains((int) type.getType()) && !isBoss) { toDrop.remove(i); i--; } else { alreadyDropped.add((int) type.getType()); } } } if (toDrop.size() > maxDrops) { toDrop = toDrop.subList(0, maxDrops); } Point[] toPoint = new Point[toDrop.size()]; int shiftDirection = 0; int shiftCount = 0; int curX = Math.min(Math.max(monster.getPosition().x - 25 * (toDrop.size() / 2), footholds.getMinDropX() + 25), footholds.getMaxDropX() - toDrop.size() * 25); int curY = Math.max(monster.getPosition().y, footholds.getY1()); //int monsterShift = curX - while (shiftDirection < 3 && shiftCount < 1000) { // TODO for real center drop the monster width is needed o.o" if (shiftDirection == 1) { curX += 25; } else if (shiftDirection == 2) { curX -= 25; } // now do it for (int i = 0; i < toDrop.size(); i++) { MapleFoothold wall = footholds.findWall(new Point(curX, curY), new Point(curX + toDrop.size() * 25, curY)); if (wall != null) { //System.out.println("found a wall. wallX " + wall.getX1() + " curX " + curX); if (wall.getX1() < curX) { shiftDirection = 1; shiftCount++; break; } else if (wall.getX1() == curX) { if (shiftDirection == 0) { shiftDirection = 1; } shiftCount++; break; } else { shiftDirection = 2; shiftCount++; break; } } else if (i == toDrop.size() - 1) { //System.out.println("ok " + curX); shiftDirection = 3; } final Point dropPos = calcDropPos(new Point(curX + i * 25, curY), new Point(monster.getPosition())); toPoint[i] = new Point(curX + i * 25, curY); final int drop = toDrop.get(i); if (drop == -1) { // meso final int mesoRate = ChannelServer.getInstance(dropOwner.getClient().getChannel()).getMesoRate(); Random r = new Random(); double mesoDecrease = Math.pow(0.93, monster.getExp() / 300.0); if (mesoDecrease > 1.0) { mesoDecrease = 1.0; } else if (mesoDecrease < 0.001) { mesoDecrease = 0.005; } int tempmeso = Math.min(30000, (int) (mesoDecrease * (monster.getExp()) * (1.0 + r.nextInt(20)) / 10.0)); if (dropOwner.getBuffedValue(MapleBuffStat.MESOUP) != null) { tempmeso = (int) (tempmeso * dropOwner.getBuffedValue(MapleBuffStat.MESOUP).doubleValue() / 100.0); } final int meso = tempmeso; if (meso > 0) { final MapleMonster dropMonster = monster; final MapleCharacter dropChar = dropOwner; TimerManager.getInstance().schedule(new Runnable() { public void run() { spawnMesoDrop(meso * mesoRate, meso, dropPos, dropMonster, dropChar, isBoss); } }, monster.getAnimationTime("die1")); } } else { IItem idrop; MapleInventoryType type = ii.getInventoryType(drop); if (type.equals(MapleInventoryType.EQUIP)) { Equip nEquip = ii.randomizeStats((Equip) ii.getEquipById(drop)); idrop = nEquip; } else { idrop = new Item(drop, (byte) 0, (short) 1); // Randomize quantity for certain items if (ii.isArrowForBow(drop) || ii.isArrowForCrossBow(drop) || ii.isThrowingStar(drop)) { idrop.setQuantity((short) (1 + ii.getSlotMax(drop) * Math.random())); } } StringBuilder logMsg = new StringBuilder("Created as a drop from monster "); logMsg.append(monster.getObjectId()); logMsg.append(" ("); logMsg.append(monster.getId()); logMsg.append(") at "); logMsg.append(dropPos.toString()); logMsg.append(" on map "); logMsg.append(mapid); idrop.log(logMsg.toString(), false); final MapleMapItem mdrop = new MapleMapItem(idrop, dropPos, monster, dropOwner); final MapleMapObject dropMonster = monster; final MapleCharacter dropChar = dropOwner; final TimerManager tMan = TimerManager.getInstance(); activateItemReactors(mdrop); tMan.schedule(new Runnable() { public void run() { spawnAndAddRangedMapObject(mdrop, new DelayedPacketCreation() { public void sendPackets(MapleClient c) { c.getSession().write(MaplePacketCreator.dropItemFromMapObject(drop, mdrop.getObjectId(), dropMonster.getObjectId(), isBoss ? 0 : dropChar.getId(), dropMonster.getPosition(), dropPos, (byte) 1)); } }); tMan.schedule(new ExpireMapItemJob(mdrop), 60000); } }, monster.getAnimationTime("die1")); } } } }





