Register for your free account! | Forgot your password?

You last visited: Today at 07:14

  • Please register to post and access all features, it's quick, easy and FREE!

 

EXTENDED CURRENCY!

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2015
Posts: 98
Received Thanks: 5
EXTENDED CURRENCY!

WNDMANAGER.CPP

under:
Code:
void CWndMgr::PutItemGold( CMover* pMover, CItemElem* pItemElem, CEditString* pEdit, int flag )

else if(lpCharacter->m_nVenderType == 1)
					nCost = pItemElem->GetChipCost();
add:
Code:
#ifdef __EXTENDED_CURRENCY
				else if(lpCharacter->m_nVenderType == 2)
					nCost = pItemElem->GetChipFarmCost();
				
				else if(lpCharacter->m_nVenderType == 3)
					nCost = pItemElem->GetChipLgCost();
				
				else if(lpCharacter->m_nVenderType == 4)
					nCost = pItemElem->GetChipDonateCost();
#endif // __EXTENDED_CURRENCY
under:
Code:
#if __VER >= 11 // __CSC_VER11_3
			if(lpCharacter && lpCharacter->m_nVenderType == 1)
			{
				CString temp;
				temp.Format(" %s", prj.GetText(TID_GAME_REDCHIP));
				strTemp += temp;
			}
add:
Code:
#ifdef __EXTENDED_CURRENCY
			if(lpCharacter && lpCharacter->m_nVenderType == 2)
			{
				CString temp;
				temp.Format(" %s", prj.GetText( TID_GAME_PERIN ));
				strTemp += temp;
			}
			if(lpCharacter && lpCharacter->m_nVenderType == 3)
			{
				CString temp;
				temp.Format(" %s", prj.GetText( TID_GAME_BLUE ));
				strTemp += temp;
			}
			if(lpCharacter && lpCharacter->m_nVenderType == 4)
			{
				CString temp;
				temp.Format(" %s", prj.GetText( TID_GAME_BLACK ));
				strTemp += temp;
			}
#endif // __EXTENDED_CURRENCY
WNDITEMCTRL.CPP

under:
Code:
void CWndItemCtrl::RanderIcon( C2DRender* p2DRender, CItemElem* pItemElem, int x, int y, int nParent, int nalpha ) 

#if __VER >= 11 // __CSC_VER11_3
		if( nParent == APP_SHOP_ )
		{
			CWndShop* pWndBase = (CWndShop*)g_WndMng.GetWndBase( APP_SHOP_ );
			LPCHARACTER lpCharacter = pWndBase->m_pMover->GetCharacter();
			if(lpCharacter && lpCharacter->m_nVenderType == 1)
			{
				if( bRander == 0 && g_pPlayer->m_Inventory.GetAtItemNum( II_CHP_RED ) < (int)pItemElem->GetChipCost() )
					bRander = 1;
			}
add:
Code:
#ifdef __EXTENDED_CURRENCY
			else if(lpCharacter && lpCharacter->m_nVenderType == 2)
			{
				if( bRander == 0 && g_pPlayer->m_Inventory.GetAtItemNum( II_SYS_SYS_SCR_PERIN ) < (int)pItemElem->GetChipFarmCost() )
					bRander = 1;
			}
			else if(lpCharacter && lpCharacter->m_nVenderType == 3)
			{
				if( bRander == 0 && g_pPlayer->m_Inventory.GetAtItemNum( II_CHP_BLUE ) < (int)pItemElem->GetChipLgCost() )
					bRander = 1;
			}
			else if(lpCharacter && lpCharacter->m_nVenderType == 4)
			{
				if( bRander == 0 && g_pPlayer->m_Inventory.GetAtItemNum( II_CHP_BLACK ) < (int)pItemElem->GetChipDonateCost() )
					bRander = 1;
			}

#endif // __EXTENDED_CURRENCY
WNDFIELD.CPP

under:
Code:
BOOL CWndInventory::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )

#if __VER >= 11 // __CSC_VER11_3
				CWndShop* pwndShop = (CWndShop*)g_WndMng.GetWndBase(APP_SHOP_);
				if(pwndShop)
				{
					LPCHARACTER lpCharacter = pwndShop->m_pMover->GetCharacter();
					if(lpCharacter->m_nVenderType == 1)
					{
						if(g_pPlayer->m_Inventory.GetAtItemNum( II_CHP_RED ) - (int)((CItemElem*)lpShortcut->m_dwData)->GetChipCost() >= 0) //구매하려는 품목의 칩개수 이상을 가지고 있는지 확인.
						{
							SAFE_DELETE( m_pWndConfirmBuy );
							m_pWndConfirmBuy = new CWndConfirmBuy;
							m_pWndConfirmBuy->m_pItemElem = (CItemElem*)lpShortcut->m_dwData;
							m_pWndConfirmBuy->m_nBuyType = 1;
							m_pWndConfirmBuy->Initialize( this, APP_CONFIRM_BUY_ );
							bForbid = FALSE;
						}
						else
							g_WndMng.OpenMessageBox( _T( prj.GetText(TID_GAME_CANNT_BY_REDCHIP) ) );
					}
add:
Code:
#ifdef __EXTENDED_CURRENCY
					else if(lpCharacter->m_nVenderType == 2)
					{
						if(g_pPlayer->m_Inventory.GetAtItemNum( II_SYS_SYS_SCR_PERIN ) - (int)((CItemElem*)lpShortcut->m_dwData)->GetChipFarmCost() >= 0) //구매하려는 품목의 칩개수 이상을 가지고 있는지 확인.
						{
							SAFE_DELETE( m_pWndConfirmBuy );
							m_pWndConfirmBuy = new CWndConfirmBuy;
							m_pWndConfirmBuy->m_pItemElem = (CItemElem*)lpShortcut->m_dwData;
							m_pWndConfirmBuy->m_nBuyType = 2;
							m_pWndConfirmBuy->Initialize( this, APP_CONFIRM_BUY_ );
							bForbid = FALSE;
						}
						else
							g_WndMng.OpenMessageBox( _T( prj.GetText(TID_GAME_CANNT_BY_PERIN) ) );
					}
					else if(lpCharacter->m_nVenderType == 3)
					{
						if(g_pPlayer->m_Inventory.GetAtItemNum( II_CHP_BLUE ) - (int)((CItemElem*)lpShortcut->m_dwData)->GetChipLgCost() >= 0) //구매하려는 품목의 칩개수 이상을 가지고 있는지 확인.
						{
							SAFE_DELETE( m_pWndConfirmBuy );
							m_pWndConfirmBuy = new CWndConfirmBuy;
							m_pWndConfirmBuy->m_pItemElem = (CItemElem*)lpShortcut->m_dwData;
							m_pWndConfirmBuy->m_nBuyType = 3;
							m_pWndConfirmBuy->Initialize( this, APP_CONFIRM_BUY_ );
							bForbid = FALSE;
						}
						else
							g_WndMng.OpenMessageBox( _T( prj.GetText(TID_GAME_CANNT_BY_BLUE) ) );
					}
					else if(lpCharacter->m_nVenderType == 4)
					{
						if(g_pPlayer->m_Inventory.GetAtItemNum( II_CHP_BLACK ) - (int)((CItemElem*)lpShortcut->m_dwData)->GetChipDonateCost() >= 0) //구매하려는 품목의 칩개수 이상을 가지고 있는지 확인.
						{
							SAFE_DELETE( m_pWndConfirmBuy );
							m_pWndConfirmBuy = new CWndConfirmBuy;
							m_pWndConfirmBuy->m_pItemElem = (CItemElem*)lpShortcut->m_dwData;
							m_pWndConfirmBuy->m_nBuyType = 4;
							m_pWndConfirmBuy->Initialize( this, APP_CONFIRM_BUY_ );
							bForbid = FALSE;
						}
						else
							g_WndMng.OpenMessageBox( _T( prj.GetText(TID_GAME_CANNT_BY_BLACK) ) );
					}
#endif // __EXTENDED_CURRENCY
WNDSHOP.CPP

under:
Code:
void CWndConfirmBuy::OnChangeBuyCount( DWORD dwBuy )

	else if(m_nBuyType == 1)
		dwCost = m_pItemElem->GetChipCost();
add:
Code:
#ifdef __EXTENDED_CURRENCY
	else if(m_nBuyType == 2)
		dwCost = m_pItemElem->GetChipFarmCost();
	else if(m_nBuyType == 3)
		dwCost = m_pItemElem->GetChipLgCost();
	else if(m_nBuyType == 4)
		dwCost = m_pItemElem->GetChipDonateCost();
#endif // __EXTENDED_CURRENCY
under:
Code:
BOOL CWndConfirmBuy::Initialize( CWndBase* pWndParent, DWORD dwWndId ) 

	else if(m_nBuyType == 1)
		dwCost = m_pItemElem->GetChipCost();
add:
Code:
#ifdef __EXTENDED_CURRENCY
	else if(m_nBuyType == 2)
		dwCost = m_pItemElem->GetChipFarmCost();
	else if(m_nBuyType == 3)
		dwCost = m_pItemElem->GetChipLgCost();
	else if(m_nBuyType == 4)
		dwCost = m_pItemElem->GetChipDonateCost();
#endif // __EXTENDED_CURRENCY
under:
Code:
void CWndConfirmBuy::OnOK()

#if __VER >= 11 // __CSC_VER11_3
	//아래 메세지 처리 할 것
	DWORD dwCost;
	int nBuy;
add:
Code:
#ifdef __EXTENDED_CURRENCY	
	if(m_nBuyType == 4)
	{
		dwCost = m_pItemElem->GetChipDonateCost();
		if( m_pItemElem->m_nItemNum < 1 || dwCost == 0 )
		{
			g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0006) ) );	// 다른 사용자에게 팔렸습니다.
			return;
		}

		nBuy = atoi( m_pEdit->GetString() );
		if( (int)( (nBuy * dwCost) ) > g_pPlayer->m_Inventory.GetAtItemNum( II_CHP_BLACK ) )
		{
			g_WndMng.OpenMessageBox( _T( prj.GetText(TID_GAME_CANNT_BY_BLACK ) ) );	// 칩이 부족합니다.	
			return;
		}
	}

	else if(m_nBuyType == 3)
	{
		dwCost = m_pItemElem->GetChipLgCost();
		if( m_pItemElem->m_nItemNum < 1 || dwCost == 0 )
		{
			g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0006) ) );	// 다른 사용자에게 팔렸습니다.
			return;
		}

		nBuy = atoi( m_pEdit->GetString() );
		if( (int)( (nBuy * dwCost) ) > g_pPlayer->m_Inventory.GetAtItemNum( II_CHP_BLUE ) )
		{
			g_WndMng.OpenMessageBox( _T( prj.GetText(TID_GAME_CANNT_BY_BLUE) ) );	// 칩이 부족합니다.	
			return;
		}
	}

	else if(m_nBuyType == 2)
	{
		dwCost = m_pItemElem->GetChipFarmCost();
		if( m_pItemElem->m_nItemNum < 1 || dwCost == 0 )
		{
			g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0006) ) );	// 다른 사용자에게 팔렸습니다.
			return;
		}

		nBuy = atoi( m_pEdit->GetString() );
		if( (int)( (nBuy * dwCost) ) > g_pPlayer->m_Inventory.GetAtItemNum( II_SYS_SYS_SCR_PERIN ) )
		{
			g_WndMng.OpenMessageBox( _T( prj.GetText(TID_GAME_CANNT_BY_PERIN) ) );	// 칩이 부족합니다.	
			return;
		}
	}
#endif // __EXTENDED_CURRENCY
above this:
Code:
CWndItemCtrlVendor::CWndItemCtrlVendor()
then find: under this
#if __VER >= 11 // __CSC_VER11_3
	if(m_nBuyType == 0)
		g_DPlay.SendBuyItem( cTab, (BYTE)( m_pItemElem->m_dwObjId ), nBuy, m_dwItemId );
	else if(m_nBuyType == 1)
		g_DPlay.SendBuyChipItem( cTab, (BYTE)( m_pItemElem->m_dwObjId ), nBuy, m_dwItemId );
