Skip to content

Instantly share code, notes, and snippets.

@secretdataz
Last active August 19, 2016 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save secretdataz/119f25cc4e321a7757cfa48f36ae7854 to your computer and use it in GitHub Desktop.
Save secretdataz/119f25cc4e321a7757cfa48f36ae7854 to your computer and use it in GitHub Desktop.
questprogress for rAthena for compatibility with emulator with different architecture™.
//////////////////////////////////////////////////////////////////////////////////
//
// Another variant of `checkquest` script command for compatibility with
// scripts from other emulators that use `questprogress`.
// (This does not ensure 100% compatibility due to different architecture™. /s)
//
// *questprogress(<ID>{,PLAYTIME|HUNTING})
//
// If no additional argument supplied, return the state of the quest:
// 0 = Quest not started (not in quest log)
// 1 = Quest has been given
// 2 = Quest completed
//
// If parameter 'PLAYTIME' is supplied:
// 0 = Quest not started (not in quest log)
// 1 = The time limit has not yet been reached
// 2 = The time limit has been reached
//
// If parameter 'HUNTING' is supplied:
// 0 = Quest not started (not in quest log)
// 1 = Player hasn't killed all of the target monsters
// 2 = Player has killed all of the target monsters
//
//////////////////////////////////////////////////////////////////////////////////
function script questprogress {
.@id = getarg(0);
.@type = getarg(1, HAVEQUEST);
.@val = checkquest(.@id, .@type);
if(.@val == -1){
return 0;
}else if(.@val == 0 || .@val == 1){
return 1;
}else if(.@val == 2){
return 2;
}else{ // Unknown state
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment