当前位置: 首页>>代码示例>>C++>>正文


C++ CItem::GetItemIdx方法代码示例

本文整理汇总了C++中CItem::GetItemIdx方法的典型用法代码示例。如果您正苦于以下问题:C++ CItem::GetItemIdx方法的具体用法?C++ CItem::GetItemIdx怎么用?C++ CItem::GetItemIdx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CItem的用法示例。


在下文中一共展示了CItem::GetItemIdx方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AddItem

BOOL CWearedExDialog::AddItem(WORD relPos, cIcon * InIcon)
{
    CHero* pHero = OBJECTMGR->GetHero();

    if( ! AddIcon(relPos, InIcon) )
    {
        return FALSE;
    }

    CItem * item = (CItem * )InIcon;

    pHero->SetWearedItemIdx(relPos, item->GetItemIdx());
    pHero->SetCurComboNum(SKILL_COMBO_NUM);

    APPEARANCEMGR->AddCharacterPartChange(pHero->GetID(), eCHAPPEAR_INIT);

    CHARCALCMGR->AddItem( pHero, item->GetItemBaseInfo());
    //CHARCALCMGR->Initialize( pHero );
    GAMEIN->GetCharacterDialog()->RefreshInfo();
    RefreshSetItem(
        item->GetItemBaseInfo());

    DWORD	dwArmor	=	HERO->GetWearedItemIdx( eWearedItem_Dress );
    DWORD	dwBoots	=	HERO->GetWearedItemIdx( eWearedItem_Shoes );
    DWORD	dwGlove	=	HERO->GetWearedItemIdx( eWearedItem_Glove );
    DWORD	dwItem	=	item->GetItemIdx();

    if( dwArmor == dwItem || dwBoots == dwItem || dwGlove == dwItem )
        HERO->DoGetDefenseRate();

    RefreshArmorItem();
    //----------------------------------

    return TRUE;
}
开发者ID:xianyinchen,项目名称:LUNAPlus,代码行数:35,代码来源:WearedExDialog.cpp

示例2: RefreshSetItem

void CWearedExDialog::RefreshSetItem( const ITEMBASE& item )
{
    const SetScript* script = GAMERESRCMNGR->GetSetScript( item.wIconIdx );

    if( ! script )
    {
        return;
    }

    const SetScript::Item&	itemSet = script->mItem;
    CHero*					hero	= OBJECTMGR->GetHero();

    for(POSTYPE part = TP_WEAR_START ; part < TP_WEAR_END ; ++part )
    {
        const ITEMBASE* itemBase = ITEMMGR->GetItemInfoAbsIn( hero, part );

        if( itemBase )
        {
            CItem* item = ITEMMGR->GetItem( itemBase->dwDBIdx );
            ASSERT( item );

            if( itemSet.end() != itemSet.find( item->GetItemIdx() ) )
            {
                ITEMMGR->RefreshItem( item );
            }
        }
    }
}
开发者ID:xianyinchen,项目名称:LUNAPlus,代码行数:28,代码来源:WearedExDialog.cpp

示例3: FakeMoveIcon

BOOL CPetResurrectionDialog::FakeMoveIcon( LONG x, LONG y, cIcon* icon )
{
	if( WT_ITEM != icon->GetType() ||
		icon->IsLocked()			||
		m_bDisable )
	{
		return FALSE;
	}

	CItem* pItem = (CItem *)icon;

	if( pItem->GetItemInfo()->SupplyType != ITEM_KIND_PET )
	{
		return FALSE;
	}

	PET_OBJECT_INFO* pPetObjectInfo = PETMGR->GetPetObjectInfo( pItem->GetDBIdx() );

	if( !pPetObjectInfo )
	{
		return FALSE;
	}

	if( pPetObjectInfo->State != ePetState_Die )
	{
		return FALSE;
	}

	CItem* old = ( CItem* )( mSourceItem->GetLinkItem() );
	if( old )
		old->SetLock( FALSE );

	mSourceItem->SetData( pItem->GetItemIdx() );
	mSourceItem->SetLinkItem( pItem );

	ITEMMGR->AddToolTip( mSourceItem );

	mIconDialog->AddIcon( 0, mSourceItem );

	pItem->SetLock( TRUE );

	return FALSE;
}
开发者ID:xianyinchen,项目名称:LUNAPlus,代码行数:43,代码来源:PetResurrectionDialog.cpp

示例4: NetworkMsgParse


//.........这里部分代码省略.........
				break;
			}

		}
		break;

	case MP_NOTE_GETPACKAGE_ACK:
		{
			ITEMOBTAINARRAY * pmsg = (ITEMOBTAINARRAY *)pMsg;												// 아이템 획득 정보를 담을 포인터를 선언하고 메시지를 받는다.

			CItem* pItem = NULL;																			// 아이템 정보를 담을 포인터를 선언하고 null처리를 한다.

			for(WORD i = 0; i < pmsg->ItemNum; ++i )
			{
				ITEMBASE& itemBase = pmsg->ItemInfo[ i ];
				pItem = GAMEIN->GetInventoryDialog()->GetItemForPos( pmsg->GetItem(i)->Position);

				ITEMBASE prevItemBase;
				ZeroMemory( &prevItemBase, sizeof( prevItemBase ) );

				if(pItem)
				{
					if( pItem->GetDBIdx() == itemBase.dwDBIdx )
					{
						prevItemBase = pItem->GetItemBaseInfo();
					}

					pItem->SetItemBaseInfo( itemBase );												// 아이템 기본 정보를 세팅한다.
				}
				else																						// 아이템 정보가 유효하지 않으면,
				{
					pItem = ITEMMGR->MakeNewItem(pmsg->GetItem(i),"MP_NOTE_GETPACKAGE_ACK");					// 새로 아이템을 생성해 포인터로 받는다.
					
					const ITEM_INFO* pInfo = ITEMMGR->GetItemInfo( pItem->GetItemIdx() ) ;
					if( !pInfo ) continue;

					if( pInfo->wSeal == eITEM_TYPE_SEAL )
					{
						itemBase.nSealed = eITEM_TYPE_SEAL ;
						itemBase.nRemainSecond = pInfo->dwUseTime ;

						pItem->SetItemBaseInfo( itemBase ) ;
					}

					GAMEIN->GetInventoryDialog()->AddItem(pItem);
				}
			}

			if( pItem )
			{
				ITEMMGR->ItemDropEffect( pItem->GetItemIdx() );
			}

			QUICKMGR->RefreshQickItem();
		}
		break;

	case MP_NOTE_GETPACKAGE_NOTIFY:
		{
			MSG_DWORD4* pmsg = (MSG_DWORD4*)pMsg;
			const ITEM_INFO* pInfo = ITEMMGR->GetItemInfo( pmsg->dwData3 ) ;
			if(pInfo)
			{
				if( pInfo->Stack )
					CHATMGR->AddMsg( CTC_GETITEM, CHATMGR->GetChatMsg( 1112 ), pInfo->ItemName, pmsg->dwData4 );
				else
开发者ID:xianyinchen,项目名称:LUNAPlus,代码行数:67,代码来源:NoteManager.cpp


注:本文中的CItem::GetItemIdx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。