- UID
- 5321
- 閱讀權限
- 10
- 主題
- 64
- 帖子
- 114
- 精華
- 1
- A幣
- 15
- 在線時間
- 92 小時
- 最後登錄
- 2017-2-3
集團新軍
- 主題
- 64
- 帖子
- 114
- 精華
- 1
- 綜合社群主題發文量
- 0
- 電玩社群主題發文量
- 0
- 娛樂社群主題發文量
- 0
- 技術社群主題發文量
- 0
- 閱讀權限
- 10
- 註冊時間
- 2016-11-17
TA的每日心情 | 衰 2017-2-1 17:20 |
---|
簽到天數: 63 天 連續簽到: 0 天 [LV.6]常住居民II
|
以下是我從 MapleMap.Class 提取出的全地圖物品掉落
以下兩個代碼 分別是 黃金楓葉和 黃色甚麼蛋的
但是我還是沒有找到 楓葉的掉落 到底存在哪裏
希望有可以分享一下 ^^
這些代碼 之後我會找機會大概講解一下
- private void dropFromMonster(MapleCharacter dropOwner, MapleMonster monster)
- {
- if ((this.dropsDisabled) || (monster.dropsDisabled())) {
- return;
- }
- final boolean explosive = monster.isExplosive();
- MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
- boolean isBoss = monster.isBoss();
- ChannelServer cserv = dropOwner.getClient().getChannelServer();
- int maxDrops;
- int maxDrops;
- if (explosive) {
- maxDrops = 10 * cserv.getBossDropRate();
- } else {
- maxDrops = 4 * cserv.getDropRate();
- }
- List<Integer> toDrop = new ArrayList();
- for (int i = 0; i < maxDrops; i++) {
- toDrop.add(Integer.valueOf(monster.getDrop()));
- }
- if (dropOwner.getEventInstance() == null)
- {
- Random randomInt = new Random();
- int chance = randomInt.nextInt(100);
- if (chance <= 10) {
- toDrop.add(Integer.valueOf(4000313));
- }
- }
- if (dropOwner.getEventInstance() == null)
- {
- Random randomInt = new Random();
- int chance = randomInt.nextInt(100);
- if (chance <= 10) {
- toDrop.add(Integer.valueOf(2022065));
- }
- }
- Set<Integer> alreadyDropped = new HashSet();
- byte htpendants = 0;byte htstones = 0;byte mesos = 0;
- for (int i = 0; i < toDrop.size(); i++) {
- if (((Integer)toDrop.get(i)).intValue() == -1)
- {
- if (!isPQMap()) {
- if (alreadyDropped.contains(Integer.valueOf(-1)))
- {
- if (!explosive)
- {
- toDrop.remove(i);
- i--;
- }
- else if (mesos < 9)
- {
- mesos = (byte)(mesos + 1);
- }
- else
- {
- toDrop.remove(i);
- i--;
- }
- }
- else {
- alreadyDropped.add(Integer.valueOf(-1));
- }
- }
- }
- else if ((alreadyDropped.contains(toDrop.get(i))) && (!explosive))
- {
- toDrop.remove(i);
- i--;
- }
- else
- {
- if (((Integer)toDrop.get(i)).intValue() == 2041200)
- {
- if (htstones > 2)
- {
- toDrop.remove(i);
- i--;
- continue;
- }
- htstones = (byte)(htstones + 1);
- }
- else if (((Integer)toDrop.get(i)).intValue() == 1122000)
- {
- if (htstones > 2)
- {
- toDrop.remove(i);
- i--;
- continue;
- }
- htpendants = (byte)(htpendants + 1);
- }
- alreadyDropped.add(toDrop.get(i));
- }
- }
- if (toDrop.size() > maxDrops) {
- toDrop = toDrop.subList(0, maxDrops);
- }
- if ((mesos < 7) && (explosive)) {
- for (int i = mesos; i < 7; i++) {
- toDrop.add(Integer.valueOf(-1));
- }
- }
- int shiftDirection = 0;
- int shiftCount = 0;
- int curX = Math.min(Math.max(monster.getPosition().x - 25 * (toDrop.size() / 2), this.footholds.getMinDropX() + 25), this.footholds.getMaxDropX() - toDrop.size() * 25);
- int curY = Math.max(monster.getPosition().y, this.footholds.getY1());
- while ((shiftDirection < 3) && (shiftCount < 1000))
- {
- if (shiftDirection == 1) {
- curX += 25;
- } else if (shiftDirection == 2) {
- curX -= 25;
- }
- for (int i = 0; i < toDrop.size(); i++)
- {
- MapleFoothold wall = this.footholds.findWall(new Point(curX, curY), new Point(curX + toDrop.size() * 25, curY));
- if (wall != null)
- {
- if (wall.getX1() < curX)
- {
- shiftDirection = 1;
- shiftCount++;
- break;
- }
- if (wall.getX1() == curX)
- {
- if (shiftDirection == 0) {
- shiftDirection = 1;
- }
- shiftCount++;
- break;
- }
- shiftDirection = 2;
- shiftCount++;
- break;
- }
- if (i == toDrop.size() - 1) {
- shiftDirection = 3;
- }
- final Point dropPos = calcDropPos(new Point(curX + i * 25, curY), new Point(monster.getPosition()));
- final int drop = ((Integer)toDrop.get(i)).intValue();
- if (drop == -1)
- {
- if (monster.isBoss())
- {
- final int cc = ChannelServer.getInstance(dropOwner.getClient().getChannel()).getMesoRate() + 25;
- final MapleMonster dropMonster = monster;
- Random r = new Random();
- double mesoDecrease = Math.pow(0.9300000000000001D, monster.getExp() / 300.0D);
- if (mesoDecrease > 1.0D) {
- mesoDecrease = 1.0D;
- } else if (mesoDecrease < 0.001D) {
- mesoDecrease = 0.005D;
- }
- int tempmeso = Math.min(30000, (int)(mesoDecrease * monster.getExp() * (1.0D + r.nextInt(20)) / 10.0D));
- if (dropOwner.getBuffedValue(MapleBuffStat.MESOUP) != null) {
- tempmeso = (int)(tempmeso * dropOwner.getBuffedValue(MapleBuffStat.MESOUP).doubleValue() / 100.0D);
- }
- final int dmesos = tempmeso;
- if (dmesos > 0)
- {
- final MapleCharacter dropChar = dropOwner;
- final boolean publicLoott = isPQMap();
- TimerManager.getInstance().schedule(new Runnable()
- {
- public void run()
- {
- MapleMap.this.spawnMesoDrop(dmesos * cc, dmesos, dropPos, dropMonster, dropChar, (explosive) || (publicLoott));
- }
- }, monster.getAnimationTime("die1"));
- }
- }
- else
- {
- final int mesoRate = ChannelServer.getInstance(dropOwner.getClient().getChannel()).getMesoRate();
- Random r = new Random();
- double mesoDecrease = Math.pow(0.9300000000000001D, monster.getExp() / 300.0D);
- if (mesoDecrease > 1.0D) {
- mesoDecrease = 1.0D;
- }
- int tempmeso = Math.min(30000, (int)(mesoDecrease * monster.getExp() * (1.0D + r.nextInt(20)) / 10.0D));
- if (dropOwner.getBuffedValue(MapleBuffStat.MESOUP) != null) {
- tempmeso = (int)(tempmeso * dropOwner.getBuffedValue(MapleBuffStat.MESOUP).doubleValue() / 100.0D);
- }
- final int meso = tempmeso;
- if (meso > 0)
- {
- MapleMonster dropMonster = monster;
- final MapleCharacter dropChar = dropOwner;
- boolean publicLoott = isPQMap();
- TimerManager.getInstance().schedule(new Runnable()
- {
- public void run()
- {
- dropChar.gainMeso(meso * mesoRate, true, true);
- }
- }, monster.getAnimationTime("die1"));
- }
- }
- }
- else
- {
- MapleInventoryType type = ii.getInventoryType(drop);
- IItem idrop;
- IItem idrop;
- if (type.equals(MapleInventoryType.EQUIP))
- {
- Equip nEquip = ii.randomizeStats(dropOwner.getClient(), (Equip)ii.getEquipById(drop));
- idrop = nEquip;
- }
- else
- {
- idrop = new Item(drop, (byte)0, (short)1);
- if ((ii.isArrowForBow(drop)) || (ii.isArrowForCrossBow(drop)))
- {
- if (dropOwner.getJob().getId() / 100 == 3) {
- idrop.setQuantity((short)(int)(1.0D + 100.0D * Math.random()));
- }
- }
- else if ((ii.isThrowingStar(drop)) || (ii.isBullet(drop))) {
- idrop.setQuantity((short)1);
- }
- }
- final MapleMapItem mdrop = new MapleMapItem(idrop, dropPos, monster, dropOwner);
- final MapleMapObject dropMonster = monster;
- final MapleCharacter dropChar = dropOwner;
- final TimerManager tMan = TimerManager.getInstance();
- tMan.schedule(new Runnable()
- {
- public void run()
- {
- MapleMap.this.spawnAndAddRangedMapObject(mdrop, new MapleMap.DelayedPacketCreation()
- {
- public void sendPackets(MapleClient c)
- {
- c.getSession().write(MaplePacketCreator.dropItemFromMapObject(MapleMap.3.this.val$drop, MapleMap.3.this.val$mdrop.getObjectId(), MapleMap.3.this.val$dropMonster.getObjectId(), MapleMap.3.this.val$explosive ? 0 : MapleMap.3.this.val$dropChar.getId(), MapleMap.3.this.val$dropMonster.getPosition(), MapleMap.3.this.val$dropPos, (byte)1));
- }
- }, null);
-
- tMan.schedule(new MapleMap.ExpireMapItemJob(MapleMap.this, mdrop), MapleMap.this.dropLife);
- }
- }, monster.getAnimationTime("die1"));
- }
- }
- }
- }
複製代碼
|
|