Jump to content
Sign in to follow this  
n0tttt

[Suggestion] Script command to retrieve active quest info

Recommended Posts

As of now, there isn't a script command to retrieve the timer or the hunted amount of a given mob in a quest. There's only checkquest(<id>,PLAYTIME) or checkquest(<id>,HUNTING) which only retrieves if the timer has been reached, or if the amount has been hunted. It'd be useful to have a command which returns the sd->quest_log[id].time parameter or sd->quest_log.count[j]
This way there wouldn't be a need for variables like etower_timer, and this would be useful to retrieve this info instantly for multiple specified quests.
Here's what I propose:

*getquestinfo(<quest>,<type>{,<mob id>{,<char_id>})

Returns the quest information of the given character.

Valid info types:
 PLAYTIME: returns the internal timer of the quest.
 HUNTING: returns the amount of <mob id> already hunted.

Examples:

	mes "You've hunted "+getquestinfo(60301,HUNTING,1155)+" Petit.";

	[email protected] = getquestinfo(60200,PLAYTIME);
	mes "You still have to wait "+Time2Str([email protected])+" to enter Endless Tower again.";

 

And here's a little snippet to check instance timers easily, which would be one of the main uses of this type of command I think.

	setarray [email protected]$[0],"Endless Tower","Sealed Catacomb";
	setarray [email protected]_id[0],60200,3040;
	setarray [email protected]$[0],"Unavaiaible","990000","Avaiaible","009900";
	for([email protected] = getarraysize([email protected]$);[email protected] < [email protected];[email protected]++) {
		[email protected]$ = "";
		[email protected] = checkquest([email protected]_id[[email protected]],PLAYTIME);
		[email protected] = [email protected] == -1 || [email protected] == 2;
		if([email protected]) {
			[email protected] = getquestinfo([email protected]_id[[email protected]],PLAYTIME);
			[email protected]$ = Time2Str([email protected]);
		}
		dispbottom [email protected]$[[email protected]]+": "[email protected]$[[email protected]*2]+" "[email protected]$+".","0x"[email protected]$[[email protected]*2 + 1];
	}
	end;

 

Edited by n0tttt
  • Upvote 6

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.