Advertisement
Emistry

[RO] GM Quest Management Atcommand

Apr 24th, 2020
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.09 KB | None | 0 0
  1.  
  2. -   script  atcmd_quest_manage  -1,{
  3. OnInit:
  4.     bindatcmd "checkquest", strnpcinfo(3) + "::OnCheckQuest", 99;
  5.     bindatcmd "setquest", strnpcinfo(3) + "::OnSetQuest", 99;
  6.     bindatcmd "erasequest", strnpcinfo(3) + "::OnEraseQuest", 99;
  7.     end;
  8.    
  9. OnCheckQuest:
  10.     .@quest_id = atoi(.@atcmd_parameters$[0]);
  11.     dispbottom "checkquest("+.@quest_id+"):";
  12.     switch (checkquest(.@quest_id)) {
  13.         case -1: dispbottom "-1 = Quest not started (not in quest log)";
  14.         case 0:  dispbottom " 0 = Quest has been given, but the state is \"inactive\"";
  15.         case 1:  dispbottom " 1 = Quest has been given, and the state is \"active\"";
  16.         case 2:  dispbottom " 2 = Quest completed";
  17.     }
  18.     dispbottom "checkquest("+.@quest_id+", PLAYTIME):";
  19.     switch (checkquest(.@quest_id, PLAYTIME)) {
  20.         case -1: dispbottom "-1 = Quest not started (not in quest log)";
  21.         case 0:  dispbottom " 0  = the time limit has not yet been reached";
  22.         case 1:  dispbottom " 1  = the time limit has not been reached but the quest is marked as complete";
  23.         case 2:  dispbottom " 2  = the time limit has been reached";
  24.     }
  25.     dispbottom "checkquest("+.@quest_id+", HUNTING):";
  26.     switch (checkquest(.@quest_id, HUNTING)) {
  27.         case -1: dispbottom "-1 = Quest not started (not in quest log)";
  28.         case 0:  dispbottom " 0 = you haven't killed all of the target monsters and the time limit has not been reached.";
  29.         case 1:  dispbottom " 1 = you haven't killed all of the target monsters but the time limit has been reached.";
  30.         case 2:  dispbottom " 2 = you've killed all of the target monsters";
  31.     }
  32.     end;
  33.    
  34. OnSetQuest:
  35.     .@quest_id = atoi(.@atcmd_parameters$[0]);
  36.     if (checkquest(.@quest_id) == -1) {
  37.         setquest .@quest_id;
  38.         dispbottom "setquest("+.@quest_id+") - quest assigned.";
  39.     }
  40.     else {
  41.         dispbottom "setquest("+.@quest_id+") - failed, quest already assigned.";
  42.     }
  43.     end;
  44.    
  45. OnEraseQuest:
  46.     .@quest_id = atoi(.@atcmd_parameters$[0]);
  47.     if (checkquest(.@quest_id) == -1) {
  48.         dispbottom "erasequest("+.@quest_id+") - failed quest aren't assigned yet.";
  49.     }
  50.     else {
  51.         erasequest .@quest_id;
  52.         dispbottom "erasequest("+.@quest_id+") - quest erased.";
  53.     }
  54.     end;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement