[Source] New amp system

Status
Not open for further replies.
Joined
Nov 29, 2009
Messages
370
Reaction score
26
Hello,

Can anyone help me implement the new amplification system into my source, i have looked over how it is done with the other amps and i can't seem to figure how it works,

My current amp system is like this, and i don't know how to get the amplification system to work, at all.
this is my MoverSkill.cpp
PHP:
	case II_SYS_SYS_SCR_AMPES:	// "ESÁõÆøÀÇ µÎ·ç¸¶¸®"		
		{
			// ES, EMÀº µ¿ÀÏ¾È ¾ÆÀÌÅÛ.. I´Â °°ÀÌ »ç¿ëÇÒ¼ö ¾÷½À´Ï´Ù.
			if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPES ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPEM ) ||
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESA ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESA1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESA2) ||
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESB ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESB1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESB2) ||
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESC ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESC1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESC2) || 
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESD ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESD1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESD2) ||
#ifdef __S_ADD_EXP
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESS ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESS1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESS2) ||
#endif // __S_ADD_EXP
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESE )
				)
				nResult = 2;
			else if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPI ) )
				nResult = 3;
			else
				DoApplySkill( (CCtrl*)this, pItemProp, NULL );
		}
		break;
	case II_SYS_SYS_SCR_AMPESA:
	case II_SYS_SYS_SCR_AMPESB:
	case II_SYS_SYS_SCR_AMPESC:
	case II_SYS_SYS_SCR_AMPESD:
	case II_SYS_SYS_SCR_AMPESE:
#ifdef __S_ADD_EXP
	case II_SYS_SYS_SCR_AMPESS:
#endif // __S_ADD_EXP
		{
			if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPES ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPEM ) )
				nResult = 2;
			else if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPI ) )
				nResult = 3;

			// ·¹º§ °Ë»ç
			int nLevel = GetLevel();

			CString str;
			if( pItemProp->dwID == II_SYS_SYS_SCR_AMPESA )
			{
				if( 20 < nLevel )
				{
					str.Format( "%d - %d", 1, 20 );
					((CUser*)this)->AddDefinedText( TID_GAME_EXP_NOTUSELEVEL, "\"%s\"", str ); // 
					nResult = 99;
				}
			}
			else if( pItemProp->dwID == II_SYS_SYS_SCR_AMPESB )
			{
				if( nLevel < 21 || 40 < nLevel )
				{
					str.Format( "%d - %d", 21, 40 );
					((CUser*)this)->AddDefinedText( TID_GAME_EXP_NOTUSELEVEL, "\"%s\"", str ); // 
					nResult = 99;
				}
			}
			else if( pItemProp->dwID == II_SYS_SYS_SCR_AMPESC )
			{
				if( nLevel < 41 || 60 < nLevel )
				{
					str.Format( "%d - %d", 41, 60 );
					((CUser*)this)->AddDefinedText( TID_GAME_EXP_NOTUSELEVEL, "\"%s\"", str ); // 
					nResult = 99;
				}
			}
			else if( pItemProp->dwID == II_SYS_SYS_SCR_AMPESD )
			{
				if( nLevel < 61 || 80 < nLevel )
				{
					str.Format( "%d - %d", 61, 80 );
					((CUser*)this)->AddDefinedText( TID_GAME_EXP_NOTUSELEVEL, "\"%s\"", str ); // 
					nResult = 99;
				}
			}
			else if( pItemProp->dwID == II_SYS_SYS_SCR_AMPESE )
			{
				if( nLevel < 81 || 120 < nLevel )
				{
					str.Format( "%d - %d", 81, 120 );
					((CUser*)this)->AddDefinedText( TID_GAME_EXP_NOTUSELEVEL, "\"%s\"", str ); // 
					nResult = 99;
				}
			}

			if( !(nResult == 2 || nResult == 3 || nResult == 99 ) )
			{
				BOOL bBuf[3];
				int nBufCount = 0;
				BOOL bSpecial = FALSE;
				int nSpecialCount = 0;

				ZeroMemory( bBuf, sizeof( bBuf ) );
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESA ) )
				{
					bBuf[0] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESA1 ) )
				{
					bBuf[1] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESA2 ) )
				{
					bBuf[2] = TRUE;		++nBufCount;
				}

				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESB ) )
				{
					bBuf[0] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESB1 ) )
				{
					bBuf[1] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESB2 ) )
				{
					bBuf[2] = TRUE;		++nBufCount;
				}

				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESC ) )
				{
					bBuf[0] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESC1 ) )
				{
					bBuf[1] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESC2 ) )
				{
					bBuf[2] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESD ) )
				{
					bBuf[0] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESD1 ) )
				{
					bBuf[1] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESD2 ) )
				{
					bBuf[2] = TRUE;		++nBufCount;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESE ) )
				{
					bBuf[0] = TRUE;		++nBufCount;
				}
#ifdef __S_ADD_EXP
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESS ) )
				{
					bBuf[0] = TRUE;		++nBufCount;	nSpecialCount++;//bSpecial = TRUE;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESS1 ) )
				{
					bBuf[1] = TRUE;		++nBufCount;	nSpecialCount++;//bSpecial = TRUE;
				}
				if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESS2 ) )
				{
					bBuf[2] = TRUE;		++nBufCount;	nSpecialCount++;//bSpecial = TRUE;
				}
