Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 14:55

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

Advertisement



Random Stat Scroll Question

Discussion on Random Stat Scroll Question within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2015
Posts: 167
Received Thanks: 41
Random Stat Scroll Question

Hello Epvp, anyone who can tell me how can I change the Stats of Random Scroll (Scroll of STR, Scroll of DEX, Scroll of INT, Scroll of STA) I want to change it to random stats by 150 randomized by 10, 20, 30, 40 up to 150

and Here's the Code


Code:

void CDPSrvr::OnRandomScroll( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpbuf, u_long uBufSize )
{
#ifdef __SYSSECURITY
try{
#endif
	DWORD dwId1, dwId2;
	
	ar >> dwId1;
	ar >> dwId2;
	
	CUser* pUser	= g_UserMng.GetUser( dpidCache, dpidUser );
	if( IsValidObj( pUser ) )
	{
		// Àκ¥Å丮¿¡ ÀÖ´ÂÁö ÀåÂøµÇ¾î ÀÖ´ÂÁö È®ÀÎÀ» ÇØ¾ß ÇÔ
		CItemElem* pItemElem0	= pUser->m_Inventory.GetAtId( dwId1 );
		CItemElem* pItemElem1	= pUser->m_Inventory.GetAtId( dwId2 );
		if( IsUsableItem( pItemElem0 ) == FALSE || IsUsableItem( pItemElem1 ) == FALSE )
		{
			return;
		}


		if( pUser->m_Inventory.IsEquip( dwId1 ) )
		{
			pUser->AddDefinedText( TID_GAME_EQUIPPUT , "" );
			return;
		}			


		if( pItemElem1->GetProp()->dwItemKind3 != IK3_RANDOM_SCROLL )
		{
			return;					
		}


		if( !(pItemElem0->GetProp()->dwItemKind1 == IK1_WEAPON || pItemElem0->GetProp()->dwItemKind2 == IK2_ARMOR || pItemElem0->GetProp()->dwItemKind2 == IK2_ARMORETC ) )
		{
			pUser->AddDefinedText(  TID_GAME_RANDOMSCROLL_ERROR, "" );
			return;
		}


		int nSTR[4] = { 1,  9, 21, 37 };
		int nDEX[4] = { 2, 10, 22, 38 };
		int nINT[4] = { 3, 11, 23, 39 };
		int nSTA[4] = { 4, 12, 24, 40 };


		int nValue = 0;
		int nRandom = xRandom( 100 );
		if( nRandom < 64 )
			nValue = 1;
		else if( nRandom < 94 )
			nValue = 2;
		else if( nRandom < 99 )
			nValue = 3;
		else if( nRandom < 100 )
			nValue = 4;



		if( 0 < nValue )
		{
			int nKind = 0;
			int nToolKind = 0;
			if( pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RANDOMSTR )
			{
				nKind = nSTR[nValue-1];
				nToolKind = DST_STR;
			}
			else if( pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RANDOMDEX )
			{
				nKind = nDEX[nValue-1];
				nToolKind = DST_DEX;
			}
			else if( pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RANDOMINT )
			{
				nKind = nINT[nValue-1];
				nToolKind = DST_INT;
			}
			else if( pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RANDOMSTA )
			{
				nKind = nSTA[nValue-1];
				nToolKind = DST_STA;
			}


			pUser->UpdateItem( (BYTE)pItemElem0->m_dwObjId, UI_RANDOMOPTITEMID, nKind );


			LogItemInfo aLogItem;
			aLogItem.SendName = pUser->GetName();
			aLogItem.RecvName = "RANDOMSCROLL";
			aLogItem.WorldId = pUser->GetWorld()->GetID();
			aLogItem.Gold = aLogItem.Gold2 = pUser->GetGold();
			aLogItem.Action = "(";
			OnLogItem( aLogItem, pItemElem0, pItemElem0->m_nItemNum );
			aLogItem.Action = ")";
			OnLogItem( aLogItem, pItemElem1, pItemElem1->m_nItemNum );


			pUser->RemoveItem( (BYTE)( dwId2 ), (short)1 );		


			// ¾ÆÀÌÅÛ ¹Ú±â ¼º°ø~
			pUser->AddPlaySound( SND_INF_UPGRADESUCCESS );			
			g_UserMng.AddCreateSfxObj((CMover *)pUser, XI_INT_SUCCESS, pUser->GetPos().x, pUser->GetPos().y, pUser->GetPos().z);			


			DWORD dwStringNum = 0;
			switch( nToolKind )
			{
			case DST_STR:
				dwStringNum = TID_TOOLTIP_STR;
				break;
			case DST_DEX:
				dwStringNum = TID_TOOLTIP_DEX;
				break;
			case DST_STA:
				dwStringNum = TID_TOOLTIP_STA;
				break;
			default: //case DST_INT:
				dwStringNum = TID_TOOLTIP_INT;
				break;
			}
			CString strMessage;
			strMessage.Format( prj.GetText( TID_GAME_RANDOMSCROLL_SUCCESS ), pItemElem0->GetProp()->szName, prj.GetText( dwStringNum ), nValue );
			pUser->AddText( strMessage );
		}
	}
#ifdef __SYSSECURITY
}
catch(...)
{
	Error("Error on Line %d in %s",__LINE__,__FILE__);
}
#endif
}
.HeyEyay. is offline  
Old 04/19/2016, 20:23   #2
 
