Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'd like to determine the attributes of a quest (i.e., information provided by functions such as QuestIsDaily and IsQuestCompletable) before the player clicks on the quest detail.

I'm trying to write an add-on that handles accepting and completing of daily quests with a single click on the NPC, but I'm running into a problem whereby I can't find out anything about a given quest unless the quest text is currently being displayed, defeating the purpose of the add-on. Other add-ons of this nature seem to be getting around this limitation by hard-coding information about quests, an approach I don't much like as it requires constant maintenance.

It seems to me that this information must be available somehow, as the game itself can properly figure out which icon to display over the head of the NPC without player interaction. The only question is, are add-on authors allowed access to this information? If so, how?


EDIT: What I originally left out was that the situations I'm trying to address are when:

  1. An NPC has multiple quests
  2. The quest detail is not the first thing that shows up upon right-click

Otherwise, the situation is much simpler, as I have the information I need provided immediately.

share|improve this question

migrated from gaming.stackexchange.com Feb 3 '11 at 17:34

This question came from our site for passionate videogamers on all platforms.

1 Answer 1

up vote 4 down vote accepted

GetGossipAvailableQuests allows you to get available quests from the NPC once you have triggered the GOSSIP_SHOW event and allows you to determine if it is a daily quest. GetGossipActiveQuests allows you to get active quests from the NPC under the same condition and returns a value for each one that indicates whether or not it is complete. Assuming the "one click" is a right-click within range of the NPC, this would work.

If you're looking for something that's available via a left-click at any range, I'm unfamiliar with such an API function.

share|improve this answer
    
I just realized what I left out of that original question - this approach works when the NPC has only one quest, but not when multiple quests are available. When multiple quests are available, the IsQuestCompletable function does not return anything because no quest detail is shown upon the first click. –  Matt DiTrolio Feb 3 '11 at 15:44
    
This solution should still work even with your edited case. In fact, it fits your criteria perfectly: GetGossipAvailableQuests triggers after GOSSIP_SHOW, which means the quest detail does not have to be the first thing that shows up. Furthermore, it returns details about more than one quest. GetNumGossipAvailableQuests will tell you how many to expect, and also is available after GOSSIP_SHOW. –  Shaun Feb 3 '11 at 16:10
    
So you're saying that I should be able to call IsQuestCompletable while I loop through the list of quests? –  Matt DiTrolio Feb 3 '11 at 17:23
    
Ah, I missed that part of your edit. IsQuestCompletable only works against the quest being showed in the quest window. GetGossipActiveQuests shows you whether a quest is complete. Updated my answer. –  Shaun Feb 3 '11 at 17:42
    
@MattDiTrolio: Did this work for you? –  Shaun Feb 8 '11 at 16:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.