Since I'm tired of seeing the same old NX NPC being released, here's an improved one.
What it does:
Asks user how much NX they would like to buy, rather than give two choices.
Works for:
V 61
V 62
Not sure of any other version. Let me know if it does ;)
Here it is. Stick it in any NPC you'd like.
I'll be editing this tomorrow for more info on what it does. I'll add screens too I suppose.Code:importPackage(net.sf.odinms.client); var status = 0; var c; var em; var amount; var cost; var costmult = 250; // change this. How many mesos per 1 nx point it costs. var nxpermes = costmult * 1000; //Do not edit this. function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { if (status >= 0 && mode == 0) { cm.sendOk("Ahh well, see ya later kid!"); cm.dispose(); return; } if (mode == 1) status++; else status--; if(status == 0){ cm.sendNext("Hey there! I sell NX!"); }else if(status == 1){ cm.sendGetText("Please indicate how much nx you would like to buy!\r\nCurrent NX exchange rate:\r\n #r1,000 NX#k for #b" + nxpermes + "#k mesos."); }else if(status == 2){ if(cm.getText() >= 1){ cost = cm.getText() * costmult; cm.sendYesNo("So you want to buy #r" + cm.getText() + "#k Nx? That's going to cost you \r\n#r" + cost + "#k Mesos. Are you sure you want to buy that?"); }else{ cm.sendNext("That's not a number or you tried to get a negative amount of NX Cash! Please input a number..."); status = 0; } }else if(status == 3){ if(cm.getPlayer().getMeso() >= cost){ cm.getChar().modifyCSPoints(4, cm.getText()); cm.gainMeso(-cost); cm.sendOk("There you go! Have a nice day!"); cm.dispose(); }else{ cm.sendOk("You don't have enough Money to buy that much!" + cost); cm.dispose(); } } } }



Reply With Quote![[release]Simple, yet effective NX Selling NPC](http://ragezone.com/hyper728.png)


