Donator NPC that sells edited stat items

Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    Account Upgraded | Title Enabled! Vietster is offline
    MemberRank
    Dec 2012 Join Date
    305Posts

    Re: Donator NPC that sells edited stat items

    Quote Originally Posted by hecari View Post
    Any item? Or specific item?

    Based on Item ID.
    PHP Code:
    public void ProDonatorItem(int itemMapleCharacter player) {
            
    Equip nItem = new Equip(itemequip.getNextFreeSlot());
            
    nItem.setStr((short250); //STR
            
    nItem.setDex((short250); //DEX 
            
    nItem.setInt((short250); //INT
            
    nItem.setLuk((short250); //LUK
            
    nItem.setWatk((short100); // WA
            
    nItem.setUpgradeSlots((byte0);
            
    player.getInventory(MapleInventoryType.EQUIP).addFromDB(nItem);
        } 
    You use:

    PHP Code:
    cm.ProDonatorItem(<itemID>, c.getPlayer()); 
    Quick question regarding this. Hecari how would you place it in the npc to make it any item gained through using the command sendGetText?

  2. #17
    Account Upgraded | Title Enabled! bbhing98 is offline
    MemberRank
    Jul 2012 Join Date
    314Posts

    Re: Donator NPC that sells edited stat items

    Quote Originally Posted by Vietster View Post
    Quick question regarding this. Hecari how would you place it in the npc to make it any item gained through using the command sendGetText?
    i think it's like this.
    make an array, then
    PHP Code:
    case 1:
    cm.whatever;
    cm.ProDonatorItem(<itemID>, c.getPlayer());  
    break;

    case 
    2:
    cm.whatver;
    cm.ProDonatorItem(<itemID>, c.getPlayer());  
    break; 
    if i'm not wrong, thats it, if you has a pool of item to be selected. if it's for gm, use
    PHP Code:
    cm.MakeGMItem(itemIDcm.getPlayer()); 
    Quote Originally Posted by bbhing98 View Post
    how do i change the level, add speed, add jump, upgrade slot to an item with this function? is it something like cm.ProDonatorItem(itemID,str,dex,int,luk,level,speed,jump,upgrade slot? )?
    something like
    PHP Code:
    public void ProDonatorItem(int itemint strint dexint int_int lukint levelint speedint jumpint upgradeslots){
    Equip eu = new Equip(itemequip.getNextFreeSlot());
             
    MapleJob job eu.getJob(); // JOB
             
    short hand eu.getHands(); // HANDS
             
    byte level eu.getLevel(); // LEVEL
             
    eu.setStr((shortstr); // STR
             
    eu.setDex((shortdex); // DEX
             
    eu.setInt((shortint_); // INT
             
    eu.setLuk((shortluk); //LUK
             
    eu.setUpgradeSlots((byteupgradeslots); // Feel free to change
             
    eu.setJob(job);
             
    eu.setHands(hand);
             
    eu.setLevel(level);
             
    eu.setSpeed(speed);
             
    eu.setJump(jump);
             
    getPlayer().getInventory(MapleInventoryType.EQUIP).addFromDB(eu);
    getPlayer().getInventory(MapleInventoryType.EQUIP).removeItem(slot);   
     } 
    can someone give me the function for setJob, getJob? its giving me error.
    also it says cannot find symbol for equip, slot. help?


    also, how can i add potential to an item? someone can write a complete code for it?

    edit: i've also found this in my npcconversationmanager.java.

    PHP Code:
    public void changeStat(byte slotint typeint amount) { 
            
    Equip sel = (Equipc.getPlayer().getInventory(MapleInventoryType.EQUIPPED).getItem(slot); 
            switch (
    type) { 
                case 
    0
                    
    sel.setStr((shortamount); 
                    break; 
                case 
    1
                    
    sel.setDex((shortamount); 
                    break; 
                case 
    2
                    
    sel.setInt((shortamount); 
                    break; 
                case 
    3
                    
    sel.setLuk((shortamount); 
                    break; 
                case 
    4
                    
    sel.setHp((shortamount); 
                    break; 
                case 
    5
                    
    sel.setMp((shortamount); 
                    break; 
                case 
    6
                    
    sel.setWatk((shortamount); 
                    break; 
                case 
    7
                    
    sel.setMatk((shortamount); 
                    break; 
                case 
    8
                    
    sel.setWdef((shortamount); 
                    break; 
                case 
    9
                    
    sel.setMdef((shortamount); 
                    break; 
                case 
    10
                    
    sel.setAcc((shortamount); 
                    break; 
                case 
    11
                    
    sel.setAvoid((shortamount); 
                    break; 
                case 
    12
                    
    sel.setHands((shortamount); 
                    break; 
                case 
    13
                    
    sel.setSpeed((shortamount); 
                    break; 
                case 
    14
                    
    sel.setJump((shortamount); 
                    break; 
                case 
    15
                    
    sel.setUpgradeSlots((byteamount); 
                    break; 
                case 
    16
                    
    sel.setViciousHammer((byteamount); 
                    break; 
                case 
    17
                    
    sel.setLevel((byteamount); 
                    break; 
                case 
    18
                    
    sel.setEnhance((byteamount); 
                    break; 
                case 
    19
                    
    sel.setPotential1(amount); 
                    break; 
                case 
    20
                    
    sel.setPotential2(amount); 
                    break; 
                case 
    21
                    
    sel.setPotential3(amount); 
                    break; 
                case 
    22
                    
    sel.setPotential4(amount); 
                    break; 
                case 
    23
                    
    sel.setPotential5(amount); 
                    break; 
                case 
    24
                    
    sel.setOwner(getText()); 
                    break; 
                default: 
                    break; 
            } 
    how do i use this? does the code above works the same as ProDonatorItem? is it possible to customize all the stat of the item, as in str,dex,int,luk,potentials,speed,jump,level,vicious slot, upgrade slot, level, wdef....... with the "changeStat" function? someone help me? thanks
    HELPPPPPPPPPPP

  3. #18
    $_SESSION['DEV']; hecari is offline
    MemberRank
    Dec 2008 Join Date
    336Posts

    Re: Donator NPC that sells edited stat items

    Quote Originally Posted by Vietster View Post
    Quick question regarding this. Hecari how would you place it in the npc to make it any item gained through using the command sendGetText?
    sendGetText: You're supposed to input the item id is it? If you input the item id, you assign a variable itemid to store the cm.getText then use the variable in the method.

    cm.ProDonatorItem(<variable>, c.getPlayer());

    Quote Originally Posted by bbhing98 View Post
    i think it's like this.
    make an array, then
    PHP Code:
    case 1:
    cm.whatever;
    cm.ProDonatorItem(<itemID>, c.getPlayer());  
    break;

    case 
    2:
    cm.whatver;
    cm.ProDonatorItem(<itemID>, c.getPlayer());  
    break; 
    if i'm not wrong, thats it, if you has a pool of item to be selected. if it's for gm, use
    PHP Code:
    cm.MakeGMItem(itemIDcm.getPlayer()); 


    HELPPPPPPPPPPP
    If you want different str,dex,luk and int, you need to use alot of variable to store each individual cm.getText

  4. #19
    Account Upgraded | Title Enabled! bbhing98 is offline
    MemberRank
    Jul 2012 Join Date
    314Posts
    Quote Originally Posted by hecari View Post
    sendGetText: You're supposed to input the item id is it? If you input the item id, you assign a variable itemid to store the cm.getText then use the variable in the method.

    cm.ProDonatorItem(<variable>, c.getPlayer());



    If you want different str,dex,luk and int, you need to use alot of variable to store each individual cm.getText
    I'm doing it in a npc which gives item which has the value that I've pre-set in npc scripting(like if someone hits level200 they will gain an item with random stats and random potential line and random speed/jump/scroll slots blabla.
    IT IS PRESET IN A NPC, NOT HAVING TO INSERT IT WHEN I TALK TO THE NPC.
    What I wanted is a java source code with the function that makes an item with customize stats which is gonna be pre inserted in a npc (not mass cm.sendGetText/Number when talking to the npc)
    I hope you understand what I meant lol

  5. #20
    $_SESSION['DEV']; hecari is offline
    MemberRank
    Dec 2008 Join Date
    336Posts

    Re: Donator NPC that sells edited stat items

    Then create a method like this:

    PHP Code:
    public void ProDonatorItem(int itemMapleClient c){
    Equip eu = new Equip(itemequip.getNextFreeSlot());
             
    MapleJob job eu.getJob(); // JOB
             
    short hand eu.getHands(); // HANDS
             
    byte level eu.getLevel(); // LEVEL
             
    eu.setStr((short) <predefined>); // STR
             
    eu.setDex((short) <predefined>); // DEX
             
    eu.setInt((short) <predefined>); // INT
             
    eu.setLuk((short) <predefined>); //LUK
             
    eu.setUpgradeSlots((byte) <predefined>); // Feel free to change
             
    eu.setJob(job);
             
    eu.setHands(hand);
             
    eu.setLevel(level);
             
    eu.setSpeed(speed);
             
    eu.setJump(jump);
             
    c.getPlayer().getInventory(MapleInventoryType.EQUIP).addFromDB(eu);
    c.getPlayer().getInventory(MapleInventoryType.EQUIP).removeItem(slot);   
     } 

  6. #21
    Account Upgraded | Title Enabled! Vietster is offline
    MemberRank
    Dec 2012 Join Date
    305Posts

    Re: Donator NPC that sells edited stat items

    Quote Originally Posted by hecari View Post
    sendGetText: You're supposed to input the item id is it? If you input the item id, you assign a variable itemid to store the cm.getText then use the variable in the method.

    cm.ProDonatorItem(<variable>, c.getPlayer());



    If you want different str,dex,luk and int, you need to use alot of variable to store each individual cm.getText
    So your telling me to input a variable? Could you possibly show a example? I'm trying to make it so that it will link to all the equips and when they open the npc they will just need to type in the name of the equip so ex. "Lionheart Cutlass" and it will give it to them with the modded stats, or are there no ways to do that and I have to make a array for all the equips?

  7. #22
    Account Upgraded | Title Enabled! bbhing98 is offline
    MemberRank
    Jul 2012 Join Date
    314Posts
    Quote Originally Posted by hecari View Post
    Then create a method like this:

    PHP Code:
    public void ProDonatorItem(int itemMapleClient c){
    Equip eu = new Equip(itemequip.getNextFreeSlot());
             
    MapleJob job eu.getJob(); // JOB
             
    short hand eu.getHands(); // HANDS
             
    byte level eu.getLevel(); // LEVEL
             
    eu.setStr((short) <predefined>); // STR
             
    eu.setDex((short) <predefined>); // DEX
             
    eu.setInt((short) <predefined>); // INT
             
    eu.setLuk((short) <predefined>); //LUK
             
    eu.setUpgradeSlots((byte) <predefined>); // Feel free to change
             
    eu.setJob(job);
             
    eu.setHands(hand);
             
    eu.setLevel(level);
             
    eu.setSpeed(speed);
             
    eu.setJump(jump);
             
    c.getPlayer().getInventory(MapleInventoryType.EQUIP).addFromDB(eu);
    c.getPlayer().getInventory(MapleInventoryType.EQUIP).removeItem(slot);   
     } 
    Sorry for bothering you, hecari, but I still don't understand what you're trying to say. Okay let's say, I wanna make a npc with this

    If (status==1)
    cm.ProDonatoraItem(8273839 10(str) 20(str) 12(int) 17(luk) 200(hp) 200(mp) 20(speed) 20(jump) 600001(potential1) 60001 (potential2) 600001(potential3)
    Cm.dispose

    If (status==2)
    Cm.ProdonatorItem (4727627 50(str) 20(dex) 30(int) 50(luk) 200(hp) 200(mp) 20(speed) 20(jump) 600001(potential1) 60001 (potential2) 600001(potential3)

    If (status==3)
    Cm.ProdonatorItem (467627 50(str) 20(dex) 30(int) 50(luk) 200(hp) 200(mp) 20(speed) 20(jump) 600001(potential1) 60001 (potential2) 600001(potential3)

    Of course the brackets won't be here, only the values, so do I do that? Like not all the item has he same stat so I'd do it like this. Thanks

  8. #23
    $_SESSION['DEV']; hecari is offline
    MemberRank
    Dec 2008 Join Date
    336Posts

    Re: Donator NPC that sells edited stat items

    Quote Originally Posted by bbhing98 View Post
    Sorry for bothering you, hecari, but I still don't understand what you're trying to say. Okay let's say, I wanna make a npc with this

    If (status==1)
    cm.ProDonatoraItem(8273839 10(str) 20(str) 12(int) 17(luk) 200(hp) 200(mp) 20(speed) 20(jump) 600001(potential1) 60001 (potential2) 600001(potential3)
    Cm.dispose

    If (status==2)
    Cm.ProdonatorItem (4727627 50(str) 20(dex) 30(int) 50(luk) 200(hp) 200(mp) 20(speed) 20(jump) 600001(potential1) 60001 (potential2) 600001(potential3)

    If (status==3)
    Cm.ProdonatorItem (467627 50(str) 20(dex) 30(int) 50(luk) 200(hp) 200(mp) 20(speed) 20(jump) 600001(potential1) 60001 (potential2) 600001(potential3)

    Of course the brackets won't be here, only the values, so do I do that? Like not all the item has he same stat so I'd do it like this. Thanks
    Yes, you can do that. What I'm recommending is if you only have those 3 option, might as well just hard-code it into the source like

    PHP Code:
    public void makeDonatorItem1(int itemMapleClient c) {
    // code put here
    }

    public 
    void makeDonatorItem2(int itemMapleClient c) {
    // code put here


  9. #24
    Account Upgraded | Title Enabled! Vietster is offline
    MemberRank
    Dec 2012 Join Date
    305Posts

    Re: Donator NPC that sells edited stat items

    What do you mean by variable hecari o-o sorry for bothering you just sort of clueless at the moment xD

  10. #25
    $_SESSION['DEV']; hecari is offline
    MemberRank
    Dec 2008 Join Date
    336Posts

    Re: Donator NPC that sells edited stat items

    var itemid_inputted;

    itemid_inputted = Integer.parseInt(cm.getText()); //I forget how to parse a text to int in javascript.

    cm.ProDonatorItem(itemid_inputted, c);

  11. #26
    Account Upgraded | Title Enabled! bbhing98 is offline
    MemberRank
    Jul 2012 Join Date
    314Posts

    Re: Donator NPC that sells edited stat items

    Yes finally you understood what I meant. In my opinion, since I'm gonna have more than 10 items to be given out as some event prizes and starter pack items, so I would prefer a line of code that can be fully customized with any item that I want to give up rather than the same stats (yes I fully understand that I can make multiple method but I prefer full customization to the item stats)

  12. #27
    Account Upgraded | Title Enabled! Vietster is offline
    MemberRank
    Dec 2012 Join Date
    305Posts

    Re: Donator NPC that sells edited stat items

    PHP Code:
    var status 0;  
    var 
    itemid_inputted;
    var 
    selected 1;  
    var 
    wui 0;  


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


    function 
    action(modetypeselection) {  
        
    selected selection;  
                if (
    mode == -1) {  
            
    cm.dispose();  
                } else {  
                if (
    mode == && status == 0) {  
            
    cm.dispose();  
        return;  
    }  
                if (
    mode == 1)  
            
    status++;  
        else  
            
    status--;  
                if (
    status == 0) {  
            
    cm.sendAcceptDecline("Hello #h #, Welcome to the IOC Reward Choice! The required amount of Donation Points is 1000 DP, Would you like trade in your points for a IOC? \r\n \r\n You currently have #r#e" cm.getPlayer().getPoints() + " Donation Points. \r\n\r\n Please check your inventory ");
        } else if (
    status == 1) {
            if (
    cm.getChar().isDonator() == true && cm.getPlayer().getPoints() >= 1000 && for (int i GameConstants.itemBlock)) {
        var 
    String "Please Choose your desired Item or NX equip that you wish to gain as a IOC Reward. Please check your Inventory to make sure you have enough room because, we don't give back refunds. Enjoy!\r\n\r\n";  
                
    cm.sendGetText(String+cm.EquipList(cm.getC())); //or is it cm.getPlayer().getClient() ? .___. or (cm.getC()));
            
    } else {  
                
    cm.sendOk("You do not have the requirements. You must be a Donator to use this NPC, a requirement of 1000 DP to purchase, or simply you are purchasing something that does not exist.");  
                
    cm.dispose();
            }  
        } else if (
    status == 2) { 
        
    itemid_inputted Integer.parseInt(cm.getText("Please type in what you would like to receive")); 
            if (
    cm.getPlayer().getPoints() > 1000 ) { 
                            
    cm.getPlayer().gainPoints(-1000); 
                            if (
    cm.canHold(itemid_inputted)) { 
                            
    cm.ProDonatorItem(itemid_inputtedc);
                            
    cm.reloadChar();  
                            
    cm.dispose(); 
                           } else { 
                            
    cm.sendOk("Your inventory is full."); 
                           } 
                           
    cm.dispose(); 
                        } 
                }
        } 
    Hecari can you tell me if this script is correct? of inputting what you told me to

  13. #28
    $_SESSION['DEV']; hecari is offline
    MemberRank
    Dec 2008 Join Date
    336Posts

    Re: Donator NPC that sells edited stat items

    hmmm . Apparently if you want to do search item by name, my method doesnt work, my method simply uses itemID.

    Quote Originally Posted by bbhing98 View Post
    Yes finally you understood what I meant. In my opinion, since I'm gonna have more than 10 items to be given out as some event prizes and starter pack items, so I would prefer a line of code that can be fully customized with any item that I want to give up rather than the same stats (yes I fully understand that I can make multiple method but I prefer full customization to the item stats)
    Then yes, your method is feasible.

  14. #29
    Account Upgraded | Title Enabled! Vietster is offline
    MemberRank
    Dec 2012 Join Date
    305Posts

    Re: Donator NPC that sells edited stat items

    I see, do you have any knowledgeable idea on how to make it search item by name for it? and method that would be best suggested?

  15. #30
    $_SESSION['DEV']; hecari is offline
    MemberRank
    Dec 2008 Join Date
    336Posts

    Re: Donator NPC that sells edited stat items

    I recommend referencing the !search <item> command and implement it into the a function in npc.



Page 2 of 2 FirstFirst 12

Advertisement