#endif // __S_ADD_EXP

				int nMaxBuf = 3;
				//if( bSpecial == FALSE )
				{				
					if( nLevel < 41 )
						nMaxBuf = 3;				
					else if( nLevel < 61 && nSpecialCount < 2 )
						nMaxBuf = 2;
					else if( nLevel <= 120 && nSpecialCount < 1 )
						nMaxBuf = 1;
					else
						nMaxBuf = 3;
				}

#ifdef __S_ADD_EXP
				//if( bSpecial && pItemProp->dwID != II_SYS_SYS_SCR_AMPESS )
				if( nSpecialCount && pItemProp->dwID != II_SYS_SYS_SCR_AMPESS )
				{
					nResult = 2;					
				}
				else
#endif // __S_ADD_EXP
				if( nBufCount < nMaxBuf )
				{
					for( int i = 0 ; i < nMaxBuf ; ++i )
					{
						if( bBuf[i] == FALSE )
						{
							if( i == 0 )
								pItemProp = prj.GetItemProp( pItemProp->dwID );
							else if( i == 1 )
								pItemProp = prj.GetItemProp( pItemProp->dwID + 1 );
							else 
								pItemProp = prj.GetItemProp( pItemProp->dwID + 2 );	
							break;
						}							
					}

					DoApplySkill( (CCtrl*)this, pItemProp, NULL );
					float fFactor = 1;
					switch( nBufCount + 1)
					{
					case 1:
						{
							fFactor *= 1.5f;
						}
						break;
					case 2:
						{
							//if( bSpecial || nLevel < 61 )
							if( nSpecialCount || nLevel < 61 )
								fFactor *= 2.0f;
							else
								fFactor *= 1.5f;
						}
						break;
					case 3:
						{
							//if( bSpecial || nLevel < 41 )
							if( nSpecialCount || nLevel < 41 )
								fFactor *= 2.5f;
							else if( nLevel < 61 )
								fFactor *= 2.0f;
							else
								fFactor *= 1.5f;
						}
						break;
					}
					CString strTemp;
#if __VER >= 11 // __EXPITEM_TOOLTIP_CHANGE
					int nPercent = (int)( (fFactor - 1.0f) * 100.0f );
					strTemp.Format( "%s %d%% %s", prj.GetText( TID_GAME_EXPITEM_TOOLTIP ), nPercent, prj.GetText( TID_GAME_EXPITEM_TOOLTIP1 ) );
#else //__EXPITEM_TOOLTIP_CHANGE
					strTemp.Format( "%s%.1f%s", prj.GetText( TID_GAME_EXPTOOLTIP ), fFactor, prj.GetText( TID_GAME_EXPTOOLTIP1 ) );
#endif //__EXPITEM_TOOLTIP_CHANGE
					((CUser*)this)->AddText( strTemp ); // 
				}
				else
				{
#ifdef __S_ADD_EXP
					//if( bSpecial )
					//{
					//	((CUser*)this)->AddDefinedText( TID_GAME_EXP_3 ); //
					//}
//					else
#endif // __S_ADD_EXP
					{
						if( nLevel < 21 )
							str.Format( "%d - %d", 1, 20 );
						else if( nLevel < 41 )
							str.Format( "%d - %d", 21, 40 );
						else if( nLevel < 61 )
							str.Format( "%d - %d", 41, 60 );
						else if( nLevel < 81 )
							str.Format( "%d - %d", 61, 80 );
						else if( nLevel <= 120 )
							str.Format( "%d - %d", 81, 120 );

						CString szMaxBuf;
						szMaxBuf.Format( "%d", nMaxBuf );
						((CUser*)this)->AddDefinedText( TID_GAME_EXP_NOTUSE, "\"%s\" \"%s\"", str, szMaxBuf ); // 
					}
					nResult = 99;					
				}				
			}
		}
		break;
	case II_SYS_SYS_SCR_AMPEM:	// "EMÁõÆøÀÇ µÎ·ç¸¶¸®"		
		{
			// ES, EMÀº µ¿ÀÏ¾È ¾ÆÀÌÅÛ.. I´Â °°ÀÌ »ç¿ëÇÒ¼ö ¾÷½À´Ï´Ù.
			if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPES ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPEM ) ||
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESA ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESA1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESA2) ||
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESB ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESB1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESB2) ||
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESC ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESC1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESC2) || 
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESD ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESD1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESD2) ||
#ifdef __S_ADD_EXP
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESS ) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESS1) || HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESS2) ||
#endif // __S_ADD_EXP
				HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPESE ) 
				)
				nResult = 2;
			else if( HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_AMPI ) )
				nResult = 3;
			else
				DoApplySkill( (CCtrl*)this, pItemProp, NULL );
		}
		break;

Edit: I have looked through this forum for it, mostly using the search button or searching the help and tutorial/release sections and can not find anything on it, so i was hoping someone might come forth and give me a head start on how to do it, or a pointer on where abouts to look/edit in the source to add the system.

Thanks
Nick
 
Last edited:
then I don't know what he was telling you, but he's probably lieing

cause there are at least 3 files that need editing. One to allow you to use the amps and display the current Exp bonus afterward. Second is to make them display properly at the top of the screen. and the third is to actually make the exp rate increase (the first one I mentioned is just the text you see after using it and what gives you the buff).
 
then I don't know what he was telling you, but he's probably lieing

cause there are at least 3 files that need editing. One to allow you to use the amps and display the current Exp bonus afterward. Second is to make them display properly at the top of the screen. and the third is to actually make the exp rate increase (the first one I mentioned is just the text you see after using it and what gives you the buff).

I found the 3 files needed to edit to make them work, but i have no idea where about to start, to code in the new amp system
 
Status
Not open for further replies.
Back