Register for your free account! | Forgot your password?

You last visited: Today at 03:45

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


Scroll Of Fixed Awake Question

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2010
Posts: 119
Received Thanks: 7
Scroll Of Fixed Awake Question

Okay, so am not really good at c++. I come up to this questions because whenever you buff the scroll into a different item kind then it will not work + the scroll will disappear instead of it will say wrong item + it will have the item stay on the inventory. So here is my noob alternate code that you can flame but I would be glad if you could help me out with this people.

So instead of:

Code:
else 
                {
                        pUser->AddText( "Oops! Wrong item!" );
                        return FALSE;
                }
                pUser->UpdateItemEx( (BYTE)( pTarget->m_dwObjId ), UI_RANDOMOPTITEMID, pTarget->GetRandomOptItemId() );
                return TRUE;
        }
        return FALSE;
I made it to:

Code:
else if ( pTarget->GetProp()->dwItemKind3 != pTarget )
                {
                        pUser->AddText( "Oops! Wrong item!" );
                        return FALSE;
                }
                pUser->UpdateItemEx( (BYTE)( pTarget->m_dwObjId ), UI_RANDOMOPTITEMID, pTarget->GetRandomOptItemId() );
                return TRUE;
        }
        return FALSE;
Or could it be:

Code:
else
                {
                        if ( pTarget->GetProp()->dwItemKind3 != pTarget )
                        {
                               pUser->AddText( "Oops! Wrong item!" );
                               return FALSE;
                        }
                }
                pUser->UpdateItemEx( (BYTE)( pTarget->m_dwObjId ), UI_RANDOMOPTITEMID, pTarget->GetRandomOptItemId() );
                return TRUE;
        }
        return FALSE;
I am 90% sure that my alternates are not really correct, but really guys can you help me out?



pakinglalat is offline  
Old 08/07/2016, 19:00   #2
 
elite*gold: 0
Join Date: Feb 2014
Posts: 264
Received Thanks: 227
can u copy the whole code?


Jupsi332 is offline  
Old 08/07/2016, 19:03   #3
 
elite*gold: 0
Join Date: Jan 2010
Posts: 119
Received Thanks: 7
Hi! This is the whole function.

Code:
BOOL CDPSrvr::DoUseItemTarget_WezzyFixAwakeningScroll( CUser* pUser, CItemElem* pMaterial, CItemElem* pTarget )
{
        int nRandomOptionKind = g_xRandomOptionProperty->GetRandomOptionKind( pTarget );
 
        if( nRandomOptionKind >= 0 )
        {
                g_xRandomOptionProperty->InitializeRandomOption( pTarget->GetRandomOptItemIdPtr() ); //Reset awake

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////// |Weapons|Armor|Shield| /////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


                			if( pTarget->GetProp()->dwItemKind1 == IK1_WEAPON || pTarget->GetProp()->dwItemKind2 == IK2_ARMORETC || pTarget->GetProp()->dwItemKind2 == IK2_ARMOR || pTarget->GetProp()->dwItemKind3 == IK3_SHIELD )
                			{
                        		if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_STR )
					{
                        		g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                        		g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                        		g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
					}

                        		else if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_STA )
					{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
					}

                        		else if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_DEX )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                	}

                        		else if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_INT )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                	}

                        		else if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_ADOCH )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                               	 	}

                        		else if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_SPEED )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                	}

								else if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_INCATK ) 
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_INCMP )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_INCHP )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_INCDEF )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
									}
                        		}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////// |-------|Accesory|------| //////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


                		else if( pTarget->GetProp()->dwItemKind2 == IK2_JEWELRY )
                		{
                        	if( pMaterial->m_dwItemId == II_SYS_J_AWAKEFIX_STR )
                                {
                                g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 15 );
                                }
                       		else if( pMaterial->m_dwItemId == II_SYS_J_AWAKEFIX_STA )
                                {
                                g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 15 );
                                }
                        	else if( pMaterial->m_dwItemId == II_SYS_J_AWAKEFIX_DEX )
                                {
                                g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 15 );
                                }
                        	else if( pMaterial->m_dwItemId == II_SYS_J_AWAKEFIX_INT )
                                {
                                g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 15 );
                                }
                        	else if( pMaterial->m_dwItemId == II_SYS_J_AWAKEFIX_ADOCH )
                                {
                                g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 15 );
                                }
                        	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////// |-------|Fashions|------| //////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


                			else if( pTarget->GetProp()->dwItemKind2 == IK2_CLOTH || pTarget->GetProp()->dwItemKind2 == IK2_CLOTHETC  )
                			{
                        		if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_STR )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                               		}
                        		else if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_STA )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_DEX )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_INT )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_ADOCH )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_SPEED )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                	}

								else if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_INCATK ) 
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_INCMP )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_INCHP )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_F_AWAKEFIX_INCDEF )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
									}
                        		}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////// |-------|Raise Pets|------| ////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



                			else if( pTarget->GetProp()->dwItemKind3 == IK3_EGG )
                			{
                        		if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_STR )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_STA )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_DEX )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_INT )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_ADOCH )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_SPEED )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                	}

								else if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_INCATK ) 
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_INCMP )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_INCHP )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_P_AWAKEFIX_INCDEF )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
									}
                        		}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////// |-------|Looter Pets|------| ///////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


                			else if( pTarget->GetProp()->dwItemKind3 == IK3_PET )
                			{
                        		if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_STR )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STR, 150 );
                               		}
                        		else if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_STA )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_STA, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_DEX )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_DEX, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_INT )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_INT, 150 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_ADOCH )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_CRITICAL_BONUS, 100 );
                                	}
                        		else if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_SPEED )
                                	{
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_SPEED, 50 );
                                }

								else if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_INCATK ) 
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ATKPOWER_RATE, 100 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_INCMP )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_MP_MAX_RATE, 50 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_INCHP )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_HP_MAX_RATE, 100 );
									}

								else if( pMaterial->m_dwItemId == II_SYS_V_AWAKEFIX_INCDEF )
									{
										g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
                                        g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100 );
									}
                        }
                else if (pTarget->GetProp()->dwItemKind3 != pTarget )
                {
                        pUser->AddText( "Oops! Wrong item!" );
                        return FALSE;
                }
                pUser->UpdateItemEx( (BYTE)( pTarget->m_dwObjId ), UI_RANDOMOPTITEMID, pTarget->GetRandomOptItemId() );
                return TRUE;
        }
        return FALSE;
}
pakinglalat is offline  
Old 08/07/2016, 20:06   #4
 
