modifyNX()

Status
Not open for further replies.
Joined
Nov 30, 2007
Messages
511
Reaction score
0
In NPCConversationManager, before the last '}' bracket:

Example cm.modifyNX(133337, 0);
Gives me 133,337 NX cash.

PHP:
        public void modifyNX(int amount, int type) {
            getPlayer().modifyCSPoints(type, amount);
            if (amount > 0) {
                        getClient().getSession().write(MaplePacketCreator.serverNotice(5, "You have gained NX Cash (+" + amount +")."));
                 } else { 
                        getClient().getSession().write(MaplePacketCreator.serverNotice(5, "You have lost NX Cash (" + (amount) +")."));           
                 }
        }

'Credits', I guess, would go to me.
 
Last edited:
Re: [Release] modifyNX()

what does it do?
If you've got Penguin's BETA Cash Shop, it can be used to give or take away from a player's total NX cash, and gives them a message in the chat box telling them how much they've gained or lost. It can be used in NPC scripts if you're wondering. Place it in AbstractPlayerInteraction.java and it can be used for portal, events, etc. scripts.
 
Re: [Release] modifyNX()

To sum up what she said, modifyNX() can now be used in NPCs to easily give out nx.
 
Re: [Release] modifyNX()

Looks like a fancy version of mine. :3 Nice.
It would look like that no matter what. I actually saw yours and realized that it didn't have the little bit my function had with the client message so I decided to just go ahead and release what I had.
 
Re: [Release] modifyNX()

It would look like that no matter what. I actually saw yours and realized that it didn't have the little bit my function had with the client message so I decided to just go ahead and release what I had.
All in all, it's a good addition. I'll probably add the server message to mine, since my short attention span makes me think "modify" will change it to a set number, instead of gaining or losing.
 
All in all, it's a good addition. I'll probably add the server message to mine, since my short attention span makes me think "modify" will change it to a set number, instead of gaining or losing.
Alright then, have fun.

You have gained Post Count (+1).

Bump?
 
Last edited by a moderator:
Re: [Release] modifyNX()

So now in our NPC codes we can put:
Code:
modifyNX(5000)
To give 5000NX?
Don't forget the cm. before the function name.

An example of modifyNX's usage:

cm.sendOk("Ah, you've gotten the special item for me! Here's your 5,000 NX Cash as promised!");
cm.modifyNX(5000);

Or, if you're subtracting NX:
cm.sendOk("Wrong answer, you lose 5,000 NX Cash!");
cm.modifyNX(-5000);

Both would invoke the message "You have gained/lost NX Cash (+/- 5000)." in the player's chatbox.
 
Re: [Release] modifyNX()

Silly extra work for the same result minus the player notice.

;)

Same result?
Lets see,

originalnx = 10000;
using your method and try adding 10000 to originalnx;
originalnx = 10000;

using my method and try adding 10000 to originalnx;
originalnx = 20000;

Please learn basic math, before contradicting.
 
Re: [Release] modifyNX()

Same result?
Lets see,

originalnx = 10000;
using your method and try adding 10000 to originalnx;
originalnx = 10000;

using my method and try adding 10000 to originalnx;
originalnx = 20000;

Please learn basic math, before contradicting.
That's true.
iGoofy's
Code:
getPlayer().modifyCSPoints(type, amount);
just makes it so that it's a set amount. Yours checks to see what the current is, and then it adds to it.
 
Status
Not open for further replies.
Back