then shouldn't use time limit, just set another npc variable for it
prontera,150,185,0 script test override 1_F_MARIA,{
.@difficulty = 3; // official script only has 3 digits ... sux ... maximum is 9 btw
if ( .start == 0 ) {
if ( getgmlevel() != 99 ) {
dispbottom "only GM can activate this event.";
end;
}
F_ShuffleNumbers 1, 9, .@r, .@difficulty;
for ( .@i = 0; .@i < .@difficulty; ++.@i )
.guess += .@r[.@i] * (10 ** .@i); // change 10**.@i into pow(10,.@i) for rathena
dispbottom "input this number -> "+ .guess;
.start = 1;
end;
}
else if ( .start == 1 ) {
input .@num;
if ( .start != 1 ) { // <--- THIS is what you need
dispbottom "the guessing time has over";
end;
}
if ( .@num != .guess ) {
// Let's do some MATH !!
if ( .@num < 10 ** (.@difficulty -1) || .@num >= 10 ** .@difficulty ) {
dispbottom "Number input requirement has not been fulfilled. Please enter a "+ .@difficulty +" digit number.";
end;
}
for ( .@i = 0; .@i < .@difficulty; ++.@i )
.@n[.@i] = .@num / ( 10**.@i ) % 10;
for ( .@i = 0; .@i < .@difficulty; ++.@i ) {
if ( .@n[.@i] == 0 ) {
dispbottom "Violation of number input parameter. Number 0 has been input.";
end;
}
if ( countstr( .@num +"", .@n[.@i] +"" ) > 1 ) {
dispbottom "Violation of number input parameter. Number has been input more than once.";
end;
}
}
for ( .@i = 0; .@i < .@difficulty; ++.@i ) {
if ( compare( .guess +"", .@n[.@i] +"" ) )
++.@has_number;
if ( charat( .@num +"", .@i ) == charat( .guess +"", .@i ) )
++.@correct_pos;
}
dispbottom "Your guess has "+ .@has_number +" digit of number that is on the answer, and "+ .@correct_pos +" digit having same position with the answer.";
end;
}
npctalk strcharinfo(0) +" has guess correctly";
getitem Apple, 1;
.start = .guess = 0;
end;
}
}