Jump to content
  • A way to list all the world quests and the rewards?


    AudreyH
    • Version: All Product: Quester Type: Suggestion Status: Fixed

    It's to create a profle quest to do the world quests

    We need rewards, location, and the quest line to try to kill, or click on objects etc

    If it's possible :)

    PS Some quest world will not be possible as the dungeon quest ;)



    User Feedback

    Recommended Comments

    eeny

    Posted

    I have been looking into this, however im taking the "carpet bomb" approach... in legion when you go to a world quest zone you automatically have the quest ID in your list (without picking it up) and you can get WROBOT to pulse on that quest ID.

    Currently working on profiles that go along the lines of

    • Go to location1 XYZ (hopefully there is a daily quest there today)
    • IF has quest
      • Quest pulse
    • Go to location2 XYZ (repeat) 

    All i need to do is find all the available dailies, which by the looks of things may take some time... started with Aszuna of course.

    Droidz

    Posted

    I have found this profile: https://www.thebuddyforum.com/honorbuddy-forum/honorbuddy-profiles/267654-world-quests-wip.html

    Converted for WRobot:  TestWorldQuest.xml (not tested)

    Class code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using robotManager.Helpful;
    using wManager.Wow.Class;
    using wManager.Wow.Enums;
    using wManager.Wow.Helpers;
    
    
    
    public class WorldQuestData
    {
        public int ID;
        public string Name;
        public System.DateTime ExpireTime;
    }
    
    
    public class WorldQuestInfo : QuestClass
    {
        public WorldQuestInfo()
        {
            Name = "WorldQuestInfo";
        }
    
        static List<WorldQuestData> _cache = new List<WorldQuestData>();
        static internal bool _dirty = true;
        static internal bool _setup = false;
    
        static WorldQuestInfo()
        {
            Setup();
        }
    
        public static void Setup()
        {
            if (_setup)
                return;
    
            EventsLua.AttachEventLua(LuaEventsId.WORLD_MAP_UPDATE, m => WorldQuestMarkDirty());
            EventsLua.AttachEventLua(LuaEventsId.SUPER_TRACKED_QUEST_CHANGED, m => WorldQuestMarkDirty());
            EventsLua.AttachEventLua(LuaEventsId.WORLD_QUEST_COMPLETED_BY_SPELL, m => WorldQuestMarkDirty());
    
            UpdateWorldQuests();
            _setup = true;
        }
    
        public static void WorldQuestMarkDirty()
        {
            _dirty = true;
        }
    
        public static bool HasWorldQuest(int questid)
        {
            UpdateWorldQuests();
    
            var quest = _cache.FirstOrDefault(q => q.ID == questid);
    
            if (quest == null || quest.ExpireTime <= System.DateTime.UtcNow)
                return false;
            return true;
        }
    
        public static void UpdateWorldQuests()
        {
            if (!_dirty)
                return;
            _cache = new List<WorldQuestData>();
            
            int BrokenIslesMapArea = 1007;
    
            var numZones = Lua.LuaDoString<int>(string.Format("return C_MapCanvas.GetNumZones({0});", BrokenIslesMapArea));
    
            for (int i = 1; i < numZones; ++i)
            {
                var zoneID = Lua.LuaDoString<int>(string.Format("local zoneMapID, zoneName, zoneDepth, left, right, top, bottom = C_MapCanvas.GetZoneInfo({0}, {1}); return zoneMapID;", BrokenIslesMapArea, i));
                var zoneName = Lua.LuaDoString<string>(string.Format("local zoneMapID, zoneName, zoneDepth, left, right, top, bottom = C_MapCanvas.GetZoneInfo({0}, {1}); return zoneName;", BrokenIslesMapArea, i));
                var zoneDepth = Lua.LuaDoString<int>(string.Format("local zoneMapID, zoneName, zoneDepth, left, right, top, bottom = C_MapCanvas.GetZoneInfo({0}, {1}); return zoneDepth;", BrokenIslesMapArea, i));
    
                if (zoneDepth > 1) //Do not look at subzones
                {
                    Logging.WriteDebug(string.Format("[WorldQuestInfo] Ignoring {0} ({1}) as ZoneDepth > 1 ({2})", zoneID, zoneName, zoneDepth));
                    continue;
                }
    
                string toRun = string.Format(@"     local questids = '';
    
                        			                    local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID({0}, {1});
    
                                                        if taskInfo then
    				                                                    for i, info in ipairs(taskInfo) do
    					                                                    if HaveQuestData(info.questId) then
    						                                                    if QuestMapFrame_IsQuestWorldQuest(info.questId) then
                                                                                        questids = questids .. info.questId .. '#LUASEPARATOR#';
    							                                                    end
    						                                                    end
    					                                                    end
    				                                                    end
                                                       return questids;
                                                    ".Replace("#LUASEPARATOR#", Lua.ListSeparator), zoneID, BrokenIslesMapArea);
    
                var questids = Lua.LuaDoString<List<int>>(toRun);
    
                foreach (var questid in questids)
                {
                    if (questid <= 0)
                        continue;
    
                    //TimeLeft is in minutes
                    var TimeLeft = Lua.LuaDoString<int>(string.Format("return C_TaskQuest.GetQuestTimeLeftMinutes({0});", questid));
                    var QuestInfo = Lua.LuaDoString<string>(string.Format("return C_TaskQuest.GetQuestInfoByQuestID({0});", questid));
    
                    Logging.WriteDebug(string.Format("[WorldQuestInfo] WorldQuest {0} ({2}) active ({1}m left)", QuestInfo, TimeLeft, questid));
    
                    var data = new WorldQuestData();
                    data.ID = questid;
                    data.Name = QuestInfo;
                    data.ExpireTime = DateTime.UtcNow.AddMinutes(TimeLeft);
                    _cache.Add(data);
                }
            }
    
            _dirty = false;
        }
    
        public static bool IsWorldQuest(int questid)
        {
            string lua = string.Format("local tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex = GetQuestTagInfo({0}); return worldQuestType;", questid);
    
            var ret = Lua.LuaDoString<string>(lua);
    
            if (string.IsNullOrWhiteSpace(ret) || ret == "nil")
                return false;
            return true;
        }
    }

    Usage:

    bool hasWorldQuest = WorldQuestInfo.HasWorldQuest(int QuestId);
    
    bool isWorldQuest = WorldQuestInfo.IsWorldQuest(int questid);

     

    camelot10

    Posted

    got this error

     

    [E] 03:47:29 - [Quester] Cannot create instance of : WorldQuestData

    quickfixed that ( moved WorldQuestData ) inside class

    TestWorldQuest.xml

    AudreyH

    Posted

    No problem to convert single quest with only a mob to kill, but multiple objective world quest doesnt run, it loop on the first objective

    For multiple objective we have to go on the right place with the c# code, but after its a quest as others quest, and i think wrobot never complete the first objec when its done

    Here an example, i tried many many options but perhaps not the good one lol ( i make comparison with quest profile that run fine )

    Any help plz?

    A Tainted Vintage.xml

    AudreyH

    Posted

    For interact quest no problem, many mobs to kill no problem, only with a mini boss in a many lines quest there is a problem

    and found a bug in the C#

            for (int i = 1; i < numZones; ++i)

    its

            for (int i = 1; i <= numZones; ++i)

     

    AudreyH

    Posted

    and a Wrobot problem, i cant execute twice my script, i have to start wrobot again

     

    E] 14:45:30 - Compilator Error :
    c:\Users\xxxt\AppData\Local\Temp\xiyfmihj.0.cs(21,12) : error CS0433: Le type 'WorldQuestInfo' existe dans 'c:\Users\pat\AppData\Local\Temp\fqt1lqtd.dll' et dans 'c:\Users\xxxt\AppData\Local\Temp\wcaddpqe.dll'

     

    AudreyH

    Posted

    Also cant perform 2 or more LoadProfile in questordereditor, is it intended or a bug?



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...