Register for your free account! | Forgot your password?

You last visited: Today at 18:52

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

Advertisement



random scroll

Discussion on random scroll within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
xToffer's Avatar
 
elite*gold: 0
Join Date: Apr 2018
Posts: 139
Received Thanks: 18
random scroll

fix thanks for the hints
xToffer is offline  
Old 04/24/2018, 01:19   #2
 
elite*gold: 294
Join Date: Jun 2009
Posts: 407
Received Thanks: 587
It is in your first if / else if statement.

Also avoid your GetProp() calls that you spam everywhere. Store the pointer or I think CItemElem or a parent class has the item id stored in it as well.
Avalion is offline  
Old 04/24/2018, 03:53   #3
 
xToffer's Avatar
 
elite*gold: 0
Join Date: Apr 2018
Posts: 139
Received Thanks: 18
i comment out the 3 scroll's

Code:
			if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYM && pItemElem0->GetRandomOpt() > 11)
				return;
			//else if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYR && (pItemElem0->GetRandomOpt() < 13 || pItemElem0->GetRandomOpt() > 24))
		//		return;
		//	else if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYU && (pItemElem0->GetRandomOpt() < 25 || pItemElem0->GetRandomOpt() > 36))
		//		return;
		//	else if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYL && pItemElem0->GetRandomOpt() < 37)
		//		return;

			int nRareLevel;
			switch (pItemElem1->GetProp()->dwID)
			{
			case II_SYS_SYS_SCR_RARITYM: nRareLevel = 1; break;
		//	case II_SYS_SYS_SCR_RARITYR: nRareLevel = 2; break;
			//case II_SYS_SYS_SCR_RARITYU: nRareLevel = 3; break;
		//	case II_SYS_SYS_SCR_RARITYL: nRareLevel = 4; break;
			}

			int type = xRandom(11) + 1;

			unsigned int upChance = 0;

			switch (nRareLevel)
			{
			case 1: upChance = 10; break;
		//	case 2: upChance = 5; break;
		//	case 3: upChance = 2; break;
			}

			if (nRareLevel<4)
			{
				if (xRandom(100) + 1<upChance)
					nRareLevel++;
			}

			if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYM && pItemElem0->GetRandomOpt() < 1 && xRandom(100) + 1<80)
				type = 0;

			int n_blubb = (nRareLevel - 1) * 11 + type;
			pItemElem0->SetRandomOpt(n_blubb);

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

			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);

			CString strText;
			strText.Format("Rarity of %s sucessfully changed.", pItemElem0->GetName());
			pUser->AddText(strText);
i only copy this
Code:
				if( pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RANDOMSTR )
				{
					nKind = nSTR[nValue-1];
					nToolKind = DST_STR;
				}
and change to that.

so i change the getprop() sir?
xToffer is offline  
Old 04/24/2018, 13:57   #4
 
elite*gold: 0
Join Date: Mar 2018
Posts: 77
Received Thanks: 57
Quote:
Originally Posted by xToffer View Post
i comment out the 3 scroll's

Code:
			if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYM && pItemElem0->GetRandomOpt() > 11)
				return;
			//else if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYR && (pItemElem0->GetRandomOpt() < 13 || pItemElem0->GetRandomOpt() > 24))
		//		return;
		//	else if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYU && (pItemElem0->GetRandomOpt() < 25 || pItemElem0->GetRandomOpt() > 36))
		//		return;
		//	else if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYL && pItemElem0->GetRandomOpt() < 37)
		//		return;

			int nRareLevel;
			switch (pItemElem1->GetProp()->dwID)
			{
			case II_SYS_SYS_SCR_RARITYM: nRareLevel = 1; break;
		//	case II_SYS_SYS_SCR_RARITYR: nRareLevel = 2; break;
			//case II_SYS_SYS_SCR_RARITYU: nRareLevel = 3; break;
		//	case II_SYS_SYS_SCR_RARITYL: nRareLevel = 4; break;
			}

			int type = xRandom(11) + 1;

			unsigned int upChance = 0;

			switch (nRareLevel)
			{
			case 1: upChance = 10; break;
		//	case 2: upChance = 5; break;
		//	case 3: upChance = 2; break;
			}

			if (nRareLevel<4)
			{
				if (xRandom(100) + 1<upChance)
					nRareLevel++;
			}

			if (pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RARITYM && pItemElem0->GetRandomOpt() < 1 && xRandom(100) + 1<80)
				type = 0;

			int n_blubb = (nRareLevel - 1) * 11 + type;
			pItemElem0->SetRandomOpt(n_blubb);

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

			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);

			CString strText;
			strText.Format("Rarity of %s sucessfully changed.", pItemElem0->GetName());
			pUser->AddText(strText);
i only copy this
Code:
				if( pItemElem1->GetProp()->dwID == II_SYS_SYS_SCR_RANDOMSTR )
				{
					nKind = nSTR[nValue-1];
					nToolKind = DST_STR;
				}
and change to that.

so i change the getprop() sir?
You should really read up on basic syntax and if/elseif/else statements.

Mushpoie is offline  
Reply


Similar Threads Similar Threads
[Released] Monster legends (Random Gold) (Random Food) (Random Exp)
02/03/2015 - Facebook - 6 Replies
Monster legends New Tools !! *1 - Random Gold *2 - Random Food *3 - Random Exp All Tested And Working 100% Without Any Problem :handsdown: !!! Link
DC Random 8 -> 100 Gems + Random 3M --> 18 M Food + Random 3M --> 18M Gold
01/24/2015 - Dragon City - 25 Replies
DC Random 8 -> 100 Gems + Random 3M --> 18 M Food + Random 3M --> 18M Gold Dragon City Gem + Gold + Food +Exp
Java Color.rgb(random,random,random)
05/19/2014 - Java - 4 Replies
Guten Abend liebe Community, ich habe ein Anliegen. Wie ist es möglich bei der Methode : setTextColor(Color.rgb(0,0,0)); anstatt (0,0,0) 3 random Integer zu verwenden wenn ja wie? Ich habe es mal so probiert: final Random r = new Random();



All times are GMT +1. The time now is 18:53.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.