NX Statements

Junior Spellweaver
Joined
Jun 27, 2008
Messages
148
Reaction score
0
OPEN net.sf.odinms.client.MapleCharacter.java
FIND
Code:
        public void setBuddyCapacity(int capacity) {
                buddylist.setCapacity(capacity);
                client.getSession().write(MaplePacketCreator.updateBuddyCapacity(capacity));
        }
ADD UNDER
Code:
        public void gainNX(int nxchange) {  
            this.nxcash += nxchange;
	}



OPEN net.sf.odinms.scripting.npc.NPCConversationManager.java
FIND
Code:
        public int getBuddyCapacity() {
            return getPlayer().getBuddyCapacity();
        }

ADD UNDER
Code:
        public void gainNX(int nxcash) {
                getPlayer().gainNX(nxcash);
        }


Compile and you're done. Credits to me. D:
This is for adding NX via NPCs. Use it however you want.
I have an NPC I can paste on request for the Nexon Game Card 100/250.
Or I can make one that sells NX for Mesos, instead of using a php. :3

[IMG]https://forum.ragezone.com/ima...forum.ragezone.com/images/404_image.png[/IMG]
 
Re: [Release] NX Statements

Code:
/*
	NX Cash Selling NPC
	By V1ral from www.ancient-ms.net
	Put it as any NPC you have free.
	Change prices and ammounts to your liking
*/
function start() {
	cm.sendSimple ("Hello!Would you like to buy some NX? I have a few packages here for selection.\r\n#r#L0##e10,000 NX - 100,000,000 Mesos#n#l\r\n#k#L1##e25,000 NX - 250,000,000 Mesos#n#l#k");
	}

function action(mode, type, selection) {
		cm.dispose();

	switch(selection){
		case 0: 
			if(cm.getMeso() >= 100000000){
			cm.sendOk("Thanks, 10,000 NX points have been added to your account.");
			cm.gainNX(10000);
			cm.gainMeso(-100000000);
			cm.dispose();
			}else{
			cm.sendOk("You do not have 100,000,000 mesos.");
			cm.dispose();
			}
		break;
		case 1: 
			if(cm.getMeso() >= 250000000) {
			cm.sendOk("Thanks, 25,000 NX points have been added to your account.");
			cm.gainNX(25000);
			cm.gainMeso(-250000000);
			cm.dispose();		
			}
			else{	
				cm.sendOk("You do not have 250,000,000 mesos.");
				cm.dispose();
			};
		break;
			}
		}
There's the NPC. Enjoy!!
 
Re: [Release] NX Statements

Code:
/*
	NX Cash Selling NPC
	By V1ral from www.ancient-ms.net
	Put it as any NPC you have free.
	Change prices and ammounts to your liking
*/
function start() {
	cm.sendSimple ("Hello!Would you like to buy some NX? I have a few packages here for selection.\r\n#r#L0##e10,000 NX - 100,000,000 Mesos#n#l\r\n#k#L1##e25,000 NX - 250,000,000 Mesos#n#l#k");
	}

function action(mode, type, selection) {
		cm.dispose();

	switch(selection){
		case 0: 
			if(cm.getMeso() >= 100000000){
			cm.sendOk("Thanks, 10,000 NX points have been added to your account.");
			cm.gainNX(10000);
			cm.gainMeso(-100000000);
			cm.dispose();
			}else{
			cm.sendOk("You do not have 100,000,000 mesos.");
			cm.dispose();
			}
		break;
		case 1: 
			if(cm.getMeso() >= 250000000) {
			cm.sendOk("Thanks, 25,000 NX points have been added to your account.");
			cm.gainNX(25000);
			cm.gainMeso(-250000000);
			cm.dispose();		
			}
			else{	
				cm.sendOk("You do not have 250,000,000 mesos.");
				cm.dispose();
			};
		break;
			}
		}
There's the NPC. Enjoy!!

Thanks alot dude! Now i won't have ppl complaning to me asking me to top-up cash into their accounts.
 
Re: [Release] NX Statements

OPEN net.sf.odinms.client.MapleCharacter.java
OPEN net.sf.odinms.scripting.npc.NPCConversationManager.java
FIND
Code:
        public int getBuddyCapacity() {
            return getPlayer().getBuddyCapacity();
        }

ADD UNDER
Code:
        public void gainNX(int nxcash) {
                getPlayer().gainNX(nxcash);
        }


Compile and you're done. Credits to me. D:
This is for adding NX via NPCs. Use it however you want.
I have an NPC I can paste on request for the Nexon Game Card 100/250.
Or I can make one that sells NX for Mesos, instead of using a php. :3

[IMG]https://forum.ragezone.com/ima...pl0x? Using Sean's Repack Havent found "-_-
 
Re: [Release] NX Statements

haha darn you. you beat me to it. but i give you props. cause now i dont have to do so much work. i started on my nxCash exchanging NPC today. and finished it. I was going to wait for my friend to get on so we can test it on his server, and if it didnt work he was going to edit the server files for me to make it work. but now it seems you have done both already. good job man. im still planning on doing mine the way i want but i will use yours as a reference if i get stuck. =)

(i get stuck alot so im probably going to use alot of yours in the long run)
 
Re: [Release] NX Statements

Hi,

Nice release! I was wondering you could add a 'getNX'

Would it be like this ? (in MapleCharacter.java)

Code:
	public int getNX() {  
		return nxchange;
	}

And in NPCConversationManager.java

Code:
	public int getNX() {
		return getPlayer().getNX();
	}

THIS CAN BE INCORRECT SO DO NOT USE THIS YET! SO DON`T COME WHINING IF THIS FUCKED UP YOUR SERVER LEECHERS!

xV1ral, is this correct? Please help me if not.

Thanks for the release anyway,
 
Back