add:
Code:
#ifdef __EXTENDED_CURRENCY
else if(m_nBuyType == 2)
		g_DPlay.SendBuyChipItem( cTab, (BYTE)( m_pItemElem->m_dwObjId ), nBuy, m_dwItemId );
else if(m_nBuyType == 3)
		g_DPlay.SendBuyChipItem( cTab, (BYTE)( m_pItemElem->m_dwObjId ), nBuy, m_dwItemId );
else if(m_nBuyType == 4)
		g_DPlay.SendBuyChipItem( cTab, (BYTE)( m_pItemElem->m_dwObjId ), nBuy, m_dwItemId );
#endif // __EXTENDED_CURRENCY
Project.cpp

under:
Code:
CProject::~CProject()

#if __VER >= 11 // __CSC_VER11_3
		for( j = 0; j < MAX_VENDOR_INVENTORY_TAB; j++ )
		{
			for( i = 0; i < lpCharacter->m_venderItemAry2[ j ].GetSize(); i++)
				safe_delete( (LPVENDOR_ITEM)lpCharacter->m_venderItemAry2[ j ].GetAt(i) );
		}
add:
Code:
#ifdef __EXTENDED_CURRENCY		
		for( j = 0; j < MAX_VENDOR_INVENTORY_TAB; j++ )
		{
			for( i = 0; i < lpCharacter->m_venderItemAry4[ j ].GetSize(); i++)
				safe_delete( (LPVENDOR_ITEM)lpCharacter->m_venderItemAry4[ j ].GetAt(i) );
		}
		for( j = 0; j < MAX_VENDOR_INVENTORY_TAB; j++ )
		{
			for( i = 0; i < lpCharacter->m_venderItemAry5[ j ].GetSize(); i++)
				safe_delete( (LPVENDOR_ITEM)lpCharacter->m_venderItemAry5[ j ].GetAt(i) );
		}
		for( j = 0; j < MAX_VENDOR_INVENTORY_TAB; j++ )
		{
			for( i = 0; i < lpCharacter->m_venderItemAry6[ j ].GetSize(); i++)
				safe_delete( (LPVENDOR_ITEM)lpCharacter->m_venderItemAry6[ j ].GetAt(i) );
		}
#endif // __EXTENDED_CURRENCY
under:
Code:
#if __VER >= 11 // __CSC_VER11_3
			else if( script.Token == "AddVenderItem2" || script.Token == "AddVendorItem2")
			{
				script.GetToken(); // (
				int nSlot = script.GetNumber(); script.GetToken(); // 
				DWORD dwId = script.GetNumber(); script.GetToken(); //

				LPVENDOR_ITEM pVendorItem = new VENDOR_ITEM;
				pVendorItem->m_dwItemId = dwId;
				lpCharacter->m_venderItemAry2[ nSlot ].Add( pVendorItem );
			}
add:
Code:
#ifdef __EXTENDED_CURRENCY			
			else if( script.Token == "AddVenderItem4" || script.Token == "AddVenderItem4")
			{
				script.GetToken(); // (
				int nSlot = script.GetNumber(); script.GetToken(); // 
				DWORD dwId = script.GetNumber(); script.GetToken(); //

				LPVENDOR_ITEM pVendorItem = new VENDOR_ITEM;
				pVendorItem->m_dwItemId = dwId;
				lpCharacter->m_venderItemAry4[ nSlot ].Add( pVendorItem );
			}
			else if( script.Token == "AddVenderItem5" || script.Token == "AddVenderItem5")
			{
				script.GetToken(); // (
				int nSlot = script.GetNumber(); script.GetToken(); // 
				DWORD dwId = script.GetNumber(); script.GetToken(); //

				LPVENDOR_ITEM pVendorItem = new VENDOR_ITEM;
				pVendorItem->m_dwItemId = dwId;
				lpCharacter->m_venderItemAry5[ nSlot ].Add( pVendorItem );
			} 
			else if( script.Token == "AddVenderItem6" || script.Token == "AddVenderItem6")
			{
				script.GetToken(); // (
				int nSlot = script.GetNumber(); script.GetToken(); // 
				DWORD dwId = script.GetNumber(); script.GetToken(); //

				LPVENDOR_ITEM pVendorItem = new VENDOR_ITEM;
				pVendorItem->m_dwItemId = dwId;
				lpCharacter->m_venderItemAry6[ nSlot ].Add( pVendorItem );
			}
#endif // __EXTENDED_CURRENCY
project.h

under:
Code:
#if __VER >= 11 // __CSC_VER11_3
	int				m_nVenderType;
	CPtrArray		m_venderItemAry2[ 4 ];
add:
Code:
#ifdef __EXTENDED_CURRENCY
	CPtrArray		m_venderItemAry4[ 4 ];
	CPtrArray		m_venderItemAry5[ 4 ];
	CPtrArray		m_venderItemAry6[ 4 ];
#endif // __EXTENDED_CURRENCY
mover.cpp

under:
Code:
void CMover::ProcessRegenItem()

#if __VER >= 11 // __CSC_VER11_3
				if(pCharacter->m_nVenderType == 1) // 칩으로 거래하는 vender일 경우
				{
					if(pCharacter->m_venderItemAry2[i].GetSize())
					{
						fShop	= TRUE;
						m_ShopInventory[i]->Clear();		// m_pack을 다 없앤다.
						for( int j = 0; j < pCharacter->m_venderItemAry2[i].GetSize(); j++ )
						{
							pVendor	= (LPVENDOR_ITEM)pCharacter->m_venderItemAry2[i].GetAt(j);
							CItemElem itemElem;
							itemElem.m_dwItemId	= pVendor->m_dwItemId;
							itemElem.m_nItemNum	= (short)( prj.GetItemProp( pVendor->m_dwItemId )->dwPackMax );
							itemElem.m_nHitPoint = prj.GetItemProp( pVendor->m_dwItemId )->dwEndurance;
							if( (int)itemElem.GetChipCost() < 1 )
								Error( "chip cost < 1 : npc = %s, item = %d", pCharacter->m_szKey, pVendor->m_dwItemId );
							else
								m_ShopInventory[i]->Add( &itemElem );
						}
					}
				}
