Quantcast
Download
(42 Kb)
Download
Updated: 10/22/18 10:54 PM
Pictures
File Info
Compatibility:
Murkmire (4.2)
Updated:10/22/18 10:54 PM
Created:10/16/16 05:17 PM
Monthly downloads:196
Total downloads:2,351
Favorites:9
MD5:
4.2
Arch's Quest Refresh (Abandon Pledge Quests)
Version: 1.1.5
by: Architecture [More]
Lightweight addon used for easily abandoning your currently accepted undaunted pledge quests.

Custom Control



This allows you to easily drop old undaunted pledge quests in order to pick up new ones (without having to search through your quest journal). The abandon quest confirmation prompt will still behave as it does by default and thus you will be prompted to confirm the undaunted quest you wish to abandon.

You may also conveniently abandon a pledge quest using one of the following chat slash commands:
  • /apq
  • /abandonpledgequests
  • /questrefresh


Many Thanks!
- Added slash commands to easily abandon a pledge quest:
* /apq
* /abandonpledgequests
* /questrefresh
- Initial multiple language support (so it at least works with non-English "PLEDGE" full-text matching)
- Allow recursive abandonment (with option)
- Added option to display message if/once all pledge quests are abandoned
Optional Files (0)


Archived Files (15)
File Name
Version
Size
Author
Date
1.1.4
42kB
Architecture
05/22/18 10:59 PM
1.1.3
42kB
Architecture
05/22/17 08:43 PM
1.1.2
42kB
Architecture
03/18/17 03:58 PM
1.1.1
42kB
Architecture
03/18/17 03:55 PM
1.1.0
42kB
Architecture
03/18/17 03:54 PM
1.0.9
42kB
Architecture
03/18/17 03:46 PM
1.0.8
42kB
Architecture
03/18/17 03:41 PM
1.0.7
41kB
Architecture
03/18/17 02:25 PM
1.0.6
41kB
Architecture
02/27/17 10:04 PM
1.0.5
41kB
Architecture
02/27/17 10:02 PM
1.0.4
41kB
Architecture
02/26/17 04:18 PM
1.0.3
41kB
Architecture
02/16/17 12:07 AM
1.0.2
41kB
Architecture
10/19/16 04:33 AM
1.0.1
38kB
Architecture
10/16/16 05:22 PM
1.0.0
38kB
Architecture
10/16/16 05:17 PM


Post A Reply Comment Options
Unread 10/24/17, 01:26 PM  
Architecture
 
Architecture's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 63
Uploads: 8
Originally Posted by xNinja-PLZ
Is there a way to make this work with other quests ?
Possibly, but it depends on the type of quest for how I can setup rules / settings to allow different types of quests. What was a use case you had in mind?
Report comment to moderator  
Reply With Quote
Unread 09/23/17, 06:26 PM  
xNinja-PLZ
 
xNinja-PLZ's Avatar

Forum posts: 0
File comments: 2
Uploads: 0
Is there a way to make this work with other quests ?
Report comment to moderator  
Reply With Quote
Unread 03/18/17, 04:05 PM  
Architecture
 
Architecture's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 63
Uploads: 8
Made many new changes -- check out the changelog for details!
Report comment to moderator  
Reply With Quote
Unread 03/18/17, 03:07 PM  
Architecture
 
Architecture's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 63
Uploads: 8
Originally Posted by Baertram
Hi there,

just tested a bit more and changed your source code a bit:
Lua Code:
  1. -- Callback function for removed quest
  2. local function ArchQuestRefresh_OnRemoveQuest(eventCode, isCompleted, journalIndex, questName, zoneIndex, poiIndex, questID)
  3.     if ARCH_QUEST_REFRESH == nil then return false end
  4. d("[ArchQuestRefresh_OnRemoveQuest] isCompleted: " .. tostring(isCompleted) .. ", journalIndex: " .. tostring(journalIndex) .. ", questName: " .. tostring(questName) .. ", questID: " .. tostring(questID))
  5.     --If pledges quest got abandoned we need to go on with the next possible pledges quest
  6.     if string.find(string.upper(questName), pledgeQuestNameCheck) then
  7.         --UnRegister event callback function to realize if quest get's abandoned
  8.         EVENT_MANAGER:UnregisterForEvent("ArchQuestRefreshRemoveQuest", EVENT_QUEST_REMOVED)
  9.         ARCH_QUEST_REFRESH:Abandon()
  10.     end
  11. end
  12.  
  13. function ArchQuestRefresh:Abandon()
  14.     if self.sv ~= nil and self.sv.enabled then
  15.  
  16.         for i = 1, MAX_JOURNAL_QUESTS do
  17.             local questName = GetJournalQuestName(i)
  18.             local questType = GetJournalQuestType(i)
  19.             --d(questName)
  20.             --d(GetJournalQuestType(i))
  21.  
  22.             if questType == QUEST_TYPE_DUNGEON and string.find(string.upper(questName), pledgeQuestNameCheck) then
  23.                 --Register event callback function to realize if quest get's abandoned
  24.                 EVENT_MANAGER:RegisterForEvent("ArchQuestRefreshRemoveQuest", EVENT_QUEST_REMOVED, ArchQuestRefresh_OnRemoveQuest)
  25.                 QUEST_JOURNAL_MANAGER:ConfirmAbandonQuest(i)
  26.             end
  27.         end
  28.     end
  29.     --UnRegister event callback function to realize if quest get's abandoned
  30.     EVENT_MANAGER:UnregisterForEvent("ArchQuestRefreshRemoveQuest", EVENT_QUEST_REMOVED)
  31. end


