Page 1 of 1

Getting QuestId from List

Posted: Sun Feb 03, 2013 1:57 pm
by dr-nuker
Hello folks.

I'm not clever enought and I like to spam the forum with questions...

So here I go:

I accept a quest in Dalanis and it is possible to result in 3 different quests.
So actually the event npc offers one quest out of a pool of three. All of the same name but different things to do.

I accept the quest anyways but want do decide by id it's Id which path to take.

Or is there something like AcceptQuestById() so that i just try all three and see qhich is possible to accept?

thanks in advance :)

Re: Getting QuestId from List

Posted: Sun Feb 03, 2013 2:14 pm
by rock5
Well, AcceptQuestByName(nameorid) will return true if a match is found. So you could do

Code: Select all

if AcceptQuestByName(id1) then
    -- do quest 1 stuff
elseif AcceptQuestByName(id2) then
    -- do quest 2 stuff
elseif AcceptQuestByName(id3) then
    -- do quest 3 stuff
end

Re: Getting QuestId from List

Posted: Tue Feb 05, 2013 4:13 pm
by dr-nuker
Well... not working for me :/

Code: Select all

		if AcceptQuestByName(423751) then
    			-- do chain
			__WPL:setWaypointIndex(__WPL:findWaypointTag("silverchain"));
		elseif AcceptQuestByName(423662) then
    			-- do wooden box
			__WPL:setWaypointIndex(__WPL:findWaypointTag("woodenbox"));
		elseif AcceptQuestByName(413859) then
    			-- do puppet
			player:sleep()
			__WPL:setWaypointIndex(__WPL:findWaypointTag("clothpuppet"));
		end
I definately gor the quest with finding cloth puppet, but the bot insists of saing he got another quest but not that one.
So now I'd like to recheck the Id of the quest with the given name.

Any idea? :)

Re: Getting QuestId from List

Posted: Tue Feb 05, 2013 6:47 pm
by rock5
I think maybe some offsets have changed. I'll look into it later.

Re: Getting QuestId from List

Posted: Wed Feb 06, 2013 12:33 am
by rock5
I see, they all have the same name. Similar to the Invaders bags quest.

I think the AcceptQuestByName compares the names so it probably always does the first one.

I think what you have to do is accept the quest first then see what id it has. I think getQuestStatus compares ids. Try

Code: Select all

      AcceptQuestByName("Auermo's Confession") -- Or use any of the 3 ids
      if getQuestStatus(423751) ~= "not accepted" then
         -- do chain
         __WPL:setWaypointIndex(__WPL:findWaypointTag("silverchain"));
      elseif getQuestStatus(423662) ~= "not accepted" then
         -- do wooden box
         __WPL:setWaypointIndex(__WPL:findWaypointTag("woodenbox"));
      elseif getQuestStatus(423859) ~= "not accepted" then
         -- do puppet
         player:sleep()
         __WPL:setWaypointIndex(__WPL:findWaypointTag("clothpuppet"));
      end  
Note: the last id was wrong.

Re: Getting QuestId from List

Posted: Wed Feb 06, 2013 5:40 pm
by dr-nuker
Thanks a lot.

Looks like it's working :)