ich bin mit c++ nicht so sicher und wäre nett wenn mir jemand bestätigen könnte ob ich den code so richtig eingefügt habe . Ich hab mir jetzt schon ein paar petfilter codes angesehen und langsam komm ich zur überzeugung das das ein Teil vom Code fehlt.
Cross veröffentlicht Code Auszüge mit Zeilenangaben bezogen auf seinen VScoure code oder ? weil wenn ich den Clean Source nehme die auch Sedrika nimmt dann finde ich die Zeilenangabe nicht schlüssig. und wenn ich mir die von xXConXx die ansehe unterscheiden die sich auch wieder
Wäre also für jede Hilfe dankbar
Code:
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 )
{
[COLOR="Red"] BOOL b1 = TRUE;
#ifdef __WORLDSERVER
#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->dwItemKind2 == IK2_JEWELRY)
b1 = FALSE;
#endif
#endif[/COLOR]
if( pOwner->IsLoot( pItem, TRUE ) && b1 ) // ·çÆÃµÇ´Â¾ÆÀÌÅÛÀÎÁö °Ë»çÇÔ.
{
vDist = pObj->GetPos() - pMover->GetPos();
fDistSq = D3DXVec3LengthSq( &vDist ); // °Å¸® ±¸ÇÔ.
if( fDistSq < 15 * 15 && fDistSq < fMinDist ) // 10¹ÌÅÍ À̳»°í... °¡Àå °Å¸®°¡ °¡±î¿î ¾ÆÅÛÀ» ãÀ½.
[COLOR="Red"]pMinObj = pObj; [/COLOR]
}
}
}
}
}
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;
}
BOOL CAIPet::StateInit( const AIMSG & msg )
{
return TRUE;
}