add:
Code:
#ifdef __EXTENDED_CURRENCY				
				else if(pCharacter->m_nVenderType == 2 )
				{
					if(pCharacter->m_venderItemAry4[i].GetSize())
					{
						fShop	= TRUE;
						m_ShopInventory[i]->Clear();		// m_pack을 다 없앤다.
						for( int j = 0; j < pCharacter->m_venderItemAry4[i].GetSize(); j++ )
						{
							pVendor	= (LPVENDOR_ITEM)pCharacter->m_venderItemAry4[i].GetAt(j);
							CItemElem itemElem;
							itemElem.m_dwItemId	= pVendor->m_dwItemId;
							itemElem.m_nItemNum	= (short)( prj.GetItemProp( pVendor->m_dwItemId )->dwPackMax );
							itemElem.m_nHitPoint = prj.GetItemProp( pVendor->m_dwItemId )->dwEndurance;
							if( (int)itemElem.GetChipFarmCost() < 1 )
								Error( "Farm Chip cost < 1 : npc = %s, item = %d", pCharacter->m_szKey, pVendor->m_dwItemId );
							else
								m_ShopInventory[i]->Add( &itemElem );
						}
					}
				}
				else if(pCharacter->m_nVenderType == 3 )
				{
                  if(pCharacter->m_venderItemAry5[i].GetSize())
					{
						fShop	= TRUE;
						m_ShopInventory[i]->Clear();		// m_pack을 다 없앤다.
						for( int j = 0; j < pCharacter->m_venderItemAry5[i].GetSize(); j++ )
						{
							pVendor	= (LPVENDOR_ITEM)pCharacter->m_venderItemAry5[i].GetAt(j);
							CItemElem itemElem;
							itemElem.m_dwItemId	= pVendor->m_dwItemId;
							itemElem.m_nItemNum	= (short)( prj.GetItemProp( pVendor->m_dwItemId )->dwPackMax );
							itemElem.m_nHitPoint = prj.GetItemProp( pVendor->m_dwItemId )->dwEndurance;
							if( (int)itemElem.GetChipLgCost() < 1 )
								Error( "LG Chip cost < 1 : npc = %s, item = %d", pCharacter->m_szKey, pVendor->m_dwItemId );
							else
								m_ShopInventory[i]->Add( &itemElem );
						}
					}
				}
				else if(pCharacter->m_nVenderType == 4 )
				{
                  if(pCharacter->m_venderItemAry6[i].GetSize())
					{
						fShop	= TRUE;
						m_ShopInventory[i]->Clear();		// m_pack을 다 없앤다.
						for( int j = 0; j < pCharacter->m_venderItemAry6[i].GetSize(); j++ )
						{
							pVendor	= (LPVENDOR_ITEM)pCharacter->m_venderItemAry6[i].GetAt(j);
							CItemElem itemElem;
							itemElem.m_dwItemId	= pVendor->m_dwItemId;
							itemElem.m_nItemNum	= (short)( prj.GetItemProp( pVendor->m_dwItemId )->dwPackMax );
							itemElem.m_nHitPoint = prj.GetItemProp( pVendor->m_dwItemId )->dwEndurance;
							if( (int)itemElem.GetChipDonateCost() < 1 )
								Error( "Donate Chip cost < 1 : npc = %s, item = %d", pCharacter->m_szKey, pVendor->m_dwItemId );
							else
								m_ShopInventory[i]->Add( &itemElem );
						}
					}
				}
#endif // __EXTENDED_CURRENCY
under:
Code:
BOOL CMover::IsVendorNPC()

#if __VER >= 11 // __CSC_VER11_3
	if(pCharacter->m_nVenderType == 1)
	for( int i = 0; i < MAX_VENDOR_INVENTORY_TAB; i++ )
	{
		if( pCharacter->m_venderItemAry2[i].GetSize() )
			return TRUE;
	}
add:
Code:
#ifdef __EXTENDED_CURRENCY // IKnow zu viele for schleifen hdf XD	
	if(pCharacter->m_nVenderType == 2) // Farm Chips
	for( int i = 0; i < MAX_VENDOR_INVENTORY_TAB; i++ )
	{
		if( pCharacter->m_venderItemAry4[i].GetSize() )
			return TRUE;
	}
	if(pCharacter->m_nVenderType == 3) // Lg Chips
    for( int i = 0; i < MAX_VENDOR_INVENTORY_TAB; i++ )
	{
		if( pCharacter->m_venderItemAry5[i].GetSize() )
			return TRUE;
	}
	if(pCharacter->m_nVenderType == 4) // Donate Chips
	for( int i = 0; i < MAX_VENDOR_INVENTORY_TAB; i++ )
	{
		if( pCharacter->m_venderItemAry6[i].GetSize() )
			return TRUE;
	}
#endif // __EXTENDED_CURRENCY
under:
Code:
BOOL CMover::SetDataMTE( const char* alphaTex, const char* eff2ndTex )

	pData->_pTex[ 0 ] = TexturePool::Get()->GetTexture( DIR_SFXTEX, std::string(szAlphaTexture) );
	pData->_pTex[ 1 ] = TexturePool::Get()->GetTexture( DIR_SFXTEX, std::string(eff2ndTex) );

	if( NULL == pData->_pTex[ 0 ] || NULL == pData->_pTex[ 1 ] )
	{
		Error( "Failed loading MTE texture %s or %s", szAlphaTexture, eff2ndTex );
		return FALSE;
	}
	
	//ok... now you can use this data
	return TRUE;
}

#endif //__BS_EFFECT_LUA
add:
Code:
#ifdef __EXTENDED_CURRENCY
int CMover::GetChipFarmNum()
{
	int nCount	= 0;
	for( int i = 0; i < m_Inventory.GetMax(); i++ )
	{
		CItemElem* pItem	= static_cast<CItemElem*>( GetItemId( i ) );
		if( pItem && ::IsUsableItem( pItem ) )
		{
			if( pItem->GetProp()->dwID == II_SYS_SYS_SCR_PERIN )
				nCount	+= pItem->m_nItemNum;
		}
	}
	return nCount;
}