elite*gold: 0
Join Date: Jan 2014
Posts: 700
Received Thanks: 344
"if ( pTarget->GetProp()->dwItemKind3 != pTarget )"
this make no sense


just
"if ( pTarget->GetProp()->dwItemKind3 != pTarget->GetProp()->dwItemKind3 )"


Drabur is offline  
Old 08/07/2016, 20:14   #5
 
elite*gold: 0
Join Date: Feb 2014
Posts: 264
Received Thanks: 227
Quote:
Originally Posted by Drabur View Post
"if ( pTarget->GetProp()->dwItemKind3 != pTarget )"
this make no sense


just
"if ( pTarget->GetProp()->dwItemKind3 != pTarget->GetProp()->dwItemKind3 )"
Das macht genau so wenig sinn, da du die beiden selben punkte vergleichst, die können nur gleich sein
Jupsi332 is offline  
Old 08/07/2016, 20:25   #6
 
elite*gold: 0
Join Date: Jan 2014
Posts: 700
Received Thanks: 344
haha ok das hab ich nicht mal gelesen D:
@pakinglalat
what you want to change at this system?
Drabur is offline  
Old 08/08/2016, 07:24   #7
 
elite*gold: 0
Join Date: Jan 2010
Posts: 119
Received Thanks: 7
Quote:
Originally Posted by Drabur View Post
haha ok das hab ich nicht mal gelesen D:
@pakinglalat
what you want to change at this system?
Hi, in this system when you use the scroll in the wrong item kind will have the scroll removed in the inventory. For example:

I have a fashion item which is the item kind of "IK2_CLOTH" and "IK2_CLOTHETC". Then I will buff the weapons only scroll which is for "IK1_WEAPON" then the scroll will be removed in the inventory instead of making it stay.

So in the else statement, it should be like if none of those conditions are true will have the text "Oops.. blabla" show up and return false right? The thing is, it will show that text but then the scroll will be removed. What I want is the scroll will stay in the inventory when it is buffed in the wrong item kind. I remember @raventh1984 fixed this long time ago. But I cannot remember the statement.
pakinglalat is offline  
Old 08/08/2016, 12:40   #8
 