After you press the keybind or chat command:
This way one will get the popup to abandon a pledges quest.
After pressing "YES" the event EVENT_QUEST_REMOVED will be triggered and the callback function will just try to abandon the next quest.

This will not work if you press "NO" in the abandon quest dialog though as the event will not be triggered!
For this you'd need to:

-Put the not abandoned questname or unique questID on a "whitelist" and check against this in your function ArchQuestRefresh:Abandon, so it won't be tried to abandon again the next time as the user already said "NO".
-The keybind/chat command should reset the whitelist before the abandon function is called!
-You'd need to hook into the quest dialog and chekc if the "NO" button was used (by keybind OR mouse) so you'd need to find the NO button'S callback function and pray that it is global hookable
-After the user pressed the "NO" button just call the abandon quest function again WITHOUT resetting the whitelist
Hey Baertram,

I am adding this in right now -- I will put in a setting option as well (default to this behavior) Posting update shortly.

Thank you for the contribution and feedback!
Report comment to moderator  
Reply With Quote
Unread 03/18/17, 02:43 PM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1800
File comments: 1947
Uploads: 48
Hi there,

just tested a bit more and changed your source code a bit:
Lua Code:
  1. -- Callback function for removed quest
  2. local function ArchQuestRefresh_OnRemoveQuest(eventCode, isCompleted, journalIndex, questName, zoneIndex, poiIndex, questID)
  3.     if ARCH_QUEST_REFRESH == nil then return false end
  4. d("[ArchQuestRefresh_OnRemoveQuest] isCompleted: " .. tostring(isCompleted) .. ", journalIndex: " .. tostring(journalIndex) .. ", questName: " .. tostring(questName) .. ", questID: " .. tostring(questID))
  5.     --If pledges quest got abandoned we need to go on with the next possible pledges quest
  6.     if string.find(string.upper(questName), pledgeQuestNameCheck) then
  7.         --UnRegister event callback function to realize if quest get's abandoned
  8.         EVENT_MANAGER:UnregisterForEvent("ArchQuestRefreshRemoveQuest", EVENT_QUEST_REMOVED)
  9.         ARCH_QUEST_REFRESH:Abandon()
  10.     end
  11. end
  12.  
  13. function ArchQuestRefresh:Abandon()
  14.     if self.sv ~= nil and self.sv.enabled then
  15.  
  16.         for i = 1, MAX_JOURNAL_QUESTS do
  17.             local questName = GetJournalQuestName(i)
  18.             local questType = GetJournalQuestType(i)
  19.             --d(questName)
  20.             --d(GetJournalQuestType(i))
  21.  
  22.             if questType == QUEST_TYPE_DUNGEON and string.find(string.upper(questName), pledgeQuestNameCheck) then
  23.                 --Register event callback function to realize if quest get's abandoned
  24.                 EVENT_MANAGER:RegisterForEvent("ArchQuestRefreshRemoveQuest", EVENT_QUEST_REMOVED, ArchQuestRefresh_OnRemoveQuest)
  25.                 QUEST_JOURNAL_MANAGER:ConfirmAbandonQuest(i)
  26.             end
  27.         end
  28.     end
  29.     --UnRegister event callback function to realize if quest get's abandoned
  30.     EVENT_MANAGER:UnregisterForEvent("ArchQuestRefreshRemoveQuest", EVENT_QUEST_REMOVED)
  31. end


After you press the keybind or chat command:
This way one will get the popup to abandon a pledges quest.
After pressing "YES" the event EVENT_QUEST_REMOVED will be triggered and the callback function will just try to abandon the next quest.

This will not work if you press "NO" in the abandon quest dialog though as the event will not be triggered!
For this you'd need to:

