int32 pc_attendance_counter( map_session_data* sd ){
std::shared_ptr<s_attendance_period> period = pc_attendance_period();
// No running attendance period
if( period == nullptr ){
return 0;
}
// Get the counter for the current period
int counter = static_cast<int>(pc_readreg2( sd, ATTENDANCE_COUNT_VAR ));
+ // Check if we have a remaining counter from a previous period
+ if( counter >= 20 && !pc_attendance_rewarded_today(sd) ){
+ pc_setreg2( sd, ATTENDANCE_COUNT_VAR, 0 );
+ return 0;
+ }
// Check if we have a remaining counter from a previous period
if( counter > 0 && pc_readreg2( sd, ATTENDANCE_DATE_VAR ) < period->start ){
// Reset the counter to zero
pc_setreg2( sd, ATTENDANCE_COUNT_VAR, 0 );
return 0;
}
return 10 * counter + ( ( pc_attendance_rewarded_today(sd) ) ? 1 : 0 );
}
I think this is what @Sapito Sucio is trying to tell you to do.
Though you have to really understand that attendance forces players to login/attend. On the days you want them active.
It would be best if you just use a daily reward script for the purpose of resetting your daily rewards.