Alright for some reason I am having trouble with this ifcheck....
This is in char update btw:
if ( !IS_NPC(ch) )
{
if ( is_saibaman ( ch ) )
{
if (time_info.hour >= 6 || time_info.hour <= 19 )
{
if ( !xIS_SET(ch->affected_by, AFF_SYNTHESIS) )
transform_synthesis(ch);
}
else
{
if ( xIS_SET(ch->affected_by, AFF_SYNTHESIS) )
untransform_synthesis( ch );
}
}
}
Its suppose to make a saibaman affected by synthesis during the day, and unaffected at night. It will transform but not untransform the player... I don't understand why though...
here is the two functions:
/*Saibman Power ups */
void untransform_synthesis( CHAR_DATA *ch )
{
xREMOVE_BIT(ch->affected_by, AFF_SYNTHESIS);
act( AT_DGREY, "The moon rises and the sun sets, your ability to gain energy from the sun ceases.", ch, NULL, NULL, TO_CHAR);
act( AT_DGREY, "$n stops collecting energy from the sun.", ch, NULL, NULL, TO_NOTVICT );
if (xIS_SET(ch->affected_by, AFF_SAIBAMAN1))
{
if( xIS_SET(ch->affected_by, AFF_MAJIN))
ch->pl = ch->exp * 11.5;
else
ch->pl = ch->exp * 10;
}
else if (xIS_SET(ch->affected_by, AFF_SAIBAMAN2))
{
if( xIS_SET(ch->affected_by, AFF_MAJIN))
ch->pl = ch->exp * 17.5;
else
ch->pl = ch->exp * 16;
}
else if (xIS_SET(ch->affected_by, AFF_SAIBAMAN3))
{
if( xIS_SET(ch->affected_by, AFF_MAJIN))
ch->pl = ch->exp * 25.5;
else
ch->pl = ch->exp * 24;
}
else
ch->pl = ch->exp;
return;
}
/*
* The Sythesis for saibaman
*/
void transform_synthesis( CHAR_DATA *ch )
{
if ( xIS_SET( ch->act, PLR_NOSYN ))
return;
if( xIS_SET(ch->affected_by, AFF_SYNTHESIS) )
return;
act( AT_GREEN, "You glace up at the sun and your body begins to radiate as you begin absorbing energy from the sun.", ch, NULL, NULL, TO_CHAR );
act( AT_GREEN, "$n glaces up at the sun and suddenly $s body begins to radiate as they begin collecting energy from the sun.", ch, NULL, NULL, TO_NOTVICT );
xSET_BIT(ch->affected_by, AFF_SYNTHESIS);
if (xIS_SET(ch->affected_by, AFF_SAIBAMAN1))
{
if( (xIS_SET(ch->affected_by, AFF_SYNTHESIS) && xIS_SET(ch->affected_by, AFF_MAJIN)))
ch->pl = ch->exp * 14.5;
else if(( xIS_SET(ch->affected_by, AFF_SYNTHESIS) && !xIS_SET(ch->affected_by, AFF_MAJIN)) )
ch->pl = ch->exp * 13;
else if(( !xIS_SET(ch->affected_by, AFF_SYNTHESIS) && xIS_SET(ch->affected_by, AFF_MAJIN)) )
ch->pl = ch->exp * 11.5;
else
ch->pl = ch->exp * 10;
}
else if (xIS_SET(ch->affected_by, AFF_SAIBAMAN2))
{
if( (xIS_SET(ch->affected_by, AFF_SYNTHESIS) && xIS_SET(ch->affected_by, AFF_MAJIN)))
ch->pl = ch->exp * 19.5;
else if(( xIS_SET(ch->affected_by, AFF_SYNTHESIS) && !xIS_SET(ch->affected_by, AFF_MAJIN)) )
ch->pl = ch->exp * 18;
else if(( !xIS_SET(ch->affected_by, AFF_SYNTHESIS) && xIS_SET(ch->affected_by, AFF_MAJIN)) )
ch->pl = ch->exp * 17.5;
else
ch->pl = ch->exp * 16;
}
else if (xIS_SET(ch->affected_by, AFF_SAIBAMAN3))
{
if( (xIS_SET(ch->affected_by, AFF_SYNTHESIS) && xIS_SET(ch->affected_by, AFF_MAJIN)))
ch->pl = ch->exp * 27.5;
else if(( xIS_SET(ch->affected_by, AFF_SYNTHESIS) && !xIS_SET(ch->affected_by, AFF_MAJIN)) )
ch->pl = ch->exp * 26;
else if(( !xIS_SET(ch->affected_by, AFF_SYNTHESIS) && xIS_SET(ch->affected_by, AFF_MAJIN)) )
ch->pl = ch->exp * 25.5;
else
ch->pl = ch->exp * 24;
}
else
ch->pl = ch->exp * 2;
return;
}