elite*gold: 0
Join Date: Jan 2010
Posts: 119
Received Thanks: 7
Quote:
Originally Posted by Avalion View Post
What do you want specifically because from my understanding, you just want the original code...
Hi, the original code works 100% but the scrolls are for different kinds of items right? Like for example scroll a is only for weapons & shield and then scroll b is only for fashion & cloak then you will use scroll a into the fashion items/cloaks. Then it will go to else right + the text will appear but, the scroll a will be removed in the inventory instead of making it stay in the inventory since it is not for those items(fashion/cloak) but for weapon/shield only. I hope that explains much.
pakinglalat is offline  
Old 08/08/2016, 13:08   #9

 
elite*gold: 158
Join Date: Feb 2010
Posts: 386
Received Thanks: 174
Code:
BOOL CDPSrvr::DoUseItemTarget_WezzyFixAwakeningScroll( CUser* pUser, CItemElem* pMaterial, CItemElem* pTarget )
{

	if( IsInvalidObj( pUser ) || !pMaterial || !pMaterial->GetProp() || !pTarget || !pTarget->GetProp() )
		return FALSE;
	
    int nRandomOptionKind = g_xRandomOptionProperty->GetRandomOptionKind( pTarget );

    if( nRandomOptionKind >= 0 )
    {
        g_xRandomOptionProperty->InitializeRandomOption( pTarget->GetRandomOptItemIdPtr() );
		int nBonus, nValue, nCount;
		nCount = 0;

		if( pTarget->GetProp()->dwItemKind2 == IK2_WEAPON_DIRECT || pTarget->GetProp()->dwItemKind2 == IK2_WEAPON_MAGIC || pTarget->GetProp()->dwItemKind2 == IK2_SECONDHAND )
		{
			nCount = 1;
			
			switch(pMaterial->m_dwItemId)
			{
				case II_SYS_V_AWAKEFIX_STR: //SCROLL
				{
					nBonus = DST_STR; //ATRIB
					nValue = 500; //BONUS
					break;
				}
				default:
				{
					nCount = 0;
				}
			}
		}

        if ( nCount > 0 )
        {
			for ( int i = 0; i < nCount; i++ )
	            g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), nBonus, nValue );
	
			pUser->UpdateItemEx( (BYTE)( pTarget->m_dwObjId ), UI_RANDOMOPTITEMID, pTarget->GetRandomOptItemId() );
	        return TRUE;
	    }
	    else
	    {
	    	pUser->AddText( "Oops! Wrong item!" );
			return FALSE;
	    }
    }
    return FALSE;
}
naruto66620 is offline  
Old 08/08/2016, 15:15   #10
 
elite*gold: 0
Join Date: Jan 2010
Posts: 119
Received Thanks: 7
Quote:
Originally Posted by naruto66620 View Post
Code:
BOOL CDPSrvr::DoUseItemTarget_WezzyFixAwakeningScroll( CUser* pUser, CItemElem* pMaterial, CItemElem* pTarget )
{

	if( IsInvalidObj( pUser ) || !pMaterial || !pMaterial->GetProp() || !pTarget || !pTarget->GetProp() )
		return FALSE;
	
    int nRandomOptionKind = g_xRandomOptionProperty->GetRandomOptionKind( pTarget );

    if( nRandomOptionKind >= 0 )
    {
        g_xRandomOptionProperty->InitializeRandomOption( pTarget->GetRandomOptItemIdPtr() );
		int nBonus, nValue, nCount;
		nCount = 0;

		if( pTarget->GetProp()->dwItemKind2 == IK2_WEAPON_DIRECT || pTarget->GetProp()->dwItemKind2 == IK2_WEAPON_MAGIC || pTarget->GetProp()->dwItemKind2 == IK2_SECONDHAND )
		{
			nCount = 1;
			
			switch(pMaterial->m_dwItemId)
			{
				case II_SYS_V_AWAKEFIX_STR: //SCROLL
				{
					nBonus = DST_STR; //ATRIB
					nValue = 500; //BONUS
					break;
				}
				default:
				{
					nCount = 0;
				}
			}
		}

        if ( nCount > 0 )
        {
			for ( int i = 0; i < nCount; i++ )
	            g_xRandomOptionProperty->SetParam( pTarget->GetRandomOptItemIdPtr(), nBonus, nValue );
	
			pUser->UpdateItemEx( (BYTE)( pTarget->m_dwObjId ), UI_RANDOMOPTITEMID, pTarget->GetRandomOptItemId() );
	        return TRUE;
	    }
	    else
	    {
	    	pUser->AddText( "Oops! Wrong item!" );
			return FALSE;
	    }
    }
    return FALSE;
}
Hello sir, you have a very neat and optimized code. I like it so much. I might consider changing mine to yours but my problem is when I use the scroll in a different item kind the scroll will disappear though the text "Oops! Wrong item!" will be printed out. What I need to do is when the scroll is used in different item kind it will say "Oops! Wrong item!" + the scroll will stay in the inventory rather than disappearing.
pakinglalat is offline  
Old 08/08/2016, 17:38   #11
 
