Junior Spellweaver
- Joined
- Sep 20, 2019
- Messages
- 107
- Reaction score
- 8
Hello there!
If you have played or used a HeavenMS source at any point you must have noticed that in FM is Inkwell that offers you some items for Perfect Pitch in exchange.. Well after finish working in some new maps i've added into my HeavenMS source i decided start to work in a new one, and something crossed my mind.. Why not adding a coin currency like perfect pitch? so i started to work on it but didn't ended like i expected, maybe i messed or missed something, i hope someone could help me on this so i'm going to explain what i did step by step.
First i added a new column into the "shopitem" table into my database named "coin" at the side of the "pitch" one and ended like this:
Also as expected, i added the new shop into shop table.. Ok, so good so far, so i went into MapleShop.java and below the perfect pitch code i added a new one copying the one from the perfect pitch i pasted it, adding some changes changing the "getPitch" for "getCoin", so after that and adding some INT needed into the code i went to MapleShopItems.java and added whats needed so both codes ended like this:
MapleShop.java
MapleShopItems.java
But seems like it's not working but whenever i go into the game and tried to open the store, this is what is shown on it:
Literally nothing..
Just in case you're wondering, yes, i added the store items using coin as currency instead mesos or pitch..
So any guidance on this? did i miss something? is it client sided? need some localhost edit?
Thanks in advance, have a good day!
If you have played or used a HeavenMS source at any point you must have noticed that in FM is Inkwell that offers you some items for Perfect Pitch in exchange.. Well after finish working in some new maps i've added into my HeavenMS source i decided start to work in a new one, and something crossed my mind.. Why not adding a coin currency like perfect pitch? so i started to work on it but didn't ended like i expected, maybe i messed or missed something, i hope someone could help me on this so i'm going to explain what i did step by step.
First i added a new column into the "shopitem" table into my database named "coin" at the side of the "pitch" one and ended like this:
![Lichtmager - [HeavenMS] Adding new currency like Perfect Pitch - RaGEZONE Forums Lichtmager - [HeavenMS] Adding new currency like Perfect Pitch - RaGEZONE Forums](https://i.ibb.co/F8DNGB1/coin.png)
Also as expected, i added the new shop into shop table.. Ok, so good so far, so i went into MapleShop.java and below the perfect pitch code i added a new one copying the one from the perfect pitch i pasted it, adding some changes changing the "getPitch" for "getCoin", so after that and adding some INT needed into the code i went to MapleShopItems.java and added whats needed so both codes ended like this:
MapleShop.java
PHP:
} else if (item.getCoin() > 0) {
int amount = (int)Math.min((float) item.getCoin() * quantity, Integer.MAX_VALUE);
if (c.getPlayer().getInventory(MapleInventoryType.ETC).countById(4310010) >= amount) {
if (MapleInventoryManipulator.checkSpace(c, itemId, quantity, "")) {
if (!ItemConstants.isRechargeable(itemId)) {
MapleInventoryManipulator.addById(c, itemId, quantity, "", -1);
MapleInventoryManipulator.removeById(c, MapleInventoryType.ETC, 4310010, amount, false, false);
} else {
short slotMax = ii.getSlotMax(c, item.getItemId());
quantity = slotMax;
MapleInventoryManipulator.addById(c, itemId, quantity, "", -1);
MapleInventoryManipulator.removeById(c, MapleInventoryType.ETC, 4310010, amount, false, false);
}
c.announce(MaplePacketCreator.shopTransaction((byte) 0));
} else
c.announce(MaplePacketCreator.shopTransaction((byte) 3));
}
MapleShopItems.java
PHP:
package server;
/**
*
* @author Matze
*/
public class MapleShopItem {
private short buyable;
private int itemId;
private int price;
private int pitch;
private int coin;
public MapleShopItem(short buyable, int itemId, int price, int pitch, int coin) {
this.buyable = buyable;
this.itemId = itemId;
this.price = price;
this.pitch = pitch;
this.coin = coin;
}
public short getBuyable() {
return buyable;
}
public int getItemId() {
return itemId;
}
public int getPrice() {
return price;
}
public int getPitch() {
return pitch;
}
public int getCoin() {
return coin;
}
}
But seems like it's not working but whenever i go into the game and tried to open the store, this is what is shown on it:
![Lichtmager - [HeavenMS] Adding new currency like Perfect Pitch - RaGEZONE Forums Lichtmager - [HeavenMS] Adding new currency like Perfect Pitch - RaGEZONE Forums](https://i.ibb.co/HdS2D9F/2023-02-21-15-27-29.png)
Literally nothing..
Just in case you're wondering, yes, i added the store items using coin as currency instead mesos or pitch..
So any guidance on this? did i miss something? is it client sided? need some localhost edit?
Thanks in advance, have a good day!
Last edited: