Originally posted by [b]NoH[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4145
F_ClearJobVar is a very useful function, however it doesn't clear the quest entries for the different jobs. You could do it with a piece of code like:
CODE
set .@i,1001; // We define the first range of quests to erase
set .@j,1014;
while(1) {
do {
if ( checkquest(.@i) == 0 || checkquest(.@i) == 1 ) // We don't erase completed quests
erasequest .@i;
set .@i,.@i+1;
} while (.@i<=.@j);
set .@k,.@k+1; // We count the number of "ranges". - Btw: I'd kill for a i++ shortcut un eA :)
if ( .@k == 1 ) {
set .@i,2000; // Second range of quests to erase
set .@j,2062;
}
else if ( .@k == 2 ) {
set .@i,3000; // etc
set .@j,3032;
}
else if ( .@k == 3 ) {
set .@i,6000;
set .@j,6024;
}
else if ( .@k == 4 ) {
set .@i,7000;
set .@j,7011;
}
else if ( .@k == 5 ) {
set .@i,8000;
set .@j,8016;
}
else if ( .@k == 6 ) {
set .@i,9000;
set .@j,9018;
}
else if ( .@k == 7 ) {
set .@i,4000;
set .@j,4013;
}
else break; // We're done cleaning the quest entries
}
But
attention! This is untested, so it may very well be bugged, I may have skipped quest IDs, etc (it's very likely actually). Also if you use it, you must call the function "F_ClearJobVar"
after the completequest command or it's gonna erase the current job quest as well (state must be at 2 so it's not erased).
This post has been edited by NoH: Mar 27 2010, 01:43 PM