First of all, thanks to all for the feedback
Quote:
Originally Posted by sorvani
Here is how I see it.
All NPC's will have to gain an inventory that items given to them can be logged in.
Then the quest structure will need to have commands added to it to check said inventory, and purge said inventory.
Then quest files themselves will still have to be rewrote to use these new functions.
|
I haven't seen enough of the quest manager code to fully understand how this works (the get item code seemed to purge *all* items of a certain ID from the players inventory, returning a yield count), however, I agree with you on the inventory part, and with trevius on the array (or collection) implementation:
- All items handed in to the NPC should be stored in there *if* - and only if - they are part of *any* item set the NPC would accept for a quest. To facilitate this, I guess the NPC could use an array that contained all quest items accepted by him, associated with a quest ID, a count "required amount" and a count "amount turned in".
- When an item is turned in that is contained in the array, it's according "amount turned in" counter is increased until max is reached. Another item of the same type would increase another counter if that item is in the list more than once, otherwise it would get "eaten" by the NPC (to mimic behaviour were you have to turn in multiple items *unstacked*).
- depending on how MQ NPCs behave on live, once all items for a quest are complete, the reward is triggered and the array is either reset or the items for the completed quest are removed from the array. I am not sure if you could multiquest 2 different quests at the same time.
I think that covers most situations that I can think of.
I'll have a look at the quest manager over the next weeks (am in no hurry) and see if I can find the actual code that does the completeness check on quests (I suspect it is in the perl scripts for each quest currently) - to generalize this in the questmgr code. Ideally, the perl code would only have to call some "getItem(arrayOfTurnedInItemsWithCounts)" function, and check it's return value for an event that indicates a completed quest. Shouldn't require much recoding on the script side. Or rather - I would try to make it so that it could be done without recoding. If possible.
Cheers,
Douc Langur