int CMover::GetChipLgNum()
{
	int nCount	= 0;
	for( int i = 0; i < m_Inventory.GetMax(); i++ )
	{
		CItemElem* pItem	= static_cast<CItemElem*>( GetItemId( i ) );
		if( pItem && ::IsUsableItem( pItem ) )
		{
			if( pItem->GetProp()->dwID == II_CHP_BLUE )
				nCount	+= pItem->m_nItemNum;
		}
	}
	return nCount;
}

int CMover::GetChipDonateNum()
{
	int nCount	= 0;
	for( int i = 0; i < m_Inventory.GetMax(); i++ )
	{
		CItemElem* pItem	= static_cast<CItemElem*>( GetItemId( i ) );
		if( pItem && ::IsUsableItem( pItem ) )
		{
			if( pItem->GetProp()->dwID == II_CHP_BLACK )
				nCount	+= pItem->m_nItemNum;
		}
	}
	return nCount;
}
#endif // __EXTENDED_CURRENCY
mover.h

under:
Code:
#ifdef __CHIP_PLAYERSHOP
	int						GetChipNum();
add:
Code:
#ifdef __EXTENDED_CURRENCY
	int						GetChipFarmNum();
	int						GetChipLgNum();
	int						GetChipDonateNum();
#endif // __EXTENDED_CURRENCY
DPSrvr.cpp

under:
Code:
void CDPSrvr::OnBuyChipItem( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )

find this:
if( lpChar && lpChar->m_nVenderType != 1 )	// 2 - 칩 상인
replace by:
Code:
#ifdef __EXTENDED_CURRENCY		
		if( lpChar && lpChar->m_nVenderType != 1 && lpChar->m_nVenderType != 2 && lpChar->m_nVenderType != 3 && lpChar->m_nVenderType != 4)	// 1 - 칩 상인
			return;
#else
		if( lpChar && lpChar->m_nVenderType != 1 )	// 2 - 칩 상인
			return;
#endif //__EXTENDED_CURRENCY
find this:
Code:
		if( lpChar && lpChar->m_nVenderType == 1 && pUser->m_Inventory.GetAtItemNum( II_CHP_RED ) < (int)( pItemElem->GetChipCost() * nNum ) )
		{
			pUser->AddDefinedText( TID_GAME_LACKCHIP );
			return;
		}
replace by:
Code:
#ifdef __EXTENDED_CURRENCY	
		if( lpChar && ( lpChar->m_nVenderType == 1 && pUser->m_Inventory.GetAtItemNum( II_CHP_RED ) < (int)( pItemElem->GetChipCost() * nNum ) ) )
		{
			pUser->AddDefinedText( TID_GAME_LACKCHIP );
			return;
		}
		if( lpChar->m_nVenderType == 2 && pUser->m_Inventory.GetAtItemNum( II_SYS_SYS_SCR_PERIN ) < (int)( pItemElem->GetChipFarmCost() * nNum ) )
		{
			pUser->AddDefinedText( TID_GAME_LACKCHIP );
			return;
		}
		if( lpChar->m_nVenderType == 3 && pUser->m_Inventory.GetAtItemNum( II_CHP_BLUE ) < (int)( pItemElem->GetChipLgCost() * nNum ) )
		{
			pUser->AddDefinedText( TID_GAME_LACKCHIP );
			return;
		}
		if( lpChar->m_nVenderType == 4 && pUser->m_Inventory.GetAtItemNum( II_CHP_BLACK ) < (int)( pItemElem->GetChipDonateCost() * nNum ) )
		{
			pUser->AddDefinedText( TID_GAME_LACKCHIP );
			return;
		}
#else	// __EXTENDED_CURRENCY
		if( lpChar && lpChar->m_nVenderType == 1 && pUser->m_Inventory.GetAtItemNum( II_CHP_RED ) < (int)( pItemElem->GetChipCost() * nNum ) )
		{
			pUser->AddDefinedText( TID_GAME_LACKCHIP );
			return;
		}
#endif // __EXTENDED_CURRENCY
under:
Code:
		if( lpChar && lpChar->m_nVenderType == 1 )
		{
			if( pUser->m_Inventory.IsFull( pItemElem, pItemElem->GetProp(), nNum ) )
			{
				int nChipNum = pItemElem->GetChipCost() * nNum;
				ItemProp* pChipItemProp = prj.GetItemProp( II_CHP_RED );

				if( nChipNum < (int)( pChipItemProp->dwPackMax ) )
				{
					CItemElem* pTempElem;
					int bEmpty = FALSE;

					for( int i = 0; i < pUser->m_Inventory.GetSize(); i++ )
					{
						pTempElem = pUser->m_Inventory.GetAtId( i );

						if( IsUsableItem(pTempElem) && pChipItemProp->dwID == pTempElem->m_dwItemId )
						{
							if( pTempElem->m_nItemNum <= nChipNum )
								bEmpty = TRUE;

							break;
						}
					}
			
					if( !bEmpty )
					{
						pUser->AddDefinedText( TID_GAME_LACKSPACE, "" );
						return;
					}
				}
			}
		
			DWORD dwChipCost = pItemElem->GetChipCost() * nNum;

			if( dwChipCost > 0x7fff )
			{
				for( ; dwChipCost > 0x7fff; )
				{
					pUser->RemoveItemA( II_CHP_RED, 0x7fff );
					dwChipCost -= 0x7fff;
				}
			}

			pUser->RemoveItemA( II_CHP_RED, (short)dwChipCost );

			CItemElem itemElem;
			itemElem	= *pItemElem;
			itemElem.m_nItemNum = nNum;
			itemElem.SetSerialNumber();

			if( pUser->CreateItem( &itemElem ) )
			{
				// 로그 남김
				LogItemInfo aLogItem;
				aLogItem.Action = "B";
				aLogItem.SendName = pUser->GetName();
				CString strTemp;
				strTemp.Format( "%s_C", pVendor->GetName() );
				aLogItem.RecvName = (LPCTSTR)strTemp;
				aLogItem.WorldId = pUser->GetWorld()->GetID();
				aLogItem.Gold = pUser->GetItemNum( II_CHP_RED ) + itemElem.GetChipCost() * nNum;
				aLogItem.Gold2 = pUser->GetItemNum( II_CHP_RED );
				aLogItem.Gold_1 = (DWORD)( (-1) * (int)( (itemElem.GetChipCost() * nNum) ) );
				OnLogItem( aLogItem, &itemElem, nNum );
			}	
			else
			{
				LogItemInfo aLogItem;
				aLogItem.Action = "B";
				aLogItem.SendName = pUser->GetName();
				CString strTemp;
				strTemp.Format( "%s_CF", pVendor->GetName() );
				aLogItem.RecvName = (LPCTSTR)strTemp;
				aLogItem.WorldId = pUser->GetWorld()->GetID();
				aLogItem.Gold = pUser->GetItemNum( II_CHP_RED ) + itemElem.GetChipCost() * nNum;
				aLogItem.Gold2 = pUser->GetItemNum( II_CHP_RED );
				aLogItem.Gold_1 = (DWORD)( (-1) * (int)( (itemElem.GetChipCost() * nNum) ) );
				OnLogItem( aLogItem, &itemElem, nNum );
			}
		}
