Ejemplo n.º 1
0
BOOL CWndShopCtrl::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
{
	CWndBase* pWndFrame =  pShortcut->m_pFromWnd->GetFrameWnd();
	if( pWndFrame->GetWndId() != APP_SHOP_ )
		return FALSE;

	if( pShortcut->m_dwShortcut == SHORTCUT_ITEM )
	{
		CItemElem* pItemElem = (CItemElem*)pShortcut->m_dwData;
		DWORD nTempCost = 0;
		if( m_nTabType == 0)
		{
			nTempCost += pItemElem->GetCost();
			nTempCost = static_cast< int >( static_cast< float >( nTempCost ) * prj.m_fShopBuyRate );

			if(CTax::GetInstance()->IsApplyTaxRate( g_pPlayer, pItemElem ))
				nTempCost += ( static_cast<DWORD>(nTempCost * CTax::GetInstance()->GetPurchaseTaxRate( g_pPlayer )) );
		}
		else if( m_nTabType == 1 || m_nTabType == 2 )
			nTempCost += pItemElem->GetChipCost();

		nTempCost = (int)((float)nTempCost * prj.m_fShopCost );
		
		if( pItemElem && pItemElem->m_dwItemId == II_SYS_SYS_SCR_PERIN )
			nTempCost = PERIN_VALUE;

		if( nTempCost > INT_MAX )
			return FALSE;

		for( int i = 0; i < MAX_CART; i++ )
		{
			int x = i % 6;
			int y = i / 6;			
			CRect rectHittest = CRect( x * 35, y * 35 + 3, x * 35 + 35, y * 35 + 35 + 3);
			if( rectHittest.PtInRect( point ) )
			{
				m_nLastPoint = i;
				break;
			}
		}
		CWndBase* pParent = (CWndBase*)GetParentWnd();
		pParent->OnChildNotify( WIN_ITEMDROP, m_nIdWnd, (LRESULT*)pShortcut ); 
		return TRUE;
	}

	return FALSE;
}
Ejemplo n.º 2
0
BOOL CWndGHTeleporter::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
{
	CWndBase* pWndFrame	= pShortcut->m_pFromWnd->GetFrameWnd();
	if( !pWndFrame )
	{
		assert( 0 );
		return FALSE;
	}

	if( APP_INVENTORY == pWndFrame->GetWndId( ) )			// 인벤에서 온 아이템은 조건검사 
	{
		CItemElem* pItem = g_pPlayer->m_Inventory.GetAtId( pShortcut->m_dwId );
		if( !IsUsableItem( pItem ) )
			return FALSE;

		// 텔레포터 아이템일때만 
		if( IK3_TELEPORTER != pItem->GetProp( )->dwItemKind3  )
			return FALSE;

		g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, pItem->m_dwObjId ), g_pPlayer->GetId( ) );
	}

	return TRUE;
}
Ejemplo n.º 3
0
BOOL CWndRepairItem::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	if( message == WIN_ITEMDROP )
	{
		LPSHORTCUT lpShortcut = (LPSHORTCUT)pLResult;
		CWndBase* pWndFrame = lpShortcut->m_pFromWnd->GetFrameWnd();
		if( nID == 11 ) // item
		{
			if( pWndFrame->GetWndId() == APP_INVENTORY )
			{
				CItemBase* pItemBase	= g_pPlayer->GetItemId( lpShortcut->m_dwId );
				if( pItemBase )
				{
					if( g_pPlayer->m_Inventory.IsEquip( pItemBase->m_dwObjId ) == FALSE )
					{
						// 아이템인가?
						// 방어구 혹은 무기인가?
						// 수리할 필요가 있는가?
						ItemProp* pItemProp	= pItemBase->GetProp();
						if( pItemProp )
						{
							if( pItemProp->dwItemKind2 >= IK2_WEAPON_HAND && pItemProp->dwItemKind2 <= IK2_ARMORETC && ((CItemElem*)pItemBase)->m_nRepair < pItemProp->nMaxRepair )
							{
								CItemElem* pItemElem	= (CItemElem*)pItemBase;
								if( pItemElem->m_nHitPoint < 0 )
									pItemElem->m_nHitPoint = 0;

								if( pItemElem->m_nHitPoint < (int)( pItemProp->dwEndurance ) )
								{
									int nRepair	= 100 - ( ( pItemElem->m_nHitPoint * 100 ) / pItemProp->dwEndurance );
									DWORD dwSumCost = m_dwCost + nRepair * ( pItemProp->dwCost / 1000 + 1 );
									if( g_pPlayer->GetTotalGold() >= (int)( dwSumCost ) )
									{
										m_dwCost = dwSumCost;
										char szCost[MAX_PATH] = {0,};
										sprintf( szCost, "%-d", m_dwCost );
										pWndStaticCost->SetTitle( szCost );
										int iIndex	= lpShortcut->m_dwData - 100;
										m_adwIdRepair[iIndex]	= pItemElem->m_dwObjId;
										pItemElem->m_bRepair	= TRUE;
									}
									else
									{
										// 페냐가 부족하여 수리를 할수 없습니다.
										g_WndMng.PutString( prj.GetText(TID_GAME_REPAIR_NOTENOUGHPENYA), NULL, prj.GetTextColor( TID_GAME_REPAIR_NOTENOUGHPENYA ) );
									}									
								}
								else
								{
									// 수리할 필요가 없는 아이템
									g_WndMng.PutString( prj.GetText(TID_GAME_REPAIR_FULLENDURANCE), NULL, prj.GetTextColor( TID_GAME_REPAIR_FULLENDURANCE ) );
								}
							}
							else
							{
								// 수리할수 없는 아이템
								g_WndMng.PutString( prj.GetText(TID_GAME_REPAIR_DONOT), NULL, prj.GetTextColor( TID_GAME_REPAIR_DONOT ) );
							}
						}
					}
					else
					{
						// 장착되어 있음.
						g_WndMng.PutString( prj.GetText(TID_GAME_REPAIR_EQUIP), NULL, prj.GetTextColor( TID_GAME_REPAIR_EQUIP ) );
					}
				}
//				if( itemElem )
//				{
//					pRepairItem.Add( itemElem->m_dwItemId, itemElem->m_nItemNum, itemElem->m_nAbilityOption, itemElem->m_dwSerialNumber );
//				}

				/*
				CWndItemCtrl* pWndItemCtrl = (CWndItemCtrl*)lpShortcut->m_pFromWnd;
				UINT SelectCount = pWndItemCtrl->GetSelectedCount();
				if( SelectCount != 1)
				{
					//g_WndMng.PutString( "장착 되어 있는것은 넣을수 없습니다", NULL, 0xffffff00 );
					g_WndMng.PutString( prj.GetText(TID_GAME_EQUIPPUT), NULL, prj.GetTextColor( TID_GAME_EQUIPPUT ) );
					
				}
				else
				{
					for( int i = 0; i < SelectCount; i++ )
					{
						int nItem = pWndItemCtrl->GetSelectedItem( i );
						pWndItemCtrl->GetItem( nItem );
					}
					CItemElem* itemElem = (CItemElem*)lpShortcut->m_dwData;
					if( itemElem )
					{
						pRepairItem.Add( itemElem->m_dwItemId, itemElem->m_nItemNum, itemElem->m_nAbilityOption, itemElem->m_dwSerialNumber );
					}
				}
				int aaa = 0;				
				*/
			}
		}
	}
	else
	if( message == WNM_CLICKED )
	{
		if( nID == WIDC_OK )
		{
			g_DPlay.SendRepairItem( m_adwIdRepair );
		}
		else if( nID == WIDC_CANCEL || nID == WTBID_CLOSE )
		{
			OnInit();
			nID = WTBID_CLOSE;
		}
	}
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
Ejemplo n.º 4
0
BOOL CWndItemTransy::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
{
	CWndBase* pWndFrame = pShortcut->m_pFromWnd->GetFrameWnd();
	
	// 인벤토리에서 온것인지 검사
	if( !(pShortcut->m_dwShortcut == SHORTCUT_ITEM) && !(pWndFrame->GetWndId() == APP_INVENTORY) )
		return FALSE;
	
	// 장착되어있는지 검사
	if( g_pPlayer->m_Inventory.IsEquip( pShortcut->m_dwId ) )
	{
		g_WndMng.PutString( prj.GetText(TID_GAME_EQUIPPUT), NULL, prj.GetTextColor(TID_GAME_EQUIPPUT) );
		SetForbid( TRUE );
		return FALSE;
	}
	
	CItemElem* pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
	if( pItemElem == NULL )
	{
		SetForbid( TRUE );
		return FALSE;
	}
	
	if( PtInRect( &m_Rect[0], point ) )
	{
		ItemProp* pItemPropChange = NULL;
		// 성별이 있는 아이템 인지 검사
		ItemProp* pItemProp = pItemElem->GetProp();
		
		pItemPropChange = g_pPlayer->GetTransyItem( pItemProp );
		if( pItemPropChange == NULL )
		{
			g_WndMng.PutString( prj.GetText(TID_GAME_ITEM_TRANSY), NULL, prj.GetTextColor(TID_GAME_ITEM_TRANSY) );
			SetForbid( TRUE );
			return FALSE;
		}

#ifdef __SYS_ITEMTRANSY
		if(!m_bMenu)
		{
#endif //__SYS_ITEMTRANSY
			if( m_pItemElem[1]->GetProp()->dwID == II_CHR_SYS_SCR_ITEMTRANSY_A )
			{
				if( 61 <= pItemElem->GetProp()->dwLimitLevel1 )
				{
					CString strMsg;
					strMsg.Format( prj.GetText( TID_GAME_ITEM_TRANSY_NOT_LEVEL_0 ), m_pItemElem[1]->GetProp()->szName );
					g_WndMng.PutString( strMsg, NULL, prj.GetTextColor(TID_GAME_ITEM_TRANSY_NOT_LEVEL_0) );
					SetForbid( TRUE );
					return FALSE;
				}
			}
			else
			{
				if( pItemElem->GetProp()->dwLimitLevel1 < 61 )
				{
					CString strMsg;
					strMsg.Format( prj.GetText( TID_GAME_ITEM_TRANSY_NOT_LEVEL_1 ), m_pItemElem[1]->GetProp()->szName );
					g_WndMng.PutString( strMsg, NULL, prj.GetTextColor(TID_GAME_ITEM_TRANSY_NOT_LEVEL_1) );
					SetForbid( TRUE );
					return FALSE;
				}
			}
#ifdef __SYS_ITEMTRANSY
		}
#endif //__SYS_ITEMTRANSY
		if( m_pItemElem[0] )
		{
			m_pItemElem[0]->SetExtra( 0 );	
		}
		
		pItemElem->SetExtra( 1 );
		m_pItemElem[0] = pItemElem;

		m_pItemElemChange = *m_pItemElem[0];
		m_pItemElemChange.m_dwItemId = pItemPropChange->dwID;
		m_pItemElemChange.m_nHitPoint	= pItemPropChange->dwEndurance;
	}
	
	return TRUE;
}
Ejemplo n.º 5
0
BOOL CWndGuildBank::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	if( WIN_DBLCLK == message )
		return FALSE;

	LPSHORTCUT	lpShortcut	= reinterpret_cast<LPSHORTCUT>(pLResult);
	if( lpShortcut == NULL )
		return FALSE;
	if( lpShortcut->m_pFromWnd == NULL )
		return FALSE;
	CWndBase*	pWndFrame	= lpShortcut->m_pFromWnd->GetFrameWnd();
	
	if(  pWndFrame == NULL )
		return FALSE;

	if( pWndFrame->GetWndId() == APP_INVENTORY )
	{
		switch (message)
		{
		case	WIN_ITEMDROP:
			{
				if( nID == 11 ) // item
				{
					BOOL bForbid = TRUE;
					SAFE_DELETE( g_WndMng.m_pWndTradeGold );
					if( lpShortcut->m_dwData != 0 )
					{
						CWndItemCtrl* pWndItemCtrl = (CWndItemCtrl*)lpShortcut->m_pFromWnd;
						
						UINT SelectCount = pWndItemCtrl->GetSelectedCount();
						if( SelectCount != 1)
						{
							//g_WndMng.PutString( "장착 되어 있는것은 넣을수 없습니다", NULL, 0xffffff00 );
							g_WndMng.PutString( prj.GetText(TID_GAME_EQUIPPUT), NULL, prj.GetTextColor( TID_GAME_EQUIPPUT ) );
							
						}
						else
						{
							for( int i = 0; i < (int)( SelectCount ); i++ )
							{
								int nItem = pWndItemCtrl->GetSelectedItem( i );
								pWndItemCtrl->GetItem( nItem );
							}
							CItemElem* itemElem = (CItemElem*)lpShortcut->m_dwData;
							
							if( itemElem->IsCharged() )
							{
								g_WndMng.PutString( prj.GetText( TID_GAME_NOTTRADE ), NULL, prj.GetTextColor( TID_GAME_NOTTRADE ) );
								return FALSE;
							}

							if( itemElem->m_nItemNum > 1 )
							{ 
								g_WndMng.m_pWndTradeGold = new CWndTradeGold;
								memcpy( &g_WndMng.m_pWndTradeGold->m_Shortcut, pLResult, sizeof(SHORTCUT) );
								g_WndMng.m_pWndTradeGold->m_dwGold = itemElem->m_nItemNum;
								g_WndMng.m_pWndTradeGold->m_nIdWndTo = APP_GUILD_BANK;
								g_WndMng.m_pWndTradeGold->m_pWndBase = this;
								
								g_WndMng.m_pWndTradeGold->Initialize( NULL, APP_TRADE_GOLD );
								g_WndMng.m_pWndTradeGold->MoveParentCenter();
								CWndStatic* pStatic	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_STATIC );
								CWndStatic* pStaticCount	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_CONTROL1 );
								CString strMain = prj.GetText(TID_GAME_MOVECOUNT);//"몇개를 이동하시겠습니까?";
								CString strCount = prj.GetText(TID_GAME_NUMCOUNT);// " 갯수 : ";
								pStatic->m_strTitle = strMain;
								pStaticCount->m_strTitle = strCount;
							}
							else
							{
								g_DPlay.SendPutItemGuildBank( (BYTE)( lpShortcut->m_dwId ), 1, 1 );
							}
							
						}
					}
				}
			}
			break;

		case	WIN_DBLCLK:
			{
			}
			break;
			
		case	WNM_CLICKED:
			{
				switch( nID )
				{
				case WTBID_CLOSE: // 종료
					{
						g_DPlay.SendCloseGuildBankWnd();
					}
					break;
				}
			}
			break;
		}
	} else
	{
		switch( nID )
		{
		case WTBID_CLOSE:
			{
				g_DPlay.SendCloseGuildBankWnd();
			}
			break;

		case WIDC_BUTTON1:		// 길드 지원(공헌)
			SAFE_DELETE(m_pwndGuildMerit);
			// TID_GAME_GUILDNOTHINGNAME 
			{
				CGuild *pGuild = g_pPlayer->GetGuild();
				if( pGuild )
				{
					if( pGuild->m_szGuild[0] == '\0' )
					{
						// "길드명칭이 없어 길드에 지원을 할 수 없습니다. 길드마스터는 길드명칭을 정해주세요."
						g_WndMng.OpenMessageBox( prj.GetText( TID_GAME_GUILDNOTHINGNAME ), MB_OK, this );
					}
					else
					{
						m_pwndGuildMerit = new CWndGuildMerit;
						m_pwndGuildMerit->Initialize( this );
					}
				}
			}
			break;
		case WIDC_BUTTON2:		// 망토제작.
			{
				CGuild *pGuild = g_pPlayer->GetGuild();
				if( pGuild )
				{
					if( pGuild->m_nLevel < 4 )		// 4레벨 이하는 망토못만듬.
					{
						g_WndMng.OpenMessageBox( prj.GetText( TID_GAME_GUILDNOTLEVEL ), MB_OK, this );
						break;
					}
					g_DPlay.SendCreateGuildCloak();
				}
			}
			break;
#if __VER < 8 // #ifndef __GUILDCOMBAT_85
		case WIDC_BUTTON3:
			{
				CGuild *pGuild = g_pPlayer->GetGuild();

				// 길드가 존재하고 우승한 길드이면서...그길드의 맴버이면...망토 생성가능
				if( pGuild && g_GuildCombatMng.m_uWinGuildId == pGuild->GetGuildId() && pGuild->IsMember( g_pPlayer->m_idPlayer ) )
				{
					CWndGuildBankMessageBox* pBox = new CWndGuildBankMessageBox;
					g_WndMng.OpenCustomBox( "", pBox );
					CString str;
					str.Format( prj.GetText( TID_GAME_GUILDCOMBAT_MAKE_CLOAK ) );	//"수정요망!! 용망토를 생성하시겠습니까? 1,000페냐의 제작 수수료가 부과됩니다." );
					pBox->SetValue( str );
				}
			}
			break;
#endif // __VER < 8
#if __VER >= 11 // __GUILD_BANK_LOG
		case WIDC_LOG:
			{
				CGuild* pGuild = g_pPlayer->GetGuild();
				CGuildMember* pGuildMemberl;
					
				pGuildMemberl = pGuild->GetMember( g_pPlayer->m_idPlayer );
						
				if( pGuildMemberl && (pGuildMemberl->m_nMemberLv == GUD_MASTER || pGuildMemberl->m_nMemberLv == GUD_KINGPIN) )
				{
					CWndGuildBankLog* pwndbanklog = (CWndGuildBankLog*)GetWndBase(APP_GUILD_BANK_LOG);
					if(pwndbanklog == NULL)
					{
						g_WndMng.m_pWndGuildBankLog = new CWndGuildBankLog();
						g_WndMng.m_pWndGuildBankLog->Initialize(this);
					}
					else
						SAFE_DELETE(g_WndMng.m_pWndGuildBankLog);
				}
				else
					g_WndMng.PutString( prj.GetText( TID_GAME_CANNT_USE_GLOG ), NULL, prj.GetTextColor( TID_GAME_CANNT_USE_GLOG ) );
			}
			break;
#endif //__GUILD_BANK_LOG
		}
	}
	
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
} 
Ejemplo n.º 6
0
BOOL CWndPiercing::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
{
	CWndBase* pWndFrame =  pShortcut->m_pFromWnd->GetFrameWnd();

	// 아이템이 인벤토리에서 왔는가?
	if( !(pShortcut->m_dwShortcut == SHORTCUT_ITEM) && !(pWndFrame->GetWndId() == APP_INVENTORY) )
		return FALSE;
	
	if( g_pPlayer->m_Inventory.IsEquip( pShortcut->m_dwId ) )
	{
		g_WndMng.PutString( prj.GetText(TID_GAME_EQUIPPUT), NULL, prj.GetTextColor(TID_GAME_EQUIPPUT) );
		SetForbid( TRUE );
		return FALSE;
	}
		
	CItemElem* pItemElem  = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
	if(pItemElem == NULL)
		return FALSE;

	// 아이템( 방어구, 무기구 )
	if( PtInRect(&m_Rect[0], point) )
	{
		
#if __VER < 9 // __ULTIMATE
		if( pItemElem->GetProp()->dwItemKind3 != IK3_SUIT )
		{
			g_WndMng.PutString( prj.GetText(TID_PIERCING_POSSIBLE_ITEM), NULL, prj.GetTextColor(TID_PIERCING_POSSIBLE_ITEM) );
			return FALSE;
		}
#endif // __ULTIMATE
		
		// 4개 초과로 피어싱 할수 없음
#if __VER >= 12 // __EXT_PIERCING
		if( !pItemElem->IsPierceAble( NULL_ID, TRUE ) )
#else // __EXT_PIERCING
		if( pItemElem->GetPiercingSize() >= MAX_PIERCING_SUIT )
#endif // __EXT_PIERCING
		{
			g_WndMng.PutString( prj.GetText(TID_PIERCING_POSSIBLE), NULL, prj.GetTextColor(TID_PIERCING_POSSIBLE) );
			return FALSE;
		}
#ifdef __NEW_ITEM_VARUNA
		if( pItemElem->GetProp()->IsBaruna() )
		{
			g_WndMng.PutString( prj.GetText(TID_PIERCING_POSSIBLE), NULL, prj.GetTextColor(TID_PIERCING_POSSIBLE) );
			return FALSE;
		}
#endif // __NEW_ITEM_VARUNA	
		if( pItemElem->GetProp()->dwItemRare == 0xffffffff )
		{
			g_WndMng.PutString( prj.GetText(TID_PIERCING_POSSIBLE_ITEM), NULL, prj.GetTextColor(TID_PIERCING_POSSIBLE_ITEM) );
			return FALSE;
		}

		if( m_pItemElem[0] )
			m_pItemElem[0]->SetExtra( 0 );

		pItemElem->SetExtra( 1 );
		m_pItemElem[0]	= pItemElem;	
		
		if( m_pItemElem[1] )
		{
			m_pItemElem[1]->SetExtra( 0 );
			m_pItemElem[1] = NULL;
		}
		if( m_pItemElem[2] )
		{
			m_pItemElem[2]->SetExtra( 0 );
			m_pItemElem[2] = NULL;
		}
	}
	else
	if( PtInRect(&m_Rect[1], point) )
	{
		// 파워다이스 8, 10만 사용할수 있음
		if( m_pItemElem[0] )
		{
#if __VER >= 8 //__Y_NEW_ENCHANT
			if( pItemElem->GetProp()->dwID != II_GEN_MAT_MOONSTONE && pItemElem->GetProp()->dwID != II_GEN_MAT_MOONSTONE_1 )
#else //__Y_NEW_ENCHANT				
			if( pItemElem->GetProp()->dwID != II_GEN_MAT_DIE_EIGHT && pItemElem->GetProp()->dwID != II_GEN_MAT_DIE_TEN )
#endif //__Y_NEW_ENCHANT
			{
				g_WndMng.PutString( prj.GetText(TID_SBEVE_NOTUSEITEM), NULL, prj.GetTextColor(TID_SBEVE_NOTUSEITEM) );
				return FALSE;
			}
			if( m_pItemElem[1] )
				m_pItemElem[1]->SetExtra( 0 );

			pItemElem->SetExtra( 1 );
			m_pItemElem[1]	= pItemElem;
		}
	}
	else
	if( PtInRect(&m_Rect[2], point) )
	{
		if( m_pItemElem[0] )
		{
			// 보조아이템은 상용화 아이템만 검사
			if( pItemElem->GetProp()->dwID != II_SYS_SYS_SCR_PIEPROT )
			{
				g_WndMng.PutString( prj.GetText(TID_SBEVE_NOTUSEITEM), NULL, prj.GetTextColor(TID_SBEVE_NOTUSEITEM) );
				return FALSE;
			}

			if( m_pItemElem[2] )
				m_pItemElem[2]->SetExtra( 0 );
			
			pItemElem->SetExtra( 1 );
			m_pItemElem[2]	= pItemElem;
		}
	}		

	return TRUE;
}
Ejemplo n.º 7
0
BOOL CWndVendor::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	if( message == 100 && nID == 100 )
	{
		LPSHORTCUT pShortcut	= (LPSHORTCUT)pLResult;
		if( pShortcut )
		{
			CWndBase* pWndFrame		= pShortcut->m_pFromWnd->GetFrameWnd();
			if( pWndFrame->GetWndId() == APP_INVENTORY )
			{
				CItemBase* pItemBase	= m_pVendor->GetItemId( pShortcut->m_dwId );
				if( pItemBase )
				{
					if( pItemBase->IsQuest() )
						return FALSE;

					if( pItemBase->GetProp()->dwItemKind3 == IK3_CLOAK && ( (CItemElem*)pItemBase )->m_idGuild != 0 )
						return FALSE;

//#if __VER >= 11 // __MA_VER11_05	// 케릭터 봉인 거래 기능 world,database,neuz	
//					if( pItemBase->m_dwItemId == II_SYS_SYS_SCR_SEALCHARACTER )
//						return FALSE;	// 개인상점판매허용
//#endif // __MA_VER11_05	// 케릭터 봉인 거래 기능 world,database,neuz

#if __VER >= 9 // __CSC_VER9_1
//					ItemProp* pItemProp = pItemBase->GetProp();
					CItemElem* pItemElem = (CItemElem*)pItemBase;
					if( pItemElem->IsFlag( CItemElem::expired ) )
						return TRUE;
					/*
					if(pItemProp->dwItemKind3 == IK3_EGG && pItemElem->m_pPet) //사망한 펫은 거래 불가
					{
						if(pItemElem->m_pPet->GetLife() <= 0)
							return FALSE;
					}
					*/
#endif //__CSC_VER9_1

					/*
					if( ((CItemElem*)pItemBase)->m_bCharged == 1 )
					{
						g_WndMng.PutString( prj.GetText( TID_GAME_NOTTRADE ), NULL, prj.GetTextColor( TID_GAME_NOTTRADE ) );
						return FALSE;
					}
					*/

					int iIndex	= pShortcut->m_dwData - 100;
					if( 0 <= iIndex && iIndex < MAX_VENDITEM )						
					{
						if( m_pVendor->m_vtInfo.GetItem( iIndex ) != NULL )
							return FALSE;
						
						if( IsUsingItem( pItemBase ) == FALSE && m_pVendor->IsActiveMover() && !m_pVendor->m_vtInfo.IsVendorOpen() )
						{
							SAFE_DELETE( m_pWndRegVend );
							m_pWndRegVend	= new CWndRegVend;
							m_pWndRegVend->Initialize( this );
							m_pWndRegVend->SetItem( iIndex, pItemBase );
						}
					}
				}
			}	// APP_INVENTORY
		}
	}
	else
	{
		if( nID == WIDC_OK )
		{
			if( g_pPlayer->m_pActMover->IsFly() )
				return TRUE;
			if( g_pPlayer->m_vtInfo.VendorIsVendor() == FALSE )
				return TRUE;
			CWndEdit* pWndEdit	= (CWndEdit*)GetDlgItem( WIDC_EDIT1 );
			CString strVendor	= pWndEdit->GetString();
			strVendor.TrimLeft();
			strVendor.TrimRight();

		/*#if __VER >= 11 // __MOD_VENDOR
			// 매물 액수 총합 + 현재 소지금이 2억1천이 넘으면 경고띄우고 리턴시킴.
			int nGold = (int)g_pPlayer->GetTotalGold();

			for( int iv = 0 ; iv < MAX_VENDITEM ; ++iv )
			{
				CItemBase *pItemBase = g_pPlayer->m_vtInfo.GetItem( iv );
				if( pItemBase == NULL )
					continue;

				nGold += ((CItemElem*)pItemBase)->m_nCost * pItemBase->GetExtra();
			}					
			
			if( nGold <= 0 || 2100000000 <= nGold )
			{
				g_WndMng.OpenMessageBox( _T(prj.GetText(TID_GAME_VENDOR_MAX_ALL_GOLD)), MB_OK, this );
				return TRUE;
			}
		#endif*/

			if( prj.IsInvalidName( strVendor )
#ifdef __RULE_0615
				|| prj.IsAllowedLetter( strVendor, TRUE ) == FALSE
#endif	// __RULE_0615
				)
			{
				g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0020) ) );
				return TRUE;
			}

			g_WndMng.WordChange( strVendor );
			// name
