How to prevent lord buff stacking

08/13/2016 14:42 jeromerz#1
Hello guys, can u help me a little bit on lord system i made the lord event requirement as normal players but they are able to stack a lot of lord buffs any tips where can i prevent it or disable it?

Thanks in advance
08/13/2016 14:53 alfredico#2
What about a checking if lord's event is running...?
08/13/2016 17:52 jeromerz#3
Code:
namespace	lordevent
{
	int	CreateRequirements( CUser* pUser, int iEEvent, int iIEvent )
	{
		ILordEvent* pEvent		= CSLord::Instance()->GetEvent();
		if(!pUser->IsAuthHigher(AUTH_GAMEMASTER))
		{
			if( !CSLord::Instance()->IsLord( pUser->m_idPlayer ) )
			{
				return TID_GAME_L_EVENT_CREATE_E001;
			}
		}
		if( pEvent->GetComponent( pUser->m_idPlayer ) )		// is there no event?
			return TID_GAME_L_EVENT_CREATE_E002;
		if( pUser->IsQuerying() )
			return TID_GAME_LORD_IS_QUERYING;
		__int64 iCost	= pEvent->GetCost( iEEvent, iIEvent );
		if( iCost == 0 )
			return TID_GAME_L_EVENT_CREATE_E004;
		if( iCost > pUser->GetTotalGold() )
			return TID_GAME_L_EVENT_CREATE_E003;

		pUser->SetQuerying( TRUE );
		return 0;
	}
};
i don't know how to do that =(
Code:
if( pEvent->GetComponent( pUser->m_idPlayer ) )		// is there no event?
			return TID_GAME_L_EVENT_CREATE_E002;
this check the id of the player who used the event but i know how to put the check for the lord event not the player who host it but when the event is active
08/13/2016 18:56 alfredico#4
Player different from NULL_ID
CLEComponent::CLEComponent()
:
nTick( 0 ),
idPlayer( NULL_ID ),
fEFactor( 1.0F ),
#ifdef __CLIENT
m_pTexture( NULL ),
#endif // __CLIENT
fIFactor( 1.0F )
{
}
08/14/2016 01:59 jeromerz#5
sorry i dont know what to do with that. :(

is this right?

Added it on the requirement for lord
Code:
		if( CLEComponent::CLEComponent() )
		{
			return TID_GAME_L_EVENT_CREATE_E001;
		}