- UID
- 72773
- 閱讀權限
- 20
- 主題
- 13
- 帖子
- 69
- 精華
- 5
- A幣
- 216
- 在線時間
- 163 小時
- 最後登錄
- 2024-11-22
初窺門道
- 主題
- 13
- 帖子
- 69
- 精華
- 5
- 綜合社群主題發文量
- 0
- 電玩社群主題發文量
- 0
- 娛樂社群主題發文量
- 0
- 技術社群主題發文量
- 13
- 閱讀權限
- 20
- 註冊時間
- 2019-8-9
TA的每日心情 | 衰 2021-6-8 20:12 |
---|
簽到天數: 14 天 連續簽到: 0 天 [LV.3]偶爾看看II
|
嗨 又是我目前已知 GMSv111 GMSv117
兩個版本都會有這問題
問題點:
將儲值滿的飛鏢或是子彈賣到商店後 可以用極低的價格回購
也就是花費1個的價錢 即可回購一整組
一樣懶的廢話 直接上教學
首先打開你的IDE
找到MapleShop.java
搜尋
- if (GameConstants.isThrowingStar(item.getItemId()) || GameConstants.isBullet(item.getItemId())) {
複製代碼 之後會得到大概這樣的內容
- double price;
- if (GameConstants.isThrowingStar(item.getItemId()) || GameConstants.isBullet(item.getItemId())) {
- price = ii.getWholePrice(item.getItemId()) / (double) ii.getSlotMax(item.getItemId());
- } else {
- price = ii.getPrice(item.getItemId());
- }
- final int recvMesos = (int) Math.max(Math.ceil(price * quantity), 0);
- if (price != -1.0 && recvMesos > 0) {
- c.getPlayer().gainMeso(recvMesos, false);
- }
- c.getSession().write(NPCPacket.confirmShopTransaction((byte) 0x4, this, c, -1));
- }
- }
複製代碼 將這整段直接替換成
- double price;
- if (GameConstants.isThrowingStar(item.getItemId()) || GameConstants.isBullet(item.getItemId())) {
- price = ii.getPrice(item.getItemId()) * (double) quantity;//飛鏢 子彈計算方式
- } else {
- price = ii.getPrice(item.getItemId());
- }
- final int recvMesos = (int) Math.max(Math.ceil(price * quantity), 0);
- final int recvMesos2 = (int) Math.max(Math.ceil(price + ii.getWholePrice(item.getItemId())), 0);//對應飛鏢 子彈售出價格
- if (price != -1.0 && recvMesos > 0 && GameConstants.isThrowingStar(item.getItemId()) || price != -1.0 && recvMesos > 0 && GameConstants.isBullet(item.getItemId())) {
- c.getPlayer().gainMeso(recvMesos2, false);
- } else {
- c.getPlayer().gainMeso(recvMesos, false);
- }
- c.getSession().write(NPCPacket.confirmShopTransaction((byte) 0x4, this, c, -1));
- }
- }
複製代碼 往下搜尋- final Item i = c.getPlayer().getRebuy().get(index);
複製代碼 會得到大概這樣
- if (index >= 0) {
- final Item i = c.getPlayer().getRebuy().get(index);
- final int price = (int) Math.max(Math.ceil(ii.getPrice(itemId) * (GameConstants.isRechargable(itemId) ? 1 : i.getQuantity())), 0);
- if (price >= 0 && c.getPlayer().getMeso() >= price) {
- if (MapleInventoryManipulator.checkSpace(c, itemId, i.getQuantity(), i.getOwner())) {
- c.getPlayer().gainMeso(-price, false);
- MapleInventoryManipulator.addbyItem(c, i);
- c.getPlayer().getRebuy().remove(index);
- c.getSession().write(NPCPacket.confirmShopTransaction((byte) 0, this, c, x));
- } else {
- c.getPlayer().dropMessage(1, "Your inventory is full.");
- c.getSession().write(NPCPacket.confirmShopTransaction((byte) 0, this, c, -1));
- }
- } else {
- c.getSession().write(NPCPacket.confirmShopTransaction((byte) 0, this, c, -1));
- }
- return;
- }
複製代碼
一樣將這整段替換為
- if (index >= 0) {
- final Item i = c.getPlayer().getRebuy().get(index);
- final int price = (int) Math.max(Math.ceil(ii.getPrice(itemId) * (GameConstants.isRechargable(itemId) ? 1 : i.getQuantity())), 0);
- final int price2 = (int) Math.max(Math.ceil(ii.getPrice(itemId) * i.getQuantity() + ii.getWholePrice(itemId)) ,0);
- if (price >= 0 && c.getPlayer().getMeso() >= price) {
- if (MapleInventoryManipulator.checkSpace(c, itemId, i.getQuantity(), i.getOwner()) && GameConstants.isRechargable(itemId) || MapleInventoryManipulator.checkSpace(c, itemId, i.getQuantity(), i.getOwner()) && GameConstants.isBullet(itemId) ) {
- c.getPlayer().gainMeso(-price2, false);
- MapleInventoryManipulator.addbyItem(c, i);
- c.getPlayer().getRebuy().remove(index);
- c.getSession().write(NPCPacket.confirmShopTransaction((byte) 0, this, c, x));
- } else if (MapleInventoryManipulator.checkSpace(c, itemId, i.getQuantity(), i.getOwner())) {
- c.getPlayer().gainMeso(-price, false);
- MapleInventoryManipulator.addbyItem(c, i);
- c.getPlayer().getRebuy().remove(index);
- c.getSession().write(NPCPacket.confirmShopTransaction((byte) 0, this, c, x));
- } else {
- c.getPlayer().dropMessage(1, "你的背包已滿");
- c.getSession().write(NPCPacket.confirmShopTransaction((byte) 0, this, c, -1));
- }
- } else {
- c.getSession().write(NPCPacket.confirmShopTransaction((byte) 0, this, c, -1));
- }
- return;
- }
複製代碼 編譯後 飛鏢跟子彈的販賣及回購價格就會正常了
|
|