#ifdef __RULE_0615
			if( strVendor.GetLength() < 6 || strVendor.GetLength() > 32 )
#else	// __RULE_0615
			if( strVendor.GetLength() < 6 || strVendor.GetLength() >= 38 )
#endif	// __RULE_0615
			{
				g_WndMng.OpenMessageBox( _T( prj.GetText(TID_DIAG_0011) ) );
				return TRUE;
			}

			CString strFormat = strVendor;

			if( !strVendor.IsEmpty()  )
			{
				pWndEdit->m_string	= strFormat;
				pWndEdit->m_string.GetTextFormat(strFormat);
			}
			
#if __VER >= 8 // __S8_VENDOR_REVISION
			CWndVendorConfirm* pBox = new CWndVendorConfirm;
			g_WndMng.OpenCustomBox( "", pBox );			
			pBox->SetVendorName( strFormat );
			pBox->SetValue( prj.GetText( TID_GAME_VENDOR_START ) );
#else // __VER >= 8 // __S8_VENDOR_REVISION
			g_DPlay.SendPVendorOpen( (const char*)strFormat );
#endif // __VER >= 8 // __S8_VENDOR_REVISION
			CWndButton* pWndButton	= (CWndButton*)GetDlgItem( WIDC_OK );
			pWndButton->SetVisible( FALSE );
		}
		else if( nID == WIDC_CANCEL || nID == WTBID_CLOSE )
		{
#if __VER >= 8 // __S8_VENDOR_REVISION
			if( g_pPlayer->m_vtInfo.IsVendorOpen() )
			{
				CWndVendorConfirm* pBox = new CWndVendorConfirm;
				g_WndMng.OpenCustomBox( "", pBox );			
				pBox->SetValue( prj.GetText( TID_GAME_VENDOR_STOP ) );
				return FALSE;
			}
#endif // __VER >= 8 // __S8_VENDOR_REVISION
			Destroy( FALSE );
		}
		else if( nID == WIDC_CHAT )
		{
			BOOL bChattingRoom = FALSE;
			if( g_pPlayer->m_vtInfo.IsVendorOpen() )
			{
				g_DPlay.SendOpenChattingRoom();
				bChattingRoom = TRUE;
			}
			else if( g_pPlayer->m_vtInfo.GetOther() && g_Chatting.m_bState )
			{
				bChattingRoom = TRUE;
			}

			if( bChattingRoom )
			{
			#if __VER >= 11 // __MOD_VENDOR
				if(!m_pwndVenderMessage) 
				{
					m_pwndVenderMessage = new CWndVendorMessage;

					if(m_pVendor->IsActiveMover())
						m_pwndVenderMessage->m_nIsOwner = TRUE;
				#ifdef __FIX_WND_1109
					m_pwndVenderMessage->Initialize( this );
				#else	// __FIX_WND_1109
					m_pwndVenderMessage->Initialize( );
				#endif	// __FIX_WND_1109
				}
				else
				{
					if(m_pwndVenderMessage->IsVisible()) m_pwndVenderMessage->SetVisible(FALSE);
					else								 m_pwndVenderMessage->SetVisible(TRUE);
				}
			#else
				SAFE_DELETE( m_pwndVenderMessage );
				m_pwndVenderMessage = new CWndVendorMessage;
			#ifdef __FIX_WND_1109
				m_pwndVenderMessage->Initialize( this );
			#else	// __FIX_WND_1109
				m_pwndVenderMessage->Initialize( );
			#endif	// __FIX_WND_1109
			#endif

			}
		}
