Make item with random stats

Results 1 to 4 of 4
  1. #1
    Proficient Member Mr mr is offline
    MemberRank
    Mar 2013 Join Date
    167Posts

    Make item with random stats

    I saw this at the original maplestory scripts:
    Code:
    ret = inven.exchangeEx( 0, "4001129", -n3, "1312006,Variation:3", 1 );
    i am wondering how can it be done with java. I think this "Variation" tells the server to make a item with random stats. Any suggestion?


  2. #2
    Moderator Eric is offline
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    3,188Posts

    Re: Make item with random stats

    of course you can create an item with random stats.. it's already in sources.

    Here's Lithium's:
    Code:
    public void MakeNoobPot(byte slot, MapleCharacter player) {
            int randst = (int) (100.0 * Math.random()) + 21;
            MapleInventory equip = player.getInventory(MapleInventoryType.EQUIP);
            Equip eu = (Equip) equip.getItem(slot);
            int item = equip.getItem(slot).getItemId();
            // MapleJob job = eu.();
            short hand = eu.getHands();
            byte level = eu.getLevel();
            Equip nItem = new Equip(item, equip.getNextFreeSlot(), (byte)0);
            nItem.setStr((short) randst); // STR
            nItem.setDex((short) randst); // DEX
            nItem.setInt((short) randst); // INT
            nItem.setLuk((short) randst); //LUK
            nItem.setWatk((short) randst); // WA
            nItem.setUpgradeSlots((byte) 0); // SLOT
            //nItem.setJob(job);
            nItem.setHands(hand);
            nItem.setLevel(level);
            player.getInventory(MapleInventoryType.EQUIP).addFromDB(nItem);
        }
    This will randomize stats on the item. Just call this function and change the randoms if you want.

  3. #3
    Proficient Member Tenchio is offline
    MemberRank
    Jan 2013 Join Date
    162Posts

    Re: Make item with random stats

    This just gave me an idea, I going to create a special event for this. owo

  4. #4
    Proficient Member Mr mr is offline
    MemberRank
    Mar 2013 Join Date
    167Posts

    Re: Make item with random stats

    Quote Originally Posted by chunkarama View Post
    of course you can create an item with random stats.. it's already in sources.

    Here's Lithium's:
    Code:
    public void MakeNoobPot(byte slot, MapleCharacter player) {
            int randst = (int) (100.0 * Math.random()) + 21;
            MapleInventory equip = player.getInventory(MapleInventoryType.EQUIP);
            Equip eu = (Equip) equip.getItem(slot);
            int item = equip.getItem(slot).getItemId();
            // MapleJob job = eu.();
            short hand = eu.getHands();
            byte level = eu.getLevel();
            Equip nItem = new Equip(item, equip.getNextFreeSlot(), (byte)0);
            nItem.setStr((short) randst); // STR
            nItem.setDex((short) randst); // DEX
            nItem.setInt((short) randst); // INT
            nItem.setLuk((short) randst); //LUK
            nItem.setWatk((short) randst); // WA
            nItem.setUpgradeSlots((byte) 0); // SLOT
            //nItem.setJob(job);
            nItem.setHands(hand);
            nItem.setLevel(level);
            player.getInventory(MapleInventoryType.EQUIP).addFromDB(nItem);
        }
    This will randomize stats on the item. Just call this function and change the randoms if you want.
    By reading this code, I can see how it works, but it won't work for me. You'll need to make some changes.. By the way, thanks



Advertisement