-Put the not abandoned questname or unique questID on a "whitelist" and check against this in your function ArchQuestRefresh:Abandon, so it won't be tried to abandon again the next time as the user already said "NO".
-The keybind/chat command should reset the whitelist before the abandon function is called!
-You'd need to hook into the quest dialog and chekc if the "NO" button was used (by keybind OR mouse) so you'd need to find the NO button'S callback function and pray that it is global hookable
-After the user pressed the "NO" button just call the abandon quest function again WITHOUT resetting the whitelist
Report comment to moderator  
Reply With Quote
Unread 03/05/17, 09:19 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1800
File comments: 1947
Uploads: 48
Hi there,

your addon is not working with other clients language then english :-(

Please make it multi language supportable by not using a constant value for the quest name "pledge" but a variable that will use the client's language to determine the correct quest name.

Example, something like this:
Lua Code:
  1. local questLang = GetCVar("language.2") -- contains "en" or "de" or "fr" now
  2. local languageToPledgeQuestName = {
  3.     ["en"] = "PLEDGE",
  4.     ["de"] = "GELÍBNIS",
  5.     ["fr"] = "SERMENT",
  6. }
  7. local pledgeQuestNameCheck = languageToPledgeQuestName[questLang] or "PLEDGE"
  8.  
  9. function ArchQuestRefresh:Abandon()
  10.     if self.sv ~= nil and self.sv.enabled then
  11.         for i = 1, MAX_JOURNAL_QUESTS do
  12.             local questName = GetJournalQuestName(i)
  13.             local questType = GetJournalQuestType(i)
  14.             --d(questName)
  15.             --d(GetJournalQuestType(i))
  16.        
  17.             if questType == QUEST_TYPE_DUNGEON and string.find(string.upper(questName), pledgeQuestNameCheck) then
  18.                 QUEST_JOURNAL_MANAGER:ConfirmAbandonQuest(i)
  19.             end
  20.         end
  21.     end
  22. end

Attention:
be sure to change the lua file's encoding to UTF-8 w/o BOM in order to allow Umlauts in the names (like Gel÷bnis).

Maybe ask for some other languages as Japanese and Russian, Portugues, Spanish, Italian and maybe others are possible too.

Another question:
If I use the chat command or keybinding it will only show a popup if I want to abort the first found pledges quest and after this it is not automatically showing the next quests (I got 3 old ones).
I have to use the keybind/chat command 3 times.

Is this intended to work this way?
Maybe your loop over the quests is aborted by the popup asking to abandon the quest, and if I say yes or no in this popup your loop needs to start again (excluding the before found quests where I have chosen "no" in the popup!)?
Last edited by Baertram : 03/05/17 at 09:41 AM.
Report comment to moderator  
Reply With Quote
Unread 02/27/17, 10:05 PM  
Architecture
 
Architecture's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 63
Uploads: 8
Originally Posted by Baertram
Nice idea, this is a helping hand!

Is this only working by help of a keybind (I'm not having so much keybindings left^^)?
Would you mind adding a short slash command like

Code:
/apq
to abandon the pledge quests too?

Something like this:
Lua Code:
  1. --Register the slash commands
  2. --Put this function call at the end of your function ArchQuestRefresh:Initialize(addonName)
  3. local function RegisterSlashCommands()
  4.     -- Register slash commands
  5.     SLASH_COMMANDS["/apq"]                         = ARCH_QUEST_REFRESH:Abandon()
  6.     SLASH_COMMANDS["/abandonpledgequests"] = ARCH_QUEST_REFRESH:Abandon()
  7. end

Many thanks
Hey Baertram!

Thank you for the feedback, I have added the slash commands

Cheers,
Report comment to moderator  
Reply With Quote
Unread 02/27/17, 01:16 AM  
KiriX
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 53
Uploads: 3
Make multi-language support! =)
__________________
Sorry for my English =)
Report comment to moderator  
Reply With Quote
Unread 02/26/17, 04:33 PM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1800
File comments: 1947
Uploads: 48
Nice idea, this is a helping hand!

Is this only working by help of a keybind (I'm not having so much keybindings left^^)?
Would you mind adding a short slash command like

Code:
/apq
to abandon the pledge quests too?

Something like this:
Lua Code:
  1. --Register the slash commands
  2. --Put this function call at the end of your function ArchQuestRefresh:Initialize(addonName)
  3. local function RegisterSlashCommands()
  4.     -- Register slash commands
  5.     SLASH_COMMANDS["/apq"]                         = ARCH_QUEST_REFRESH:Abandon()
  6.     SLASH_COMMANDS["/abandonpledgequests"] = ARCH_QUEST_REFRESH:Abandon()
  7. end

Many thanks
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: