• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • API Questions AreaTransition/QuestObjects/QuestState/Manual

    Discussion in 'Archives' started by 3.1415, May 2, 2014.

    1. 3.1415

      3.1415 New Member

      Joined:
      Oct 29, 2012
      Messages:
      16
      Likes Received:
      1
      Trophy Points:
      3
      I currenty try to make some Questroutines

      1) How can I check if the bot is in bossarea or not?
      area.Name.Equals is insufficient

      2) How can I check for green questobjects near me and interact with them?
      3) Is it possible to turn in questrewards?
      4) Is it pissible to check queststate?

      Is there any Manual with all possible methods/functions/conditions listed?
      I tryhard to get all of them but its annoying and timeconsuming as hell

      thx in advance
       
    2. pushedx

      pushedx Moderator Moderator Buddy Core Dev

      Joined:
      Sep 24, 2013
      Messages:
      4,252
      Likes Received:
      290
      Trophy Points:
      83
      You can't. You can only know if you are in "Upper Prisin", but there's no way to know which part of the map you are in, unless you keep track of all of the "local area transitions" that you take. If you were to start the bot in a random place, you'd not know where you were unless you explore and then find some identifying object that would let you know (which would not work for Vaal/Dom, since they are all Stairs).

      Quest objects are just normal objects whose rarity is set to quest. You have to process all objects and find the one you are looking for. Items that drop, can be easily identified by their metadata type "/QuestItems/" as per BaseItemTypes. For the other type of world objects that you interact with, you'd be best going through and using the object explorer to check the type/name. That's basically how the hacked in system works right now, it just checks for things like Tree Roots, Ancient Seal, etc... Now with the way objects work, you need to make sure they are targetable (IsTargetable), as they are always there spawned, but not usable if you don't have the quest state active or are done.

      The concept of turning in quest rewards is simply going to the NPC that requires the turn in. You just interact with the NPC, and you can close all their dialog windows that pop up. There is an API for talking to a NPC and choosing a quest dialog text to trigger the window you want, which is what is done for Sell, but this too is something you'd have to add manual support for to know the current text dialog you need to trigger to get the reward.. There's no API for figuring out which NPC the bot needs to go to, as that is something that probably will be coded in manually.

      For NPCs, there is a field you can use to help know when you need to talk to someone though. Npc.HasFloatingIcon will return true if the NPC has a floating icon above their head.

      Yes, this API support was added a few patches ago. You can do something like this to dump the current quest state:
      Code:
                      foreach (var quest in Dat.Quests)
                      {
                          var state = Dat.GetQuestState(quest, Difficulty.Normal);
                          if (state != null)
                              Log.DebugFormat(state.ToString());
                          else
                          {
                              Log.DebugFormat("No state for [{0}].", quest);
                          }
                      }
      
      Output format will look something like this. To get all known quest states, you can use this code:
      Code:
                      foreach (var questState in Dat.QuestStates)
                      {
                          Log.DebugFormat(questState.ToString());
                      }
      
      That output will look like this.

      Documentation is handled through intellisense. Use the Object Explorer after added a reference to Exilebuddy.exe to your class library project and look through the various Loki namespace/types. There aren't any guides as to how to put everything together though, and there most likely won't be for a while. It'll be much easier to just write a bunch of code examples of doing different things to give people ideas and go from there. However, that will come after the new beta is done, as people need something to work with rather than trying to recreate everything themselves (which is not even 100% possible with the current bot).
       

    Share This Page