FLYFF V15 Source - remove destructable item

09/27/2019 10:10 jarovart#1
Hello guys,

Where can I find the function for destroying items or a function or variable, which is setting +3 for destruction of items, in the source code?

I want, that i can upgrade e.g. weapons up to +10 without using sprotects and the weapons should not be destroyable while upgrading above +3.

Have a nice weekend!
09/27/2019 19:13 ZeroTwo02#2
Weapon/Armor Upgrade -> ItemUpgrade.cpp -> CItemUpgrade::EnchantGeneral

Change ->

Code:
			if( !bSmelprot )
			{
#ifdef __SM_ITEM_2ND_EX
				if( bSmelprot2 )
				{
					pUser->UpdateItem( (BYTE)pItemMain->m_dwObjId, UI_AO,  pItemMain->GetAbilityOption() - 1 );
					aLogItem.Action = "9";
					g_DPSrvr.OnLogItem( aLogItem, pItemMain, pItemMain->m_nItemNum );
				}
				else
#endif	// __SM_ITEM_2ND_EX
				{
					aLogItem.Action = "L";
					g_DPSrvr.OnLogItem( aLogItem, pItemMain, pItemMain->m_nItemNum );
					pUser->RemoveItem( (BYTE)( pItemMain->m_dwObjId ), (short)1 );
				}
			}
To ->

Code:
#ifdef __SM_ITEM_2ND_EX
				if( !bSmelprot && bSmelprot2 )
				{
					pUser->UpdateItem( (BYTE)pItemMain->m_dwObjId, UI_AO,  pItemMain->GetAbilityOption() - 1 );
					aLogItem.Action = "9";
					g_DPSrvr.OnLogItem( aLogItem, pItemMain, pItemMain->m_nItemNum );
				}
Accessory Upgrade -> ItemUpgrade.cpp -> CItemUpgrade::RefineAccessory

Delete ->
Code:
		if( !bSmelprot )
		{
			if( pItemMain->GetAbilityOption() >= 3 )		// »èÁ¦
			{
				aLogItem.Action	= "L";
				g_DPSrvr.OnLogItem( aLogItem, pItemMain, pItemMain->m_nItemNum );
				pUser->UpdateItem( (BYTE)pItemMain->m_dwObjId, UI_NUM, 0 );
			}
		}
Elementalisation Upgrade on Weapon/Armor -> ItemUpgrade.cpp -> CItemUpgrade::EnchantAttribute

Change ->

Code:
			if( !bSmelprot )
			{
#ifdef __SM_ITEM_2ND_EX
				if( bSmelprot2  )
				{
					pUser->UpdateItem( (BYTE)pItemMain->m_dwObjId, UI_RAO, pItemMain->m_nResistAbilityOption - 1 );
					aLogItem.Action = "8";
					g_DPSrvr.OnLogItem( aLogItem, pItemMain, pItemMain->m_nItemNum );
				}
				else
#endif	// __SM_ITEM_2ND_EX
				{
					aLogItem.Action = "L";
					g_DPSrvr.OnLogItem( aLogItem, pItemMain, pItemMain->m_nItemNum );
					pUser->RemoveItem( (BYTE)( pItemMain->m_dwObjId ), (short)1 );
				}
			}
To ->

Code:
				if( !bSmelprot && bSmelprot2  )
				{
					pUser->UpdateItem( (BYTE)pItemMain->m_dwObjId, UI_RAO, pItemMain->m_nResistAbilityOption - 1 );
					aLogItem.Action = "8";
					g_DPSrvr.OnLogItem( aLogItem, pItemMain, pItemMain->m_nItemNum );
				}
09/28/2019 06:03 jarovart#3
thanks, do you know, where can I change the duration of upgrading?

Edit:
Your changes works, btw there are still a warning window popping up, if I am upgrading an item above +3. I couldnt find this eventfunction, which calls this pop up. where it will be triggered?
09/28/2019 08:26 ZeroTwo02#4
Quote:
Originally Posted by jarovart View Post
thanks, do you know, where can I change the duration of upgrading?

Edit:
Your changes works, btw there are still a warning window popping up, if I am upgrading an item above +3. I couldnt find this eventfunction, which calls this pop up. where it will be triggered?
To change the duration of upgrade, change in WndField.cpp ->
Code:
m_dwEnchantWaitTime		= g_tmCurrent + SEC(4);
About the pop up, you should look into WndItemCtrl.cpp, function "CWndItemCtrl::OnLButtonDown" and WndField.cpp, function "CWndSmeltSafetyConfirm::OnInitialUpdate()".
09/28/2019 12:26 jarovart#5
Quote:
Originally Posted by ZeroTwo02 View Post
To change the duration of upgrade, change in WndField.cpp ->
Code:
m_dwEnchantWaitTime		= g_tmCurrent + SEC(4);
About the pop up, you should look into WndItemCtrl.cpp, function "CWndItemCtrl::OnLButtonDown" and WndField.cpp, function "CWndSmeltSafetyConfirm::OnInitialUpdate()".

how do you know so many about this source code? Is there somewhere a documentation, which I do not know about? I mean, this source code has not only few lines and it was written very dirty. Its obvious, that the flyff developer do not want that foreign developer understand it...

BTW, I want to awake an setpart several times with scroll of awakening without using scroll of cancel awakening, like cs setparts with scroll of blessing. Where can I find the source code, which blocks to awake again an already awakened setpart ?

And thank you for your help!
09/28/2019 14:15 ZeroTwo02#6
Quote:
Originally Posted by jarovart View Post
how do you know so many about this source code? Is there somewhere a documentation, which I do not know about? I mean, this source code has not only few lines and it was written very dirty. Its obvious, that the flyff developer do not want that foreign developer understand it...

BTW, I want to awake an setpart several times with scroll of awakening without using scroll of cancel awakening, like cs setparts with scroll of blessing. Where can I find the source code, which blocks to awake again an already awakened setpart ?

And thank you for your help!
DPSrvr.cpp, function "CDPSrvr::DoUseItemTarget_GenRandomOption"

Remove ->

Code:
	if( 
#if __VER >= 12 // __J12_0
		// ¿©½ÅÀÇ Ãູ°ú ¸ÔÆê °¢¼ºÀº °¢¼º Ãë¼Ò ¾øÀÌ µ¤¾î ¾µ ¼ö ÀÖ°Ô ÇÑ´Ù
		nKind != CRandomOptionProperty::eBlessing && nKind != CRandomOptionProperty::eEatPet &&
#endif	// __J12_0
		g_xRandomOptionProperty->GetRandomOptionSize( pTarget->GetRandomOptItemId() ) > 0
	)
	{
		pUser->AddDefinedText( nHasOption );
		return FALSE;
	}