PETFILTER (copy paste)

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Blessed Developer Akerius is offline
    MemberRank
    Apr 2011 Join Date
    Planet OithLocation
    280Posts

    PETFILTER (copy paste)

    this guide is for those who cant follow the source given by Johnny
    just follow and paste the code

    Spoiler:

    First:

    _AIInterface Folder (AIPet.cpp)

    Look for
    Code:
    BOOL CAIPet::SubItemLoot( void )
    paste the code under
    Code:
    if( pItemProp )
    {
    Spoiler:

    BOOL b1 = TRUE;
    #ifdef _PETFILTER_HOL_B
    if(!pOwner->bQuestItem && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GEM && pItemProp->dwItemKind3 == IK3_GEM)
    b1 = FALSE;
    else if(!pOwner->bWeapons && pItemProp->dwItemKind1 == IK1_WEAPON)
    b1 = FALSE;
    else if(!pOwner->bArmor && pItemProp->dwItemKind1 == IK1_ARMOR)
    b1 = FALSE;
    else if(!pOwner->bCards && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && pItemProp->dwItemKind3 != IK3_ULTIMATE && pItemProp->dwItemKind3 != IK3_ENCHANT && pItemProp->dwItemKind3 != IK3_PIERDICE)
    b1 = FALSE;
    else if(!pOwner->bFood && pItemProp->dwItemKind1 == IK1_GENERAL && (pItemProp->dwItemKind2 == IK2_FOOD || pItemProp->dwItemKind2 == IK2_REFRESHER || pItemProp->dwItemKind2 == IK2_POTION))
    b1 = FALSE;
    else if(!pOwner->bEggs && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GENERAL && pItemProp->dwItemKind3 == IK3_EGG)
    b1 = FALSE;
    else if(!pOwner->bStones && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && (pItemProp->dwItemKind3 == IK3_PIERDICE || pItemProp->dwItemKind3 == IK3_ENCHANT || pItemProp->dwItemKind3 == IK3_ULTIMATE || pItemProp->dwItemKind3 == IK3_SUPSTONE))
    b1 = FALSE;
    else if(!pOwner->bAccessory && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind3 == IK2_JEWELRY)
    b1 = FALSE;
    #endif


    2nd: _Common (Mover.cpp)

    Under this
    Code:
    #endif	// __PET_1024
    #endif	// __CLIENT
    Copy and paste this
    Spoiler:

    #ifdef __CLIENT
    #ifdef _PETFILTER_HOL_B
    void CMover::SendBuffPetCollectUpdate()
    {
    if(this->IsPlayer())
    {
    g_DPlay.SendBuffPetCollectUpdate();
    }
    }
    #endif
    #endif


    3rd: _Common (Mover.h)

    Under this
    Code:
    DWORD			m_dwStateMode;
    Copy and Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B
    BOOL bQuestItem, bWeapons, bArmor, bCards, bFood, bEggs, bStones, bAccessory;
    #endif

    Under this
    Code:
    void			SetCmdParam( int nIdx, int nValue ) { m_nCParam[nIdx] = nValue; }
    Copy and Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B
    public:
    void SendBuffPetSelect();
    void SendBuffPetCollectUpdate();
    private:
    #endif


    4th: _Interface (WndPetSys.cpp)

    Under this
    Code:
    m_nCtrlId[7] = WIDC_BUFFPET_SLOT8;
    Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B

    CWndButton* chk = (CWndButton*) GetDlgItem( WIDC_CHECK1 );
    chk->SetCheck(g_DPlay.bQuestItem);

    chk = (CWndButton*) GetDlgItem( WIDC_CHECK2 );
    chk->SetCheck(g_DPlay.bWeapons);

    chk = (CWndButton*) GetDlgItem( WIDC_CHECK3 );
    chk->SetCheck(g_DPlay.bArmor);

    chk = (CWndButton*) GetDlgItem( WIDC_CHECK4 );
    chk->SetCheck(g_DPlay.bCards);

    chk = (CWndButton*) GetDlgItem( WIDC_CHECK5 );
    chk->SetCheck(g_DPlay.bFood);

    chk = (CWndButton*) GetDlgItem( WIDC_CHECK6 );
    chk->SetCheck(g_DPlay.bEggs);

    chk = (CWndButton*) GetDlgItem( WIDC_CHECK7 );
    chk->SetCheck(g_DPlay.bStones);

    chk = (CWndButton*) GetDlgItem( WIDC_CHECK8 );
    chk->SetCheck(g_DPlay.bAccessory);

    #endif

    Under this
    Code:
    BOOL CWndBuffPetStatus::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
    {
    Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B
    switch ( nID )
    {
    case WIDC_CHECK1:
    {
    g_DPlay.bQuestItem = !g_DPlay.bQuestItem;
    g_DPlay.SendBuffPetCollectUpdate();
    break;
    }
    case WIDC_CHECK2:
    {
    g_DPlay.bWeapons = !g_DPlay.bWeapons;
    g_DPlay.SendBuffPetCollectUpdate();
    break;
    }
    case WIDC_CHECK3:
    {
    g_DPlay.bArmor = !g_DPlay.bArmor;
    g_DPlay.SendBuffPetCollectUpdate();
    break;
    }
    case WIDC_CHECK4:
    {
    g_DPlay.bCards = !g_DPlay.bCards;
    g_DPlay.SendBuffPetCollectUpdate();
    break; }
    case WIDC_CHECK5:
    {
    g_DPlay.bFood = !g_DPlay.bFood;
    g_DPlay.SendBuffPetCollectUpdate();
    break;
    }
    case WIDC_CHECK6:
    {
    g_DPlay.bEggs = !g_DPlay.bEggs;
    g_DPlay.SendBuffPetCollectUpdate();
    break;
    }
    case WIDC_CHECK7:
    {
    g_DPlay.bStones = !g_DPlay.bStones;
    g_DPlay.SendBuffPetCollectUpdate();
    break;
    }
    case WIDC_CHECK8:
    {
    g_DPlay.bAccessory = !g_DPlay.bAccessory;
    g_DPlay.SendBuffPetCollectUpdate();
    break;
    }
    }
    #endif


    5th: _Network (MsgHdr.h)

    Under this
    Code:
    #define PACKETTYPE_QUERYMAILBOX_COUNT				(DWORD)0x88100241
    Paste this
    Spoiler:

    #define PACKETTYPE_VISPET_UPDATECOLLECTIONS (DWORD)0x88100242


    6th: Neuz (DPClient.cpp)

    Under this
    Code:
    void CDPClient::SendSwapVis( int nPos1, int nPos2 )
    {
    	BEFORESENDSOLE( ar, PACKETTYPE_VISPET_SWAPVIS, DPID_UNKNOWN );
    	ar << nPos1 << nPos2;
    	SEND( ar, this, DPID_SERVERPLAYER );
    }
    Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B
    void CDPClient::SendBuffPetCollectUpdate()
    {
    BEFORESENDSOLE( ar, PACKETTYPE_VISPET_UPDATECOLLECTIONS, DPID_UNKNOWN );
    ar << (BYTE) bQuestItem << (BYTE) bWeapons << (BYTE) bArmor << (BYTE) bCards << (BYTE) bFood << (BYTE) bEggs << (BYTE) bStones << (BYTE) bAccessory;
    SEND( ar, this, DPID_SERVERPLAYER );
    }
    #endif

    Look this
    Code:
    void CDPClient::OnGuildHousePacket( CAr & ar )
    Under this
    Code:
    CWndGuildHousing* pWnd = (CWndGuildHousing*)g_WndMng.GetApplet( APP_GH_FURNITURE_STORAGE );
    	if( pWnd )
    		pWnd->RefreshItemList( );			// À©µµÃ¢ÀÌ ¶°ÀÖÀ¸¸é Refresh
    	else
    Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B
    if(!bInitializedPetCollection)
    {
    bQuestItem = bWeapons = bArmor = bCards = bFood = bEggs = bStones = bAccessory = TRUE;
    g_pPlayer->SendBuffPetCollectUpdate();
    bInitializedPetCollection = TRUE;
    }
    #endif


    6th: Neuz (DPClient.h)
    Under this
    Code:
    public:
    	void	SendGuildHouseTenderMainWnd( DWORD dwGHType, OBJID objNpcId );
    	void	SendGuildHouseTenderInfoWnd( OBJID objGHId );
    	void	SendGuildHouseTenderJoin( OBJID objGHId, int nTenderPerin, int nTenderPenya );
    #endif // __GUILD_HOUSE_MIDDLE
    Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B
    public:
    void SendBuffPetCollectUpdate( );
    BOOL bInitializedPetCollection, bQuestItem , bWeapons , bArmor , bCards , bFood, bEggs, bStones , bAccessory;

    #endif


    7th: Neuz (VersionCommon.h)

    Under this
    Code:
    #define __MAINSERVER
    Paste this
    Spoiler:

    #define _PETFILTER_HOL_B


    8th: WorldServer (DPSrvr.cpp)
    Under this
    Code:
    #ifdef __QUIZ
    	ON_MSG( PACKETTYPE_QUIZ_ENTRANCE, OnQuizEventEntrance );
    	ON_MSG( PACKETTYPE_QUIZ_TELEPORT, OnQuizEventTeleport );
    #endif // __QUIZ
    Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B
    ON_MSG( PACKETTYPE_VISPET_UPDATECOLLECTIONS, OnBuffPetUpdateCollection );
    #endif


    End of the Code Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B
    void CDPSrvr::OnBuffPetUpdateCollection( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE, u_long )
    {
    try
    {
    CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );

    if( IsValidObj( pUser ) == TRUE )
    {
    BYTE cQuestItem , cWeapons , cArmor , cCards , cFood , cEggs , cStones , cAccessory;
    ar >> cQuestItem >> cWeapons >> cArmor >> cCards >> cFood >> cEggs >> cStones >> cAccessory;


    if(cQuestItem > 0) { pUser->bQuestItem = TRUE; } else { pUser->bQuestItem = FALSE; }
    if(cWeapons > 0) { pUser->bWeapons = TRUE; } else { pUser->bWeapons = FALSE; }
    if(cArmor > 0) { pUser->bArmor = TRUE; } else { pUser->bArmor = FALSE; }
    if(cCards > 0) { pUser->bCards = TRUE; } else { pUser->bCards = FALSE; }
    if(cFood > 0) { pUser->bFood = TRUE; } else { pUser->bFood = FALSE; }
    if(cEggs > 0) { pUser->bEggs = TRUE; } else { pUser->bEggs = FALSE; }
    if(cStones > 0) { pUser->bStones = TRUE; } else { pUser->bStones = FALSE; }
    if(cAccessory > 0) { pUser->bAccessory = TRUE; } else { pUser->bAccessory = FALSE; }
    //Error("OnBuffPetUpdate (%i, %i, %i, %i, %i, %i, %i, %i)", (int) g_pPlayer->->bQuestItem, (int) pUser->m_pActMover->bWeapons, (int) pUser->m_pActMover->bArmor, (int) pUser->m_pActMover->bCards, (int) pUser->m_pActMover->bFood, (int) pUser->m_pActMover->bEggs, (int) pUser->m_pActMover->bStones, (int) pUser->m_pActMover->bAccessory);
    }
    }
    catch(...)
    {
    Error("Exception caught in File %s on line %d", __FILE__, __LINE__);
    }
    }

    #endif


    9th: WorldServer (DPSrvr.h)
    Before this
    Code:
    private:
    	DPID	m_dpidCache;		// ij½¬¼­¹ö DPID
    };
    Paste this
    Spoiler:

    #ifdef _PETFILTER_HOL_B
    void OnBuffPetUpdateCollection( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE, u_long );
    #endif


    10th: WorldServer (VersionCommon.h)
    Under this
    Code:
    #define __MAINSERVER
    Paste this
    Spoiler:

    #define _PETFILTER_HOL_B


    New Resdata.inc
    Spoiler:

    APP_BUFFPET_STATUS "WndTile00.tga" "" 1 352 128 0x2410000 26
    {
    // Title String
    IDS_RESDATA_INC_006602
    }
    {
    // Help Key
    IDS_RESDATA_INC_006603
    }
    {
    WTYPE_CUSTOM WIDC_CUSTOM1 "" 0 8 6 72 90 0x260000 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006604
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006605
    }
    WTYPE_STATIC WIDC_BUFFPET_SLOT1 "WndElemItemBlank.tga" 0 80 2 112 34 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006606
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006607
    }
    WTYPE_STATIC WIDC_BUFFPET_SLOT3 "WndElemItemBlank.tga" 0 144 2 176 34 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006608
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006609
    }
    WTYPE_STATIC WIDC_BUFFPET_SLOT2 "WndElemItemBlank.tga" 0 112 2 144 34 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006610
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006611
    }
    WTYPE_STATIC WIDC_BUFFPET_SLOT4 "WndElemItemBlank.tga" 0 80 32 112 64 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006612
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006613
    }
    WTYPE_STATIC WIDC_BUFFPET_SLOT7 "WndElemItemBlank.tga" 0 80 62 112 94 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006614
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006615
    }
    WTYPE_STATIC WIDC_BUFFPET_SLOT9 "WndElemItemBlank.tga" 0 144 62 176 94 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006616
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006617
    }
    WTYPE_STATIC WIDC_BUFFPET_SLOT5 "WndElemItemBlank.tga" 0 112 32 144 64 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006618
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006619
    }
    WTYPE_STATIC WIDC_BUFFPET_SLOT8 "WndElemItemBlank.tga" 0 112 62 144 94 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006620
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006621
    }
    WTYPE_STATIC WIDC_BUFFPET_SLOT6 "WndElemItemBlank.tga" 0 144 32 176 64 0x2220002 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_006622
    }
    {
    // ToolTip
    IDS_RESDATA_INC_006623
    }
    WTYPE_STATIC WIDC_STATIC2 "WndEditTile200.tga" 1 178 2 340 18 0x2220001 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_027068
    }
    {
    // ToolTip
    IDS_RESDATA_INC_027069
    }
    WTYPE_BUTTON WIDC_CHECK1 "ButtCheck.bmp" 0 180 22 276 38 0x220018 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_027070
    }
    {
    // ToolTip
    IDS_RESDATA_INC_027071
    }
    WTYPE_BUTTON WIDC_CHECK2 "ButtCheck.bmp" 0 180 40 276 56 0x220018 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_027072
    }
    {
    // ToolTip
    IDS_RESDATA_INC_027073
    }
    WTYPE_BUTTON WIDC_CHECK3 "ButtCheck.bmp" 0 180 56 276 72 0x220018 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_027074
    }
    {
    // ToolTip
    IDS_RESDATA_INC_027075
    }
    WTYPE_BUTTON WIDC_CHECK4 "ButtCheck.bmp" 0 180 72 276 88 0x220018 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_027076
    }
    {
    // ToolTip
    IDS_RESDATA_INC_027077
    }
    WTYPE_BUTTON WIDC_CHECK5 "ButtCheck.bmp" 0 258 24 354 40 0x220018 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_027078
    }
    {
    // ToolTip
    IDS_RESDATA_INC_027079
    }
    WTYPE_BUTTON WIDC_CHECK6 "ButtCheck.bmp" 0 258 39 354 55 0x220018 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_027080
    }
    {
    // ToolTip
    IDS_RESDATA_INC_027081
    }
    WTYPE_BUTTON WIDC_CHECK7 "ButtCheck.bmp" 0 258 56 354 72 0x220018 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_027082
    }
    {
    // ToolTip
    IDS_RESDATA_INC_027083
    }
    WTYPE_BUTTON WIDC_CHECK8 "ButtCheck.bmp" 0 259 72 355 88 0x220018 0 0 0 0 46 112 169
    {
    // Title String
    IDS_RESDATA_INC_027084
    }
    {
    // ToolTip
    IDS_RESDATA_INC_027085
    }
    }


    Resdata.txt

    Spoiler:

    IDS_RESDATA_INC_027068 Drop Filter
    IDS_RESDATA_INC_027069
    IDS_RESDATA_INC_027070 QI
    IDS_RESDATA_INC_027071
    IDS_RESDATA_INC_027072 Weapons
    IDS_RESDATA_INC_027073
    IDS_RESDATA_INC_027074 Armor Parts
    IDS_RESDATA_INC_027075
    IDS_RESDATA_INC_027076 Cards
    IDS_RESDATA_INC_027077
    IDS_RESDATA_INC_027078 Food
    IDS_RESDATA_INC_027079
    IDS_RESDATA_INC_027080 Egg
    IDS_RESDATA_INC_027081
    IDS_RESDATA_INC_027082 Stones
    IDS_RESDATA_INC_027083
    IDS_RESDATA_INC_027084 Jewelry
    IDS_RESDATA_INC_027085



    Dont hate me.. just trying to help those newbie like me

    Update....

    if you got problem with the first Step, use this:

    look this
    Code:
    BOOL CAIPet::SubItemLoot( void )
    replace the entire code regards with BOOL CAIPet::SubItemLoot( void )
    with this
    Spoiler:

    BOOL CAIPet::SubItemLoot( void )
    {
    CMover* pMover = GetMover();
    CMover* pOwner = prj.GetMover( m_idOwner );
    CWorld* pWorld = GetWorld();
    MoverProp *pProp = pMover->GetProp();
    D3DXVECTOR3 vPos = pMover->GetPos();
    CObj *pObj = NULL;
    int nRange = 0;
    D3DXVECTOR3 vDist;
    FLOAT fDistSq, fMinDist = 9999999.0f;
    CObj *pMinObj = NULL;

    vDist = pOwner->GetPos() - pMover->GetPos();
    fDistSq = D3DXVec3LengthSq( &vDist );
    if( fDistSq > 32.0f * 32.0f ) // ÁÖÀδ԰úÀÇ °Å¸®°¡ 32¹ÌÅͰ¡ ³ÑÀ¸¸é ¾ÆÀÌÅÛ ¾ÈÁý´Â´Ù.
    return FALSE;

    if( pOwner && pOwner->IsFly() )
    return FALSE;

    // ±ÙóÀÇ ¾ÆÀÌÅÛÀ» °Ë»öÇÔ. - ÁÖÀδԲ¨¸¸ °Ë»öÇØ¾ßÇÒµí...
    FOR_LINKMAP( pWorld, vPos, pObj, nRange, CObj::linkDynamic, pMover->GetLayer() )
    {
    if( pObj->GetType() == OT_ITEM ) //OT_ITEM
    {
    CItem *pItem = (CItem *)pObj; //pItem vllt IK3 usw
    ItemProp* pItemProp = pItem->GetProp();
    // ÀÌ°É µû·Î ³ÖÀºÀÌÀ¯´Â StateIdle ARRIVAL¿¡¼­ DoLoot()ÇÏ°í ³­Á÷ÈÄ¿¡ ´Ù½Ã SubItemLoot()À» È£ÃâÇßÀ»¶§
    // LootÇÑ ¾ÆÀÌÅÛÀÌ ¾ÆÁ÷ ¾ÈÁö¿öÁ®¼­ ¿©±â¼­ ¶Ç °Ë»öÀÌ µÇ´õ¶ó°í.. ±×·¡¼­ Áߺ¹µÇ´Â ¾ÆÀÌÅÛÀº °Ë»ö ¾ÈµÇ°Ô °íÃĺôÙ.
    // if( pItem->GetId() != m_idLootItem )

    if( pItem->IsDelete() == FALSE )
    {
    if( pItemProp )
    {
    BOOL b1 = TRUE;


    #ifdef _PETFILTER_HOL_B
    //Error("Kind1: %i,Kind2: %i,Kind3: %i; pMover->m_pActMover->bQuestItem: %i", (int) pItemProp->dwItemKind1, (int) pItemProp->dwItemKind2, (int) pItemProp->dwItemKind3, (int)pMover->m_pActMover->bQuestItem);
    // BYTE cQuestItem , cWeapons , cArmor , cCards , cDrinks, cEggs, cStones , cAccessory
    if(!pOwner->bQuestItem && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GEM && pItemProp->dwItemKind3 == IK3_GEM)
    b1 = FALSE;
    else if(!pOwner->bWeapons && pItemProp->dwItemKind1 == IK1_WEAPON)
    b1 = FALSE;
    else if(!pOwner->bArmor && pItemProp->dwItemKind1 == IK1_ARMOR)
    b1 = FALSE;
    else if(!pOwner->bCards && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && pItemProp->dwItemKind3 != IK3_ULTIMATE && pItemProp->dwItemKind3 != IK3_ENCHANT && pItemProp->dwItemKind3 != IK3_PIERDICE)
    b1 = FALSE;
    else if(!pOwner->bFood && pItemProp->dwItemKind1 == IK1_GENERAL && (pItemProp->dwItemKind2 == IK2_FOOD || pItemProp->dwItemKind2 == IK2_REFRESHER || pItemProp->dwItemKind2 == IK2_POTION))
    b1 = FALSE;
    else if(!pOwner->bEggs && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GENERAL && pItemProp->dwItemKind3 == IK3_EGG)
    b1 = FALSE;
    else if(!pOwner->bStones && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && (pItemProp->dwItemKind3 == IK3_PIERDICE || pItemProp->dwItemKind3 == IK3_ENCHANT || pItemProp->dwItemKind3 == IK3_ULTIMATE || pItemProp->dwItemKind3 == IK3_SUPSTONE))
    b1 = FALSE;
    else if(!pOwner->bAccessory && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind3 == IK2_JEWELRY)
    b1 = FALSE;
    #endif

    if( pOwner->IsLoot( pItem, TRUE ) && b1 ) // ·çÆÃµÇ´Â¾ÆÀÌÅÛÀÎÁö °Ë»çÇÔ.
    {
    vDist = pObj->GetPos() - pMover->GetPos();
    fDistSq = D3DXVec3LengthSq( &vDist ); // °Å¸® ±¸ÇÔ.
    if( fDistSq < 15 * 15 && fDistSq < fMinDist ) // 10¹ÌÅÍ À̳»°í... °¡Àå °Å¸®°¡ °¡±î¿î ¾ÆÅÛÀ» ãÀ½.
    {
    pMinObj = pObj;
    }
    }
    }
    }
    }
    }
    END_LINKMAP

    if( pMinObj )
    {
    // Get object ID of the loot item
    DWORD dwIdLootItem = ((CItem *)pMinObj)->GetId();

    // Get the item obj
    CCtrl *pCtrl = prj.GetCtrl( dwIdLootItem );

    // if exists...
    if( IsValidObj(pCtrl) )
    {
    MoveToDst( pMinObj->GetPos() ); // ¸ñÇ¥ÂÊÀ¸·Î À̵¿.
    m_idLootItem = dwIdLootItem;
    m_bLootMove = TRUE;
    }
    }

    return m_bLootMove;
    }


    i dont know your exact source codes regards with BOOL CAIPet::SubItemLoot( void ) so, paste mine
    Last edited by Akerius; 05-10-11 at 09:14 AM. Reason: forgot to put BOOL b1 = TRUE; in AIPet.cpp


  2. #2
    Odd future cKenzy is offline
    MemberRank
    Aug 2010 Join Date
    SwitzerlandLocation
    361Posts

    Re: PETFILTER (copy paste)

    It's working, no bugs or anything like that?

    ---------- Post added at 10:08 AM ---------- Previous post was at 09:18 AM ----------

    I think there are something that you need to change >.>

    Change #ifdef to #ifndef or idk , im getting errors in that lines.

    #ifdef _PETFILTER_HOL_B
    if(!pOwner->bQuestItem && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GEM && pItemProp->dwItemKind3 == IK3_GEM)
    b1 = FALSE;
    else if(!pOwner->bWeapons && pItemProp->dwItemKind1 == IK1_WEAPON)
    b1 = FALSE;
    else if(!pOwner->bArmor && pItemProp->dwItemKind1 == IK1_ARMOR)
    b1 = FALSE;
    else if(!pOwner->bCards && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && pItemProp->dwItemKind3 != IK3_ULTIMATE && pItemProp->dwItemKind3 != IK3_ENCHANT && pItemProp->dwItemKind3 != IK3_PIERDICE)
    b1 = FALSE;
    else if(!pOwner->bFood && pItemProp->dwItemKind1 == IK1_GENERAL && (pItemProp->dwItemKind2 == IK2_FOOD || pItemProp->dwItemKind2 == IK2_REFRESHER || pItemProp->dwItemKind2 == IK2_POTION))
    b1 = FALSE;
    else if(!pOwner->bEggs && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GENERAL && pItemProp->dwItemKind3 == IK3_EGG)
    b1 = FALSE;
    else if(!pOwner->bStones && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && (pItemProp->dwItemKind3 == IK3_PIERDICE || pItemProp->dwItemKind3 == IK3_ENCHANT || pItemProp->dwItemKind3 == IK3_ULTIMATE || pItemProp->dwItemKind3 == IK3_SUPSTONE))
    b1 = FALSE;
    else if(!pOwner->bAccessory && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind3 == IK2_JEWELRY)
    b1 = FALSE;
    #endif

  3. #3
    Account Upgraded | Title Enabled! hellmater is offline
    MemberRank
    May 2010 Join Date
    C:/EstoniaLocation
    313Posts

    Re: PETFILTER (copy paste)

    Quote Originally Posted by Kenzy View Post
    Code:
    It's working, no bugs or anything like that?
    
    ---------- Post added at 10:08 AM ---------- Previous post was at 09:18 AM ----------
    
    I think there are something that you need to change >.>
    
    Change #ifdef to #ifndef or idk , im getting errors in that lines.
    
    #ifdef _PETFILTER_HOL_B
    if(!pOwner->bQuestItem && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GEM && pItemProp->dwItemKind3 == IK3_GEM)
    b1 = FALSE;
    else if(!pOwner->bWeapons && pItemProp->dwItemKind1 == IK1_WEAPON)
    b1 = FALSE;
    else if(!pOwner->bArmor && pItemProp->dwItemKind1 == IK1_ARMOR)
    b1 = FALSE;
    else if(!pOwner->bCards && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && pItemProp->dwItemKind3 != IK3_ULTIMATE && pItemProp->dwItemKind3 != IK3_ENCHANT && pItemProp->dwItemKind3 != IK3_PIERDICE)
    b1 = FALSE;
    else if(!pOwner->bFood && pItemProp->dwItemKind1 == IK1_GENERAL && (pItemProp->dwItemKind2 == IK2_FOOD || pItemProp->dwItemKind2 == IK2_REFRESHER || pItemProp->dwItemKind2 == IK2_POTION))
    b1 = FALSE;
    else if(!pOwner->bEggs && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GENERAL && pItemProp->dwItemKind3 == IK3_EGG)
    b1 = FALSE;
    else if(!pOwner->bStones && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && (pItemProp->dwItemKind3 == IK3_PIERDICE || pItemProp->dwItemKind3 == IK3_ENCHANT || pItemProp->dwItemKind3 == IK3_ULTIMATE || pItemProp->dwItemKind3 == IK3_SUPSTONE))
    b1 = FALSE;
    else if(!pOwner->bAccessory && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind3 == IK2_JEWELRY)
    b1 = FALSE;
    #endif
    No offense but your getting errors in every copy paste release. Take it slow , check everything twice.
    Last edited by hellmater; 05-09-11 at 01:46 PM.

  4. #4
    One word! Im Fawkin Pro! Xakzi is offline
    MemberRank
    Jul 2010 Join Date
    SwedenLocation
    1,356Posts

    Re: PETFILTER (copy paste)

    maybe if you wrote what error you get, then it would be easier to help ya out, other then that, the codes looks like its working, i havent tried it since i dont have to lol, but it is really a spoon fed pet filter for big time leechers (like him above ^)
    anyway, post your error instead of saying stuff that you dont know ;)

  5. #5
    Blessed Developer Akerius is offline
    MemberRank
    Apr 2011 Join Date
    Planet OithLocation
    280Posts

    Re: PETFILTER (copy paste)

    Quote Originally Posted by Kenzy View Post
    It's working, no bugs or anything like that?

    ---------- Post added at 10:08 AM ---------- Previous post was at 09:18 AM ----------

    I think there are something that you need to change >.>

    Change #ifdef to #ifndef or idk , im getting errors in that lines.

    #ifdef _PETFILTER_HOL_B
    if(!pOwner->bQuestItem && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GEM && pItemProp->dwItemKind3 == IK3_GEM)
    b1 = FALSE;
    else if(!pOwner->bWeapons && pItemProp->dwItemKind1 == IK1_WEAPON)
    b1 = FALSE;
    else if(!pOwner->bArmor && pItemProp->dwItemKind1 == IK1_ARMOR)
    b1 = FALSE;
    else if(!pOwner->bCards && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && pItemProp->dwItemKind3 != IK3_ULTIMATE && pItemProp->dwItemKind3 != IK3_ENCHANT && pItemProp->dwItemKind3 != IK3_PIERDICE)
    b1 = FALSE;
    else if(!pOwner->bFood && pItemProp->dwItemKind1 == IK1_GENERAL && (pItemProp->dwItemKind2 == IK2_FOOD || pItemProp->dwItemKind2 == IK2_REFRESHER || pItemProp->dwItemKind2 == IK2_POTION))
    b1 = FALSE;
    else if(!pOwner->bEggs && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GENERAL && pItemProp->dwItemKind3 == IK3_EGG)
    b1 = FALSE;
    else if(!pOwner->bStones && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && (pItemProp->dwItemKind3 == IK3_PIERDICE || pItemProp->dwItemKind3 == IK3_ENCHANT || pItemProp->dwItemKind3 == IK3_ULTIMATE || pItemProp->dwItemKind3 == IK3_SUPSTONE))
    b1 = FALSE;
    else if(!pOwner->bAccessory && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind3 == IK2_JEWELRY)
    b1 = FALSE;
    #endif

    ifdef statement meaning if define statement while ifndef statement meaning ifnot define statement...
    look the statement

    #ifdef _PETFILTER_HOL_B
    meaning if PETFILTFILTER_HOL_B is defined, it will do the next statement below

    while
    #ifndef _PETFILTER_HOL_B
    meaning if _PETFILTER_HOL_B is not defined, it will do the next statement
    *since the _PETFILTER_HOL_B is defined in DPSrvr.cpp/h
    the ifndef statement will not do the statement

    ifndef statement purpose is to support some codes either you comment something or uncomment it but, to make your statement correct, you need to support your ifndef statement like this
    #ifndef ITEM01
    #ifdef ITEMDEFAULT
    statement
    #endif
    #endif

    ---------- Post added at 01:31 AM ---------- Previous post was at 12:36 AM ----------

    if you got problem with first Step, use this:

    look this
    Code:
    BOOL CAIPet::SubItemLoot( void )
    replace the entire code regards with BOOL CAIPet::SubItemLoot( void )
    with this
    Spoiler:

    BOOL CAIPet::SubItemLoot( void )
    {
    CMover* pMover = GetMover();
    CMover* pOwner = prj.GetMover( m_idOwner );
    CWorld* pWorld = GetWorld();
    MoverProp *pProp = pMover->GetProp();
    D3DXVECTOR3 vPos = pMover->GetPos();
    CObj *pObj = NULL;
    int nRange = 0;
    D3DXVECTOR3 vDist;
    FLOAT fDistSq, fMinDist = 9999999.0f;
    CObj *pMinObj = NULL;

    vDist = pOwner->GetPos() - pMover->GetPos();
    fDistSq = D3DXVec3LengthSq( &vDist );
    if( fDistSq > 32.0f * 32.0f ) // ÁÖÀδ԰úÀÇ °Å¸®°¡ 32¹ÌÅͰ¡ ³ÑÀ¸¸é ¾ÆÀÌÅÛ ¾ÈÁý´Â´Ù.
    return FALSE;

    if( pOwner && pOwner->IsFly() )
    return FALSE;

    // ±ÙóÀÇ ¾ÆÀÌÅÛÀ» °Ë»öÇÔ. - ÁÖÀδԲ¨¸¸ °Ë»öÇØ¾ßÇÒµí...
    FOR_LINKMAP( pWorld, vPos, pObj, nRange, CObj::linkDynamic, pMover->GetLayer() )
    {
    if( pObj->GetType() == OT_ITEM ) //OT_ITEM
    {
    CItem *pItem = (CItem *)pObj; //pItem vllt IK3 usw
    ItemProp* pItemProp = pItem->GetProp();
    // ÀÌ°É µû·Î ³ÖÀºÀÌÀ¯´Â StateIdle ARRIVAL¿¡¼­ DoLoot()ÇÏ°í ³­Á÷ÈÄ¿¡ ´Ù½Ã SubItemLoot()À» È£ÃâÇßÀ»¶§
    // LootÇÑ ¾ÆÀÌÅÛÀÌ ¾ÆÁ÷ ¾ÈÁö¿öÁ®¼­ ¿©±â¼­ ¶Ç °Ë»öÀÌ µÇ´õ¶ó°í.. ±×·¡¼­ Áߺ¹µÇ´Â ¾ÆÀÌÅÛÀº °Ë»ö ¾ÈµÇ°Ô °íÃĺôÙ.
    // if( pItem->GetId() != m_idLootItem )

    if( pItem->IsDelete() == FALSE )
    {
    if( pItemProp )
    {
    BOOL b1 = TRUE;


    #ifdef _PETFILTER_HOL_B
    //Error("Kind1: %i,Kind2: %i,Kind3: %i; pMover->m_pActMover->bQuestItem: %i", (int) pItemProp->dwItemKind1, (int) pItemProp->dwItemKind2, (int) pItemProp->dwItemKind3, (int)pMover->m_pActMover->bQuestItem);
    // BYTE cQuestItem , cWeapons , cArmor , cCards , cDrinks, cEggs, cStones , cAccessory
    if(!pOwner->bQuestItem && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GEM && pItemProp->dwItemKind3 == IK3_GEM)
    b1 = FALSE;
    else if(!pOwner->bWeapons && pItemProp->dwItemKind1 == IK1_WEAPON)
    b1 = FALSE;
    else if(!pOwner->bArmor && pItemProp->dwItemKind1 == IK1_ARMOR)
    b1 = FALSE;
    else if(!pOwner->bCards && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && pItemProp->dwItemKind3 != IK3_ULTIMATE && pItemProp->dwItemKind3 != IK3_ENCHANT && pItemProp->dwItemKind3 != IK3_PIERDICE)
    b1 = FALSE;
    else if(!pOwner->bFood && pItemProp->dwItemKind1 == IK1_GENERAL && (pItemProp->dwItemKind2 == IK2_FOOD || pItemProp->dwItemKind2 == IK2_REFRESHER || pItemProp->dwItemKind2 == IK2_POTION))
    b1 = FALSE;
    else if(!pOwner->bEggs && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_GENERAL && pItemProp->dwItemKind3 == IK3_EGG)
    b1 = FALSE;
    else if(!pOwner->bStones && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind2 == IK2_MATERIAL && (pItemProp->dwItemKind3 == IK3_PIERDICE || pItemProp->dwItemKind3 == IK3_ENCHANT || pItemProp->dwItemKind3 == IK3_ULTIMATE || pItemProp->dwItemKind3 == IK3_SUPSTONE))
    b1 = FALSE;
    else if(!pOwner->bAccessory && pItemProp->dwItemKind1 == IK1_GENERAL && pItemProp->dwItemKind3 == IK2_JEWELRY)
    b1 = FALSE;
    #endif

    if( pOwner->IsLoot( pItem, TRUE ) && b1 ) // ·çÆÃµÇ´Â¾ÆÀÌÅÛÀÎÁö °Ë»çÇÔ.
    {
    vDist = pObj->GetPos() - pMover->GetPos();
    fDistSq = D3DXVec3LengthSq( &vDist ); // °Å¸® ±¸ÇÔ.
    if( fDistSq < 15 * 15 && fDistSq < fMinDist ) // 10¹ÌÅÍ À̳»°í... °¡Àå °Å¸®°¡ °¡±î¿î ¾ÆÅÛÀ» ãÀ½.
    {
    pMinObj = pObj;
    }
    }
    }
    }
    }
    }
    END_LINKMAP

    if( pMinObj )
    {
    // Get object ID of the loot item
    DWORD dwIdLootItem = ((CItem *)pMinObj)->GetId();

    // Get the item obj
    CCtrl *pCtrl = prj.GetCtrl( dwIdLootItem );

    // if exists...
    if( IsValidObj(pCtrl) )
    {
    MoveToDst( pMinObj->GetPos() ); // ¸ñÇ¥ÂÊÀ¸·Î À̵¿.
    m_idLootItem = dwIdLootItem;
    m_bLootMove = TRUE;
    }
    }

    return m_bLootMove;
    }


    i dont know your exact source codes regards with BOOL CAIPet::SubItemLoot( void ) so, paste mine
    Last edited by Akerius; 06-09-11 at 02:42 AM.

  6. #6
    Proficient Member carlos123 is offline
    MemberRank
    Jun 2009 Join Date
    186Posts

    Re: PETFILTER (copy paste)

    no errors/warning compiling, added it in resdata.inc/txt.txt but the client crash when i use a buff pet :)

  7. #7
    Blessed Developer Akerius is offline
    MemberRank
    Apr 2011 Join Date
    Planet OithLocation
    280Posts

    Re: PETFILTER (copy paste)

    did you put the resdata.inc and .txt to your datasub1.res?

  8. #8
    Proficient Member carlos123 is offline
    MemberRank
    Jun 2009 Join Date
    186Posts

    Re: PETFILTER (copy paste)

    yea ofc.

  9. #9
    Blessed Developer Akerius is offline
    MemberRank
    Apr 2011 Join Date
    Planet OithLocation
    280Posts

    Re: PETFILTER (copy paste)

    just a reminder:

    the resdata.inc posted is a new version of resdata.inc
    and dont copy paste the whole script in resdata.inc, just add some script that is lack to your
    APP_BUFFPET_STATUS "WndTile00.tga" "" 1 352 128 0x2410000 26

    if im not mistaken the lack scripts in resdata.inc for those who dont have pet filter ends in
    IDS_RESDATA_INC_006623
    }
    WTYPE_STATIC WIDC_STATIC2 "WndEditTile200.tga" 1 178 2 340 18 0x2220001 0 0 0 0 46 112 169
    {

    so just continue the codes after

    IDS_RESDATA_INC_006623
    }
    WTYPE_STATIC WIDC_STATIC2 "WndEditTile200.tga" 1 178 2 340 18 0x2220001 0 0 0 0 46 112 169
    {

  10. #10
    ~FlyFF DeV~ Jomex is offline
    MemberRank
    Mar 2009 Join Date
    PolandLocation
    588Posts

    Re: PETFILTER (copy paste)

    Quote Originally Posted by Akerius View Post
    just a reminder:

    the resdata.inc posted is a new version of resdata.inc
    and dont copy paste the whole script in resdata.inc, just add some script that is lack to your
    APP_BUFFPET_STATUS "WndTile00.tga" "" 1 352 128 0x2410000 26

    if im not mistaken the lack scripts in resdata.inc for those who dont have pet filter ends in
    IDS_RESDATA_INC_006623
    }
    WTYPE_STATIC WIDC_STATIC2 "WndEditTile200.tga" 1 178 2 340 18 0x2220001 0 0 0 0 46 112 169
    {

    so just continue the codes after

    IDS_RESDATA_INC_006623
    }
    WTYPE_STATIC WIDC_STATIC2 "WndEditTile200.tga" 1 178 2 340 18 0x2220001 0 0 0 0 46 112 169
    {
    ur funny my source reads and USES it already...

  11. #11
    Account Upgraded | Title Enabled! divinepunition is offline
    MemberRank
    Dec 2008 Join Date
    FranceLocation
    621Posts

    Re: PETFILTER (copy paste)

    It could be really easier for people to code petfilter like aeonsoft done for region.

    You could have only one DWORD named for exemple (in mover.h)

    DWORD m_dwPetFilterState;

    and you could define

    #define PETFILTER_NONE 0x00000000
    #define PETFILTER_QUESTITEM 0x00000001
    #define PETFILTER_WEAPON 0x00000002
    #define PETFILTER_ARMOR 0x00000004
    #define PETFILTER_CARD 0x00000008
    #define PETFILTER_FOOD 0x00000010
    #define PETFILTER_EGGS 0x00000020
    #define PETFILTER_STONES 0x00000040
    #define PETFILTER_ACCESSPRY 0x00000080

    and to test if a pet have a value, juste use the & binary operator,

    BOOL IsPetFilterAttribute( DWORD dwAttribut ) { return ( m_dwPetFilterState& dwAttribut ) == dwAttribut ? TRUE : FALSE; }


    with this system you could have only one value to save in your database, to allow persistent petfilter infos :p

  12. #12
    Apprentice BloodGood is offline
    MemberRank
    Sep 2015 Join Date
    18Posts

    Re: PETFILTER (copy paste)

    Alright so these are the two errors i am getting after copying the code Tried to redo it three times still same error. :/

    Spoiler:
    error C2440: '=' : cannot convert from 'void (__cdecl *)(CAr &,DPID,DPID,LPBYTE,u_long)' to 'void (__thiscall CDPSrvr::* )(CAr &,DPID,DPID,LPBYTE,u_long)'

    c:\Users\Chris\Desktop\New Flyff\Flyff Repack (v15) (rev3.1)\Source\Src\Worldserver\DPSrvr.cpp(12418): error C2039: 'OnBuffPetUpdateCollection' : is not a member of 'CDPSrvr'


    Update
    I fixed it haha in Dpsrvr.h the code had to be before this }; Didn't know that woops XD.
    Last edited by BloodGood; 19-11-15 at 10:31 PM.

  13. #13
    Member Frostbite is offline
    MemberRank
    Aug 2013 Join Date
    95Posts

    Re: PETFILTER (copy paste)

    Quote Originally Posted by BloodGood View Post
    Alright so these are the two errors i am getting after copying the code Tried to redo it three times still same error. :/

    Spoiler:
    error C2440: '=' : cannot convert from 'void (__cdecl *)(CAr &,DPID,DPID,LPBYTE,u_long)' to 'void (__thiscall CDPSrvr::* )(CAr &,DPID,DPID,LPBYTE,u_long)'

    c:\Users\Chris\Desktop\New Flyff\Flyff Repack (v15) (rev3.1)\Source\Src\Worldserver\DPSrvr.cpp(12418): error C2039: 'OnBuffPetUpdateCollection' : is not a member of 'CDPSrvr'


    Update
    I fixed it haha in Dpsrvr.h the code had to be before this }; Didn't know that woops XD.

  14. #14
    Proficient Member blastboy is offline
    MemberRank
    Jun 2006 Join Date
    Enemy linesLocation
    193Posts

    Re: PETFILTER (copy paste)

    I had to make a change in DPSrvr.ccp to this line:
    Code:
    #ifdef    _PETFILTER_HOL_B
        ON_MSG( PACKETTYPE_VISPET_UPDATECOLLECTIONS, OnBuffPetUpdateCollection );
    #endif
    it would't build changed it to:
    Code:
    #ifdef    _PETFILTER_HOL_B
        ON_MSG( PACKETTYPE_VISPET_UPDATECOLLECTIONS, &CDPSrvr::OnBuffPetUpdateCollection );
    #endif
    then i could build again :)

  15. #15
    Member kloklojul is online now
    MemberRank
    Sep 2008 Join Date
    82Posts

    Re: PETFILTER (copy paste)

    depends if your source if updated for vs17 or vs03. in vs you have to add CDPS



Page 1 of 2 12 LastLast

Advertisement