Cubing NPC

Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    the one and only Skorch is offline
    MemberRank
    Jun 2012 Join Date
    skorchLocation
    354Posts

    Cubing NPC

    Some people have been asking me for this script, and it's not that hard to make,
    so I figured why not share it with the community since I've already given it out to a few individuals.
    Basically you pick an item you want to cube, pick a cube you want to cube the item with, then every
    time you click the next button, the new item stats will show on your screen. If you're not satisfied with
    the stats you obtained, you can continuously click next to cube.
    Every time you click next, you will lose an amount of NX. Once you are satisfied, you can end the
    NPC chat and pick which line you want to keep if you wish to continue.
    Code:
    importPackage(Packages.tools);importPackage(Packages.constants);
    
    
    var MC = 2500;
    var PMC = 3750;
    var SMC = 5500;
    var RMC = 7250;
    var EMC = 9500;
    var picked = 0;
    
    
    var status = -1;
    var slot = Array();
    var inv;
    var sel = -1;
    var keepline = -1;
    var anotherkeepline = -1;
    var itemid = -1;
    var state = -1;
    
    
    function start() {
        status = -1;
        action(1, 0, 0);
    }
    
    
    function action(mode, type, selection) {
        if (mode == 1)
            status++;
        else {
            cm.dispose();
            return;
        }
        if (status == 0) {
            cm.sendSimple("Ah hello there!~\r\nI am a Cubing NPC.\r\n\r\n#L100#I want to Cube!#l\r\n#L101#I want to buy some cubes!#l\r\n#L102#I just cubed - refresh my inventory!#l");
        } else if (status == 1) {
            state = selection;
            if (state == 101) {
                cm.sendSimple("Welcome to cube seller! Choose which cubes you want to buy \r #L0##i5062000#Miracle Cube - 2500 NX\r\n#L1##i5062001#Premium Miracle Cube - 3750 NX\r\n#L2##i5062002#Super Miracle Cube - 5500 NX\r\n#L3##i5062003#Revolutionary Miracle Cube - 7250 NX\r\n#L4##i5062005#Enlightening Miracle Cube - 9500 NX");
            } else if (state == 100) {
                cm.sendYesNo("Ah hello there. Do you want me to check if you can cube anything? \r\nKeeping one line will cost 5k NX! \r\n(After you closed the NPC chat talk to me again to refresh your inventory.)");
            } else if (state == 102) {
                cm.getPlayer().fakeRelog();
                cm.dispose();
                return;
            } else {
                cm.dispose();
                return;
            }
        } else if (status == 2) {
            if (state == 101) {
                picked = selection;
                cm.sendGetText("Enter the amount of cubes you want");
            } else if (state == 100) {
                if (!cm.haveItem(5062000, 1) && !cm.haveItem(5062001, 1) && !cm.haveItem(5062002, 1) && !cm.haveItem(5062003, 1) && !cm.haveItem(5062005, 1)) {
                    cm.sendOk("You do not have any of these:\r\n #v5062000# #t5062000#\r\n #v5062001# #t5062001#\r\n #v5062002# #t5062002#\r\n #v5062003# #t5062003#\r\n #v5062005# #t5062005#");
                    cm.dispose();
                    return;
                } else {
                    inv = cm.getInventory(1);
                    var bbb = false;
                    var selStr = "I can only cube items which have 2 (or more potential lines):\r\n\r\n#b";
                    for (var i = 0; i <= inv.getSlotLimit(); i++) {
                        slot.push(i);
                        var it = inv.getItem(i);
                        if (it == null || it.getPotential1() == 0 || it.getPotential2() == 0) {
                            continue;
                        }
                        itemid = it.getItemId();
                        //bwg - 7, with hammer is 9.
                        //therefore, we should make the max slots (natural+7)
                        /*if (cm.getNaturalStats(itemid, "tuc") < 0 || itemid == 1122080 || cm.isCash(itemid)) {
                        continue;
                    }*/
                        bbb = true;
                        selStr += "#L" + i + "##v" + itemid + "##t" + itemid + "##l\r\n";
                    }
                    if (!bbb) {
                        cm.sendOk("You don't have any equipments with two (or more) potential lines on them.");
                        cm.dispose();
                        return;
                    }
                    cm.sendSimple(selStr + "#k");
                }
            }
        } else if (status == 3) {
            if (state == 101) {
                if (cm.getText() * 0 != 0) {
                    cm.sendOk("Numbers only!");
                    cm.dispose();
                    return;
                }
                if (picked == 0) {
                    cm.sendYesNo("This will cost you " + cm.getText() * MC + " NX, do you wish to proceed?");
                }
                if (picked == 1) {
                    cm.sendYesNo("This will cost you " + cm.getText() * PMC + " NX, do you wish to proceed?");
                }
                if (picked == 2) {
                    cm.sendYesNo("This will cost you " + cm.getText() * SMC + " NX, do you wish to proceed?");
                }
                if (picked == 3) {
                    cm.sendYesNo("This will cost you " + cm.getText() * RMC + " NX, do you wish to proceed?");
                }
                if (picked == 4) {
                    cm.sendYesNo("This will cost you " + cm.getText() * EMC + " NX, do you wish to proceed?");
                }
            } else if (state == 100) {
                statsSel = inv.getItem(slot[selection]);
                var slots = slot[selection];
                var cuubee = "Which cube to you want to use " + slots + "?";
                if (cm.haveItem(5062000, 1))
                    cuubee += "\r\n#L0##v5062000##t5062000##l\r\n";
                if (cm.haveItem(5062001, 1))
                    cuubee += "\r\n#L1##v5062001##t5062001##l\r\n";
                if (cm.haveItem(5062002, 1))
                    cuubee += "\r\n#L2##v5062002##t5062002##l\r\n";
                if (cm.haveItem(5062005, 1) || cm.haveItem(5062003, 1))
                    cuubee += "\r\n#L3##v5062005##t5062005# or #v5062003##t5062003##l\r\n";
                cm.sendSimple(cuubee);
            }
        } else if (status == 4) {
            if (state == 101) {
                if (picked == 0) {
                    if (cm.getPlayer().getCSPoints(1) >= cm.getText() * MC) {
                        cm.gainItem(5062000, cm.getText());
                        cm.getPlayer().modifyCSPoints(1, -cm.getText() * MC);
                    } else {
                        cm.sendOk("You don't have enough NX");
                    }
                }
                if (picked == 1) {
                    if (cm.getPlayer().getCSPoints(1) >= cm.getText() * PMC) {
                        cm.gainItem(5062001, cm.getText());
                        cm.getPlayer().modifyCSPoints(1, -cm.getText() * PMC);
                    } else {
                        cm.sendOk("You don't have enough NX");
                    }
                }
                if (picked == 2) {
                    if (cm.getPlayer().getCSPoints(1) >= cm.getText() * SMC) {
                        cm.gainItem(5062002, cm.getText());
                        cm.getPlayer().modifyCSPoints(1, -cm.getText() * SMC);
                    } else {
                        cm.sendOk("You don't have enough NX");
                    }
                }
                if (picked == 3) {
                    if (cm.getPlayer().getCSPoints(1) >= cm.getText() * RMC) {
                        cm.gainItem(5062003, cm.getText());
                        cm.getPlayer().modifyCSPoints(1, -cm.getText() * RMC);
                    } else {
                        cm.sendOk("You don't have enough NX");
                    }
                }
                if (picked == 4) {
                    if (cm.getPlayer().getCSPoints(1) >= cm.getText() * EMC) {
                        cm.gainItem(5062005, cm.getText());
                        cm.getPlayer().modifyCSPoints(1, -cm.getText() * EMC);
                    } else {
                        cm.sendOk("You don't have enough NX");
                    }
                }
                cm.dispose();
            } else if (state == 100) {
                if (sel == -1) {
                    sel = selection;
                }
                if (cm.getPlayer().getCSPoints(1) >= 5000) {
                    cm.sendSimple("Do you want to keep one of these? (Costs 5k NX!)\r\nCurrent potentials:\r\n#L1#ID:" + statsSel.getPotential1() + " Name:" + potentialname(statsSel.getPotential1(), itemid) + "#l\r\n#L2#ID:" + statsSel.getPotential2() + " Name:" + potentialname(statsSel.getPotential2(), itemid) + "#l\r\n#L3#ID:" + statsSel.getPotential3() + " Name:" + potentialname(statsSel.getPotential3(), itemid) + "#l\r\n\r\n#L0#No.#l");
                } else {
                    cm.sendSimple("Are you sure you want to cube these potentials away?\r\nCurrent potentials:\r\nID:" + statsSel.getPotential1() + " Name:" + potentialname(statsSel.getPotential1(), itemid) + "\r\nID:" + statsSel.getPotential2() + " Name:" + potentialname(statsSel.getPotential2(), itemid) + "\r\nID:" + statsSel.getPotential3() + " Name:" + potentialname(statsSel.getPotential3(), itemid) + "\r\n\r\n#L0#Yes.#l");
                }
            }
        } else if (status == 5) {
            if (keepline == -1) {
                keepline = selection;
            }
            if (selection != 0) {
                if (cm.getPlayer().getCSPoints(1) >= 10000) {
                    cm.sendSimple("Do you want to keep another of these? (Costs 10k NX!)\r\nCurrent potentials:\r\n#L1#ID:" + statsSel.getPotential1() + " Name:" + potentialname(statsSel.getPotential1(), itemid) + "#l\r\n#L2#ID:" + statsSel.getPotential2() + " Name:" + potentialname(statsSel.getPotential2(), itemid) + "#l\r\n#L3#ID:" + statsSel.getPotential3() + " Name:" + potentialname(statsSel.getPotential3(), itemid) + "#l\r\n\r\n#L0#No.#l");
                } else {
                    cm.sendSimple("Are you sure you want to cube these potentials away?\r\nCurrent potentials:\r\nID:" + statsSel.getPotential1() + " Name:" + potentialname(statsSel.getPotential1(), itemid) + "\r\nID:" + statsSel.getPotential2() + " Name:" + potentialname(statsSel.getPotential2(), itemid) + "\r\nID:" + statsSel.getPotential3() + " Name:" + potentialname(statsSel.getPotential3(), itemid) + "\r\n\r\n#L0#Yes.#l");
                }
            } else {
                if (anotherkeepline == -1) {
                    anotherkeepline = 0;
                    if (keepline != 0)
                        cm.getPlayer().modifyCSPoints(1, -5000);
                }
                renew(statsSel, sel, keepline, anotherkeepline);
            }
        } else if (status == 6) {
            if (anotherkeepline == -1) {
                anotherkeepline = selection;
                if (keepline != 0)
                    cm.getPlayer().modifyCSPoints(1, -15000);
            }
            renew(statsSel, sel, keepline, anotherkeepline);
            status--;
        } else if (status == 7) {
            renew(statsSel, sel, keepline, anotherkeepline);
        } else cm.dispose();
    }
    
    
    function renew(statsSel, selection, keepline, anotherkeepline) {
        if (selection == 0) {
            if (!cm.haveItem(5062000, 1)) {
                cm.sendOk("You have no cubes left!");
                cm.getPlayer().fakeRelog();
                cm.dispose();
                return;
            } else {
                poteee = Math.floor((Math.random()*3)+1);
    
    
                if (anotherkeepline == 0 && keepline == 0) {
                    if (poteee = 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (poteee = 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (poteee = 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                } else if (anotherkeepline == 1 || keepline == 1) {
                    if (poteee = 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (poteee = 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                } else if (anotherkeepline == 2 || keepline == 2) {
                    if (poteee = 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (poteee = 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                } else if (anotherkeepline == 3 || keepline == 3) {
                    if (poteee = 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (poteee = 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                }
                cm.gainItem(5062000, -1);
                cm.sendNext("Do you want to keep going?\r\nCurrent potentials:\r\nID:" + statsSel.getPotential1() + " Name:" + potentialname(statsSel.getPotential1(), itemid) + "\r\nID:" + statsSel.getPotential2() + " Name:" + potentialname(statsSel.getPotential2(), itemid) + "\r\nID:" + statsSel.getPotential3() + " Name:" + potentialname(statsSel.getPotential3(), itemid) + "\r\n");
            }
        } else if (selection == 1) {
            if (!cm.haveItem(5062001, 1)) {
                cm.sendOk("You have no cubes left!");
                cm.getPlayer().fakeRelog();
                cm.dispose();
                return;
            } else {
                poteee = Math.floor((Math.random()*3)+1);
                poteeee = Math.floor((Math.random()*3)+1);
    
    
                if (anotherkeepline == 0 && keepline == 0) {
                    if (poteee = 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (poteee = 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (poteee = 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                    if (poteeee = 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (poteeee = 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (poteeee = 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                } else if (anotherkeepline == 0 && keepline != 0) {
                    cm.getPlayer().modifyCSPoints(1, -5000);
                    if (keepline != 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (keepline != 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (keepline != 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                } else if (anotherkeepline != 0 && keepline != 0) {
                    cm.getPlayer().modifyCSPoints(1, -15000);
                    if (anotherkeepline != 1 && keepline != 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (anotherkeepline != 2 && keepline != 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (anotherkeepline != 3 && keepline != 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                }
                cm.gainItem(5062001, -1);
                cm.sendNext("Do you want to keep going?\r\nCurrent potentials:\r\nID:" + statsSel.getPotential1() + " Name:" + potentialname(statsSel.getPotential1(), itemid) + "\r\nID:" + statsSel.getPotential2() + " Name:" + potentialname(statsSel.getPotential2(), itemid) + "\r\nID:" + statsSel.getPotential3() + " Name:" + potentialname(statsSel.getPotential3(), itemid) + "\r\n");
            }
        } else if (selection == 2) {
            if (!cm.haveItem(5062002, 1)) {
                cm.sendOk("You have no cubes left!");
                cm.getPlayer().fakeRelog();
                cm.dispose();
                return;
            } else {
                if (anotherkeepline == 0 && keepline == 0) {
                    statsSel.setPotential1(cm.getRandomPotential());
                    statsSel.setPotential2(cm.getRandomPotential());
                    statsSel.setPotential3(cm.getRandomPotential());
                } else if (anotherkeepline == 0 && keepline != 0) {
                    if (keepline != 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (keepline != 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (keepline != 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                } else if (anotherkeepline != 0 && keepline != 0) {
                    if (anotherkeepline != 1 && keepline != 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (anotherkeepline != 2 && keepline != 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (anotherkeepline != 3 && keepline != 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                }
                cm.gainItem(5062002, -1);
                cm.sendNext("Do you want to keep going?\r\nCurrent potentials:\r\nID:" + statsSel.getPotential1() + " Name:" + potentialname(statsSel.getPotential1(), itemid) + "\r\nID:" + statsSel.getPotential2() + " Name:" + potentialname(statsSel.getPotential2(), itemid) + "\r\nID:" + statsSel.getPotential3() + " Name:" + potentialname(statsSel.getPotential3(), itemid) + "\r\n");
            }
        } else if (selection == 3) {
            if (!cm.haveItem(5062005, 1) && !cm.haveItem(5062003, 1)) {
                cm.sendOk("You have no cubes left!");
                cm.getPlayer().fakeRelog();
                cm.dispose();
                return;
            } else {
                if (anotherkeepline == 0 && keepline == 0) {
                    statsSel.setPotential1(cm.getRandomPotential());
                    statsSel.setPotential2(cm.getRandomPotential());
                    statsSel.setPotential3(cm.getRandomPotential());
                } else if (anotherkeepline == 0 && keepline != 0) {
                    if (keepline != 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (keepline != 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (keepline != 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                } else if (anotherkeepline != 0 && keepline != 0) {
                    if (anotherkeepline != 1 && keepline != 1)
                        statsSel.setPotential1(cm.getRandomPotential());
                    if (anotherkeepline != 2 && keepline != 2)
                        statsSel.setPotential2(cm.getRandomPotential());
                    if (anotherkeepline != 3 && keepline != 3)
                        statsSel.setPotential3(cm.getRandomPotential());
                }
                if (cm.haveItem(5062003, 1))
                    cm.gainItem(5062003, -1);
                else
                    cm.gainItem(5062005, -1);
                cm.sendNext("Do you want to keep going?\r\nCurrent potentials:\r\nID:" + statsSel.getPotential1() + " Name:" + potentialname(statsSel.getPotential1(), itemid) + "\r\nID:" + statsSel.getPotential2() + " Name:" + potentialname(statsSel.getPotential2(), itemid) + "\r\nID:" + statsSel.getPotential3() + " Name:" + potentialname(statsSel.getPotential3(), itemid) + "\r\n");
            }
        }
    }
    
    
    function potentialname(potpot, item) {
        return GameConstants.resolvePotentialID(item, potpot);;
    }
    In NPCConversationManager
    Code:
        public final int getRandomPotential() {
            List<Integer> list = new ArrayList<Integer>(MapleItemInformationProvider.getInstance().getAllPotentialInfo().keySet());
            Collections.sort(list);
            return list.get(Randomizer.nextInt(list.size()));
        }
    
    
    public static String resolvePotentialID(final int itemID, final int potID){ 
            final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); 
            int eqLevel = ii.getReqLevel(itemID); //TODO: Check for invalid itemID 
            int potLevel; 
            final List<StructItemOption> potInfo = MapleItemInformationProvider.getInstance().getPotentialInfo(potID); 
            //gets the "real potential level" 
            if(eqLevel == 0){ 
                potLevel = 1; 
            } else { 
                potLevel = (eqLevel+1)/10; 
                potLevel++; 
            } 
             
            if(potID == 0){ 
                return "No potential"; 
            } else if (potID < 0){ 
                return "Hidden potential"; 
            } 
            StructItemOption st = potInfo.get(potLevel-1); 
             
            String sb = st.opString; 
            for(int i=0;i<st.opString.length();i++){ 
                //# denotes the beginning of the parameter name that needs to be replaced, e.g. "Weapon DEF: +#incPDD" 
                if(st.opString.charAt(i) == '#'){ 
                    int j = i + 2; 
                    while((j < st.opString.length()) && st.opString.substring(i+1, j).matches("^[a-zA-Z]+$")){ 
                        j++; 
                    } 
                    String curParam = st.opString.substring(i,j); 
                    String curParamStripped; 
                    //get rid of any trailing percent signs on the parameter name 
                    if(j != st.opString.length() || st.opString.charAt(st.opString.length()-1) == '%'){ //hacky 
                        curParamStripped = curParam.substring(1, curParam.length()-1); 
                    } else { 
                        curParamStripped = curParam.substring(1); 
                    } 
                     
                    String paramValue = Integer.toString(st.get(curParamStripped)); 
    
                    if(curParam.charAt(curParam.length()-1) == '%'){ 
                        paramValue = paramValue.concat("%"); 
                    } 
                    sb = sb.replace(curParam, paramValue); 
                } 
            } 
            return sb; 
        } 
    
    
    
        public void fakeRelog() {
            this.client.getSession().write(CField.getCharInfo(this));
            MapleMap mapp = getMap();
            mapp.setCheckStates(false);
            mapp.removePlayer(this);
            mapp.addPlayer(this);
            mapp.setCheckStates(true);
    
            this.client.getSession().write(CWvsContext.getFamiliarInfo(this));
        }
    Enjoy!
    Last edited by Skorch; 30-12-13 at 06:51 AM.


  2. #2
    Banned SilentThief is offline
    BannedRank
    Sep 2012 Join Date
    The MatrixLocation
    466Posts

    Re: Cubing NPC

    I'm waiting for oxy to get here and say that there are to many vars and to little of arrays.

    OT: Fantastic release. Much appreciated, also, anyone who is wondering, the fakeRelog method in this script isn't in every source, go and...code it or leech it.

  3. #3
    Valued Member Neptunia is offline
    MemberRank
    Dec 2013 Join Date
    105Posts

    Re: Cubing NPC

    >Says leecher proofing is unnecessary
    >release npc without methods

  4. #4
    Banned SilentThief is offline
    BannedRank
    Sep 2012 Join Date
    The MatrixLocation
    466Posts

    Re: Cubing NPC

    Quote Originally Posted by Lynx1213 View Post
    >Says leecher proofing is unnecessary
    >release npc without methods
    What do you need 1-3 easy methods for this? :3

  5. #5
    Account Upgraded | Title Enabled! cindylim is offline
    MemberRank
    Jan 2013 Join Date
    218Posts

    Re: Cubing NPC

    rg.mozilla.javascript.internal.EvaluatorException: Java class "constants.GameCon
    stants" has no public instance field or method named "resolvePotentialID". (<Unk
    nown source>#355) in <Unknown source> at line number 355

  6. #6
    Omega sunnyboy is offline
    MemberRank
    Mar 2010 Join Date
    6,109Posts

    Re: Cubing NPC

    my cube npc 108 lines and cud still be shorter! but nice job i guess

  7. #7
    Banned SilentThief is offline
    BannedRank
    Sep 2012 Join Date
    The MatrixLocation
    466Posts

    Re: Cubing NPC

    Quote Originally Posted by ExtremeDevilz View Post
    -
    Obviously in that persons source, there is no resolvePotentialID method.

    HOW TO FIX: ADD THE METHOD (aka code it in)

  8. #8
    That one pokemon thing Luxray is offline
    MemberRank
    Apr 2010 Join Date
    2,043Posts

    Re: Cubing NPC

    Even though it's a good release (at least original), why make it? You're literally saving a few seconds per cube if you do it this way instead of the normal way.

    Edit: There are some useful tricks in this NPC that are useful too though. (Ex: if (cm.getText() * 0 != 0) {)
    Last edited by Kreeate; 29-12-13 at 07:48 PM.

  9. #9
    Beep Boop Rampenbram is online now
    MemberRank
    Feb 2009 Join Date
    The NetherlandsLocation
    341Posts

    Re: Cubing NPC

    If you people are smart, it's already been released.

    public static String resolvePotentialID(final int itemID, final int potID) {

  10. #10
    desk.getCoffee().drink(); AngelSpirit is offline
    MemberRank
    Jul 2010 Join Date
    CanadaLocation
    318Posts

    Re: Cubing NPC

    Shameless (but relevant) self-plug here.

  11. #11
    ♥Fatal|Error♥ JungleByte is offline
    MemberRank
    Oct 2009 Join Date
    Singapore, SingLocation
    1,096Posts

    Re: Cubing NPC

    getRandomPotential? Hmm

  12. #12
    Account Upgraded | Title Enabled! cindylim is offline
    MemberRank
    Jan 2013 Join Date
    218Posts

    Re: Cubing NPC

    can make 5 line?

  13. #13
    the one and only Skorch is offline
    MemberRank
    Jun 2012 Join Date
    skorchLocation
    354Posts

    Re: Cubing NPC

    Quote Originally Posted by cindylim View Post
    can make 5 line?
    Depends on the source you're using.
    This NPC doesn't affect it at all, it's just a shortcut to cubing.

  14. #14
    Proficient Member nukehead1 is offline
    MemberRank
    Apr 2013 Join Date
    178Posts

    Re: Cubing NPC

    Quote Originally Posted by Hecarim View Post
    Depends on the source you're using.
    This NPC doesn't affect it at all, it's just a shortcut to cubing.
    Do you have getRandomPotential for NPCConversation Mangaer

  15. #15
    desk.getCoffee().drink(); AngelSpirit is offline
    MemberRank
    Jul 2010 Join Date
    CanadaLocation
    318Posts

    Re: Cubing NPC

    Quote Originally Posted by nukehead1 View Post
    Do you have getRandomPotential for NPCConversation Mangaer
    It shouldn't be difficult to make; select a random potential, discard if the optionType doesn't fit the desired item or rank, repeat till found.

    Actually, OP, I'm curious to see your implementation of getRandomPotential(). I somehow doubt that you managed to get all the checks working as they should, considering how annoying potentials are:

    * The optionType property, for starters, needs to be checked. Else you'll wind up placing potentials on equipment they shouldn't be on, e.g. %Boss Damage on armors and accessories.
    * You also need to discard potentials >= 60000 (these are the dojo glove potentials) and < 10000, as those can't appear on normal items.
    * On top of that, you need to check potential rank properly. An item can have potentials not only of its current rank, but of one rank lower than it; that is, Epic-ranked items can have Epic or Rare potential lines, Unique-ranked can have Unique or Epic lines, and Legendary-ranked can have Legendary or Unique. You also need to make sure that any item always has at least one line of its rank.



Page 1 of 2 12 LastLast

Advertisement