Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[HeavenMS] Adding new currency like Perfect Pitch

Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
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:

Lichtmager - [HeavenMS] Adding new currency like Perfect Pitch - RaGEZONE Forums


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


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:
RaGEZONE VIP
[VIP] Member
Joined
Apr 4, 2008
Messages
19
Reaction score
1
You're limited to a single currency for your shops* pre-bigbang unless you do multiple client edits.

You can do a scripted NPC that mimics a shop instead if you don't want to mess with the client but it doesn't look as good.
 
Last edited:
Upvote 0
Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
Reaction score
8
You're limited to a single currency for your shops* pre-bigbang unless you do multiple client edits.

You can do a scripted NPC that mimics a shop instead if you don't want to mess with the client but it doesn't look as good.

I was 90% sure it needed a client edit, but my hopes were up lol.

Do you happen to know the script of the NPC you just mentioned? or where i can find one to start with?



Ohhh you mean a NPC like Agent E! So dumb me. I see, well thats what i'm gonna do at the end, sadly. Thank you so much for the confirmation of what i suspected. Ty
 
Upvote 0
Back
Top