elite*gold: 59
Join Date: Oct 2012
Posts: 716
Received Thanks: 465
No need for Source changes.
Open the propItemEtc.inc and at the and of the file you'll find the stated items properties.
Defines the Randomoption id: int nSTR[4] = { 1, 9, 21, 37 };
Quote:
RandomOptItem 21 IDS_PROPITEMETC_INC_000103 37 90000000
{
DST_STR 3
}
FlyCraft.TobiLap is offline  
Thanks
1 User
Old 04/20/2016, 03:39   #3
 
elite*gold: 0
Join Date: Jul 2015
Posts: 167
Received Thanks: 41
Im Gonna Test It Thank You

btw i gonna make it by 10 like this

10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150 so im gonna change it too on propItemEtc.inc? or I Gonna edit it here

Code:
   		int nSTR[4] = { 1,  9, 21, 37, 50, 54 };		int nDEX[4] = { 2, 10, 22, 38, 51, 55 };
		int nINT[4] = { 3, 11, 23, 39, 52, 56 };
		int nSTA[4] = { 4, 12, 24, 40, 53, 57 };

PropItemEtc


Code:
	RandomOptItem	50	IDS_PROPITEMETC_INC_000119	52	90000000
	{
		DST_STR	40
	}
	RandomOptItem	51	IDS_PROPITEMETC_INC_000120	52	90000000
	{
		DST_DEX	40
	}
	RandomOptItem	52	IDS_PROPITEMETC_INC_000121	52	90000000
	{
		DST_INT	40
	}
	RandomOptItem	53	IDS_PROPITEMETC_INC_000122	52	90000000
	{
		DST_STA	40
	}
.HeyEyay. is offline  
Reply


Similar Threads Similar Threads
[Release]Scroll's Stat reset | Change Name Char
12/05/2016 - SRO PServer Guides & Releases - 22 Replies
heya i'll release scrolls stat reset & Change name Char lets start like everytime. Stat Reset Download & Scan Click Here Click Here Change name scroll & Download & Scan
Any way to reset STAT points? (not using a stat reset scroll)
02/12/2016 - SRO Coding Corner - 5 Replies
Hey folks i tryed with item scroll reset stat, it works allmost perfect but those dc is rly sux... I saw at some private server that they have some like coded procedure starting to be active when you write something in your for example private chat(and it give nice reset stat without DC) chat: $Reset Reset_stats thats only example.
CRASH After Using Reset STAT scroll.
01/13/2016 - SRO Private Server - 2 Replies
Hey Folks! I made restat scroll, i found some threads here abt that and i tryed to make my own. But there is on weird thing, each time i use this restat scroll it makes my client crash but stats are return to previous/basic stat(so that works correct) Okai how i did that: 1* Database: 1.1 I putted that in RefObjectCommon table: 1 70001 ITEM_MALL_STATS_POINT_RECALL_A_KARA ???? ???? ???...
Stat Reset Scroll
02/28/2015 - SRO Private Server - 2 Replies
Hello epvp, i downloaded this stat reset scroll but when i use it, it doesn't do anything and i added successfully to DB+media. _AddTimedJob - USE GO /****** Object: StoredProcedure . Script Date: 2/28/2015 8:45:17 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
[Question] How to use Random Properties Scroll
05/03/2011 - Grand Chase - 3 Replies
Anyone know how to use Random Properties Scroll??.. can you teach me?? thnx



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


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.