[Packet]Use_flag_scroll how i can identify Inventorytype?

Results 1 to 9 of 9
  1. #1
    Apprentice RomantiCs is offline
    MemberRank
    Oct 2008 Join Date
    19Posts

    sad [Packet]Use_flag_scroll how i can identify Inventorytype?

    Hi. Tody i try to use item Lucky Day Scroll and Protection Scroll.
    But i don't know how to identify inventory type from this item.
    Becuase i got receive op code[Use_flag_scroll] and packet specify inventory position. But don't have inventory type.

    *Protection scroll and Shilding ward have same property.But defferent type.
    ID: 2531000 NAME: Protection Scroll [Inventory type : USE]
    ID: 5064000 NAME: Shielding Ward [Inventory type : CASH]
    So. When used item i got same header [USE_FLAG_SCROLL]

    Packet for Use_flag_scroll

    [Received] USE_FLAG_SCROLL (Protection scroll [USE SLOT])
    Data: [FF 74 96 06] [04 00] [F5 FF] [00]


    [FF 74 96 06] = Player Tick
    [04 00] = Scroll Position
    [F5 FF] = Equip Position
    [00] = Unknown
    ---------------------------------------------------
    [Received] USE_FLAG_SCROLL (Sheilding ward [CASH Slot])
    Data: [05 12 99 06] [01 00] [F5 FF] [00]


    [05 12 99 06] = Player Tick
    [01 00] = Scroll Position
    [F5 FF] = Equip Position
    [00] = Unknown


    When received packet server i will get scroll from position. but fixed inventory type?
    Code:
    short scrollpos = slea.readShort();
    Item scroll = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(scrollpos);
    Now I can't identify Inventorytype.
    Please help me thx.
    Ps.sorry for posting invalid category


  2. #2
    Wut. QuietCrystal is offline
    MemberRank
    Aug 2010 Join Date
    SingaporeLocation
    346Posts

    Re: [Packet]Use_flag_scroll how i can identify Inventorytype?

    Inventory type is itemID / 1000000. 2 = Use, 5 = Cash

  3. #3
    Member bekzod13 is offline
    MemberRank
    May 2010 Join Date
    86Posts

    Re: [Packet]Use_flag_scroll how i can identify Inventorytype?

    Quote Originally Posted by QuietCrystal View Post
    Inventory type is itemID / 1000000. 2 = Use, 5 = Cash
    Read before you post, if u look at the packet, there is no indication of an itemid, it just comes with a position short, but some packets seem to be in both cash and use inventories. so you cant simply do itemID / 1000000.

    OT: My only suggestion is, are you sure this is the correct shielding ward they use ingame. I know they have multiple version of the same equip sometimes.

  4. #4
    Apprentice RomantiCs is offline
    MemberRank
    Oct 2008 Join Date
    19Posts

    Re: [Packet]Use_flag_scroll how i can identify Inventorytype?

    I'm sure protection = shielding ward.
    Protection scroll can founded by cygnus.
    Shielding ward can founded by Buy at cashshop.

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

    Re: [Packet]Use_flag_scroll how i can identify Inventorytype?

    I remember having this problem.

    Basically, you can't. You can't tell the difference, not really; the packet just doesn't have that data in it. You need to do some heuristics to guess which inventory tab has the scroll you are looking for. Check which inventory tab at the given position has a valid scroll in it; that is the tab you are looking for.

  6. #6
    Moongran Saii is offline
    MemberRank
    Jan 2012 Join Date
    510Posts

    Re: [Packet]Use_flag_scroll how i can identify Inventorytype?

    I had this problem too once, and never actually solved it.
    the easiest solution would be enabling just one kind of scrolls of this type(cash only, or use only).
    like shielding ward instead of protection scroll

  7. #7
    Apprentice RomantiCs is offline
    MemberRank
    Oct 2008 Join Date
    19Posts

    Re: [Packet]Use_flag_scroll how i can identify Inventorytype?

    Maybe i can solve it.

    Code:
    scrollpos = slea.readShort(); //For readiong position of scroll when used.
    Item scroll = c.getPlayer().getInventory(MapleInventoryType.CASH).getItem(scrollpos);
    
    if(scroll == null || !Gameconstants.isFlagScroll(scroll.getItemId())) {
        scroll = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(scrollpos);
        if(!Gameconstants.isFlagScroll(scroll.getItemId())) {
             c.getSession().write(CWvsContext.enableActions());
        }
    }
    ps.If you use this souce you should copy + paste and fix some syntax error. Because i don't copy from my souce. :)

  8. #8
    Wut. QuietCrystal is offline
    MemberRank
    Aug 2010 Join Date
    SingaporeLocation
    346Posts

    Re: [Packet]Use_flag_scroll how i can identify Inventorytype?

    Quote Originally Posted by bekzod13 View Post
    Read before you post, if u look at the packet, there is no indication of an itemid, it just comes with a position short, but some packets seem to be in both cash and use inventories. so you cant simply do itemID / 1000000.

    OT: My only suggestion is, are you sure this is the correct shielding ward they use ingame. I know they have multiple version of the same equip sometimes.
    My bad haha, wasn't paying that well attention when reading the post ):

    OT: Stepping away from the problem, would it be possible to just restrict the use of the protection scroll, and instead give players the shielding ward?

  9. #9
    <3 Dynamik is offline
    MemberRank
    Feb 2011 Join Date
    TorontoLocation
    532Posts

    Re: [Packet]Use_flag_scroll how i can identify Inventorytype?

    I am not sure if I am a bit rusty or whatever, and I don't have any source code on me, but wouldn't this work:

    scroll.getItemId(), and check if it equals 2531000 (or whatever IDs in that category that is a USE scroll). If not, it would be a cash item?



Advertisement