[Release] Item Trader NPC

Results 1 to 11 of 11
  1. #1
    Member Vanlj95 is offline
    MemberRank
    Feb 2011 Join Date
    92Posts

    [Release] Item Trader NPC


    RaGEZONE Recommends

    RaGEZONE Recommends

    Hey guys, first release.
    This is an easy customizible NPC, that you can change yourself. Say you want to change the item traded from maple leaves to Golden Maple Leaves. Just change the variable at the top, and at the bottom, and on the selections. You can easily edit the items that are given to the character by changing the itemID and name. Enjoy!

    PHP Code:
    /**
    OdinMS Javascript
    NPC: Spiegelmann

    **/


    var status;
    var 
    leafs;
    var 
    itemID;
    var 
    itemName;

    function 
    start() {
        
    status = -1;
        
    action(100);
    }

    function 
    action(modetypeselection) {
        
    status++;
        if(
    mode != 1){
            
    cm.dispose();
            return;
        }
        if(
    status == 0){
          
    cm.sendNext("Hello, you got any Maple Leaves?");
          } else if (
    status == 1) {
          
    cm.sendSimple("You can obtain Maple Leaves from killing any monster. Anyways, you can trade your Maple Leaves here for items. By the way, the Maple Leaves look like this: #v4001126. \r\n\r\n#L0##e#bCrystal Ilbi Forging Manual#l\r\n#L1#Crystal Leaf Earrings Forging Manual#l\r\n#L2#Facestompers Forging Manual#l\r\n#L3#Black Phoenix Shield Forging Manual#l\r\n#L4#Neva Forging Manual#l\r\n#L5#Stormcasters Forging Manual#l\r\n#L6#Sirius Cloak Forging Manual#l\r\n#L7#Tiger's Fang Forging Manual#l\r\n#L8#Ilbi#l");
          } else if (
    status == 2) {
          
          if (
    selection == 0) {
          
    leafs 250;
          
    itemID 4031912;
          
    itemName "Crystal Ilbi Forging Manual";
          
          } else if (
    selection == 1) {
          
    leafs 200;
          
    itemID 4031825;
          
    itemName "Crystal Leaf Earring Forging Manual";
          
          } else if (
    selection == 2) {
          
    leafs 325;
          
    itemID 4031911;
          
    itemName "Facestompers Forging Manual";
          
          } else if (
    selection == 3) {
          
    leafs 175;
          
    itemID 4031829;
          
    itemName "Black Phoenix Shield Forging Manual";
          
          } else if (
    selection == 4) {
          
    leafs 200;
          
    itemID 4031908;
          
    itemName "Neva Forging Manual";
          
          } else if (
    selection == 5) {
          
    leafs 325;
          
    itemID 4031824;
          
    itemName "Stormcasters Forging Manual";
          
          } else if (
    selection == 6) {
          
    leafs 175;
          
    itemID 4031827;
          
    itemName "Sirius Cloak Forging Manual";
          
          } else if (
    selection == 7) {
          
    leafs 225;
          
    itemID 4031907;
          
    itemName "Tiger's Fang Forging Manual";
          
          } else if (
    selection == 8) {
          
    leafs 150;
          
    itemID 2070006;
          
    itemName "Ilbi";
          
          }
          
          
    cm.sendYesNo("Are you sure you want to get the " itemName "? It will cost you #b" leafs " #kMaple Leaves.");
          
          } else if (
    mode == 1) {
          if (!
    cm.haveItem(4001126,leafs)){
         
    cm.sendOk("You don't have the required #b" leafs " Maple Leaves. #kVote more, and you will get enough eventually.");
          
    cm.dispose();
          }else{
          
           
    cm.gainItem(4001126,-leafs);
          
    cm.gainItem(itemID,1);
          
          
          
    cm.sendOk("Enjoy your #b" itemName "! #kRemember to vote more often to get more of these exclusive deals!");
          
    cm.dispose();
          
          }
          }
          } 
    Last edited by Vanlj95; 01-02-13 at 02:19 AM. Reason: double cm.dispose();


  2. #2
    Account Upgraded | Title Enabled! Sharky is offline
    True MemberRank
    Dec 2010 Join Date
    Ur Mom's Pants.Location
    927Posts

    Re: [Release] Item Trader NPC

    Not bad. First release?

    I got bored so I decided to make one that I thought was more user-friendly and all around cooler :O Not tested, and I experimented with some # codes, so I would appreciate somebody looking this over. Anyways, here it is :P
    PHP Code:
    /**
     * How to Edit:
     * Put the item ID you want to use in place of '4001126' for the item players need to trade in.
     * Put the item IDs of the prizes in the first section of the item array. Where you see '4031912, 4031825, etc'.
     * Put the amount of the requiredItem the player needs for the CORRESPONDING item in the second part of the item array. Where you see '250, 200, etc'.
     * Corresponding means: Match up the item ID to the amount of requiredItem needed. In this script, the player needs 250 requiredItem for the '4031912' item.
     */
    var status 0;
    var 
    requiredItem 4001126;
    var 
    item = [[403191240318254031911403182940319084031824403182740319072070006], [250200325175200325175225150]];
    var 
    sel;

    function 
    start(){
        
    cm.sendNext("Hello! Do you have any #r#t"requiredItem +"##k? If you do, I can trade you some items for them!");
    }

    function 
    action(m,t,s){
        
    status++;
        if(
    != 1){
            
    cm.dispose();
            return;
        }
        if(
    status == 1){
            if(!
    cm.haveItem(requiredItem)){ // SORRY, I had this as item[0] =/
                
    cm.sendOk("You don't have any #r#t"requiredItem +"##k!");
                
    cm.dispose();
            } else {
                var 
    talk "Which Item would you like to buy?#b";
                for(var 
    0item[0].lengthtalk += "\r\n\t#L"+"##t"item[0][i] +"##l"i++);
                
    cm.sendSimple(talk);
            }
        } else if (
    status == 2){
            
    sel s;
            
    cm.sendYesNo("Would you like to buy 1 #b#t"item[0][s] +"##kdItem for #r"item[1][s] +" #t"requiredItem +"#?");
        } else if (
    status == 3){
            if(
    cm.haveItem(requiredItemitem[1][sel])){
                
    cm.sendOk("Enjoy your #b#t" item[0][sel] + "##k! Remember to vote more often to get more of these exclusive deals!");
                
    cm.gainItem(item[0][sel]);
                
    cm.gainItem(requiredItem, -item[1][sel]);
            } else {
                var 
    percent Math.ceil(cm.itemQuantity(requiredItem) / item[1][sel]); // removed the +100, as the #B # reads decimals x_x
                
    cm.sendOk("You only have #b#c"requiredItem +"# #t"requiredItem +"##k. You need #r"item[1][sel] +" #t"requiredItem +"##k to buy a #b#t"item[0][sel] +"##k! \r\n\r\n#ePercent of #b#t"requiredItem +"#'s#k collected (rounded by the 10%): \r\n#B"percent +"#");
            }
            
    cm.dispose(); // forgot this in the first post, sorry x_x
        
    }

    Last edited by Sharky; 05-03-11 at 02:10 AM.

  3. #3
    Member Vanlj95 is offline
    MemberRank
    Feb 2011 Join Date
    92Posts

    Re: [Release] Item Trader NPC

    Quote Originally Posted by Sharky View Post
    Not bad. First release?

    I got bored so I decided to make one that I thought was more user-friendly and all around cooler :O Not tested, and I experimented with some # codes, so I would appreciate somebody looking this over. Anyways, here it is :P
    PHP Code:
    /**
     * How to Edit:
     * Put the item ID you want to use in place of '4001126' for the item players need to trade in.
     * Put the item IDs of the prizes in the first section of the item array. Where you see '4031912, 4031825, etc'.
     * Put the amount of the requiredItem the player needs for the CORRESPONDING item in the second part of the item array. Where you see '250, 200, etc'.
     * Corresponding means: Match up the item ID to the amount of requiredItem needed. In this script, the player needs 250 requiredItem for the '4031912' item.
     */
    var status 0;
    requiredItem 4001126;
    item = [[403191240318254031911403182940319084031824403182740319072070006], [250200325175200325175225150]];
    var 
    sel;

    function 
    start(){
        
    cm.sendNext("Hello! Do you have any #r#t"requiredItem +"##k? If you do, I can trade you some items for them!");
    }

    function 
    action(m,t,s){
        
    status++;
        if(
    != 1){
            
    cm.dispose();
            return;
        }
        if(
    status == 1){
            if(!
    cm.haveItem(item[0])){
                
    cm.sendOk("You don't have any #r#t"requiredItem +"##k!");
                
    cm.dispose();
            } else {
                var 
    talk "Which Item would you like to buy?#b";
                for(var 
    0item[0].lengthtalk += "\r\n\t#L"+"##t"item[0][i] +"##l"i++);
                
    cm.sendSimple(talk);
            }
        } else if (
    status == 2){
            
    sel s;
            
    cm.sendYesNo("Would you like to buy 1 #b#t"item[0][s] +"##kdItem for #r"item[1][s] +" #t"requiredItem +"#?");
        } else if (
    status == 3){
            if(
    cm.haveItem(requiredItemitem[1][sel])){
                
    cm.sendOk("Enjoy your #b#t" item[0][sel] + "##k! Remember to vote more often to get more of these exclusive deals!");
                
    cm.gainItem(item[0][sel]);
                
    cm.gainItem(requiredItem, -item[1][sel]);
            } else {
                var 
    percent Math.ceil(cm.itemQuantity(requiredItem) / item[1][sel] + 100);
                
    cm.sendOk("You only have #b#c"requiredItem +"# #t"requiredItem +"##k. You need #r"item[1][sel] +" #t"requiredItem +"##k to buy a #b#t"item[0][sel] +"##k! \r\n\r\n#ePercent of #b#t"requiredItem +"#'s#k collected: \r\n#B"percent +"#");
            }
        }

    Wow, nice, I'm impressed. You used way less characters than me. I'm still kind of new to this though, haha.

  4. #4
    while(true) spam(); kevintjuh93 is offline
    ModeratorRank
    Jun 2008 Join Date
    The NetherlandsLocation
    4,121Posts

    Re: [Release] Item Trader NPC

    Can be stop releasing these shitty npcs? Just keep them for yourself. Kthnx
    Posted via Mobile Device

  5. #5
    Member Vanlj95 is offline
    MemberRank
    Feb 2011 Join Date
    92Posts

    Re: [Release] Item Trader NPC

    Quote Originally Posted by kevintjuh93 View Post
    Can be stop releasing these shitty npcs? Just keep them for yourself. Kthnx
    Posted via Mobile Device
    I just released something that I made. Is there something wrong with that? There is no rule about releasing bad stuff, is there?

  6. #6
    Account Upgraded | Title Enabled! Sharky is offline
    True MemberRank
    Dec 2010 Join Date
    Ur Mom's Pants.Location
    927Posts

    Re: [Release] Item Trader NPC

    Quote Originally Posted by Vanlj95 View Post
    I just released something that I made. Is there something wrong with that? There is no rule about releasing bad stuff, is there?
    If there were, Kevin couldn't have released MoopleDev :P ROFL, kidding buddy.

    Quote Originally Posted by kevintjuh93 View Post
    Can be stop releasing these shitty npcs? Just keep them for yourself. Kthnx
    Posted via Mobile Device
    I'm gonna release one later just because you posted this ;)

  7. #7
    while(true) spam(); kevintjuh93 is offline
    ModeratorRank
    Jun 2008 Join Date
    The NetherlandsLocation
    4,121Posts

    Re: [Release] Item Trader NPC

    Chris, i will kill you. And you better release it in the help section. Yours are always corrupt.

    And release something that is worth it.
    Posted via Mobile Device

  8. #8
    Account Upgraded | Title Enabled! Sharky is offline
    True MemberRank
    Dec 2010 Join Date
    Ur Mom's Pants.Location
    927Posts

    Re: [Release] Item Trader NPC

    Quote Originally Posted by kevintjuh93 View Post
    Chris, i will kill you. And you better release it in the help section. Yours are always corrupt.

    And release something that is worth it.
    Posted via Mobile Device
    ROFL, when are mine corrupt? xD

  9. #9
    Alpha Member Soulfist is offline
    Alpha MaleRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: [Release] Item Trader NPC

    Quote Originally Posted by kevintjuh93 View Post
    Can be stop releasing these shitty npcs? Just keep them for yourself. Kthnx
    Posted via Mobile Device
    Dun need to be like dat kev

    Its his first release.

  10. #10
    Account Inactive lFatelHighDef is offline
    InactiveRank
    Feb 2011 Join Date
    330Posts

    Re: [Release] Item Trader NPC

    Yeah Kev, haha. Youll scare off all the people trying to learn, then we'll be left with leechers.

  11. #11
    Alpha Member Soulfist is offline
    Alpha MaleRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: [Release] Item Trader NPC

    Quote Originally Posted by lFatelHighDef View Post
    Yeah Kev, haha. Youll scare off all the people trying to learn, then we'll be left with leechers.
    Too late for that my frien




Advertisement