elite*gold: 150
Join Date: Mar 2008
Posts: 324
Received Thanks: 262
Why would you even hard-code all the Scrolls? Just give them a new itemkind and set the awakes according to destparam and adjparamval.

Show us the code where you call DoUseItemTarget_WezzyFixAwakeningScroll. The return value needs to be used correctly there.
Nortix is offline  
Old 08/08/2016, 18:02   #12
 
elite*gold: 0
Join Date: Mar 2008
Posts: 650
Received Thanks: 206
Quote:
Originally Posted by pakinglalat View Post
Hello sir, you have a very neat and optimized code. I like it so much. I might consider changing mine to yours but my problem is when I use the scroll in a different item kind the scroll will disappear though the text "Oops! Wrong item!" will be printed out. What I need to do is when the scroll is used in different item kind it will say "Oops! Wrong item!" + the scroll will stay in the inventory rather than disappearing.
else
{
pUser->AddText( "Oops! Wrong item!" );
return FALSE;
}
alfredico is offline  
Old 08/08/2016, 20:34   #13
 
elite*gold: 0
Join Date: Mar 2016
Posts: 9
Received Thanks: 0
i have the same error , the message Oops! Wrong Item! not work
i use this guide any help ?
[Release] Fix Awake Scroll
kimba2015 is offline  
Old 08/09/2016, 00:48   #14
 
elite*gold: 0
Join Date: Mar 2016
Posts: 9
Received Thanks: 0
Post CODE

Quote:
Originally Posted by Avalion View Post
Code:
			else if (pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_INCDEF)
			{
				g_xRandomOptionProperty->SetParam(pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100);
				g_xRandomOptionProperty->SetParam(pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100);
				g_xRandomOptionProperty->SetParam(pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100);
			}
			else
			{
				pUser->AddText("This scroll is not for this item type.");
				return false;
			}
Post full code please
kimba2015 is offline  
Old 08/09/2016, 08:44   #15
 
elite*gold: 0
Join Date: Jan 2010
Posts: 119
Received Thanks: 7
Quote:
Originally Posted by Avalion View Post
Code:
			else if (pMaterial->m_dwItemId == II_SYS_N_AWAKEFIX_INCDEF)
			{
				g_xRandomOptionProperty->SetParam(pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100);
				g_xRandomOptionProperty->SetParam(pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100);
				g_xRandomOptionProperty->SetParam(pTarget->GetRandomOptItemIdPtr(), DST_ADJDEF_RATE, 100);
			}
			else
			{
				pUser->AddText("This scroll is not for this item type.");
				return false;
			}
Hi there, that is the original else statement and that is the problem where if you use the scroll into the different kind of item the scroll disappears although the message will be displayed. Yet, the scroll will be disappeared.

Quote:
Originally Posted by Nortix View Post
Why would you even hard-code all the Scrolls? Just give them a new itemkind and set the awakes according to destparam and adjparamval.

