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;
}
{
#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;
}