add:
Code:
#ifdef __EXTENDED_CURRENCY
		if( lpChar && lpChar->m_nVenderType == 2 )
		{
			if( pUser->m_Inventory.IsFull( pItemElem, pItemElem->GetProp(), nNum ) )
			{
				int nChipNum = pItemElem->GetChipFarmCost() * nNum;
				ItemProp* pChipItemProp = prj.GetItemProp( II_SYS_SYS_SCR_PERIN );

				if( nChipNum < (int)( pChipItemProp->dwPackMax ) )
				{
					CItemElem* pTempElem;
					int bEmpty = FALSE;

					for( int i = 0; i < pUser->m_Inventory.GetSize(); i++ )
					{
						pTempElem = pUser->m_Inventory.GetAtId( i );

						if( IsUsableItem(pTempElem) && pChipItemProp->dwID == pTempElem->m_dwItemId )
						{
							if( pTempElem->m_nItemNum <= nChipNum )
								bEmpty = TRUE;	
							break;
						}
					}
			
					if( !bEmpty )
					{
						pUser->AddDefinedText( TID_GAME_LACKSPACE, "" );
						return;
					}
				}
			}
		
			DWORD dwChipCost = pItemElem->GetChipFarmCost() * nNum;

			if( dwChipCost > 0x7fff )
			{
				for( ; dwChipCost > 0x7fff; )
				{
					pUser->RemoveItemA( II_SYS_SYS_SCR_PERIN, 0x7fff );
					dwChipCost -= 0x7fff;
				}
			}

			pUser->RemoveItemA( II_SYS_SYS_SCR_PERIN, (short)dwChipCost );

			CItemElem itemElem;
			itemElem	= *pItemElem;
			itemElem.m_nItemNum = nNum;
			itemElem.SetSerialNumber();

			if( pUser->CreateItem( &itemElem ) )
			{
				// 로그 남김
				LogItemInfo aLogItem;
				aLogItem.Action = "B";
				aLogItem.SendName = pUser->GetName();
				CString strTemp;
				strTemp.Format( "%s_C", pVendor->GetName() );
				aLogItem.RecvName = (LPCTSTR)strTemp;
				aLogItem.WorldId = pUser->GetWorld()->GetID();
				aLogItem.Gold = pUser->GetItemNum( II_SYS_SYS_SCR_PERIN ) + itemElem.GetChipFarmCost() * nNum;
				aLogItem.Gold2 = pUser->GetItemNum( II_SYS_SYS_SCR_PERIN );
				aLogItem.Gold_1 = (DWORD)( (-1) * (int)( (itemElem.GetChipFarmCost() * nNum) ) );
				OnLogItem( aLogItem, &itemElem, nNum );
			}	
			else
			{
				LogItemInfo aLogItem;
				aLogItem.Action = "B";
				aLogItem.SendName = pUser->GetName();
				CString strTemp;
				strTemp.Format( "%s_CF", pVendor->GetName() );
				aLogItem.RecvName = (LPCTSTR)strTemp;
				aLogItem.WorldId = pUser->GetWorld()->GetID();
				aLogItem.Gold = pUser->GetItemNum( II_SYS_SYS_SCR_PERIN ) + itemElem.GetChipFarmCost() * nNum;
				aLogItem.Gold2 = pUser->GetItemNum( II_SYS_SYS_SCR_PERIN );
				aLogItem.Gold_1 = (DWORD)( (-1) * (int)( (itemElem.GetChipFarmCost() * nNum) ) );
				OnLogItem( aLogItem, &itemElem, nNum );
			}
		}
		
		if( lpChar && lpChar->m_nVenderType == 3 )
		{
			if( pUser->m_Inventory.IsFull( pItemElem, pItemElem->GetProp(), nNum ) )
			{
				int nChipNum = pItemElem->GetChipLgCost() * nNum;
				ItemProp* pChipItemProp = prj.GetItemProp( II_CHP_BLUE );

				if( nChipNum < (int)( pChipItemProp->dwPackMax ) )
				{
					CItemElem* pTempElem;
					int bEmpty = FALSE;

					for( int i = 0; i < pUser->m_Inventory.GetSize(); i++ )
					{
						pTempElem = pUser->m_Inventory.GetAtId( i );

						if( IsUsableItem(pTempElem) && pChipItemProp->dwID == pTempElem->m_dwItemId )
						{
							if( pTempElem->m_nItemNum <= nChipNum )
								bEmpty = TRUE;	
							break;
						}
					}
			
					if( !bEmpty )
					{
						pUser->AddDefinedText( TID_GAME_LACKSPACE, "" );
						return;
					}
				}
			}
		
			DWORD dwChipCost = pItemElem->GetChipLgCost() * nNum;

			if( dwChipCost > 0x7fff )
			{
				for( ; dwChipCost > 0x7fff; )
				{
					pUser->RemoveItemA( II_CHP_BLUE, 0x7fff );
					dwChipCost -= 0x7fff;
				}
			}

			pUser->RemoveItemA( II_CHP_BLUE, (short)dwChipCost );

			CItemElem itemElem;
			itemElem	= *pItemElem;
			itemElem.m_nItemNum = nNum;
			itemElem.SetSerialNumber();

			if( pUser->CreateItem( &itemElem ) )
			{
				// 로그 남김
				LogItemInfo aLogItem;
				aLogItem.Action = "B";
				aLogItem.SendName = pUser->GetName();
				CString strTemp;
				strTemp.Format( "%s_C", pVendor->GetName() );
				aLogItem.RecvName = (LPCTSTR)strTemp;
				aLogItem.WorldId = pUser->GetWorld()->GetID();
				aLogItem.Gold = pUser->GetItemNum( II_CHP_BLUE ) + itemElem.GetChipLgCost() * nNum;
				aLogItem.Gold2 = pUser->GetItemNum( II_CHP_BLUE );
				aLogItem.Gold_1 = (DWORD)( (-1) * (int)( (itemElem.GetChipLgCost() * nNum) ) );
				OnLogItem( aLogItem, &itemElem, nNum );
			}	
			else
			{
				LogItemInfo aLogItem;
				aLogItem.Action = "B";
				aLogItem.SendName = pUser->GetName();
				CString strTemp;
				strTemp.Format( "%s_CF", pVendor->GetName() );
				aLogItem.RecvName = (LPCTSTR)strTemp;
				aLogItem.WorldId = pUser->GetWorld()->GetID();
				aLogItem.Gold = pUser->GetItemNum( II_CHP_BLUE ) + itemElem.GetChipLgCost() * nNum;
				aLogItem.Gold2 = pUser->GetItemNum( II_CHP_BLUE );
				aLogItem.Gold_1 = (DWORD)( (-1) * (int)( (itemElem.GetChipLgCost() * nNum) ) );
				OnLogItem( aLogItem, &itemElem, nNum );
			}
		}
		
		if( lpChar && lpChar->m_nVenderType == 4 )
		{
			if( pUser->m_Inventory.IsFull( pItemElem, pItemElem->GetProp(), nNum ) )
			{
				int nChipNum = pItemElem->GetChipDonateCost() * nNum;
				ItemProp* pChipItemProp = prj.GetItemProp( II_CHP_BLACK );

				if( nChipNum < (int)( pChipItemProp->dwPackMax ) )
				{
					CItemElem* pTempElem;
					int bEmpty = FALSE;

					for( int i = 0; i < pUser->m_Inventory.GetSize(); i++ )
					{
						pTempElem = pUser->m_Inventory.GetAtId( i );

						if( IsUsableItem(pTempElem) && pChipItemProp->dwID == pTempElem->m_dwItemId )
						{
							if( pTempElem->m_nItemNum <= nChipNum )
								bEmpty = TRUE;	
							break;
						}
					}
			
					if( !bEmpty )
					{
						pUser->AddDefinedText( TID_GAME_LACKSPACE, "" );
						return;
					}
				}
			}
		
			DWORD dwChipCost = pItemElem->GetChipDonateCost() * nNum;

			if( dwChipCost > 0x7fff )
			{
				for( ; dwChipCost > 0x7fff; )
				{
					pUser->RemoveItemA( II_CHP_BLACK, 0x7fff );
					dwChipCost -= 0x7fff;
				}
			}

			pUser->RemoveItemA( II_CHP_BLACK, (short)dwChipCost );

			CItemElem itemElem;
			itemElem	= *pItemElem;
			itemElem.m_nItemNum = nNum;
			itemElem.SetSerialNumber();

			if( pUser->CreateItem( &itemElem ) )
			{
				// 로그 남김
				LogItemInfo aLogItem;
				aLogItem.Action = "B";
				aLogItem.SendName = pUser->GetName();
				CString strTemp;
				strTemp.Format( "%s_C", pVendor->GetName() );
				aLogItem.RecvName = (LPCTSTR)strTemp;
				aLogItem.WorldId = pUser->GetWorld()->GetID();
				aLogItem.Gold = pUser->GetItemNum( II_CHP_BLACK ) + itemElem.GetChipDonateCost() * nNum;
				aLogItem.Gold2 = pUser->GetItemNum( II_CHP_BLACK );
				aLogItem.Gold_1 = (DWORD)( (-1) * (int)( (itemElem.GetChipDonateCost() * nNum) ) );
				OnLogItem( aLogItem, &itemElem, nNum );
			}	
			else
			{
				LogItemInfo aLogItem;
				aLogItem.Action = "B";
				aLogItem.SendName = pUser->GetName();
				CString strTemp;
				strTemp.Format( "%s_CF", pVendor->GetName() );
				aLogItem.RecvName = (LPCTSTR)strTemp;
				aLogItem.WorldId = pUser->GetWorld()->GetID();
				aLogItem.Gold = pUser->GetItemNum( II_CHP_BLACK ) + itemElem.GetChipDonateCost() * nNum;
				aLogItem.Gold2 = pUser->GetItemNum( II_CHP_BLACK );
				aLogItem.Gold_1 = (DWORD)( (-1) * (int)( (itemElem.GetChipDonateCost() * nNum) ) );
				OnLogItem( aLogItem, &itemElem, nNum );
			}
		}