Show us the code where you call DoUseItemTarget_WezzyFixAwakeningScroll. The return value needs to be used correctly there.
Code:
#ifdef __WEZZY_FIX_AWAKE_SCROLL
                        // WEAPON, ARMOR, SHIELD //
			case II_SYS_N_AWAKEFIX_STR:
			case II_SYS_N_AWAKEFIX_STA:
			case II_SYS_N_AWAKEFIX_DEX:
			case II_SYS_N_AWAKEFIX_INT:
			case II_SYS_N_AWAKEFIX_ADOCH:
			case II_SYS_N_AWAKEFIX_SPEED:

			case II_SYS_N_AWAKEFIX_INCATK:
			case II_SYS_N_AWAKEFIX_INCMP:
			case II_SYS_N_AWAKEFIX_INCHP:
			case II_SYS_N_AWAKEFIX_INCDEF:
			// WEAPON, ARMOR, SHIELD //

			// ACCESSORY
			case II_SYS_J_AWAKEFIX_STR:
			case II_SYS_J_AWAKEFIX_STA:
			case II_SYS_J_AWAKEFIX_DEX:
			case II_SYS_J_AWAKEFIX_INT:
			case II_SYS_J_AWAKEFIX_ADOCH:

			case II_SYS_J_AWAKEFIX_INCATK:
			case II_SYS_J_AWAKEFIX_INCMP:
			case II_SYS_J_AWAKEFIX_INCHP:
			case II_SYS_J_AWAKEFIX_INCDEF:
			// ACCESSORY

			// FASHION
			case II_SYS_F_AWAKEFIX_STR:
			case II_SYS_F_AWAKEFIX_STA:
			case II_SYS_F_AWAKEFIX_DEX:
			case II_SYS_F_AWAKEFIX_INT:
			case II_SYS_F_AWAKEFIX_ADOCH:
			case II_SYS_F_AWAKEFIX_SPEED:

			case II_SYS_F_AWAKEFIX_INCATK:
			case II_SYS_F_AWAKEFIX_INCMP:
			case II_SYS_F_AWAKEFIX_INCHP:
			case II_SYS_F_AWAKEFIX_INCDEF:
			// FASHION

			// PETS
			case II_SYS_P_AWAKEFIX_STR:
			case II_SYS_P_AWAKEFIX_STA:
			case II_SYS_P_AWAKEFIX_DEX:
			case II_SYS_P_AWAKEFIX_INT:
			case II_SYS_P_AWAKEFIX_ADOCH:
			case II_SYS_P_AWAKEFIX_SPEED:

			case II_SYS_P_AWAKEFIX_INCATK:
			case II_SYS_P_AWAKEFIX_INCMP:
			case II_SYS_P_AWAKEFIX_INCHP:
			case II_SYS_P_AWAKEFIX_INCDEF:
			// PETS

			// LOOTER PETS
			case II_SYS_V_AWAKEFIX_STR:
			case II_SYS_V_AWAKEFIX_STA:
			case II_SYS_V_AWAKEFIX_DEX:
			case II_SYS_V_AWAKEFIX_INT:
			case II_SYS_V_AWAKEFIX_ADOCH:
			case II_SYS_V_AWAKEFIX_SPEED:

			case II_SYS_V_AWAKEFIX_INCATK:
			case II_SYS_V_AWAKEFIX_INCMP:
			case II_SYS_V_AWAKEFIX_INCHP:
			case II_SYS_V_AWAKEFIX_INCDEF:
			// LOOTER PETS
				b = DoUseItemTarget_WezzyFixAwakeningScroll( pUser, pMaterial, pTarget );
				break;
#endif // __WEZZY_FIX_AWAKE_SCROLL

			default:
				break;
		}
		if( b )
		{
			pUser->AddPlaySound( SND_INF_UPGRADESUCCESS );
			if( pUser->IsMode( TRANSPARENT_MODE ) == 0 )
				g_UserMng.AddCreateSfxObj( pUser, XI_INT_SUCCESS, pUser->GetPos().x, pUser->GetPos().y, pUser->GetPos().z );

			PutItemLog( pUser, "u", "OnDoUseItemTarget", pMaterial );

			pUser->UpdateItem( (BYTE)( pMaterial->m_dwObjId ), UI_NUM, pMaterial->m_nItemNum - 1 );	
		}
	}
}
As you can see in the last statement, if b is true it is m_nItemNum - 1. Then as you can see the else returns false.


pakinglalat is offline  
Reply



« Arena Score System Errors Need HELP PLEASE | How to prevent lord buff stacking »

Similar Threads
[Release] Fix Awake Scroll
01/23/2017 - Flyff PServer Guides & Releases - 34 Replies
I release my custom fix awake Scroll WORLDSERVER DPSrvr.cpp Under #endif // __PET_0519 case II_SYS_SYS_SCR_LEVELDOWN01:
scroll of fix awake problem
01/14/2015 - Flyff PServer - Discussions / Questions - 4 Replies
hi have add scroll to fix awaken + 511 STR i use scroll on my item but its not work item still no awake and scroll is there still
Fix Awake Scroll Error
09/19/2014 - Flyff PServer - Discussions / Questions - 1 Replies
#CLOSED
[Request] Scroll of Fix awake
07/05/2013 - Flyff PServer - Discussions / Questions - 8 Replies
hello :) i would like to ask your help on my request some one who is nice to share his source for Scroll of fix awake x3 its just a request no bad comments please :)
flyff scroll of fix awake
12/06/2011 - Flyff PServer - Discussions / Questions - 5 Replies
plese help me



All times are GMT +2. The time now is 03:45.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.