[release]Simple, yet effective NX Selling NPC

Results 1 to 14 of 14
  1. #1
    Proficient Member og.Lios is offline
    MemberRank
    Dec 2008 Join Date
    Bismarck, NorthLocation
    157Posts

    [release]Simple, yet effective NX Selling NPC

    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.

    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();
    		}
    }
    }
    }
    I'll be editing this tomorrow for more info on what it does. I'll add screens too I suppose.


  2. #2
    Infraction Banned nejevoli is offline
    MemberRank
    May 2008 Join Date
    ♥ In Your HeartLocation
    574Posts

    Re: Simple, yet effective NX Selling NPC

    woah lios is on a release streak :O

  3. #3
    Proficient Member og.Lios is offline
    MemberRank
    Dec 2008 Join Date
    Bismarck, NorthLocation
    157Posts

    Re: Simple, yet effective NX Selling NPC

    lol, I get bored often.

    This is what happens when you get snowed in and you don't have a car with 4-wheel Drive T_T

  4. #4
    Banned whichboy5 is offline
    BannedRank
    May 2008 Join Date
    53Posts

    Re: Simple, yet effective NX Selling NPC

    Thanks for this release!
    I would like to use it...

  5. #5
    Proficient Member og.Lios is offline
    MemberRank
    Dec 2008 Join Date
    Bismarck, NorthLocation
    157Posts

    Re: Simple, yet effective NX Selling NPC

    Quote Originally Posted by whichboy5 View Post
    Thanks for this release!
    I would like to use it...
    Then go right ahead?

    Also, if you're on a version below v 61, please let me know if this script works, I could adjust it as well if you would like :3

  6. #6
    Alpha Member Markii is offline
    MemberRank
    Nov 2008 Join Date
    NewyorkLocation
    1,917Posts

    Re: Simple, yet effective NX Selling NPC

    wont think it works cause its a differnet cm.

    But overall Nice job lios

  7. #7
    Infraction Banned CptObvious is offline
    MemberRank
    Aug 2008 Join Date
    366Posts

    Re: Simple, yet effective NX Selling NPC

    I'm pretty sure v62 NPC formatting is quiet different then v55 NPC formatting, either wise nice release nigga

  8. #8
    Infraction Banned MrMysterious is offline
    MemberRank
    Dec 2008 Join Date
    In a treeLocation
    752Posts

    Re: Simple, yet effective NX Selling NPC

    lol use getNumber()

  9. #9
    Account Upgraded | Title Enabled! Lanny is offline
    MemberRank
    Aug 2008 Join Date
    In your screen!Location
    399Posts

    Re: Simple, yet effective NX Selling NPC

    Lol Nice release =O

  10. #10
    Proficient Member og.Lios is offline
    MemberRank
    Dec 2008 Join Date
    Bismarck, NorthLocation
    157Posts

    Re: Simple, yet effective NX Selling NPC

    Hmm, getNumber() always would return an undefined. Either I was using it incorrectly or god hates me :D

  11. #11
    Infraction Banned MrMysterious is offline
    MemberRank
    Dec 2008 Join Date
    In a treeLocation
    752Posts

    Re: Simple, yet effective NX Selling NPC

    lol give me an example of how you were using it

  12. #12
    Mother effin' clouds SaintsIan is offline
    MemberRank
    Apr 2008 Join Date
    fyrechat.netLocation
    2,809Posts

    Re: Simple, yet effective NX Selling NPC

    very flexible script for people to use and have the amount they wish instead of buying and buying ;)
    And "MONSTER KILLL!!!!" for your releases. get 3 more and you will get god like :O

  13. #13
    Account Upgraded | Title Enabled! lonerzboy is offline
    MemberRank
    Apr 2008 Join Date
    Singapore~Location
    305Posts

    Re: Simple, yet effective NX Selling NPC

    Good job..
    Your releases are so good!!!~

  14. #14
    Member dragonsin53 is offline
    MemberRank
    Sep 2008 Join Date
    82Posts

    Re: [release]Simple, yet effective NX Selling NPC

    Hmm i tried it,it doesnt work for me :( i am using v55 repack btw xD



Advertisement