#endif // __EXTENDED_CURRENCY
	}
#ifdef __SYSSECURITY
}
catch(...)
{
	Error("Error on Line %d in %s",__LINE__,__FILE__);
}
#endif
}
#endif // __GUILDCOMBATCHIP
Define to Versioncommon.h [Neuz, Worldserver].
Code:
#define __EXTENDED_CURRENCY
http://epvpimg.com/Y78ab

Credits: GOW SOURCE



jericho2nd is offline  
Old   #2
 
elite*gold: 0
Join Date: Jan 2014
Posts: 684
Received Thanks: 324
PHP Code:
#ifdef __EXTENDED_CURRENCY
DWORD CItemBase::GetChipFarmCost()
{
    
ItemProp *pProp GetProp();
    if( 
pProp == NULL )        
        return -
1;
    if( 
pProp->dwReferValue1 == 0xFFFFFFFF )    
        return -
1;

    return 
pProp->dwReferValue1;
}

DWORD CItemBase::GetChipLgCost()
{
    
ItemProp *pProp GetProp();
    if( 
pProp == NULL )        
        return -
1;
    if( 
pProp->dwReferValue1 == 0xFFFFFFFF )    
        return -
1;

    return 
pProp->dwReferValue1;
}

DWORD CItemBase::GetChipDonateCost()
{
    
ItemProp *pProp GetProp();
    if( 
pProp == NULL )        
        return -
1;
    if( 
pProp->dwReferValue1 == 0xFFFFFFFF )    
        return -
1;

    return 
pProp->dwReferValue1;
}
#endif    // __EXTENDED_CURRENCY 
for real?


