Inventory and some test items

Results 1 to 11 of 11
  1. #1
    DBO Freak xDarKyx is offline
    MemberRank
    Mar 2011 Join Date
    280Posts

    Inventory and some test items

    Could someone please explain how to add the inventory case ( if it's needed) and some example for the items.


  2. #2
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: Inventory and some test items

    Here...
    Code:
    CNtlPacket packet(sizeof(sGU_ITEM_CREATE));
    sGU_ITEM_CREATE * sPacket = (sGU_ITEM_CREATE *)packet.GetPacketData();
                                
    sPacket->wOpCode = GU_ITEM_CREATE;
    sPacket->handle = AcquireSerialId(); //
    sPacket->sItemData.itemNo = ItemID;
    sPacket->sItemData.byPlace = Where;
    sPacket->sItemData.byPosition = PositionOfWhere;
    sPacket->sItemData.byRank = ITEM_RANK_NORMAL;
    sPacket->sItemData.byStackcount = 0;
    sPacket->sItemData.byCurrentDurability = 100;
                                
    packet.SetPacketLen( sizeof(sGU_ITEM_CREATE) );
    int rc = g_pApp->Send( this->GetHandle(), &packet );
    PD: In here you have the ranks.

    Code:
    ITEM_RANK_NOTHING
    ITEM_RANK_NORMAL
    ITEM_RANK_SUPERIOR
    ITEM_RANK_EXCELLENT
    ITEM_RANK_RARE
    ITEM_RANK_LEGENDARY

  3. #3
    DBO Freak xDarKyx is offline
    MemberRank
    Mar 2011 Join Date
    280Posts

    Re: [Help] Inventory and some test items

    I used the following lines, added them to my GameServer.
    Code:
    //////////////////////////////////////////////////////////////////////////////////////
    							  ////item infosGU_AVATAR_ITEM_INFO sPacket;
    							  //
    							  CNtlPacket packet3(sizeof(sGU_AVATAR_ITEM_INFO));
    							  sGU_AVATAR_ITEM_INFO * sPacket3 = (sGU_AVATAR_ITEM_INFO *)packet3.GetPacketData();
    							  
    							  sPacket3->wOpCode =GU_AVATAR_ITEM_INFO;
    							  sPacket3->byBeginCount = 1;
    							  sPacket3->byItemCount = 1;
    
    							  sPacket3->aItemProfile[0].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[0].tblidx = 19901;
    							  sPacket3->aItemProfile[0].byPlace = CONTAINER_TYPE_BAGSLOT;
    							  sPacket3->aItemProfile[0].byPos = 0;
    							  sPacket3->aItemProfile[0].byStackcount = 0;
    							  sPacket3->aItemProfile[0].byRank = 1;
    							  sPacket3->aItemProfile[0].byCurDur = 10;
    							  
    
    
    
    							  packet3.SetPacketLen(sizeof(sGU_AVATAR_ITEM_INFO));
    							  rc = g_pApp->Send(this->GetHandle() ,&packet3);
    And for some reason when i try to Enter the GameServer, I get this error:


    Does anyone have any idea why this could happen?

  4. #4
    AKCore ATIDOT3 is offline
    MemberRank
    Apr 2013 Join Date
    BinaryLocation
    536Posts

    Re: [Help] Inventory and some test items

    bad packet i think, exceed allow size.

    you should add std::cout for see what is happening.

  5. #5
    Dbo Dev Daneos is offline
    MemberRank
    Sep 2009 Join Date
    GermanyLocation
    933Posts

    Re: [Help] Inventory and some test items

    I do the bind to world function now and then I also wanted to work on the items function. Maybe we can work together.

  6. #6
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: [Help] Inventory and some test items

    I'm working with he too. We can work the three of us.

  7. #7
    DBO Freak xDarKyx is offline
    MemberRank
    Mar 2011 Join Date
    280Posts

    Re: [Help] Inventory and some test items

    The problem is the following.
    RwInt32 iDataLen = sizeof(sNTLPACKETHEADER);
    iDataLen += sizeof(BYTE);
    iDataLen += sizeof(sITEM_PROFILE)*sPacket.byItemCount;

    SendEvent(iDataLen, &sPacket);
    the code should look something like this

  8. #8
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: [Help] Inventory and some test items

    No, that is for DBOVirtualServer.

    - - - Updated - - -

    I have that form and doesn't work.

  9. #9
    DBO Freak xDarKyx is offline
    MemberRank
    Mar 2011 Join Date
    280Posts

    Re: [Help] Inventory and some test items

    Well, I did this , and I belive it is correctly written, my gameserver lets me connect now.
    But I can't see any inventory.

    Code:
    //////////////////////////////////////////////////////////////////////////////////////
    							  ////item infos GU_AVATAR_ITEM_INFO sPacket3; Not yet working
    							  
    							  
    							  CNtlPacket packet3(sizeof(sGU_AVATAR_ITEM_INFO));
    							  sGU_AVATAR_ITEM_INFO * sPacket3 = (sGU_AVATAR_ITEM_INFO *)packet3.GetPacketData();
    							  
    							  sPacket3->wOpCode =GU_AVATAR_ITEM_INFO;
    							  sPacket3->byItemCount = 11;
    
    							  sPacket3->aItemProfile[0].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[0].tblidx = 19901;
    							  sPacket3->aItemProfile[0].byPlace = CONTAINER_TYPE_BAGSLOT;
    							  sPacket3->aItemProfile[0].byPos = 0;
    							  sPacket3->aItemProfile[0].byStackcount = 0;
    							  sPacket3->aItemProfile[0].byRank = 1;
    							  sPacket3->aItemProfile[0].byCurDur = 10;
    
    							  sPacket3->aItemProfile[1].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[1].tblidx = 13001;
    							  sPacket3->aItemProfile[1].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[1].byPos = 0;
    							  sPacket3->aItemProfile[1].byStackcount = 0;
    							  sPacket3->aItemProfile[1].byRank = 1;
    							  sPacket3->aItemProfile[1].byCurDur = 100;
    
    							  sPacket3->aItemProfile[2].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[2].tblidx = 19905;
    							  sPacket3->aItemProfile[2].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[2].byPos = 1;
    							  sPacket3->aItemProfile[2].byStackcount = 1;
    							  sPacket3->aItemProfile[2].byRank = 1;
    							  sPacket3->aItemProfile[2].byCurDur = 100;
    
    							  sPacket3->aItemProfile[3].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[3].tblidx = 13002;
    							  sPacket3->aItemProfile[3].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[3].byPos = 2;
    							  sPacket3->aItemProfile[3].byStackcount = 1;
    							  sPacket3->aItemProfile[3].byRank = 1;
    							  sPacket3->aItemProfile[3].byCurDur = 100;
    
    							  sPacket3->aItemProfile[4].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[4].tblidx = 13003;
    							  sPacket3->aItemProfile[4].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[4].byPos = 3;
    							  sPacket3->aItemProfile[4].byStackcount = 0;
    							  sPacket3->aItemProfile[4].byRank = 1;
    							  sPacket3->aItemProfile[4].byCurDur = 100;
    
    							  sPacket3->aItemProfile[5].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[5].tblidx = 14001;
    							  sPacket3->aItemProfile[5].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[5].byPos = 4;
    							  sPacket3->aItemProfile[5].byStackcount = 0;
    							  sPacket3->aItemProfile[5].byRank = 1;
    							  sPacket3->aItemProfile[5].byCurDur = 100;
    
    							  sPacket3->aItemProfile[6].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[6].tblidx = 14002;
    							  sPacket3->aItemProfile[6].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[6].byPos = 5;
    							  sPacket3->aItemProfile[6].byStackcount = 0;
    							  sPacket3->aItemProfile[6].byRank = 1;
    							  sPacket3->aItemProfile[6].byCurDur = 100;
    
    							  sPacket3->aItemProfile[7].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[7].tblidx = 14003;
    							  sPacket3->aItemProfile[7].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[7].byPos = 6;
    							  sPacket3->aItemProfile[7].byStackcount = 0;
    							  sPacket3->aItemProfile[7].byRank = 1;
    							  sPacket3->aItemProfile[7].byCurDur = 100;
    
    							  sPacket3->aItemProfile[8].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[8].tblidx = 15001;
    							  sPacket3->aItemProfile[8].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[8].byPos = 7;
    							  sPacket3->aItemProfile[8].byStackcount = 0;
    							  sPacket3->aItemProfile[8].byRank = 1;
    							  sPacket3->aItemProfile[8].byCurDur = 100;
    
    							  sPacket3->aItemProfile[9].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[9].tblidx = 15002;
    							  sPacket3->aItemProfile[9].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[9].byPos = 8;
    							  sPacket3->aItemProfile[9].byStackcount = 0;
    							  sPacket3->aItemProfile[9].byRank = 1;
    							  sPacket3->aItemProfile[9].byCurDur = 100;
    
    							  sPacket3->aItemProfile[10].handle = AcquireSerialId();
    							  sPacket3->aItemProfile[10].tblidx = 15003;
    							  sPacket3->aItemProfile[10].byPlace = CONTAINER_TYPE_BAG1;
    							  sPacket3->aItemProfile[10].byPos = 9;
    							  sPacket3->aItemProfile[10].byStackcount = 0;
    							  sPacket3->aItemProfile[10].byRank = 1;
    							  sPacket3->aItemProfile[10].byCurDur = 100;
    
    							  
    							  int iDataLen = sizeof(sNTLPACKETHEADER);
    
    							  iDataLen += sizeof(BYTE);
    							  iDataLen += sizeof(sITEM_PROFILE)*sPacket3->byItemCount;
    
    			
    							  rc = g_pApp->Send(iDataLen, &packet3);

  10. #10
    DBO Freak xDarKyx is offline
    MemberRank
    Mar 2011 Join Date
    280Posts

    Re: [Help] Inventory and some test items

    Topic Closed.

  11. #11
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: Inventory and some test items

    @maximojoni you have this problem.

    Try to change your code to

    Code:
    int rc = g_pApp->Send( this->GetHandle(), &packet );
    
    
    int rc = g_pApp->Send(iDataLen, &packet);
    PD:

    maximojoni has exceeded their stored private messages quota and cannot accept further messages until they clear some space.

    - - - Updated - - -
    @maximojoni so? works? And delete recived messages, because you have a full inbox.



Advertisement