Emistry 145 Posted March 17, 2015 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) Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted March 17, 2015 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?? Quote Share this post Link to post Share on other sites
Emistry 145 Posted March 17, 2015 I can try show an example later when I get back to home. example : 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. 2 Hadeszeus and Gerz reacted to this Quote Share this post Link to post Share on other sites
Gerz 7 Posted July 3, 2015 good one, add this please! +1 Quote Share this post Link to post Share on other sites
Hadeszeus 15 Posted July 12, 2015 Up for this. Exactly what I'm looking for. Quote Share this post Link to post Share on other sites
Jedzkie 58 Posted July 12, 2015 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 }, Quote Share this post Link to post Share on other sites
Milchdealer 0 Posted July 19, 2015 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: Quote Share this post Link to post Share on other sites