/awaking erro !

12/07/2016 15:17 ramom155#1
How do I block awake in fashions?

12/07/2016 22:30 NoWay | Phoenix#2
Source -> Randomoption.cpp -> In Function
int CRandomOptionProperty::GetRandomOptionKind( CItemElem* pItemElem )

Replace the Function with this!
Code:
int CRandomOptionProperty::GetRandomOptionKind( CItemElem* pItemElem )
{
	ItemProp* pProp		= pItemElem->GetProp();
	switch( pProp->dwParts )
	{
		case PARTS_UPPER_BODY:
		case PARTS_RWEAPON:
		case PARTS_SHIELD:
/*
#if __VER >= 12 // __J12_0
		case PARTS_HAND:
		case PARTS_FOOT:
		case PARTS_CAP:
#endif	// __J12_0
			return static_cast<int>( eAwakening );
		case PARTS_CLOTH:
		case PARTS_CLOAK:
#if __VER >= 12 // __J12_0
		case PARTS_HAT:
		case PARTS_GLOVE:
		case PARTS_BOOTS:
#endif	// __J12_0
			return static_cast<int>( eBlessing );
*/
#if __VER >= 12 // __PET_0519
		default:
			{
				if( pProp->dwItemKind3 == IK3_EGG && pItemElem->m_pPet && pItemElem->m_pPet->GetLevel() >= PL_C )
					return static_cast<int>( eSystemPet );
				else if( pProp->dwItemKind3 == IK3_PET )
					return static_cast<int>( eEatPet );
				break;
			}
#endif	// __PET_0519
	}
	return -1;
}

BOOL	CRandomOptionProperty::GetParam( __int64 nRandomOptItemId, int i, int* pnDst, int* pnAdj )
{
	if( i >= MAX_RANDOM_OPTION )
		return FALSE;

	int nRandomOption	= static_cast<int>( nRandomOptItemId >> ( 8 + i * 18 ) );
	*pnAdj	= nRandomOption & 0x000001FF;
	if( nRandomOption & 0x00000200 )
		*pnAdj	= -*pnAdj;
	nRandomOption	= nRandomOption >> 10;

        *pnDst	= nRandomOption & 0x0000007F;

	return ( *pnDst > 0 );
}
I hope that I could help you :)
Best Regards~
12/07/2016 23:51 KetchupSamurai#3
Quote:
Originally Posted by NoWay | Phoenix View Post
Source -> Randomoption.cpp -> In Function
int CRandomOptionProperty::GetRandomOptionKind( CItemElem* pItemElem )

Replace the Function with this!
Code:
-Snip-
I hope that I could help you :)
Best Regards~
H
He say's it's an error with the command and not the function, the original poster should also read the command to seeing its right in front of both you. Its quite simple of a fix but here we go anyways lol..... I wonder what happens if we remove the nerf :/

Code:
BOOL TextCmd_GenRandomOption( CScanner & s )
{
#ifdef __WORLDSERVER 
    CUser* pUser = (CUser*)s.dwValue;
    CItemElem* pItemElem = pUser->m_Inventory.GetAt( 0 );
    if( pItemElem ){
        int nRandomOptionKind = g_xRandomOptionProperty->GetRandomOptionKind( pItemElem );
        if( nRandomOptionKind >= 0 ){
            if( pUser->HasActivatedSystemPet() && pItemElem->GetProp()->dwItemKind3 == IK3_EGG || pUser->HasActivatedEatPet() && pItemElem->GetProp()->dwItemKind3 == IK3_PET ){
                pUser->AddText( "Please deactivate your Pet/s." );
            }else{ 
                if( pItemElem->GetProp()->dwItemKind2 == IK2_CLOTH || pItemElem->GetProp()->dwItemKind2 == IK2_CLOTHETC || pItemElem->GetProp()->dwItemKind2 == IK2_CLOTHWIG ){
                pUser->AddText( "No Cs is awakeable with /awake!");
                }else{
                 if( pItemElem->GetProp()->dwID == II_SYS_SYS_SCR_BLESSEDNESS ){
                 return TRUE;
                 }else{
                if( pUser->GetGold() >= 1000000 ){
                    g_xRandomOptionProperty->InitializeRandomOption( pItemElem->GetRandomOptItemIdPtr() );
                    g_xRandomOptionProperty->GenRandomOption( pItemElem->GetRandomOptItemIdPtr(), nRandomOptionKind, pItemElem->GetProp()->dwParts );
                    pUser->UpdateItemEx( (BYTE)( pItemElem->m_dwObjId ), UI_RANDOMOPTITEMID, pItemElem->GetRandomOptItemId() );
                    pUser->AddGold( -1000000 );
                    pUser->AddText( "Awakening: -1.000.000" );
                }else{
                    pUser->AddText( "You must have 1.000.000 Penya to awake something." );
                }
            }


        }else{
            pUser->AddText ( "You have to put the item in first slot to awake it." );
        }
    }
#endif // __WORLDSERVER
    return TRUE;
}
12/15/2016 14:42 ramom155#4
Quote:
Originally Posted by KetchupSamurai View Post
He say's it's an error with the command and not the function, the original poster should also read the command to seeing its right in front of both you. Its quite simple of a fix but here we go anyways lol..... I wonder what happens if we remove the nerf :/

Code:
BOOL TextCmd_GenRandomOption( CScanner & s )
{
#ifdef __WORLDSERVER 
    CUser* pUser = (CUser*)s.dwValue;
    CItemElem* pItemElem = pUser->m_Inventory.GetAt( 0 );
    if( pItemElem ){
        int nRandomOptionKind = g_xRandomOptionProperty->GetRandomOptionKind( pItemElem );
        if( nRandomOptionKind >= 0 ){
            if( pUser->HasActivatedSystemPet() && pItemElem->GetProp()->dwItemKind3 == IK3_EGG || pUser->HasActivatedEatPet() && pItemElem->GetProp()->dwItemKind3 == IK3_PET ){
                pUser->AddText( "Please deactivate your Pet/s." );
            }else{ 
                if( pItemElem->GetProp()->dwItemKind2 == IK2_CLOTH || pItemElem->GetProp()->dwItemKind2 == IK2_CLOTHETC || pItemElem->GetProp()->dwItemKind2 == IK2_CLOTHWIG ){
                pUser->AddText( "No Cs is awakeable with /awake!");
                }else{
                 if( pItemElem->GetProp()->dwID == II_SYS_SYS_SCR_BLESSEDNESS ){
                 return TRUE;
                 }else{
                if( pUser->GetGold() >= 1000000 ){
                    g_xRandomOptionProperty->InitializeRandomOption( pItemElem->GetRandomOptItemIdPtr() );
                    g_xRandomOptionProperty->GenRandomOption( pItemElem->GetRandomOptItemIdPtr(), nRandomOptionKind, pItemElem->GetProp()->dwParts );
                    pUser->UpdateItemEx( (BYTE)( pItemElem->m_dwObjId ), UI_RANDOMOPTITEMID, pItemElem->GetRandomOptItemId() );
                    pUser->AddGold( -1000000 );
                    pUser->AddText( "Awakening: -1.000.000" );
                }else{
                    pUser->AddText( "You must have 1.000.000 Penya to awake something." );
                }
            }


        }else{
            pUser->AddText ( "You have to put the item in first slot to awake it." );
        }
    }
#endif // __WORLDSERVER
    return TRUE;
}
Error in remove the nerf :\

[Only registered and activated users can see links. Click Here To Register...]
12/15/2016 15:19 Lumi#5
As the error showed:

You are using else without if-clauses.