#if __VER >= 11 // __MOD_VENDOR
		else if(nID == WIDC_RESET)
		{
			
			CItemBase	apItem_VT[MAX_VENDITEM];		/// vendor and trader share pointer array
			ZeroMemory( apItem_VT, sizeof( apItem_VT ) );

			//if( g_pPlayer->m_vtInfo.IsVendorOpen() )
			//{
				for( int i = 0; i < MAX_VENDITEM; i++ )
				{
					// 리스트를 클리어 한다. 
					CItemBase* pItemBase = g_pPlayer->m_vtInfo.GetItem(i);
					if( pItemBase != NULL )
					{
						if( pItemBase->m_dwObjId != 0 )
							g_DPlay.SendUnregisterPVendorItem( i );
					}
				}

				// 저장버퍼도 클리어
				memset(g_Neuz.m_aSavedInven, 0, sizeof(g_Neuz.m_aSavedInven));
			//}
		}
#endif
	}
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
}
Ejemplo n.º 8
0
BOOL CWndBank::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{
	// 인벤토리에서 Bank로 아이템이 Drop되었다. 어디서 왔는지 확인한후 적절히 대응하라.
	if( message == WIN_ITEMDROP )
	{
		LPSHORTCUT lpShortcut = (LPSHORTCUT)pLResult;
		CWndBase* pWndFrame = lpShortcut->m_pFromWnd->GetFrameWnd();
		CWndBase* pWndTarget = pWndFrame->m_pWndOnMouseMove;
		CWndBase* pWndPut = pWndFrame->m_pCurFocus;
		BYTE nSlot;
		if( pWndTarget == &(m_wndItemCtrl[0]) )
		{
			nSlot = 0;
		}
		else if( pWndTarget == &(m_wndItemCtrl[1]) )
		{
			nSlot = 1;
		}
		else
		{
			nSlot = 2;
		}
		
		BOOL bForbid = TRUE;
		if( nID == 11 ) // item
		{
			if( pWndFrame->GetWndId() == APP_INVENTORY )
			{
				SAFE_DELETE( g_WndMng.m_pWndTradeGold );
				if( lpShortcut->m_dwData != 0 )
				{
					CWndItemCtrl* pWndItemCtrl = (CWndItemCtrl*)lpShortcut->m_pFromWnd;
					UINT SelectCount = pWndItemCtrl->GetSelectedCount();
					if( SelectCount != 1)
					{
						//g_WndMng.PutString( "장착 되어 있는것은 넣을수 없습니다", NULL, 0xffffff00 );
						g_WndMng.PutString( prj.GetText(TID_GAME_EQUIPPUT), NULL, prj.GetTextColor( TID_GAME_EQUIPPUT ) );
						
					}
					else
					{
						for( int i = 0; i < (int)( SelectCount ); i++ )
						{
							int nItem = pWndItemCtrl->GetSelectedItem( i );
							pWndItemCtrl->GetItem( nItem );
						}
						CItemElem* itemElem = (CItemElem*)lpShortcut->m_dwData;
						if( itemElem->m_nItemNum > 1 )
						{ 
							g_WndMng.m_pWndTradeGold = new CWndTradeGold;
							memcpy( &g_WndMng.m_pWndTradeGold->m_Shortcut, pLResult, sizeof(SHORTCUT) );
							g_WndMng.m_pWndTradeGold->m_dwGold = itemElem->m_nItemNum;
							g_WndMng.m_pWndTradeGold->m_nIdWndTo = APP_BANK;
							g_WndMng.m_pWndTradeGold->m_pWndBase = this;
							g_WndMng.m_pWndTradeGold->m_nSlot = nSlot;
							
							g_WndMng.m_pWndTradeGold->Initialize( NULL, APP_TRADE_GOLD );
							g_WndMng.m_pWndTradeGold->MoveParentCenter();
							CWndStatic* pStatic	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_STATIC );
							CWndStatic* pStaticCount	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_CONTROL1 );
							CString strMain = prj.GetText(TID_GAME_MOVECOUNT);//"몇개를 이동하시겠습니까?";
							CString strCount = prj.GetText(TID_GAME_NUMCOUNT);// " 갯수 : ";
							pStatic->m_strTitle = strMain;
							pStaticCount->m_strTitle = strCount;
						}
						else
						{
							g_DPlay.SendPutItemBank( nSlot, (BYTE)( lpShortcut->m_dwId ), 1 );
						}
						
					}
				}
				else
				{
					// 페냐 (돈)
					g_WndMng.m_pWndTradeGold = new CWndTradeGold;
					memcpy( &g_WndMng.m_pWndTradeGold->m_Shortcut, pLResult, sizeof(SHORTCUT) );
					g_WndMng.m_pWndTradeGold->m_dwGold = g_pPlayer->GetGold();
					g_WndMng.m_pWndTradeGold->m_nIdWndTo = APP_BANK;
					g_WndMng.m_pWndTradeGold->m_pWndBase = this;
					g_WndMng.m_pWndTradeGold->m_nSlot = nSlot;
					
					g_WndMng.m_pWndTradeGold->Initialize( NULL, APP_TRADE_GOLD );
					g_WndMng.m_pWndTradeGold->MoveParentCenter();
					CWndStatic* pStatic	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_STATIC );
					CWndStatic* pStaticCount	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_CONTROL1 );
					//CString strMain = "얼마를 이동하시겠습니까?";
					//CString strCount = " SEED : ";
					CString strMain = prj.GetText(TID_GAME_MOVEPENYA);//"얼마를 이동하시겠습니까?";
					CString strCount = prj.GetText(TID_GAME_PENYACOUNT );// " pennya : ";
					pStatic->m_strTitle = strMain;
					pStaticCount->m_strTitle = strCount;
				}
			}
			else if( pWndFrame->GetWndId() == APP_COMMON_BANK )
			{
				BYTE nPutSolt;
			
				SAFE_DELETE( g_WndMng.m_pWndTradeGold );
				if( lpShortcut->m_dwData != 0 )
				{
					if( pWndPut == &(m_wndItemCtrl[0]) )
					{
						nPutSolt = 0;
					}
					else if( pWndPut == &(m_wndItemCtrl[1]) )
					{
						nPutSolt = 1;
					}
					else if( pWndPut == &(m_wndItemCtrl[2]) )
					{
						nPutSolt = 2;
					}
					else
					{
						nPutSolt = 3;
					}

					CWndItemCtrl* pWndItemCtrl = (CWndItemCtrl*)lpShortcut->m_pFromWnd;
					UINT SelectCount = pWndItemCtrl->GetSelectedCount();
					if( SelectCount != 1)
					{
						//g_WndMng.PutString( "장착 되어 있는것은 넣을수 없습니다", NULL, 0xffffff00 );
						g_WndMng.PutString( prj.GetText(TID_GAME_EQUIPPUT), NULL, prj.GetTextColor( TID_GAME_EQUIPPUT ) );
						
					}
					else
					{
						for( int i = 0; i < (int)( SelectCount ); i++ )
						{
							int nItem = pWndItemCtrl->GetSelectedItem( i );
							pWndItemCtrl->GetItem( nItem );
						}
						CItemElem* itemElem = (CItemElem*)lpShortcut->m_dwData;
						if( itemElem->m_nItemNum > 1 )
						{ 
							g_WndMng.m_pWndTradeGold = new CWndTradeGold;
							memcpy( &g_WndMng.m_pWndTradeGold->m_Shortcut, pLResult, sizeof(SHORTCUT) );
							g_WndMng.m_pWndTradeGold->m_dwGold = itemElem->m_nItemNum;
							g_WndMng.m_pWndTradeGold->m_nIdWndTo = APP_COMMON_BANK;
							g_WndMng.m_pWndTradeGold->m_pWndBase = this;
							g_WndMng.m_pWndTradeGold->m_nSlot = nSlot;
							g_WndMng.m_pWndTradeGold->m_nPutSlot = nPutSolt;
							
							g_WndMng.m_pWndTradeGold->Initialize( NULL, APP_TRADE_GOLD );
							g_WndMng.m_pWndTradeGold->MoveParentCenter();
							CWndStatic* pStatic	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_STATIC );
							CWndStatic* pStaticCount	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_CONTROL1 );
							CString strMain = prj.GetText(TID_GAME_MOVECOUNT);//"몇개를 이동하시겠습니까?";
							CString strCount = prj.GetText(TID_GAME_NUMCOUNT);// " 갯수 : ";
							pStatic->m_strTitle = strMain;
							pStaticCount->m_strTitle = strCount;
						}
						else
						{
							g_DPlay.SendPutItemBankToBank( nPutSolt, nSlot, (BYTE)( lpShortcut->m_dwId ), 1 );
						}
						
					}
				}
				else
				{

					if( pWndPut == &(m_wndItemCtrl[0]) )
					{
						nPutSolt = 0;
					}
					else if( pWndPut == &(m_wndItemCtrl[1]) )
					{
						nPutSolt = 1;
					}
					else
					{
						nPutSolt = 2;
					}


					if( pWndPut == &(m_wndGold[0]) )
					{
						nPutSolt = 0;
					}
					else if( pWndPut == &(m_wndGold[1]) )
					{
						nPutSolt = 1;
					}
					else
					{
						nPutSolt = 2;
					}
					
					// 페냐 (돈)
					g_WndMng.m_pWndTradeGold = new CWndTradeGold;
					memcpy( &g_WndMng.m_pWndTradeGold->m_Shortcut, pLResult, sizeof(SHORTCUT) );
					g_WndMng.m_pWndTradeGold->m_dwGold = g_pPlayer->m_dwGoldBank[nPutSolt];
					g_WndMng.m_pWndTradeGold->m_nIdWndTo = APP_COMMON_BANK;
					g_WndMng.m_pWndTradeGold->m_pWndBase = this;
					g_WndMng.m_pWndTradeGold->m_nSlot = nSlot;
					g_WndMng.m_pWndTradeGold->m_nPutSlot = nPutSolt;
					
					g_WndMng.m_pWndTradeGold->Initialize( NULL, APP_TRADE_GOLD );
					g_WndMng.m_pWndTradeGold->MoveParentCenter();
					CWndStatic* pStatic	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_STATIC );
					CWndStatic* pStaticCount	= (CWndStatic *)g_WndMng.m_pWndTradeGold->GetDlgItem( WIDC_CONTROL1 );
					//CString strMain = "얼마를 이동하시겠습니까?";
					//CString strCount = " SEED : ";
					CString strMain = prj.GetText(TID_GAME_MOVEPENYA);//"얼마를 이동하시겠습니까?";
					CString strCount = prj.GetText(TID_GAME_PENYACOUNT );// " pennya : ";
					pStatic->m_strTitle = strMain;
					pStaticCount->m_strTitle = strCount;
				}
			}
		}
	}
	if( message == WNM_CLICKED )
	{
		switch( nID )
		{
			case 100: // icon
//				m_wndItemCtrl.SetWndRect( m_wndItemCtrl.GetWindowRect( TRUE ) );
				break;
			case WTBID_REPORT:
				break;
			case WTBID_CLOSE: // 종료
				{
//					g_DPlay.SendCloseBankWnd();
				}
				break;
		}
	}	
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
}