Making an MSI only on 1 Item ?

Results 1 to 5 of 5
  1. #1
    Proficient Member TheJava is offline
    MemberRank
    Jan 2014 Join Date
    166Posts

    Making an MSI only on 1 Item ?

    Greetings ,

    Does anyone know how to edit this MSI command ?

    Instead of allowing players to choose their item I want it to be only on 1 item which is 1302000 ( sword ). So once the NPC runs 'cm.MakeGMItem();' the player instantly gets a sword with MSI stats .

    public void MakeGMItem(byte slot, MapleCharacter player) {
    MapleInventory equip = player.getInventory(MapleInventoryType.EQUIP);
    Equip eu = (Equip) equip.getItem(slot);
    int item = equip.getItem(slot).getItemId();
    short hand = eu.getHands();
    byte level = eu.getLevel();
    Equip nItem = new Equip(item, slot, (byte) 0);
    nItem.setStr((short) 32767); // STR
    nItem.setDex((short) 32767); // DEX
    nItem.setInt((short) 32767); // INT
    nItem.setLuk((short) 32767); //LUK
    nItem.setUpgradeSlots((byte) 0);
    nItem.setHands(hand);
    nItem.setLevel(level);
    player.getInventory(MapleInventoryType.EQUIP).removeItem(slot);
    player.getInventory(MapleInventoryType.EQUIP).addFromDB(nItem);
    }

    Thanks
    TheJAVA


  2. #2
    Proficient Member TheJava is offline
    MemberRank
    Jan 2014 Join Date
    166Posts

    Re: Making an MSI only on 1 Item ?

    Bumppp !

    To make things clearer ,

    I'm trying to make like a NPC command and the NPC gives a Alchemist Ring + random str / dex / luk & int.

    Can anyone provide me a custom made one or edit from mine ^ ?

    Thanks
    Last edited by TheJava; 19-01-14 at 03:08 PM.

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

    Re: Making an MSI only on 1 Item ?

    Code:
    public void MakeGMItem(MapleCharacter player) {
    MapleInventory equip = player.getInventory(MapleInventoryType.EQUIP);
    int item = 1302000; // replace 1302000 with the id of the item you want to msi.
    byte slot = equip.getNextFreeSlot(); // Find the method to get the next free slot in MapleInventory.(This code might be different in different version.)
    Equip nItem = new Equip(item, slot, (byte) 0);
    nItem.setStr((short) 32767); // STR
    nItem.setDex((short) 32767); // DEX
    nItem.setInt((short) 32767); // INT
    nItem.setLuk((short) 32767); //LUK
    nItem.setUpgradeSlots((byte) 0);
    player.getInventory(MapleInventoryType.EQUIP).addFromDB(nItem);
    }
    That's about it. Should work.

    Tell me if it work. Been ages since I touch Java.

  4. #4
    Proficient Member TheJava is offline
    MemberRank
    Jan 2014 Join Date
    166Posts

    Re: Making an MSI only on 1 Item ?

    Greetings ,

    I've tested out your way and may I know do I use it like this ? cm.MakeGMItem(cm.getPlayer()); ?

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

    Re: Making an MSI only on 1 Item ?

    How do you use the original code?



Advertisement