- UID
- 286271
- 帖子
- 42
- 主題
- 31
- 精華
- 0
- 積分
- 31
- 楓幣
- 507
- 威望
- 31
- 存款
- 0
- 贊助金額
- 0
- 推廣
- 0
- GP
- 31
- 閱讀權限
- 10
- 性別
- 保密
- 在線時間
- 2 小時
- 註冊時間
- 2020-7-12
- 最後登入
- 2021-4-13
|
进入MaplePlayerShop.java
找到public void buy(MapleClient c, int item, short quantity) {,下面的直接替换,可以解决掉复制和钱超过21亿后的BUG。
public void buy(MapleClient c, int item, short quantity) {
if (isVisitor(c.getPlayer())) {
MaplePlayerShopItem pItem = items.get(item);
owner = this.getOwner();
synchronized (c.getPlayer()) {
IItem newItem = pItem.getItem().copy();
newItem.setQuantity((short) (newItem.getQuantity() * quantity));
if (c.getPlayer().getMeso() >= pItem.getPrice() && owner.getMeso()+pItem.getPrice() < 2100000000){ //判断是否有足够的金币购买,且卖家钱不超21E。
c.getPlayer().gainMeso(-pItem.getPrice() * quantity, true);
owner.gainMeso(pItem.getPrice() * quantity, true);
MapleInventoryManipulator.addFromDrop(c, newItem, "");
pItem.setBundles((short) (pItem.getBundles() - quantity));
}else{
c.getSession().write(MaplePacketCreator.serverNotice(1, "你的金币不足,或者是对方金币总量已达到最高限额!."));
MaplePlayerShop shop = owner.getPlayerShop();
shop.removeVisitor(c.getPlayer());
c.getPlayer().changeMap(c.getPlayer().getMap(), c.getPlayer().getPosition());//将人物传开,避免卡号的问题
}
}
}
}
还有就是在这里可以复制标类物品,我个人的解决办法是,直接屏蔽掉》
进入PlayerInteractionHandler.java
找到:
MaplePlayerShopItem item = new MaplePlayerShopItem(
shop, sellItem, bundles, price);
在下面添加:
if (sellItem.getItemId() >=2070000 && sellItem.getItemId() <=2070017){
c.getSession().write(MaplePacketCreator.serverNotice(1, "发现你放标类物品在商店里面,所\n\r以进行没收处理!."));
}else{
shop.addItem(item);
}
|
|