Jump to content
Emistry

Script Command : getquestinfo

Recommended Posts

quest_db: (//  Quest Database///****************************************************************************** ************* Entry structure ************************************************ ******************************************************************************{	Id: Quest ID                    [int]	Name: Quest Name                [string]	TimeLimit: Time Limit (seconds) [int, optional]	Targets: (                      [array, optional]	{		MobId: Mob ID           [int]		Count:                  [int]	},	... (can repeated up to MAX_QUEST_OBJECTIVES times)	)	Drops: (	{		ItemId: Item ID to drop [int]		Rate: Drop rate         [int]		MobId: Mob ID to match  [int, optional]	},	... (can be repeated)	)},

 

since the quest structure has been updated.

Is it possible Hercules implement a script command to retrieve the information based on quest id ?

 

it seem like useful for script that link to the quests.

 

You dont need to hardcore what monster/item are going to hunt in the script. 

getquestinfo( <param> );	1	-	quest ID	2	-	quest Name	3	-	time limit	4	-	array of targets (mob id + count)	5	-	array of drops (item id + count)	

 

Share this post


Link to post
Share on other sites

 

quest_db: (//  Quest Database///****************************************************************************** ************* Entry structure ************************************************ ******************************************************************************{	Id: Quest ID                    [int]	Name: Quest Name                [string]	TimeLimit: Time Limit (seconds) [int, optional]	Targets: (                      [array, optional]	{		MobId: Mob ID           [int]		Count:                  [int]	},	... (can repeated up to MAX_QUEST_OBJECTIVES times)	)	Drops: (	{		ItemId: Item ID to drop [int]		Rate: Drop rate         [int]		MobId: Mob ID to match  [int, optional]	},	... (can be repeated)	)},
 

since the quest structure has been updated.

Is it possible Hercules implement a script command to retrieve the information based on quest id ?

 

it seem like useful for script that link to the quests.

 

You dont need to hardcore what monster/item are going to hunt in the script. 

getquestinfo( <param> );	1	-	quest ID	2	-	quest Name	3	-	time limit	4	-	array of targets (mob id + count)	5	-	array of drops (item id + count)	
Can't get a use of it, any example of script which can be useful??

Share this post


Link to post
Share on other sites

I can try show an example later when I get back to home.

 

example :

56vxlag.png

 

as you can see from the picture, most of these quest npc are written in a way like this, so that the NPC can tell which monsters they are going to hunt and how many.

and they are hardcoded into the npc script.

official server doesnt have any changes for the quest, so there isnt any major issue about it.

 

but what if the private server plan to adjust the quest ?? then they have to manually adjust all the related NPC script due to the content are mostly hardcoded into the script itself.

 

if we can add a script command to retrieve the quest information, things could be done easily, even the script could be much more simpler or shorter at certain cases ( *custom script mostly* )

 

some part may probably look simpler and nicer I guess.

current script example : 

		switch(select("Hunt Dark Frame:Hunt Evil Druid:Hunt Wraith:Hunt Raydric Archer")) {			case 1: callsub L_Quest,10110,.@str1$+"Hunt 10 Dark Frames.",.@str2$;			case 2: callsub L_Quest,10111,.@str1$+"Hunt 10 Evil Druids.",.@str2$;			case 3: callsub L_Quest,10112,.@str1$+"Hunt 10 Wraiths.",.@str2$;			case 4: callsub L_Quest,10113,.@str1$+"Hunt 10 Raydric Archers.",.@str2$;		}

 

if we have getquestinfo( <quest id>,<param> )  ,  assume param 1  = quest title.

		setarray .@quest_id,			10110,			10111,			10112,			101103;		.@quest_id_size = getarraysize( .@quest_id );		for ( .@i = 0; .@i < .@quest_id_size; .@i++ ) {			.@quest_menu$ = .@quest_menu$ + getquestinfo( .@quest_id[.@i],1 ) + ":";		}		.@i = select( .@quest_menu$ ) - 1;		callsub L_Quest,.@quest_id[.@i],.@str1$+"Hunt "+getquestinfo( .@quest_id[.@i],1 ),.@str2$;

we could write it this way, where we only need to provide the quest id.

it reduced the redundancy for certain part of the script.

Share this post


Link to post
Share on other sites

 

 

quest_db: (//  Quest Database///****************************************************************************** ************* Entry structure ************************************************ ******************************************************************************{	Id: Quest ID                    [int]	Name: Quest Name                [string]	TimeLimit: Time Limit (seconds) [int, optional]	Targets: (                      [array, optional]	{		MobId: Mob ID           [int]		Count:                  [int]	},	... (can repeated up to MAX_QUEST_OBJECTIVES times)	)	Drops: (	{		ItemId: Item ID to drop [int]		Rate: Drop rate         [int]		MobId: Mob ID to match  [int, optional]	},	... (can be repeated)	)},
 

since the quest structure has been updated.

Is it possible Hercules implement a script command to retrieve the information based on quest id ?

 

it seem like useful for script that link to the quests.

 

You dont need to hardcore what monster/item are going to hunt in the script. 

getquestinfo( <param> );	1	-	quest ID	2	-	quest Name	3	-	time limit	4	-	array of targets (mob id + count)	5	-	array of drops (item id + count)	
Can't get a use of it, any example of script which can be useful??

 

Is it possible that quest db supports items not only monsters? For example, hunt 10 Poring Cards.

 

Example structure:

 

Drops: (

{

    ItemID: 4001 // Target Item ID

    Count: 10 // Target Count

    MobID: 1002 // Target Monster

},

Share this post


Link to post
Share on other sites

Doing some tests and might write up a plugin.

 

Names are not yet parsed into the memory DB, as far as I can see

struct quest_db {	int id;	unsigned int time;	int objectives_count;	struct quest_objective *objectives;	int dropitem_count;	struct quest_dropitem *dropitem;	//char name[NAME_LENGTH];};

As such I'm not sure you can read them and maybe that's better, as we don't actually need them server side and they would take up lots of space:

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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

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