Drabur is offline  
Thanks
1 User
Old   #3
 
elite*gold: 0
Join Date: Jul 2015
Posts: 98
Received Thanks: 5
Quote:
Originally Posted by Drabur View Post
PHP Code:
#ifdef __EXTENDED_CURRENCY
DWORD CItemBase::GetChipFarmCost()
{
    
ItemProp *pProp GetProp();
    if( 
pProp == NULL )        
        return -
1;
    if( 
pProp->dwReferValue1 == 0xFFFFFFFF )    
        return -
1;

    return 
pProp->dwReferValue1;
}

DWORD CItemBase::GetChipLgCost()
{
    
ItemProp *pProp GetProp();
    if( 
pProp == NULL )        
        return -
1;
    if( 
pProp->dwReferValue1 == 0xFFFFFFFF )    
        return -
1;

    return 
pProp->dwReferValue1;
}

DWORD CItemBase::GetChipDonateCost()
{
    
ItemProp *pProp GetProp();
    if( 
pProp == NULL )        
        return -
1;
    if( 
pProp->dwReferValue1 == 0xFFFFFFFF )    
        return -
1;

    return 
pProp->dwReferValue1;
}
#endif    // __EXTENDED_CURRENCY 
for real?
oh sorry . this is for private shop
jericho2nd is offline  
Old   #4
 
elite*gold: 0
Join Date: Jan 2014
Posts: 684
Received Thanks: 324
its just stupid 3 times the same code? just a other name for this function
code like gpotato


Drabur is offline  
Thanks
1 User
Old   #5
 
elite*gold: 0
Join Date: Sep 2016
Posts: 25
Received Thanks: 9
too lazy to read all that , can you explain what it is ?
Pradaa is offline  
Old   #6
 
elite*gold: 0
Join Date: Aug 2013
Posts: 110
Received Thanks: 45
You must register and activate your account in order to view images.
@Pradaa
Virage' is offline  
Old   #7
 
elite*gold: 0
Join Date: Sep 2016
Posts: 25
Received Thanks: 9
Quote:
Originally Posted by Virage' View Post
You must register and activate your account in order to view images.
@Pradaa
I didn't asked for a title -_-
Pradaa is offline  
Old   #8
 
elite*gold: 0
Join Date: Feb 2014
Posts: 248
Received Thanks: 219
Quote:
Originally Posted by Pradaa View Post
I didn't asked for a title -_-
title says what it is.. what is wrong with you?
Jupsi332 is offline  
Thanks
2 Users
Old   #9
 
elite*gold: 0
Join Date: Sep 2016
Posts: 25
Received Thanks: 9
Quote:
Originally Posted by Jupsi332 View Post
title says what it is.. what is wrong with you?
i'm just asking for explanation or even screens

cause i don't understand that title lmao

cause i don't understand that title
Pradaa is offline  
Old   #10
 
elite*gold: 0
Join Date: Nov 2015
Posts: 124
Received Thanks: 129
its for private shop like you vend item for Red Chip etc..
justcallmeidol09 is offline  
Old   #11
 
elite*gold: 85
Join Date: Jan 2012
Posts: 1,140
Received Thanks: 873
what about this? o.O
[Release] Items kaufen via Perin
Rhyder` is offline  
Old   #12
 
elite*gold: 0
Join Date: Aug 2013
Posts: 110
Received Thanks: 45
Quote:
Originally Posted by Pradaa View Post
i'm just asking for explanation or even screens

cause i don't understand that title lmao

cause i don't understand that title
Ich kann echt nicht glauben was man an "Extended Currency" nicht verstehen kann?!

Neue Chip Whrungen z.B. statt nur Red Chips gibt es jetzt Blue Chips oder whatever..

Wenn du den Titel so offensichtlich wie er dort steht schon nicht verstehst dann kann man ja wohl immer noch Google Translate oder irgendeine andere bersetzungmaschine benutzen.

Krasser Typ
Virage' is offline  
Old   #13
 
elite*gold: 0
Join Date: Aug 2014
Posts: 358
Received Thanks: 55
Extended currency is for a npc shop.
Ecrypter is offline  
Old   #14
 
elite*gold: 10
Join Date: Oct 2010
Posts: 283
Received Thanks: 51
@Drabur ist genau so in der GoW Source drin.
@topic i dont know if its useful because its already released.

Mit freundlichen Gr廻en,
- Kevin
kevinkraus is offline  
Old   #15
 
elite*gold: 0
Join Date: Aug 2017
Posts: 20
Received Thanks: 0
where is the item.h and item.cpp?


RhisisChaos is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
NPC Extended Currency
Hello Epvp, Anyone who knows what's the problem? i tried to add the EXTENDED CURRENCY on my source and compile all successfully then try to make...
0 Replies - Flyff PServer - Discussions / Questions
EXTENDED [MAINTENANCE]
http://sf.ph.gameclub.com/images/notice/check_bg_img02.jpg EMERGENCY SERVER MAINTENANCE 10/16/2010 Due to some technical concerns, the server...
2 Replies - Soldier Front Hacks, Bots, Cheats & Exploits



All times are GMT +1. The time now is 07:14.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.