[HeavenMS] MAXHP / MP, AP Exchanger

Results 1 to 3 of 3
  1. #1
    Hardcore Member goldstory is offline
    MemberRank
    Jan 2010 Join Date
    131Posts

    wink [HeavenMS] MAXHP / MP, AP Exchanger

    MAX HP/ MP, AP points & Fame Exchanger.

    This is just a small release, I'm sure somebody will use this as I've saw a few people asking for this sort of thing.

    No additional methods are needed unless you want the fakeRelog method which I will add.
    Basically, the merchant exchanges a currency of your choice for .. well the title says it all.
    This is ideal for low rate servers, or those who would like to keep HP washing optional.

    Use it as you wish~

    Here's the NPC script:

    Spoiler:

    PHP Code:
    var status = -1;
    var 
    choice;
    var 
    fee;
    var 
    result;
    var 
    heal;
    var 
    MapleStat Java.type('client.MapleStat');
    var 
    item 4310000//Change this to an item of your choice.

    function start() {
        
    action(100);
    }

    function 
    action(modetypeselection) {
        if (
    mode != 1) {
            
    cm.dispose();
            return;
        } else
            
    status++;
        if (
    status == 0) {
            
    cm.sendSimple("What would you like to do?\r\n\r\n"
                
    "#L0#Increase my MAX #rHP#k\r\n"
                
    "#L1#Increase my MAX #bMP#k\r\n"
                
    +"\t#fUI/UIWindow.img/SkillMacro/line02#\r\n\r\n"
                
    "#L2##kPurchase Ability Points\r\n"
                
    "#L3##kPurchase Fame\r\n"
            
    );

        } else if (
    status == 1) {
            
    choice selection;
            if (
    selection == 0) {
                
    cm.sendGetText("How many #z" item "#(s) do you want to use to increase your MAX#rHP#k?\r\n\n #r100#k points = #r1#k #z" item "#.\r\n");
            } else if (
    selection == 1) {
                
    cm.sendGetText("How many #z" item "#(s) do you want to use to increase your MAX#bMP#k?\r\n\n #b100#k points = #r1#k #z" item "#.\r\n");
            } else if (
    selection == 2) {
                
    cm.sendGetText("How many #z" item "#s do you want to trade for #gAbility Points#k\r\n\r\n\r\n#r200#k points = #r1#k #z" item "#.\r\n");
            } else if (
    selection == 3) {
                
    cm.sendGetText("How many #z" item "#s do you want to trade for #gFame#k?\r\n\r\n\r\n#r100#k Fame = #r1#k #z" item "#.\r\n");            
            }
        } else if (
    status == 2) {
            if (
    choice == 0) {
                
    fee cm.getText();
                
    cm.sendYesNo("Are you sure you want to trade #r" fee "#k #z" item "#(s) to add #rHP#k points?");
            } else if (
    choice == 1) {
                
    fee0 cm.getText();
                
    cm.sendYesNo("Are you sure you want to trade #r" fee0 "#k #z" item "#(s) to add #bMP#k points?");
            } else if (
    choice == 2) {
                
    fee1 cm.getText();
                
    result fee1 200
                cm
    .sendYesNo("Are you sure you want to trade #r" fee1 "#k #z" item "#(s) to add\r\n#r" result "#k #gAbility Points#k?");
            } else if (
    choice == 3) {
                
    fee2 cm.getText();
                
    result fee2 100
                cm
    .sendYesNo("Are you sure you want to trade #r" fee2 "#k #z" item "#(s) to add\r\n#r" result "#k #eFame#n#k?");            
            }
        } else if (
    status == 3) {
            if (
    choice == 0) {
                
    heal cm.getClient().getPlayer().healHpMp();
                
    result fee 100
                
    if (!cm.haveItem(itemfee)) {  
                    
    cm.sendOk("You cannot trade #z" item "#(s) that you do not have.\r\nCome back when you have the required amount!\r\n");  
                    
    cm.dispose();  
                } else if (
    cm.getText() < 1) {  
                    
    cm.sendOk("You need to have atleast #r1#k #z" item "# to trade!");  
                    
    cm.dispose();  
                } else if (!
    cm.haveItem(itemfee) + fee 640) {  
                    
    cm.sendOk("You can only trade #r320#k #z" item "# maximum!");  
                    
    cm.dispose();  
                } else if (
    cm.getClient().getPlayer().getMaxHp() + result 33000) {
                    
    cm.sendOk("I'm sorry you cannot have more than 32,000 of this stat");
                    
    cm.dispose();
                } else {
                    
    cm.gainItem(item, -fee);
                    
    cm.getClient().getPlayer().addMaxHP(fee 100);   
                    
    cm.getClient().getPlayer().updateSingleStat(MapleStat.MAXHPcm.getClient().getPlayer().getMaxHP());
                    
    heal();            
                    
    cm.sendOk("Thanks!");
                    
    cm.dispose();
                }
            } else if (
    choice == 1) {
                
    heal cm.getClient().getPlayer().healHpMp();
                
    result fee0 100
                
    if (!cm.haveItem(itemfee0)) {  
                    
    cm.sendOk("You cannot trade #z" item "#(s) that you do not have.\r\nCome back when you have the required amount!\r\n");  
                    
    cm.dispose();  
                } else if (
    cm.getText() < 1) {  
                    
    cm.sendOk("You need to have atleast #r1#k #z" item "# to trade!");  
                    
    cm.dispose();  
                } else if (!
    cm.haveItem(itemfee0) + fee0 640) {  
                    
    cm.sendOk("You can only trade #r320#k #z" item "# maximum!");  
                    
    cm.dispose();  
                } else if (
    cm.getClient().getPlayer().getMaxMp() + result 33000) {
                    
    cm.sendOk("I'm sorry you cannot have more than 32,000 of this stat");
                    
    cm.dispose();
                } else {
                    
    cm.gainItem(item, -fee0);
                    
    cm.getClient().getPlayer().addMaxMP(fee0 100);   
                    
    cm.getClient().getPlayer().updateSingleStat(MapleStat.MAXMPcm.getClient().getPlayer().getMaxMP());
                    
    heal();
                    
    cm.sendOk("Thanks!");
                    
    cm.dispose();
                }
            } else if (
    choice == 2) {            
                
    result fee1 200
                
    if (!cm.haveItem(itemfee1)) {  
                    
    cm.sendOk("You cannot trade #z" item "#(s) that you do not have.\r\nCome back when you have the required amount!\r\n");  
                    
    cm.dispose();  
                } else if (
    cm.getText() < 1) {  
                    
    cm.sendOk("You need to have atleast #r1#k #z" item "# to trade!");  
                    
    cm.dispose();  
                } else if (!
    cm.haveItem(itemfee1) + fee1 640) {  
                    
    cm.sendOk("You can only trade #r320#k #z" item "# maximum!");  
                    
    cm.dispose();
                } else {
                    
    cm.gainItem(item, -fee1); 
                    
    cm.getPlayer().gainAp(resulttrue);
                    
    cm.getPlayer().fakeRelog();
                    
    cm.sendOk("Thanks! Your points have been added.");
                    
    cm.getClient().getPlayer().updateSingleStat(MapleStat.AVAILABLEAPcm.getClient().getPlayer().gainAp());    
                    
    cm.dispose();
                }
            } else if (
    choice == 3) {
                
    result fee2 100
                
    if (!cm.haveItem(itemfee2)) {  
                    
    cm.sendOk("You cannot trade #z" item "#(s) that you do not have.\r\nCome back when you have the required amount!\r\n");  
                    
    cm.dispose();  
                } else if (
    cm.getText() < 1) {  
                    
    cm.sendOk("You need to have atleast #r1#k #z" item "# to trade!");  
                    
    cm.dispose();  
                } else if (!
    cm.haveItem(itemfee2) + fee2 2000) {  
                    
    cm.sendOk("You can only trade #r1000#k #z" item "# maximum!");  
                    
    cm.dispose();
                } else {
                    
    cm.gainItem(item, -fee2); 
                    
    cm.getClient().getPlayer().addFame(fee2 100);           
                    
    cm.sendOk("Thanks!");
                    
    cm.dispose();
                }
            }
        }



    fakeRelog Method:
    Spoiler:


    In MapleCharacter somewhere add..
    PHP Code:
        public void fakeRelog() {
            
    changeMapInternal(getMap(), getPosition(), MaplePacketCreator.getCharInfo(this));



    special thanks to @izarooni for helping with some things that I ran into!


    Merry Christmas to everyone, happy holidays!~
    Last edited by goldstory; 25-12-20 at 03:56 PM.


  2. #2
    Registered ZTMS is offline
    MemberRank
    Nov 2020 Join Date
    8Posts

    Re: [HeavenMS] MAXHP / MP, AP Exchanger

    Nice release! Happy Holidays!

  3. #3
    Hardcore Member goldstory is offline
    MemberRank
    Jan 2010 Join Date
    131Posts

    Re: [HeavenMS] MAXHP / MP, AP Exchanger

    Quote Originally Posted by ZTMS View Post
    Nice release! Happy Holidays!
    Same to you! Enjoy!



Advertisement